Browse Source

列表数据存放至仓库

hm 2 weeks ago
parent
commit
978633103a

+ 74 - 0
src/store/common.js

@@ -17,6 +17,80 @@ export const useCommonStore = defineStore('common', {
       alertMessage: '', //提示框内容
       alertKey: 0, //更新此值即可重启倒计时
       timeSelect: [], //图例时间选择器
+      tableData: [
+        {
+          name: '长宁区发生不明原因肺炎',
+          riskLevel: 'A级',
+          reportUnit: '长宁区疾病预防控制中心',
+          reportTime: '2024-07-15 08:00',
+          address: 'xxxxxxxxxxxx',
+          disposalUnit: '长宁区疾控',
+          numberOfCases: '3例',
+          keyLocations: 1,
+          keyGroups: 1,
+          newstatus: '处置中'
+        },
+        {
+          name: '长宁区发生猴痘事件',
+          riskLevel: 'A级',
+          reportUnit: '长宁区疾病预防控制中心',
+          reportTime: '2024-09-30 09:12',
+          address: 'xx街道xx号',
+          disposalUnit: '长宁区疾控',
+          numberOfCases: '3例',
+          keyLocations: 1,
+          keyGroups: 0,
+          newstatus: '处置中'
+        },
+        {
+          name: '普陀区发生疟疾事件',
+          riskLevel: 'B级',
+          reportUnit: '普陀区疾病预防控制中心',
+          reportTime: '2024-09-30 10:23',
+          address: 'xx街道xx号',
+          disposalUnit: '长宁区疾控',
+          numberOfCases: '3例',
+          keyLocations: 1,
+          keyGroups: 0,
+          newstatus: '处置中'
+        },
+        {
+          name: '黄浦区发生猩红热事件',
+          riskLevel: 'B级',
+          reportUnit: '黄浦区疾病预防控制中心',
+          reportTime: '2024-09-26 14:03',
+          address: 'xx街道xx号',
+          disposalUnit: '长宁区疾控',
+          numberOfCases: '3例',
+          keyLocations: 1,
+          keyGroups: 0,
+          newstatus: '处置中'
+        },
+        {
+          name: '徐汇区发生聚集性呕吐腹泻事件',
+          riskLevel: 'D级',
+          reportUnit: '徐汇区疾病预防控制中心',
+          reportTime: '2024-09-26 16:33',
+          address: 'xx街道xx号',
+          disposalUnit: '长宁区疾控',
+          numberOfCases: '3例',
+          keyLocations: 1,
+          keyGroups: 0,
+          newstatus: '处置中'
+        },
+        {
+          name: '发热门诊就诊量',
+          riskLevel: 'C级',
+          reportUnit: '静安区疾病预防控制中心',
+          reportTime: '2024-09-25 16:40',
+          address: 'xx街道xx号',
+          disposalUnit: '长宁区疾控',
+          numberOfCases: '3例',
+          keyLocations: 1,
+          keyGroups: 0,
+          newstatus: '已核实'
+        }
+      ], //首屏列表
       riskTableItem:{}, //风险列表点击项
     }
   },

+ 1 - 1
src/store/disposalProgress.js

