|
@ -25,7 +25,7 @@ |
|
|
/> |
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<Tabs :tabsList="tabsList" :current="current" @change="change" /> |
|
|
<Tabs :tabsList="tabsList" :current="current" @change="change" :key="tabsKay"/> |
|
|
<div class="flex"> |
|
|
<div class="flex"> |
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<ContentWrap class="w-[100%]"> |
|
|
<ContentWrap class="w-[100%]"> |
|
@ -55,7 +55,7 @@ |
|
|
/> |
|
|
/> |
|
|
<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-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 |
|
|
v-for="(item,index) in subTabsList" |
|
|
v-for="(item,index) in subTabsList" |
|
|
:key="item.value" |
|
|
:key="item.value" |
|
@ -63,12 +63,12 @@ |
|
|
:name="item.value" |
|
|
:name="item.value" |
|
|
> |
|
|
> |
|
|
<Form |
|
|
<Form |
|
|
:ref="'fileFormRef'+ ( index + 1 )" |
|
|
:ref="'fileFormRef'" |
|
|
:rules="upFileRules" |
|
|
:rules="upFileRules" |
|
|
:schema="fileFormSchemas" |
|
|
:schema="fileFormSchemas" |
|
|
:is-col="true" |
|
|
:is-col="true" |
|
|
/> |
|
|
/> |
|
|
<el-button type="primary" @click="uploadFile($event,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 --> |
|
@ -316,8 +316,14 @@ const props = defineProps({ |
|
|
type: Object, |
|
|
type: Object, |
|
|
required: true, |
|
|
required: true, |
|
|
default: null |
|
|
default: null |
|
|
} |
|
|
}, |
|
|
|
|
|
subIndex: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
required: false, |
|
|
|
|
|
default: 'A' |
|
|
|
|
|
}, |
|
|
}) |
|
|
}) |
|
|
|
|
|
const subIndex = ref(props.subIndex) |
|
|
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 : ''))) |
|
@ -345,14 +351,16 @@ const masterParmas = ref({ |
|
|
const HeadButttondata = ref() |
|
|
const HeadButttondata = ref() |
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const buttondata = ref() |
|
|
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 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 |
|
|
|
|
|
tabsKay.value+=1 |
|
|
// 加载明细列表 |
|
|
// 加载明细列表 |
|
|
if (!props.isBasic || (props.isBasic && props.tabsExtend)) { |
|
|
if (!props.isBasic || (props.isBasic && props.tabsExtend)) { |
|
|
// 设置主表id |
|
|
// 设置主表id |
|
@ -369,8 +377,12 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
} |
|
|
} |
|
|
isShowDrawer.value = true |
|
|
isShowDrawer.value = true |
|
|
if (row) { |
|
|
if (row) { |
|
|
|
|
|
console.log(row) |
|
|
detailLoading.value = true |
|
|
detailLoading.value = true |
|
|
try { |
|
|
try { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
imageFormRef.value.setValues(row) |
|
|
|
|
|
}) |
|
|
detailData.value = row |
|
|
detailData.value = row |
|
|
// 判断详情新增按钮是否显示 |
|
|
// 判断详情新增按钮是否显示 |
|
|
if (routeName.value.indexOf('Job') > -1) { |
|
|
if (routeName.value.indexOf('Job') > -1) { |
|
@ -607,28 +619,27 @@ const uploadImage =async () => { |
|
|
emit( |
|
|
emit( |
|
|
'uploadImage', |
|
|
'uploadImage', |
|
|
masterParmas.value.number, |
|
|
masterParmas.value.number, |
|
|
imageFormRef.value.formModel.filePath.map((item) => item.url) |
|
|
imageFormRef.value.formModel.filePathList.map((item) => item.url) |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
// 选择二级tabs |
|
|
// 选择二级tabs |
|
|
|
|
|
const fileFormRef = ref() |
|
|
const handleTabsChange=(e)=>{ |
|
|
const handleTabsChange=(e)=>{ |
|
|
console.log(e) |
|
|
|
|
|
emit('subTabsChick',e) |
|
|
emit('subTabsChick',e) |
|
|
} |
|
|
} |
|
|
// 上传文件 |
|
|
// 上传文件 |
|
|
const fileFormRef = ref() |
|
|
const uploadFile=async(index)=>{ |
|
|
const uploadFile=async(e,index)=>{ |
|
|
let _lists = fileFormRef.value?.map(v => unref(v)?.getElFormRef()) |
|
|
console.log(proxy.$refs) |
|
|
const elForm = _lists[index] |
|
|
console.log(proxy.$refs['fileFormRef'+(index+1))) |
|
|
|
|
|
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) |
|
|
emit( |
|
|
emit( |
|
|
'uploadFile', |
|
|
'uploadFile', |
|
|
masterParmas.value.number, |
|
|
masterParmas.value.number, |
|
|
fileFormRef.value.formModel.filePath.map((item) => item.url) |
|
|
fileFormRef.value.formModel.filePathList.map((item) => item.url) |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
//监视属性 |
|
|
//监视属性 |
|
|