From df627b0ad5325e6c9a836f7009a23439ce353c54 Mon Sep 17 00:00:00 2001 From: weifashi <605403358@qq.com> Date: Wed, 26 Jul 2023 18:47:48 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E7=94=A8=E6=88=B7=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=BB=84=E4=BB=B6=20-=20=20=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=94=A8=E6=88=B7ids?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/components/UserSelect.vue | 2 +- resources/assets/js/pages/manage/apps.vue | 4 +- resources/assets/js/pages/manage/test/gggg.js | 311 ------------------ 3 files changed, 4 insertions(+), 313 deletions(-) delete mode 100644 resources/assets/js/pages/manage/test/gggg.js diff --git a/resources/assets/js/components/UserSelect.vue b/resources/assets/js/components/UserSelect.vue index 42b8a4974..338952cbb 100755 --- a/resources/assets/js/components/UserSelect.vue +++ b/resources/assets/js/components/UserSelect.vue @@ -312,7 +312,7 @@ export default { } else { this.searchKey = "" } - this.$emit("on-show-change",value) + this.$emit("on-show-change",value,this.values) }, searchKey() { diff --git a/resources/assets/js/pages/manage/apps.vue b/resources/assets/js/pages/manage/apps.vue index 6395004a6..8696d0550 100644 --- a/resources/assets/js/pages/manage/apps.vue +++ b/resources/assets/js/pages/manage/apps.vue @@ -27,6 +27,7 @@ import store from '../../store/index' import {mapState} from "vuex"; import { EventCenterForMicroApp } from '@micro-zoe/micro-app' import DialogWrapper from './components/DialogWrapper' +import UserSelect from "../../components/UserSelect.vue"; import {languageList, languageType} from "../../language"; export default { @@ -80,7 +81,8 @@ export default { Vue, store, components:{ - DialogWrapper + DialogWrapper, + UserSelect } }, theme: this.themeMode, diff --git a/resources/assets/js/pages/manage/test/gggg.js b/resources/assets/js/pages/manage/test/gggg.js deleted file mode 100644 index 408f3f5d8..000000000 --- a/resources/assets/js/pages/manage/test/gggg.js +++ /dev/null @@ -1,311 +0,0 @@ -import Vue from 'vue'; -import Modal from './modal.vue'; -import Button from '../button/button.vue'; -import Locale from '../../mixins/locale'; - -const prefixCls = 'ivu-modal-confirm'; - -Modal.newInstance = properties => { - const _props = properties || {}; - - const Instance = new Vue({ - mixins: [ Locale ], - data: Object.assign({}, _props, { - visible: false, - width: 416, - title: '', - body: '', - iconType: '', - iconName: '', - okText: undefined, - cancelText: undefined, - showCancel: false, - loading: false, - buttonLoading: false, - scrollable: false, - closable: false, - closing: false, // 关闭有动画,期间使用此属性避免重复点击 - okIng: false, - enterOk: false, - }), - render (h) { - let footerVNodes = []; - if (this.showCancel) { - footerVNodes.push(h(Button, { - props: { - type: 'text' - }, - on: { - click: this.cancel - } - }, this.localeCancelText)); - } - footerVNodes.push(h(Button, { - props: { - type: 'primary', - loading: this.buttonLoading - }, - on: { - click: this.ok - } - }, this.localeOkText)); - - // render content - let body_render; - if (this.render) { - body_render = h('div', { - attrs: { - class: `${prefixCls}-body ${prefixCls}-body-render` - } - }, [this.render(h)]); - } else { - body_render = h('div', { - attrs: { - class: `${prefixCls}-body` - } - }, [ - h('div', { - domProps: { - innerHTML: this.body - } - }) - ]); - } - - // when render with no title, hide head - let head_render; - if (this.title) { - head_render = h('div', { - attrs: { - class: `${prefixCls}-head` - } - }, [ - h('div', { - class: this.iconTypeCls - }, [ - h('i', { - class: this.iconNameCls - }) - ]), - h('div', { - attrs: { - class: `${prefixCls}-head-title` - }, - domProps: { - innerHTML: this.title - } - }) - ]); - } - - return h(Modal, { - props: Object.assign({}, _props, { - width: this.width, - scrollable: this.scrollable, - closable: this.closable, - enterOk: this.enterOk - }), - domProps: { - value: this.visible - }, - on: { - input: (status) => { - this.visible = status; - }, - 'on-cancel': this.cancel - } - }, [ - h('div', { - attrs: { - class: prefixCls - } - }, [ - head_render, - body_render, - h('div', { - attrs: { - class: `${prefixCls}-footer` - } - }, footerVNodes) - ]) - ]); - }, - computed: { - iconTypeCls () { - return [ - `${prefixCls}-head-icon`, - `${prefixCls}-head-icon-${this.iconType}` - ]; - }, - iconNameCls () { - return [ - 'ivu-icon', - `ivu-icon-${this.iconName}` - ]; - }, - localeOkText () { - if (this.okText) { - return this.okText; - } else { - return this.t('i.modal.okText'); - } - }, - localeCancelText () { - if (this.cancelText) { - return this.cancelText; - } else { - return this.t('i.modal.cancelText'); - } - } - }, - methods: { - cancel () { - if (this.closing) return; - this.$children[0].visible = false; - this.buttonLoading = false; - this.onCancel(); - this.remove(); - }, - ok () { - if (this.closing) return; - if (this.loading) { - this.buttonLoading = true; - } else { - this.$children[0].visible = false; - this.remove(); - } - - this.okIng = true; - const call = this.onOk(); - if (call && call.then) { - call.then(() => { - this.$children[0].visible = false; - this.remove(); - }).catch(() => { - this.buttonLoading = false; - }).finally(_ => { - this.okIng = false; - }); - } else { - this.okIng = false; - } - }, - remove () { - this.closing = true; - setTimeout(() => { - this.closing = false; - this.destroy(); - }, 300); - }, - destroy () { - this.$destroy(); - if (this.$el) { - try { - if (this.append && typeof this.append === 'object') { - this.append.removeChild(this.$el); - } else { - document.body.removeChild(this.$el); - } - } catch (e) { - - } - } - this.onRemove(); - }, - onOk () {}, - onCancel () {}, - onRemove () {} - } - }); - - const component = Instance.$mount(); - if (_props.append && typeof _props.append === 'object') { - _props.append.appendChild(component.$el); - } else { - document.body.appendChild(component.$el); - } - const modal = Instance.$children[0]; - - return { - show (props) { - modal.$parent.showCancel = props.showCancel; - modal.$parent.iconType = props.icon; - - switch (props.icon) { - case 'info': - modal.$parent.iconName = 'ios-information-circle'; - break; - case 'success': - modal.$parent.iconName = 'ios-checkmark-circle'; - break; - case 'warning': - modal.$parent.iconName = 'ios-alert'; - break; - case 'error': - modal.$parent.iconName = 'ios-close-circle'; - break; - case 'confirm': - modal.$parent.iconName = 'ios-help-circle'; - break; - } - - if ('width' in props) { - modal.$parent.width = props.width; - } - - if ('closable' in props) { - modal.$parent.closable = props.closable; - } - - if ('title' in props) { - modal.$parent.title = props.title; - } - - if ('content' in props) { - modal.$parent.body = props.content; - } - - if ('okText' in props) { - modal.$parent.okText = props.okText; - } - - if ('cancelText' in props) { - modal.$parent.cancelText = props.cancelText; - } - - if ('onCancel' in props) { - modal.$parent.onCancel = props.onCancel; - } - - if ('onOk' in props) { - modal.$parent.onOk = props.onOk; - } - - // async for ok - if ('loading' in props) { - modal.$parent.loading = props.loading; - } - - if ('scrollable' in props) { - modal.$parent.scrollable = props.scrollable; - } - - if ('enterOk' in props) { - modal.$parent.enterOk = props.enterOk; - } - - // notice when component destroy - modal.$parent.onRemove = props.onRemove; - - modal.visible = true; - }, - remove () { - modal.visible = false; - modal.$parent.buttonLoading = false; - modal.$parent.remove(); - }, - component: modal - }; -}; - -export default Modal;