| | |
| | | import React, {Component} from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { Spin, notification, Input, Button, Table, Modal, Typography, Row, Col, Tooltip } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { QuestionCircleOutlined, LinkOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | 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)))}'` |
| | | 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') |
| | |
| | | }) |
| | | } |
| | | if (applangList.length) { |
| | | applangList.unshift('zh-CN') |
| | | applangList = JSON.stringify(applangList) |
| | | } else { |
| | | applangList = '' |
| | |
| | | }) |
| | | } |
| | | if (applangList.length) { |
| | | applangList.unshift('zh-CN') |
| | | applangList = JSON.stringify(applangList) |
| | | } else { |
| | | applangList = '' |
| | |
| | | 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)))}'` |
| | | 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') |
| | |
| | | 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)))}'` |
| | | 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') |
| | |
| | | confirmloading: false |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | 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() {} |
| | | }) |
| | | } |
| | | |
| | |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">标题:</div> |
| | | <div className="content">{item.title || '无'}</div> |
| | | <div className="label">应用名称:</div> |
| | | <div className="content">{item.app_name || ''}</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 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> |
| | |
| | | <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> |
| | |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <SubMutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> |
| | | <SubMutilForm type={subVisible} selectApp={selectApp} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> |
| | | </Modal> |
| | | </div> |
| | | ) |