king
2023-09-06 d2fd67a1bcec35db7870f55a83a25c043ae854f8
2023-09-06
14个文件已修改
208 ■■■■ 已修改文件
src/index.js 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/calendar/options.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/options.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/double-data-card/options.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/options.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/base-table/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/options.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/options.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemfunc/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js
@@ -110,18 +110,6 @@
      GLOB.mainSystemApi = ''
    }
    if (/#\/hs$/.test(window.location.href)) { // hs下不打印脚本
      GLOB.debugger = false
      if (GLOB.mainSystemApi) {
        GLOB.localSystemApi = GLOB.mainSystemApi
        GLOB.mainSystemApi = ''
      }
      if (GLOB.cloudServiceApi) {
        GLOB.mainSystemApi = GLOB.cloudServiceApi
      }
    }
    if (GLOB.sysType !== 'cloud') {
      if (config.appkey === options.cakey) {
        document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">不可使用云端appkey,请联系管理员!</div>'
@@ -153,6 +141,18 @@
      }
    }
    if (/#\/hs$/.test(window.location.href)) { // hs下不打印脚本
      GLOB.debugger = false
      if (GLOB.mainSystemApi) {
        GLOB.localSystemApi = GLOB.mainSystemApi
        GLOB.mainSystemApi = ''
      }
      if (GLOB.cloudServiceApi) {
        GLOB.mainSystemApi = GLOB.cloudServiceApi
      }
    }
    let _href = window.location.href.split('#')[0]
    let _systemMsg = localStorage.getItem(_href + 'system')
    let className = 'mk-blue-black'
src/menu/components/calendar/options.jsx
@@ -131,6 +131,19 @@
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType || isprint
    },
    {
      type: 'radio',
      field: 'click',
      label: '点击事件',
      initval: wrap.click || '',
src/menu/components/card/data-card/options.jsx
@@ -564,6 +564,19 @@
      forbid: ispop || isprint
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType || isprint
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/menu/components/card/double-data-card/options.jsx
@@ -240,6 +240,19 @@
      forbid: ispop || isprint
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType || isprint
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/menu/components/search/main-search/options.jsx
@@ -155,6 +155,19 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/menu/components/table/base-table/options.jsx
@@ -199,7 +199,19 @@
      initval: wrap.controlVal || '',
      tooltip: '当字段值与禁用值相等时,行数据会禁用,多个值用逗号分隔。',
      required: false
    }
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ]
    },
  ]
  return wrapForm
src/menu/components/table/edit-table/index.jsx
@@ -323,7 +323,7 @@
            <PlusOutlined className="plus" title="添加列" onClick={this.addColumns}/>
            {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="添加搜索" onClick={this.addSearch}/> : null}
            <PlusSquareOutlined className="plus" title="添加按钮" onClick={this.addButton}/>
            <NormalForm title="表格设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
            <NormalForm title="表格设置" width={900} update={this.updateWrap} getForms={this.getWrapForms}>
              <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
            </NormalForm>
            <CopyComponent type="editable" card={card}/>
src/menu/components/table/edit-table/options.jsx
@@ -111,6 +111,9 @@
        {value: 'all', label: '全部'},
        {value: 'change', label: '修改项'},
        {value: 'simple', label: '单项'},
      ],
      controlFields: [
        {field: 'standard', values: ['change', 'simple']},
      ]
    },
    // {
