This commit is contained in:
zmj 2024-03-18 23:28:44 +08:00
parent c352b14f64
commit c7d91dc682
18 changed files with 47 additions and 75 deletions

View File

@ -24,15 +24,28 @@
</el-descriptions-item>
</el-descriptions>
</el-form>
<el-card class="mt-5" v-if="detailConfig?.table">
<template #header>
{{ detailConfig.table.title }}列表
</template>
<el-table :data="tableLists">
<el-table-column :label="item.label" :prop="item.value" show-overflow-tooltip
v-for="(item, index) in detailConfig.table.tableConfig" :key="index" />
</el-table>
</el-card>
<div v-if="detailConfig?.table">
<el-card class="mt-5" v-if="!Array.isArray(detailConfig?.table)">
<template #header>
{{ detailConfig.table.title }}列表
</template>
<el-table :data="tableLists">
<el-table-column :label="item.label" :prop="item.value" show-overflow-tooltip
v-for="(item, index) in detailConfig.table.tableConfig" :key="index" />
</el-table>
</el-card>
<el-card class="mt-5" v-else>
<!-- <template #header>
{{ detailConfig.table.title }}列表
</template>
<el-table :data="tableLists">
<el-table-column :label="item.label" :prop="item.value" show-overflow-tooltip
v-for="(item, index) in detailConfig.table.tableConfig" :key="index" />
</el-table> -->
</el-card>
</div>
</popup>
</div>
@ -42,7 +55,7 @@
import Popup from '@/components/popup/index.vue'
import { defineProps, ref, defineExpose } from "vue"
import { cloneDeep } from 'lodash-es'
const props = defineProps({
detailConfig: {
type: Object,
@ -71,9 +84,17 @@ const formData = ref({})
//
const setFormData = async (data: Record<any, any>) => {
formData.value = data
if (props.detailConfig?.table) {
let res = await props.detailConfig.table.fetchFun({ [props.detailConfig.table.query]: formData.value.id })
let query = cloneDeep(props.detailConfig.table.query)
if (typeof (props.detailConfig.table.query) === 'object') {
for (let key in query) {
query[key] ||= data.id
}
} else {
query = { [query]: data.id }
}
let res = await props.detailConfig.table.fetchFun({ ...query })
tableLists.value = res.lists
}
@ -89,6 +110,7 @@ const open = () => {
//
const handleClose = () => {
emit('close')
console.log("gianni1")
}

View File

@ -14,7 +14,7 @@ const detailConfig = {
},
{
label: "单位类别",
value: "type"
value: "type_text"
},
{
label: "资质等级",

View File

@ -54,7 +54,7 @@
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['manage_basic.manage_project/detail']" type="danger" link
<el-button v-perms="['manage_basic.manage_project/detail']" link
@click="handleDetail(row.id)">
详情
</el-button>

View File

@ -7,11 +7,11 @@ const detailConfig = {
},
{
label: "性质",
value: "nature"
value: "nature_text"
},
{
label: "行业",
value: "industry"
value: "industry_text"
},
{
label: "建设单位",
@ -19,7 +19,7 @@ const detailConfig = {
},
{
label: "建设区域",
value: "build_area"
value: "build_area_text"
},
{
label: "项目地址",
@ -27,7 +27,7 @@ const detailConfig = {
},
{
label: "项目级别",
value: "project_level"
value: "project_level_text"
},
{
label: "总投资(万元)",
@ -35,7 +35,7 @@ const detailConfig = {
},
{
label: "工程状态",
value: "engineering_status"
value: "engineering_status_text"
},
{
label: "合同服务内容",

View File

@ -101,7 +101,7 @@
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['manage_basic.manage_project/detail']" type="danger" link
<el-button v-perms="['manage_basic.manage_project/detail']" link
@click="handleDetail(row.id)">
详情
</el-button>

View File

@ -112,10 +112,7 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionAcceptLists, apiSupervisionAcceptDelete, apiSupervisionAcceptDetail, apisupervision_accept } from '@/api/supervision_accept'
<<<<<<< HEAD
=======
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'

View File

@ -64,12 +64,8 @@
<script lang="ts" setup name="supervisionCommencementReportLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
<<<<<<< HEAD
import { apiSupervisionCommencementReportLists, apiSupervisionCommencementReportDelete, apiSupervisionCommencementReportDetail } from '@/api/supervision_commencement_report'
=======
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
import { apiSupervisionCommencementReportLists, apiSupervisionCommencementReportDelete } from '@/api/supervision_commencement_report'
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'

View File

@ -66,10 +66,7 @@ import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
import { apiSupervisionDesignDisclosureLists, apiSupervisionDesignDisclosureDelete, apiSupervisionDesignDisclosureDetail } from '@/api/supervision_design_disclosure'
<<<<<<< HEAD
import detailConfig from './detail'
=======
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'

View File

@ -81,10 +81,7 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionInspectionLists, apiSupervisionInspectionDelete, apiSupervisionInspectionDetail } from '@/api/supervision_inspection'
<<<<<<< HEAD
=======
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'

View File

@ -105,12 +105,8 @@
<script lang="ts" setup name="supervisionMaterialEquipmentInfoLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
<<<<<<< HEAD
import { apiSupervisionMaterialEquipmentInfoLists, apiSupervisionMaterialEquipmentInfoDelete, apiSupervisionMaterialEquipmentInfoDetail } from '@/api/supervision_material_equipment_info'
=======
import { apiSupervisionMaterialEquipmentInfoLists, apiSupervisionMaterialEquipmentInfoDelete } from '@/api/supervision_material_equipment_info'
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'

View File

@ -44,23 +44,6 @@ const detailConfig = {
column: 1
},
],
table: {
title: "设备",
tableConfig: [
{
label: "设备名称",
value: 'name',
},
{
label: "是否显示",
value: 'is_show_text'
},
],
query: 'device_id',
fetchFun: apiSupervisionMonitoringEquipmentDetailLists,
}
}
export default detailConfig;

View File

@ -87,8 +87,8 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" :column="2"
width="60vw" />
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig"
:column="2" width="60vw" />
</div>
</template>

View File

@ -63,13 +63,8 @@
<script lang="ts" setup name="supervisionRulesLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
<<<<<<< HEAD
import { apiSupervisionRulesLists, apiSupervisionRulesDelete, apiSupervisionRulesDetail } from '@/api/supervision_rules'
import { timeFormat } from '@/utils/util'
=======
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
import { apiSupervisionRulesLists, apiSupervisionRulesDelete } from '@/api/supervision_rules'
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'

View File

@ -64,13 +64,8 @@
<script lang="ts" setup name="supervisionRulesDisclosureLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
<<<<<<< HEAD
import { apiSupervisionRulesDisclosureLists, apiSupervisionRulesDisclosureDelete, apiSupervisionRulesDisclosureDetail } from '@/api/supervision_rules_disclosure'
import { timeFormat } from '@/utils/util'
=======
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
import { apiSupervisionRulesDisclosureLists, apiSupervisionRulesDisclosureDelete } from '@/api/supervision_rules_disclosure'
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'

View File

@ -80,10 +80,7 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionSideStationLists, apiSupervisionSideStationDelete, apiSupervisionSideStationDetail } from '@/api/supervision_side_station'
<<<<<<< HEAD
=======
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'

View File

@ -79,7 +79,7 @@ const detailConfig = {
],
fetchFun: apisupervision_problem,
query: 'data_id'
query: { 'data_id': '', data_type: 6 }
}

View File

@ -95,14 +95,14 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" />
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" />
</div>
</template>
<script lang="ts" setup name="supervisionTestBlocksSpecimensLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionTestBlocksSpecimensLists, apiSupervisionTestBlocksSpecimensDelete } from '@/api/supervision_test_blocks_specimens'
import { apiSupervisionTestBlocksSpecimensLists, apiSupervisionTestBlocksSpecimensDelete, apiSupervisionTestBlocksSpecimensDetail } from '@/api/supervision_test_blocks_specimens'
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'

View File

@ -97,11 +97,8 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionWitnessSamplingLists, apiSupervisionWitnessSamplingDelete, apiSupervisionWitnessSamplingDetail } from '@/api/supervision_witness_sampling'
<<<<<<< HEAD
=======
import { apiSupervisionProjectSearch } from '@/api/supervision_project'
import { apiSupervisionMaterialEntrySearch } from '@/api/supervision_material_entry'
>>>>>>> 346a5866d2c73a11f9e463e241a4b2183785356f
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import { useRouter } from 'vue-router'