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