From 2e2fe3dcf3f68ad8d18b07eefd8b862cabf44f42 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期日, 13 七月 2025 21:05:04 +0800
Subject: [PATCH] 1. 新增联合执法清单界面
---
src/views/fysp/data-product/ProdLawEnforceList.vue | 362 +++++++++++++++++++++++++++++++++++++++++++++++++++
src/components.d.ts | 12 -
src/constants/menu.js | 8 +
src/router/index.js | 6
4 files changed, 375 insertions(+), 13 deletions(-)
diff --git a/src/components.d.ts b/src/components.d.ts
index 2b04de3..06b456c 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -13,19 +13,15 @@
CompGenericWrapper: typeof import('./components/CompGenericWrapper.vue')['default']
CompQuickSet: typeof import('./components/search-option/CompQuickSet.vue')['default']
Content: typeof import('./components/core/Content.vue')['default']
- ElAffix: typeof import('element-plus/es')['ElAffix']
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
- ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
- ElCalendar: typeof import('element-plus/es')['ElCalendar']
ElCard: typeof import('element-plus/es')['ElCard']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
- ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
@@ -37,9 +33,6 @@
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
- ElDropdown: typeof import('element-plus/es')['ElDropdown']
- ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
- ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
@@ -49,17 +42,13 @@
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
- ElLink: typeof import('element-plus/es')['ElLink']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup']
ElOption: typeof import('element-plus/es')['ElOption']
- ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
- ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElPopover: typeof import('element-plus/es')['ElPopover']
- ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
@@ -78,7 +67,6 @@
ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
- ElTransfer: typeof import('element-plus/es')['ElTransfer']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
Footer: typeof import('./components/core/Footer.vue')['default']
diff --git a/src/constants/menu.js b/src/constants/menu.js
index 72f2ea3..a017de3 100644
--- a/src/constants/menu.js
+++ b/src/constants/menu.js
@@ -87,7 +87,13 @@
path: '/fysp/data-product/dailyreport',
icon: 'Document',
name: '鏃ユ姤绠$悊'
- }
+ },
+ {
+ path: '/fysp/data-product/lawenforcelist',
+ icon: 'Document',
+ name: '鑱斿悎鎵ф硶娓呭崟'
+ },
+
]
},
{
diff --git a/src/router/index.js b/src/router/index.js
index fea22a1..59aa0d9 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -41,6 +41,12 @@
path: '/fysp/data-product/scenereport',
component: () => import('@/views/fysp/data-product/ProdSceneReport.vue')
},
+ {
+ //鍦烘櫙鎶ュ憡
+ name: 'lawenforcelist',
+ path: '/fysp/data-product/lawenforcelist',
+ component: () => import('@/views/fysp/data-product/ProdLawEnforceList.vue')
+ },
// {
// //鍦烘櫙鎶ュ憡-宸ュ湴
// name: 'construction',
diff --git a/src/views/fysp/data-product/ProdLawEnforceList.vue b/src/views/fysp/data-product/ProdLawEnforceList.vue
new file mode 100644
index 0000000..99d1b0f
--- /dev/null
+++ b/src/views/fysp/data-product/ProdLawEnforceList.vue
@@ -0,0 +1,362 @@
+<template>
+ <FYTable
+ @search="onSearch"
+ :pagination="false"
+ ref="tableRef"
+ @cell-click="cellClick"
+ :cell-class-name="cellClassName"
+ @table-paste="handlePaste"
+ @sort-change="handleSortChange"
+ >
+ <template #options>
+ <!-- 鍖哄幙 -->
+ <FYOptionLocation
+ :allOption="false"
+ :level="3"
+ :checkStrictly="false"
+ v-model:value="formSearch.locations"
+ ></FYOptionLocation>
+ <!-- 鍦烘櫙绫诲瀷 -->
+ <FYOptionScene
+ :allOption="false"
+ :type="2"
+ v-model:value="formSearch.scenetype"
+ ></FYOptionScene>
+ <!-- 鏃堕棿 -->
+ <FYOptionTime
+ :initValue="false"
+ type="month"
+ v-model:value="formSearch.time"
+ ></FYOptionTime>
+ </template>
+
+ <template #options-expand>
+ <el-form :inline="true">
+ <CompQuickSet @quick-set="setOptions"></CompQuickSet>
+ </el-form>
+ <el-descriptions v-if="this.tableData.length > 0" title="" :column="1" direction="vertical" border>
+ <el-descriptions-item label="鑱斿悎鎵ф硶娓呭崟">
+ {{ listSummary }}
+ </el-descriptions-item>
+ </el-descriptions>
+ </template>
+
+ <template #table-column="{ size }">
+ <el-table-column fixed="left" label="搴忓彿" width="80">
+ <template #default="{ row }">
+ {{ row.index + 1 }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="sceneName"
+ :show-overflow-tooltip="true"
+ label="鍚嶇О"
+ width="300"
+ >
+ </el-table-column>
+ <!-- <el-table-column
+ prop="subTaskTime"
+ label="宸℃煡鏃ユ湡"
+ width="110"
+ sortable="custom"
+ :formatter="timeFormat"
+ /> -->
+ <!-- <el-table-column
+ prop="evaluation.resultscorebef"
+ label="寰楀垎"
+ width="90"
+ sortable="custom"
+ /> -->
+ <!-- <el-table-column
+ prop="evaluation.resultscorebef"
+ label="鐜俊鐮�"
+ width="100"
+ >
+ <template #default="{ row }">
+ <span :style="`color: ${toCode(row).color};`">{{
+ toCode(row).name
+ }}</span>
+ </template>
+ </el-table-column> -->
+
+ <el-table-column prop="dname" label="鍖哄幙" width="90" />
+ <el-table-column
+ prop="tname"
+ label="琛楅亾"
+ width="110"
+ :filters="townFilters"
+ :filter-method="filterHandler"
+ />
+ <el-table-column prop="evaluation.scenseaddress" label="鍦板潃" />
+ <!-- <el-table-column prop="biArea" label="闆嗕腑鍖�" width="110" />
+ <el-table-column prop="biManagementCompany" label="鐗╀笟" min-width="110"/> -->
+ <!-- <el-table-column fixed="right" align="right" label="鎿嶄綔" width="160">
+ <template #default="{ row }">
+ <el-button type="primary" size="small" @click="editRow(row)"
+ >鏌ョ湅</el-button
+ >
+ </template>
+ </el-table-column> -->
+ </template>
+ </FYTable>
+</template>
+
+<script>
+/**
+ * 鑱斿悎鎵ф硶娓呭崟
+ */
+import dayjs from 'dayjs';
+import evaluateApi from '@/api/fysp/evaluateApi';
+import { envCreditCode } from '@/constants/index';
+import { useTablePaste } from '@/composables/tablePaste';
+import { useCloned } from '@vueuse/core';
+import { useMessageBoxTip } from '@/composables/messageBox';
+
+export default {
+ setup() {
+ const {
+ cellClick,
+ cellClassName,
+ handlePaste,
+ setTableData,
+ addRefreshEvent,
+ tableData
+ } = useTablePaste({
+ score1: 8,
+ score2: 9
+ });
+ return {
+ cellClick,
+ cellClassName,
+ handlePaste,
+ setTableData,
+ addRefreshEvent,
+ tableData
+ };
+ },
+ data() {
+ return {
+ formSearch: {
+ locations: {},
+ scenetype: {},
+ time: dayjs().add(-1, 'M').date(1).toDate()
+ },
+ townFilters: [],
+ // 鍘熷鏁版嵁锛岀敤浜庢帓搴忓彇娑堝悗
+ orginData: [],
+ evaluationRule: undefined,
+ evaluationSubRule: undefined,
+ //鐩戞祴鏁版嵁瑙勫垯鍚嶇О
+ ruleName: {
+ score1: {
+ id: undefined,
+ name: '鐩戞祴鏁版嵁鍑虹幇鍗曟棩鍙婁互涓婃湁鏁堣秴鏍�'
+ },
+ score2: {
+ id: undefined,
+ name: '鐩戞祴鏁版嵁鏈堝潎鍊艰秴鍖哄煙鏈堝潎鍊�20%浠ヤ笂鎴栨暟鎹槑鏄惧紓甯�'
+ }
+ },
+ updateLoading: false
+ };
+ },
+ computed: {
+ area() {
+ const { locations, scenetype, time } = this.formSearch;
+ return {
+ provincecode: locations.pCode,
+ provincename: locations.pName,
+ citycode: locations.cCode,
+ cityname: locations.cName,
+ districtcode: locations.dCode,
+ districtname: locations.dName,
+ starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'),
+ scensetypeid: scenetype.value
+ };
+ },
+ listSummary() {
+ if (this.tableData.length > 0) {
+ const { locations, scenetype, time } = this.formSearch;
+ return `鏍规嵁${locations.dName}${dayjs(time).format(
+ 'YYYY骞碝M鏈�'
+ )}鐨勭幇鍦烘暣鏀规儏鍐典互鍙婅嚜鍔ㄨ瘎鍒嗙粨鏋滐紝骞剁粨鍚堝巻鍙插贰鏌ヨ褰曪紝寰楀嚭浠ヤ笅缁煎悎寰楀垎鏈�宸殑10瀹�${
+ scenetype.label
+ }浣滀负鑱斿悎鎵ф硶澶囬�夋竻鍗曘�俙;
+ } else {
+ return ``;
+ }
+ }
+ },
+ methods: {
+ // _getParam() {
+ // const { locations, scenetype, time } = this.formSearch;
+ // return {
+ // provincecode: locations.pCode,
+ // provincename: locations.pName,
+ // citycode: locations.cCode,
+ // cityname: locations.cName,
+ // districtcode: locations.dCode,
+ // districtname: locations.dName,
+ // starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'),
+ // scensetypeid: scenetype.value
+ // };
+ // },
+ editRow(row) {
+ this.$router.push(`evalutationEdit/${row.subTaskId}`);
+ },
+ setOptions(param) {
+ this.formSearch.locations = param.locations;
+ this.formSearch.scenetype = param.scenetype;
+ this.formSearch.sourceType = param.sourceType;
+ this.$refs.tableRef.onSearch();
+ },
+ onSearch(page, func) {
+ this.$refs.tableRef.clearSort();
+ this.fetchEvaluationRule(this.area).then(() => {
+ evaluateApi.fetchAutoEvaluation(this.area).then((res) => {
+ if (res.data) {
+ this.tableData = res.data
+ .filter((d) => {
+ return d.evaluation != null;
+ })
+ .slice(0, 10);
+ this.tableData.sort((a, b) => {
+ const s1 = a.evaluation
+ ? parseInt(a.evaluation.resultscorebef)
+ : 0;
+ const s2 = b.evaluation
+ ? parseInt(b.evaluation.resultscorebef)
+ : 0;
+ return s1 - s2;
+ });
+ this.orginData = useCloned(this.tableData).cloned;
+ this.getFilters(res.data);
+ if (typeof func === 'function') {
+ func({ data: this.tableData });
+ }
+ } else {
+ this.tableData = [];
+ this.orginData = [];
+ if (typeof func === 'function') {
+ func({ data: this.tableData });
+ }
+ }
+ });
+ });
+ },
+ fetchEvaluationRule() {
+ const param = {
+ // 鑷姩璇勪及绫诲瀷
+ taskTypeId: 99,
+ ...this.area
+ };
+ // 鑾峰彇璇勪及鎬昏鍒�
+ return evaluateApi.fetchEvaluationRule(param).then((res) => {
+ if (res.data.length > 0) {
+ this.evaluationRule = res.data[0];
+ // 鑾峰彇鍏蜂綋瀛愯鍒�
+ return evaluateApi
+ .getSubRules(this.evaluationRule.guid)
+ .then((res) => {
+ this.evaluationSubRule = res.data;
+ // 鏌ユ壘鍙鍏ュ緱鍒嗙殑瑙勫垯id
+ for (const key in this.ruleName) {
+ const value = this.ruleName[key];
+ const subrule = this.evaluationSubRule.find((v) => {
+ return v.itemname == value.name;
+ });
+ if (subrule) {
+ value.id = subrule.guid;
+ }
+ }
+ });
+ }
+ });
+ },
+
+ getFilters(data) {
+ const townList = [];
+ data.forEach((e) => {
+ if (townList.indexOf(e.tname) == -1) {
+ townList.push(e.tname);
+ }
+ });
+ this.townFilters = townList.map((v) => {
+ return { text: v, value: v };
+ });
+ },
+ toCode(row, column) {
+ if (row.evaluation) {
+ return envCreditCode(row.evaluation.resultscorebef);
+ } else {
+ return '';
+ }
+ },
+ timeFormat(row, column) {
+ const time = row.subTaskTime;
+ if (time) {
+ return dayjs(time).format('MM-DD');
+ } else {
+ return '';
+ }
+ },
+ filterHandler(value, row, column) {
+ const property = column['property'];
+ return row[property] === value;
+ },
+ sortScore(a, b) {
+ const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
+ const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
+ return s1 - s2;
+ },
+ handleSortChange({ column, prop, order }) {
+ console.log(column, prop, order);
+ if (order == null) {
+ this.orginData.forEach((e, i) => {
+ this.tableData[i] = e;
+ });
+ } else if (prop == 'evaluation.resultscorebef') {
+ this.tableData.sort((a, b) => {
+ const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
+ const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
+ if (order == 'ascending') {
+ return s1 - s2;
+ } else if (order == 'descending') {
+ return s2 - s1;
+ }
+ });
+ } else if (prop == 'sceneIndex') {
+ this.tableData.sort((a, b) => {
+ if (order == 'ascending') {
+ if (a.sceneIndex === b.sceneIndex) {
+ return a.subTaskTime > b.subTaskTime ? 1 : -1;
+ } else {
+ return a.sceneIndex - b.sceneIndex;
+ }
+ } else if (order == 'descending') {
+ if (a.sceneIndex === b.sceneIndex) {
+ return b.subTaskTime > a.subTaskTime ? 1 : -1;
+ } else {
+ return b.sceneIndex - a.sceneIndex;
+ }
+ }
+ });
+ } else if (prop == 'subTaskTime') {
+ this.tableData.sort((a, b) => {
+ if (order == 'ascending') {
+ return a[prop] > b[prop] ? 1 : -1;
+ // return dayjs(a).isAfter(dayjs(b)) ? 1 : -1;
+ } else if (order == 'descending') {
+ return b[prop] > a[prop] ? 1 : -1;
+ // return dayjs(b).isAfter(dayjs(a)) ? 1 : -1;
+ }
+ });
+ }
+ }
+ },
+ mounted() {
+ this.addRefreshEvent(this.$refs.tableRef.doLayout);
+ }
+};
+</script>
+<style scoped></style>
--
Gitblit v1.9.3