فهرست منبع

增加搜索条件

xzc 5 روز پیش
والد
کامیت
e70835249e

+ 63 - 18
yudao-ui-admin-vue3/src/views/pressure2/pipescheduling/index.vue

@@ -140,24 +140,30 @@
       </div>
 
       <!-- 锅炉相关查询条件 -->
-      <div class="bg-gray-50 p-3 rounded mt-2">
-        <el-form-item label="管道归类" prop="typeList" class="mb-2">
-          <div class="flex items-center flex-1">
-            <el-checkbox-group
-              v-model="queryParams.typeList"
-              class="flex flex-wrap gap-2"
-              @change="handleTypeListChange"
-            >
-              <el-checkbox
-                v-for="dict in containerTypeOptions"
-                :key="dict.value"
-                :label="dict.label"
-                :value="dict.value"
-              />
-            </el-checkbox-group>
-          </div>
+        <el-form-item label="管道归类" prop="typeList" style="width: 200vh;">
+          <el-checkbox-group
+            v-model="queryParams.typeList"
+            class="flex flex-wrap gap-2"
+            @change="handleTypeListChange"
+          >
+            <el-checkbox
+              v-for="dict in containerTypeOptions"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-checkbox-group>
+        </el-form-item>
+        <el-form-item label="管道级别" prop="pipeClassList">
+          <el-checkbox-group v-model="queryParams.pipeClassList" class="flex flex-wrap gap-2">
+            <el-checkbox
+              v-for="level in availablePipeLevelOptions"
+              :key="level.value"
+              :label="level.label"
+              :value="level.value"
+            />
+          </el-checkbox-group>
         </el-form-item>
-      </div>
 
       <!-- 操作按钮 -->
       <div class="flex justify-between mt-3">
@@ -456,7 +462,7 @@ import PipePlanScheduleDialog from "@/views/pressure2/pipescheduling/components/
 import Detail from "@/views/pressure2/pipescheduling/detail.vue";
 import PipelineDetailList from "@/views/pressure2/pipescheduling/components/PipelineDetailList.vue";
 import {formatDate} from "@/utils/formatTime";
-import {ref} from "vue";
+import {ref, computed} from "vue";
 import {PipeEquipmentDetailVO, PipeEquipmentVO} from "@/api/pressure2/pipeequipment";
 import {EquipBoilerSchedulingVO} from "@/api/pressure2/equipboilerscheduling";
 import download from "@/utils/download";
@@ -480,6 +486,7 @@ const queryParams = ref({
   equipDistrict: undefined as number[] | undefined,
   equipStreet: undefined as number[] | undefined,
   typeList: [] as string[],
+  pipeClassList: [] as string[], // 管道最高级别(GC1/GC2/GC3/GB1/GB2/GA1/GA2)
   nextDate: [
     dayjs('1900-01-01').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
     dayjs().add(1, 'month').endOf('month').endOf('day').format('YYYY-MM-DD HH:mm:ss')
@@ -500,8 +507,39 @@ const month = ref<string>(dayjs().add(1, 'month').endOf('month').endOf('day').fo
 const detailDialogRef = ref() // 详情弹窗引用
 // 添加锅炉类型字典选项变量
 const containerTypeOptions = getStrDictOptions(DICT_TYPE.PIPE_TYPE)
+// 管道级别(最高级别)字典选项
+const pipeLevelOptions = getStrDictOptions(DICT_TYPE.PRESSURE2_PIPE_LEVEL)
 const selectedTypeList = ref<StringDictDataType[]>([]) // 选中的锅炉归类
 
+/**
+ * 管道类型 -> 级别前缀映射
+ * GC 开头:工业管道;GB 开头:公用管道;GA 开头:长输管道
+ */
+const pipeTypeLabelToPrefix = (label: string): string => {
+  if (!label) return ''
+  if (label.includes('工业')) return 'GC'
+  if (label.includes('公用')) return 'GB'
+  if (label.includes('长输')) return 'GA'
+  return ''
+}
+
+/** 根据已选管道类型获取对应的管道级别选项(按前缀过滤,合并去重) */
+const availablePipeLevelOptions = computed<StringDictDataType[]>(() => {
+  const result: StringDictDataType[] = []
+  const seen = new Set<string>()
+  selectedTypeList.value.forEach((dict) => {
+    const prefix = pipeTypeLabelToPrefix(dict.label)
+    if (!prefix) return
+    pipeLevelOptions.forEach((opt) => {
+      if (opt.value.startsWith(prefix) && !seen.has(opt.value)) {
+        seen.add(opt.value)
+        result.push(opt)
+      }
+    })
+  })
+  return result
+})
+
 const selectedLegalList = ref([])
 const selectedYearList = ref([])
 const mainTableRef = ref() // 主表格引用
@@ -557,6 +595,8 @@ const resetQuery = () => {
 
   // 清空选中的容器归类对象
   selectedTypeList.value = []
+  // 重置管道级别选项
+  queryParams.value.pipeClassList = []
 
   // 清除表格排序
   mainTableRef.value?.clearSort()
@@ -645,6 +685,11 @@ const handleStreetClear = () => {
 /** 处理锅炉归类变化 */
 const handleTypeListChange = (values: string[]) => {
   selectedTypeList.value = containerTypeOptions.filter((dict) => values.includes(dict.value))
+  // 取消选中的管道类型,需要清除其对应的管道级别选项
+  const validLevelValues = new Set(availablePipeLevelOptions.value.map((opt) => opt.value))
+  queryParams.value.pipeClassList = (queryParams.value.pipeClassList || []).filter((v) =>
+    validLevelValues.has(v)
+  )
 }
 /*
 

+ 12 - 10
yudao-ui-admin-vue3/src/views/pressure2/schedule/components/ShiftSchedule.vue

@@ -14,6 +14,18 @@
           </template>
         </el-table-column>
 
+        <!-- 使用单位 - 移到星期前面 -->
+        <el-table-column label="使用单位" prop="unitName" width="150" align="center" show-overflow-tooltip sortable />
+
+        <!-- 管线长度 - 移到星期前面 -->
+        <el-table-column label="管线长度 (m)" prop="pipeLengthTotal" width="120" align="center">
+          <template #default="{ row }">
+            <span class="font-mono font-semibold text-blue-800">
+              {{ formatPipeLength(row.pipeLengthTotal) }}
+            </span>
+          </template>
+        </el-table-column>
+
         <el-table-column label="星期" prop="week" width="80" align="center" />
 
         <!-- 检验员 -->
@@ -53,7 +65,6 @@
             {{ row.checkType === '100' ? '定期检验' : '年度检查' }}
           </template>
         </el-table-column>
-        <el-table-column label="使用单位" prop="unitName" width="150" align="center" show-overflow-tooltip sortable />
         <el-table-column label="管道使用地址" prop="pipeAddress" width="200" align="center" show-overflow-tooltip />
         <el-table-column label="联系人" prop="contact" width="100" align="center" />
         <el-table-column label="电话" prop="contactPhone" width="130" align="center" />
@@ -70,15 +81,6 @@
           </template>
         </el-table-column>
 
-        <!-- 管线长度 -->
-        <el-table-column label="管线长度 (m)" prop="pipeLengthTotal" width="120" align="center">
-          <template #default="{ row }">
-            <span class="font-mono font-semibold text-blue-800">
-              {{ formatPipeLength(row.pipeLengthTotal) }}
-            </span>
-          </template>
-        </el-table-column>
-
         <el-table-column label="区域街道" prop="equipStreetName" width="120" align="center">
           <template #default="{ row }">
             <span>