From 1a176e4bdba485301385caac1a29102e598d25cc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 13 五月 2025 11:32:02 +0800 Subject: [PATCH] 2025-05-13 --- src/views/appmanage/index.jsx | 624 ++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 374 insertions(+), 250 deletions(-) diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index c2d907c..da7e730 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -1,14 +1,13 @@ import React, {Component} from 'react' import { fromJS } from 'immutable' -import { Spin, notification, Input, Button, Table, Modal, ConfigProvider, Typography, Row, Col, Tooltip } from 'antd' -import { QuestionCircleOutlined } from '@ant-design/icons' +import { Spin, notification, Input, Button, Table, Modal, Typography, Row, Col, Tooltip } from 'antd' +import { QuestionCircleOutlined, LinkOutlined } 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' @@ -16,12 +15,12 @@ const { Paragraph } = Typography const { Search } = Input -const _locale = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS 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')) const skinStyle = { bg_black_style_blue: {name: '钃濊壊', color: '#1890ff'}, @@ -33,12 +32,12 @@ 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_blue_purple: {name: '钃濈传鑹�', color: '#3860f4'}, 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'} + bg_black_style_deep_blue: {name: '娣辫摑鑹�', color: '#1d3661'} } class AppManage extends Component { @@ -378,7 +377,7 @@ } deleteTran = (record) => { - const _this = this + const that = this let param = { func: 's_sVersion_del', @@ -396,7 +395,7 @@ message: '鎿嶄綔鎴愬姛锛�', duration: 3 }) - _this.getTransList() + that.getTransList() } else { notification.warning({ top: 92, @@ -415,7 +414,7 @@ } enableTran = (record) => { - const _this = this + const that = this let param = { func: 's_sVersion_sub', @@ -433,7 +432,7 @@ message: '鎿嶄綔鎴愬姛锛�', duration: 3 }) - _this.getTransList() + that.getTransList() } else { Modal.error({ title: result.message, @@ -486,13 +485,16 @@ 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 || '' + cell.wxMerchId = _param.wxMerchId || '' + cell.wxMerchName = _param.wxMerchName || '' if (cell.adapter && (cell.adapter === 'true' || cell.adapter === 'false')) { cell.adapter = '' } cell.userbind = _param.userbind || '' - cell.instantMessage = _param.instantMessage || '' } if (cell.user_binding !== 'true') { @@ -517,8 +519,7 @@ }) if (!selectApp && applist[0]) { - let _href = window.location.href.split('#')[0] + 'app_record' - let record = localStorage.getItem(_href) + let record = localStorage.getItem(window.GLOB.sysSign + 'app_record') record = record ? JSON.parse(record) : null if (record && record.dates) { @@ -537,7 +538,7 @@ }) if (reset) { - localStorage.setItem(_href, JSON.stringify(record)) + localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify(record)) } } } @@ -599,7 +600,7 @@ } deleteApp = (record) => { - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎銆�' + record.remark + '銆嬪悧锛�', @@ -619,12 +620,12 @@ duration: 5 }) - _this.setState({ + that.setState({ selectApp: null, selectSubApp: null, loading: true }) - _this.getAppList() + that.getAppList() } else { if (result.message.indexOf('kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�') > -1) { result.message = 'kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�' @@ -647,7 +648,7 @@ deleteSubApp = (record) => { const { selectApp } = this.state - const _this = this + const that = this let param = { func: 's_kei_addupt', @@ -668,13 +669,16 @@ 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 }) // 瀛愬簲鐢↖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 => `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({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', topHeight: item.topHeight || '', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) + 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)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'` + }) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText, 'x') @@ -690,11 +694,11 @@ duration: 5 }) - _this.setState({ + that.setState({ selectSubApp: null, loading: true }) - _this.getAppList() + that.getAppList() } else { notification.warning({ top: 92, @@ -715,17 +719,16 @@ jumpApp = (item) => { const { selectApp } = this.state - let _href = window.location.href.split('#')[0] + 'app_record' - let record = localStorage.getItem(_href) + let record = localStorage.getItem(window.GLOB.sysSign + 'app_record') record = record ? JSON.parse(record) : null if (!record || !record.dates) { - localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {[selectApp.ID]: new Date().getTime()}})) + 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(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {...record.dates, [selectApp.ID]: new Date().getTime()}})) + 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(_href, JSON.stringify({...record, preId: selectApp.ID})) + localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify({...record, preId: selectApp.ID})) } } @@ -733,7 +736,22 @@ if (item.typename === 'pc') { route = 'pcdesign' } - let param = {...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 = 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)))}`)) } @@ -741,7 +759,21 @@ jumpMenu = (item) => { const { selectApp } = this.state - window.open(window.location.href.replace(/#.+/ig, `#/role/${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 = 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 => { @@ -785,7 +817,7 @@ } }) - const _this = this + const that = this confirm({ content: '纭畾瑕佹墽琛屽悧锛�', @@ -821,10 +853,10 @@ message: '鎵ц鎴愬姛銆�', duration: 3 }) - _this.setState({ + that.setState({ scriptIndex: 1 }, () => { - _this.getScriptList() + that.getScriptList() }) } resolve() @@ -876,10 +908,10 @@ ID = selectApp.ID } else { let lowerKei = res.kei_no.toLowerCase() - if (lowerKei === 'mob') { + if (['mob', 'pad', 'pc', 'admin'].includes(lowerKei)) { notification.warning({ top: 92, - message: '搴旂敤缂栫爜涓嶅厑璁镐娇鐢╩ob锛�', + message: '搴旂敤缂栫爜涓嶅厑璁镐娇鐢╩ob銆乸ad銆乸c銆乤dmin锛�', duration: 3 }) return @@ -915,12 +947,15 @@ 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 => `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({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', topHeight: item.topHeight || '', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) + 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)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'` + }) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText, 'x') } @@ -957,6 +992,53 @@ }) }) }) + } + + getCusParam = (item) => { + let _par = { + sysBgColor: item.sysBgColor || '#ffffff' + } + if (item.userbind) { + _par.userbind = item.userbind + } + 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 + } + if (item.wxMerchId) { + _par.wxMerchId = item.wxMerchId + _par.wxMerchName = item.wxMerchName || item.wxMerchId + } + + return _par } submitSubCard = () => { @@ -1008,12 +1090,15 @@ 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 || ''}','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({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', topHeight: item.topHeight || '', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) + 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)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'` + }) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText, 'x') @@ -1050,226 +1135,265 @@ }) } + updateLink = (item) => { + let link = `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` + + let param = { + func: 's_miniapp_kei_linkurl_upt', + id: item.ID, + linkurl: link + } + + confirm({ + content: '纭畾鏇存柊搴旂敤閾炬帴鍦板潃鍚楋紵', + onOk() { + return new Promise(resolve => { + Api.getCloudConfig(param).then(result => { + if (result.status) { + notification.success({ + top: 92, + message: '鎿嶄綔鎴愬姛锛�', + duration: 3 + }) + } else { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + resolve() + }, () => { + resolve() + }) + }) + }, + onCancel() {} + }) + } + render () { 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"> - <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 })})} - /> + <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> - <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} - /> + <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> + <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> - {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} + <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> - <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'}}>{item.lang === 'en-US' ? '鑻辨枃' : '涓枃'}</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"> - {/* <div className="label">鐨偆:</div> - <div className="content" style={{color: color}}>{css}</div> */} - </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"> - <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}` }}></Paragraph> - </div> - </div> - ) - })} - </div> + {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 !== 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> - </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 || item.wxMerchName ? <> + <div className="label">鍏宠仈搴旂敤:</div> + <div className="content">{`${item.wxAppName}${item.wxAppName && item.wxMerchName ? ' / ' + item.wxMerchName : item.wxMerchName || ''}`}</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.app_name || ''}</div> + </div> + </Col> + <Col span={12}> + <div className="app-item"> + <div className="label">LOGO:</div> + <div className="content">{item.app_icon ? <img style={{width: '18px', height: '18px', borderRadius: '4px'}} src={item.app_icon} 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> + <Button type="link" onClick={() => this.updateLink(item)}><LinkOutlined style={{color: 'orange'}}/></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={'970px'} + 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} selectApp={selectApp} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> + </Modal> </div> ) } -- Gitblit v1.8.0