Browse Source

Merge remote-tracking branch 'origin/master_hella' into master_hella

master_hella_20240701
gaojs 8 months ago
parent
commit
3724f9eed1
  1. 8
      src/components/UploadFile/src/UploadFile.vue
  2. 15
      src/views/system/systemInstallPackage/index.vue
  3. 27
      src/views/system/systemInstallPackage/systemInstallPackage.data.ts

8
src/components/UploadFile/src/UploadFile.vue

@ -129,11 +129,11 @@ const excelUploadError: UploadProps['onError'] = (): void => {
}
//
const handleRemove = (file) => {
const findex = fileList.value.map((f) => f.name).indexOf(file.name)
if (findex > -1) {
fileList.value.splice(findex, 1)
// const findex = fileList.value.map((f) => f.name).indexOf(file.name)
// if (findex > -1) {
// fileList.value.splice(findex, 1)
emit('update:modelValue', listToString(fileList.value))
}
// }
}
const handlePreview: UploadProps['onPreview'] = (uploadFile) => {
console.log(uploadFile)

15
src/views/system/systemInstallPackage/index.vue

@ -41,6 +41,13 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
:sumFormDataByForm ="(formRef,formModel)=>{
console.log(formModel)
const {uploadFile} = formModel
formRef.value.setValues({
installPackageUrl:uploadFile
})
}"
@success="formsSuccess"
:rules="SystemInstallPackageRules"
:formAllSchemas="SystemInstallPackage.allSchemas"
@ -131,12 +138,20 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if('create'==type){
const currentTime = new Date().getTime()
const fileId = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='fileId')
fileId['value'] = currentTime
const uploadFile = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='uploadFile')
uploadFile['componentProps']['upData']['tableId'] = currentTime
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
if (formType === 'create') {
delete data['uploadFile']
await SystemInstallPackageApi.createSystemInstallPackage(data)
message.success(t('common.createSuccess'))
} else {

27
src/views/system/systemInstallPackage/systemInstallPackage.data.ts

@ -25,6 +25,11 @@ export const SystemInstallPackage = useCrudSchemas(reactive<CrudSchema[]>([
label: '安装路径',
field: 'installPackageUrl',
sort: 'custom',
form: {
componentProps: {
disabled: true
},
}
},
{
label: '是否强制更新',
@ -53,14 +58,34 @@ export const SystemInstallPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '附件id',
field: 'fileId',
isForm:false,
sort: 'custom',
form: {
componentProps: {
disabled: true
},
value:'',
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '上传附件',
field: 'uploadFile',
sort: 'custom',
form: {
component: 'UploadFile',
componentProps: {
upData:{
tableId: '',
tableName: ''
},
limit:1
}
},
},
{
label: '创建时间',
field: 'createTime',

Loading…
Cancel
Save