Browse Source

详情组件修改

master
陈薪名 1 year ago
parent
commit
ffaedf51d5
  1. 35
      src/components/Detail/src/Detail.vue

35
src/components/Detail/src/Detail.vue

@ -13,7 +13,15 @@
<div class="flex" v-if="current == 0">
<!-- 详情 -->
<ContentWrap class="w-[73%]">
<Descriptions :data="detailData" :schema="allSchemas.detailSchema" :columns="2" />
<Descriptions v-if="isBasic" :data="detailData" :schema="allSchemas.detailSchema" :columns="2" />
<Table
v-if="!isBasic"
:columns="detailAllSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{ total: tableObject.total }"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage" />
</ContentWrap>
<ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 -->
@ -25,11 +33,6 @@
<ChangeRecord :changeRecordData="changeRecordData" class="mt-20px" />
</ContentWrap>
</div>
<ContentWrap v-else>
<Table :columns="allSchemas.tableColumns" :data="tableObject.tableList" :loading="tableObject.loading"
:pagination="{ total: tableObject.total }" v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage" />
</ContentWrap>
</el-drawer>
</template>
@ -62,6 +65,18 @@ const props = defineProps({
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
// API
detailApi: {
type: Object,
required: true,
default: null
}
})
const isShowDrawer = ref(false)
@ -170,6 +185,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
tableId: row.id,
tableName: tableName,
}
getList() //
isShowDrawer.value = true
if (row) {
detailLoading.value = true
@ -206,6 +222,13 @@ const getChangeRecordList = async () => {
changeRecordData.changeRecordList = await DetailApi.getChangeRecordPage(remarksData.data)
}
const { tableObject, tableMethods } = useTable({
getListApi: props.detailApi?.getDetasListPage // APIID
})
//
const { getList } = tableMethods
</script>
<style lang="scss">
.el-drawer__body {

Loading…
Cancel
Save