文件上传修改

This commit is contained in:
jia 2023-12-22 18:25:00 +08:00
parent 227e8ccf0c
commit 661d4943f1
51 changed files with 410 additions and 663 deletions

View File

@ -128,19 +128,13 @@ const setFormData = async (data: Record<any, any>) => {
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
}

View File

@ -226,19 +226,13 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
@ -264,7 +258,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -219,6 +219,7 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
const showDialog2 = ref(false)
const formDataannex = reactive([])
const customEvent2 = (e: any) => {
formData.project_id = e.id;

View File

@ -212,19 +212,13 @@ const setFormData = async (data: Record<any, any>) => {
Object.assign(jobs, res)
})
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
// console.log(jobs)
project_name.value = data.project_name
@ -253,7 +247,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -157,19 +157,13 @@ const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}

View File

@ -194,7 +194,7 @@ const formData = reactive({
name: '',
description: '',
notes: '',
annex: [],
annex: '',
status: '',
})
@ -210,19 +210,13 @@ const setFormData = async (data: Record<any, any>) => {
custom_name.value = data.custom.name
project_name.value = data.project.name
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
@ -246,7 +240,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -200,19 +200,13 @@ const setFormData = async (data: Record<any, any>) => {
Object.assign(jobs, res)
})
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
project_name.value = data.project_name
custom_name.value = data.custom_name
@ -239,7 +233,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -188,19 +188,13 @@ const setFormData = async (data: Record<any, any>) => {
Object.assign(jobs, res)
})
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
console.log(jobs)
project_name.value = data.project_name
@ -229,7 +223,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -146,19 +146,13 @@ const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}

View File

@ -333,19 +333,13 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
for (const key in formData) {

View File

@ -321,20 +321,16 @@ const setFormData = async (data: Record<any, any>) => {
}
}
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
//@ts-ignore
data.project_content && (formData.project_content = String(data.project_content).split(","))
//@ts-ignore
@ -353,8 +349,9 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, project_content: formData.project_content.join(",") }

View File

@ -242,19 +242,13 @@ const setFormData = async (data: Record<any, any>) => {
Object.assign(jobs, res)
})
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
console.log(jobs)
project_name.value = data.project_name
@ -283,7 +277,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -201,21 +201,16 @@ const setFormData = async (data: Record<any, any>) => {
custom_name.value = data.custom_name
project_name.value = data.project_name
project_code.value = data.project_code
if (data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
}
}
for (const key in formData) {
@ -249,7 +244,7 @@ const validatephone = (e: any) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = formDataannex.map((item) => item.uri).toString()
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -147,19 +147,13 @@ const formRules = reactive<any>({
const setFormData = async (data: Record<any, any>) => {
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
for (const key in formData) {
@ -184,7 +178,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -380,7 +380,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -199,8 +199,8 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
@ -208,13 +208,8 @@ const setFormData = async (data: Record<any, any>) => {
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -243,7 +238,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -223,21 +223,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -266,7 +261,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -276,21 +276,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -319,7 +314,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -180,21 +180,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -223,7 +218,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -200,7 +200,7 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
@ -208,13 +208,8 @@ const setFormData = async (data: Record<any, any>) => {
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -243,7 +238,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -198,21 +198,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -241,7 +236,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -182,21 +182,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -224,7 +219,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -187,21 +187,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
project_name.value = data.project_name;
for (const key in formData) {
@ -229,7 +224,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -261,19 +261,13 @@ const handleDelete = (row: any) => {
//
const setFormData = async (data: Record<any, any>) => {
if (data.annex && data.annex.length > 0) {
if (data.annex.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
customer_name.value = data.custom.name
for (const key in formData) {
@ -320,7 +314,7 @@ const isMobileNumber = (rule: any, value: string | number | any[], callback: (ar
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }

View File

@ -228,21 +228,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -271,7 +266,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -281,21 +281,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -322,7 +317,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -192,21 +192,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
if (data.dept_id) {
getlist1(data.dept_id
)
@ -235,7 +230,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -192,21 +192,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
if (data.dept_id) {
getlist1(data.dept_id
)
@ -235,7 +230,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -159,21 +159,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
@ -196,7 +191,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -269,20 +269,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
@ -312,7 +308,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -260,21 +260,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -303,7 +298,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -216,21 +216,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
if (data.dept_id) {
getlist1(data.dept_id
)
@ -259,7 +254,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -192,21 +192,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
if (data.dept_id) {
getlist1(data.dept_id
)
@ -235,7 +230,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -104,21 +104,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -175,21 +175,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -217,7 +212,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -196,21 +196,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
if (data.dept_id) {
getlist1(data.dept_id
@ -237,7 +232,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -122,21 +122,16 @@ const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -202,21 +202,16 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.file.split(',').map((item: any, index: any) => {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
}
for (const key in formData) {
@ -245,7 +240,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
formData.file = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()

View File

@ -343,7 +343,6 @@ const setFormData = async (data: Record<any, any>) => {
}
}
if (data.annex && data.annex.length > 0) {
if (data.file.includes(",")) {
const arry1 = data.annex.split(',').map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
@ -351,12 +350,8 @@ const setFormData = async (data: Record<any, any>) => {
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
}
@ -376,7 +371,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item) => item.uri).toString()
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
}
await formRef.value?.validate()
const data = { ...formData, }