@@ -139,6 +142,18 @@
    },
    {
      type: 'radio',
      field: 'standard',
      label: '修改标准',
      initval: wrap.standard || 'init',
      tooltip: '如何判断行信息是否应该提交。',
      required: false,
      options: [
        {value: 'init', label: '与初始值不同'},
        {value: 'change', label: '存在编辑痕迹'},
      ]
    },
    {
      type: 'radio',
      field: 'cache',
      label: '缓存',
      initval: wrap.cache || 'true',
src/menu/components/table/normal-table/options.jsx
@@ -293,6 +293,19 @@
      forbid: ispop || isprint
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType || isprint
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -4,6 +4,7 @@
import { Table, Typography, Modal, Input, InputNumber, Button, notification, message, Select } from 'antd'
import { EditOutlined, QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import md5 from 'md5'
import Api from '@/api'
import asyncComponent from '@/utils/asyncComponent'
@@ -947,6 +948,7 @@
    pageSize: 10,         // 每页数据条数
    columns: null,        // 显示列
    forms: [],
    signForms: [],
    orderfields: {},      // 排序id与field转换
    loading: false,
    pageOptions: [],
@@ -963,6 +965,7 @@
    let deForms = []
    let _forms = {}
    let hasBid = false
    let signForms = []
    let getColumns = (cols) => {
      return cols.map(item => {
@@ -974,6 +977,8 @@
        } else {
          if (item.editable === 'true') {
            _forms[item.field] = item
            signForms.push(item.field)
            if (item.ctrlField) {
              item.ctrlValue = item.ctrlValue.split(',')
@@ -1046,6 +1051,7 @@
    this.setState({
      forms,
      signForms,
      pageSize: setting.pageSize || 10,
      pageOptions,
      columns: _columns,
@@ -1108,10 +1114,28 @@
  }
  transferData = (menuid, data, type) => {
    const { MenuID } = this.props
    const { edData } = this.state
    const { MenuID, setting } = this.props
    const { edData, signForms } = this.state
    if (menuid !== MenuID) return
    if (setting.commit !== 'all' && setting.standard !== 'change') {
      if (type !== 'line') {
        data.forEach(item => {
          let value = ''
          signForms.forEach(field => {
            value += item[field]
          })
          item.$sign = md5(value)
        })
      } else {
        let value = ''
        signForms.forEach(field => {
          value += data[field]
        })
        data.$sign = md5(value)
      }
    }
    if (type !== 'line') {
      let index = edData.findIndex(item => !item.$origin && !item.$forbid)
@@ -1461,19 +1485,31 @@
  changeRecord = (id, record) => {
    const { setting } = this.props
    const { tableId } = this.state
    const { tableId, signForms } = this.state
    if (id !== tableId) return
    let lock = record.$lock
    if (!record.$sign) {
      record.$origin = false
      record.$lock = true
      delete record.$forbid
    } else {
      let value = ''
      signForms.forEach(field => {
        value += record[field]
      })
      if (record.$sign !== md5(value)) {
        record.$origin = false
        record.$lock = true
      } else {
        record.$origin = true
        record.$lock = false
      }
    }
    let _data = this.state.edData.map(item => {
      if (item.$$uuid === record.$$uuid) {
        record.$origin = false
        record.$lock = true
        delete record.$forbid
        return record
      } else {
        return item
@@ -1481,7 +1517,7 @@
    })
    this.setState({edData: _data}, () => {
      if (setting.tableType && setting.hasAction && !lock && this.state.selectedRowKeys.includes(record.$$uuid)) {
      if (setting.tableType && setting.hasAction && this.state.selectedRowKeys.includes(record.$$uuid)) {
        this.selectdata(this.state.selectedRowKeys)
      }
    })
src/tabviews/custom/components/table/edit-table/normalTable/index.scss
@@ -254,6 +254,9 @@
    border-color: var(--mk-table-border-color)!important;
  }
  table tr {
    th .ant-table-column-title {
      position: unset!important;
    }
    th .ant-table-column-title, th .ant-table-column-title span:not(.anticon) {
      font-size: var(--mk-table-font-size)!important;
      font-weight: var(--mk-table-font-weight)!important;
src/tabviews/zshare/topSearch/index.jsx
@@ -669,6 +669,8 @@
  }
  handleSubmit = () => {
    const { config } = this.props
    this.setState({}, () => {
      this.props.form.validateFields((err, values) => {
        if (err) return
@@ -706,11 +708,20 @@
          this.sign = ''
        }, 2000)
        
        if (config.wrap && config.wrap.cacheSearch === 'true') {
          let _values = {}
          searches.forEach(item => {
            _values[item.key] = item.value
          })
          window.GLOB.SearchBox.set(config.$searchId + 'cache', _values)
        }
        if (this.props.refreshdata) {
          this.props.refreshdata(searches)
        } else {
          window.GLOB.SearchBox.set(this.props.config.$searchId, searches)
          MKEmitter.emit('searchRefresh', this.props.config.$searchId)
          window.GLOB.SearchBox.set(config.$searchId, searches)
          MKEmitter.emit('searchRefresh', config.$searchId)
        }
      })
    })
src/utils/utils.js
@@ -275,6 +275,10 @@
    let roleId = sessionStorage.getItem('role_id') || ''
    let required = false
    let keys = []
    let values = null
    if (config.wrap && config.wrap.cacheSearch === 'true') {
      values = window.GLOB.SearchBox.get(config.$searchId + 'cache')
    }
    config.search = config.search.map(item => {
      item.hidden = item.Hide === 'true'
@@ -387,6 +391,10 @@
      
      item.oriInitval = item.initval
      if (values) {
        item.initval = values[item.field] || ''
      }
      if (item.blacklist && item.blacklist.length > 0 && !item.hidden) {
        if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
          item.hidden = true
src/views/systemfunc/index.jsx
@@ -17,8 +17,10 @@
    if (!sessionStorage.getItem('UserID')) {
      this.props.history.replace('/login')
    } else {
      sessionStorage.setItem('LocalUserID', sessionStorage.getItem('UserID'))
      sessionStorage.setItem('LocalLoginUID', sessionStorage.getItem('LoginUID'))
      if (!sessionStorage.getItem('LocalUserID')) {
        sessionStorage.setItem('LocalUserID', sessionStorage.getItem('UserID'))
        sessionStorage.setItem('LocalLoginUID', sessionStorage.getItem('LoginUID'))
      }
      sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id'))
      sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM'))
      sessionStorage.setItem('User_Name', sessionStorage.getItem('CloudUserName'))