From 1957c4ca667c0681b7ce95d512c4d0654f4d6961 Mon Sep 17 00:00:00 2001 From: zmrid <514224717@qq.com> Date: Mon, 13 Feb 2023 17:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A1=8C=E9=9D=A2=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=BF=AB=E6=8D=B7=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/custom/Base_DesktopMenu.js | 112 ++ .../Base_DesktopMenuModelBody.vue | 43 + .../Base_MaterialDetailModelBody.vue | 124 +- iMES.Vue3/src/router/viewGird.js | 4 + iMES.Vue3/src/views/Home.vue | 1140 +++++++++-------- iMES.Vue3/src/views/Login.vue | 4 +- .../views/custom/custom/Base_DesktopMenu.vue | 70 + 7 files changed, 866 insertions(+), 631 deletions(-) create mode 100644 iMES.Vue3/src/extension/custom/custom/Base_DesktopMenu.js create mode 100644 iMES.Vue3/src/extension/custom/custom/custom_extend/Base_DesktopMenuModelBody.vue create mode 100644 iMES.Vue3/src/views/custom/custom/Base_DesktopMenu.vue diff --git a/iMES.Vue3/src/extension/custom/custom/Base_DesktopMenu.js b/iMES.Vue3/src/extension/custom/custom/Base_DesktopMenu.js new file mode 100644 index 0000000..59ced34 --- /dev/null +++ b/iMES.Vue3/src/extension/custom/custom/Base_DesktopMenu.js @@ -0,0 +1,112 @@ +/***************************************************************************************** +** Author:COCO 2022 +*****************************************************************************************/ +//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 +import Base_DesktopMenuModelBody from './custom_extend/Base_DesktopMenuModelBody' +let extension = { + components: { + //查询界面扩展组件 + gridHeader: '', + gridBody: '', + gridFooter: '', + //新建、编辑弹出框扩展组件 + modelHeader: '', + modelBody: Base_DesktopMenuModelBody, + modelFooter: '' + }, + tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) + buttons: { view: [], box: [], detail: [] }, //扩展的按钮 + methods: { + getFormOption(field) { + let option; + this.editFormOptions.forEach(x => { + x.forEach(item => { + if (item.field == field) { + option = item; + } + }) + }) + return option; + }, + //下面这些方法可以保留也可以删除 + onInit() { //框架初始化配置前, + //示例:在按钮的最前面添加一个按钮 + // this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组 + // name: '按钮', //按钮名称 + // icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档) + // type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button + // onClick: function () { + // this.$Message.success('点击了按钮'); + // } + // }); + + //示例:设置修改新建、编辑弹出框字段标签的长度 + // this.boxOptions.labelWidth = 150; + //显示序号(默认隐藏) + this.columnIndex = true; + this.boxOptions.height = 450; + var menuId = this.getFormOption('MenuId'); + menuId.onChange = (val, item) => { + this.http.get('api/menu/getTreeItemById?menuId=' + val, {}, true).then((result) => { + console.log("8888", result); + this.editFormFields["MenuName"] = result.MenuName; + this.editFormFields["MenuUrl"] = result.Url; + }); + }; + //选择背景颜色 + this.editFormOptions.forEach(x => { + x.forEach(item => { + if (item.field == 'Color') { + //给编辑表单设置[选择数据]操作,extra具体配置见mesform组件api + item.extra = { + icon: "el-icon-zoom-out", + text: "选择", + style: "color:blue;font-size: 14px;cursor: pointer;", + click: item => { + this.$refs.modelBody.open(); + } + } + } + }) + }) + }, + getRow(color) { + this.editFormFields["Color"] = color; + }, + onInited() { + //框架初始化配置后 + //如果要配置明细表,在此方法操作 + //this.detailOptions.columns.forEach(column=>{ }); + }, + searchBefore(param) { + //界面查询前,可以给param.wheres添加查询参数 + //返回false,则不会执行查询 + return true; + }, + searchAfter(result) { + //查询后,result返回的查询数据,可以在显示到表格前处理表格的值 + return true; + }, + addBefore(formData) { + //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值 + return true; + }, + updateBefore(formData) { + //编辑保存前formData为对象,包括明细表、删除行的Id + return true; + }, + rowClick({ row, column, event }) { + //查询界面点击行事件 + // this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行; + }, + modelOpenAfter(row) { + //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据 + //(1)判断是编辑还是新建操作: this.currentAction=='Add'; + //(2)给弹出框设置默认值 + //(3)this.editFormFields.字段='xxx'; + //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值 + //看不懂就把输出看:console.log(this.editFormOptions) + } + } +}; +export default extension; diff --git a/iMES.Vue3/src/extension/custom/custom/custom_extend/Base_DesktopMenuModelBody.vue b/iMES.Vue3/src/extension/custom/custom/custom_extend/Base_DesktopMenuModelBody.vue new file mode 100644 index 0000000..570f2b1 --- /dev/null +++ b/iMES.Vue3/src/extension/custom/custom/custom_extend/Base_DesktopMenuModelBody.vue @@ -0,0 +1,43 @@ + + \ No newline at end of file diff --git a/iMES.Vue3/src/extension/custom/custom/custom_extend/Base_MaterialDetailModelBody.vue b/iMES.Vue3/src/extension/custom/custom/custom_extend/Base_MaterialDetailModelBody.vue index 1488e93..3e0a4ba 100644 --- a/iMES.Vue3/src/extension/custom/custom/custom_extend/Base_MaterialDetailModelBody.vue +++ b/iMES.Vue3/src/extension/custom/custom/custom_extend/Base_MaterialDetailModelBody.vue @@ -1,92 +1,55 @@