diff --git a/src/views/archiveKeeping/deviceManage/form.vue b/src/views/archiveKeeping/deviceManage/form.vue index 43ca8ae..0618725 100644 --- a/src/views/archiveKeeping/deviceManage/form.vue +++ b/src/views/archiveKeeping/deviceManage/form.vue @@ -3,23 +3,38 @@
- - - - - - - - - - - - - - - /m² +
+ + + + + + + + + + + - + + + /m² + + +
+
+ + + + + + + + + + + +
@@ -40,7 +55,7 @@ const defaultForm = { id: null, name: null, code: null, admin: null, phone: null export default { mixins: [form(defaultForm)], props: { - selectedCategory: { + selectedStore: { type: Object, default: function() { return {} @@ -49,36 +64,35 @@ export default { }, data() { return { - isAdd: false, + isAddArea: false, rules: { name: [ { required: true, message: '库房名称不可为空', trigger: 'blur' } ], + areaName: [ + { required: true, message: '区域名称不可为空', trigger: 'blur' } + ], code: [ { required: true, message: '库房编码不可为空', trigger: 'blur' } + ], + areaCode: [ + { required: true, message: '区域编码不可为空', trigger: 'blur' } ] } } }, watch: { - selectedCategory: function(newValue, oldValue) { + selectedStore: function(newValue, oldValue) { } }, created() { }, methods: { - // 新建时,判断当前节点类型,“门类类型” option区分可选 - beforeToAdd() { - this.form.isType = null - }, [CRUD.HOOK.beforeSubmit]() { }, // 提交前的验证 [CRUD.HOOK.afterValidateCU](crud) { return true - }, - changeType() { - this.isAdd = this.form.isType === 2 } } } diff --git a/src/views/archiveKeeping/deviceManage/index.vue b/src/views/archiveKeeping/deviceManage/index.vue index dcd6619..9b2ec8c 100644 --- a/src/views/archiveKeeping/deviceManage/index.vue +++ b/src/views/archiveKeeping/deviceManage/index.vue @@ -51,12 +51,13 @@
+
- + @@ -66,12 +67,14 @@ import crudCategory from '@/api/system/category/category' import CRUD, { presenter, header } from '@crud/crud' import crudOperation from '@crud/CRUD.operation' import eForm from './form' +import sortDialog from './sortDialog' +import TableList from './tableList' import Vue from 'vue' import dataJson from './data.json' export default { name: 'DeviceManage', - components: { crudOperation, eForm }, + components: { crudOperation, eForm, sortDialog, TableList }, cruds() { return [ CRUD({ @@ -173,18 +176,28 @@ export default { } } }, - // 新增 - 判断当前节点类型,卷内/文件不可新建 + // 新增 - 判断当前节点类型 [CRUD.HOOK.beforeToAdd](crud, form, btn) { const isCanAddKey = JSON.parse(localStorage.getItem('currentStoreKey')) - if (isCanAddKey.isType === 4 || isCanAddKey.isType === 5) { - this.$message({ - message: '此门类下不可新建门类', - type: 'error', - duration: 2500 - }) - return false + console.log('isCanAddKey', isCanAddKey) + if (isCanAddKey.isType === '2') { + this.$refs.eform.isAddArea = true + this.$refs.eform.crud.title = '区域' + } else { + this.$refs.eform.isAddArea = false + this.$refs.eform.crud.title = '库房' + } + }, + // 编辑前 + [CRUD.HOOK.beforeToEdit](crud, form, btn) { + const isCanAddKey = JSON.parse(localStorage.getItem('currentStoreKey')) + if (isCanAddKey.isType === '2') { + this.$refs.eform.isAddArea = false + this.$refs.eform.crud.title = '库房' + } else { + this.$refs.eform.isAddArea = true + this.$refs.eform.crud.title = '区域' } - this.$refs.eform.beforeToAdd() }, // 新增/编辑后 - 新增后默认选中新增的库房 [CRUD.HOOK.afterSubmit](crud, addedCategory) { diff --git a/src/views/archiveKeeping/deviceManage/module/childDevice.vue b/src/views/archiveKeeping/deviceManage/module/childDevice.vue new file mode 100644 index 0000000..ddd6af6 --- /dev/null +++ b/src/views/archiveKeeping/deviceManage/module/childDevice.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/views/archiveKeeping/deviceManage/sortDialog.vue b/src/views/archiveKeeping/deviceManage/sortDialog.vue new file mode 100644 index 0000000..e15bf03 --- /dev/null +++ b/src/views/archiveKeeping/deviceManage/sortDialog.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/views/archiveKeeping/deviceManage/tableList.vue b/src/views/archiveKeeping/deviceManage/tableList.vue new file mode 100644 index 0000000..4f8e738 --- /dev/null +++ b/src/views/archiveKeeping/deviceManage/tableList.vue @@ -0,0 +1,559 @@ + + + + + diff --git a/src/views/archiveKeeping/deviceManage/type.json b/src/views/archiveKeeping/deviceManage/type.json new file mode 100644 index 0000000..f93533c --- /dev/null +++ b/src/views/archiveKeeping/deviceManage/type.json @@ -0,0 +1,32 @@ +{ + "code": 200, + "message": "操作成功", + "data": [ + + { + "id": "7305DE3D273B0CAC079538", + "name": "网络视频录像机(NVR)" + }, + { + "id": "C09A1946216E496BB3FA88", + "name": "环境监控主机" + }, + { + "id": "DD656054BE3D1DF1E2F1FC", + "name": "密集架" + }, + { + "id": "65D1886B0F864291766421", + "name": "通道门" + }, + { + "id": "E2767FEACA9CE0E3B16B89", + "name": "桌面式RFID读写器" + }, + { + "id": "3B85FA21FDAFBB618B5D40", + "name": "手持式RFID读写器" + } + ], + "timestamp": 1703481969284 +} \ No newline at end of file