Эх сурвалжийг харах

添加父级设备;
备件物料添加;

zhangafei 1 сар өмнө
parent
commit
9906bacb95
59 өөрчлөгдсөн 241 нэмэгдсэн , 1014 устгасан
  1. BIN
      src/assets/images/checkcode.png
  2. BIN
      src/assets/images/cms_bpm.png
  3. BIN
      src/assets/images/cms_oa.png
  4. BIN
      src/assets/images/daiban.png
  5. BIN
      src/assets/images/demo.png
  6. BIN
      src/assets/images/department.png
  7. BIN
      src/assets/images/drag_cover.png
  8. BIN
      src/assets/images/duban.png
  9. BIN
      src/assets/images/guaz.png
  10. BIN
      src/assets/images/header.jpg
  11. BIN
      src/assets/images/link.png
  12. BIN
      src/assets/images/logo.png
  13. BIN
      src/assets/images/nodata.png
  14. BIN
      src/assets/images/panel_cover.png
  15. BIN
      src/assets/images/pdf4.jpg
  16. BIN
      src/assets/images/people.png
  17. BIN
      src/assets/images/placeholderImage.png
  18. BIN
      src/assets/images/process_no_form.png
  19. BIN
      src/assets/images/setting.png
  20. BIN
      src/assets/images/template_cover.jpg
  21. BIN
      src/assets/images/wallet.png
  22. BIN
      src/assets/images/zaiban.png
  23. BIN
      src/assets/loginmini/icon/icon-code.png
  24. BIN
      src/assets/loginmini/icon/icon-eye-g.png
  25. BIN
      src/assets/loginmini/icon/icon-eye-k.png
  26. BIN
      src/assets/loginmini/icon/icon-line-msg.png
  27. BIN
      src/assets/loginmini/icon/icon-line-pad.png
  28. BIN
      src/assets/loginmini/icon/icon-line-tel.png
  29. BIN
      src/assets/loginmini/icon/icon-line-user.png
  30. BIN
      src/assets/loginmini/icon/icon-password.png
  31. BIN
      src/assets/loginmini/icon/icon-success.png
  32. BIN
      src/assets/loginmini/icon/icon-user.png
  33. BIN
      src/assets/loginmini/icon/icon_dow.png
  34. BIN
      src/assets/loginmini/icon/jeecg_ad.png
  35. BIN
      src/assets/loginmini/icon/jeecg_ad_text.png
  36. BIN
      src/assets/loginmini/icon/jeecg_bg.png
  37. BIN
      src/assets/loginmini/icon/jeecg_logo.png
  38. BIN
      src/assets/loginmini/icon/logo.png
  39. 3 0
      src/assets/loginmini/style/home.less
  40. 3 3
      src/components/Form/src/jeecg/components/JImageUpload.vue
  41. 21 0
      src/views/equipmentLifecycle/device/list/DeviceBaseInfo.api.ts
  42. 2 2
      src/views/equipmentLifecycle/device/list/DeviceBaseInfo.data.ts
  43. 30 3
      src/views/equipmentLifecycle/device/list/DeviceBaseInfoList.vue
  44. 92 0
      src/views/equipmentLifecycle/device/list/components/ParentDeviceModal.vue
  45. 0 0
      src/views/equipmentLifecycle/device/list/components/SubDeviceModal.vue
  46. 0 64
      src/views/equipmentLifecycle/device/parentDevice/ParentDevice.api.ts
  47. 0 101
      src/views/equipmentLifecycle/device/parentDevice/ParentDevice.data.ts
  48. 0 26
      src/views/equipmentLifecycle/device/parentDevice/V20250401_1__menu_insert_ParentDevice.sql
  49. 0 70
      src/views/equipmentLifecycle/device/parentDevice/components/ParentDeviceForm.vue
  50. 0 188
      src/views/equipmentLifecycle/device/parentDevice/index.vue
  51. 0 64
      src/views/equipmentLifecycle/device/subDevice/SubDevice.api.ts
  52. 0 114
      src/views/equipmentLifecycle/device/subDevice/SubDevice.data.ts
  53. 0 26
      src/views/equipmentLifecycle/device/subDevice/V20250401_1__menu_insert_SubDevice.sql
  54. 0 70
      src/views/equipmentLifecycle/device/subDevice/components/SubDeviceForm.vue
  55. 0 76
      src/views/equipmentLifecycle/device/subDevice/components/SubDeviceModal.vue
  56. 0 186
      src/views/equipmentLifecycle/device/subDevice/index.vue
  57. 80 11
      src/views/equipmentLifecycle/setting/material/DeviceMaterialRelation.data.ts
  58. 2 2
      src/views/equipmentLifecycle/setting/material/components/DeviceMaterialRelationModal.vue
  59. 8 8
      src/views/sys/login/LoginSelect.vue

BIN
src/assets/images/checkcode.png


BIN
src/assets/images/cms_bpm.png


BIN
src/assets/images/cms_oa.png


BIN
src/assets/images/daiban.png


BIN
src/assets/images/demo.png


BIN
src/assets/images/department.png


BIN
src/assets/images/drag_cover.png


BIN
src/assets/images/duban.png


BIN
src/assets/images/guaz.png


BIN
src/assets/images/header.jpg


BIN
src/assets/images/link.png


BIN
src/assets/images/logo.png


BIN
src/assets/images/nodata.png


BIN
src/assets/images/panel_cover.png


BIN
src/assets/images/pdf4.jpg


BIN
src/assets/images/people.png


BIN
src/assets/images/placeholderImage.png


BIN
src/assets/images/process_no_form.png


BIN
src/assets/images/setting.png


BIN
src/assets/images/template_cover.jpg


BIN
src/assets/images/wallet.png


BIN
src/assets/images/zaiban.png


BIN
src/assets/loginmini/icon/icon-code.png


BIN
src/assets/loginmini/icon/icon-eye-g.png


BIN
src/assets/loginmini/icon/icon-eye-k.png


BIN
src/assets/loginmini/icon/icon-line-msg.png


BIN
src/assets/loginmini/icon/icon-line-pad.png


BIN
src/assets/loginmini/icon/icon-line-tel.png


BIN
src/assets/loginmini/icon/icon-line-user.png


BIN
src/assets/loginmini/icon/icon-password.png


BIN
src/assets/loginmini/icon/icon-success.png


BIN
src/assets/loginmini/icon/icon-user.png


BIN
src/assets/loginmini/icon/icon_dow.png


BIN
src/assets/loginmini/icon/jeecg_ad.png


BIN
src/assets/loginmini/icon/jeecg_ad_text.png


BIN
src/assets/loginmini/icon/jeecg_bg.png


