king
2021-07-30 f6a1ab6a58215cf7546976a86eb6face1a7be32f
src/views/appmanage/index.jsx
@@ -16,7 +16,7 @@
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'))
@@ -74,7 +74,9 @@
    visible: false,
    subVisible: false,
    transcolumns: [
      { title: '传输号', dataIndex: 'VersionName', key: 'VersionName', align: 'left' },
      { 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' },
@@ -303,45 +305,66 @@
  }
  submitScript = () => {
    // const { selectTran } = this.state
    const { selectTran } = this.state
    this.scriptRef.handleConfirm().then(res => {
      this.setState({
        confirmloading: true
      })
      // let param = {}
      // s_sVersionDetail_Add
      // s_sVersionDetail_CloudAdd
      // 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
      //   })
      // })
      let kei_no = res.appId.split(',')[1]
      let lang = res.subAppId.split(',')[1]
      let kei_no_detail = 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)
      }
      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
        })
      })
    })
  }
@@ -563,7 +586,7 @@
    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 = 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 || ''}'`)
    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 || ''}','${item.sms_id || ''}'`)
    param.LText = param.LText.join(' union all ')
    param.LText = Utils.formatOptions(param.LText)
    
@@ -610,6 +633,12 @@
    }
    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'})))}`))
  }
  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'})))}`))
  }
  onSelectChange = selectedRowKeys => {
@@ -764,7 +793,7 @@
      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 || ''}'`)
        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 || ''}','${item.sms_id || ''}'`)
        param.LText = param.LText.join(' union all ')
        param.LText = Utils.formatOptions(param.LText)
      }
@@ -849,7 +878,7 @@
      }
      // 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 || ''}'`)
      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 || ''}','${item.sms_id || ''}'`)
      param.LText = param.LText.join(' union all ')
      param.LText = Utils.formatOptions(param.LText)
@@ -998,8 +1027,8 @@
                      </Col>
                      <Col span={12}>
                        <div className="app-item">
                          <div className="label">登录:</div>
                          <div className="content">{item.login_types === 'false' ? '不需要' : '需要'}</div>
                          {/* <div className="label">登录:</div>
                          <div className="content">{item.login_types === 'false' ? '不需要' : '需要'}</div> */}
                        </div>
                      </Col>
                      <Col span={12}>
@@ -1028,11 +1057,12 @@
                      <Col span={12}>
                        <div className="app-item">
                          <div className="label">网站图标:</div>
                          <div className="content">{item.favicon ? <img style={{width: '30px', height: '30px'}} src={item.favicon} alt="" /> : '无'}</div>
                          <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px'}} 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>