Browse Source

fix:删除多余代码

feature/tsjb-1.0
parent
commit
0931fc881b
  1. 8
      src/api/data/complaintCollection.ts
  2. 104
      src/components/data/complaint_detail.vue
  3. 9
      src/views/data/ComplaintCollection.vue
  4. 11
      src/views/data/ComplaintCollection_12389ts.vue
  5. 11
      src/views/data/ComplaintCollection_gabxf.vue
  6. 11
      src/views/data/ComplaintCollection_gjxf.vue
  7. 11
      src/views/data/ComplaintCollection_jzxx.vue
  8. 11
      src/views/data/ComplaintCollection_ldxj.vue
  9. 10
      src/views/data/DuplicateDrawerWithDetail.vue

8
src/api/data/complaintCollection.ts

@ -33,14 +33,6 @@ export function updateComplaintCollection(body) {
}
export function watchDetail(body) {
return request.post({
url: `/data/complaintCollection/watchDetail`,
body
});
}
/**
*
*/

104
src/components/data/complaint_detail.vue

@ -1,104 +0,0 @@
<template>
<el-dialog title="详情" v-model="visible" width="60vw" :lock-scroll="false" destroy-on-close>
<div style="min-height: 50vh" v-loading="loading">
<div class="row" style="margin: 0 60px">
<div class="col col-24">
<!-- <complaint-problem-info :data="base" :dict="dict" />-->
</div>
<div class="col col-24">
<!-- <complaintdes :data="base" :dict="dict" />-->
</div>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button size="large" @click="visible = false">关闭</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import {computed, ref, watch} from "vue";
import {ElMessage} from "element-plus";
import {watchDetail} from "@/api/data/complaintCollection.ts";
const props = defineProps({
modelValue: { type: Boolean, default: false },
id: { type: [String, Number], default: "" },
dict: { type: Object, default: () => ({}) },
});
const emit = defineEmits(["update:modelValue"]);
const visible = computed({
get: () => props.modelValue,
set: (v) => emit("update:modelValue", v),
});
const loading = ref(false);
const loaded = ref(false);
const detail = ref({});
/** ✅ 假设接口统一返回:detail = { ...baseFields, negative: { ...核查/涉及信息 } } */
const base = computed(() => detail.value || {});
async function fetchDetail() {
if (!props.id) return;
loading.value = true;
loaded.value = false;
try {
const body={
id:props.id
}
const res = await watchDetail(body);
detail.value = res?.data ?? res ?? {};
loaded.value = true;
} catch (e) {
detail.value = {};
loaded.value = true;
ElMessage.error(e?.message || "详情获取失败");
} finally {
loading.value = false;
}
}
/** 打开弹窗或 id 变化时自动请求 */
watch(
() => [visible.value, props.id],
([v]) => {
if (v) fetchDetail();
}
);
</script>
<style scoped>
/* ✅ 让弹窗内容纵向排列,每个模块一整行 */
.row {
display: flex;
flex-direction: column; /* 关键:不要横向排 */
gap: 14px; /* 替代 row-gap,更直观 */
margin: 0;
}
/* ✅ 强制每个 col-24 占满 100% 宽度(在 flex 下生效) */
.col.col-24,
.col-24 {
width: 100%;
flex: 0 0 100%;
max-width: 100%;
min-width: 0;
}
/* ✅ 保险:如果你的子组件根节点是 el-collapse,确保它也占满 */
:deep(.el-collapse) {
width: 100%;
}
:deep(.el-collapse-item__header) {
width: 100%;
}
</style>

9
src/views/data/ComplaintCollection.vue

@ -409,14 +409,6 @@
@updateSuccess="getList"
/>
<!-- 查看详情 -->
<complaint_detail
width="80vw"
v-model="detailShow"
:id="activeId"
:dict="dict"/>
<negative-dialog
v-model="show"
:id="activeNegativeId"
@ -443,7 +435,6 @@ import {
getComplaintCollectionPage, saveInvolveJson,
updateComplaintCollection
} from "@/api/data/complaintCollection.ts";
import Complaint_detail from "@/components/data/complaint_detail.vue";
import useUserStore from "@/stores/modules/user.ts";
const route = useRoute()

