文件上传修改

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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
for (const key in formData) {

View File

@ -321,19 +321,15 @@ 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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
//@ts-ignore
data.project_content && (formData.project_content = String(data.project_content).split(","))
@ -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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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,20 +201,15 @@ 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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
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)
}
}
@ -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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -199,21 +199,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) => {
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 arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}
@ -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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -223,20 +223,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -104,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -104,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -276,20 +276,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -180,20 +180,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -200,20 +200,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.split(',').map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -198,20 +198,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -104,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -104,20 +104,15 @@ 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)
}
}
}

View File

@ -182,20 +182,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -187,20 +187,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
project_name.value = data.project_name;
@ -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) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
}
const arry1 = data.annex.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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,20 +228,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +281,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +192,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
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,20 +192,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
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,20 +159,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
for (const key in formData) {
@ -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) => {
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 arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +260,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +216,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
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,20 +192,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
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,20 +104,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -175,20 +175,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,20 +196,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
if (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,20 +122,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}

View File

@ -202,20 +202,15 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.file[0] }]
Object.assign(formDataannex, arry1)
console.log(formDataannex)
}
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
@ -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,19 +343,14 @@ 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}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
} else {
const arry1 = [{ name: `文件1`, uri: data.annex }]
Object.assign(formDataannex, arry1)
const arry1 = data.annex.split(',').map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
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, }