| | |
| | | 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>' |
| | |
| | | } |
| | | } |
| | | |
| | | 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' |
| | |
| | | }, |
| | | { |
| | | 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 || '', |
| | |
| | | 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: '黑名单', |
| | |
| | | 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: '黑名单', |
| | |
| | | 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: '黑名单', |
| | |
| | | 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 |
| | |
| | | <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}/> |
| | |
| | | {value: 'all', label: '全部'}, |
| | | {value: 'change', label: '修改项'}, |
| | | {value: 'simple', label: '单项'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'standard', values: ['change', 'simple']}, |
| | | ] |
| | | }, |
| | | // { |
| | |
| | | }, |
| | | { |
| | | 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', |
| | |
| | | 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: '黑名单', |
| | |
| | | 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' |
| | |
| | | pageSize: 10, // 每页数据条数 |
| | | columns: null, // 显示列 |
| | | forms: [], |
| | | signForms: [], |
| | | orderfields: {}, // 排序id与field转换 |
| | | loading: false, |
| | | pageOptions: [], |
| | |
| | | let deForms = [] |
| | | let _forms = {} |
| | | let hasBid = false |
| | | let signForms = [] |
| | | |
| | | let getColumns = (cols) => { |
| | | return cols.map(item => { |
| | |
| | | } else { |
| | | if (item.editable === 'true') { |
| | | _forms[item.field] = item |
| | | |
| | | signForms.push(item.field) |
| | | |
| | | if (item.ctrlField) { |
| | | item.ctrlValue = item.ctrlValue.split(',') |
| | |
| | | |
| | | this.setState({ |
| | | forms, |
| | | signForms, |
| | | pageSize: setting.pageSize || 10, |
| | | pageOptions, |
| | | columns: _columns, |
| | |
| | | } |
| | | |
| | | 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) |
| | |
| | | |
| | | 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 |
| | |
| | | }) |
| | | |
| | | 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) |
| | | } |
| | | }) |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | handleSubmit = () => { |
| | | const { config } = this.props |
| | | |
| | | this.setState({}, () => { |
| | | this.props.form.validateFields((err, values) => { |
| | | if (err) return |
| | |
| | | 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) |
| | | } |
| | | }) |
| | | }) |
| | |
| | | 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' |
| | |
| | | |
| | | 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 |
| | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | this.props.history.replace('/login') |
| | | } else { |
| | | 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')) |