@@ -54,7 +54,7 @@ export const useDisposalProgressStore = defineStore('disposalProgress', {
           nodeName: '风险人员和环境排查管控',
           state: '进行中',
           children: [
-            { nodeId: '3-1', level: 2, nodeName: '段伟', state: '已完成', isActive: false, },
+            { nodeId: '3-1', level: 2, nodeName: '段伟', state: '已完成', isActive: false, collapsed: true, },
             { nodeId: '3-2', level: 2, nodeName: '陆成奇', state: '已完成', isActive: false, },
             {
               nodeId: '3-3',

+ 1 - 0
src/views/index.vue

@@ -108,6 +108,7 @@ function setActive(index, item) {
     commonStore.activeModule = "风险总览"
   }else{
     commonStore.activeModule = ""
+    commonStore.riskTableItem =  commonStore.tableData[0]
   }
   // handleJtlxPoints(index === 0)
 }

+ 2 - 2
src/views/left/dialog/components/DisposalProgressContentSecond.vue

@@ -97,7 +97,7 @@ function ensureCollapsedFlag(nodes) {
   nodes.forEach(node => {
     if (node.children?.length) {
       if (!Object.prototype.hasOwnProperty.call(node, 'collapsed')) {
-        node.collapsed = true
+        node.collapsed = false
       }
       ensureCollapsedFlag(node.children)
     }
@@ -188,7 +188,7 @@ function isLeafNode(d) {
 
 // **初始化 X6 画布**
 onMounted(() => {
-  ensureCollapsedFlag(disposalProgressStore.nodeData)
+  // ensureCollapsedFlag(disposalProgressStore.nodeData)
 })
 </script>
 

+ 1 - 1
src/views/left/dialog/components/common/DisposalChildBox.vue

@@ -12,7 +12,7 @@
           </div>
         </div>
         <transition name="collapse-fade" @before-enter="beforeEnter" @enter="enter" @leave="leave">
-          <DisposalChildBox v-if="item?.children?.length > 0 && !item.collapsed" :data="item" @nodeClick="handleNodeClick" />
+          <DisposalChildBox v-if="item?.children?.length > 0 && item.collapsed" :data="item" @nodeClick="handleNodeClick" />
         </transition>
         <!-- <DisposalChildBox v-if="item?.children?.length > 0 && !item.collapsed" :data="item" @nodeClick="handleNodeClick"></DisposalChildBox> -->
       </div>

+ 7 - 82
src/views/left/modules/common/RiskTableContent.vue

@@ -40,80 +40,7 @@ const timeButtons = ref([
   { id: 3, name: '年', active: true }
 ])
 
-const tableData = ref([
-  {
-    name: '长宁区发生不明原因肺炎',
-    riskLevel: 'A级',
-    reportUnit: '长宁区疾病预防控制中心',
-    reportTime: '2024-07-15 08:00',
-    address: 'xxxxxxxxxxxx',
-    disposalUnit: '长宁区疾控',
-    numberOfCases: '3例',
-    keyLocations: 1,
-    keyGroups: 1,
-    newstatus: '处置中'
-  },
-  {
-    name: '长宁区发生猴痘事件',
-    riskLevel: 'A级',
-    reportUnit: '长宁区疾病预防控制中心',
-    reportTime: '2024-09-30 09:12',
-    address: 'xx街道xx号',
-    disposalUnit: '长宁区疾控',
-    numberOfCases: '3例',
-    keyLocations: 1,
-    keyGroups: 0,
-    newstatus: '处置中'
-  },
-  {
-    name: '普陀区发生疟疾事件',
-    riskLevel: 'B级',
-    reportUnit: '普陀区疾病预防控制中心',
-    reportTime: '2024-09-30 10:23',
-    address: 'xx街道xx号',
-    disposalUnit: '长宁区疾控',
-    numberOfCases: '3例',
-    keyLocations: 1,
-    keyGroups: 0,
-    newstatus: '处置中'
-  },
-  {
-    name: '黄浦区发生猩红热事件',
-    riskLevel: 'B级',
-    reportUnit: '黄浦区疾病预防控制中心',
-    reportTime: '2024-09-26 14:03',
-    address: 'xx街道xx号',
-    disposalUnit: '长宁区疾控',
-    numberOfCases: '3例',
-    keyLocations: 1,
-    keyGroups: 0,
-    newstatus: '处置中'
-  },
-  {
-    name: '徐汇区发生聚集性呕吐腹泻事件',
-    riskLevel: 'D级',
-    reportUnit: '徐汇区疾病预防控制中心',
-    reportTime: '2024-09-26 16:33',
-    address: 'xx街道xx号',
-    disposalUnit: '长宁区疾控',
-    numberOfCases: '3例',
-    keyLocations: 1,
-    keyGroups: 0,
-    newstatus: '处置中'
-  },
-  {
-    name: '发热门诊就诊量',
-    riskLevel: 'C级',
-    reportUnit: '静安区疾病预防控制中心',
-    reportTime: '2024-09-25 16:40',
-    address: 'xx街道xx号',
-    disposalUnit: '长宁区疾控',
-    numberOfCases: '3例',
-    keyLocations: 1,
-    keyGroups: 0,
-    newstatus: '已核实'
-  }
-])
+
 
 let activeIndex1 = ref(1)
 let activeIndex2 = ref(2)
@@ -123,7 +50,7 @@ const scrollBoard = ref(null)
 const riskTableconfig = ref({
   indexHeader: '编号',
   header: ['事件名称', '风险等级', '报告单位', '报告时间', '发生地点', '处置单位', '病例数', '重点场所', '重点人群', '最新状态'],
-  data: tableData.value.map(row => [
+  data: commonStore.tableData.map(row => [
     row.name,
     `<div class="risk-badge risk-${row.riskLevel}"></div>`, // 自定义风险等级
     row.reportUnit,
@@ -181,13 +108,11 @@ function handleRowClick(config) {
   console.log('点击行数据:', config)
   // 获取当前点击行的数据
   const rowIndex = config.rowIndex
-  if (rowIndex) {
-    if (rowIndex >= 0 && rowIndex < tableData.value.length) {
-      const rowData = toRaw(tableData.value[config.rowIndex])
-      console.log('当前点击行的数据:', rowData)
-      commonStore.riskTableItem=rowData
-      handleRowAction(rowData) // 执行点击后的逻辑
-    }
+ 
+  const rowData = commonStore.tableData[rowIndex]
+  if (rowData) {
+    commonStore.riskTableItem = toRaw(rowData)
+    handleRowAction(rowData)
   }
 }
 

+ 1 - 1
src/views/right/components/reportHandle/comp/riskHandleBottom.vue

@@ -435,7 +435,7 @@ onMounted(() => {
 
 ::v-deep(.el-pagination .el-pager li) {
   background-color: transparent;
-  /* color: #598ab5; */
+  color: #2b91c3;
   border: none;
 }