From c8804ceb1fe2dea76f9949c5ea04423876ee2c81 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 28 六月 2024 14:02:47 +0800 Subject: [PATCH] 2024-06-28 --- src/views/appmanage/index.jsx | 1230 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 975 insertions(+), 255 deletions(-) diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index 6857460..910f152 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -1,147 +1,132 @@ import React, {Component} from 'react' import { fromJS } from 'immutable' -import { Spin, notification, Button, Table, Modal, ConfigProvider, Typography } from 'antd' +import { Spin, notification, Input, Button, Table, Modal, Typography, Row, Col, Tooltip } from 'antd' +import { QuestionCircleOutlined } from '@ant-design/icons' import moment from 'moment' import md5 from 'md5' -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 { langs } from '@/store/options.js' import asyncComponent from '@/utils/asyncComponent' import './index.scss' const { confirm } = Modal const { Paragraph } = Typography +const { Search } = Input -const _locale = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS -const Header = asyncComponent(() => import('@/mob/header')) +const Header = asyncComponent(() => import('./header')) const MutilForm = asyncComponent(() => import('./mutilform')) +const TransForm = asyncComponent(() => import('./transform')) +const ScriptForm = asyncComponent(() => import('./scriptform')) const SubMutilForm = asyncComponent(() => import('./submutilform')) +const TransMenu = asyncComponent(() => import('./transmenu')) -let base_url = '' -if (process.env.NODE_ENV === 'production') { - base_url = document.location.origin + '/' + window.GLOB.service -} else { - base_url = window.GLOB.location + '/' + window.GLOB.service +const skinStyle = { + bg_black_style_blue: {name: '钃濊壊', color: '#1890ff'}, + bg_black_style_red: {name: '绾㈣壊', color: '#f5222d'}, + bg_black_style_orange_red: {name: '姗欑孩鑹�', color: '#fa541c'}, + bg_black_style_orange: {name: '姗欒壊', color: '#fa8c16'}, + bg_black_style_orange_yellow: {name: '姗欓粍鑹�', color: '#faad14'}, + bg_black_style_yellow: {name: '榛勮壊', color: '#fadb14'}, + bg_black_style_yellow_green: {name: '榛勭豢鑹�', color: '#a0d911'}, + bg_black_style_green: {name: '缁胯壊', color: '#52c41a'}, + bg_black_style_cyan: {name: '闈掕壊', color: '#13c2c2'}, + bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#2f54eb'}, + bg_black_style_purple: {name: '绱壊', color: '#722ed1'}, + bg_black_style_magenta: {name: '娲嬬孩鑹�', color: '#eb2f96'}, + bg_black_style_grass_green: {name: '鑽夌豢鑹�', color: '#aeb303'}, + bg_black_style_deep_red: {name: '娣辩孩鑹�', color: '#c32539'}, + bg_black_style_deep_blue: {name: '娣辩孩鑹�', color: '#1d3661'} } - -sessionStorage.setItem('isEditState', 'true') class AppManage extends Component { state = { loading: false, applist: [], columns: [ - { title: '搴旂敤鍚嶇О', dataIndex: 'remark', key: 'remark', align: 'center' }, - { title: '搴旂敤缂栫爜', dataIndex: 'kei_no', key: 'kei_no', align: 'center' }, + { title: '搴旂敤鍚嶇О', dataIndex: 'remark', key: 'remark', align: 'center', width: '30%' }, + { title: '搴旂敤缂栫爜', dataIndex: 'kei_no', key: 'kei_no', align: 'center', width: '30%' }, { title: '鎿嶄綔', key: 'action', align: 'center', - render: (text, record) => (<Button type="link" onClick={() => this.deleteApp(record)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button>), - }, - ], - subcolumns: [ - { - title: '搴旂敤绫诲瀷', dataIndex: 'typename', key: 'typename', align: 'center' - }, - { - title: '璇█', dataIndex: 'lang', key: 'lang', align: 'center', - render: (text, record) => text === 'en-US' ? '鑻辨枃' : '涓枃' - }, - { - title: '鐧诲綍', dataIndex: 'login_types', key: 'login_types', align: 'center', - render: (text, record) => text === 'false' ? '涓嶉渶瑕�' : '闇�瑕�' - }, - { - title: '鏉冮檺绠$悊', dataIndex: 'role_type', key: 'role_type', align: 'center', - render: (text, record) => text === 'false' ? '涓嶅惎鐢�' : '鍚敤' - }, - { - title: '鐢ㄦ埛缁戝畾', dataIndex: 'user_binding', key: 'user_binding', align: 'center', - render: (text, record) => { - let val = '' - if (!text) return '鏃�' - if (text.indexOf('uname_pwd') > -1) { - val = '鐢ㄦ埛鍚�' - } - if (text.indexOf('sms_vcode') > -1) { - val = val ? val + ',鎵嬫満鍙�' : '鎵嬫満鍙�' - } - return val - } - }, - { - title: '鐨偆', dataIndex: 'css', key: 'css', align: 'center', - render: (text, record) => { - const style = { - bg_black_style_blue: '钃濋粦鑹茬郴', - bg_white_style_blue: '钃濈櫧鑹茬郴', - bg_black_style_red: '绾㈤粦鑹茬郴', - bg_white_style_red: '绾㈢櫧鑹茬郴', - bg_black_style_orange_red: '姗欑孩榛戣壊绯�', - bg_white_style_orange_red: '姗欑孩鐧借壊绯�', - bg_black_style_orange: '姗欓粦鑹茬郴', - bg_white_style_orange: '姗欑櫧鑹茬郴', - bg_black_style_orange_yellow: '姗欓粍榛戣壊绯�', - bg_white_style_orange_yellow: '姗欓粍鐧借壊绯�', - bg_black_style_yellow: '榛勯粦鑹茬郴', - bg_white_style_yellow: '榛勭櫧鑹茬郴', - bg_black_style_yellow_green: '榛勭豢榛戣壊绯�', - bg_white_style_yellow_green: '榛勭豢鐧借壊绯�', - bg_black_style_green: '缁块粦鑹茬郴', - bg_white_style_green: '缁跨櫧鑹茬郴', - bg_black_style_cyan: '闈掗粦鑹茬郴', - bg_white_style_cyan: '闈掔櫧鑹茬郴', - bg_black_style_blue_purple: '钃濈传榛戣壊绯�', - bg_white_style_blue_purple: '钃濈传鐧借壊绯�', - bg_black_style_purple: '绱粦鑹茬郴', - bg_white_style_purple: '绱櫧鑹茬郴', - bg_black_style_magenta: '娲嬬孩榛戣壊绯�', - bg_white_style_magenta: '娲嬬孩鐧借壊绯�', - bg_black_style_grass_green: '鑽夌豢榛戣壊绯�', - bg_white_style_grass_green: '鑽夌豢鐧借壊绯�', - bg_black_style_deep_red: '娣辩孩榛戣壊绯�', - bg_white_style_deep_red: '娣辩孩鐧借壊绯�' - } - - return style[text] || '钃濋粦鑹茬郴' - } - }, - { - title: '鏍囬', dataIndex: 'title', key: 'title', align: 'center', width: '170px' - }, - { - title: '鍥炬爣', dataIndex: 'favicon', key: 'favicon', align: 'center', width: '120px', - render: (text, record) => (text ? <img style={{width: '32px', height: '32px'}} src={text} alt="" /> : null) - }, - { - title: '鎿嶄綔', - key: 'action', - align: 'center', - width: '250px', + width: '40%', render: (text, record) => ( <div> - <Button type="link" onClick={() => this.deleteSubApp(record)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button> - <Button type="link" onClick={() => this.jumpApp(record)}>缂栬緫搴旂敤</Button> - <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${base_url}${record.typename === 'pad' ? 'mob' : record.typename}/index.html#/index/${this.state.selectApp.kei_no}/${record.lang}` }}></Paragraph> + <Button type="link" onClick={() => this.setState({ selectApp: record, visible: 'edit' })} style={{color: '#8E44AD'}}>淇敼</Button> + <Button type="link" onClick={() => this.deleteApp(record)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button> + <Button type="link" onClick={() => this.setState({ selectSubApp: record, subVisible: 'plus' })} style={{color: '#26C281'}}>娣诲姞瀛愬簲鐢�</Button> </div> - ) + ), }, ], selectApp: null, selectSubApp: null, - selectedRowKeys: [], - selectedSubRowKeys: [], visible: false, - subVisible: false + subVisible: false, + transcolumns: [ + { title: '浼犺緭鍙�', dataIndex: 'VersionName', key: 'VersionName', align: 'left', render: (text, record) => ( + <Paragraph copyable={{text}}>{text}</Paragraph> + )}, + { title: '璇存槑', dataIndex: 'ProgramName', key: 'ProgramName', align: 'left' }, + { title: '鐘舵��', dataIndex: 'StatusName', key: 'StatusName', align: 'left' }, + { title: '鍒涘缓鏃堕棿', dataIndex: 'CreateDate', key: 'CreateDate', align: 'left' }, + { + title: '鎿嶄綔', + key: 'action', + align: 'center', + width: '230px', + render: (text, record) => ( + <div onClick={() => this.forbid = true}> + <Button type="link" onClick={() => this.setState({ editTran: record, transVisible: 'edit' })} style={{color: '#8E44AD'}}>淇敼</Button> + <Button type="link" onClick={() => this.deleteTran(record)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button> + <Button type="link" onClick={() => this.enableTran(record)} style={{color: '#26C281'}}>鍚敤</Button> + </div> + ), + }, + ], + transVisible: false, + translist: [], + tranSearchKey: '', + selectTran: null, + editTran: null, + transIndex: 1, + transTotal: 0, + scriptcolumns: [ + { title: '鍏抽敭瀛�', dataIndex: 'KeyWords', key: 'KeyWords', align: 'left' }, + { title: '鎻忚堪', dataIndex: 'Remark', key: 'Remark', align: 'left' }, + { title: '绫诲瀷', dataIndex: 'TypeName', key: 'TypeName', align: 'left' }, + { title: '鎺掑簭', dataIndex: 'Sort', key: 'Sort', align: 'left' }, + ], + scriptVisible: false, + scriptlist: [], + scriptSearchKey: '', + scriptIndex: 1, + scriptTotal: 0, } + forbid = false + UNSAFE_componentWillMount() { + if (sessionStorage.getItem('devError') === 'true') { + sessionStorage.clear() + window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') + window.location.reload() + return + } + + if (!sessionStorage.getItem('UserID')) { + this.props.history.replace('/login') + return + } + + window.GLOB.developing = true + document.body.className = '' this.getAppList() this.getSmStemp() + this.getTransList() } /** @@ -153,10 +138,324 @@ } } + getTransList = () => { + const { tranSearchKey, transIndex } = this.state + + let param = { + func: 's_get_sVersion', + dataM: 'Y', + PageSize: 10, + PageIndex: transIndex, + OrderCol: 'ID desc' + } + + if (tranSearchKey) { + param.VersionName = tranSearchKey + param.ProgramName = tranSearchKey + } + + this.setState({ + loading: true + }) + + Api.getCloudConfig(param).then(result => { + if (result.status) { + this.setState({ + loading: false, + translist: result.data, + selectTran: null, + scriptlist: [], + transTotal: result.total + }) + } else { + this.setState({ + loading: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + }) + } + + getScriptList = () => { + const { scriptSearchKey, scriptIndex, selectTran } = this.state + + if (!selectTran || !selectTran.ID) { + notification.warning({ + top: 92, + message: '缂哄皯浼犺緭鍙稩D!', + duration: 3 + }) + return + } + + let param = { + func: 's_get_sVersionDetail', + dataM: 'Y', + PageSize: 10, + PageIndex: scriptIndex, + OrderCol: 'Sort desc', + BID: selectTran.ID, + } + + if (scriptSearchKey) { + param.TypeName = scriptSearchKey + param.KeyWords = scriptSearchKey + param.Remark = scriptSearchKey + } + + this.setState({ + loading: true + }) + + Api.getCloudConfig(param).then(result => { + if (result.status) { + this.setState({ + loading: false, + scriptlist: result.data, + scriptTotal: result.total, + selectScriptKeys: [] + }) + } else { + this.setState({ + loading: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + }) + } + + scriptSearch = (value) => { + this.setState({scriptSearchKey: value, scriptIndex: 1}, () => { + this.getScriptList() + }) + } + + changeScriptTable = (pagination) => { + this.setState({ + scriptIndex: pagination.current + }, () => { + this.getScriptList() + }) + } + + changeTable = (pagination) => { + this.setState({ + transIndex: pagination.current + }, () => { + this.getTransList() + }) + } + + tranSearch = (value) => { + this.setState({tranSearchKey: value, transIndex: 1}, () => { + this.getTransList() + }) + } + + submitTrans = () => { + const { transVisible, editTran } = this.state + + this.transRef.handleConfirm().then(res => { + this.setState({ + confirmloading: true + }) + + let param = {} + + if (transVisible === 'plus') { + param.func = 's_sVersion_add' + param.VersionName = res.VersionName + param.ProgramName = res.ProgramName + } else { + param.func = 's_sVersion_upt' + param.ProgramName = res.ProgramName + param.ID = editTran.ID + } + + Api.getCloudConfig(param).then(result => { + if (result.status) { + notification.success({ + top: 92, + message: '鎿嶄綔鎴愬姛锛�', + duration: 3 + }) + this.setState({ + confirmloading: false, + transVisible: false + }) + this.getTransList() + } else { + this.setState({ + confirmloading: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + }, () => { + this.setState({ + confirmloading: false + }) + }) + }) + } + + submitScript = () => { + const { selectTran } = this.state + + this.scriptRef.handleConfirm().then(res => { + this.setState({ + confirmloading: true + }) + + let kei_no = res.appId.split(',')[1] + let lang = res.subAppId ? res.subAppId.split(',')[1] : '' + let kei_no_detail = res.subAppId ? res.subAppId.split(',')[2] : '' + + let param = { + func: 's_sVersionDetail_CloudAdd', + kei_no: kei_no, + kei_no_detail: kei_no_detail, + lang: lang, + BID: selectTran.ID + } + + if (res.VType === 'subapp') { + param.VType = 'mob_menu' + param.TrdMenuID = '' + param.upid = md5(window.GLOB.appkey + kei_no + kei_no_detail + lang) + } else if (res.VType === 'view') { + param.VType = 'mob_menu' + param.TrdMenuID = res.viewId + } else if (res.VType === 'role') { + param.VType = 'mob_roletree' + param.upid = md5(window.GLOB.appkey + kei_no + kei_no_detail + lang) + } else if (res.VType === 'app') { + param.VType = 'Vkei' + } + + Api.getCloudConfig(param).then(result => { + if (result.status) { + notification.success({ + top: 92, + message: '鎿嶄綔鎴愬姛锛�', + duration: 3 + }) + this.setState({ + scriptIndex: 1, + confirmloading: false, + scriptVisible: false + }, () => { + this.getScriptList() + }) + } else { + this.setState({ + confirmloading: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + }, () => { + this.setState({ + confirmloading: false + }) + }) + }) + } + + deleteTran = (record) => { + const _this = this + + let param = { + func: 's_sVersion_del', + ID: record.ID + } + + confirm({ + content: '纭畾鍒犻櫎璇ヤ紶杈撳彿鍚楋紵', + onOk() { + return new Promise(resolve => { + Api.getCloudConfig(param).then(result => { + if (result.status) { + notification.success({ + top: 92, + message: '鎿嶄綔鎴愬姛锛�', + duration: 3 + }) + _this.getTransList() + } else { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + resolve() + }, () => { + resolve() + }) + }) + }, + onCancel() {} + }) + } + + enableTran = (record) => { + const _this = this + + let param = { + func: 's_sVersion_sub', + ID: record.ID + } + + confirm({ + content: '纭畾鍚敤璇ヤ紶杈撳彿鍚楋紵', + onOk() { + return new Promise(resolve => { + Api.getCloudConfig(param).then(result => { + if (result.status) { + notification.success({ + top: 92, + message: '鎿嶄綔鎴愬姛锛�', + duration: 3 + }) + _this.getTransList() + } else { + Modal.error({ + title: result.message, + }) + } + resolve() + }, () => { + resolve() + }) + }) + }, + onCancel() {} + }) + } + getAppList = () => { let param = { func: 's_get_kei' } + + this.setState({ + loading: true + }) Api.getCloudConfig(param).then(result => { if (result.status) { @@ -165,6 +464,49 @@ item.sublist = item.data_detail || [] item.sublist = item.sublist.map(cell => { cell.ID = cell.d_id + + if (cell.customize_param) { + let _param = {} + try { + _param = JSON.parse(window.decodeURIComponent(window.atob(cell.customize_param))) + } catch (e) { + _param = {} + } + // cell.copyright = _param.copyright || '' + // cell.logo = _param.logo || '' + cell.apptype = _param.apptype || '' + cell.delay = _param.delay || 0 + cell.statusBarColor = _param.statusBarColor || 'black' + cell.sysBgColor = _param.sysBgColor || '#ffffff' + cell.direction = _param.direction || 'vertical' + cell.adapter = _param.adapter || '' + cell.topHeight = _param.topHeight || '' + cell.share = _param.share || 'false' // 鍒嗕韩 + cell.share_des = _param.share_des || '' // 鍒嗕韩鎻忚堪 + cell.share_url = _param.share_url || '' // 鍒嗕韩鍥剧墖 + cell.share_link = _param.share_link || '' // 鍒嗕韩閾炬帴 + cell.wxAppId = _param.wxAppId || '' + cell.wxAppName = _param.wxAppName || '' + + if (cell.adapter && (cell.adapter === 'true' || cell.adapter === 'false')) { + cell.adapter = '' + } + + cell.userbind = _param.userbind || '' + cell.instantMessage = _param.instantMessage || '' + } + + if (cell.user_binding !== 'true') { + cell.user_binding = 'false' + } + if (cell.share !== 'true') { + cell.share = 'false' + } + + if (!cell.adapter && cell.apptype) { + cell.adapter = 'app' + } + return cell }) @@ -174,13 +516,41 @@ return item }) - + + if (!selectApp && applist[0]) { + let record = localStorage.getItem(window.GLOB.sysSign + 'app_record') + record = record ? JSON.parse(record) : null + + if (record && record.dates) { + let ids = applist.map(item => item.ID) + let reset = false + + Object.keys(record.dates).forEach(key => { + if (!ids.includes(key)) { + delete record.dates[key] + reset = true + } + }) + + applist.sort((a, b) => { + return (record.dates[b.ID] || 0) - (record.dates[a.ID] || 0) + }) + + if (reset) { + localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify(record)) + } + } + } + + if (!selectApp && applist[0]) { + selectApp = applist[0] + } + this.setState({ loading: false, applist: applist, selectApp }) - } else { this.setState({ loading: false @@ -195,24 +565,25 @@ } getSmStemp = () => { - let _sql = `select ID,TemplateCode,SignName from (select * from bd_msn_sms_temp where deleted=0 and status=20 ) a - inner join (select openid from sapp where id='${window.GLOB.appkey}') b + let _sql = `select聽ID,TemplateCode,SignName+'_'+describe as SignName from (select * from bd_msn_sms_temp where deleted=0 and status=20 ) a + inner join (select openid from sapp where id='${window.GLOB.appkey}') b on a.openid=b.openid` - _sql = Utils.formatOptions(_sql) + _sql = Utils.formatOptions(_sql, 'x') let param = { func: 'sPC_Get_SelectedList', LText: _sql, obj_name: 'data', - arr_field: 'ID,TemplateCode,SignName' + arr_field: 'ID,TemplateCode,SignName', + exec_type: 'x' } param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) + param.secretkey = Utils.encrypt('', param.timestamp) param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉 - Api.getSystemConfig(param).then(res => { + Api.getCloudConfig(param).then(res => { let msgs = [] if (!res.status) { notification.warning({ @@ -249,14 +620,15 @@ }) _this.setState({ - selectedRowKeys: [], - selectedSubRowKeys: [], selectApp: null, selectSubApp: null, loading: true }) _this.getAppList() } else { + if (result.message.indexOf('kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�') > -1) { + result.message = 'kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�' + } notification.warning({ top: 92, message: result.message, @@ -280,22 +652,35 @@ let param = { func: 's_kei_addupt', ID: selectApp.ID, - exec_type: 'y', + exec_type: 'x', remark: selectApp.remark, kei_no: selectApp.kei_no, - LText: '' + cus_param_type: 'A' } + param.del_typename = record.typename + param.lang = record.lang 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) + sublist = sublist.map(item => { + if (item.typename !== 'pc') { + item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind') + item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage') + } + return item + }) - // 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 = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) + // 瀛愬簲鐢↖D銆乼ypename銆佸簲鐢↖D銆丆loudUserID銆乤ppkey銆乴ogin_types(鏄惁闇�瑕佺櫥褰曪紝宸插純鐢�)銆乴ink_type(鏄惁浣跨敤鐭繛鎺ワ紝宸插純鐢�)銆乺ole_type(鏄惁浣跨敤瑙掕壊绠$悊)銆乴ang銆乧ss(鐨偆)銆乼itle(鏍囬)銆乫avicon(鍥炬爣)銆乽ser_binding(鐢ㄦ埛缁戝畾)銆乻ms_id(鐭俊妯℃澘ID)銆佽嚜瀹氫箟 + param.LText = sublist.map(item => { + let _par = this.getCusParam(item) + + return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'` + }) param.LText = param.LText.join(' union all ') - param.LText = Utils.formatOptions(param.LText) + param.LText = Utils.formatOptions(param.LText, 'x') confirm({ content: '纭畾鍒犻櫎璇ュ瓙搴旂敤鍚楋紵', @@ -310,7 +695,6 @@ }) _this.setState({ - selectedSubRowKeys: [], selectSubApp: null, loading: true }) @@ -335,104 +719,226 @@ jumpApp = (item) => { const { selectApp } = this.state + let record = localStorage.getItem(window.GLOB.sysSign + 'app_record') + record = record ? JSON.parse(record) : null + + if (!record || !record.dates) { + localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {[selectApp.ID]: new Date().getTime()}})) + } else { + if (record.preId === selectApp.ID || record.activeId === selectApp.ID) { + localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {...record.dates, [selectApp.ID]: new Date().getTime()}})) + } else { + localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify({...record, preId: selectApp.ID})) + } + } + let route = 'mobdesign' if (item.typename === 'pc') { route = 'pcdesign' } - window.open(window.location.href.replace(/#.+/ig, `#/${route}/${window.btoa(window.encodeURIComponent(JSON.stringify({...item, kei_no: selectApp.kei_no, remark: selectApp.remark, type: 'app'})))}`)) + let applangList = [] + if (item.lang === 'zh-CN') { + selectApp.sublist.forEach(cell => { + if (cell.typename === item.typename && cell.lang !== 'zh-CN') { + applangList.push(cell.lang) + } + }) + } + if (applangList.length) { + applangList.unshift('zh-CN') + applangList = JSON.stringify(applangList) + } else { + applangList = '' + } + + let param = {...item, kei_no: selectApp.kei_no, remark: selectApp.remark, applangList, type: 'app'} + + window.open(window.location.href.replace(/#.+/ig, `#/${route}/${window.btoa(window.encodeURIComponent(JSON.stringify(param)))}`)) } - /** - * - */ + jumpMenu = (item) => { + const { selectApp } = this.state + + let applangList = [] + if (item.lang === 'zh-CN') { + selectApp.sublist.forEach(cell => { + if (cell.typename === item.typename && cell.lang !== 'zh-CN') { + applangList.push(cell.lang) + } + }) + } + if (applangList.length) { + applangList.unshift('zh-CN') + applangList = JSON.stringify(applangList) + } else { + applangList = '' + } + + window.open(window.location.href.replace(/#.+/ig, `#/role/${window.btoa(window.encodeURIComponent(JSON.stringify({...item, kei_no: selectApp.kei_no, remark: selectApp.remark, applangList, type: 'app'})))}`)) + } + onSelectChange = selectedRowKeys => { const { applist } = this.state let selectApp = applist.filter(item => item.ID === selectedRowKeys[0])[0] - this.setState({ selectedRowKeys, selectApp }) + this.setState({ selectApp }) } - /** - * - */ - onSubChange = selectedSubRowKeys => { - this.setState({ selectedSubRowKeys }) + onScriptChange = selectedRowKeys => { + this.setState({ selectScriptKeys: selectedRowKeys }) + } + + onScriptSelect = (record) => { + const { selectScriptKeys } = this.state + + if (selectScriptKeys.includes(record.ID)) { + this.setState({ selectScriptKeys: selectScriptKeys.filter(key => key !== record.ID) }) + } else { + this.setState({ selectScriptKeys: [...selectScriptKeys, record.ID]}) + } + } + + deleteScripts = () => { + const { selectScriptKeys, selectTran } = this.state + + if (selectScriptKeys.length === 0) { + notification.warning({ + top: 92, + message: '璇烽�夋嫨瑕佸垹闄ょ殑鑴氭湰锛�', + duration: 3 + }) + return + } + + let params = selectScriptKeys.map(key => { + return { + func: 's_sVersionDetail_del', + BID: selectTran.ID, + ID: key + } + }) + + const _this = this + + confirm({ + content: '纭畾瑕佹墽琛屽悧锛�', + onOk() { + return new Promise(resolve => { + let deffers = params.map((param, i) => { + return new Promise(resolve => { + setTimeout(() => { + Api.getCloudConfig(param).then(res => { + resolve(res) + }, () => { + resolve({status: false, message: '鍒犻櫎澶辫触锛�'}) + }) + }, i * 150) + }) + }) + Promise.all(deffers).then(result => { + let errorMsg = '' + result.forEach(res => { + if (!res.status) { + errorMsg = res.message + } + }) + if (errorMsg) { + notification.warning({ + top: 92, + message: errorMsg, + duration: 3 + }) + } else { + notification.success({ + top: 92, + message: '鎵ц鎴愬姛銆�', + duration: 3 + }) + _this.setState({ + scriptIndex: 1 + }, () => { + _this.getScriptList() + }) + } + resolve() + }) + }) + }, + onCancel() {} + }) + } + + onTransChange = selectedRowKeys => { + const { translist, selectTran } = this.state + let _selectTran = translist.filter(item => item.ID === selectedRowKeys[0])[0] + + this.setState({ selectTran: _selectTran }) + + if (!selectTran || selectTran.ID !== _selectTran.ID) { + this.setState({ scriptIndex: 1 }, () => { + this.getScriptList() + }) + } + } + + onTransSelect = (record) => { + const { selectTran } = this.state + + this.setState({ selectTran: record }) + + if (!selectTran || selectTran.ID !== record.ID) { + this.setState({ scriptIndex: 1 }, () => { + this.getScriptList() + }) + } } /** * @description 鐐瑰嚮鏁磋锛岃Е鍙戝垏鎹紝 鍒ゆ柇鏄惁鍙�夛紝鍗曢�夋垨澶氶�夛紝杩涜瀵瑰簲鎿嶄綔 */ changeRow = (record) => { - this.setState({ selectedRowKeys: [record.ID], selectApp: record }) + this.setState({ selectApp: record }) } - - /** - * @description 鐐瑰嚮鏁磋锛岃Е鍙戝垏鎹紝 鍒ゆ柇鏄惁鍙�夛紝鍗曢�夋垨澶氶�夛紝杩涜瀵瑰簲鎿嶄綔 - */ - changeSubRow = (record) => { - this.setState({ selectedSubRowKeys: [record.ID], selectSubApp: record }) - } - - trigerApp = (type) => { - if (type === 'edit' && !this.state.selectApp) { - notification.warning({ - top: 92, - message: '璇烽�夋嫨闇�瑕佺紪杈戠殑搴旂敤锛�', - duration: 5 - }) - return - } - - this.setState({ - visible: type - }) - } - - trigerSubApp = (type) => { - if (type === 'edit' && !this.state.selectSubApp) { - notification.warning({ - top: 92, - message: '璇烽�夋嫨闇�瑕佺紪杈戠殑瀛愬簲鐢紒', - duration: 5 - }) - return - } else if (!this.state.selectApp) { - notification.warning({ - top: 92, - message: '璇烽�夋嫨搴旂敤锛�', - duration: 5 - }) - return - } - - this.setState({ - subVisible: type - }) - } - submitCard = () => { - const { selectApp, visible } = this.state + const { selectApp, visible, applist } = this.state this.mobcardRef.handleConfirm().then(res => { - this.setState({ - confirmloading: true - }) - let ID = '' if (visible === 'edit') { ID = selectApp.ID } else { + let lowerKei = res.kei_no.toLowerCase() + if (['mob', 'pad', 'pc', 'admin'].includes(lowerKei)) { + notification.warning({ + top: 92, + message: '搴旂敤缂栫爜涓嶅厑璁镐娇鐢╩ob銆乸ad銆乸c銆乤dmin锛�', + duration: 3 + }) + return + } else if (applist.filter(app => app.kei_no.toLowerCase() === lowerKei).length > 0) { + notification.warning({ + top: 92, + message: '搴旂敤缂栫爜宸插瓨鍦紒', + duration: 3 + }) + return + } ID = md5(window.GLOB.appkey + res.kei_no) } + + this.setState({ + confirmloading: true + }) let param = { func: 's_kei_addupt', ID: ID, - exec_type: 'y', + exec_type: 'x', remark: res.remark, kei_no: res.kei_no, + cus_param_type: 'A', LText: '' } @@ -440,10 +946,21 @@ param.secretkey = Utils.encrypt('', param.timestamp) 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'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) - param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) + selectApp.sublist = selectApp.sublist.map(item => { + if (item.typename !== 'pc') { + item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind') + item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage') + } + return item + }) + + param.LText = selectApp.sublist.map(item => { + let _par = this.getCusParam(item) + + return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'` + }) param.LText = param.LText.join(' union all ') - param.LText = Utils.formatOptions(param.LText) + param.LText = Utils.formatOptions(param.LText, 'x') } Api.getCloudConfig(param).then(result => { @@ -455,8 +972,6 @@ }) this.setState({ - selectedRowKeys: [], - selectedSubRowKeys: [], selectApp: null, selectSubApp: null, confirmloading: false, @@ -482,6 +997,52 @@ }) } + getCusParam = (item) => { + let _par = { + sysBgColor: item.sysBgColor || '#ffffff' + } + if (item.userbind) { + _par.userbind = item.userbind + } + if (item.instantMessage) { + _par.instantMessage = item.instantMessage + } + if (item.apptype) { + _par.apptype = item.apptype + } + if (item.topHeight) { + _par.topHeight = item.topHeight + } + if (item.typename === 'pad') { + _par.direction = item.direction || 'vertical' + } + if (item.typename !== 'pc') { + _par.statusBarColor = item.statusBarColor || 'black' + _par.delay = item.delay || 0 + } + if (item.adapter) { + _par.adapter = item.adapter + } + if (item.share) { + _par.share = item.share + } + if (item.share_des) { + _par.share_des = item.share_des + } + if (item.share_url) { + _par.share_url = item.share_url + } + if (item.share_link) { + _par.share_link = item.share_link + } + if (item.wxAppId) { + _par.wxAppId = item.wxAppId + _par.wxAppName = item.wxAppName || item.wxAppId + } + + return _par + } + submitSubCard = () => { const { selectApp, subVisible, selectSubApp } = this.state @@ -501,9 +1062,10 @@ let param = { func: 's_kei_addupt', ID: selectApp.ID, - exec_type: 'y', + exec_type: 'x', remark: selectApp.remark, kei_no: selectApp.kei_no, + cus_param_type: 'A', LText: '' } @@ -527,10 +1089,21 @@ }) } - // 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'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) + sublist = sublist.map(item => { + if (item.typename !== 'pc') { + item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind') + item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage') + } + return item + }) + + param.LText = sublist.map(item => { + let _par = this.getCusParam(item) + + return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'` + }) param.LText = param.LText.join(' union all ') - param.LText = Utils.formatOptions(param.LText) + param.LText = Utils.formatOptions(param.LText, 'x') Api.getCloudConfig(param).then(result => { if (result.status) { @@ -541,7 +1114,6 @@ }) this.setState({ - selectedSubRowKeys: [], selectSubApp: null, confirmloading: false, subVisible: false, @@ -567,76 +1139,224 @@ } render () { - const { loading, visible, subVisible, columns, applist, selectedRowKeys, selectedSubRowKeys, subcolumns, selectApp, selectSubApp } = this.state + const { loading, visible, subVisible, columns, transcolumns, applist, translist, transVisible, selectApp, selectTran, selectSubApp, scriptVisible, scriptlist, scriptcolumns, selectScriptKeys } = this.state return ( <div className="mk-app-manage"> - <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> + <Header view="manage" /> + {loading ? + <div className="loading-mask"> + <Spin size="large" /> + </div> : null + } + <div className="view-wrap"> + <div className="left-view"> + <div className="app-table"> + <div className="app-action"> + <Button className="mk-green" onClick={() => this.setState({ visible: 'plus' })}>娣诲姞搴旂敤</Button> + </div> + <Table + rowKey="ID" + columns={columns} + dataSource={applist} + pagination={false} + rowSelection={{ type: 'radio', selectedRowKeys: selectApp ? [selectApp.ID] : [], onChange: this.onSelectChange }} + onRow={(record) => ({ onClick: () => this.setState({ selectApp: 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={'trans-table' + (this.state.transTotal <= 10 ? ' no-footer' : '')}> + <div className="app-action"> + <Button className="mk-green" onClick={() => this.setState({ transVisible: 'plus' })}>娣诲姞浼犺緭鍙�</Button> + <Search placeholder="缁煎悎鎼滅储" onSearch={value => this.tranSearch(value)} enterButton /> + </div> + <Table + rowKey="ID" + columns={transcolumns} + dataSource={translist} + pagination={{ + current: this.state.transIndex, + pageSize: 10, + total: this.state.transTotal || 0, + showTotal: (total, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉 + }} + rowSelection={{ type: 'radio', selectedRowKeys: selectTran ? [selectTran.ID] : [], onChange: this.onTransChange }} + onRow={(record) => ({ onClick: () => { + if (this.forbid) { + this.forbid = false + return + } + this.onTransSelect(record) + }})} + onChange={this.changeTable} + /> </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)} })} - /> + {selectTran ? <div className="script-table"> + <div className="app-action"> + <Button className="mk-green" onClick={() => this.setState({ scriptVisible: true })}>娣诲姞鑴氭湰</Button> + <Button className="mk-danger" onClick={this.deleteScripts} style={{marginLeft: '15px'}}>鍒犻櫎</Button> + <Search placeholder="缁煎悎鎼滅储" defaultValue={this.state.scriptSearchKey} onSearch={value => this.scriptSearch(value)} enterButton /> + </div> + <Table + rowKey="ID" + columns={scriptcolumns} + dataSource={scriptlist} + pagination={{ + current: this.state.scriptIndex, + pageSize: 10, + total: this.state.scriptTotal || 0, + showTotal: (total, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉 + }} + rowSelection={{ type: 'checkbox', selectedRowKeys: selectScriptKeys, onChange: this.onScriptChange }} + onRow={(record) => ({ onClick: () => this.onScriptSelect(record)})} + onChange={this.changeScriptTable} + /> + </div> : null} </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={'850px'} - 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 className="right-view"> + {selectApp ? <div className="app-title">{selectApp.remark}</div> : null} + {selectApp && selectApp.sublist.map((item, index) => { + let css = skinStyle[item.css] ? skinStyle[item.css].name : '' + let color = skinStyle[item.css] ? skinStyle[item.css].color : '#e8e8e8' + let binding = '' + if (item.user_binding === 'true') { + binding = '鐢ㄦ埛缁戝畾' + } + if (item.share === 'true') { + binding = binding ? binding + '銆佸垎浜�' : '鍒嗕韩' + } + + return ( + <div className="sub-app" key={index} style={{borderColor: color}}> + <Row> + <Col span={12}> + <div className="app-item"> + <div className="label">搴旂敤绫诲瀷:</div> + <div className="content" style={{fontSize: '18px', fontWeight: 600}}>{item.typename}</div> + </div> + </Col> + <Col span={12}> + <div className="app-item"> + <div className="label">璇█:</div> + <div className="content" style={{textDecoration: 'underline'}}>{langs[item.lang]}</div> + </div> + </Col> + <Col span={12}> + <div className="app-item"> + <div className="label">鏉冮檺绠$悊:</div> + <div className="content">{item.role_type === 'false' ? '涓嶅惎鐢�' : '鍚敤'}</div> + </div> + </Col> + <Col span={12}> + <div className="app-item"> + {item.wxAppName ? <div className="label">鍏宠仈鍏紬鍙�:</div> : null} + {item.wxAppName ? <div className="content">{item.wxAppName}</div> : null} + </div> + </Col> + <Col span={12}> + <div className="app-item"> + <div className="label">鐨偆:</div> + <div className="content" style={{color: color}}>{css}</div> + </div> + </Col> + <Col span={12}> + <div className="app-item"> + {/* {binding ? <div className="label"> + <Tooltip placement="topLeft" title="寰俊鍏紬鍙风櫥褰曟椂锛岀郴缁熺敤鎴蜂笌寰俊鐢ㄦ埛鐨勭粦瀹氭柟寮忋��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鐢ㄦ埛缁戝畾: + </Tooltip> + </div> : null} */} + {binding ? <div className="label"> + <Tooltip placement="topLeft" title="寰俊鍏紬鍙锋垨灏忕▼搴忎腑锛岀粦瀹氱郴缁熺敤鎴枫�佽嚜瀹氫箟鍒嗕韩绛夊姛鑳姐��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鎵╁睍鍔熻兘: + </Tooltip> + </div> : null} + <div className="content">{binding}</div> + </div> + </Col> + <Col span={12}> + <div className="app-item"> + <div className="label">鏍囬:</div> + <div className="content">{item.title || '鏃�'}</div> + </div> + </Col> + <Col span={12}> + <div className="app-item"> + <div className="label">缃戠珯澶村儚:</div> + <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px', borderRadius: '4px'}} src={item.favicon} alt="" /> : '鏃�'}</div> + </div> + </Col> + </Row> + <div className="action"> + {item.lang !== 'zh-CN' ? <TransMenu app={item} supApp={selectApp} /> : null} + <Button type="link" onClick={() => this.jumpMenu(item)} style={{color: 'rgba(30, 228, 224, 1)'}}>鑿滃崟&鏉冮檺</Button> + <Button type="link" onClick={() => this.setState({ selectSubApp: item, subVisible: 'edit' })} style={{color: '#8E44AD'}}>淇敼</Button> + <Button type="link" onClick={() => this.deleteSubApp(item)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button> + <Button type="link" onClick={() => this.jumpApp(item)}>缂栬緫搴旂敤</Button> + <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}${item.wxAppId ? '/' + item.wxAppId : ''}` }}></Paragraph> + </div> + </div> + ) + })} + </div> + </div> + <Modal + title={'缂栬緫搴旂敤'} + width={'600px'} + maskClosable={false} + visible={visible !== false} + onCancel={() => this.setState({visible: false, confirmloading: 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={transVisible === 'plus' ? '娣诲姞浼犺緭鍙�' : '缂栬緫浼犺緭鍙�'} + width={'600px'} + maskClosable={false} + visible={transVisible !== false} + onCancel={() => this.setState({transVisible: false, confirmloading: false})} + confirmLoading={this.state.confirmloading} + onOk={this.submitTrans} + cancelText="鍙栨秷" + okText="纭畾" + destroyOnClose + > + <TransForm type={transVisible} card={transVisible === 'edit' ? this.state.editTran : ''} wrappedComponentRef={(inst) => this.transRef = inst} inputSubmit={this.submitTrans} /> + </Modal> + <Modal + title={'娣诲姞鑴氭湰'} + width={900} + maskClosable={false} + visible={scriptVisible} + onCancel={() => this.setState({scriptVisible: false, confirmloading: false})} + confirmLoading={this.state.confirmloading} + onOk={this.submitScript} + cancelText="鍙栨秷" + okText="纭畾" + destroyOnClose + > + <ScriptForm applist={applist} wrappedComponentRef={(inst) => this.scriptRef = inst} inputSubmit={this.submitScript} /> + </Modal> + <Modal + title={subVisible === 'plus' ? '娣诲姞瀛愬簲鐢�' : '缂栬緫瀛愬簲鐢�'} + width={'850px'} + maskClosable={false} + visible={subVisible !== false} + onCancel={() => this.setState({subVisible: false, confirmloading: 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> </div> ) } -- Gitblit v1.8.0