Переглянути джерело

bug:工艺路线,设备bug

lupeng 10 місяців тому
батько
коміт
76f447f1e8

+ 3 - 5
src/components/CommonTable/configs/tableConfig.ts

@@ -563,7 +563,7 @@ export const tableConfig = {
       {
         label: "用户id",
         prop: "id",
-        hide : true,
+        hide: true,
         /*display:false,*/
       },
       {
@@ -581,7 +581,6 @@ export const tableConfig = {
       {
         label: "所属机构",
         prop: "institution",
-        search: true,
         filterable: true,
         type: "select",
         width: 100,
@@ -657,7 +656,7 @@ export const tableConfig = {
     ],
   },
 
-  ROUTE_COMMON:{
+  ROUTE_COMMON: {
     url: "/api/v1/op/route/common",
     column: [
       {
@@ -769,7 +768,6 @@ export const tableConfig = {
         width: 150,
         overHidden: true,
       },
-      ]
+    ],
   },
-
 };

+ 2 - 0
src/views/base/craftManagement/route/index.vue

@@ -178,6 +178,8 @@ const startChooseRoute = () => {
 };
 // 已经绑定了工序的可以复制,跟后端HT商量只传id即可。
 const copyRow = (row) => {
+  option.value.column[4].display = false;
+  option.value.column[5].display = false;
   if (row.usable == 0) {
     ElMessage.error("该路线未被绑定!");
     return;

+ 228 - 218
src/views/base/modeling/station/index.vue

@@ -16,7 +16,7 @@
       @current-change="dataList"
       @selection-change="selectionChange"
     >
-      <template #enable="scope">
+      <!--      <template #enable="scope">
         <el-switch
           active-value="1"
           inactive-value="0"
@@ -26,9 +26,9 @@
           v-model="scope.row.enable"
           @click="changeItem(scope.row)"
           class="ml-2"
-          style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
+          style="&#45;&#45;el-switch-on-color: #13ce66; &#45;&#45;el-switch-off-color: #ff4949"
         />
-      </template>
+      </template>-->
       <template #menu-left="{ size }">
         <el-button
           :disabled="toDeleteIds.length < 1"
@@ -36,15 +36,17 @@
           icon="el-icon-delete"
           :size="size"
           @click="multipleDelete"
-        >删除</el-button
+          >删除</el-button
         >
       </template>
-      <template #menu="{row,index,type}">
-        <el-button @click="binding(row)"
-                   icon="el-icon-ticket"
-                   text
-                   type="primary"
-        >设备</el-button>
+      <template #menu="{ row, index, type }">
+        <el-button
+          @click="binding(row)"
+          icon="el-icon-ticket"
+          text
+          type="primary"
+          >设备</el-button
+        >
       </template>
     </avue-crud>
     <el-dialog
@@ -54,7 +56,7 @@
       @close="dialog.visible = false"
       :destroy-on-close="true"
     >
-      <station-page  :stationId="stationDevice.id"/>
+      <station-page :stationId="stationDevice.id" />
     </el-dialog>
     <CommonTable
       ref="ctableRef"
@@ -65,38 +67,47 @@
   </div>
 </template>
 <script setup="ts">
-  import { ref, getCurrentInstance } from "vue";
-  import { useCrud } from "@/hooks/userCrud";
-  import ButtonPermKeys from "@/common/configs/buttonPermission";
-  import { useCommonStoreHook } from "@/store";
-  import { updateStation } from "@/api/station";
-  const { isShowTable, tableType } = toRefs(useCommonStoreHook());
-  import { useDictionaryStore } from "@/store";
-  const { dicts } = useDictionaryStore();
-  const test = () => {
-    isShowTable.value = true;
-    tableType.value = tableType.value == 1 ? 2 : 1;
-  };
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+import { useCommonStoreHook } from "@/store";
+import { updateStation } from "@/api/station";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+import { useDictionaryStore } from "@/store";
+const { dicts } = useDictionaryStore();
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
 
-  // 传入一个url,后面不带/
-  const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
-    useCrud({
-      src: "/api/v1/base/station",
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/base/station",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
+// const permission = reactive({
+//   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
+//   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
+//   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
+//   menu: true,
+// });
+function rowSave(form, done, loading) {
+  const parts = form.stationIp.split(".");
+  if (parts.length !== 4) {
+    ElMessage({
+      message: "工位ip格式不正确",
+      type: "error",
     });
-  const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
-    Methords; //增删改查
-  const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
-  const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
-  // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
-  // const permission = reactive({
-  //   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
-  //   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
-  //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
-  //   menu: true,
-  // });
-  function rowSave(form,done,loading) {
-    const parts = form.stationIp.split('.');
-    if (parts.length !== 4) {
+    loading();
+    return false;
+  }
+  for (const part of parts) {
+    if (isNaN(part) || part < 0 || part > 255) {
       ElMessage({
         message: "工位ip格式不正确",
         type: "error",
@@ -104,211 +115,210 @@
       loading();
       return false;
     }
-    for (const part of parts) {
-      if (isNaN(part) || part < 0 || part > 255) {
-        ElMessage({
-          message: "工位ip格式不正确",
-          type: "error",
-        });
-        loading();
-        return false;
-      }
-    }
-    createRow(form,done,loading);
-
   }
-  const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+  createRow(form, done, loading);
+}
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 
-  onMounted(() => {
-    // console.log("crudRef", crudRef)
-    dataList();
-  });
-  const ctableRef=ref(null);
-  /**
-   * 上传excel相关
-   */
-  const uploadRef = ref(null);
-  const uploadFinished = () => {
-    // 上传完成后的刷新操作
-    page.currentPage = 1;
-    dataList();
-  };
-  const importExcelData = () => {
-    if (uploadRef.value) {
-      uploadRef.value.show("/api/v1/base/station");
-    }
-  };
-  const dialog = reactive({
-    title: "设备绑定",
-    visible: false,
-  });
-  const stationDevice=ref(null);
-  const binding=(row)=>{
-    dialog.visible=true;
-    stationDevice.value=row;
-  }
-  const onSelectedFinish=(selectedValue)=>{
-    form.value.manager=selectedValue.userName;
-    form.value.managerId=selectedValue.id;
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
+});
+const ctableRef = ref(null);
+/**
+ * 上传excel相关
+ */
+const uploadRef = ref(null);
+const uploadFinished = () => {
+  // 上传完成后的刷新操作
+  page.currentPage = 1;
+  dataList();
+};
+const importExcelData = () => {
+  if (uploadRef.value) {
+    uploadRef.value.show("/api/v1/base/station");
   }
-  const stationUpdate=ref({});
-  const changeItem=(row)=>{
-    stationUpdate.value.id=row.id;
-    stationUpdate.value.enable=row.enable;
-    updateStation(stationUpdate.value).then((data) => {
-      dataList();
-      ElMessage({
-        message: data.msg,
-        type: "success",
-      });
-
+};
+const dialog = reactive({
+  title: "设备绑定",
+  visible: false,
+});
+const stationDevice = ref(null);
+const binding = (row) => {
+  dialog.visible = true;
+  stationDevice.value = row;
+};
+const onSelectedFinish = (selectedValue) => {
+  form.value.manager = selectedValue.userName;
+  form.value.managerId = selectedValue.id;
+};
+const stationUpdate = ref({});
+const changeItem = (row) => {
+  stationUpdate.value.id = row.id;
+  stationUpdate.value.enable = row.enable;
+  updateStation(stationUpdate.value).then((data) => {
+    dataList();
+    ElMessage({
+      message: data.msg,
+      type: "success",
     });
-
-  }
-  // 设置表格列或者其他自定义的option
-  option.value = Object.assign(option.value, {
-    selection: true,
-    column: [
-      {
-        label: "工位编号",
-        prop: "stationCode",
-        overHidden: true,
-        width:120,
-        search: true,
-        rules: [{
+  });
+};
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  selection: true,
+  column: [
+    {
+      label: "工位编号",
+      prop: "stationCode",
+      overHidden: true,
+      width: 120,
+      search: true,
+      rules: [
+        {
           required: true,
           message: "请填写工位编号",
-          trigger: "blur"
-        }],
-      },
-      {
-        label: "工位名称",
-        width:120,
-        prop: "name",
-        search: true,
-        overHidden: true,
-        rules: [{
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "工位名称",
+      width: 120,
+      prop: "name",
+      search: true,
+      overHidden: true,
+      rules: [
+        {
           required: true,
           message: "请填写工位名称",
-          trigger: "blur"
-        }],
-      },
-      {
-        label: "工位类型",
-        prop: "stationDictValue",
-        width:90,
-        search: true,
-        overHidden: true,
-        rules: [{
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "工位类型",
+      prop: "stationDictValue",
+      width: 90,
+      search: true,
+      overHidden: true,
+      rules: [
+        {
           required: true,
           message: "请选择工位类型",
-          trigger: "blur"
-        }],
-        type: 'select',
-        dicData:dicts.station_type,
-        searchClearable: false, //可清空的输入框,默认为true
-        filterable: true, //添加filterable属性即可启用搜索功能
-        props: {
-          label: "dictLabel", // 下拉菜单显示的字段
-          value: "dictValue" // 下拉菜单值的字段
+          trigger: "blur",
         },
+      ],
+      type: "select",
+      dicData: dicts.station_type,
+      searchClearable: false, //可清空的输入框,默认为true
+      filterable: true, //添加filterable属性即可启用搜索功能
+      props: {
+        label: "dictLabel", // 下拉菜单显示的字段
+        value: "dictValue", // 下拉菜单值的字段
       },
-      {
-        label: "操作方式",
-        prop: "operateDictValue",
-        width:90,
-        overHidden: true,
-        rules: [{
+    },
+    {
+      label: "操作方式",
+      prop: "operateDictValue",
+      width: 90,
+      overHidden: true,
+      rules: [
+        {
           required: true,
           message: "操作方式",
-          trigger: "blur"
-        }],
-        type: 'select',
-        dicData:dicts.station_operate_type,
-        props: {
-          label: "dictLabel", // 下拉菜单显示的字段
-          value: "dictValue" // 下拉菜单值的字
+          trigger: "blur",
         },
+      ],
+      type: "select",
+      dicData: dicts.station_operate_type,
+      props: {
+        label: "dictLabel", // 下拉菜单显示的字段
+        value: "dictValue", // 下拉菜单值的字
       },
-      {
-        label: "负责人",
-        prop: "manager",
-        overHidden: true,
-        width:90,
-        rules: [{
+    },
+    {
+      label: "负责人",
+      prop: "manager",
+      overHidden: true,
+      width: 90,
+      rules: [
+        {
           required: true,
           message: "请选择负责人",
-          trigger: "blur"
-        }],
-        click: ({ value, column }) => {
-          ctableRef.value.startSelect();
+          trigger: "blur",
         },
+      ],
+      click: ({ value, column }) => {
+        ctableRef.value.startSelect();
       },
-      {
-        label: "负责人id",
-        prop: "managerId",
-        hide:true,
-        display:false,
-
-      },
-      {
-        label: "所属产线",
-        prop: "productionLineName",
-        width:90,
-        overHidden: true,
-        display:false
-      },
-      {
-        label: "工位地址",
-        prop: "position",
-        width:90,
-        overHidden: true,
-        rules: [{
+    },
+    {
+      label: "负责人id",
+      prop: "managerId",
+      hide: true,
+      display: false,
+    },
+    {
+      label: "所属产线",
+      prop: "productionLineName",
+      width: 90,
+      overHidden: true,
+      display: false,
+    },
+    {
+      label: "工位地址",
+      prop: "position",
+      width: 90,
+      overHidden: true,
+      rules: [
+        {
           required: true,
           message: "请填写工位地址",
-          trigger: "blur"
-        }],
-      },
-      {
-        label: "IP地址",
-        prop: "stationIp",
-        overHidden: true,
-        width:90,
-        rules: [{
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "IP地址",
+      prop: "stationIp",
+      overHidden: true,
+      width: 90,
+      rules: [
+        {
           required: true,
           message: "请填写工位IP地址",
           trigger: "blur",
-        }],
-
-      },
-      { label: "启用状态",
+        },
+      ],
+    },
+    /*{ label: "启用状态",
         slot:true,
         headerAlign: 'center',
         prop: "enable",
         width: 100,
         display: false
-      },
-      {
-        label: "工位描述",
-        width:90,
-        overHidden: true,
-        prop: "remark",
-        type: 'textarea',
-        span: 24,
-      },
-      {
-        label: "创建人",
-        prop: "creator",
-        overHidden: true,
-        display:false
-      },
-      {
-        label: "创建时间",
-        prop: "created",
-        overHidden: true,
-        display:false
-      },
-    ]
-  });
+      },*/
+    {
+      label: "工位描述",
+      width: 90,
+      overHidden: true,
+      prop: "remark",
+      type: "textarea",
+      span: 24,
+    },
+    {
+      label: "创建人",
+      prop: "creator",
+      overHidden: true,
+      display: false,
+    },
+    {
+      label: "创建时间",
+      prop: "created",
+      overHidden: true,
+      display: false,
+    },
+  ],
+});
 </script>
-

+ 0 - 1
src/views/device/allocate/index.vue

@@ -776,7 +776,6 @@ option.value = Object.assign(option.value, {
       addDisabled: true,
       width: 130,
       overHidden: true,
-      search: true,
     },
     {
       label: "设备类型",

+ 15 - 0
src/views/device/disable/index.vue

@@ -335,6 +335,7 @@ onMounted(() => {
 const ctableRef = ref(null);
 const onSelectedFinish = (selectedValue) => {
   form.value.deviceName = selectedValue.deviceName;
+  form.value.deviceName2 = selectedValue.deviceName;
   form.value.deviceNo = selectedValue.deviceNo;
   form.value.specifications = selectedValue.specifications;
   form.value.manufacturer = selectedValue.manufacturer;
@@ -420,6 +421,20 @@ option.value = Object.assign(option.value, {
       prop: "deviceName",
       search: true,
       overHidden: true,
+      display: false,
+      rules: [
+        {
+          required: true,
+          message: "请输入名称",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "名称",
+      prop: "deviceName2",
+      overHidden: true,
+      hide: true,
       rules: [
         {
           required: true,

Різницю між файлами не показано, бо вона завелика
+ 516 - 490
src/views/device/metering/index.vue


+ 1 - 1
vite.config.ts

@@ -207,7 +207,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
     // 构建配置
     build: {
       sourcemap: true,
-      chunkSizeWarningLimit: 2000, // 消除打包大小超过500kb警告
+      chunkSizeWarningLimit: 4000, // 消除打包大小超过500kb警告
       minify: "terser", // Vite 2.6.x 以上需要配置 minify: "terser", terserOptions 才能生效
       terserOptions: {
         compress: {