BIN
src/assets/loginmini/icon/jeecg_logo.png


BIN
src/assets/loginmini/icon/logo.png


+ 3 - 0
src/assets/loginmini/style/home.less

@@ -36,6 +36,9 @@
   background-color: #0198cd;
   background-image: url(../icon/jeecg_ad.png);
   background-size: cover;
+  display: flex;
+  align-items: center;
+  justify-content: center;
 }
 
 .aui-image-text {

+ 3 - 3
src/components/Form/src/jeecg/components/JImageUpload.vue

@@ -20,7 +20,7 @@
           <div class="ant-upload-text">{{ text }}</div>
         </div>
         <a-button v-if="listType == 'picture'" :disabled="disabled">
-          <UploadOutlined></UploadOutlined>
+          <UploadOutlined />
           {{ text }}
         </a-button>
       </div>
@@ -125,8 +125,8 @@
       watch(
         () => props.value,
         (val, prevCount) => {
-         //update-begin---author:liusq ---date:20230601  for:【issues/556】JImageUpload组件value赋初始值没显示图片------------
-            if (val && val instanceof Array) {
+          //update-begin---author:liusq ---date:20230601  for:【issues/556】JImageUpload组件value赋初始值没显示图片------------
+          if (val && val instanceof Array) {
             val = val.join(',');
           }
           if (initTag.value == true) {

+ 21 - 0
src/views/equipmentLifecycle/device/list/DeviceBaseInfo.api.ts

@@ -13,6 +13,12 @@ enum Api {
   exportXls = '/deviceInfo/deviceBaseInfo/exportXls',
   // 设备编号是否是唯一的
   checkDeviceCode = '/deviceInfo/deviceBaseInfo/queryDeviceBaseInfoByDeviceNumber',
+  // 保存父级设备
+  saveParentDevice = '/deviceInfo/deviceBaseInfo/parentAdd',
+  // 保存子设备
+  saveSubDevice = '/deviceInfo/deviceBaseInfo/subAdd',
+  // 设备物料关系
+  saveDeviceMaterialRelation = '/deviceInfo/deviceBaseInfo/deviceMaterialRelationAdd',
 }
 /**
  * 导出api
@@ -68,3 +74,18 @@ export const saveOrUpdate = (params, isUpdate) => {
 export const checkDeviceCode = (params) => {
   return defHttp.get({ url: Api.checkDeviceCode, params });
 };
+
+// 保存父级设备 id,parentDeviceIds
+export const saveParentDevice = (params) => {
+  return defHttp.post({ url: Api.saveParentDevice, params, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });
+};
+
+// 保存子级设备 id,subDeviceIds
+export const saveSubDevice = (params) => {
+  return defHttp.post({ url: Api.saveSubDevice, params, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });
+};
+
+// 设备物料关系 id,deviceMaterialRelationIds
+export const saveDeviceMaterialRelation = (params) => {
+  return defHttp.post({ url: Api.saveDeviceMaterialRelation, params, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });
+};

+ 2 - 2
src/views/equipmentLifecycle/device/list/DeviceBaseInfo.data.ts

@@ -372,7 +372,7 @@ export const formSchema: FormSchema[] = [
   {
     label: '品牌',
     field: 'brand',
-    component: 'JDictSelectTag',
+    component: 'JSearchSelect',
     componentProps: {
       dictCode: 'brand_type',
     },
@@ -381,7 +381,7 @@ export const formSchema: FormSchema[] = [
   {
     label: '单位',
     field: 'unit',
-    component: 'JDictSelectTag',
+    component: 'JSearchSelect',
     componentProps: {
       dictCode: 'unit_type',
     },

+ 30 - 3
src/views/equipmentLifecycle/device/list/DeviceBaseInfoList.vue

@@ -87,8 +87,8 @@
   import DeviceBaseInfoModal from './components/DeviceBaseInfoModal.vue';
   import { columns, searchFormSchema, superQuerySchema } from './DeviceBaseInfo.data';
   import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DeviceBaseInfo.api';
-  import ParentDeviceModal from '../parentDevice/components/ParentDeviceModal.vue';
-  import SubDeviceModal from '../subDevice/components/SubDeviceModal.vue';
+  import ParentDeviceModal from './components/ParentDeviceModal.vue';
+  import SubDeviceModal from './components/SubDeviceModal.vue';
   import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
   import DeviceBaseInfoDetailDrawer from './components/DeviceBaseInfoDetailDrawer.vue';
   import { useDrawer } from '/@/components/Drawer';
@@ -101,6 +101,10 @@
       type: Boolean,
       default: false,
     },
+    superQueryParams: {
+      type: Array,
+      default: () => [],
+    },
   });
 
   //注册model
@@ -132,6 +136,29 @@
         fixed: 'right',
       },
       beforeFetch: (params) => {
+        if (props.noOperate === true) {
+          let superQueryParamsArr = [];
+          if (queryParam['superQueryParams']) {
+            superQueryParamsArr = JSON.parse(decodeURIComponent(queryParam['superQueryParams']));
+          }
+
+          if (!queryParam['superQueryMatchType']) {
+            queryParam['superQueryMatchType'] = 'and';
+          }
+
+          props.superQueryParams.forEach((ele) => {
+            const parentDeviceIdsIndex = superQueryParamsArr.findIndex((item) => {
+              return item.field === ele.field;
+            });
+            if (parentDeviceIdsIndex !== -1) {
+              superQueryParamsArr.splice(parentDeviceIdsIndex, 1, ele);
+            } else {
+              superQueryParamsArr.push(ele);
+            }
+          });
+
+          queryParam['superQueryParams'] = encodeURIComponent(JSON.stringify(superQueryParamsArr));
+        }
         return Object.assign(params, queryParam);
       },
     },
@@ -229,7 +256,7 @@
             showFooter: true,
           });
         },
-        auth: 'deviceInfo:parent_device:add',
+        auth: 'deviceInfo:parent_device_info:add',
       },
       {
         label: '添加子设备',

+ 92 - 0
src/views/equipmentLifecycle/device/list/components/ParentDeviceModal.vue

@@ -0,0 +1,92 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="registerModal"
+    destroyOnClose
+    :title="title"
+    :width="1200"
+    :height="800"
+    @ok="handleSubmit"
+    :bodyStyle="{ padding: 0 }"
+  >
+    <DeviceBaseInfoList :noOperate="true" @selection-change="handleRowSelectionChange" :superQueryParams="superQueryParams" />
+  </BasicModal>
+</template>
+
+<script lang="ts" setup>
+  import { ref, computed, unref } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import DeviceBaseInfoList from '../DeviceBaseInfoList.vue';
+  import { saveParentDevice } from '../DeviceBaseInfo.api';
+  import { useMessage } from '/@/hooks/web/useMessage';
+
+  const { createMessage } = useMessage();
+  // Emits声明
+  const emit = defineEmits(['register', 'success']);
+  const isUpdate = ref(true);
+  const isDetail = ref(false);
+  const selectedRows = ref([]);
+  const deviceBaseInfoId = ref('');
+  const superQueryParams = ref([]);
+
+  //表单赋值
+  const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
+    setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
+    isUpdate.value = !!data?.isUpdate;
+    isDetail.value = !!data?.showFooter;
+    if (!data?.device) {
+      closeModal();
+      return;
+    }
+
+    deviceBaseInfoId.value = data?.device?.id;
+    superQueryParams.value = [
+      { field: 'parentDeviceIds', rule: 'eq', val: null, type: 'text', dbType: 'string' },
+      { field: 'id', rule: 'ne', val: data?.device?.id, type: 'text', dbType: 'string' },
+    ];
+  });
+  //设置标题
+  const title = computed(() => (!unref(isUpdate) ? '添加父设备' : !unref(isDetail) ? '详情' : '编辑'));
+  //表单提交事件
+  async function handleSubmit() {
+    try {
+      if (!selectedRows.value.length) {
+        createMessage.warning('请选择要添加的父设备');
+        return;
+      }
+      setModalProps({ confirmLoading: true });
+      //提交表单
+      await saveParentDevice({ id: deviceBaseInfoId.value, parentDeviceIds: selectedRows.value.join(',') }, isUpdate.value);
+      //关闭弹窗
+      closeModal();
+      //刷新列表
+      emit('success');
+    } catch ({ errorFields }) {
+      if (errorFields) {
+        const firstField = errorFields[0];
+        if (firstField) {
+          scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
+        }
+      }
+      return Promise.reject(errorFields);
+    } finally {
+      setModalProps({ confirmLoading: false });
+    }
+  }
+
+  // 监听行选择
+  const handleRowSelectionChange = (selection) => {
+    selectedRows.value = selection.keys;
+  };
+</script>
+
+<style lang="less" scoped>
+  /** 时间和数字输入框样式 */
+  :deep(.ant-input-number) {
+    width: 100%;
+  }
+
+  :deep(.ant-calendar-picker) {
+    width: 100%;
+  }
+</style>

+ 0 - 0
src/views/equipmentLifecycle/device/parentDevice/components/ParentDeviceModal.vue → src/views/equipmentLifecycle/device/list/components/SubDeviceModal.vue


+ 0 - 64
src/views/equipmentLifecycle/device/parentDevice/ParentDevice.api.ts

@@ -1,64 +0,0 @@
-import {defHttp} from '/@/utils/http/axios';
-import { useMessage } from "/@/hooks/web/useMessage";
-
-const { createConfirm } = useMessage();
-
-enum Api {
-  list = '/deviceInfo/parentDevice/list',
-  save='/deviceInfo/parentDevice/add',
-  edit='/deviceInfo/parentDevice/edit',
-  deleteOne = '/deviceInfo/parentDevice/delete',
-  deleteBatch = '/deviceInfo/parentDevice/deleteBatch',
-  importExcel = '/deviceInfo/parentDevice/importExcel',
-  exportXls = '/deviceInfo/parentDevice/exportXls',
-}
-/**
- * 导出api
- * @param params
- */
-export const getExportUrl = Api.exportXls;
-/**
- * 导入api
- */
-export const getImportUrl = Api.importExcel;
-/**
- * 列表接口
- * @param params
- */
-export const list = (params) =>
-  defHttp.get({url: Api.list, params});
-
-/**
- * 删除单个
- */
-export const deleteOne = (params,handleSuccess) => {
-  return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
-    handleSuccess();
-  });
-}
-/**
- * 批量删除
- * @param params
- */
-export const batchDelete = (params, handleSuccess) => {
-  createConfirm({
-    iconType: 'warning',
-    title: '确认删除',
-    content: '是否删除选中数据',
-    okText: '确认',
-    cancelText: '取消',
-    onOk: () => {
-      return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
-        handleSuccess();
-      });
-    }
-  });
-}
-/**
- * 保存或者更新
- * @param params
- */
-export const saveOrUpdate = (params, isUpdate) => {
-  let url = isUpdate ? Api.edit : Api.save;
-  return defHttp.post({url: url, params});
-}

+ 0 - 101
src/views/equipmentLifecycle/device/parentDevice/ParentDevice.data.ts

@@ -1,101 +0,0 @@
-import { BasicColumn } from '/@/components/Table';
-import { FormSchema } from '/@/components/Table';
-// import { rules } from '/@/utils/helper/validator';
-// import { render } from '/@/utils/common/renderUtils';
-// import { getWeekMonthQuarterYear } from '/@/utils';
-//列表数据
-export const columns: BasicColumn[] = [
-  {
-    title: '日期',
-    align: 'center',
-    dataIndex: 'createDate',
-  },
-  {
-    title: '设备编号',
-    align: 'center',
-    dataIndex: 'deviceNumber',
-  },
-  {
-    title: '父设备编号',
-    align: 'center',
-    dataIndex: 'parentDeviceNumber',
-  },
-  {
-    title: '父设备名称',
-    align: 'center',
-    dataIndex: 'parentDeviceName',
-  },
-  {
-    title: '品牌',
-    align: 'center',
-    dataIndex: 'brand',
-  },
-  {
-    title: '规格型号',
-    align: 'center',
-    dataIndex: 'specificationModel',
-  },
-];
-//查询数据
-export const searchFormSchema: FormSchema[] = [];
-//表单数据
-export const formSchema: FormSchema[] = [
-  {
-    label: '设备名称',
-    field: 'deviceName',
-    component: 'Input',
-  },
-  {
-    label: '设备编号',
-    field: 'deviceNumber',
-    component: 'Input',
-    dynamicRules: () => {
-      return [{ required: true, message: '请输入设备编号!' }];
-    },
-  },
-  {
-    label: '父设备编号',
-    field: 'deviceBaseInfoId',
-    component: 'Input',
-    show: false,
-  },
-  {
-    label: '品牌',
-    field: 'brand',
-    component: 'JDictSelectTag',
-    componentProps: {
-      dictCode: 'brand_type',
-    },
-  },
-  {
-    label: '规格型号',
-    field: 'specificationModel',
-    component: 'Input',
-  },
-  // TODO 主键隐藏字段,目前写死为ID
-  {
-    label: '',
-    field: 'id',
-    component: 'Input',
-    show: false,
-  },
-];
-
-// 高级查询数据
-export const superQuerySchema = {
-  createDate: { title: '日期', order: 0, view: 'datetime', type: 'string' },
-  deviceNumber: { title: '设备编号', order: 1, view: 'text', type: 'string' },
-  parentDeviceNumber: { title: '父设备编号', order: 2, view: 'text', type: 'string' },
-  parentDeviceName: { title: '父设备名称', order: 3, view: 'text', type: 'string' },
-  brand: { title: '品牌', order: 4, view: 'text', type: 'string' },
-  specificationModel: { title: '规格型号', order: 5, view: 'text', type: 'string' },
-};
-
-/**
- * 流程表单调用这个方法获取formSchema
- * @param param
- */
-export function getBpmFormSchema(_formData): FormSchema[] {
-  // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
-  return formSchema;
-}

+ 0 - 26
src/views/equipmentLifecycle/device/parentDevice/V20250401_1__menu_insert_ParentDevice.sql

@@ -1,26 +0,0 @@
--- 注意:该页面对应的前台目录为views/deviceInfo文件夹下
--- 如果你想更改到其他目录,请修改sql中component字段对应的值
-
-
-INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) 
-VALUES ('2025040103458600520', NULL, '父设备表', '/deviceInfo/parentDeviceList', 'deviceInfo/ParentDeviceList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-04-01 15:45:52', NULL, NULL, 0);
-
--- 权限控制sql
--- 新增
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('2025040103458600521', '2025040103458600520', '添加父设备表', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:parent_device:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:45:52', NULL, NULL, 0, 0, '1', 0);
--- 编辑
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('2025040103458600522', '2025040103458600520', '编辑父设备表', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:parent_device:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:45:52', NULL, NULL, 0, 0, '1', 0);
--- 删除
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('2025040103458600523', '2025040103458600520', '删除父设备表', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:parent_device:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:45:52', NULL, NULL, 0, 0, '1', 0);
--- 批量删除
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('2025040103458610524', '2025040103458600520', '批量删除父设备表', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:parent_device:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:45:52', NULL, NULL, 0, 0, '1', 0);
--- 导出excel
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('2025040103458610525', '2025040103458600520', '导出excel_父设备表', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:parent_device:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:45:52', NULL, NULL, 0, 0, '1', 0);
--- 导入excel
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('2025040103458610526', '2025040103458600520', '导入excel_父设备表', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:parent_device:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:45:52', NULL, NULL, 0, 0, '1', 0);

+ 0 - 70
src/views/equipmentLifecycle/device/parentDevice/components/ParentDeviceForm.vue

@@ -1,70 +0,0 @@
-<template>
-    <div style="min-height: 400px">
-        <BasicForm @register="registerForm"></BasicForm>
-        <div style="width: 100%;text-align: center" v-if="!formDisabled">
-            <a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
-        </div>
-    </div>
-</template>
-
-<script lang="ts">
-    import {BasicForm, useForm} from '/@/components/Form/index';
-    import {computed, defineComponent} from 'vue';
-    import {defHttp} from '/@/utils/http/axios';
-    import { propTypes } from '/@/utils/propTypes';
-    import {getBpmFormSchema} from '../ParentDevice.data';
-    import {saveOrUpdate} from '../ParentDevice.api';
-    
-    export default defineComponent({
-        name: "ParentDeviceForm",
-        components:{
-            BasicForm
-        },
-        props:{
-            formData: propTypes.object.def({}),
-            formBpm: propTypes.bool.def(true),
-        },
-        setup(props){
-            const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
-                labelWidth: 150,
-                schemas: getBpmFormSchema(props.formData),
-                showActionButtonGroup: false,
-                baseColProps: {span: 24}
-            });
-
-            const formDisabled = computed(()=>{
-                if(props.formData.disabled === false){
-                    return false;
-                }
-                return true;
-            });
-
-            let formData = {};
-            const queryByIdUrl = '/deviceInfo/parentDevice/queryById';
-            async function initFormData(){
-                let params = {id: props.formData.dataId};
-                const data = await defHttp.get({url: queryByIdUrl, params});
-                formData = {...data}
-                //设置表单的值
-                await setFieldsValue(formData);
-                //默认是禁用
-                await setProps({disabled: formDisabled.value})
-            }
-
-            async function submitForm() {
-                let data = getFieldsValue();
-                let params = Object.assign({}, formData, data);
-                console.log('表单数据', params)
-                await saveOrUpdate(params, true)
-            }
-
-            initFormData();
-            
-            return {
-                registerForm,
-                formDisabled,
-                submitForm,
-            }
-        }
-    });
-</script>

+ 0 - 188
src/views/equipmentLifecycle/device/parentDevice/index.vue

@@ -1,188 +0,0 @@
-<template>
-  <!--引用表格-->
-  <BasicTable @register="registerTable" :rowSelection="rowSelection">
-    <!--插槽:table标题-->
-    <template #tableTitle>
-      <a-button type="primary" v-auth="'deviceInfo:parent_device:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
-      <a-button type="primary" v-auth="'deviceInfo:parent_device:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
-        导出
-      </a-button>
-      <j-upload-button type="primary" v-auth="'deviceInfo:parent_device:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">
-        导入
-      </j-upload-button>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <template #overlay>
-          <a-menu>
-            <a-menu-item key="1" @click="batchHandleDelete">
-              <Icon icon="ant-design:delete-outlined" />
-              删除
-            </a-menu-item>
-          </a-menu>
-        </template>
-        <a-button v-auth="'deviceInfo:parent_device:deleteBatch'"
-          >批量操作
-          <Icon icon="mdi:chevron-down" />
-        </a-button>
-      </a-dropdown>
-      <!-- 高级查询 -->
-      <super-query :config="superQueryConfig" @search="handleSuperQuery" />
-    </template>
-    <!--操作栏-->
-    <template #action="{ record }">
-      <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
-    </template>
-    <!--字段回显插槽-->
-    <!-- <template v-slot:bodyCell="{ column, record, index, text }"> </template> -->
-  </BasicTable>
-  <!-- 表单区域 -->
-  <ParentDeviceModal @register="registerModal" @success="handleSuccess" />
-</template>
-
-<script lang="ts" name="deviceInfo-parentDevice" setup>
-  import { reactive } from 'vue';
-  import { BasicTable, TableAction } from '/@/components/Table';
-  import { useModal } from '/@/components/Modal';
-  import { useListPage } from '/@/hooks/system/useListPage';
-  import ParentDeviceModal from './components/ParentDeviceModal.vue';
-  import { columns, searchFormSchema, superQuerySchema } from './ParentDevice.data';
-  import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ParentDevice.api';
-
-  const queryParam = reactive<any>({});
-
-  //注册model
-  const [registerModal, { openModal }] = useModal();
-  //注册table数据
-  const { tableContext, onExportXls, onImportXls } = useListPage({
-    tableProps: {
-      title: '父设备表',
-      api: list,
-      columns,
-      canResize: false,
-      formConfig: {
-        //labelWidth: 120,
-        schemas: searchFormSchema,
-        autoSubmitOnEnter: true,
-        showAdvancedButton: true,
-        fieldMapToNumber: [],
-        fieldMapToTime: [],
-      },
-      actionColumn: {
-        width: 120,
-        fixed: 'right',
-      },
-      beforeFetch: (params) => {
-        return Object.assign(params, queryParam);
-      },
-    },
-    exportConfig: {
-      name: '父设备表',
-      url: getExportUrl,
-      params: queryParam,
-    },
-    importConfig: {
-      url: getImportUrl,
-      success: handleSuccess,
-    },
-  });
-
-  const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
-
-  // 高级查询配置
-  const superQueryConfig = reactive(superQuerySchema);
-
-  /**
-   * 高级查询事件
-   */
-  function handleSuperQuery(params) {
-    Object.keys(params).map((k) => {
-      queryParam[k] = params[k];
-    });
-    reload();
-  }
-  /**
-   * 新增事件
-   */
-  function handleAdd() {
-    openModal(true, {
-      isUpdate: false,
-      showFooter: true,
-    });
-  }
-  /**
-   * 编辑事件
-   */
-  function handleEdit(record: Recordable) {
-    openModal(true, {
-      record,
-      isUpdate: true,
-      showFooter: true,
-    });
-  }
-  /**
-   * 详情
-   */
-  function handleDetail(record: Recordable) {
-    openModal(true, {
-      record,
-      isUpdate: true,
-      showFooter: false,
-    });
-  }
-  /**
-   * 删除事件
-   */
-  async function handleDelete(record) {
-    await deleteOne({ id: record.id }, handleSuccess);
-  }
-  /**
-   * 批量删除事件
-   */
-  async function batchHandleDelete() {
-    await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
-  }
-  /**
-   * 成功回调
-   */
-  function handleSuccess() {
-    (selectedRowKeys.value = []) && reload();
-  }
-  /**
-   * 操作栏
-   */
-  function getTableAction(record) {
-    return [
-      {
-        label: '编辑',
-        onClick: handleEdit.bind(null, record),
-        auth: 'deviceInfo:parent_device:edit',
-      },
-    ];
-  }
-  /**
-   * 下拉操作栏
-   */
-  function getDropDownAction(record) {
-    return [
-      {
-        label: '详情',
-        onClick: handleDetail.bind(null, record),
-      },
-      {
-        label: '删除',
-        popConfirm: {
-          title: '是否确认删除',
-          confirm: handleDelete.bind(null, record),
-          placement: 'topLeft',
-        },
-        auth: 'deviceInfo:parent_device:delete',
-      },
-    ];
-  }
-</script>
-
-<style lang="less" scoped>
-  :deep(.ant-picker),
-  :deep(.ant-input-number) {
-    width: 100%;
-  }
-</style>

+ 0 - 64
src/views/equipmentLifecycle/device/subDevice/SubDevice.api.ts

@@ -1,64 +0,0 @@
-import {defHttp} from '/@/utils/http/axios';
-import { useMessage } from "/@/hooks/web/useMessage";
-
-const { createConfirm } = useMessage();
-
-enum Api {
-  list = '/deviceInfo/subDevice/list',
-  save='/deviceInfo/subDevice/add',
-  edit='/deviceInfo/subDevice/edit',
-  deleteOne = '/deviceInfo/subDevice/delete',
-  deleteBatch = '/deviceInfo/subDevice/deleteBatch',
-  importExcel = '/deviceInfo/subDevice/importExcel',
-  exportXls = '/deviceInfo/subDevice/exportXls',
-}
-/**
- * 导出api
- * @param params
- */
-export const getExportUrl = Api.exportXls;
-/**
- * 导入api
- */
-export const getImportUrl = Api.importExcel;
-/**
- * 列表接口
- * @param params
- */
-export const list = (params) =>
-  defHttp.get({url: Api.list, params});
-
-/**
- * 删除单个
- */
-export const deleteOne = (params,handleSuccess) => {
-  return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
-    handleSuccess();
-  });
-}
-/**
- * 批量删除
- * @param params
- */
-export const batchDelete = (params, handleSuccess) => {
-  createConfirm({
-    iconType: 'warning',
-    title: '确认删除',
-    content: '是否删除选中数据',
-    okText: '确认',
-    cancelText: '取消',
-    onOk: () => {
-      return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
-        handleSuccess();
-      });
-    }
-  });
-}
-/**
- * 保存或者更新
- * @param params
- */
-export const saveOrUpdate = (params, isUpdate) => {
-  let url = isUpdate ? Api.edit : Api.save;
-  return defHttp.post({url: url, params});
-}

