|
@ -149,26 +149,65 @@ const buttonTableClick = async (val, row) => { |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
|
|
// debugger |
|
|
|
|
|
console.log(row) |
|
|
|
|
|
if(row && row.videoAddress.trim()){ |
|
|
|
|
|
row.filePathList = row.videoAddress.split(',') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (row && row.filePathList && row.filePathList.length > 0) { |
|
|
|
|
|
row.filePathListView = row.filePathList.map((item) => { |
|
|
|
|
|
return { |
|
|
|
|
|
name: item, |
|
|
|
|
|
url: item |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType,data) => { |
|
|
const formsSuccess = async (formType,data) => { |
|
|
var isHave =InspectionMethod.allSchemas.formSchema.some(function (item) { |
|
|
// data.filePathList = [] |
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
// data.tmp = [] |
|
|
}); |
|
|
data.filePathList = [] |
|
|
if(isHave){ |
|
|
for (let i = 0; i < data.filePathListView.length; i++) { |
|
|
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|
|
data.filePathList.push(data.filePathListView[i].url) |
|
|
message.error('失效时间要大于生效时间') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
if(data.filePathList.length>0){ |
|
|
|
|
|
data.videoAddress = data.filePathList.join(',') |
|
|
} |
|
|
} |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
// debugger |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
// 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'; |
|
|
|
|
|
// }); |
|
|
|
|
|
// if(isHave){ |
|
|
|
|
|
// if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|
|
|
|
|
// message.error('失效时间要大于生效时间') |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if(data.activeTime==0)data.activeTime = null; |
|
|
|
|
|
// if(data.expireTime==0)data.expireTime = null; |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
|
|
|
|
|
|
await InspectionMethodApi.createInspectionMethod(data) |
|
|
await InspectionMethodApi.createInspectionMethod(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
// debugger |
|
|
await InspectionMethodApi.updateInspectionMethod(data) |
|
|
await InspectionMethodApi.updateInspectionMethod(data) |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
} |
|
|
} |
|
|