From 8e003c1a94d26cc4d477e7aa03593ccb4d7e6c61 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 11 十月 2024 17:47:40 +0800 Subject: [PATCH] 2024-10-11 --- src/views/appmanage/index.jsx | 108 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 88 insertions(+), 20 deletions(-) diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index 21ccb4b..c352ad1 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -377,7 +377,7 @@ } deleteTran = (record) => { - const _this = this + const that = this let param = { func: 's_sVersion_del', @@ -395,7 +395,7 @@ message: '鎿嶄綔鎴愬姛锛�', duration: 3 }) - _this.getTransList() + that.getTransList() } else { notification.warning({ top: 92, @@ -414,7 +414,7 @@ } enableTran = (record) => { - const _this = this + const that = this let param = { func: 's_sVersion_sub', @@ -432,7 +432,7 @@ message: '鎿嶄綔鎴愬姛锛�', duration: 3 }) - _this.getTransList() + that.getTransList() } else { Modal.error({ title: result.message, @@ -485,6 +485,10 @@ 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 = '' @@ -597,7 +601,7 @@ } deleteApp = (record) => { - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎銆�' + record.remark + '銆嬪悧锛�', @@ -617,12 +621,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宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�' @@ -645,7 +649,7 @@ deleteSubApp = (record) => { const { selectApp } = this.state - const _this = this + const that = this let param = { func: 's_kei_addupt', @@ -672,7 +676,11 @@ }) // 瀛愬簲鐢↖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)))}'` + }) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText, 'x') @@ -688,11 +696,11 @@ duration: 5 }) - _this.setState({ + that.setState({ selectSubApp: null, loading: true }) - _this.getAppList() + that.getAppList() } else { notification.warning({ top: 92, @@ -813,7 +821,7 @@ } }) - const _this = this + const that = this confirm({ content: '纭畾瑕佹墽琛屽悧锛�', @@ -849,10 +857,10 @@ message: '鎵ц鎴愬姛銆�', duration: 3 }) - _this.setState({ + that.setState({ scriptIndex: 1 }, () => { - _this.getScriptList() + that.getScriptList() }) } resolve() @@ -948,7 +956,11 @@ 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)))}'` + }) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText, 'x') } @@ -985,6 +997,56 @@ }) }) }) + } + + 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 + } + if (item.wxMerchId) { + _par.wxMerchId = item.wxMerchId + _par.wxMerchName = item.wxMerchName || item.wxMerchId + } + + return _par } submitSubCard = () => { @@ -1041,7 +1103,11 @@ 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)))}'` + }) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText, 'x') @@ -1188,8 +1254,10 @@ </Col> <Col span={12}> <div className="app-item"> - {/* <div className="label">鐨偆:</div> - <div className="content" style={{color: color}}>{css}</div> */} + {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}> @@ -1234,7 +1302,7 @@ <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> + <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> ) @@ -1285,7 +1353,7 @@ </Modal> <Modal title={subVisible === 'plus' ? '娣诲姞瀛愬簲鐢�' : '缂栬緫瀛愬簲鐢�'} - width={'850px'} + width={'970px'} maskClosable={false} visible={subVisible !== false} onCancel={() => this.setState({subVisible: false, confirmloading: false})} -- Gitblit v1.8.0