king
2024-11-07 fa2c99a6ed8574878c1bdefae5dcb839fc4ebcf8
src/views/pcdesign/index.jsx
@@ -10,7 +10,7 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import { getTables, getFuncsAndInters, getLangTrans } from '@/utils/utils-custom.js'
import { getTables, getFuncsAndInters, getOutMessage, getLangTrans, getAllSqls } from '@/utils/utils-custom.js'
import MKEmitter from '@/utils/events.js'
import MenuUtils from '@/utils/utils-custom.js'
import asyncComponent from '@/utils/asyncComponent'
@@ -1181,6 +1181,8 @@
    } else if (this.checklog()) {
      if (sessionStorage.getItem('applangList') && !config.trans) {
      } else if (config.enabled && !config.allSqls) {
      } else {
        notification.success({
          top: 92,
@@ -1205,6 +1207,52 @@
      } else if (!config.enabled && config.force && _pass) {
        config.enabled = true
        delete config.force
      }
      let long_data = ''
      if (config.enabled) {
        let sqls = getAllSqls(config)
        let _t = moment().format('YYYYMMDDHHmmss')
        let getguid = () => {
          let uuid = ''
          for (let i = 0; i < 18; i++) {
            uuid += String.fromCharCode(Math.floor(Math.random() * 26) + 65)
          }
          uuid = uuid.replace(/minke/ig, 'MNKIE')
          return uuid
        }
        long_data = []
        // let oriIds = {}
        // if (config.allSqls) {
        //   config.allSqls.forEach(item => {
        //     if (!item.md5) return
        //     oriIds[item.uuid + item.md5] = item.v_id
        //   })
        // }
        config.allSqls = sqls.map(item => {
          let v_id = _t + getguid()
          // if (oriIds[item.uuid + item.md5]) {
          //   v_id = oriIds[item.uuid + item.md5]
          // }
          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${config.sqlperm === 'false' ? '' : item.roleId || ''}`)
          return {
            uuid: item.uuid,
            v_id: v_id,
            type: item.type,
            reps: item.reps,
            // md5: item.md5 || '',
            luser: item.luser === true
          }
        })
        long_data = long_data.join(';')
      } else {
        delete config.allSqls
      }
      if (config.cacheUseful !== 'true') {
@@ -1257,8 +1305,19 @@
      }
      let interfaces = getFuncsAndInters(config)
      let msg = getOutMessage(config)
      roleParam.interfaces = interfaces
      roleParam.msg = msg
      roleParam.backend = 'level1'
      let langSql = getLangTrans(config)
      roleParam.pds = 'false'
      if (config.interfaces) {
        config.interfaces.forEach(item => {
          if (item.status !== 'true') return
          roleParam.pds = 'true'
        })
      }
      let param = {
        func: 'sPC_TrdMenu_AddUpt',
@@ -1272,9 +1331,10 @@
        TypeCharOne: sessionStorage.getItem('kei_no'),
        Typename: 'pc',
        MenuName: config.MenuName || '',
        PageParam: JSON.stringify({Template: 'webPage', interfaces}),
        PageParam: JSON.stringify({Template: 'webPage', interfaces, msg}),
        menus_rolelist: window.btoa(window.encodeURIComponent(JSON.stringify(roleParam))),
        open_edition: config.open_edition,
        long_data: long_data,
        // LText: '',
        // LTexttb: '',
        menus_used_list,
@@ -1807,7 +1867,7 @@
                {!controlshow ? <DoubleLeftOutlined onClick={() => {sessionStorage.setItem('controlshow', 'true'); this.setState({controlshow: true})}}/> : null}
              </div>
              <div className="wrap">
                <Button type="primary" className={needUpdate ? 'update-tip' : ''} id="save-config" onClick={this.submitConfig} loading={menuloading}>保存</Button>
                <Button type="primary" className={needUpdate ? 'update-tip' : ''} disabled={!config} id="save-config" onClick={this.submitConfig} loading={menuloading}>保存</Button>
                {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null}
                <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/>
                {config ? <Debug config={config}/> : null}
@@ -1820,8 +1880,8 @@
                <PictureController/>
                <Quotecomponent config={config} updateConfig={this.updateConfig}/>
                <StyleCombControlButton menu={config} />
                <Button className="mk-border-green" disabled={MenuId === appHomeId} onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button>
                <Button className="mk-border-purple" disabled={MenuId === appLoginId} onClick={this.setLoginView}><LoginOutlined/> 设为登录页</Button>
                <Button className="mk-border-green" disabled={MenuId === appHomeId} data-title="当前菜单为应用首页" onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button>
                <Button className="mk-border-purple" disabled={MenuId === appLoginId} data-title="当前菜单为应用登录页" onClick={this.setLoginView}><LoginOutlined/> 设为登录页</Button>
                <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/>
                <Transfer MenuID={MenuId} />
                {config ? <Versions MenuId={MenuId} Template="webPage" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null}