From 0e92cfdcd1a0ea82f00b32d9a8856fde9e6d2e2d Mon Sep 17 00:00:00 2001 From: zxx <47968546@163.com> Date: Fri, 30 Dec 2022 20:26:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mk/components/dialog/dialog.vue | 16 +- src/application/mk/components/dialog/index.js | 2 +- .../components/editors/MkGridDataSelector.vue | 5 +- .../mk/components/editors/MkGridSelect.vue | 4 + .../switchCompany/switchCompany.vue | 25 +-- .../mk/components/toolbar/toolbar.vue | 2 +- src/application/mk/config/index.js | 67 +++---- src/application/mk/libs/function/apis.js | 3 + src/application/mk/libs/function/form.js | 4 +- src/pages/Middle/Base/BaseCompany/edit.vue | 158 +++++++++++----- src/pages/Middle/Base/BaseCompany/list.vue | 174 ++++++++++-------- src/pages/Middle/Base/BaseConfig/edit.vue | 118 ++++++++---- src/pages/Middle/Base/BaseConfig/list.vue | 13 +- src/pages/Middle/Base/BaseService/edit.vue | 1 + 14 files changed, 382 insertions(+), 210 deletions(-) diff --git a/src/application/mk/components/dialog/dialog.vue b/src/application/mk/components/dialog/dialog.vue index ea5b282..9e8cdfe 100644 --- a/src/application/mk/components/dialog/dialog.vue +++ b/src/application/mk/components/dialog/dialog.vue @@ -44,8 +44,11 @@ export default { }, methods: { - + // 打开弹窗 open(options) { + // 解构赋值 page 页面组件 title 标题 callback 回调函数 pageMode 模式 add edit select dataId 数据id width 宽度 height 高度 pageOptions 页面参数 + // pageOptions 用于传递给页面的参数 例如:{id:1,name:'张三'} 页面通过 this.$options.pageOptions 获取 + // showFooter 是否显示底部按钮 const { page, title, callback, pageMode, dataId,width = 800,height = 600 , pageOptions = {} ,showFooter } = options || {}; this.width = width; @@ -57,21 +60,30 @@ export default { this.app = page; this.callback = callback; this.showFooter = showFooter; - + // 设置延迟显示,解决弹窗显示不全的问题 setTimeout(() => { this.visible = true; }, 10); }, + + // 处理回调 handleCallback(e) { const { callback } = this; + // 判断是否有回调函数 if (callback) { + // 执行回调 callback(e); + // 关闭弹窗 this.$destroy(); } }, + + // 关闭弹窗 modalClose() { this.$destroy(); }, + + // 确认事件 confirmEvent(){ const { callback } = this; let data = this.$refs.appPage.getConfirmData(); diff --git a/src/application/mk/components/dialog/index.js b/src/application/mk/components/dialog/index.js index 548fb12..33abda5 100644 --- a/src/application/mk/components/dialog/index.js +++ b/src/application/mk/components/dialog/index.js @@ -4,7 +4,7 @@ import promptComponent from './dialog.vue' // 加载dialog组件 export default { - + // 打开对话框 open: function (args) { // 打开对话框 const promptConstructor = Vue.extend(promptComponent); // 创建一个子类 let instance = new promptConstructor().$mount(''); // 创建一个实例 diff --git a/src/application/mk/components/editors/MkGridDataSelector.vue b/src/application/mk/components/editors/MkGridDataSelector.vue index 91d578e..4c5780c 100644 --- a/src/application/mk/components/editors/MkGridDataSelector.vue +++ b/src/application/mk/components/editors/MkGridDataSelector.vue @@ -31,7 +31,7 @@ diff --git a/src/application/mk/components/toolbar/toolbar.vue b/src/application/mk/components/toolbar/toolbar.vue index 2298fba..9940a58 100644 --- a/src/application/mk/components/toolbar/toolbar.vue +++ b/src/application/mk/components/toolbar/toolbar.vue @@ -1,5 +1,5 @@