|
|
@ -42,6 +42,13 @@ |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="formsSuccess" |
|
|
|
:sumFormDataByForm ="(formRef,formModel)=>{ |
|
|
|
console.log(formModel) |
|
|
|
const {videoAddress} = formModel |
|
|
|
formRef.value.setValues({ |
|
|
|
installPackageUrl:videoAddress |
|
|
|
}) |
|
|
|
}" |
|
|
|
:rules="InspectionMethodRules" |
|
|
|
:formAllSchemas="InspectionMethod.allSchemas" |
|
|
|
:apiUpdate="InspectionMethodApi.updateInspectionMethod" |
|
|
@ -163,6 +170,18 @@ const openForm = (type: string, row?: any) => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if(type=='create'){ |
|
|
|
const currentTime = new Date().getTime() |
|
|
|
const fileId = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='fileId') |
|
|
|
const uploadFile = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='videoAddress') |
|
|
|
if(fileId){ |
|
|
|
fileId['value'] = currentTime |
|
|
|
} |
|
|
|
if(uploadFile){ |
|
|
|
uploadFile['componentProps']['upData']['tableId'] = currentTime |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
@ -170,27 +189,31 @@ const openForm = (type: string, row?: any) => { |
|
|
|
const formsSuccess = async (formType,data) => { |
|
|
|
// data.filePathList = [] |
|
|
|
// data.tmp = [] |
|
|
|
data.filePathList = [] |
|
|
|
for (let i = 0; i < data.filePathListView.length; i++) { |
|
|
|
data.filePathList.push(data.filePathListView[i].url) |
|
|
|
} |
|
|
|
if(data.filePathList.length>0){ |
|
|
|
data.videoAddress = data.filePathList.join(',') |
|
|
|
} |
|
|
|
console.log(data) |
|
|
|
// for (let i = 0; i < data.filePathListView.length; i++) { |
|
|
|
// data.filePathList.push(data.filePathListView[i].url) |
|
|
|
// } |
|
|
|
// data.filePathList = [] |
|
|
|
// for (let i = 0; i < data.filePathListView.length; i++) { |
|
|
|
// data.filePathList.push(data.filePathListView[i].url) |
|
|
|
// } |
|
|
|
// if(data.filePathList.length>0){ |
|
|
|
// data.videoAddress = data.filePathList.join(',') |
|
|
|
// } |
|
|
|
// debugger |
|
|
|
// if(data.filePathListView instanceof Array){ |
|
|
|
// for(let i=0; i<data.filePathListView.length; i++){ |
|
|
|
// data.tmp.push(data.filePathListView[i].url) |
|
|
|
// } |
|
|
|
// data.videoAddress = data.tmp.join(',') |
|
|
|
// }else{ |
|
|
|
// data.videoAddress = data.filePathListView |
|
|
|
// data.filePathListView = data.filePathListView.split(',').map(url=>{return {url}}) |
|
|
|
// } |
|
|
|
// for (let i = 0; i < data.filePathListView.length; i++) { |
|
|
|
// data.filePathList.push(data.filePathListView[i]) |
|
|
|
// } |
|
|
|
// console.log(1111,data) |
|
|
|
// if(data.filePathListView instanceof Array){ |
|
|
|
// for(let i=0; i<data.filePathListView.length; i++){ |
|
|
|
// data.tmp.push(data.filePathListView[i].url) |
|
|
|
// } |
|
|
|
// data.videoAddress = data.tmp.join(',') |
|
|
|
// }else{ |
|
|
|
// data.videoAddress = data.filePathListView |
|
|
|
// data.filePathListView = data.filePathListView.split(',').map(url=>{return {url}}) |
|
|
|
// } |
|
|
|
// for (let i = 0; i < data.filePathListView.length; i++) { |
|
|
|
// data.filePathList.push(data.filePathListView[i]) |
|
|
|
// } |
|
|
|
// console.log(1111,data) |
|
|
|
// var isHave =InspectionMethod.allSchemas.formSchema.some(function (item) { |
|
|
|
// return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
|
// }); |
|
|
@ -204,6 +227,7 @@ const formsSuccess = async (formType,data) => { |
|
|
|
// if(data.expireTime==0)data.expireTime = null; |
|
|
|
if (formType === 'create') { |
|
|
|
|
|
|
|
delete data['uploadFile'] |
|
|
|
await InspectionMethodApi.createInspectionMethod(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|