Procházet zdrojové kódy

删除部分无用代码

gongtianxiao před 1 měsícem
rodič
revize
77db133cd4

+ 1 - 5
src/api/enterpriseList.js

@@ -4,7 +4,6 @@ import { COLUMN_ID, MODEL_ID } from '@/config';
 
 export const getEnterprise = (FormData) => {
   return service({
-    // url: '/proxy_dms/content/selectContentList',
     url: '/content/selectContentList',
     method: 'POST',
     data: FormData
@@ -13,7 +12,6 @@ export const getEnterprise = (FormData) => {
 
 export const updateAudit = (data) => {
   return service({
-    // url: '/proxy_dms/content/updateAudit',
     url: '/content/updateAudit',
     method: 'POST',
     data,
@@ -26,7 +24,6 @@ export const updateContent = (data) => {
     payload.content = JSON.stringify(payload.content);
   }
   return service({
-    // url: '/proxy_dms/content/updateContent',
     url: '/content/updateContent',
     method: 'POST',
     data: payload,
@@ -39,7 +36,6 @@ const addContent = (data) => {
     payload.content = JSON.stringify(payload.content);
   }
   return service({
-    // url: '/proxy_dms/content/addContent',
     url: '/content/addContent',
     method: 'POST',
     data: payload,
@@ -85,4 +81,4 @@ export async function submitAssetEdit(item, patch, { auditorComment = '修改送
   });
 
   return contentBody;
-}
+}

+ 2 - 2
src/components/layout/NotificationModal.vue

@@ -169,7 +169,7 @@ watch(unreadCount, (count) => {
 /** 打开弹窗:优先展示缓存,后台轻量同步(不强制拉全量资产) */
 const syncOnOpen = async () => {
   try {
-    await notificationStore.refresh({ forceAssets: false });
+    await notificationStore.refresh();
   } catch (e) {
     showError(e?.message || e?.msg || '通知加载失败,请稍后重试');
   }
@@ -178,7 +178,7 @@ const syncOnOpen = async () => {
 /** 手动刷新:强制拉全量资产并同步 */
 const refreshFull = async () => {
   try {
-    await notificationStore.refresh({ forceAssets: true });
+    await notificationStore.refresh();
   } catch (e) {
     showError(e?.message || e?.msg || '通知加载失败,请稍后重试');
   }

+ 1 - 1
src/components/layout/PageHeader.vue

@@ -91,7 +91,7 @@ const goManage = () => {
 };
 
 onMounted(() => {
-  notificationStore.refresh({ forceAssets: false }).catch(() => {});
+  notificationStore.refresh().catch(() => {});
 });
 </script>
 

+ 1 - 6
src/components/manage/asset/PickAssetModal.vue

@@ -86,11 +86,6 @@ const props = defineProps({
     type: Array,
     default: () => [],
   },
-  /** 顶栏当前企业,用于限定可选资产范围 */
-  currentEnterprise: {
-    type: String,
-    default: '',
-  },
 });
 
 const emit = defineEmits(['update:visible', 'confirm']);
@@ -136,7 +131,7 @@ const matchKeyword = (item, kw) => {
 
 const scopedList = computed(() =>
   pickableList.value.filter((item) =>
-    assetBelongsToManageScope(item, props.currentEnterprise)
+    assetBelongsToManageScope(item)
   )
 );
 

+ 2 - 3
src/components/manage/pages/ManageBasicArchive.vue

@@ -187,7 +187,6 @@
     <PickAssetModal
       v-model:visible="showPickModal"
       :exclude-ids="queueIds"
-      :current-enterprise="currentEnterprise"
       @confirm="handlePickConfirm"
     />
     <MonthlyEditModal
@@ -702,7 +701,7 @@ const handlePickConfirm = (pickedItems) => {
   pickedItems.forEach((item) => {
     const id = String(item.id);
     if (!id || !belongsToMonthlyQueue(item)) return;
-    if (!assetBelongsToManageScope(item, currentEnterprise.value)) return;
+    if (!assetBelongsToManageScope(item)) return;
     if (monthlyQueue.value.some((r) => String(r.id) === id)) return;
     monthlyQueue.value.push(item);
     added++;
@@ -966,7 +965,7 @@ onMounted(() => {
 
 const loadReportingState = async ({ resetQueue = false } = {}) => {
   await enterpriseStore.fetchReportProgress({ force: true });
-  await enterpriseStore.fetchList({ force: true });
+  await enterpriseStore.fetchList(true);
 
   if (resetQueue) {
     monthlyQueue.value = [];

+ 0 - 1
src/components/stats/ChartSpecial.vue

@@ -265,7 +265,6 @@ const topicCardList = ref([
 
 onMounted(() => {
   mq.addEventListener('change', onBreakpointChange);
-  enterpriseStore.fetchStatisticsList();
 });
 
 onUnmounted(() => {

+ 0 - 2
src/main.js

@@ -4,13 +4,11 @@ import router from './router'
 import { createPinia } from 'pinia'
 import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
 import '@/assets/common.css'
-import * as echarts from 'echarts'
 
 const pinia = createPinia()
 pinia.use(piniaPluginPersistedstate)
 
 const app = createApp(App)
-app.config.globalProperties.$echarts = echarts
 app.use(pinia)
 app.use(router)
 app.mount('#app')

+ 1 - 4
src/pages/HomePage.vue

@@ -26,7 +26,7 @@ import QueryFilter from '@/components/stats/QueryFilter.vue';
 import ChartSpecial from '@/components/stats/ChartSpecial.vue';
 import MonthlyReport from '@/components/stats/MonthlyReport.vue';
 import MetricCard from '@/components/stats/MetricCard.vue';
-import { computed, onMounted } from 'vue';
+import { computed } from 'vue';
 import { useEnterpriseStore } from '@/store/enterprise';
 import { useFilterStore } from '@/store/filter';
 import { sumFieldToWan, sumFieldsToWan } from '@/utils/areaMath';
@@ -149,9 +149,6 @@ const metricCardList = computed(() => [
   },
 ]);
 
-onMounted(async () => {
-  await enterpriseStore.fetchStatisticsList();
-});
 </script>
 
 <style scoped>

+ 1 - 4
src/pages/Topic1Page.vue

@@ -74,7 +74,7 @@
 
 <script setup>
 import { showWarning } from '@/utils/message';
-import { ref, onMounted, computed, watch } from 'vue';
+import { ref, computed, watch } from 'vue';
 import { useRouter } from 'vue-router';
 import PageHeader from '@/components/layout/PageHeader.vue';
 import TopicPageHeader from '@/components/stats/TopicPageHeader.vue';
@@ -379,9 +379,6 @@ const topPieChartsList = computed(() => [
   },
 ]);
 
-onMounted(() => {
-  enterpriseStore.fetchStatisticsList();
-});
 </script>
 
 <style scoped>

+ 1 - 5
src/pages/Topic2Page.vue

@@ -90,7 +90,7 @@
 <script setup>
 import { showSuccess, showWarning } from '@/utils/message';
 import { exportTableExcel } from '@/utils/exportExcel';
-import { computed, onMounted, ref, watch } from 'vue';
+import { computed, ref, watch } from 'vue';
 import { useRouter } from 'vue-router';
 import PageHeader from '@/components/layout/PageHeader.vue';
 import TopicPageHeader from '@/components/stats/TopicPageHeader.vue';
@@ -351,10 +351,6 @@ const handleExport = () => {
 };
 
 watch(() => filterStore.selectGroup, resetLocalFilters);
-
-onMounted(() => {
-  enterpriseStore.fetchStatisticsList();
-});
 </script>
 
 <style scoped>

+ 1 - 5
src/pages/Topic3Page.vue

@@ -177,7 +177,7 @@
 <script setup>
 import { showSuccess, showWarning } from '@/utils/message';
 import { exportTableExcel } from '@/utils/exportExcel';
-import { computed, onMounted, ref, watch } from 'vue';
+import { computed, ref, watch } from 'vue';
 import { useRouter } from 'vue-router';
 import PageHeader from '@/components/layout/PageHeader.vue';
 import TopicPageHeader from '@/components/stats/TopicPageHeader.vue';
@@ -609,10 +609,6 @@ const handleExport = () => {
 };
 
 watch(() => filterStore.selectGroup, resetLocalFilters);
-
-onMounted(() => {
-  enterpriseStore.fetchStatisticsList();
-});
 </script>
 
 <style scoped>

+ 0 - 13
src/store/enterprise.js

@@ -191,19 +191,6 @@ export const useEnterpriseStore = defineStore('enterprise', {
       await useNotificationStore().syncAfterReportChange();
     },
 
-    updateApprovedItem(id, patch) {
-      const list = this.listsByState[REPORT_STATE.APPROVED];
-      const index = list.findIndex(
-        (item) => String(item.id) === String(id) || String(item.c_bh || '') === String(id)
-      );
-      if (index < 0) return false;
-      this.listsByState[REPORT_STATE.APPROVED][index] = {
-        ...list[index],
-        ...patch,
-      };
-      return true;
-    },
-
     getAssetEditDraft(assetId) {
       return this.assetEditDrafts[String(assetId)] || null;
     },

+ 2 - 21
src/utils/manageContext.js

@@ -11,28 +11,9 @@ export const resolveManageEnterprise = (userInfo) =>
   || userInfo?.orgName
   || DEFAULT_MANAGE_ENTERPRISE;
 
-/** 资产是否属于当前企业/集团管辖范围(新增上报资产弹窗用) */
+/** 资产是否属于当前管理集团管辖范围 */
 export const assetBelongsToManageScope = (item) => {
-  // 优先以所属青浦集团(c_ssqpjt)匹配当前管理集团
   const filterStore = useFilterStore();
   const qpGroup = String(item?.c_ssqpjt ?? '').trim();
-  if (qpGroup && qpGroup === filterStore.selectManageGroup) {
-    return true;
-  }
-
-  // // 原逻辑(注释保留)
-  // const target = String(enterprise ?? '').trim();
-  // if (!target) return true;
-  //
-  // const qymc = String(item.c_qymc ?? '').trim();
-  // const ssjt = String(item.c_ssjt ?? '').trim();
-  //
-  // if (qymc === target || ssjt === target) return true;
-  // if (qymc.includes(target) || target.includes(qymc)) return true;
-  //
-  // if (target === DEFAULT_MANAGE_ENTERPRISE && qpGroup === DEFAULT_MANAGE_GROUP) {
-  //   return true;
-  // }
-
-  return false;
+  return Boolean(qpGroup && qpGroup === filterStore.selectManageGroup);
 };

+ 0 - 7
src/utils/statsComparison.js

@@ -88,13 +88,6 @@ const sumSnapshotSqm = (snapshots, field) =>
 export const sumSnapshotsToWan = (snapshots, field) =>
   toWanSquareMeters(sumSnapshotSqm(snapshots, field));
 
-export const sumSnapshotFieldsToWan = (snapshots, fields) => {
-  const sumSqm = (snapshots || []).reduce((total, item) => {
-    return total + fields.reduce((sum, field) => sum + Number(item?.[field] || 0), 0);
-  }, 0);
-  return toWanSquareMeters(sumSqm);
-};
-
 export const countCertifiedSnapshots = (snapshots) =>
   (snapshots || []).filter((item) => String(item?.c_sfblcz ?? '').trim() === '是').length;