Browse Source

多语言调整,故障上报点击处理,计划调整

lipenghui 1 month ago
parent
commit
31e0eb3720

+ 1 - 1
src/locales/zh-CN.ts

@@ -850,7 +850,7 @@ export default {
     createTime:'创建时间',
   },
   info:{
-    deviceClass:'设备分类:',
+    deviceClass:'设备分类',
     classHolder:'请选择设备分类',
     faultySystem:'故障系统',
     faultySystemHolder:'请输入故障系统',

+ 9 - 1
src/views/pms/failure/IotFailureReportForm.vue

@@ -11,10 +11,18 @@
       <el-col :span="12">
       <el-form-item :label="t('faultForm.device')" prop="deviceName">
         <el-select
+          v-if="disabled"
           :disabled="disabled"
           v-model="formData.deviceName"
           :placeholder="t('faultForm.choose')"
-          @click="disabled?null:openForm"
+          clearable
+          @clear="handleClear"
+        />
+        <el-select
+          v-if="!disabled"
+          v-model="formData.deviceName"
+          :placeholder="t('faultForm.choose')"
+          @click="openForm"
           clearable
           @clear="handleClear"
         />

+ 17 - 10
src/views/pms/information/index.vue

@@ -8,15 +8,16 @@
       :inline="true"
       label-width="68px"
     >
-      <el-form-item :label="t('info.deviceClass')" prop="deviceType" style="margin-left: 25px">
-        <el-select
+      <el-form-item :label="t('deviceForm.category')" prop="deviceType" style="width: 15vw" >
+        <el-tree-select
           v-model="queryParams.deviceType"
-          :placeholder="t('info.classHolder')"
-          clearable
-          class="!w-240px"
-        >
-          <el-option label="请选择字典生成" value="" />
-        </el-select>
+          :data="productClassifyList"
+          :props="defaultProps"
+          check-strictly
+          node-key="id"
+          :placeholder="t('deviceForm.categoryHolder')"
+          filterable
+        />
       </el-form-item>
       <el-form-item :label="t('info.faultySystem')" prop="failureSystem">
         <el-input
@@ -126,6 +127,8 @@ import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { IotInformationDbApi, IotInformationDbVO } from '@/api/pms/information'
 import IotInformationDbForm from './IotInformationDbForm.vue'
+import {defaultProps, handleTree} from "@/utils/tree";
+import * as ProductClassifyApi from "@/api/pms/productclassify";
 
 /** 故障知识库 列表 */
 defineOptions({ name: 'IotInformationDb' })
@@ -135,6 +138,7 @@ const { t } = useI18n() // 国际化
 
 const loading = ref(true) // 列表的加载中
 const list = ref<IotInformationDbVO[]>([]) // 列表的数据
+const productClassifyList = ref<Tree[]>([]) // 树形结构
 const total = ref(0) // 列表的总页数
 const queryParams = reactive({
   pageNo: 1,
@@ -211,7 +215,10 @@ const handleExport = async () => {
 }
 
 /** 初始化 **/
-onMounted(() => {
-  getList()
+onMounted(async () => {
+  productClassifyList.value = handleTree(
+    await ProductClassifyApi.IotProductClassifyApi.getSimpleProductClassifyList()
+  )
+  await getList()
 })
 </script>

+ 8 - 5
src/views/pms/inspect/plan/IotInspectPlan.vue

@@ -207,12 +207,15 @@ const formRules = reactive({
 // 拖动状态管理
 const items = ref([])
 const deviceChoose = (rows) => {
-  // formData.value.deviceId = row.id
-  // formData.value.deviceName = row.deviceName
-  // formData.value.deptId = row.deptId
-  // deviceLabel.value = row.deviceName
   debugger
-  list.value = rows
+  rows.forEach((it) => {
+    const ifExist = list.value.find((item) => item.id === it.id)
+    if (!ifExist) {
+      list.value.push(it)
+      console.log(JSON.stringify(it))
+    }
+  })
+  // list.value = rows
 }
 
 const viewRoute = (itemJson) => {