|
|
@ -194,8 +194,9 @@ |
|
|
|
:width="600" |
|
|
|
:maxHeight="900" |
|
|
|
:style="{height:'600px'}" |
|
|
|
:key="dialogFormKey" |
|
|
|
> |
|
|
|
<el-form ref="fileDialogUploadRef" :model="fileDialogUploadData" :key="dialogFormKey"> |
|
|
|
<el-form ref="fileDialogUploadRef" :model="fileDialogUploadData" > |
|
|
|
<el-form-item label="文件选择"> |
|
|
|
<UploadFile v-model="fileDialogUploadData.filePathList" :limit="20" /> |
|
|
|
</el-form-item> |
|
|
@ -220,6 +221,8 @@ import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|
|
|
import { useUserStoreWithOut } from '@/store/modules/user' |
|
|
|
import * as fileApi from '@/api/infra/file' |
|
|
|
import { el } from 'element-plus/es/locale' |
|
|
|
|
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
|
|
|
|
@ -242,6 +245,7 @@ const dialogUploadNumber = ref() |
|
|
|
const dialogUploadBusiCode = ref() |
|
|
|
const dialogFormKey = ref(0) |
|
|
|
const milestoneUpdateKey = ref(0) |
|
|
|
const fileDialogUploadRef = ref() |
|
|
|
const props = defineProps({ |
|
|
|
// 标签参数 |
|
|
|
tabs: { |
|
|
@ -472,6 +476,9 @@ const change = (item, index) => { |
|
|
|
subIndex.value = 'A' |
|
|
|
formKey.value += 1 |
|
|
|
getImage() |
|
|
|
} else if (item.prop == 'Milestone') { |
|
|
|
imageParmas.value.funcCode = props.milestoneFuncCode |
|
|
|
getImage() |
|
|
|
} else { |
|
|
|
imageParmas.value.funcCode = '' |
|
|
|
imageParmas.value.fileBusiType = '' |
|
|
@ -591,23 +598,61 @@ defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|
|
|
// 获取图片详情 |
|
|
|
const formKey = ref(0) |
|
|
|
const getImage = () => { |
|
|
|
props |
|
|
|
fileApi.selectList().then((response) => { |
|
|
|
props |
|
|
|
.getImageApi({ |
|
|
|
number: masterParmas.value.number, |
|
|
|
funcCode: imageParmas.value.funcCode, |
|
|
|
fileBusiType: imageParmas.value.fileBusiType |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
nextTick(() => { |
|
|
|
if (imageParmas.value.funcCode == 'device_mould_picture') { |
|
|
|
imageFormData.value.filePathList = res |
|
|
|
} else { |
|
|
|
console.log(444,res) |
|
|
|
fileFormData.value.filePathList = res |
|
|
|
formKey.value += 1 |
|
|
|
} |
|
|
|
nextTick(() => { |
|
|
|
if (imageParmas.value.funcCode == 'device_mould_picture') { |
|
|
|
imageFormData.value.filePathList = res |
|
|
|
} else { |
|
|
|
console.log(444,res) |
|
|
|
fileFormData.value.filePathList = res.map(item=>{ |
|
|
|
response.forEach(element=>{ |
|
|
|
if(item.url == element.url){ |
|
|
|
item.name = element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
return item |
|
|
|
}) |
|
|
|
formKey.value += 1 |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const getImageDialog = () => { |
|
|
|
fileApi.selectList().then((response) => { |
|
|
|
props |
|
|
|
.getImageApi({ |
|
|
|
number: masterParmas.value.number, |
|
|
|
funcCode: imageParmas.value.funcCode, |
|
|
|
fileBusiType: imageParmas.value.fileBusiType |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
nextTick(() => { |
|
|
|
if (imageParmas.value.funcCode == 'device_mould_picture') { |
|
|
|
imageFormData.value.filePathList = res |
|
|
|
} else { |
|
|
|
console.log(444,res) |
|
|
|
fileDialogUploadData.value.filePathList = res.map(item=>{ |
|
|
|
response.forEach(element=>{ |
|
|
|
if(item.url == element.url){ |
|
|
|
item.name = element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
return item |
|
|
|
}) |
|
|
|
formKey.value += 1 |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const tableObjectRef = ref() |
|
|
@ -771,7 +816,6 @@ const uploadImage = async () => { |
|
|
|
// if (!elForm) return |
|
|
|
// const valid = await elForm.validate() |
|
|
|
// if (!valid) return |
|
|
|
imageFormData |
|
|
|
let data = { |
|
|
|
number: masterParmas.value.number, |
|
|
|
filePathList: imageFormData.value.filePathList.map((item) => item.url), |
|
|
@ -916,7 +960,7 @@ const submitDialogForm = async (type, row) => { |
|
|
|
} |
|
|
|
|
|
|
|
function openDialogUpload(row) { |
|
|
|
dialogUploadVisible.value = true |
|
|
|
// dialogUploadVisible.value = true |
|
|
|
getDialogUpload(row) |
|
|
|
} |
|
|
|
|
|
|
@ -929,13 +973,27 @@ const openDialogForm = async (type: string, row?: number) => { |
|
|
|
const getDialogUpload = (row) => { |
|
|
|
dialogUploadNumber.value = row.number |
|
|
|
dialogUploadBusiCode.value = row.milestoneStage |
|
|
|
masterParmas.value.number = row.number, |
|
|
|
imageParmas.value.fileBusiType = row.milestoneStage |
|
|
|
props.getImageApi({ |
|
|
|
number: row.number, |
|
|
|
funcCode: props.milestoneFuncCode |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
fileDialogUploadData.value.filePathList = res |
|
|
|
dialogFormKey.value += 1 |
|
|
|
fileApi.selectList().then(response=>{ |
|
|
|
fileDialogUploadData.value.filePathList = res.map(item=>{ |
|
|
|
response.forEach(element=>{ |
|
|
|
if(item.url == element.url){ |
|
|
|
item.name = element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
return item |
|
|
|
}) |
|
|
|
dialogUploadVisible.value = true |
|
|
|
dialogFormKey.value += 1 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
@ -949,7 +1007,7 @@ function dialogUploadFile() { |
|
|
|
props.uploadImage(data).then((res) => { |
|
|
|
message.success('修改成功') |
|
|
|
getImage() |
|
|
|
dialogUploadVisible.value = false |
|
|
|
// dialogUploadVisible.value = false |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|