yanghao 1 天之前
父節點
當前提交
7c9e0947c6
共有 2 個文件被更改,包括 24 次插入7 次删除
  1. 5 4
      src/views/pms/qhse/index.vue
  2. 19 3
      src/views/pms/qhse/kanban/index.vue

+ 5 - 4
src/views/pms/qhse/index.vue

@@ -21,7 +21,7 @@
               v-model="queryParams.expired"
               placeholder="请选择是否过期"
               clearable
-              style="width: 150px">
+              style="width: 120px">
               <el-option
                 v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
                 :key="dict.value"
@@ -35,7 +35,7 @@
               v-model="queryParams.alertWarn"
               placeholder="请选择是否预警"
               clearable
-              style="width: 150px">
+              style="width: 120px">
               <el-option
                 v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
                 :key="dict.value"
@@ -102,7 +102,7 @@
         <zm-table
           :loading="loading"
           :data="list"
-          height="calc(46vh - 140px)"
+          height="calc(46vh - 130px)"
           :show-overflow-tooltip="true"
           :row-style="tableRowStyle"
           :row-class-name="tableRowClassName">
@@ -219,7 +219,7 @@
               v-model="formData.deptId"
               :data="deptList2"
               :props="defaultProps"
-              check-strictly
+              :check-strictly="false"
               node-key="id"
               filterable
               placeholder="请选择所在部门" />
@@ -624,6 +624,7 @@ const handleAdd = () => {
   isEdit.value = false
   dialogTitle.value = '新增台账'
   resetForm()
+  formData.value.deptId = userStore.getUser.deptId // 默认选择当前用户的部门
   dialogVisible.value = true
 }
 

+ 19 - 3
src/views/pms/qhse/kanban/index.vue

@@ -50,8 +50,6 @@ type SummaryTabValue = 'home' | 'certificate'
 const userStore = useUserStore()
 
 const type = ref('day')
-const nowDate = new Date()
-const curYear = nowDate.getFullYear()
 
 const handelChange = (value: any) => {
   console.log('Selected time:', value)
@@ -99,8 +97,26 @@ const summaryTabs: Array<{ label: string; value: SummaryTabValue }> = [
   { label: '首页看板', value: 'home' },
   { label: '证书信息', value: 'certificate' }
 ]
+
 const activeSummaryTab = ref<SummaryTabValue>('home')
-const summaryDate = ref(null)
+
+watch(
+  () => activeSummaryTab.value,
+  async (value) => {
+    if (value === 'certificate') {
+      await getCertificateBoardList()
+    } else {
+      nextTick(() => {
+        initHazardChart()
+        initSafeDayChart()
+        initSocChart()
+        resizeHazardChart()
+        resizeSafeDayChart()
+        resizeSocChart()
+      })
+    }
+  }
+)
 
 const pageTitle = computed(() =>
   activeSummaryTab.value === 'certificate' ? '证书信息看板' : 'QHSE管理看板'