From 4eb9b321db6a1c0ad34d09db62e76f9a52c4cd1f Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 22 Aug 2023 15:53:02 +0800 Subject: [PATCH] add EquipmentDrawer --- .env.dev | 4 +- src/components/DialogForm/index.vue | 4 +- .../equipment/components/EquipmentDrawer.vue | 331 ++++++++++++++++++ .../equipment/components/EquipmentPics.vue | 5 +- src/views/core/base/equipment/index.vue | 51 ++- 5 files changed, 380 insertions(+), 15 deletions(-) create mode 100644 src/views/core/base/equipment/components/EquipmentDrawer.vue diff --git a/.env.dev b/.env.dev index 8ce815d4..a9d58fdc 100644 --- a/.env.dev +++ b/.env.dev @@ -5,8 +5,8 @@ ENV = 'development' VUE_APP_TITLE = 芋道管理系统 # 芋道管理系统/开发环境 -# VUE_APP_BASE_API = 'http://192.168.1.49:48080' -VUE_APP_BASE_API = 'http://192.168.0.33:48080' +VUE_APP_BASE_API = 'http://192.168.1.49:48080' +# VUE_APP_BASE_API = 'http://192.168.0.33:48080' # VUE_APP_BASE_API = 'http://192.168.1.188:48080' # 路由懒加载 diff --git a/src/components/DialogForm/index.vue b/src/components/DialogForm/index.vue index 9b78ee4a..8a307a38 100644 --- a/src/components/DialogForm/index.vue +++ b/src/components/DialogForm/index.vue @@ -44,6 +44,7 @@ v-model="form[col.prop]" type="datetime" :placeholder="`请选择${col.label}`" + value-format="timestamp" v-bind="col.bind"> + + + + + + diff --git a/src/views/core/base/equipment/components/EquipmentPics.vue b/src/views/core/base/equipment/components/EquipmentPics.vue index 20d406f0..5484c901 100644 --- a/src/views/core/base/equipment/components/EquipmentPics.vue +++ b/src/views/core/base/equipment/components/EquipmentPics.vue @@ -78,10 +78,11 @@ export default { // margin: auto; top: 0; right: 0; - width: 640px; - height: 480px; + // width: 640px; + // height: 480px; background: #000; overflow: hidden; + padding: 8px 8px 0; } .equipment-pics > div:hover > figure { diff --git a/src/views/core/base/equipment/index.vue b/src/views/core/base/equipment/index.vue index 4341e3d4..22587626 100644 --- a/src/views/core/base/equipment/index.vue +++ b/src/views/core/base/equipment/index.vue @@ -29,7 +29,7 @@ :limit.sync="queryParams.pageSize" @pagination="getList" /> - + + + + +

Ceshi ceshi ceshi

+
@@ -47,6 +57,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin'; import { getAccessToken } from '@/utils/auth'; import EquipmentPics from './components/EquipmentPics'; import EquipmentAssets from './components/EquipmentAssets'; +import EquipmentDrawer from './components/EquipmentDrawer'; import { createEquipment, @@ -62,6 +73,7 @@ export default { name: 'Equipment', components: { Editor, + EquipmentDrawer, }, mixins: [basicPageMixin], data() { @@ -214,19 +226,19 @@ export default { ], [ { - select: true, + datetime: true, label: '生产日期', prop: 'productionTime', }, { - select: true, + datetime: true, label: '进厂日期', prop: 'enterTime', }, ], [ { - select: true, + input: true, prop: 'tvalue', label: '设备TT值', rules: [ @@ -240,7 +252,7 @@ export default { ], }, { - select: true, + input: true, label: '产品加工时间', prop: 'processingTime', rules: [ @@ -255,13 +267,13 @@ export default { ], [ { - select: true, + input: true, label: '制造商', // rules: [{ required: true, message: '不能为空', trigger: 'blur' }], prop: 'manufacturer', }, { - select: true, + input: true, label: '设备规格', prop: 'spec', }, @@ -303,15 +315,17 @@ export default { prop: 'fileUrls', subcomponent: EquipmentPics, pictures: async () => { - // some async request - return [] + // some async request + return []; }, - style: 'overflow-x: auto;' + style: 'overflow-x: auto;', }, ], ], // 是否显示弹出层 open: false, + editVisible: false, + editMode: 'edit', // 'edit', 'detail' // 查询参数 queryParams: { pageNo: 1, @@ -444,6 +458,23 @@ export default { }) .catch(() => {}); }, + // 重写 basicPageMixin 里的 处理表格按钮 方法 + handleTableBtnClick({ data, type }) { + switch (type) { + case 'edit': + this.editMode = 'edit'; + this.reset(); + const id = data.id; + getEquipment(id).then((response) => { + this.form = response.data; + this.editVisible = true; + }); + break; + case 'delete': + this.handleDelete(data); + break; + } + }, }, };