From 86b366cac525ad676da3cfd65f67a551b9260aeb Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 28 一月 2021 18:57:03 +0800 Subject: [PATCH] 2021-01-28 --- src/views/menudesign/index.jsx | 51 +++++++++++++++++++++++++++++++++------------------ 1 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 5c9d657..2d179a4 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -34,7 +34,7 @@ const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) const PaddingController = asyncComponent(() => import('@/menu/padcontroller')) const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) -// const PictureController = asyncComponent(() => import('@/menu/picturecontroller')) +const PictureController = asyncComponent(() => import('@/menu/picturecontroller')) const StyleCombController = asyncComponent(() => import('@/menu/stylecombcontroller')) const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton')) const ModalController = asyncComponent(() => import('@/menu/modalconfig/controller')) @@ -101,8 +101,10 @@ MKEmitter.addListener('changePopview', this.initPopview) MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) MKEmitter.addListener('updateCustomComponent', this.updateCustomComponent) - this.updateCustomComponent() - // this.getAppPictures() + setTimeout(() => { + this.updateCustomComponent() + this.getAppPictures() + }, 1000) } /** @@ -120,18 +122,31 @@ MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent) } - // getAppPictures = () => { - // Api.getSystemConfig({ - // func: 's_url_db_adduptdel', - // id: '', - // PageIndex: 0, // 0 浠h〃鍏ㄩ儴 - // PageSize: 0, // 0 浠h〃鍏ㄩ儴 - // typecharone: 'image', - // type: 'search' - // }).then(res => { + getAppPictures = () => { + Api.getSystemConfig({ + func: 's_url_db_adduptdel', + PageIndex: 0, // 0 浠h〃鍏ㄩ儴 + PageSize: 0, // 0 浠h〃鍏ㄩ儴 + typecharone: 'image', + type: 'search' + }).then(res => { + if (res.status) { + sessionStorage.setItem('app_pictures', JSON.stringify(res.data || [])) + } - // }) - // } + Api.getSystemConfig({ + func: 's_url_db_adduptdel', + PageIndex: 0, // 0 浠h〃鍏ㄩ儴 + PageSize: 0, // 0 浠h〃鍏ㄩ儴 + typecharone: 'video', + type: 'search' + }).then(res => { + if (res.status) { + sessionStorage.setItem('app_videos', JSON.stringify(res.data || [])) + } + }) + }) + } updateCustomComponent = () => { Api.getSystemConfig({ @@ -166,6 +181,7 @@ }) } this.setState({customComponents: coms}) + this.getRoleFields() }) } @@ -330,7 +346,6 @@ }) this.props.modifyCustomMenu(config) - this.getRoleFields() } else { notification.warning({ top: 92, @@ -794,7 +809,7 @@ onEnabledChange = () => { const { config } = this.state - if (!config.enabled && this.verifyConfig(true)) { + if (!config || (!config.enabled && this.verifyConfig(true))) { return } @@ -928,10 +943,10 @@ <div> {config && config.MenuName} </div> } bordered={false} extra={ <div> - {/* <PictureController/> */} + <PictureController/> <StyleCombControlButton menu={config} /> <PasteController type="menu" Tab={null} insert={this.insert} /> - {config ? <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config.enabled} onChange={this.onEnabledChange} /> : null} + <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> <Button type="default" onClick={this.closeView}>{dict['mob.return']}</Button> </div> -- Gitblit v1.8.0