|
@ -25,7 +25,7 @@ |
|
|
/> |
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<Tabs :tabsList="tabsList" :current="current" @change="change" :key="tabsKay"/> |
|
|
<Tabs :tabsList="tabsList" :current="current" @change="change" :key="tabsKay" /> |
|
|
<div class="flex"> |
|
|
<div class="flex"> |
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<ContentWrap class="w-[100%]"> |
|
|
<ContentWrap class="w-[100%]"> |
|
@ -39,37 +39,30 @@ |
|
|
@searchFormClick="searchFormClick" |
|
|
@searchFormClick="searchFormClick" |
|
|
:allSchemas="detailAllSchemas" |
|
|
:allSchemas="detailAllSchemas" |
|
|
/> |
|
|
/> |
|
|
<!-- 默认单表展现 --> |
|
|
|
|
|
<!-- <Descriptions |
|
|
|
|
|
v-if="isBasic && !tabsExtend" |
|
|
|
|
|
:data="detailData" |
|
|
|
|
|
:schema="allSchemas.detailSchema" |
|
|
|
|
|
:columns="2" |
|
|
|
|
|
/> --> |
|
|
|
|
|
<div v-if="isBasic && tabsExtend == 1"> |
|
|
<div v-if="isBasic && tabsExtend == 1"> |
|
|
<Form |
|
|
<el-form ref="imageFormRef" :model="imageFormData" :key="formKey"> |
|
|
ref="imageFormRef" |
|
|
<el-form-item label="文件上传"> |
|
|
:rules="upImageRules" |
|
|
<UploadImgs v-model="imageFormData.filePathList" /> |
|
|
:schema="imageFormSchemas" |
|
|
</el-form-item> |
|
|
/> |
|
|
</el-form> |
|
|
<el-button type="primary" @click="uploadImage">点击修改</el-button> |
|
|
<el-button type="primary" @click="uploadImage">点击修改</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<el-tabs type="border-card" class="demo-tabs" v-model="subIndex" v-if="isBasic && tabsExtend == 2" @tab-change="handleTabsChange"> |
|
|
<div v-if="isBasic && tabsExtend == 2"> |
|
|
<el-tab-pane |
|
|
<el-tabs class="demo-tabs" v-model="imageParmas.fileBusiType" @tab-change="handleTabsChange"> |
|
|
v-for="(item,index) in subTabsList" |
|
|
<el-tab-pane |
|
|
:key="item.value" |
|
|
v-for="item in subTabsList" |
|
|
:label="item.label" |
|
|
:key="item.value" |
|
|
:name="item.value" |
|
|
:label="item.label" |
|
|
> |
|
|
:name="item.value" |
|
|
<Form |
|
|
/> |
|
|
:ref="'fileFormRef'" |
|
|
</el-tabs> |
|
|
:rules="upFileRules" |
|
|
<el-form ref="fileFormRef" :model="fileFormData" :key="formKey"> |
|
|
:schema="fileFormSchemas" |
|
|
<el-form-item label="文件上传"> |
|
|
:is-col="true" |
|
|
<UploadFile v-model="fileFormData.filePathList" :limit="20" /> |
|
|
/> |
|
|
</el-form-item> |
|
|
<el-button type="primary" @click="uploadFile(index)">点击修改</el-button> |
|
|
</el-form> |
|
|
</el-tab-pane> |
|
|
<el-button type="primary" @click="uploadFile">点击修改</el-button> |
|
|
</el-tabs> |
|
|
</div> |
|
|
<!-- 单表切换tabs 展现table --> |
|
|
<!-- 单表切换tabs 展现table --> |
|
|
<Table |
|
|
<Table |
|
|
v-if="isBasic && tabsExtend == 3" |
|
|
v-if="isBasic && tabsExtend == 3" |
|
@ -157,9 +150,11 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|
|
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|
|
import { getCurrentInstance} from 'vue' |
|
|
import { getCurrentInstance } from 'vue' |
|
|
import { get } from 'http' |
|
|
import { get } from 'http' |
|
|
|
|
|
import { findIndex } from '@/utils' |
|
|
const { proxy } = getCurrentInstance() |
|
|
const { proxy } = getCurrentInstance() |
|
|
|
|
|
const changeFile = () => {} |
|
|
|
|
|
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
defineOptions({ name: 'Detail' }) |
|
|
|
|
|
|
|
@ -295,33 +290,12 @@ const props = defineProps({ |
|
|
required: false, |
|
|
required: false, |
|
|
default: false |
|
|
default: false |
|
|
}, |
|
|
}, |
|
|
// 详情上传图片 |
|
|
|
|
|
upImageRules: { |
|
|
|
|
|
type: Array, |
|
|
|
|
|
required: false, |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
|
|
|
imageFormAllSchemas: { |
|
|
|
|
|
type: Object, |
|
|
|
|
|
required: true, |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
|
|
|
// 详情上传文件 |
|
|
// 详情上传文件 |
|
|
upFileRules: { |
|
|
upFileRules: { |
|
|
type: Array, |
|
|
type: Array, |
|
|
required: false, |
|
|
required: false, |
|
|
default: null |
|
|
default: null |
|
|
}, |
|
|
}, |
|
|
fileFormAllSchemas: { |
|
|
|
|
|
type: Object, |
|
|
|
|
|
required: true, |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
|
|
|
subIndex: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
required: false, |
|
|
|
|
|
default: 'A' |
|
|
|
|
|
}, |
|
|
|
|
|
// 获取图片详情方法 |
|
|
// 获取图片详情方法 |
|
|
getImageApi: { |
|
|
getImageApi: { |
|
|
type: Function, |
|
|
type: Function, |
|
@ -333,21 +307,24 @@ const props = defineProps({ |
|
|
type: Function, |
|
|
type: Function, |
|
|
required: false, |
|
|
required: false, |
|
|
default: null |
|
|
default: null |
|
|
}, |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
const imageFormData = ref({ |
|
|
|
|
|
filePathList: [] |
|
|
|
|
|
}) |
|
|
|
|
|
const fileFormData = ref({ |
|
|
|
|
|
filePathList: [] |
|
|
}) |
|
|
}) |
|
|
const subIndex = ref(props.subIndex) |
|
|
const subIndex = ref('A') |
|
|
const isShowDrawer = ref(false) |
|
|
const isShowDrawer = ref(false) |
|
|
const detailLoading = ref(false) |
|
|
const detailLoading = ref(false) |
|
|
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) |
|
|
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) |
|
|
const subTabsList = ref(JSON.parse(JSON.stringify(props.subTabs ? props.subTabs : ''))) |
|
|
const subTabsList = ref(JSON.parse(JSON.stringify(props.subTabs ? props.subTabs : ''))) |
|
|
|
|
|
|
|
|
const imageFormSchemas = ref(props.imageFormAllSchemas?.formSchema) |
|
|
|
|
|
const fileFormSchemas = ref(props.fileFormAllSchemas?.formSchema) |
|
|
|
|
|
console.log('imageFormSchemas', imageFormSchemas.value) |
|
|
|
|
|
|
|
|
|
|
|
// Tabs当前选择 |
|
|
// Tabs当前选择 |
|
|
const current = ref(0) |
|
|
const current = ref(0) |
|
|
const imageParmas=ref({ |
|
|
const imageParmas = ref({ |
|
|
funcCode: 'device_mould_picture', //获取图片详情参数 |
|
|
funcCode: 'device_mould_picture', //获取图片详情参数 |
|
|
fileBusiType: '' //获取图片详情参数 |
|
|
fileBusiType: '' //获取图片详情参数 |
|
|
}) |
|
|
}) |
|
@ -355,17 +332,24 @@ const change = (item, index) => { |
|
|
current.value = index |
|
|
current.value = index |
|
|
if (item.prop == 'Image') { |
|
|
if (item.prop == 'Image') { |
|
|
imageParmas.value.funcCode = 'device_mould_picture' |
|
|
imageParmas.value.funcCode = 'device_mould_picture' |
|
|
|
|
|
imageParmas.value.fileBusiType = '' |
|
|
|
|
|
getImage() |
|
|
} else if (item.prop == 'Word') { |
|
|
} else if (item.prop == 'Word') { |
|
|
imageParmas.value.funcCode = 'device_mould_attachment' |
|
|
imageParmas.value.funcCode = 'device_mould_attachment' |
|
|
} else{ |
|
|
imageParmas.value.fileBusiType = 'A' |
|
|
imageParmas.value.funcCode = '' |
|
|
subIndex.value = 'A' |
|
|
|
|
|
formKey.value += 1 |
|
|
|
|
|
getImage() |
|
|
|
|
|
} else { |
|
|
|
|
|
imageParmas.value.funcCode = '' |
|
|
|
|
|
imageParmas.value.fileBusiType = '' |
|
|
} |
|
|
} |
|
|
emit('changeTabs', item) |
|
|
emit('changeTabs', item) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//主表所需的参数 |
|
|
//主表所需的参数 |
|
|
const masterParmas = ref({ |
|
|
const masterParmas = ref({ |
|
|
number: '' ,//主表id |
|
|
number: '' //主表id |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
@ -376,12 +360,12 @@ const buttondata = ref() |
|
|
const detailData = ref() |
|
|
const detailData = ref() |
|
|
const titleNameRef = ref() |
|
|
const titleNameRef = ref() |
|
|
const titleValueRef = ref() |
|
|
const titleValueRef = ref() |
|
|
const tabsKay =ref(0)//刷新tabs组件key值 |
|
|
const tabsKay = ref(0) //刷新tabs组件key值 |
|
|
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { |
|
|
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { |
|
|
titleNameRef.value = titleName |
|
|
titleNameRef.value = titleName |
|
|
titleValueRef.value = titleValue |
|
|
titleValueRef.value = titleValue |
|
|
current.value = 0 |
|
|
current.value = 0 |
|
|
tabsKay.value+=1 |
|
|
tabsKay.value += 1 |
|
|
// 加载明细列表 |
|
|
// 加载明细列表 |
|
|
if (!props.isBasic || (props.isBasic && props.tabsExtend)) { |
|
|
if (!props.isBasic || (props.isBasic && props.tabsExtend)) { |
|
|
// 设置主表id |
|
|
// 设置主表id |
|
@ -394,11 +378,13 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
isShowDrawer.value = true |
|
|
isShowDrawer.value = true |
|
|
|
|
|
|
|
|
|
|
|
imageParmas.value.funcCode = 'device_mould_picture' |
|
|
|
|
|
|
|
|
if (row) { |
|
|
if (row) { |
|
|
console.log(row) |
|
|
|
|
|
detailLoading.value = true |
|
|
detailLoading.value = true |
|
|
try { |
|
|
try { |
|
|
await getImage() |
|
|
await getImage() |
|
|
detailData.value = row |
|
|
detailData.value = row |
|
|
// 判断详情新增按钮是否显示 |
|
|
// 判断详情新增按钮是否显示 |
|
|
if (routeName.value.indexOf('Job') > -1) { |
|
|
if (routeName.value.indexOf('Job') > -1) { |
|
@ -470,19 +456,24 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|
|
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
// 获取图片详情 |
|
|
// 获取图片详情 |
|
|
const getImage=()=>{ |
|
|
const formKey = ref(0) |
|
|
props.getImageApi({ |
|
|
const getImage = () => { |
|
|
number:masterParmas.value.number, |
|
|
props |
|
|
funcCode:imageParmas.value.funcCode, |
|
|
.getImageApi({ |
|
|
fileBusiType:imageParmas.value.fileBusiType |
|
|
number: masterParmas.value.number, |
|
|
}).then((res)=>{ |
|
|
funcCode: imageParmas.value.funcCode, |
|
|
console.log(res) |
|
|
fileBusiType: imageParmas.value.fileBusiType |
|
|
nextTick(() => { |
|
|
}) |
|
|
imageFormRef.value.setValues({ |
|
|
.then((res) => { |
|
|
filePathList:res |
|
|
nextTick(() => { |
|
|
}) |
|
|
if (imageParmas.value.funcCode == 'device_mould_picture') { |
|
|
|
|
|
imageFormData.value.filePathList = res |
|
|
|
|
|
} else { |
|
|
|
|
|
fileFormData.value.filePathList = res |
|
|
|
|
|
formKey.value += 1 |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const tableObjectRef = ref() |
|
|
const tableObjectRef = ref() |
|
@ -588,8 +579,7 @@ const emit = defineEmits([ |
|
|
'detailOpenForm', |
|
|
'detailOpenForm', |
|
|
'tableFormButton', |
|
|
'tableFormButton', |
|
|
'openImage', |
|
|
'openImage', |
|
|
'subTabsChick', |
|
|
'subTabsChick' |
|
|
'uploadFile' |
|
|
|
|
|
]) |
|
|
]) |
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
const handleDelete = async (id: number) => { |
|
|
const handleDelete = async (id: number) => { |
|
@ -640,17 +630,18 @@ const openImage = (item) => { |
|
|
} |
|
|
} |
|
|
const imageFormRef = ref() |
|
|
const imageFormRef = ref() |
|
|
// 上传图片 |
|
|
// 上传图片 |
|
|
const uploadImage =async () => { |
|
|
const uploadImage = async () => { |
|
|
const elForm = unref(imageFormRef)?.getElFormRef() |
|
|
// const elForm = unref(imageFormRef)?.getElFormRef() |
|
|
// 校验表单 |
|
|
// // 校验表单 |
|
|
if (!elForm) return |
|
|
// if (!elForm) return |
|
|
const valid = await elForm.validate() |
|
|
// const valid = await elForm.validate() |
|
|
if (!valid) return |
|
|
// if (!valid) return |
|
|
|
|
|
imageFormData |
|
|
let data = { |
|
|
let data = { |
|
|
number:masterParmas.value.number, |
|
|
number: masterParmas.value.number, |
|
|
filePathList: imageFormRef.value.formModel.filePathList.map((item) => item.url), |
|
|
filePathList: imageFormData.value.filePathList.map((item) => item.url), |
|
|
funcCode: imageParmas.value.funcCode, |
|
|
funcCode: imageParmas.value.funcCode, |
|
|
fileBusiType: imageParmas.value.fileBusiType ? imageParmas.value.fileBusiType : '' |
|
|
fileBusiType: imageParmas.value.fileBusiType ? imageParmas.value.fileBusiType : '' |
|
|
} |
|
|
} |
|
|
props.uploadImage(data).then((res) => { |
|
|
props.uploadImage(data).then((res) => { |
|
|
message.success('修改成功') |
|
|
message.success('修改成功') |
|
@ -659,23 +650,29 @@ const uploadImage =async () => { |
|
|
} |
|
|
} |
|
|
// 选择二级tabs |
|
|
// 选择二级tabs |
|
|
const fileFormRef = ref() |
|
|
const fileFormRef = ref() |
|
|
const handleTabsChange=(e)=>{ |
|
|
const handleTabsChange = (e) => { |
|
|
emit('subTabsChick',e) |
|
|
imageParmas.value.fileBusiType = e |
|
|
|
|
|
getImage() |
|
|
} |
|
|
} |
|
|
// 上传文件 |
|
|
// 上传文件 |
|
|
const uploadFile=async(index)=>{ |
|
|
const uploadFile = async () => { |
|
|
let _lists = fileFormRef.value?.map(v => unref(v)?.getElFormRef()) |
|
|
console.log(fileFormData.value.filePathList) |
|
|
const elForm = _lists[index] |
|
|
// const elForm = unref(fileFormRef)?.getElFormRef() |
|
|
// 校验表单 |
|
|
// // 校验表单 |
|
|
if (!elForm) return |
|
|
// if (!elForm) return |
|
|
const valid = await elForm.validate() |
|
|
// const valid = await elForm.validate() |
|
|
if (!valid) return |
|
|
// if (!valid) return |
|
|
console.log(fileFormRef.value.formModel) |
|
|
// console.log(fileFormRef.value?.formModel.filePathList) |
|
|
emit( |
|
|
let data = { |
|
|
'uploadFile', |
|
|
number: masterParmas.value.number, |
|
|
masterParmas.value.number, |
|
|
filePathList: fileFormData.value.filePathList.map((item) => item.url), |
|
|
fileFormRef.value.formModel.filePathList.map((item) => item.url) |
|
|
funcCode: imageParmas.value.funcCode, |
|
|
) |
|
|
fileBusiType: imageParmas.value.fileBusiType ? imageParmas.value.fileBusiType : '' |
|
|
|
|
|
} |
|
|
|
|
|
props.uploadImage(data).then((res) => { |
|
|
|
|
|
message.success('修改成功') |
|
|
|
|
|
getImage() |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
//监视属性 |
|
|
//监视属性 |
|
|
watch( |
|
|
watch( |
|
|