+ 0 - 114
src/views/equipmentLifecycle/device/subDevice/SubDevice.data.ts

@@ -1,114 +0,0 @@
-import {BasicColumn} from '/@/components/Table';
-import {FormSchema} from '/@/components/Table';
-import { rules} from '/@/utils/helper/validator';
-import { render } from '/@/utils/common/renderUtils';
-import { getWeekMonthQuarterYear } from '/@/utils';
-//列表数据
-export const columns: BasicColumn[] = [
-   {
-    title: '日期',
-    align:"center",
-    dataIndex: 'createDate'
-   },
-   {
-    title: '设备编号',
-    align:"center",
-    dataIndex: 'deviceNumber'
-   },
-   {
-    title: '子设备编号',
-    align:"center",
-    dataIndex: 'subDeviceNumber'
-   },
-   {
-    title: '子设备名称',
-    align:"center",
-    dataIndex: 'subDeviceName'
-   },
-   {
-    title: '品牌',
-    align:"center",
-    dataIndex: 'brand'
-   },
-   {
-    title: '规格型号',
-    align:"center",
-    dataIndex: 'specificationModel'
-   },
-];
-//查询数据
-export const searchFormSchema: FormSchema[] = [
-];
-//表单数据
-export const formSchema: FormSchema[] = [
-  {
-    label: '日期',
-    field: 'createDate',
-    component: 'DatePicker',
-    componentProps: {
-       showTime: true,
-       valueFormat: 'YYYY-MM-DD HH:mm:ss'
-     },
-  },
-  {
-    label: '设备编号',
-    field: 'deviceNumber',
-    component: 'Input',
-    dynamicRules: ({model,schema}) => {
-          return [
-                 { required: true, message: '请输入设备编号!'},
-          ];
-     },
-  },
-  {
-    label: '子设备编号',
-    field: 'subDeviceNumber',
-    component: 'Input',
-    dynamicRules: ({model,schema}) => {
-          return [
-                 { required: true, message: '请输入子设备编号!'},
-          ];
-     },
-  },
-  {
-    label: '子设备名称',
-    field: 'subDeviceName',
-    component: 'Input',
-  },
-  {
-    label: '品牌',
-    field: 'brand',
-    component: 'Input',
-  },
-  {
-    label: '规格型号',
-    field: 'specificationModel',
-    component: 'Input',
-  },
-	// TODO 主键隐藏字段,目前写死为ID
-	{
-	  label: '',
-	  field: 'id',
-	  component: 'Input',
-	  show: false
-	},
-];
-
-// 高级查询数据
-export const superQuerySchema = {
-  createDate: {title: '日期',order: 0,view: 'datetime', type: 'string',},
-  deviceNumber: {title: '设备编号',order: 1,view: 'text', type: 'string',},
-  subDeviceNumber: {title: '子设备编号',order: 2,view: 'text', type: 'string',},
-  subDeviceName: {title: '子设备名称',order: 3,view: 'text', type: 'string',},
-  brand: {title: '品牌',order: 4,view: 'text', type: 'string',},
-  specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
-};
-
-/**
-* 流程表单调用这个方法获取formSchema
-* @param param
-*/
-export function getBpmFormSchema(_formData): FormSchema[]{
-  // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
-  return formSchema;
-}

