Browse Source

Merge remote-tracking branch 'origin/master'

lipenghui 2 weeks ago
parent
commit
cff7148abc

+ 15 - 5
src/router/modules/remaining.ts

@@ -331,16 +331,15 @@ const remainingRouter: AppRouteRecordRaw[] = [
     ]
   },
   {
-    path: '/FillOrderInfoS',
+    path: '/IotOpeationFill1',
     component: Layout,
-    name: 'FillOrderInfoS',
+    name: 'IotOpeationFill1',
     meta: {
-      hidden: true,
-      keepAlive: true
+      hidden: true
     },
     children: [
       {
-        path: 'template/detail/:deptId/:orderStatus/:createTime*',
+        path: 'template/detail',
         component: () => import('@/views/pms/iotopeationfill/index.vue'),
         name: 'IotOpeationFill1',
         meta: {
@@ -352,6 +351,17 @@ const remainingRouter: AppRouteRecordRaw[] = [
           activeMenu: '/template/info'
         }
       },
+    ]
+  },
+  {
+    path: '/FillOrderInfoS',
+    component: Layout,
+    name: 'FillOrderInfoS',
+    meta: {
+      hidden: true,
+      keepAlive: true
+    },
+    children: [
       {
         path: 'template/detail/:id/:deviceid/:status/:deptid/:createtime',
         component: () => import('@/views/pms/device/record/RecordInfo.vue'),

+ 1 - 0
src/utils/dict.ts

@@ -272,6 +272,7 @@ export enum DICT_TYPE {
   PMS_MAIN_WORK_ORDER_TYPE = 'pms_main_work_order_type', // 保养工单类型
   PMS_MAIN_WORK_ORDER_RESULT = 'pms_main_work_order_result', // 保养工单状态
   RQ_IOT_ISCOLLECTION = 'rq_iot_isCollection',//是否数采
+  RQ_IOT_MODEL_TEMPLATE_ATTR = 'rq_iot_model_template_attr',
   RQ_IOT_SUM = 'rq_iot_isSum',//是否累计
   PMS_ORDER_PROCESS_MODE = "pms_main_work_order_process_mode",  // 保养方式 0内部保养  1委外保养
   PMS_THING_MODEL_UNIT = 'pms_thing_model_unit', // pms属性模板单位

+ 19 - 53
src/views/pms/iotmainworkorder/IotMainWorkOrderAdd.vue

@@ -27,12 +27,6 @@
                 />
               </el-select>
             </el-form-item>
-            <!--
-            <el-form-item label="工单编号" prop="orderNumber">
-              <el-input type="text" v-model="formData.orderNumber" disabled/>
-            </el-form-item>
-            -->
-
           </el-col>
           <el-col :span="8">
             <el-form-item :label="t('mainPlan.MaintenanceCost')" prop="cost">
@@ -118,41 +112,7 @@
         <el-table-column :label="t('operationFillForm.sumTime')" align="center" prop="totalRunTime" :formatter="erpPriceTableColumnFormatter"/>
         <el-table-column :label="t('operationFillForm.sumKil')" align="center" prop="totalMileage" :formatter="erpPriceTableColumnFormatter"/>
         <el-table-column :label="t('mainPlan.MaintItems')" align="center" prop="name" />
-        <!--
-        <el-table-column label="运行里程" key="mileageRule" width="80">
-          <template #default="scope">
-            <el-switch
-              v-model="scope.row.mileageRule"
-              :active-value="0"
-              :inactive-value="1"
-            />
-          </template>
-        </el-table-column>
-        <el-table-column label="运行时间" key="runningTimeRule" width="80">
-          <template #default="scope">
-            <el-switch
-              v-model="scope.row.runningTimeRule"
-              :active-value="0"
-              :inactive-value="1"
-            />
-          </template>
-        </el-table-column>
-        <el-table-column label="自然日期" key="naturalDateRule" width="80">
-          <template #default="scope">
-            <el-switch
-              v-model="scope.row.naturalDateRule"
-              :active-value="0"
-              :inactive-value="1"
-            />
-          </template>
-        </el-table-column>
-        -->
         <el-table-column :label="t('iotMaintain.numberOfMaterials')" align="center" width="100">
-          <!--
-          <template #default="scope">
-            {{ hasMaterial(scope.row.bomNodeId) ? '是' : '否' }}
-          </template>
-          -->
           <template #default="scope">
             {{ getMaterialCount(scope.row.bomNodeId) }}
           </template>
@@ -171,16 +131,6 @@
                   {{ t('iotMaintain.remove') }}
                 </el-button>
               </div>
-              <!-- 新增配置按钮
-              <div style="margin-left: 12px">
-                <el-button
-                  link
-                  type="primary"
-                  @click="openConfigDialog(scope.row)"
-                >
-                  配置
-                </el-button>
-              </div> -->
               <div style="margin-left: 12px">
                 <el-button
                   link
@@ -669,6 +619,17 @@ const selectChoose = (selectedMaterial) => {
   });
 }
 
+// 新增方法:动态更新工单名称
+function updateWorkOrderName() {
+  if (list.value.length > 0) {
+    const firstDevice = list.value[0];
+    const currentDate = dayjs().format('YYYY-MM-DD');
+    formData.value.name = `${firstDevice.deviceCode} - ${firstDevice.deviceName} - ${currentDate} 保养工单`;
+  } else {
+    formData.value.name = `${dept.value.name} - 保养工单`;
+  }
+}
+
 const deviceChoose = async(selectedDevices) => {
   const newIds = selectedDevices.map(device => device.id)
   deviceIds.value = [...new Set([...deviceIds.value, ...newIds])]
@@ -724,8 +685,8 @@ const deviceChoose = async(selectedDevices) => {
       list.value.push(item)
     }
   })
-  // 新增完设备后 查询现有设备-bom明细中 所有设备配置的负责人姓名 逗号分隔
-  // await getDevicePersons();
+  // 更新工单名称
+  updateWorkOrderName();
 }
 
 /** 查看已经选择的物料 并编辑 */
@@ -1020,7 +981,7 @@ onMounted(async () => {
   const deptId = useUserStore().getUser.deptId
   // 查询当前登录人所属部门名称
   dept.value = await DeptApi.getDept(deptId)
-  formData.value.name = dept.value.name + ' - 保养工单'
+  // formData.value.name = dept.value.name + ' - 保养工单'
   deptUsers.value = await UserApi.getDeptUsersByDeptId(deptId)
   formData.value.deptId = deptId
   try {
@@ -1029,6 +990,9 @@ onMounted(async () => {
     const userInfo = wsCache.get(CACHE_KEY.USER)
     // 手工新增保养工单 责任人为当前登录人
     formData.value.responsiblePerson = userInfo.user.id;
+
+    // 初始化工单名称
+    updateWorkOrderName();
   } catch (error) {
     console.error('数据加载失败:', error)
     message.error('数据加载失败,请重试')
@@ -1052,6 +1016,8 @@ const handleDelete = async (str: string) => {
       devicePersonsMap.value.delete(deviceId) // 移除对应设备的责任人
       updateDevicePersonsDisplay() // 立即更新显示
     }
+    // 更新工单名称
+    updateWorkOrderName();
   } catch (error) {
     console.error('移除失败:', error)
     message.error('移除失败')

+ 6 - 5
src/views/pms/iotopeationfill/index.vue

@@ -164,13 +164,14 @@ import { IotInspectOrderApi, IotInspectOrderVO } from '@/api/pms/inspect/order'
 //import IotInspectOrderForm from './IotInspectOrderForm.vue'
 import {DICT_TYPE, getStrDictOptions} from "@/utils/dict";
 import DeptTree from "@/views/system/user/DeptTree.vue";
+import {onMounted, ref} from "vue";
 import {IotOpeationFillApi, IotOpeationFillVO} from "@/api/pms/iotopeationfill";
 import {useUserStore} from "@/store/modules/user";
 const { push } = useRouter()
-const { params, name } = useRoute() // 查询参数
-const deptId= params.deptId;
-const orderStatus = params.orderStatus;
-const createTime = params.createTime;
+const { query} = useRoute() // 查询参数
+const deptId= query.deptId;
+const orderStatus = query.orderStatus;
+const createTime = query.createTime;
 /** 巡检工单 列表 */
 defineOptions({ name: 'IotOpeationFill1' })
 
@@ -278,7 +279,7 @@ const handleExport = async () => {
 }
 
 /** 初始化 **/
-onMounted(() => {
+onMounted(async () => {
   if(deptId != null){
     queryParams.deptId = deptId;
   }

+ 10 - 5
src/views/pms/iotopeationfill/statistics.vue

@@ -221,14 +221,19 @@ const handleQuery = () => {
 
 const formRef = ref()
 const openForm = (deptId?:string,isFill?:string,createTime?:[]) => {
-  /*const type = '填写设备明细';
-  const id = queryParams.deptId
-  formRef.value.open(type,id)*/
-
   push({ name: 'FillOrderInfo2',params:{deptId,isFill,createTime}})
 }
 const openFill = (deptId?:string,orderStatus?:string,createTime?:[]) => {
-  push({ name: 'IotOpeationFill1',params:{deptId,orderStatus,createTime}})
+  push({
+    name: 'IotOpeationFill1',
+    query: {  // 使用query传递参数,而非params
+      deptId,
+      orderStatus,
+      // 数组可以直接传递,会自动序列化
+      createTime: createTime ? createTime.join(',') : undefined
+      // 建议将数组转为字符串,避免路由参数格式问题
+    }
+  })
 }
 
 

+ 274 - 24
src/views/pms/maintenance/MainPlanDeviceList.vue

@@ -45,11 +45,13 @@
           :data="list"
           :stripe="true"
           ref="tableRef"
-          :show-overflow-tooltip="true"
+          :show-overflow-tooltip="false"
           @row-click="handleRowClick"
           :max-height="effectiveTableHeight"
+          style="width: 100%; min-width: 100%"
+          class="fixed-layout-table"
         >
-          <el-table-column width="70" :label="t('workOrderMaterial.select')">
+          <el-table-column width="60" :label="t('workOrderMaterial.select')">
             <template #default="{ row }">
               <el-checkbox
                 :model-value="selectedRows.some(item => item.id === row.id)"
@@ -58,11 +60,17 @@
               />
             </template>
           </el-table-column>
-          <el-table-column :label="t('chooseMaintain.deviceCode')" align="center" prop="deviceCode" />
-          <el-table-column :label="t('deviceList.deviceName')" align="center" prop="deviceName" />
+          <el-table-column :label="t('chooseMaintain.deviceCode')" align="center" prop="deviceCode" :min-width="flexColumnMinWidths.deviceCode"/>
+          <el-table-column :label="t('deviceList.deviceName')" align="center" prop="deviceName" :min-width="flexColumnMinWidths.deviceName">
+            <template #default="{ row }">
+              <div class="flex-cell">
+                {{ row.deviceName }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column :label="t('faultForm.deptId')" align="center" prop="deptId" v-if="false"/>
-          <el-table-column :label="t('iotDevice.dept')" align="center" prop="deptName" />
-          <el-table-column :label="t('iotDevice.status')" align="center" prop="deviceStatus">
+          <el-table-column :label="t('iotDevice.dept')" align="center" prop="deptName" :min-width="flexColumnMinWidths.deptName"/>
+          <el-table-column :label="t('iotDevice.status')" align="center" prop="deviceStatus" :min-width="flexColumnMinWidths.deviceStatus">
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_DEVICE_STATUS" :value="scope.row.deviceStatus" />
             </template>
@@ -71,9 +79,14 @@
             :label="t('deviceList.createTime')"
             align="center"
             prop="createTime"
-            width="180"
-            :formatter="dateFormatter"
-          />
+            :min-width="flexColumnMinWidths.createTime"
+          >
+            <template #default="{ row }">
+              <div class="date-cell">
+                {{ formatDateTime(row.createTime) }}
+              </div>
+            </template>
+          </el-table-column>
         </el-table>
       </div>
 
@@ -122,13 +135,22 @@ const queryParams = reactive({
   code: undefined
 })
 
-// 新增响应式变量
+// 响应式变量
 const dialogWidth = ref('1100px');
 const tableMinHeight = ref(400); // 初始最小高度
 const effectiveTableHeight = ref<number | null>(null); // 单一高度变量
-const tableDynamicHeight = ref('auto'); // 新增动态高度变量
 const dialogTopRef = ref<HTMLElement | null>(null);
 const showPagination = ref(false); // 控制分页显示
+const tableContainerWidth = ref(0) // 表格容器宽度
+
+// 弹性列最小宽度记录
+const flexColumnMinWidths = reactive({
+  deviceCode: 0,
+  deviceName: 0,
+  deptName: 0,
+  deviceStatus: 0,
+  createTime: 0
+})
 
 // 点击整行选中
 const handleRowClick = (row) => {
@@ -163,6 +185,145 @@ const open = async () => {
 defineExpose({ open })
 const { wsCache } = useCache()
 
+// 文本测量工具函数
+const measureText = (text: string, fontSize: string = '14px',
+                     fontWeight: string = 'normal', extraStyles: Record<string, string> = {}): number => {
+  const span = document.createElement('span')
+  span.style.visibility = 'hidden'
+  span.style.position = 'absolute'
+  span.style.fontSize = fontSize
+  span.style.fontWeight = fontWeight
+  span.style.fontFamily = "'Microsoft YaHei', sans-serif"
+  span.style.whiteSpace = 'nowrap'
+  span.textContent = text
+
+  // 应用额外样式
+  Object.keys(extraStyles).forEach(key => {
+    span.style[key as any] = extraStyles[key];
+  });
+
+  document.body.appendChild(span)
+  const width = span.offsetWidth
+  document.body.removeChild(span)
+
+  return width
+};
+
+// 自定义日期时间格式化函数
+const formatDateTime = (dateString: string | Date) => {
+  if (!dateString) return '';
+
+  const date = new Date(dateString);
+
+  // 确保日期有效
+  if (isNaN(date.getTime())) {
+    return String(dateString).replace(/[\r\n]/g, '');;
+  }
+
+  const year = date.getFullYear();
+  const month = String(date.getMonth() + 1).padStart(2, '0');
+  const day = String(date.getDate()).padStart(2, '0');
+  const hours = String(date.getHours()).padStart(2, '0');
+  const minutes = String(date.getMinutes()).padStart(2, '0');
+  const seconds = String(date.getSeconds()).padStart(2, '0');
+
+  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`.replace(/[\r\n]/g, '');
+};
+
+// 列宽计算函数
+const calculateColumnWidths = async () => {
+  await nextTick()
+
+  if (!tableRef.value || !list.value.length) return
+
+  const table = tableRef.value
+  const columns = table.columns
+  const rows = list.value
+
+  // 获取表格容器宽度
+  const tableContainer = tableRef.value?.$el?.closest('.table-wrapper')
+  if (tableContainer) {
+    tableContainerWidth.value = tableContainer.clientWidth
+  }
+
+  // 计算各列所需最小宽度
+  const columnMinWidths = columns.map((col, colIndex) => {
+    if (colIndex === 0) return 60 // 选择列固定宽度
+
+    // 测量表头宽度
+    // 测量表头宽度 - 使用表头实际样式
+    const headerWidth = col.label
+      ? measureText(col.label, '14px', 'bold', {
+      padding: '0 12px', // 表头实际内边距
+      boxSizing: 'border-box'
+    }) + 0 // 安全边距
+      : 0;
+
+    // 测量单元格内容宽度
+    let maxCellWidth = 0
+    rows.forEach(row => {
+      let cellValue = ''
+      let cellWidth = 0
+      if (col.property === 'createTime') {
+        // 特殊处理:使用格式化后的日期文本
+        cellValue = formatDateTime(row[col.property])
+        // 使用完整时间样本确保宽度足够
+        const sampleText = '2024-12-31 23:59:59';
+        const sampleWidth = measureText(sampleText, '14px', 'normal', {
+          padding: '0 12px',
+          boxSizing: 'border-box'
+        });
+        // 时间列额外增加安全边距
+        cellWidth = Math.max(
+          measureText(cellValue, '14px', 'normal', {
+            padding: '0 12px',
+            boxSizing: 'border-box'
+          }),
+          sampleWidth
+        ) + 0; // 安全边距
+        // if (cellWidth > maxCellWidth) maxCellWidth = cellWidth
+      } else if (col.property === 'deviceStatus') {
+        // 特殊处理:字典标签文本
+        const statusText = row.deviceStatusLabel || row[col.property] || '';
+        // 模拟el-tag样式进行测量
+        cellWidth = measureText(statusText, '12px', 'normal', {
+          padding: '2px 7px',
+          border: '1px solid #dcdfe6',
+          borderRadius: '4px',
+          display: 'inline-block',
+          lineHeight: '1.5',
+          boxSizing: 'border-box'
+        }) + 0; // 20px安全边距
+      } else {
+        cellValue = row[col.property] || ''
+        cellWidth = measureText(cellValue, '14px', 'normal', {
+          padding: '0 12px',
+          boxSizing: 'border-box'
+        }) + 0; // 安全边距
+      }
+      if (cellWidth > maxCellWidth) maxCellWidth = cellWidth
+    })
+
+    // 取标题和内容的最大值,并设置最小宽度
+    let minWidth = 100; // 默认最小宽度
+    if (col.property === 'createTime') {
+      minWidth = 100; // 时间列最小宽度设为180px
+    }
+    // 取标题和内容的最大值
+    return Math.max(headerWidth, maxCellWidth, minWidth)
+  })
+
+  // 记录弹性列的最小宽度
+  flexColumnMinWidths.deviceCode = columnMinWidths[1]
+  flexColumnMinWidths.deviceName = columnMinWidths[2]
+  flexColumnMinWidths.deptName = columnMinWidths[4]
+  flexColumnMinWidths.deviceStatus = columnMinWidths[5]
+  flexColumnMinWidths.createTime = columnMinWidths[6]
+
+  // 触发表格重新布局
+  table.doLayout()
+};
+
 const getList = async () => {
   loading.value = true
   try {
@@ -177,8 +338,12 @@ const getList = async () => {
     // 数据加载完成后重新计算高度
     await nextTick();
     calculateTableHeight();
+    calculateColumnWidths()
   } finally {
     loading.value = false
+    // 数据加载完成后计算列宽
+    await nextTick();
+    calculateColumnWidths();
   }
 }
 
@@ -292,21 +457,25 @@ const resetQuery = () => {
 // 监听列表变化动态调整高度
 watch(list, () => {
   calculateTableHeight();
+  if (dialogVisible.value) {
+    calculateColumnWidths();
+  }
 });
 
 // 监听窗口大小变化
 onMounted(() => {
   window.addEventListener('resize', calculateTableHeight);
+  window.addEventListener('resize', calculateColumnWidths);
 });
 
 onUnmounted(() => {
   window.removeEventListener('resize', calculateTableHeight);
+  window.removeEventListener('resize', calculateColumnWidths);
 });
 
 </script>
 <style lang="scss" scoped>
 
-/* 新增样式 */
 .device-select-dialog {
   display: flex;
   flex-direction: column;
@@ -334,16 +503,22 @@ onUnmounted(() => {
 
 /* 列宽度保证 - 防止挤压 */
 .el-table {
-  ::v-deep(.el-table__cell) {
-    min-width: 80px;
+  /* 确保所有列头文字居中 */
+  ::v-deep(.el-table__header) th > .cell {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    text-align: center;
+  }
 
-    &:first-child {
-      min-width: 60px;
-    }
+  /* 所有内容列居中对齐 */
+  ::v-deep(.el-table__body) td {
+    text-align: center !important;
 
-    &:nth-child(2),
-    &:nth-child(3) {
-      min-width: 120px;
+    .cell {
+      display: flex;
+      justify-content: center;
+      align-items: center;
     }
   }
 
@@ -353,6 +528,80 @@ onUnmounted(() => {
   }
 }
 
+/* 列宽自适应样式 */
+::v-deep(.el-table) {
+  .el-table__header th {
+    padding: 0 !important;
+    .cell {
+      padding: 0 0px !important;
+      box-sizing: border-box !important;
+      font-weight: bold !important;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      height: 100%;
+    }
+  }
+
+  .el-table__body td {
+    padding: 0 !important;
+    .cell {
+      padding: 0 0px !important;
+      box-sizing: border-box !important;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      height: 100%;
+    }
+  }
+
+  /* 特定列额外修正 */
+  .el-table__cell:nth-child(4), /* 部门列 */
+  .el-table__cell:nth-child(5), /* 状态列 */
+  .el-table__cell:nth-child(6)  /* 时间列 */ {
+    .date-cell {
+      white-space: nowrap !important;
+      overflow: visible !important;
+      text-overflow: clip !important;
+      justify-content: center;
+    }
+  }
+}
+
+/* 固定表格布局 */
+.fixed-layout-table {
+  ::v-deep(table) {
+    table-layout: fixed !important; /* 固定列宽 */
+    width: auto !important;
+    min-width: 100%;
+  }
+
+  ::v-deep(.el-table__header),
+  ::v-deep(.el-table__body) {
+    width: auto !important; /* 允许宽度扩展 */
+  }
+
+  ::v-deep(.el-table__cell) {
+    overflow: visible !important;   /* 禁用裁剪 */
+    text-overflow: unset !important; /* 移除省略号 */
+    white-space: nowrap !important;  /* 禁止换行 */
+
+    &:nth-child(4) { /* 部门 */
+      min-width: v-bind('flexColumnMinWidths.deptName + "px"');
+      text-align: center;
+    }
+    &:nth-child(5) { /* 状态 */
+      min-width: v-bind('flexColumnMinWidths.deviceStatus + "px"');
+      text-align: center;
+    }
+    &:nth-child(6) { /* 创建时间 */
+      min-width: v-bind('(flexColumnMinWidths.createTime) + "px"');
+      overflow: visible !important;
+      text-align: center;
+    }
+  }
+}
+
 .dialog-top {
   flex-shrink: 0;
   margin-bottom: 15px;
@@ -370,19 +619,20 @@ onUnmounted(() => {
   max-height: 100%;
 
   .table-wrapper {
-    overflow: visible !important;
+    overflow: auto !important;
     .el-table {
       // 表格自带的滚动机制
       ::v-deep(.el-table__body-wrapper) {
-        overflow-y: auto !important;
+        overflow: auto !important;
       }
     }
   }
 }
 
 .table-wrapper {
-  flex: 1;
-  overflow-y: auto; /* 内部滚动 */
+  width: 100%;
+  overflow-y: hidden;
+  overflow-x: auto !important;
 }
 
 .no-label-radio .el-radio__label {

+ 17 - 8
src/views/pms/modeltemplate/detail/attrsModel/AttrTemplateModelForm.vue

@@ -15,13 +15,6 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-<!--          <el-form-item label="标识符" prop="code">
-            <el-input v-model="formData.code" placeholder="请输入标识符" />
-          </el-form-item>-->
-        </el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="12">
           <el-form-item label="是否数采:" prop="isCollection">
             <el-radio-group v-model="formData.isCollection">
               <el-radio
@@ -35,6 +28,8 @@
             </el-radio-group>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
         <el-col :span="12">
           <el-form-item label="是否累计:" prop="isSum">
             <el-radio-group v-model="formData.isSum">
@@ -49,6 +44,20 @@
             </el-radio-group>
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="标识符" prop="code" v-show="formData.isSum === 1">
+            <el-radio-group v-model="formData.code">
+              <el-radio
+                v-for="dict in getStrDictOptions(DICT_TYPE.RQ_IOT_MODEL_TEMPLATE_ATTR)"
+                :key="dict.value"
+                :value="dict.value"
+                @click="radioChange(dict.value)"
+              >
+                {{ dict.label }}
+              </el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
       </el-row>
 
       <el-row>
@@ -96,7 +105,7 @@
 
 <script lang="ts" setup>
 import DeviceAttrModelProperty from './AttrTemplateModelProperty.vue'
-import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { DICT_TYPE, getIntDictOptions,getStrDictOptions } from '@/utils/dict'
 import { DeviceAttrModelApi, DeviceAttrModelData } from '@/api/pms/modelattrtemplate'
 import { DataSpecsDataType, DeviceAttrModelFormRules } from './config'
 import { cloneDeep } from 'lodash-es'

+ 5 - 5
src/views/pms/modeltemplate/detail/attrsModel/AttrTemplateModelProperty.vue

@@ -16,7 +16,7 @@
     </el-select>
   </el-form-item>
   <!-- 数值型配置 -->
-  <ModelAttrModelNumberDataSpecs
+<!--  <ModelAttrModelNumberDataSpecs
     v-if="
       [DataSpecsDataType.INT, DataSpecsDataType.DOUBLE, DataSpecsDataType.FLOAT].includes(
         selectOptions.type || ''
@@ -24,11 +24,11 @@
     "
     v-model="selectOptions.dataSpecs"
   />
-  <!-- 枚举型配置 -->
+  &lt;!&ndash; 枚举型配置 &ndash;&gt;
   <ModelAttrModelNumberDataSpecs
     v-if="selectOptions.type === DataSpecsDataType.ENUM"
     v-model="selectOptions.dataSpecsList"
-  />
+  />-->
   <!-- 布尔型配置 -->
   <el-form-item v-if="selectOptions.type === DataSpecsDataType.BOOL" label="布尔值">
     <template v-for="(item, index) in selectOptions.dataSpecsList" :key="item.value">
@@ -77,7 +77,7 @@
     v-if="selectOptions.type === DataSpecsDataType.STRUCT"
     v-model="selectOptions.dataSpecsList"
   />
-  <el-form-item v-if="!isStructDataSpecs && !isParams" label="是否必填" prop="selectOptions.requiredFlag">
+<!--  <el-form-item v-if="!isStructDataSpecs && !isParams" label="是否必填" prop="selectOptions.requiredFlag">
     <el-radio-group v-model="selectOptions.requiredFlag">
       <el-radio :label="DeviceAttrModelRequired.REQUIRED.value">
         {{ DeviceAttrModelRequired.REQUIRED.label }}
@@ -86,7 +86,7 @@
         {{ DeviceAttrModelRequired.NOT_REQUIRED.label }}
       </el-radio>
     </el-radio-group>
-  </el-form-item>
+  </el-form-item>-->
 </template>
 
 <script lang="ts" setup>

+ 6 - 1
src/views/pms/modeltemplate/detail/attrsModel/index.vue

@@ -28,9 +28,13 @@
           添加属性
         </el-button>
       </el-form-item>
+      <el-form-item label="所属模板:" style="width: 200px" label-width="100px">
+        <span>
+          {{modelName}}
+        </span>
+      </el-form-item>
     </el-form>
   </ContentWrap>
-
   <!-- 列表 -->
   <ContentWrap>
     <el-tabs>
@@ -97,6 +101,7 @@ defineOptions({ name: 'ModelAttrTemplate' })
 
 const deviceCategoryId = route.params.id.split(",")[0] // 设备分类id
 const categoryName = route.params.id.split(",")[1];//设备分类名称
+const modelName = route.params.id.split(",")[2];//模板名称
 const { t } = useI18n() // 国际化
 const message = useMessage() // 消息弹窗
 

+ 1 - 1
src/views/pms/modeltemplate/index.vue

@@ -122,7 +122,7 @@
                 <el-button
                   type="primary"
                   link
-                  @click="openDetail(scope.row.deviceCategoryId+','+scope.row.deviceCategoryName)"
+                  @click="openDetail(scope.row.deviceCategoryId+','+scope.row.deviceCategoryName+','+scope.row.name)"
                 >
                   <Icon icon="ep:edit" />{{t('operationFill.view')}}
                 </el-button>