11
src/views/data/ComplaintCollection_12389ts.vue

@ -298,12 +298,6 @@
</div>
</div>
<!-- 查看详情 -->
<complaint_detail
v-model="detailShow"
:id="activeId"
:dict="dict"/>
</template>
@ -315,10 +309,7 @@ import {
exportData,
getComplaintCollectionPage
} from "@/api/data/complaintCollection.ts";
import Complaint_detail from "@/components/data/complaint_detail.vue";
const catchStore = useCatchStore();
import useCatchStore = useCatchStore();
const query = ref({
size: 10,

11
src/views/data/ComplaintCollection_gabxf.vue

@ -297,12 +297,6 @@
</div>
</div>
<!-- 查看详情 -->
<complaint_detail
v-model="detailShow"
:id="activeId"
:dict="dict"/>
</template>
@ -315,10 +309,7 @@ import {
exportData,
getComplaintCollectionPage
} from "@/api/data/complaintCollection.ts";
import Complaint_detail from "@/components/data/complaint_detail.vue";
const catchStore = useCatchStore();
import useCatchStore = useCatchStore();
const query = ref({
size: 10,

11
src/views/data/ComplaintCollection_gjxf.vue

@ -297,12 +297,6 @@
</div>
</div>
<!-- 查看详情 -->
<complaint_detail
v-model="detailShow"
:id="activeId"
:dict="dict"/>
</template>
@ -311,10 +305,7 @@ import {computed, onMounted, ref} from 'vue';
import {timeFormat} from "@/utils/util";
import useCatchStore from "@/stores/modules/catch";
import {exportData, getComplaintCollectionPage} from "@/api/data/complaintCollection.ts";
import Complaint_detail from "@/components/data/complaint_detail.vue";
const catchStore = useCatchStore();
import useCatchStore = useCatchStore();
const query = ref({
size: 10,

11
src/views/data/ComplaintCollection_jzxx.vue

@ -324,12 +324,6 @@
</div>
</div>
<!-- 查看详情 -->
<complaint_detail
v-model="detailShow"
:id="activeId"
:dict="dict"/>
</template>
@ -341,10 +335,7 @@ import {
exportData,
getComplaintCollectionPage
} from "@/api/data/complaintCollection.ts";
import Complaint_detail from "@/components/data/complaint_detail.vue";
const catchStore = useCatchStore();
import useCatchStore = useCatchStore();
const query = ref({
size: 10,

11
src/views/data/ComplaintCollection_ldxj.vue

@ -297,12 +297,6 @@
</div>
</div>
<!-- 查看详情 -->
<complaint_detail
v-model="detailShow"
:id="activeId"
:dict="dict"/>
</template>
@ -314,10 +308,7 @@ import {
exportData,
getComplaintCollectionPage
} from "@/api/data/complaintCollection.ts";
import Complaint_detail from "@/components/data/complaint_detail.vue";
const catchStore = useCatchStore();
import useCatchStore = useCatchStore();
const query = ref({
size: 10,

10
src/views/data/DuplicateDrawerWithDetail.vue

@ -65,25 +65,17 @@
</div>
</el-drawer>
<!-- 详情弹窗封装在组件内部 -->
<complaint_detail
width="80vw"
v-model="detailShow"
:id="activeId"
:dict="dict"
/>
</template>
<script setup>
import { computed, ref, watch } from "vue";
import dayjs from "dayjs";
import { WarningFilled } from "@element-plus/icons-vue";
import Complaint_detail from "@/components/data/complaint_detail.vue";
/**
* 目标组件内部封装
* 1) 抽屉展示重复件列表
* 2) 点击行 -> 打开 complaint_detail
* 2) 点击行 -> 查看详情
*
* props:
* - modelValue: 抽屉开关

Loading…
Cancel
Save