+ 0 - 26
src/views/equipmentLifecycle/device/subDevice/V20250401_1__menu_insert_SubDevice.sql

@@ -1,26 +0,0 @@
--- 注意:该页面对应的前台目录为views/deviceInfo文件夹下
--- 如果你想更改到其他目录,请修改sql中component字段对应的值
-
-
-INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) 
-VALUES ('202504010347250270', NULL, '子设备', '/deviceInfo/subDeviceList', 'deviceInfo/SubDeviceList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-04-01 15:47:27', NULL, NULL, 0);
-
--- 权限控制sql
--- 新增
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('202504010347250271', '202504010347250270', '添加子设备', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:sub_device:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:47:27', NULL, NULL, 0, 0, '1', 0);
--- 编辑
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('202504010347250272', '202504010347250270', '编辑子设备', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:sub_device:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:47:27', NULL, NULL, 0, 0, '1', 0);
--- 删除
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('202504010347250273', '202504010347250270', '删除子设备', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:sub_device:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:47:27', NULL, NULL, 0, 0, '1', 0);
--- 批量删除
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('202504010347250274', '202504010347250270', '批量删除子设备', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:sub_device:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:47:27', NULL, NULL, 0, 0, '1', 0);
--- 导出excel
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('202504010347250275', '202504010347250270', '导出excel_子设备', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:sub_device:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:47:27', NULL, NULL, 0, 0, '1', 0);
--- 导入excel
-INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
-VALUES ('202504010347250276', '202504010347250270', '导入excel_子设备', NULL, NULL, 0, NULL, NULL, 2, 'deviceInfo:sub_device:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-01 15:47:27', NULL, NULL, 0, 0, '1', 0);

+ 0 - 70
src/views/equipmentLifecycle/device/subDevice/components/SubDeviceForm.vue

@@ -1,70 +0,0 @@
-<template>
-    <div style="min-height: 400px">
-        <BasicForm @register="registerForm"></BasicForm>
-        <div style="width: 100%;text-align: center" v-if="!formDisabled">
-            <a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
-        </div>
-    </div>
-</template>
-
-<script lang="ts">
-    import {BasicForm, useForm} from '/@/components/Form/index';
-    import {computed, defineComponent} from 'vue';
-    import {defHttp} from '/@/utils/http/axios';
-    import { propTypes } from '/@/utils/propTypes';
-    import {getBpmFormSchema} from '../SubDevice.data';
-    import {saveOrUpdate} from '../SubDevice.api';
-    
-    export default defineComponent({
-        name: "SubDeviceForm",
-        components:{
-            BasicForm
-        },
-        props:{
-            formData: propTypes.object.def({}),
-            formBpm: propTypes.bool.def(true),
-        },
-        setup(props){
-            const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
-                labelWidth: 150,
-                schemas: getBpmFormSchema(props.formData),
-                showActionButtonGroup: false,
-                baseColProps: {span: 24}
-            });
-
-            const formDisabled = computed(()=>{
-                if(props.formData.disabled === false){
-                    return false;
-                }
-                return true;
-            });
-
-            let formData = {};
-            const queryByIdUrl = '/deviceInfo/subDevice/queryById';
-            async function initFormData(){
-                let params = {id: props.formData.dataId};
-                const data = await defHttp.get({url: queryByIdUrl, params});
-                formData = {...data}
-                //设置表单的值
-                await setFieldsValue(formData);
-                //默认是禁用
-                await setProps({disabled: formDisabled.value})
-            }
-
-            async function submitForm() {
-                let data = getFieldsValue();
-                let params = Object.assign({}, formData, data);
-                console.log('表单数据', params)
-                await saveOrUpdate(params, true)
-            }
-
-            initFormData();
-            
-            return {
-                registerForm,
-                formDisabled,
-                submitForm,
-            }
-        }
-    });
-</script>

+ 0 - 76
src/views/equipmentLifecycle/device/subDevice/components/SubDeviceModal.vue

@@ -1,76 +0,0 @@
-<template>
-  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
-      <BasicForm @register="registerForm" name="SubDeviceForm" />
-  </BasicModal>
-</template>
-
-<script lang="ts" setup>
-    import {ref, computed, unref} from 'vue';
-    import {BasicModal, useModalInner} from '/@/components/Modal';
-    import {BasicForm, useForm} from '/@/components/Form/index';
-    import {formSchema} from '../SubDevice.data';
-    import {saveOrUpdate} from '../SubDevice.api';
-    // Emits声明
-    const emit = defineEmits(['register','success']);
-    const isUpdate = ref(true);
-    const isDetail = ref(false);
-    //表单配置
-    const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
-        labelWidth: 150,
-        schemas: formSchema,
-        showActionButtonGroup: false,
-        baseColProps: {span: 24}
-    });
-    //表单赋值
-    const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
-        //重置表单
-        await resetFields();
-        setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
-        isUpdate.value = !!data?.isUpdate;
-        isDetail.value = !!data?.showFooter;
-        if (unref(isUpdate)) {
-            //表单赋值
-            await setFieldsValue({
-                ...data.record,
-            });
-        }
-        // 隐藏底部时禁用整个表单
-       setProps({ disabled: !data?.showFooter })
-    });
-    //设置标题
-    const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
-    //表单提交事件
-    async function handleSubmit(v) {
-        try {
-            let values = await validate();
-            setModalProps({confirmLoading: true});
-            //提交表单
-            await saveOrUpdate(values, isUpdate.value);
-            //关闭弹窗
-            closeModal();
-            //刷新列表
-            emit('success');
-        } catch ({ errorFields }) {
-           if (errorFields) {
-             const firstField = errorFields[0];
-             if (firstField) {
-               scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
-             }
-           }
-           return Promise.reject(errorFields);
-        } finally {
-            setModalProps({confirmLoading: false});
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-	/** 时间和数字输入框样式 */
-  :deep(.ant-input-number) {
-    width: 100%;
-  }
-
-  :deep(.ant-calendar-picker) {
-    width: 100%;
-  }
-</style>

+ 0 - 186
src/views/equipmentLifecycle/device/subDevice/index.vue

@@ -1,186 +0,0 @@
-<template>
-  <!--引用表格-->
-  <BasicTable @register="registerTable" :rowSelection="rowSelection">
-    <!--插槽:table标题-->
-    <template #tableTitle>
-      <a-button type="primary" v-auth="'deviceInfo:sub_device:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
-      <a-button type="primary" v-auth="'deviceInfo:sub_device:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出 </a-button>
-      <j-upload-button type="primary" v-auth="'deviceInfo:sub_device:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">
-        导入
-      </j-upload-button>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <template #overlay>
-          <a-menu>
-            <a-menu-item key="1" @click="batchHandleDelete">
-              <Icon icon="ant-design:delete-outlined" />
-              删除
-            </a-menu-item>
-          </a-menu>
-        </template>
-        <a-button v-auth="'deviceInfo:sub_device:deleteBatch'"
-          >批量操作
-          <Icon icon="mdi:chevron-down" />
-        </a-button>
-      </a-dropdown>
-      <!-- 高级查询 -->
-      <super-query :config="superQueryConfig" @search="handleSuperQuery" />
-    </template>
-    <!--操作栏-->
-    <template #action="{ record }">
-      <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
-    </template>
-    <!--字段回显插槽-->
-    <!-- <template v-slot:bodyCell="{ column, record, index, text }"> </template> -->
-  </BasicTable>
-  <!-- 表单区域 -->
-  <SubDeviceModal @register="registerModal" @success="handleSuccess" />
-</template>
-
-<script lang="ts" name="deviceInfo-subDevice" setup>
-  import { reactive } from 'vue';
-  import { BasicTable, TableAction } from '/@/components/Table';
-  import { useModal } from '/@/components/Modal';
-  import { useListPage } from '/@/hooks/system/useListPage';
-  import SubDeviceModal from './components/SubDeviceModal.vue';
-  import { columns, searchFormSchema, superQuerySchema } from './SubDevice.data';
-  import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SubDevice.api';
-
-  const queryParam = reactive<any>({});
-
-  //注册model
-  const [registerModal, { openModal }] = useModal();
-  //注册table数据
-  const { tableContext, onExportXls, onImportXls } = useListPage({
-    tableProps: {
-      title: '子设备',
-      api: list,
-      columns,
-      canResize: false,
-      formConfig: {
-        //labelWidth: 120,
-        schemas: searchFormSchema,
-        autoSubmitOnEnter: true,
-        showAdvancedButton: true,
-        fieldMapToNumber: [],
-        fieldMapToTime: [],
-      },
-      actionColumn: {
-        width: 120,
-        fixed: 'right',
-      },
-      beforeFetch: (params) => {
-        return Object.assign(params, queryParam);
-      },
-    },
-    exportConfig: {
-      name: '子设备',
-      url: getExportUrl,
-      params: queryParam,
-    },
-    importConfig: {
-      url: getImportUrl,
-      success: handleSuccess,
-    },
-  });
-
-  const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
-
-  // 高级查询配置
-  const superQueryConfig = reactive(superQuerySchema);
-
-  /**
-   * 高级查询事件
-   */
-  function handleSuperQuery(params) {
-    Object.keys(params).map((k) => {
-      queryParam[k] = params[k];
-    });
-    reload();
-  }
-  /**
-   * 新增事件
-   */
-  function handleAdd() {
-    openModal(true, {
-      isUpdate: false,
-      showFooter: true,
-    });
-  }
-  /**
-   * 编辑事件
-   */
-  function handleEdit(record: Recordable) {
-    openModal(true, {
-      record,
-      isUpdate: true,
-      showFooter: true,
-    });
-  }
-  /**
-   * 详情
-   */
-  function handleDetail(record: Recordable) {
-    openModal(true, {
-      record,
-      isUpdate: true,
-      showFooter: false,
-    });
-  }
-  /**
-   * 删除事件
-   */
-  async function handleDelete(record) {
-    await deleteOne({ id: record.id }, handleSuccess);
-  }
-  /**
-   * 批量删除事件
-   */
-  async function batchHandleDelete() {
-    await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
-  }
-  /**
-   * 成功回调
-   */
-  function handleSuccess() {
-    (selectedRowKeys.value = []) && reload();
-  }
-  /**
-   * 操作栏
-   */
-  function getTableAction(record) {
-    return [
-      {
-        label: '编辑',
-        onClick: handleEdit.bind(null, record),
-        auth: 'deviceInfo:sub_device:edit',
-      },
-    ];
-  }
-  /**
-   * 下拉操作栏
-   */
-  function getDropDownAction(record) {
-    return [
-      {
-        label: '详情',
-        onClick: handleDetail.bind(null, record),
-      },
-      {
-        label: '删除',
-        popConfirm: {
-          title: '是否确认删除',
-          confirm: handleDelete.bind(null, record),
-          placement: 'topLeft',
-        },
-        auth: 'deviceInfo:sub_device:delete',
-      },
-    ];
-  }
-</script>
-
-<style lang="less" scoped>
-  :deep(.ant-picker),
-  :deep(.ant-input-number) {
-    width: 100%;
-  }
-</style>

+ 80 - 11
src/views/equipmentLifecycle/setting/material/DeviceMaterialRelation.data.ts

@@ -54,26 +54,60 @@ export const formSchema: FormSchema[] = [
     label: '物料/备件名称',
     field: 'materialName',
     component: 'Input',
+    colProps: { span: 12 },
+    rules: [{ required: true, message: '物料/备件名称不能为空' }],
   },
   {
     label: '物料/备件编号',
     field: 'materialNumber',
     component: 'Input',
+    colProps: { span: 12 },
+    rules: [{ required: true, message: '物料/备件编号不能为空' }],
   },
   {
     label: '物料规格型号',
     field: 'materialSpecModel',
     component: 'Input',
+    colProps: { span: 12 },
+  },
+  {
+    label: '品牌',
+    field: 'brand',
+    component: 'JSearchSelect',
+    componentProps: {
+      dict: 'brand_type',
+    },
+    colProps: { span: 12 },
   },
   {
     label: '分类',
     field: 'classification',
-    component: 'Input',
+    component: 'JSearchSelect',
+    componentProps: {
+      dict: 'classification',
+    },
+    colProps: { span: 12 },
+  },
+  {
+    label: '类型',
+    field: 'materialType',
+    component: 'JSearchSelect',
+    componentProps: {
+      dict: 'material_type',
+    },
+    colProps: { span: 12 },
   },
   {
     label: '更换周期',
     field: 'replacementCycle',
     component: 'Input',
+    colProps: { span: 12 },
+  },
+  {
+    label: '采购周期',
+    field: 'purchaseCycle',
+    component: 'Input',
+    colProps: { span: 12 },
   },
   {
     label: '单位',
@@ -82,6 +116,48 @@ export const formSchema: FormSchema[] = [
     componentProps: {
       dict: 'unit_type',
     },
+    colProps: { span: 12 },
+  },
+  {
+    label: '标签码',
+    field: 'labelCode',
+    component: 'Input',
+    colProps: { span: 12 },
+  },
+  {
+    label: '单价',
+    field: 'price',
+    component: 'InputNumber',
+    colProps: { span: 12 },
+  },
+  {
+    label: '数量',
+    field: 'amount',
+    component: 'InputNumber',
+    dynamicDisabled: true,
+    colProps: { span: 12 },
+  },
+  {
+    label: '物料/备件图片',
+    field: 'imageUrl',
+    component: 'JImageUpload',
+    helpMessage: '最多上传3张图片',
+    componentProps: {
+      fileMax: 3,
+    },
+    colProps: { span: 12 },
+  },
+  {
+    field: 'uploadFileMax',
+    component: 'JUpload',
+    helpMessage: '最多上传3个文件',
+    label: '上传附件',
+    componentProps: { maxCount: 3 },
+  },
+  {
+    label: '备注',
+    field: 'remark',
+    component: 'InputTextArea',
   },
   // TODO 主键隐藏字段,目前写死为ID
   {
@@ -94,18 +170,11 @@ export const formSchema: FormSchema[] = [
 
 // 高级查询数据
 export const superQuerySchema = {
-  createDate: { title: '日期', order: 0, view: 'datetime', type: 'string' },
-  serialNumber: { title: '序号', order: 1, view: 'number', type: 'number' },
-  deviceNumber: { title: '设备编号', order: 2, view: 'text', type: 'string' },
-  deviceName: { title: '设备名称', order: 3, view: 'text', type: 'string' },
-  deviceCategory: { title: '设备类别', order: 4, view: 'text', type: 'string' },
-  deviceSpecModel: { title: '设备规格型号', order: 5, view: 'text', type: 'string' },
-  materialSpecModel: { title: '物料规格型号', order: 6, view: 'text', type: 'string' },
-  materialName: { title: '物料名称', order: 7, view: 'text', type: 'string' },
-  materialNumber: { title: '物料编号', order: 8, view: 'text', type: 'string' },
+  materialSpecModel: { title: '规格型号', order: 6, view: 'text', type: 'string' },
+  materialName: { title: '物料/备件名称', order: 7, view: 'text', type: 'string' },
+  materialNumber: { title: '物料/备件编号', order: 8, view: 'text', type: 'string' },
   classification: { title: '分类', order: 9, view: 'text', type: 'string' },
   replacementCycle: { title: '更换周期', order: 10, view: 'text', type: 'string' },
-  demandAmount: { title: '需求量', order: 11, view: 'number', type: 'number' },
   unit: { title: '单位', order: 12, view: 'text', type: 'string' },
 };
 

+ 2 - 2
src/views/equipmentLifecycle/setting/material/components/DeviceMaterialRelationModal.vue

@@ -5,9 +5,9 @@
     destroyOnClose
     :title="title"
     :bodyStyle="{
-      padding: '20px 10px 0 0',
+      padding: '20px 60px 0 0',
     }"
-    :width="800"
+    :width="900"
     @ok="handleSubmit"
   >
     <BasicForm @register="registerForm" name="DeviceMaterialRelationForm" />

+ 8 - 8
src/views/sys/login/LoginSelect.vue

@@ -62,7 +62,7 @@
 </template>
 
 <script lang="ts">
-  import { defineComponent, ref, computed, watch, unref, reactive, UnwrapRef } from 'vue';
+  import { defineComponent, ref, computed, unref, reactive, UnwrapRef } from 'vue';
   import { Avatar } from 'ant-design-vue';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { useMessage } from '/@/hooks/web/useMessage';
@@ -138,11 +138,11 @@
        */
       function bizDepart(loginResult) {
         //如果登录接口返回了用户上次登录租户ID,则不需要重新选择
-        if(loginResult.userInfo?.orgCode && loginResult.userInfo?.orgCode!==''){
+        if (loginResult.userInfo?.orgCode && loginResult.userInfo?.orgCode !== '') {
           isMultiDepart.value = false;
           return;
         }
-        
+
         let multi_depart = loginResult.multi_depart;
         //0:无部门 1:一个部门 2:多个部门
         if (multi_depart == 0) {
@@ -165,11 +165,11 @@
        */
       function bizTenantList(loginResult) {
         //如果登录接口返回了用户上次登录租户ID,则不需要重新选择
-        if(loginResult.userInfo?.loginTenantId && loginResult.userInfo?.loginTenantId!==0){
+        if (loginResult.userInfo?.loginTenantId && loginResult.userInfo?.loginTenantId !== 0) {
           isMultiTenant.value = false;
           return;
         }
-        
+
         let tenantArr = loginResult.tenantList;
         if (Array.isArray(tenantArr)) {
           if (tenantArr.length === 0) {
@@ -225,7 +225,7 @@
           if (!unref(isMultiDepart) && !unref(isMultiTenant)) {
             resolve();
           } else {
-            let params = { orgCode: formState.orgCode,loginTenantId: formState.tenantId, username: unref(username) };
+            let params = { orgCode: formState.orgCode, loginTenantId: formState.tenantId, username: unref(username) };
             defHttp.put({ url: '/sys/selectDepart', params }).then((res) => {
               if (res.userInfo) {
                 userStore.setUserInfo(res.userInfo);
@@ -289,11 +289,11 @@
         validate_status1.value = '';
       }
 
-      function handleTenantChange(e) {
+      function handleTenantChange() {
         validate_status.value = '';
       }
 
-      function handleDepartChange(e) {
+      function handleDepartChange() {
         validate_status1.value = '';
       }