|
@ -51,9 +51,8 @@ |
|
|
ref="imageFormRef" |
|
|
ref="imageFormRef" |
|
|
:rules="upImageRules" |
|
|
:rules="upImageRules" |
|
|
:schema="imageFormSchemas" |
|
|
:schema="imageFormSchemas" |
|
|
:is-col="true" |
|
|
|
|
|
/> |
|
|
/> |
|
|
<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"> |
|
|
<el-tabs type="border-card" class="demo-tabs" v-model="subIndex" v-if="isBasic && tabsExtend == 2" @tab-change="handleTabsChange"> |
|
|
<el-tab-pane |
|
|
<el-tab-pane |
|
@ -68,7 +67,7 @@ |
|
|
:schema="fileFormSchemas" |
|
|
:schema="fileFormSchemas" |
|
|
:is-col="true" |
|
|
:is-col="true" |
|
|
/> |
|
|
/> |
|
|
<el-button type="primary" @click="uploadFile(index)">点击上传</el-button> |
|
|
<el-button type="primary" @click="uploadFile(index)">点击修改</el-button> |
|
|
</el-tab-pane> |
|
|
</el-tab-pane> |
|
|
</el-tabs> |
|
|
</el-tabs> |
|
|
<!-- 单表切换tabs 展现table --> |
|
|
<!-- 单表切换tabs 展现table --> |
|
@ -159,6 +158,7 @@ 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' |
|
|
const { proxy } = getCurrentInstance() |
|
|
const { proxy } = getCurrentInstance() |
|
|
|
|
|
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
defineOptions({ name: 'Detail' }) |
|
@ -322,6 +322,18 @@ const props = defineProps({ |
|
|
required: false, |
|
|
required: false, |
|
|
default: 'A' |
|
|
default: 'A' |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 获取图片详情方法 |
|
|
|
|
|
getImageApi: { |
|
|
|
|
|
type: Function, |
|
|
|
|
|
required: false, |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
|
|
|
// 上传图片方法 |
|
|
|
|
|
uploadImage: { |
|
|
|
|
|
type: Function, |
|
|
|
|
|
required: false, |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
}) |
|
|
}) |
|
|
const subIndex = ref(props.subIndex) |
|
|
const subIndex = ref(props.subIndex) |
|
|
const isShowDrawer = ref(false) |
|
|
const isShowDrawer = ref(false) |
|
@ -335,16 +347,25 @@ console.log('imageFormSchemas', imageFormSchemas.value) |
|
|
|
|
|
|
|
|
// Tabs当前选择 |
|
|
// Tabs当前选择 |
|
|
const current = ref(0) |
|
|
const current = ref(0) |
|
|
|
|
|
const imageParmas=ref({ |
|
|
|
|
|
funcCode: 'device_mould_picture', //获取图片详情参数 |
|
|
|
|
|
fileBusiType: '' //获取图片详情参数 |
|
|
|
|
|
}) |
|
|
const change = (item, index) => { |
|
|
const change = (item, index) => { |
|
|
current.value = index |
|
|
current.value = index |
|
|
|
|
|
if (item.prop == 'Image') { |
|
|
|
|
|
imageParmas.value.funcCode = 'device_mould_picture' |
|
|
|
|
|
} else if (item.prop == 'Word') { |
|
|
|
|
|
imageParmas.value.funcCode = 'device_mould_attachment' |
|
|
|
|
|
} else{ |
|
|
|
|
|
imageParmas.value.funcCode = '' |
|
|
|
|
|
} |
|
|
emit('changeTabs', item) |
|
|
emit('changeTabs', item) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//主表所需的参数 |
|
|
//主表所需的参数 |
|
|
const masterParmas = ref({ |
|
|
const masterParmas = ref({ |
|
|
number: '' //主表id |
|
|
number: '' ,//主表id |
|
|
// number: '', //主表单据号 |
|
|
|
|
|
// status: '' //主表状态 用于控制子表新增编辑按钮显示情况 |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
@ -365,9 +386,6 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
if (!props.isBasic || (props.isBasic && props.tabsExtend)) { |
|
|
if (!props.isBasic || (props.isBasic && props.tabsExtend)) { |
|
|
// 设置主表id |
|
|
// 设置主表id |
|
|
masterParmas.value.number = row.number |
|
|
masterParmas.value.number = row.number |
|
|
// masterParmas.value.number = row.number |
|
|
|
|
|
// masterParmas.value.status = row.status |
|
|
|
|
|
|
|
|
|
|
|
if (!props.isBasic) { |
|
|
if (!props.isBasic) { |
|
|
tableObjectRef.value.params = { |
|
|
tableObjectRef.value.params = { |
|
|
number: row.number |
|
|
number: row.number |
|
@ -380,9 +398,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
console.log(row) |
|
|
console.log(row) |
|
|
detailLoading.value = true |
|
|
detailLoading.value = true |
|
|
try { |
|
|
try { |
|
|
nextTick(() => { |
|
|
await getImage() |
|
|
imageFormRef.value.setValues(row) |
|
|
|
|
|
}) |
|
|
|
|
|
detailData.value = row |
|
|
detailData.value = row |
|
|
// 判断详情新增按钮是否显示 |
|
|
// 判断详情新增按钮是否显示 |
|
|
if (routeName.value.indexOf('Job') > -1) { |
|
|
if (routeName.value.indexOf('Job') > -1) { |
|
@ -453,6 +469,22 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
} |
|
|
} |
|
|
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|
|
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
|
|
|
// 获取图片详情 |
|
|
|
|
|
const getImage=()=>{ |
|
|
|
|
|
props.getImageApi({ |
|
|
|
|
|
number:masterParmas.value.number, |
|
|
|
|
|
funcCode:imageParmas.value.funcCode, |
|
|
|
|
|
fileBusiType:imageParmas.value.fileBusiType |
|
|
|
|
|
}).then((res)=>{ |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
imageFormRef.value.setValues({ |
|
|
|
|
|
filePathList:res |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const tableObjectRef = ref() |
|
|
const tableObjectRef = ref() |
|
|
const tableMethodsRef = ref() |
|
|
const tableMethodsRef = ref() |
|
|
const detailAllSchemasRef = ref() |
|
|
const detailAllSchemasRef = ref() |
|
@ -556,7 +588,6 @@ const emit = defineEmits([ |
|
|
'detailOpenForm', |
|
|
'detailOpenForm', |
|
|
'tableFormButton', |
|
|
'tableFormButton', |
|
|
'openImage', |
|
|
'openImage', |
|
|
'uploadImage', |
|
|
|
|
|
'subTabsChick', |
|
|
'subTabsChick', |
|
|
'uploadFile' |
|
|
'uploadFile' |
|
|
]) |
|
|
]) |
|
@ -610,17 +641,21 @@ const openImage = (item) => { |
|
|
const imageFormRef = ref() |
|
|
const imageFormRef = ref() |
|
|
// 上传图片 |
|
|
// 上传图片 |
|
|
const uploadImage =async () => { |
|
|
const uploadImage =async () => { |
|
|
console.log(imageFormRef) |
|
|
|
|
|
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 |
|
|
emit( |
|
|
let data = { |
|
|
'uploadImage', |
|
|
number:masterParmas.value.number, |
|
|
masterParmas.value.number, |
|
|
filePathList: imageFormRef.value.formModel.filePathList.map((item) => item.url), |
|
|
imageFormRef.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() |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
// 选择二级tabs |
|
|
// 选择二级tabs |
|
|
const fileFormRef = ref() |
|
|
const fileFormRef = ref() |
|
|