From 717775a33f61d867b8bdd6cac9b33211dcb5a34e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 19 二月 2021 16:35:22 +0800 Subject: [PATCH] 2021-02-19 --- src/menu/sysinterface/settingform/index.jsx | 8 src/views/design/header/index.jsx | 4 src/mob/datasource/verifycard/index.jsx | 4 src/menu/components/share/actioncomponent/index.scss | 2 src/templates/zshare/verifycard/index.jsx | 22 +- src/views/mobmanage/submutilform/index.jsx | 79 ++++---- src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx | 4 src/views/mobmanage/index.jsx | 332 +++++++++++++++++++++++++++--------- src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx | 4 src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 12 src/templates/sharecomponent/actioncomponent/index.scss | 2 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 4 src/menu/datasource/verifycard/index.jsx | 4 13 files changed, 318 insertions(+), 163 deletions(-) diff --git a/src/menu/components/share/actioncomponent/index.scss b/src/menu/components/share/actioncomponent/index.scss index 0453e00..79f0b8a 100644 --- a/src/menu/components/share/actioncomponent/index.scss +++ b/src/menu/components/share/actioncomponent/index.scss @@ -42,7 +42,7 @@ min-height: calc(100vh - 300px); overflow-y: auto; .ant-empty { - margin: 15vh 8px; + margin: 5vh 8px; } } .ant-modal-body::-webkit-scrollbar { diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx index 1febad6..07dadb0 100644 --- a/src/menu/datasource/verifycard/index.jsx +++ b/src/menu/datasource/verifycard/index.jsx @@ -403,7 +403,7 @@ let _loading = false if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && this.scriptsForm.props.form.getFieldValue('sql') !== ' ') { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true } @@ -542,7 +542,7 @@ let _loading = false if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && this.scriptsForm.props.form.getFieldValue('sql') !== ' ') { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true } diff --git a/src/menu/sysinterface/settingform/index.jsx b/src/menu/sysinterface/settingform/index.jsx index 94d9a80..1af855e 100644 --- a/src/menu/sysinterface/settingform/index.jsx +++ b/src/menu/sysinterface/settingform/index.jsx @@ -47,9 +47,9 @@ const { activeKey, setting, preScripts, cbScripts } = this.state let _loading = false - if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql')) { + if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.preScriptsForm.props.form.getFieldValue('sql'))) { _loading = true - } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql')) { + } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.cbScriptsForm.props.form.getFieldValue('sql'))) { _loading = true } @@ -83,9 +83,9 @@ const { activeKey } = this.state let _loading = false - if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql')) { + if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.preScriptsForm.props.form.getFieldValue('sql'))) { _loading = true - } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql')) { + } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.cbScriptsForm.props.form.getFieldValue('sql'))) { _loading = true } diff --git a/src/mob/datasource/verifycard/index.jsx b/src/mob/datasource/verifycard/index.jsx index d02dff0..2d619ec 100644 --- a/src/mob/datasource/verifycard/index.jsx +++ b/src/mob/datasource/verifycard/index.jsx @@ -335,7 +335,7 @@ let _loading = false if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true } @@ -385,7 +385,7 @@ let _loading = false if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true } diff --git a/src/templates/sharecomponent/actioncomponent/index.scss b/src/templates/sharecomponent/actioncomponent/index.scss index 2226cde..d5643e2 100644 --- a/src/templates/sharecomponent/actioncomponent/index.scss +++ b/src/templates/sharecomponent/actioncomponent/index.scss @@ -49,7 +49,7 @@ min-height: calc(100vh - 300px); overflow-y: auto; .ant-empty { - margin: 15vh 8px; + margin: 5vh 8px; } } .ant-modal-body::-webkit-scrollbar { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index adca1a9..d5b0024 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -673,9 +673,7 @@ if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true this.setState({activeKey: 'scripts'}) - } - - if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true this.setState({activeKey: 'scripts'}) } diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx index 38a6001..cd2600a 100644 --- a/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx @@ -176,7 +176,7 @@ let _loading = false if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true } @@ -224,7 +224,7 @@ let _loading = false if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true } diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index f6474c0..3464225 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -157,11 +157,11 @@ const { activeKey, setting, scripts, preScripts, cbScripts } = this.state let _loading = false - if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true - } else if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql')) { + } else if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.preScriptsForm.props.form.getFieldValue('sql'))) { _loading = true - } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql')) { + } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.cbScriptsForm.props.form.getFieldValue('sql'))) { _loading = true } @@ -293,11 +293,11 @@ const { activeKey, search, arr_field, setting } = this.state let _loading = false - if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true - } else if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql')) { + } else if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.preScriptsForm.props.form.getFieldValue('sql'))) { _loading = true - } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql')) { + } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.cbScriptsForm.props.form.getFieldValue('sql'))) { _loading = true } diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx index 38552f7..056813e 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx @@ -74,7 +74,7 @@ let _loading = false if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true } @@ -192,7 +192,7 @@ let _loading = false if (this.scriptsForm && this.scriptsForm.state.editItem) { _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { _loading = true } diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index ea076fe..5e51a06 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -1321,19 +1321,17 @@ return } - let _loading = false + let msg = '' if (this.customForm && this.customForm.state.editItem) { - _loading = true + msg = '鑷畾涔夐獙璇�' + } else if (this.customForm && this.customForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.customForm.props.form.getFieldValue('sql'))) { + msg = '鑷畾涔夐獙璇�' } else if (this.orderForm && this.orderForm.state.editItem) { - _loading = true + msg = '鍗曞彿鐢熸垚' } else if (this.scriptsForm && this.scriptsForm.state.editItem) { - _loading = true - } - - if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && this.scriptsForm.props.form.getFieldValue('sql') !== ' ') { - _loading = true - } else if (this.customForm && this.customForm.props.form.getFieldValue('sql') && this.customForm.props.form.getFieldValue('sql') !== ' ') { - _loading = true + msg = '鑷畾涔夎剼鏈�' + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { + msg = '鑷畾涔夎剼鏈�' } if (verify.noteEnable === 'true' && !verify.noteCode) { // 寮�鍚煭淇℃椂锛岄渶瑕佹ā鏉跨紪鐮� @@ -1342,9 +1340,9 @@ verify.noteCode = '' } - if (_loading) { + if (msg) { confirm({ - content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, + content: msg + '鏈繚瀛橈紝纭畾鎻愪氦鍚楋紵', onOk() { resolve(verify) }, diff --git a/src/views/design/header/index.jsx b/src/views/design/header/index.jsx index f3fc1f2..99584b2 100644 --- a/src/views/design/header/index.jsx +++ b/src/views/design/header/index.jsx @@ -328,9 +328,9 @@ {editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>閫�鍑�</Button> : null} {/* 杩涘叆缂栬緫鎸夐挳 */} {!editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} - {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' ? + {/* {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' ? <a href="#/mobmanage" target="_blank" className="mobile" type="edit"> 搴旂敤绠$悊 <Icon type="arrow-right" /></a> : null - } + } */} {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '棣栭〉' }))) */} {!editLevel && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? <a className="home-edit" href={`#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=`} target="_blank" rel="noopener noreferrer"> diff --git a/src/views/mobmanage/index.jsx b/src/views/mobmanage/index.jsx index f4c551e..64056b2 100644 --- a/src/views/mobmanage/index.jsx +++ b/src/views/mobmanage/index.jsx @@ -1,21 +1,26 @@ import React, {Component} from 'react' -// import { fromJS } from 'immutable' -import { Spin, notification, Button, Table, Modal } from 'antd' +import { fromJS } from 'immutable' +import { Spin, notification, Button, Table, Modal, ConfigProvider } from 'antd' import moment from 'moment' +import enUS from 'antd/es/locale/en_US' +import zhCN from 'antd/es/locale/zh_CN' import Api from '@/api' import Utils from '@/utils/utils.js' import asyncComponent from '@/utils/asyncComponent' import './index.scss' +const { confirm } = Modal + +const _locale = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const Header = asyncComponent(() => import('@/mob/header')) const MutilForm = asyncComponent(() => import('./mutilform')) +const SubMutilForm = asyncComponent(() => import('./submutilform')) class AppManage extends Component { state = { loading: false, applist: [], - appsublist: [], columns: [ { title: '搴旂敤鍚嶇О', dataIndex: 'remark', key: 'remark', align: 'center' }, { title: '搴旂敤缂栫爜', dataIndex: 'kei_no', key: 'kei_no', align: 'center' }, @@ -40,7 +45,7 @@ }, { title: '鏉冮檺绠$悊', dataIndex: 'role_type', key: 'role_type', align: 'center', - render: (text, record) => text === 'false' ? '涓嶉渶瑕�' : '闇�瑕�' + render: (text, record) => text === 'false' ? '涓嶅惎鐢�' : '鍚敤' }, { title: '鐭繛鎺�', dataIndex: 'link_type', key: 'link_type', align: 'center', @@ -87,17 +92,25 @@ Api.getCloudConfig(param).then(result => { if (result.status) { + let selectApp = null + let applist = result.data.map(item => { + item.sublist = item.data_detail || [] + item.sublist = item.sublist.map(cell => { + cell.ID = cell.d_id + return cell + }) + + if (this.state.selectApp && this.state.selectApp.ID === item.ID) { + selectApp = item + } + + return item + }) + this.setState({ loading: false, - applist: result.data.map(item => { - item.sublist = item.data_detail || [] - item.sublist = item.sublist.map(cell => { - cell.ID = cell.d_id - return cell - }) - - return item - }) + applist: applist, + selectApp }) } else { @@ -114,11 +127,107 @@ } deleteApp = (record) => { - console.log(record) + const _this = this + + confirm({ + content: '纭畾鍒犻櫎銆�' + record.remark + '銆嬪悧锛�', + onOk() { + return new Promise(resolve => { + let param = { + func: 's_kei_del', + ID: record.ID, + kei_no: record.kei_no + } + + Api.getCloudConfig(param).then(result => { + if (result.status) { + notification.success({ + top: 92, + message: '鍒犻櫎鎴愬姛锛�', + duration: 5 + }) + + _this.setState({ + selectedRowKeys: [], + selectedSubRowKeys: [], + selectApp: null, + selectSubApp: null, + loading: true + }) + _this.getAppList() + } else { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + resolve() + }, () => { + resolve() + }) + }) + }, + onCancel() {} + }) } deleteSubApp = (record) => { - console.log(record) + const { selectApp } = this.state + const _this = this + + let param = { + func: 's_kei_addupt', + ID: selectApp.ID, + exec_type: 'y', + remark: selectApp.remark, + kei_no: selectApp.kei_no, + LText: '' + } + + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + param.secretkey = Utils.encrypt('', param.timestamp) + + let sublist = fromJS(selectApp.sublist).toJS() + sublist = sublist.filter(item => item.ID !== record.ID) + + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) + param.LText = param.LText.join(' union all ') + param.LText = Utils.formatOptions(param.LText) + + confirm({ + content: '纭畾鍒犻櫎璇ュ瓙搴旂敤鍚楋紵', + onOk() { + return new Promise(resolve => { + Api.getCloudConfig(param).then(result => { + if (result.status) { + notification.success({ + top: 92, + message: '鎿嶄綔鎴愬姛锛�', + duration: 5 + }) + + _this.setState({ + selectedSubRowKeys: [], + selectSubApp: null, + loading: true + }) + _this.getAppList() + } else { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + resolve() + }, () => { + resolve() + }) + }) + }, + onCancel() {} + }) } jumpApp = (item) => { @@ -146,13 +255,14 @@ * @description 鐐瑰嚮鏁磋锛岃Е鍙戝垏鎹紝 鍒ゆ柇鏄惁鍙�夛紝鍗曢�夋垨澶氶�夛紝杩涜瀵瑰簲鎿嶄綔 */ changeRow = (record) => { - this.setState({ selectedRowKeys: [record.ID], selectApp: record, appsublist: record.sublist || [] }) + this.setState({ selectedRowKeys: [record.ID], selectApp: record }) } /** * @description 鐐瑰嚮鏁磋锛岃Е鍙戝垏鎹紝 鍒ゆ柇鏄惁鍙�夛紝鍗曢�夋垨澶氶�夛紝杩涜瀵瑰簲鎿嶄綔 */ changeSubRow = (record) => { + console.log(record) this.setState({ selectedSubRowKeys: [record.ID], selectSubApp: record }) } @@ -176,6 +286,13 @@ notification.warning({ top: 92, message: '璇烽�夋嫨闇�瑕佺紪杈戠殑瀛愬簲鐢紒', + duration: 5 + }) + return + } else if (!this.state.selectApp) { + notification.warning({ + top: 92, + message: '璇烽�夋嫨搴旂敤锛�', duration: 5 }) return @@ -207,7 +324,7 @@ param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt('', param.timestamp) - if (visible === 'edit' && selectApp.sublist && selectApp.sublist.length > 0) { + if (visible === 'edit') { param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) @@ -222,6 +339,10 @@ }) this.setState({ + selectedRowKeys: [], + selectedSubRowKeys: [], + selectApp: null, + selectSubApp: null, confirmloading: false, visible: false, loading: true @@ -246,32 +367,67 @@ } submitSubCard = () => { - const { card } = this.state + const { selectApp, subVisible, selectSubApp } = this.state this.submobcardRef.handleConfirm().then(res => { + if (subVisible === 'plus' && selectApp.sublist.filter(item => item.typename === res.typename).length > 0) { + notification.warning({ + top: 92, + message: '搴旂敤绫诲瀷宸插瓨鍦紒', + duration: 5 + }) + return + } this.setState({ confirmloading: true }) let param = { func: 's_kei_addupt', - ID: card ? card.uuid : Utils.getuuid(), - TypeName: res.type, - remark: res.name, - kei_no: res.keiNo + ID: selectApp.ID, + exec_type: 'y', + remark: selectApp.remark, + kei_no: selectApp.kei_no, + LText: '' } + + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + param.secretkey = Utils.encrypt('', param.timestamp) + + let sublist = fromJS(selectApp.sublist).toJS() + if (subVisible === 'plus') { + sublist.unshift({ + ID: Utils.getuuid(), + ...res + }) + } else { + res.ID = selectSubApp.ID + sublist = sublist.map(item => { + if (item.ID !== res.ID) { + return item + } else { + return res + } + }) + } + + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) + param.LText = param.LText.join(' union all ') + param.LText = Utils.formatOptions(param.LText) Api.getCloudConfig(param).then(result => { if (result.status) { notification.success({ top: 92, - message: card ? '淇敼鎴愬姛锛�' : '娣诲姞鎴愬姛锛�', + message: '鎿嶄綔鎴愬姛锛�', duration: 5 }) this.setState({ + selectedSubRowKeys: [], + selectSubApp: null, confirmloading: false, - visible: false, + subVisible: false, loading: true }) this.getAppList() @@ -294,74 +450,76 @@ } render () { - const { loading, visible, subVisible, columns, applist, appsublist, selectedRowKeys, selectedSubRowKeys, subcolumns, selectApp, selectSubApp } = this.state + const { loading, visible, subVisible, columns, applist, selectedRowKeys, selectedSubRowKeys, subcolumns, selectApp, selectSubApp } = this.state return ( <div className="mk-app-manage"> - <Header view="manage" /> - {loading ? - <div className="loading-mask"> - <div className="ant-spin-blur"></div> - <Spin /> - </div> : null - } - <div className="app-table"> - <div className="app-action"> - <Button className="mk-green" onClick={() => this.trigerApp('plus')}>娣诲姞</Button> - <Button className="mk-purple" onClick={() => this.trigerApp('edit')}>淇敼</Button> + <ConfigProvider locale={_locale}> + <Header view="manage" /> + {loading ? + <div className="loading-mask"> + <div className="ant-spin-blur"></div> + <Spin /> + </div> : null + } + <div className="app-table"> + <div className="app-action"> + <Button className="mk-green" onClick={() => this.trigerApp('plus')}>娣诲姞</Button> + <Button className="mk-purple" onClick={() => this.trigerApp('edit')}>淇敼</Button> + </div> + <Table + rowKey="ID" + columns={columns} + dataSource={applist} + pagination={false} + rowSelection={{ type: 'radio', selectedRowKeys, onChange: this.onSelectChange }} + onRow={(record) => ({ onClick: () => {this.changeRow(record)} })} + /> </div> - <Table - rowKey="ID" - columns={columns} - dataSource={applist} - pagination={false} - rowSelection={{ type: 'radio', selectedRowKeys, onChange: this.onSelectChange }} - onRow={(record) => ({ onClick: () => {this.changeRow(record)} })} - /> - </div> - <div className="app-table"> - <div className="sub-app-title"><span>瀛愬簲鐢�</span></div> - <div className="app-action"> - <Button className="mk-green" onClick={() => this.trigerSubApp('plus')}>娣诲姞</Button> - <Button className="mk-purple" onClick={() => this.trigerSubApp('edit')}>淇敼</Button> + <div className="app-table"> + <div className="sub-app-title"><span>瀛愬簲鐢�</span></div> + <div className="app-action"> + <Button className="mk-green" onClick={() => this.trigerSubApp('plus')}>娣诲姞</Button> + <Button className="mk-purple" onClick={() => this.trigerSubApp('edit')}>淇敼</Button> + </div> + <Table + rowKey="ID" + columns={subcolumns} + dataSource={selectApp ? selectApp.sublist : []} + pagination={false} + rowSelection={{ type: 'radio', selectedRowKeys: selectedSubRowKeys, onChange: this.onSubChange }} + onRow={(record) => ({ onClick: () => {this.changeSubRow(record)} })} + /> </div> - <Table - rowKey="ID" - columns={subcolumns} - dataSource={appsublist} - pagination={false} - rowSelection={{ type: 'radio', selectedRowKeys: selectedSubRowKeys, onChange: this.onSubChange }} - onRow={(record) => ({ onClick: () => {this.changeSubRow(record)} })} - /> - </div> - <Modal - title={'缂栬緫搴旂敤'} - width={'600px'} - maskClosable={false} - visible={!!visible} - onCancel={() => this.setState({visible: false})} - confirmLoading={this.state.confirmloading} - onOk={this.submitCard} - cancelText="鍙栨秷" - okText="纭畾" - destroyOnClose - > - <MutilForm type={visible} card={visible === 'edit' ? selectApp : ''} wrappedComponentRef={(inst) => this.mobcardRef = inst} inputSubmit={this.submitCard} /> - </Modal> - <Modal - title={'缂栬緫瀛愬簲鐢�'} - width={'600px'} - maskClosable={false} - visible={!!subVisible} - onCancel={() => this.setState({subVisible: false})} - confirmLoading={this.state.confirmloading} - onOk={this.submitSubCard} - cancelText="鍙栨秷" - okText="纭畾" - destroyOnClose - > - <MutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> - </Modal> + <Modal + title={'缂栬緫搴旂敤'} + width={'600px'} + maskClosable={false} + visible={!!visible} + onCancel={() => this.setState({visible: false})} + confirmLoading={this.state.confirmloading} + onOk={this.submitCard} + cancelText="鍙栨秷" + okText="纭畾" + destroyOnClose + > + <MutilForm type={visible} card={visible === 'edit' ? selectApp : ''} wrappedComponentRef={(inst) => this.mobcardRef = inst} inputSubmit={this.submitCard} /> + </Modal> + <Modal + title={'缂栬緫瀛愬簲鐢�'} + width={'600px'} + maskClosable={false} + visible={!!subVisible} + onCancel={() => this.setState({subVisible: false})} + confirmLoading={this.state.confirmloading} + onOk={this.submitSubCard} + cancelText="鍙栨秷" + okText="纭畾" + destroyOnClose + > + <SubMutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> + </Modal> + </ConfigProvider> </div> ) } diff --git a/src/views/mobmanage/submutilform/index.jsx b/src/views/mobmanage/submutilform/index.jsx index 4861b60..36af92e 100644 --- a/src/views/mobmanage/submutilform/index.jsx +++ b/src/views/mobmanage/submutilform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, Radio } from 'antd' +import { Form, Row, Col, Select, Radio } from 'antd' import './index.scss' class MainSearch extends Component { @@ -50,23 +50,9 @@ <Form {...formItemLayout} className="mob-card-edit-form"> <Row gutter={24}> <Col span={24}> - <Form.Item label="搴旂敤鍚�"> - {getFieldDecorator('name', { - initialValue: card ? card.name : '', - rules: [{ - required: true, - message: '璇疯緭鍏ュ簲鐢ㄥ悕!' - }, { - max: 20, - message: '搴旂敤鍚嶄笉鍙秴杩�20涓瓧绗�!' - }] - })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} - </Form.Item> - </Col> - <Col span={24}> <Form.Item label="搴旂敤绫诲瀷"> - {getFieldDecorator('type', { - initialValue: card ? card.type : 'mob', + {getFieldDecorator('typename', { + initialValue: card ? card.typename : 'mob', rules: [ { required: true, @@ -74,38 +60,53 @@ } ] })( - <Select> - <Select.Option value="mob">绉诲姩绔�</Select.Option> + <Select disabled={type === 'edit'}> + <Select.Option value="mob">绉诲姩绔�(鍖呮嫭android銆乮os)</Select.Option> <Select.Option value="pc">PC绔�</Select.Option> </Select> )} </Form.Item> </Col> <Col span={24}> - <Form.Item label="搴旂敤缂栫爜"> - {getFieldDecorator('keiNo', { - initialValue: card ? card.keiNo : '', - rules: [{ - required: true, - message: '璇疯緭鍏ュ簲鐢ㄧ紪鐮�!' - }, { - pattern: /^[a-zA-Z_]*$/ig, - message: '搴旂敤缂栫爜鍙厑璁稿寘鍚ぇ灏忓啓瀛楁瘝鍙奯!' - }, { - max: 20, - message: '搴旂敤缂栫爜涓嶅彲瓒呰繃20涓瓧绗�!' - }] - })(<Input placeholder="" disabled={type === 'edit'} autoComplete="off" onPressEnter={this.handleSubmit} />)} + <Form.Item label="璇█"> + {getFieldDecorator('lang', { + initialValue: card ? card.lang || 'zh-CN' : 'zh-CN' + })( + <Radio.Group> + <Radio value="zh-CN">涓枃</Radio> + <Radio value="en-US">鑻辨枃</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <Col span={24}> + <Form.Item label="鐧诲綍"> + {getFieldDecorator('login_types', { + initialValue: card ? card.login_types || 'true' : 'true' + })( + <Radio.Group> + <Radio value="true">闇�瑕�</Radio> + <Radio value="false">涓嶉渶瑕�</Radio> + </Radio.Group> + )} </Form.Item> </Col> <Col span={24}> <Form.Item label="鏉冮檺绠$悊"> - {getFieldDecorator('role_manage', { - initialValue: card ? card.role_manage || 'false' : 'false', - rules: [{ - required: true, - message: '璇烽�夋嫨鏄惁鍚敤鏉冮檺绠$悊!' - }] + {getFieldDecorator('role_type', { + initialValue: card ? card.role_type || 'true' : 'true' + })( + <Radio.Group> + <Radio value="true">鍚敤</Radio> + <Radio value="false">涓嶅惎鐢�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <Col span={24}> + <Form.Item label="鐭繛鎺�"> + {getFieldDecorator('link_type', { + initialValue: card ? card.link_type || 'true' : 'true' })( <Radio.Group> <Radio value="true">鍚敤</Radio> -- Gitblit v1.8.0