Merge branch 'master' into positec
101个文件已修改
2个文件已删除
2个文件已添加
| | |
| | | "iconv-lite": "~0.4.13" |
| | | } |
| | | }, |
| | | "encryptlong": { |
| | | "version": "3.1.4", |
| | | "resolved": "https://registry.npmjs.org/encryptlong/-/encryptlong-3.1.4.tgz", |
| | | "integrity": "sha512-nx+om7MXaSBSBPBNKKPrOWMot/C0L0Ru8dy9WTyjO5k8Wo+1hsnK0d8uX1UjctkgcgEWhkKhVScniYDjXvnKgw==" |
| | | }, |
| | | "end-of-stream": { |
| | | "version": "1.4.1", |
| | | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", |
| | |
| | | } |
| | | } |
| | | }, |
| | | "jsencrypt": { |
| | | "version": "3.3.2", |
| | | "resolved": "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.3.2.tgz", |
| | | "integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A==" |
| | | }, |
| | | "jsesc": { |
| | | "version": "2.5.2", |
| | | "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", |
| | |
| | | } |
| | | } |
| | | }, |
| | | "node-rsa": { |
| | | "version": "1.1.1", |
| | | "resolved": "https://registry.npmjs.org/node-rsa/-/node-rsa-1.1.1.tgz", |
| | | "integrity": "sha512-Jd4cvbJMryN21r5HgxQOpMEqv+ooke/korixNNK3mGqfGJmy0M77WDDzo/05969+OkMy3XW1UuZsSmW9KQm7Fw==", |
| | | "requires": { |
| | | "asn1": "^0.2.4" |
| | | } |
| | | }, |
| | | "node-sass": { |
| | | "version": "4.12.0", |
| | | "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", |
| | |
| | | "dragact": "^0.2.12", |
| | | "echarts": "^5.2.1", |
| | | "echarts-for-react": "^2.0.15-beta.1", |
| | | "encryptlong": "^3.1.4", |
| | | "eslint": "^6.1.0", |
| | | "eslint-config-react-app": "^5.0.1", |
| | | "eslint-loader": "2.2.1", |
| | |
| | | "jest-watch-typeahead": "0.3.1", |
| | | "js-table2excel": "^1.0.3", |
| | | "jsbarcode": "^3.11.3", |
| | | "jsencrypt": "^3.3.2", |
| | | "jspdf": "^2.5.1", |
| | | "jssha": "^3.2.0", |
| | | "jszip": "^3.10.0", |
| | | "md5": "^2.2.1", |
| | | "mini-css-extract-plugin": "0.5.0", |
| | | "moment": "^2.24.0", |
| | | "node-rsa": "^1.1.1", |
| | | "node-sass": "^4.12.0", |
| | | "optimize-css-assets-webpack-plugin": "5.0.3", |
| | | "pnp-webpack-plugin": "1.5.0", |
| | |
| | | "display": "standalone", |
| | | "theme_color": "#000000", |
| | | "background_color": "#ffffff", |
| | | "mk_version": "20240102" |
| | | "mk_version": "20240203" |
| | | } |
| | |
| | | param.sign = md5(values) |
| | | param.t = new Date().getTime(); |
| | | |
| | | ['arr_field', 'LText_field', 'custom_script', 'LText1', 'LText', 'LText2', 'DateCount'].forEach(key => { |
| | | ['arr_field', 'custom_script', 'LText', 'DateCount'].forEach(key => { |
| | | if (param[key]) { |
| | | let val = param[key] |
| | | delete param[key] |
| | |
| | | param = this.encryptParam(param) |
| | | |
| | | axios({ |
| | | url: token.interface, |
| | | url: `${token.interface}${param.func ? '/' + param.func : ''}`, |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | }).then(res => { |
| | |
| | | param = this.encryptParam(param) |
| | | |
| | | axios({ |
| | | url: token.interface, |
| | | url: `${token.interface}${param.func ? '/' + param.func : ''}`, |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | }).then(res => { |
| | |
| | | * @description 获取业务通用接口 |
| | | * 访问 'https://sso.mk9h.cn/webapi/dostars'或云端时,传入userid、LoginUID |
| | | */ |
| | | genericInterface (param) { |
| | | genericInterface (param, script = '', position) { |
| | | param.userid = param.userid || sessionStorage.getItem('UserID') || '' |
| | | param.lang = param.lang || sessionStorage.getItem('lang') || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | |
| | | } |
| | | } |
| | | |
| | | if (param.$login) { |
| | | if (script) { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('axios', 'Api', 'param', 'position', 'systemType', script) |
| | | let promise = func(axios, this, param, position, window.GLOB.systemType) |
| | | |
| | | if (promise instanceof Promise) { |
| | | return promise |
| | | } |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | |
| | | return Promise.resolve({ |
| | | status: false, |
| | | message: '自定义脚本执行错误', |
| | | ErrCode: 'E' |
| | | }) |
| | | } else if (param.$login) { |
| | | let rduri = param.rduri || '' |
| | | |
| | | delete param.$login |
| | |
| | | import BraftEditor from 'braft-editor' |
| | | import 'braft-editor/dist/index.css' |
| | | import 'braft-extensions/dist/table.css' |
| | | // import 'braft-editor/dist/output.css' |
| | | import Table from 'braft-extensions/dist/table' |
| | | import SparkMD5 from 'spark-md5' |
| | | import moment from 'moment' |
| | |
| | | searchkey: '', |
| | | thdMenuList: [], |
| | | debug: sessionStorage.getItem('debug') === 'true' && window.GLOB.memberLevel > 0, |
| | | collapse: sessionStorage.getItem('collapse') === 'true' |
| | | collapse: sessionStorage.getItem('collapse') === 'true', |
| | | lang: sessionStorage.getItem('lang') || '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | </Dropdown> |
| | | {/* 编辑状态登录 */} |
| | | <Modal |
| | | title="登录开发机" |
| | | title={<span>登录开发机{this.state.lang === 'en-US' ? <span style={{color: 'red'}}>(英文)</span> : ''}</span>} |
| | | visible={this.state.loginVisible} |
| | | onOk={this.loginSubmit} |
| | | width={'430px'} |
| | |
| | | class MkPicture extends Component { |
| | | static propTpyes = { |
| | | style: PropTypes.object, |
| | | lostTip: PropTypes.bool, |
| | | scale: PropTypes.bool, |
| | | url: PropTypes.string, |
| | | urls: PropTypes.array, |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { url } = this.props |
| | | const { url, lostTip } = this.props |
| | | |
| | | if (url) { |
| | | this.setState({url: url, lost: false}) |
| | | this.checkUrl(url) |
| | | } else { |
| | | this.setState({url: LostPng, lost: true}) |
| | | this.setState({url: lostTip ? LostPng: '', lost: true}) |
| | | } |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { lostTip } = this.props |
| | | |
| | | if (nextProps.url) { |
| | | if (nextProps.url !== this.state.url) { |
| | | this.setState({url: nextProps.url, lost: false}) |
| | | this.checkUrl(nextProps.url) |
| | | } |
| | | } else { |
| | | this.setState({url: LostPng, lost: true}) |
| | | this.setState({url: lostTip ? LostPng: '', lost: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { style, scale, urls } = this.props |
| | | const { style, scale, urls, lostTip } = this.props |
| | | const { url, lost } = this.state |
| | | |
| | | if (!lostTip && !url) { |
| | | return ( |
| | | <div className="ant-mk-picture empty" style={style}></div> |
| | | ) |
| | | } |
| | | |
| | | return ( |
| | | <div |
| | | className={'ant-mk-picture' + (scale ? ' scale' : '') + (lost ? ' lost' : '')} |
| | |
| | | .ant-mk-picture.lost { |
| | | background-size: contain!important; |
| | | } |
| | | .ant-mk-picture.empty { |
| | | background: transparent!important; |
| | | } |
| | | .ant-mk-picture.scale { |
| | | cursor: zoom-in; |
| | | } |
| | |
| | | columns.forEach(col => { |
| | | if (col.unique !== true || !unique) return |
| | | |
| | | let _index = newData.findIndex(item => record.uuid !== item.uuid && record[col.dataIndex] === item[col.dataIndex]) |
| | | let _index = newData.findIndex(item => { |
| | | if (record.uuid === item.uuid) return false |
| | | |
| | | if (col.inputType === 'cascader') { |
| | | if (!Array.isArray(record[col.dataIndex]) || !Array.isArray(item[col.dataIndex])) { |
| | | return false |
| | | } |
| | | return record[col.dataIndex].toString() === item[col.dataIndex].toString() |
| | | } |
| | | |
| | | return record[col.dataIndex] === item[col.dataIndex] |
| | | }) |
| | | |
| | | if (_index > -1) { |
| | | notification.warning({ |
| | |
| | | if (!config) return |
| | | |
| | | if (config.defaultApp) { |
| | | if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { |
| | | if (/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(navigator.userAgent)) { |
| | | window.location.replace(window.location.href.split(/(index.html)+/ig)[0].replace('admin/', '') + 'mob/index.html#/index') |
| | | return |
| | | } |
| | |
| | | } else { |
| | | _options.push('value') |
| | | } |
| | | if (this.record.eleType === 'video' && this.record.posterType) { |
| | | |
| | | if (this.record.eleType === 'picture' && this.record.noValue === 'show') { |
| | | _options.push('lostTip') |
| | | } else if (this.record.eleType === 'video' && this.record.posterType) { |
| | | if (this.record.posterType === 'dynamic') { |
| | | _options.push('posterField') |
| | | } else { |
| | |
| | | return item |
| | | }) |
| | | }) |
| | | } else if (['datatype', 'showInfo', 'showType', 'fixStyle', 'posterType', 'eval', 'linkType', 'tipType'].includes(key)) { |
| | | } else if (['datatype', 'showInfo', 'showType', 'fixStyle', 'posterType', 'eval', 'linkType', 'tipType', 'noValue'].includes(key)) { |
| | | let _options = this.getOptions() |
| | | |
| | | this.setState({ |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'lostTip', |
| | | label: '图片缺失', |
| | | initVal: card.lostTip || 'true', |
| | | tooltip: '图片地址不存在时,是否提示图片丢失。', |
| | | required: false, |
| | | options: [ |
| | | { value: 'true', text: '提示' }, |
| | | { value: 'false', text: '不提示' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'alignItems', |
| | | label: '垂直对齐', |
| | | initVal: card.alignItems || '', |
| | |
| | | } else if (_card.eleType === 'picture') { |
| | | _card.style = style |
| | | delete _card.style.backgroundImage |
| | | delete _card.style.paddingTop |
| | | delete _card.style.paddingBottom |
| | | delete _card.style.paddingLeft |
| | | delete _card.style.paddingRight |
| | | } else { |
| | | _card.style = style |
| | | } |
| | |
| | | res.innerHeight = res.barHeight + (res.displayValue === 'true' ? fontSize + 2 : 0) |
| | | } else if (res.eleType === 'picture') { |
| | | delete res.style.backgroundImage |
| | | delete res.style.paddingTop |
| | | delete res.style.paddingBottom |
| | | delete res.style.paddingLeft |
| | | delete res.style.paddingRight |
| | | } |
| | | |
| | | return res |
| | |
| | | ], |
| | | controlFields: [ |
| | | {field: 'slidetip', values: ['slide']}, |
| | | {field: 'maxPageSize', values: ['page']}, |
| | | ], |
| | | forbid: subtype === 'propcard' |
| | | }, |
| | |
| | | forbid: !!appType || subtype !== 'datacard' || isprint |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxPageSize', |
| | | label: '每页最大数', |
| | | initval: wrap.maxPageSize || '', |
| | | min: 10, |
| | | max: 500, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: !laypage || appType === 'mob' || subtype !== 'datacard' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | ], |
| | | controlFields: [ |
| | | {field: 'slidetip', values: ['slide']}, |
| | | {field: 'maxPageSize', values: ['page']}, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxPageSize', |
| | | label: '每页最大数', |
| | | initval: wrap.maxPageSize || '', |
| | | min: 10, |
| | | max: 500, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: !laypage || appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | value: 'false', |
| | | label: '隐藏' |
| | | }] |
| | | // }, { |
| | | // type: 'radio', |
| | | // field: 'transpose', |
| | | // label: '变换', |
| | | // initval: card.transpose || 'false', |
| | | // tooltip: '横纵坐标轴交换', |
| | | // forbid: card.chartType === 'line', |
| | | // required: false, |
| | | // options: [{ |
| | | // value: 'true', |
| | | // label: '是' |
| | | // }, { |
| | | // value: 'false', |
| | | // label: '否' |
| | | // }] |
| | | }, { |
| | | type: 'radio', |
| | | field: 'show', |
| | | label: '显示', |
| | | initval: card.show || 'value', |
| | | // tooltip: '当使用自定义设置时,可在显示(值/%)处单独设置显示类型。注:自定义为空时使用此处设置。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'value', |
| | |
| | | controlFields: [ |
| | | {field: 'labelColor', values: ['true']} |
| | | ] |
| | | // }, { |
| | | // type: 'radio', |
| | | // field: 'labelColor', |
| | | // label: '标注颜色', |
| | | // initval: card.labelColor || 'system', |
| | | // tooltip: '使用系统色时,使用色系选项设置的系统颜色,使用自定义为颜色设置中定义的图形颜色。', |
| | | // required: false, |
| | | // options: [{ |
| | | // value: 'system', |
| | | // label: '系统' |
| | | // }, { |
| | | // value: 'custom', |
| | | // label: '自定义' |
| | | // }] |
| | | // }, { |
| | | // type: 'radio', |
| | | // field: 'labelValue', |
| | | // label: '标注值', |
| | | // initval: card.labelValue || 'default', |
| | | // tooltip: '标注值的显示规则。', |
| | | // required: false, |
| | | // options: [{ |
| | | // value: 'default', |
| | | // label: '默认' |
| | | // }, { |
| | | // value: 'zero', |
| | | // label: '隐藏 0 值' |
| | | // }], |
| | | }, { |
| | | type: 'radio', |
| | | field: 'adjust', |
| | |
| | | value: 'false', |
| | | label: '不显示' |
| | | }] |
| | | // }, { |
| | | // type: 'radio', |
| | | // field: 'coordinate', |
| | | // label: '坐标', |
| | | // initval: card.coordinate || 'angle', |
| | | // required: false, |
| | | // forbid: card.chartType === 'line', |
| | | // options: [{ |
| | | // value: 'angle', |
| | | // label: '二维坐标' |
| | | // }, { |
| | | // value: 'polar', |
| | | // label: '极坐标' |
| | | // }] |
| | | }, { |
| | | type: 'checkbox', |
| | | field: 'axis', |
| | |
| | | controlFields: [ |
| | | {field: 'color', notNull: true}, |
| | | ] |
| | | // }, { |
| | | // type: 'radio', |
| | | // field: 'grid', |
| | | // label: '网格线', |
| | | // initval: card.grid || 'show', |
| | | // required: false, |
| | | // options: [{ |
| | | // value: 'show', |
| | | // label: '显示' |
| | | // }, { |
| | | // value: 'hidden', |
| | | // label: '隐藏' |
| | | // }] |
| | | // }, { |
| | | // type: 'radio', |
| | | // field: 'y_line', |
| | | // label: 'y轴边线', |
| | | // initval: card.y_line || 'hidden', |
| | | // tooltip: '图形左侧或右侧的边线。', |
| | | // required: false, |
| | | // options: [{ |
| | | // value: 'show', |
| | | // label: '显示' |
| | | // }, { |
| | | // value: 'hidden', |
| | | // label: '隐藏' |
| | | // }] |
| | | // }, { |
| | | // type: 'radio', |
| | | // field: 'download', |
| | | // label: '导出图片', |
| | | // initval: card.download || 'forbid', |
| | | // required: false, |
| | | // forbid: appType === 'mob', |
| | | // options: [{ |
| | | // value: 'forbid', |
| | | // label: '禁用' |
| | | // }, { |
| | | // value: 'enable', |
| | | // label: '启用' |
| | | // }] |
| | | }, { |
| | | type: 'radio', |
| | | field: 'empty', |
| | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | | key: 'title', |
| | | field: 'title', |
| | | label: '标题', |
| | | initVal: card.title, |
| | | initval: card.title, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'name', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initVal: card.name, |
| | | initval: card.name, |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initVal: card.width, |
| | | initval: card.width, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | key: 'height', |
| | | field: 'height', |
| | | label: '图表高度', |
| | | initVal: card.height, |
| | | initval: card.height, |
| | | tooltip: '图表绘图区域的高度,不包括标题及内外边距。', |
| | | required: true, |
| | | options: ['px', 'vh', 'vw'] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'permission', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initVal: card.permission || 'false', |
| | | initval: card.permission || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'cacheLocal', |
| | | field: 'cacheLocal', |
| | | label: '本地缓存', |
| | | initVal: card.cacheLocal || 'true', |
| | | initval: card.cacheLocal || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', text: '继承菜单'}, |
| | | {value: 'false', text: '禁用'}, |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'blacklist', |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | multi: true, |
| | | initval: card.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType || isprint |
| | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | field: 'label', |
| | | label: '指标名称', |
| | | initVal: card.label || '', |
| | | initval: card.label || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'valueField', |
| | | field: 'valueField', |
| | | label: '显示值', |
| | | initVal: card.valueField || '', |
| | | initval: card.valueField || '', |
| | | required: true, |
| | | options: yfields |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxValue', |
| | | field: 'maxValue', |
| | | label: '最大值', |
| | | initVal: card.maxValue || 100, |
| | | initval: card.maxValue || 100, |
| | | tooltip: '仪表盘最大刻度值', |
| | | min: 0, |
| | | max: 999999, |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'tickInterval', |
| | | field: 'tickInterval', |
| | | label: '间隔', |
| | | initVal: card.tickInterval || 10, |
| | | initval: card.tickInterval || 10, |
| | | tooltip: '仪表盘刻度间隔值。', |
| | | min: 0, |
| | | max: 999999, |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'percent', |
| | | field: 'percent', |
| | | label: '百分率', |
| | | initVal: card.percent || 'true', |
| | | initval: card.percent || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '使用' |
| | | label: '使用' |
| | | }, { |
| | | value: 'false', |
| | | text: '不使用' |
| | | label: '不使用' |
| | | }] |
| | | // }, { |
| | | // type: 'radio', |
| | | // key: 'download', |
| | | // field: 'download', |
| | | // label: '导出图片', |
| | | // initVal: card.download || 'forbid', |
| | | // initval: card.download || 'forbid', |
| | | // required: false, |
| | | // forbid: appType === 'mob', |
| | | // options: [{ |
| | | // value: 'forbid', |
| | | // text: '禁用' |
| | | // label: '禁用' |
| | | // }, { |
| | | // value: 'enable', |
| | | // text: '启用' |
| | | // label: '启用' |
| | | // }] |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // key: 'empty', |
| | | // field: 'empty', |
| | | // label: '空值隐藏', |
| | | // initVal: card.empty || 'show', |
| | | // initval: card.empty || 'show', |
| | | // tooltip: '当查询数据为空时,隐藏该组件。', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'show', text: '否'}, |
| | | // {value: 'hidden', text: '是'}, |
| | | // {value: 'show', label: '否'}, |
| | | // {value: 'hidden', label: '是'}, |
| | | // ], |
| | | // }, |
| | | { |
| | | type: 'color', |
| | | key: 'tickColor', |
| | | field: 'tickColor', |
| | | label: '刻度线', |
| | | initVal: card.tickColor || '#CBCBCB', |
| | | initval: card.tickColor || '', |
| | | allowClear: true, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'labelColor', |
| | | field: 'labelColor', |
| | | label: '指标颜色', |
| | | initVal: card.labelColor || '#545454', |
| | | initval: card.labelColor || '', |
| | | allowClear: true, |
| | | required: false |
| | | } |
| | | ] |
| | |
| | | return [ |
| | | { |
| | | type: 'select', |
| | | key: 'labelField', |
| | | field: 'labelField', |
| | | label: '指标', |
| | | initVal: card.labelField || '', |
| | | initval: card.labelField || '', |
| | | required: true, |
| | | options: xfields |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'valueField', |
| | | field: 'valueField', |
| | | label: '值', |
| | | initVal: card.valueField || '', |
| | | initval: card.valueField || '', |
| | | required: true, |
| | | options: yfields |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxValue', |
| | | field: 'maxValue', |
| | | label: '最大值', |
| | | initVal: card.maxValue || 100, |
| | | initval: card.maxValue || 100, |
| | | min: 0, |
| | | max: 999999, |
| | | decimal: 1, |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'radius', |
| | | field: 'radius', |
| | | label: '外环', |
| | | initVal: card.radius || 75, |
| | | initval: card.radius || 75, |
| | | tooltip: '图形所占区域的百分率。', |
| | | min: 30, |
| | | max: 100, |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fontSize', |
| | | field: 'fontSize', |
| | | label: '字体大小', |
| | | initVal: card.fontSize || 28, |
| | | initval: card.fontSize || 28, |
| | | min: 12, |
| | | max: 300, |
| | | decimal: 0, |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'percent', |
| | | field: 'percent', |
| | | label: '百分率', |
| | | initVal: card.percent || 'true', |
| | | initval: card.percent || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '使用' |
| | | label: '使用' |
| | | }, { |
| | | value: 'false', |
| | | text: '不使用' |
| | | label: '不使用' |
| | | }] |
| | | // }, { |
| | | // type: 'radio', |
| | | // key: 'download', |
| | | // field: 'download', |
| | | // label: '导出图片', |
| | | // initVal: card.download || 'forbid', |
| | | // initval: card.download || 'forbid', |
| | | // required: false, |
| | | // forbid: appType === 'mob', |
| | | // options: [{ |
| | | // value: 'forbid', |
| | | // text: '禁用' |
| | | // label: '禁用' |
| | | // }, { |
| | | // value: 'enable', |
| | | // text: '启用' |
| | | // label: '启用' |
| | | // }] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'backColor', |
| | | field: 'backColor', |
| | | label: '背景色', |
| | | initVal: card.backColor || '#ebedf0', |
| | | initval: card.backColor || '', |
| | | allowClear: true, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'labelColor', |
| | | field: 'labelColor', |
| | | label: '字体颜色', |
| | | initVal: card.labelColor || '#8c8c8c', |
| | | initval: card.labelColor || '', |
| | | allowClear: true, |
| | | required: false |
| | | } |
| | | ] |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Modal, Form, Row, Col, Select, Radio, Tooltip, Input, InputNumber, notification, Tabs, Button } from 'antd' |
| | | import { QuestionCircleOutlined, EditOutlined } from '@ant-design/icons' |
| | | import { Modal, Form, notification, Tabs, Button } from 'antd' |
| | | import { EditOutlined } from '@ant-design/icons' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import { getBaseForm, getOptionForm, getRadioOptionForm } from './formconfig' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import ColorSketch from '@/mob/colorsketch' |
| | | import './index.scss' |
| | | |
| | | const { TabPane } = Tabs |
| | | |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) |
| | | const NormalForm = asyncComponent(() => import('@/menu/components/share/normalform')) |
| | | const ModalForm = asyncComponent(() => import('@/components/normalform/modalform')) |
| | | |
| | | class LineChartDrawerForm extends Component { |
| | | static propTpyes = { |
| | |
| | | }) |
| | | } |
| | | |
| | | getFields() { |
| | | const { formlist } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | const fields = [] |
| | | |
| | | if (!formlist) { |
| | | return fields |
| | | } |
| | | |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | if (item.type === 'text') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.onSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={item.min} max={item.max} precision={item.decimal} onPressEnter={this.onSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'select') { // 下拉 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请选择' + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select mode={item.multi ? 'multiple' : ''}> |
| | | {item.options.map((option, index) => |
| | | <Select.Option key={index} value={option.field}> |
| | | {option.label} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请选择' + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group disabled={item.readonly}> |
| | | {item.options.map(option => { |
| | | return ( |
| | | <Radio key={option.value} value={option.value}>{option.text}</Radio> |
| | | ) |
| | | })} |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'color') { |
| | | fields.push( |
| | | <Col span={12} key={index} className="color-col"> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal |
| | | })( |
| | | <ColorSketch /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | | } |
| | | |
| | | onSubmit = () => { |
| | | const { config } = this.props |
| | | const { plot, view } = this.state |
| | | |
| | | if (view === 'normal') { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | this.normalRef.handleConfirm().then(values => { |
| | | let _plot = {...plot, ...values} |
| | | |
| | | this.setState({ |
| | |
| | | }) |
| | | |
| | | this.props.plotchange({...config, plot: _plot}) |
| | | } |
| | | }) |
| | | } else if (view === 'base') { |
| | | this.baseRef.handleConfirm().then(res => { |
| | |
| | | const { plot, view } = this.state |
| | | |
| | | if (view === 'normal') { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | this.normalRef.handleConfirm().then(values => { |
| | | let _plot = {...plot, ...values} |
| | | |
| | | this.setState({ |
| | | plot: _plot, |
| | | view: tab |
| | | }) |
| | | } |
| | | }) |
| | | } else if (view === 'base') { |
| | | this.baseRef.handleConfirm().then(res => { |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { visible, plot, colorColumns, view, baseFormlist } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 } |
| | | } |
| | | } |
| | | const { visible, plot, colorColumns, view, baseFormlist, formlist } = this.state |
| | | |
| | | return ( |
| | | <div className="line-chart-drawer-form"> |
| | | <div className="dashboard-chart-drawer-form"> |
| | | <EditOutlined title="编辑" onClick={this.showDrawer} /> |
| | | <Modal |
| | | wrapClassName="mk-pop-modal" |
| | |
| | | {config.name ? <div className="mk-com-name">{config.name} - 编辑</div> : null} |
| | | <Tabs activeKey={view} className="menu-chart-edit-box" onChange={this.changeTab}> |
| | | <TabPane tab="组件设置" key="base"> |
| | | <NormalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> |
| | | <ModalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> |
| | | </TabPane> |
| | | <TabPane tab="图表设置" key="normal"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={16}>{this.getFields()}</Row> |
| | | </Form> |
| | | <ModalForm formlist={formlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.normalRef = inst}/> |
| | | </TabPane> |
| | | {plot ? <TabPane tab="颜色设置" key="color"> |
| | | <div> |
| | |
| | | .line-chart-drawer-form { |
| | | .dashboard-chart-drawer-form { |
| | | display: inline-block; |
| | | > .anticon-edit { |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | .menu-chart-edit-box { |
| | | .color-sketch-block { |
| | | position: relative; |
| | | top: 5px; |
| | | width: 240px; |
| | | } |
| | | .color-add { |
| | | float: right; |
| | | margin-bottom: 10px; |
| | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | | key: 'title', |
| | | field: 'title', |
| | | label: '标题', |
| | | initVal: card.title, |
| | | initval: card.title, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'name', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initVal: card.name, |
| | | initval: card.name, |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initVal: card.width, |
| | | initval: card.width, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | key: 'height', |
| | | field: 'height', |
| | | label: '图表高度', |
| | | initVal: card.height, |
| | | initval: card.height, |
| | | tooltip: '图表绘图区域的高度,不包括标题及内外边距。', |
| | | required: true, |
| | | options: ['px', 'vh', 'vw'] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'permission', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initVal: card.permission || 'false', |
| | | initval: card.permission || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'cacheLocal', |
| | | field: 'cacheLocal', |
| | | label: '本地缓存', |
| | | initVal: card.cacheLocal || 'true', |
| | | initval: card.cacheLocal || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', text: '继承菜单'}, |
| | | {value: 'false', text: '禁用'}, |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'blacklist', |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | multi: true, |
| | | initval: card.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType || isprint |
| | |
| | | return [ |
| | | { |
| | | type: 'select', |
| | | key: 'gender', |
| | | field: 'gender', |
| | | label: '类型', |
| | | initVal: card.gender || '', |
| | | initval: card.gender || '', |
| | | required: true, |
| | | options: xfields |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'Xaxis', |
| | | field: 'Xaxis', |
| | | label: 'X-轴', |
| | | initVal: card.Xaxis || '', |
| | | initval: card.Xaxis || '', |
| | | required: true, |
| | | options: columns |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'Yaxis', |
| | | field: 'Yaxis', |
| | | label: 'Y-轴', |
| | | initVal: card.Yaxis || '', |
| | | initval: card.Yaxis || '', |
| | | required: true, |
| | | options: yfields |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'shape', |
| | | field: 'shape', |
| | | label: '形状', |
| | | initVal: card.shape || 'circle', |
| | | initval: card.shape || 'circle', |
| | | required: false, |
| | | options: [{ |
| | | value: 'circle', |
| | | text: 'circle' |
| | | label: '圆形' |
| | | }, { |
| | | value: 'square', |
| | | text: 'square' |
| | | label: '方形' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'tooltip', |
| | | field: 'tooltip', |
| | | label: '悬浮提示', |
| | | initVal: card.tooltip || 'true', |
| | | initval: card.tooltip || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '显示' |
| | | label: '显示' |
| | | }, { |
| | | value: 'false', |
| | | text: '隐藏' |
| | | label: '隐藏' |
| | | }] |
| | | // }, { |
| | | // type: 'radio', |
| | | // key: 'download', |
| | | // label: '导出图片', |
| | | // initVal: card.download || 'forbid', |
| | | // required: false, |
| | | // forbid: appType === 'mob', |
| | | // options: [{ |
| | | // value: 'forbid', |
| | | // text: '禁用' |
| | | // }, { |
| | | // value: 'enable', |
| | | // text: '启用' |
| | | // }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'empty', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | | initVal: card.empty || 'show', |
| | | initval: card.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', text: '否'}, |
| | | {value: 'hidden', text: '是'}, |
| | | {value: 'show', label: '否'}, |
| | | {value: 'hidden', label: '是'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'Xunit', |
| | | field: 'Xunit', |
| | | label: 'X轴单位', |
| | | initVal: card.Xunit || '', |
| | | initval: card.Xunit || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'Yunit', |
| | | field: 'Yunit', |
| | | label: 'Y轴单位', |
| | | initVal: card.Yunit || '', |
| | | initval: card.Yunit || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'color', |
| | | label: '色系', |
| | | initVal: card.color || 'rgba(0, 0, 0, 0.65)', |
| | | tooltip: '坐标轴提示文字及示例的颜色。', |
| | | field: 'lineColor', |
| | | label: '坐标轴颜色', |
| | | initval: card.lineColor || '', |
| | | tooltip: '坐标轴线的颜色。', |
| | | allowClear: true, |
| | | required: false |
| | | } |
| | | // , { |
| | | // type: 'select', |
| | | // key: 'interaction', |
| | | // label: '交互效果', |
| | | // initVal: card.interaction || [], |
| | | // multi: true, |
| | | // required: false, |
| | | // forbid: appType === 'mob', |
| | | // options: [ |
| | | // { value: 'element-active', label: '元素聚焦' }, |
| | | // { value: 'element-selected', label: '元素选中(多选)' }, |
| | | // { value: 'element-single-selected', label: '元素选中(单选)' }, |
| | | // // { value: 'active-region', label: '背景框' }, |
| | | // { value: 'view-zoom', label: '视图缩放' }, |
| | | // { value: 'element-highlight', label: '元素高亮' }, |
| | | // { value: 'element-highlight-by-color', label: '同色元素高亮' }, |
| | | // { value: 'element-highlight-by-x', label: '同X轴元素高亮' }, |
| | | // { value: 'legend-filter', label: '图例过滤' }, |
| | | // { value: 'legend-active', label: '图例聚焦' }, |
| | | // { value: 'legend-highlight', label: '图例高亮' }, |
| | | // { value: 'brush', label: '选框过滤' }, |
| | | // ] |
| | | // } |
| | | ] |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Modal, Form, Row, Col, Select, Radio, Tooltip, Input, InputNumber, Tabs } from 'antd' |
| | | import { QuestionCircleOutlined, EditOutlined } from '@ant-design/icons' |
| | | import { Modal, Form, Tabs } from 'antd' |
| | | import { EditOutlined } from '@ant-design/icons' |
| | | |
| | | import { getBaseForm, getOptionForm } from './formconfig' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import ColorSketch from '@/mob/colorsketch' |
| | | import './index.scss' |
| | | |
| | | const { TabPane } = Tabs |
| | | const NormalForm = asyncComponent(() => import('@/menu/components/share/normalform')) |
| | | const ModalForm = asyncComponent(() => import('@/components/normalform/modalform')) |
| | | |
| | | class LineChartDrawerForm extends Component { |
| | | static propTpyes = { |
| | |
| | | }) |
| | | } |
| | | |
| | | getFields() { |
| | | const { formlist } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | const fields = [] |
| | | |
| | | if (!formlist) { |
| | | return fields |
| | | } |
| | | |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | if (item.type === 'text') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.onSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={item.min} max={item.max} precision={item.decimal} onPressEnter={this.onSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'select') { // 下拉 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请选择' + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select mode={item.multi ? 'multiple' : ''}> |
| | | {item.options.map((option, index) => |
| | | <Select.Option key={index} value={option.field || option.value}> |
| | | {option.label || option.text} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请选择' + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group disabled={item.readonly}> |
| | | {item.options.map(option => { |
| | | return ( |
| | | <Radio key={option.value} value={option.value}>{option.text}</Radio> |
| | | ) |
| | | })} |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'color') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal |
| | | })( |
| | | <ColorSketch /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | | } |
| | | |
| | | onSubmit = () => { |
| | | const { config } = this.props |
| | | const { plot, view } = this.state |
| | | |
| | | if (view === 'normal') { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | this.normalRef.handleConfirm().then(values => { |
| | | let _plot = {...plot, ...values} |
| | | |
| | | this.setState({ |
| | |
| | | }) |
| | | |
| | | this.props.plotchange({...config, plot: _plot}) |
| | | } |
| | | }) |
| | | } else if (view === 'base') { |
| | | this.baseRef.handleConfirm().then(res => { |
| | |
| | | const { plot, view } = this.state |
| | | |
| | | if (view === 'normal') { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | this.normalRef.handleConfirm().then(values => { |
| | | this.setState({ |
| | | plot: {...plot, ...values}, |
| | | view: tab |
| | | }) |
| | | } |
| | | }) |
| | | } else if (view === 'base') { |
| | | this.baseRef.handleConfirm().then(res => { |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { view, visible, baseFormlist } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 } |
| | | } |
| | | } |
| | | const { view, visible, baseFormlist, formlist } = this.state |
| | | |
| | | return ( |
| | | <div className="line-chart-drawer-form"> |
| | |
| | | {config.name ? <div className="mk-com-name">{config.name} - 编辑</div> : null} |
| | | <Tabs activeKey={view} className="menu-chart-edit-box" onChange={this.changeTab}> |
| | | <TabPane tab="组件设置" key="base"> |
| | | <NormalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> |
| | | <ModalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> |
| | | </TabPane> |
| | | <TabPane tab="图表设置" key="normal"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={16}>{this.getFields()}</Row> |
| | | </Form> |
| | | <ModalForm formlist={formlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.normalRef = inst}/> |
| | | </TabPane> |
| | | </Tabs> |
| | | </Modal> |
| | |
| | | } |
| | | } |
| | | .menu-chart-edit-box { |
| | | .color-sketch-block { |
| | | position: relative; |
| | | top: 5px; |
| | | width: 240px; |
| | | } |
| | | .color-add { |
| | | float: right; |
| | | margin-bottom: 10px; |
| | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | | key: 'title', |
| | | field: 'title', |
| | | label: '标题', |
| | | initVal: card.title, |
| | | initval: card.title, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'name', |
| | | field: 'name', |
| | | label: '组件名称', |
| | | initVal: card.name, |
| | | initval: card.name, |
| | | tooltip: '用于组件间的区分。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'chartType', |
| | | field: 'chartType', |
| | | label: '图表类型', |
| | | initVal: card.chartType || 'antv', |
| | | initval: card.chartType || 'antv', |
| | | required: true, |
| | | options: [ |
| | | { value: 'antv', text: 'antv' }, |
| | | { value: 'echarts', text: 'echarts' } |
| | | { value: 'antv', label: 'antv5.0' }, |
| | | { value: 'echarts', label: 'echarts' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initVal: card.width, |
| | | initval: card.width, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | key: 'height', |
| | | field: 'height', |
| | | label: '图表高度', |
| | | initVal: card.height, |
| | | initval: card.height, |
| | | tooltip: '图表绘图区域的高度,不包括标题及内外边距。', |
| | | required: true, |
| | | options: ['px', 'vh', 'vw'] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'permission', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initVal: card.permission || 'false', |
| | | initval: card.permission || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'cacheLocal', |
| | | field: 'cacheLocal', |
| | | label: '本地缓存', |
| | | initVal: card.cacheLocal || 'true', |
| | | initval: card.cacheLocal || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', text: '继承菜单'}, |
| | | {value: 'false', text: '禁用'}, |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'blacklist', |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | multi: true, |
| | | initval: card.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType || isprint |
| | | }, |
| | | // { |
| | | // type: 'cascader', |
| | | // key: 'linkmenu', |
| | | // label: '关联菜单', |
| | | // initVal: card.linkmenu || [], |
| | | // tooltip: '在使用柱形图且未启用自定义设置时有效。', |
| | | // required: false, |
| | | // forbid: appType === 'pc' || appType === 'mob', |
| | | // options: menulist |
| | | // }, |
| | | // { |
| | | // type: 'select', |
| | | // key: 'linkmenu', |
| | | // label: '关联菜单', |
| | | // initVal: card.linkmenu || '', |
| | | // tooltip: '双击柱状图,会打开关联的菜单。', |
| | | // required: false, |
| | | // forbid: appType !== 'pc', |
| | | // options: menulist |
| | | // }, |
| | | |
| | | } |
| | | ] |
| | | } |
| | |
| | | // import './index.scss' |
| | | |
| | | const { TabPane } = Tabs |
| | | const NormalForm = asyncComponent(() => import('@/menu/components/share/normalform')) |
| | | const ModalForm = asyncComponent(() => import('@/components/normalform/modalform')) |
| | | const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) |
| | | |
| | | class CustomChartDrawerForm extends Component { |
| | |
| | | {config.name ? <div className="mk-com-name">{config.name} - 编辑</div> : null} |
| | | <Tabs activeKey={view} onChange={this.changeTab}> |
| | | <TabPane tab="组件设置" key="base"> |
| | | <NormalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> |
| | | <ModalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> |
| | | </TabPane> |
| | | {plot ? <TabPane tab="JS" key="JS"> |
| | | {plot.chartType === 'antv' ? <div>入参:Chart、 DataSet、 wrap(dom节点)、data、 config</div> : <div>入参:echarts、 DataSet、 wrap(dom节点)、 data、 config</div>} |
| | | {plot.chartType === 'antv' ? <div>入参:Chart、 chartId(dom节点id)、data、 config</div> : <div>入参:echarts、 chartId(dom节点id)、 data、 config</div>} |
| | | <CodeMirror mode="text/javascript" theme="cobalt" value={plot.script} onChange={this.onChange} /> |
| | | </TabPane> : null} |
| | | </Tabs> |
| | |
| | | } else if (this.record.type === 'close' || this.record.type === 'reset') { |
| | | shows = ['typeName', 'label'] |
| | | } else { |
| | | shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload', 'preButton'] // 选项列表 |
| | | shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload', 'preButton', 'formCache'] // 选项列表 |
| | | |
| | | if (this.record.execSuccess === 'never') { |
| | | shows.push('resetForms') |
| | | } |
| | | if (this.record.syncComponent && this.record.syncComponent[0]) { |
| | | shows.push('syncDelay') |
| | | } |
| | | if (this.record.intertype === 'custom') { |
| | | shows.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross', 'stringify', 'ContentType', 'outerBlacklist') |
| | |
| | | shows.push('innerFunc') |
| | | } else { |
| | | shows.push('sql', 'sqlType') |
| | | if (this.record.execSuccess === 'never' && this.record.resetForms && this.record.resetForms[0]) { |
| | | shows.push('returnValue') |
| | | } |
| | | } |
| | | |
| | | if (this.record.linkmenu && this.record.linkmenu !== 'goback') { |
| | |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={0} max={10000} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | })(<InputNumber min={0} max={10000} placeholder={item.placeholder || ''} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | fields.forEach(item => { |
| | | if (item.type !== 'text' && item.type !== 'number') return |
| | | |
| | | if (item.label !== item.field) { |
| | | resets.push({ |
| | | value: item.field, |
| | | text: item.label + ' (' + item.field + ')' |
| | | }) |
| | | } else { |
| | | resets.push({ |
| | | value: item.field, |
| | | text: item.label |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | return [ |
| | |
| | | options: modules |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'syncDelay', |
| | | label: '刷新延迟', |
| | | initVal: card.syncDelay, |
| | | tooltip: '同步刷新组件的延迟时间,单位毫秒。', |
| | | // placeholder: '单位毫秒', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'anchors', |
| | | label: '跳转锚点', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'returnValue', |
| | | label: '更新表单', |
| | | initVal: card.returnValue || 'false', |
| | | tooltip: '与重置表单配合使用,开启时,必须在自定义脚本中返回数据,用于替换字段集和填充表单。', |
| | | options: [{ |
| | | value: 'false', |
| | | text: '禁用' |
| | | }, { |
| | | value: 'true', |
| | | text: '启用' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'reload', |
| | | label: '上一页', |
| | | initVal: card.reload || 'false', |
| | |
| | | text: '刷新' |
| | | }] |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // key: 'formCache', |
| | | // label: '表单缓存', |
| | | // initVal: card.formCache || 'false', |
| | | // tooltip: '主要用于数据修改后,更新相关表单的选项,清空缓存后表单再次打开时数据会重新加载。', |
| | | // required: false, |
| | | // options: [{ |
| | | // value: 'false', |
| | | // text: '不清空' |
| | | // }, { |
| | | // value: 'clear', |
| | | // text: '清空' |
| | | // }] |
| | | // }, |
| | | ] |
| | | } |
| | |
| | | if (item.subButton.intertype === 'system' && !item.subButton.sqlType) { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`}) |
| | | } |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | item.fields.forEach(m => { |
| | | if (m.dataSource && /@ID@/ig.test(m.dataSource)) { |
| | | idCtrl = true |
| | |
| | | if (item.subButton.intertype === 'system' && !item.subButton.sqlType) { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`}) |
| | | } |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | item.fields.forEach(m => { |
| | | if (m.dataSource && /@ID@/ig.test(m.dataSource)) { |
| | | idCtrl = true |
| | |
| | | if (item.subButton.intertype === 'system' && !item.subButton.sqlType) { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`}) |
| | | } |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | item.fields.forEach(m => { |
| | | if (m.dataSource && /@ID@/ig.test(m.dataSource)) { |
| | | idCtrl = true |
| | |
| | | if (item.subButton.intertype === 'system' && !item.subButton.sqlType) { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`}) |
| | | } |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | item.fields.forEach(m => { |
| | | if (m.dataSource && /@ID@/ig.test(m.dataSource)) { |
| | | idCtrl = true |
| | |
| | | if (item.subButton.intertype === 'system' && !item.subButton.sqlType) { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`}) |
| | | } |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | item.fields.forEach(m => { |
| | | if (m.dataSource && /@ID@/ig.test(m.dataSource)) { |
| | | idCtrl = true |
| | |
| | | if (item.subButton.intertype === 'system' && !item.subButton.sqlType) { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`}) |
| | | } |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | item.fields.forEach(m => { |
| | | if (m.dataSource && /@ID@/ig.test(m.dataSource)) { |
| | | idCtrl = true |
| | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable')) |
| | | const acTyOptions = { |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden', 'preButton'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden', 'preButton'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'hidden', 'preButton'], |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden', 'preButton', 'formCache'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden', 'preButton', 'formCache'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'hidden', 'preButton', 'formCache'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'], |
| | | excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'maskStyle', 'closeButton', 'hidden'], |
| | |
| | | } else if (_funcType === 'refund') { |
| | | shows.push('Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu') |
| | | reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | } else if (_funcType === 'shareLink') { |
| | | shows.push('shortUrl', 'shareUrl', 'shareProUrl', 'shareTip') |
| | | // } else if (_funcType === 'expPdf') { |
| | | // shows.push('exportType') |
| | | } |
| | |
| | | shows.push('reason') |
| | | } |
| | | } |
| | | } else if (!(openType === 'funcbutton' && this.record.funcType === 'expPdf')) { |
| | | } else if (openType !== 'funcbutton' || !['expPdf', 'shareLink'].includes(this.record.funcType)) { |
| | | if (openType !== 'excelOut') { |
| | | reOptions.control = [ |
| | | { value: '', text: '无' }, |
| | |
| | | { value: 'refund', text: '退款' }, |
| | | { value: 'closetab', text: '标签关闭' }, |
| | | { value: 'expPdf', text: '导出PDF' }, |
| | | { value: 'shareLink', text: '分享链接' }, |
| | | { value: 'megvii', text: '旷视面板机' }, |
| | | { value: 'filezip', text: '文件压缩包' }, |
| | | ] |
| | |
| | | { value: 'clearCache', text: '清空本地配置' }, |
| | | { value: 'copyurl', text: '复制链接地址' }, |
| | | { value: 'expPdf', text: '导出PDF' }, |
| | | { value: 'shareLink', text: '分享链接' }, |
| | | { value: 'logout', text: '退出' }, |
| | | { value: 'goBack', text: '返回' }, |
| | | ] |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'shortUrl', |
| | | label: '短链接', |
| | | initVal: card.shortUrl || 'false', |
| | | options: [{ |
| | | value: 'false', |
| | | text: '禁用' |
| | | }, { |
| | | value: 'true', |
| | | text: '启用' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'shareUrl', |
| | | label: '链接地址', |
| | | initVal: card.shareUrl || '', |
| | | tooltip: '链接中如果存在@BID@或@ID@将自动替换。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'shareProUrl', |
| | | label: '正式链接', |
| | | initVal: card.shareProUrl || '', |
| | | tooltip: '链接中如果存在@BID@或@ID@将自动替换。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'shareTip', |
| | | label: '分享提示', |
| | | initVal: card.shareTip || '', |
| | | tooltip: '分享时对用户的提示信息。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | min: 0, |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'formCache', |
| | | label: '表单缓存', |
| | | initVal: card.formCache || 'false', |
| | | tooltip: '主要用于数据修改后,更新相关表单的选项,清空缓存后表单再次打开时数据会重新加载。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '不清空' |
| | | }, { |
| | | value: 'clear', |
| | | text: '清空' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'hidden', |
| | | label: '隐藏', |
| | | initVal: card.hidden || 'false', |
| | |
| | | dataIndex: 'syncComId', |
| | | inputType: 'cascader', |
| | | editable: true, |
| | | unique: true, |
| | | required: true, |
| | | extends: [{key: 'label', value: 'label'}], |
| | | width: '70%', |
| | |
| | | { value: 'refund', text: '退款' }, |
| | | { value: 'closetab', text: '标签关闭' }, |
| | | { value: 'expPdf', text: '导出PDF' }, |
| | | { value: 'shareLink', text: '分享链接' }, |
| | | { value: 'megvii', text: '旷视面板机' }, |
| | | { value: 'filezip', text: '文件压缩包' }, |
| | | ] |
| | |
| | | // }] |
| | | // }, |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '宽度', |
| | | initVal: card.width || 12, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | forbid: card.eleType !== 'button', |
| | | type: 'radio', |
| | | key: 'shortUrl', |
| | | label: '短链接', |
| | | initVal: card.shortUrl || 'false', |
| | | options: [{ |
| | | value: 'false', |
| | | text: '禁用' |
| | | }, { |
| | | value: 'true', |
| | | text: '启用' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'shareUrl', |
| | | label: '链接地址', |
| | | initVal: card.shareUrl || '', |
| | | tooltip: '链接中如果存在@BID@或@ID@将自动替换。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'shareProUrl', |
| | | label: '正式链接', |
| | | initVal: card.shareProUrl || '', |
| | | tooltip: '链接中如果存在@BID@或@ID@将自动替换。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'shareTip', |
| | | label: '分享提示', |
| | | initVal: card.shareTip || '', |
| | | tooltip: '分享时对用户的提示信息。', |
| | | required: false |
| | | }, |
| | | // { |
| | | // type: 'number', |
| | | // key: 'width', |
| | | // min: 1, |
| | | // max: 24, |
| | | // precision: 0, |
| | | // label: '宽度', |
| | | // initVal: card.width || 12, |
| | | // tooltip: '栅格布局,每行等分为24列。', |
| | | // forbid: card.eleType !== 'button', |
| | | // required: true |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | key: 'show', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'formCache', |
| | | label: '表单缓存', |
| | | initVal: card.formCache || 'false', |
| | | tooltip: '主要用于数据修改后,更新相关表单的选项,清空缓存后表单再次打开时数据会重新加载。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '不清空' |
| | | }, { |
| | | value: 'clear', |
| | | text: '清空' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'hidden', |
| | | label: '隐藏', |
| | | initVal: card.hidden || 'false', |
| | |
| | | title: '组件', |
| | | dataIndex: 'syncComId', |
| | | inputType: 'cascader', |
| | | unique: true, |
| | | editable: true, |
| | | required: true, |
| | | extends: [{key: 'label', value: 'label'}], |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { colsCtrls, columns, visible, cols, searches } = this.state |
| | | |
| | | let className = '' |
| | | if (config.colsCtrls && config.colsCtrls.length) { |
| | | className = 'cols-ctrls' |
| | | } |
| | | |
| | | return ( |
| | | <div style={{display: 'inline-block'}}> |
| | | <div style={{display: 'inline-block'}} className={className}> |
| | | <ApartmentOutlined style={{color: '#13c2c2'}} title="显示列控制" onClick={this.resetMark} /> |
| | | <Modal |
| | | wrapClassName="column-control-modal-wrap" |
| | |
| | | } |
| | | } |
| | | } |
| | | .cols-ctrls { |
| | | position: relative; |
| | | } |
| | | .cols-ctrls::after { |
| | | content: ' '; |
| | | display: block; |
| | | position: absolute; |
| | | top: 0; |
| | | right: 7px; |
| | | width: 4px; |
| | | height: 4px; |
| | | border-radius: 4px; |
| | | background-color: red; |
| | | } |
| | |
| | | 取消 |
| | | </Button> : null} |
| | | </Col> |
| | | {targetKeys ? <Col span={18}> |
| | | {targetKeys ? <Col span={18} style={{clear: 'left'}}> |
| | | <Form.Item label="显示列"> |
| | | {getFieldDecorator('cols', { |
| | | initialValue: [], |
| | |
| | | render() { |
| | | const { marks, markColumns, visible, options, signs } = this.state |
| | | |
| | | let className = '' |
| | | if (this.props.type === 'line' && this.props.marks.length) { |
| | | className = 'mk-line-marks' |
| | | } |
| | | |
| | | return ( |
| | | <div style={{display: 'inline-block'}}> |
| | | <div style={{display: 'inline-block'}} className={className}> |
| | | <AntDesignOutlined className="profile" title="标记" onClick={this.resetMark} /> |
| | | <Modal |
| | | wrapClassName="mark-modal-wrap" |
| | |
| | | } |
| | | } |
| | | } |
| | | .mk-line-marks { |
| | | position: relative; |
| | | } |
| | | .mk-line-marks::after { |
| | | content: ' '; |
| | | display: block; |
| | | position: absolute; |
| | | top: 0; |
| | | right: 7px; |
| | | width: 4px; |
| | | height: 4px; |
| | | border-radius: 4px; |
| | | background-color: red; |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | if (res.copyType === 'editcols') { |
| | | res.copyType = 'cols' |
| | | } |
| | | |
| | | let type = res.copyType |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | |
| | | } else if (type === 'cols') { |
| | | config.cols = config.cols.filter(col => !col.origin) |
| | | |
| | | if (config.subtype === 'normaltable' && res.cols.length === 1) { |
| | | if ((config.subtype === 'normaltable' || config.subtype === 'editable') && res.cols.length === 1) { |
| | | config.cols.push(...res.cols) |
| | | } else { |
| | | let keys = config.cols.map(col => (col.field || '$empty')) |
| | |
| | | if (res.copyType === 'form') { |
| | | delete res.copyType |
| | | res = {fields: [res]} |
| | | } else if (res.copyType === 'simpleform') { |
| | | res = {fields: res.subcards[0].fields} |
| | | } |
| | | |
| | | res.fields = res.fields || [] |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'lostTip', |
| | | label: '图片缺失', |
| | | initVal: card.lostTip || 'true', |
| | | tooltip: '图片地址不存在时,是否提示图片丢失。', |
| | | required: false, |
| | | options: [ |
| | | { value: 'true', text: '提示' }, |
| | | { value: 'false', text: '不提示' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'perspective', |
| | | label: '字段透视', |
| | | initVal: card.perspective || '', |
| | |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], |
| | | link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist', 'nameField'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'prefix', 'postfix', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale', 'lenWidRadio', 'backgroundSize', 'span'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale', 'lenWidRadio', 'backgroundSize', 'span', 'lostTip'], |
| | | video: ['label', 'field', 'type', 'Align', 'Hide', 'startTime', 'Width', 'fieldlength', 'blacklist', 'aspectRatio'], |
| | | colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], |
| | | custom: ['label', 'type', 'Align', 'Width', 'blacklist', 'IsSort'], |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxPageSize', |
| | | label: '每页最大数', |
| | | initval: wrap.maxPageSize || '', |
| | | min: 10, |
| | | max: 500, |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | |
| | | label: card.label + '(下一行)' |
| | | }) |
| | | |
| | | if (wrap.commit === 'change') { |
| | | editCols.push({ |
| | | field: '$noActX', |
| | | label: '无动作', |
| | | disabled: card.editType !== 'select' |
| | | }) |
| | | } else if (card.enter === '$noActX') { |
| | | card.enter = '$noAct' |
| | | } |
| | | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | } |
| | | } else if (key === 'format' && value === 'percent') { |
| | | this.props.form.setFieldsValue({postfix: '%'}) |
| | | } else if (key === 'editType') { |
| | | let _options = this.getOptions() |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'enter' && item.options && item.options[item.options.length - 1].field === '$noActX') { |
| | | item.options[item.options.length - 1].disabled = value !== 'select' |
| | | } |
| | | |
| | | item.initVal = this.record[item.key] |
| | | item.hidden = !_options.includes(item.key) |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | | } else if (['editable', 'editType', 'resourceType', 'ctrlField', 'eval', 'Hide', 'IsSort'].includes(key)) { |
| | | let _options = this.getOptions() |
| | | |
| | |
| | | getPopupContainer={() => document.getElementById('edit-table-column-winter')} |
| | | > |
| | | {options.map((option, i) => |
| | | <Select.Option key={i} datatype={option.datatype || ''} label={option.label || ''} value={(option.value || option.field || option.MenuID)}> |
| | | <Select.Option key={i} disabled={option.disabled === true} datatype={option.datatype || ''} label={option.label || ''} value={(option.value || option.field || option.MenuID)}> |
| | | {(option.text || option.label || option.MenuName)} |
| | | </Select.Option> |
| | | )} |
| | |
| | | } |
| | | } |
| | | |
| | | if (values.type === 'text' && values.editable === 'true') { |
| | | if (values.editType !== 'select' && values.enter === '$noActX') { |
| | | values.enter = '$noAct' |
| | | } |
| | | } |
| | | |
| | | if (values.dataSource) { |
| | | let pass = checkSQL(values.dataSource) |
| | | |
| | |
| | | this.props.updateCol({...column, marks: vals}) |
| | | } |
| | | |
| | | copycolumn = () => { |
| | | const { column } = this.props |
| | | |
| | | let oInput = document.createElement('input') |
| | | let val = { |
| | | copyType: 'editcols', |
| | | cols: [column] |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | oInput.className = 'oInput' |
| | | oInput.style.display = 'none' |
| | | |
| | | message.success('复制成功。') |
| | | |
| | | document.body.removeChild(oInput) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | |
| | | if (this.props.rowSpan !== nextProps.rowSpan || this.props.colSpan !== nextProps.colSpan) { |
| | |
| | | {column.type === 'custom' ? <PlusOutlined className="plus" title="添加元素" onClick={() => this.props.addElement(column)} /> : null} |
| | | {column.type === 'custom' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.props.addElement(column, 'button')} /> : null} |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | <CopyOutlined title="复制显示列" style={{color: '#26C281'}} onClick={this.copycolumn} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement', 'action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | |
| | | |
| | | let oInput = document.createElement('input') |
| | | let val = { |
| | | copyType: 'cols', |
| | | copyType: 'editcols', |
| | | cols: columns.filter(col => !col.origin) |
| | | } |
| | | |
| | |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="editable" card={card}/> |
| | | <PasteComponent config={card} options={['action', 'search', 'form', 'cols']} updateConfig={this.updateComponent} /> |
| | | <PasteComponent config={card} options={['action', 'search', 'form', 'editcols']} updateConfig={this.updateComponent} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | | <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | <SettingComponent config={card} updateConfig={this.updateComponent} /> |
| | |
| | | options: columns |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxPageSize', |
| | | label: '每页最大数', |
| | | initval: wrap.maxPageSize || '', |
| | | min: 10, |
| | | max: 500, |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'lostTip', |
| | | label: '图片缺失', |
| | | initVal: card.lostTip || 'true', |
| | | tooltip: '图片地址不存在时,是否提示图片丢失。', |
| | | required: false, |
| | | options: [ |
| | | { value: 'true', text: '提示' }, |
| | | { value: 'false', text: '不提示' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'perspective', |
| | | label: '字段透视', |
| | | initVal: card.perspective || '', |
| | |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], |
| | | link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'backgroundSize', 'span'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'backgroundSize', 'span', 'lostTip'], |
| | | video: ['label', 'field', 'type', 'Align', 'Hide', 'startTime', 'Width', 'blacklist', 'aspectRatio'], |
| | | colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], |
| | | custom: ['label', 'type', 'Align', 'Width', 'blacklist', 'IsSort'], |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxPageSize', |
| | | label: '每页最大数', |
| | | initval: wrap.maxPageSize || '', |
| | | min: 10, |
| | | max: 500, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | |
| | | initval: wrap.permission || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || ispop |
| | | forbid: ispop |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | }) |
| | | return Promise.reject() |
| | | } |
| | | } else if (config.subtype === 'editable') { |
| | | let _arr = [] |
| | | columns.forEach(col => { |
| | | let key = col.field.toLowerCase() |
| | | if (['jskey', 'data_type', 'bid'].includes(key)) { |
| | | _arr.push(col.field) |
| | | } |
| | | }) |
| | | |
| | | if (_arr.length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段集中不可使用' + _arr.join('、') + '!注:此字段为提交时的系统字段。', |
| | | duration: 5 |
| | | }) |
| | | return Promise.reject() |
| | | } |
| | | } |
| | | |
| | | return new Promise((resolve, reject) => { |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | {setting.interType === 'outer' ? <Col span={8}> |
| | | {setting.interType === 'outer' ? <Col span={8} className="compact"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="业务系统指同一sso下的其他业务系统,外部系统指不同sso下的其他业务系统。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | <Radio value="false">业务</Radio> |
| | | <Radio value="true">单点</Radio> |
| | | <Radio value="external">外部</Radio> |
| | | <Radio value="custom">自定义</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | })(<KeyInterface type="develop"/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' && setting.sysInterface === 'false' ? <Col className="outer-interface" span={24}> |
| | | {setting.interType === 'outer' && (setting.sysInterface === 'false' || setting.sysInterface === 'custom') ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址,为空时使用接口地址。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 正式地址 |
| | |
| | | })(<KeyInterface type="product"/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' && setting.sysInterface === 'custom' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}> |
| | | <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 2 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 22 }} } label={ |
| | | <Tooltip placement="topLeft" title="外部接口入参及出参的自定义处理。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 自定义脚本 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('js_script', { |
| | | initialValue: setting.js_script || '' |
| | | })(<CodeMirror mode="text/javascript" theme="cobalt" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="外部函数"> |
| | | {getFieldDecorator('outerFunc', { |
| | |
| | | .ant-radio-group { |
| | | white-space: nowrap; |
| | | } |
| | | .compact { |
| | | padding-left: 0px!important; |
| | | .ant-radio-group { |
| | | span.ant-radio + * { |
| | | padding-left: 6px; |
| | | padding-right: 6px; |
| | | } |
| | | } |
| | | } |
| | | .outer-interface { |
| | | .ant-form-item-label { |
| | | width: 10.5%; |
| | |
| | | } |
| | | |
| | | if (_customScript) { |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${_customScript} |
| | | ` |
| | | } |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'1949-10-01 15:00:00' |
| | | ` |
| | | } else if (_tailScript) { |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${_dataresource} |
| | | ${_tailScript} |
| | | aaa: |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'1949-10-01 15:00:00' |
| | | ` |
| | | } else { |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${_dataresource}` |
| | | } |
| | | |
| | |
| | | item.setting.interType = 'system' |
| | | item.setting.execute = btn.verify.defaultSql || 'true' |
| | | item.setting.dataresource = btn.verify.dataresource || '' |
| | | item.setting.primaryKey = btn.verify.primaryKey || component.setting.primaryKey || 'ID' |
| | | item.setting.primaryKey = btn.verify.primaryKey || '' |
| | | item.setting.queryType = btn.verify.queryType |
| | | item.setting.laypage = btn.pagination |
| | | item.setting.order = btn.verify.order || '' |
| | | |
| | | if (btn.Ot === 'requiredOnce') { |
| | | item.setting.primaryKey = btn.verify.primaryKey || component.setting.primaryKey || 'ID' |
| | | } |
| | | |
| | | item.scripts = btn.verify.scripts || [] |
| | | |
| | |
| | | item.$searches = fromJS(searches).toJS() |
| | | searches = formatSearch(searches) |
| | | |
| | | let _columns = item.columns || [] |
| | | let _columns = [] |
| | | if (item.subtype === 'dualdatacard') { |
| | | _columns = [...item.columns, ...item.subColumns] |
| | | } else if (item.columns) { |
| | | _columns = [...item.columns] |
| | | } |
| | | |
| | | if (item.setting.primaryKey) { |
| | | let key = item.setting.primaryKey.toLowerCase() |
| | | if (_columns.findIndex(cell => cell.field.toLowerCase() === key) === -1) { |
| | | _columns.push({ |
| | | field: item.setting.primaryKey |
| | | }) |
| | | } |
| | | } |
| | | |
| | | let arr_field = _columns.map(col => col.field).join(',') |
| | |
| | | |
| | | let sql = '' |
| | | if (_customScript) { |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${_customScript} |
| | | ${_dataresource} |
| | | ${_tailScript} |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'1949-10-01 15:00:00' |
| | | ` |
| | | } else if (_tailScript) { |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${_dataresource} |
| | | ${_tailScript} |
| | | aaa: |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'1949-10-01 15:00:00' |
| | | ` |
| | | } else { |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${_dataresource}` |
| | | } |
| | | |
| | |
| | | item.name = (MenuName || '') |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | Utils.initSearchVal(item) |
| | | |
| | | item.$searches = Utils.initMainSearch(item.search) |
| | | |
| | | if (item.setting.supModule) { |
| | | let pid = item.setting.supModule.pop() |
| | | if (pid && pid !== 'empty') { |
| | |
| | | item.setting.supModule = '' |
| | | } |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | Utils.initSearchVal(item) |
| | | |
| | | item.$searches = Utils.initMainSearch(item.search) |
| | | |
| | | let statFields = [] |
| | | let getCols = (cols) => { |
| | |
| | | } |
| | | |
| | | if (cell.verify && cell.verify.preHandle === 'true') { |
| | | let script = cell.verify.pre_func |
| | | if (!/#position-/.test(script) || /#position-init/.test(script)) { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('btn', 'systemType', cell.verify.pre_func) |
| | | func(cell, window.GLOB.systemType) |
| | | let func = new Function('btn', 'position', 'systemType', script) |
| | | func(cell, 'init', window.GLOB.systemType) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | if (/#position-inner/.test(script)) { |
| | | cell.$innerScript = script |
| | | } |
| | | if (/#position-outer/.test(script)) { |
| | | cell.$outerScript = script |
| | | } |
| | | if (/#position-callback/.test(script)) { |
| | | cell.$callbackScript = script |
| | | } |
| | | } |
| | | |
| | | if (cell.syncComponentId) { |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | |
| | | top: calc(50vh - 70px); |
| | | } |
| | | |
| | | .common-table-copy { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 65px; |
| | | right: 30px; |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | .ant-btn-link:hover { |
| | | opacity: 0.8; |
| | | } |
| | |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | this.setState({ |
| | | data: {$$BID: BID || '', $$BData: BData, $$empty: true}, |
| | | data: {$$BID: BID || '', $$BData: BData, $$empty: true, $$time: new Date().getTime()}, |
| | | }) |
| | | return |
| | | } else if (config.setting.supModule && !BID) { // BID 不存在时,不做查询 |
| | |
| | | const FuncMegvii = asyncComponent(() => import('@/tabviews/zshare/actionList/funcMegvii')) |
| | | const FuncZip = asyncComponent(() => import('@/tabviews/zshare/actionList/funczip')) |
| | | const ExportPdf = asyncComponent(() => import('@/tabviews/zshare/actionList/exportPdf')) |
| | | const ShareLink = asyncComponent(() => import('@/tabviews/zshare/actionList/shareLink')) |
| | | const EditLine = asyncComponent(() => import('@/tabviews/zshare/actionList/editLine')) |
| | | const BarCode = asyncComponent(() => import('@/components/barcode')) |
| | | const QrCode = asyncComponent(() => import('@/components/qrcode')) |
| | |
| | | urls.forEach((u, i) => { |
| | | contents.push(<div className={'ant-col ant-col-' + card.width} key={card.uuid + i} style={_style_} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | | <MkPicture style={_imagestyle} scale={scale} url={u} urls={urls}/> |
| | | <MkPicture style={_imagestyle} lostTip={card.lostTip !== 'false'} scale={scale} url={u} urls={urls}/> |
| | | </div> |
| | | </div>) |
| | | }) |
| | |
| | | MkButton = <ExportPdf |
| | | btn={card} |
| | | /> |
| | | } else if (card.funcType === 'shareLink') { |
| | | MkButton = <ShareLink |
| | | BID={data.$$BID} |
| | | btn={card} |
| | | selectedData={_data} |
| | | /> |
| | | } else if (card.funcType === 'addline' || card.funcType === 'delline') { |
| | | MkButton = <EditLine |
| | | btn={card} |
| | |
| | | pageOptions.push(size) |
| | | pageOptions = pageOptions.sort((a, b) => a - b) |
| | | } |
| | | |
| | | if (_config.wrap.maxPageSize) { |
| | | pageOptions = pageOptions.filter(item => item <= _config.wrap.maxPageSize) |
| | | } |
| | | } |
| | | |
| | | let _data = [] |
| | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data, pageIndex: 1 }, () => { |
| | | if (!config.checkBid) { |
| | | this.loadData() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | pageOptions.push(size) |
| | | pageOptions = pageOptions.sort((a, b) => a - b) |
| | | } |
| | | if (_config.wrap.maxPageSize) { |
| | | pageOptions = pageOptions.filter(item => item <= _config.wrap.maxPageSize) |
| | | } |
| | | } |
| | | |
| | | if (_config.wrap.zHeight) { |
| | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data, pageIndex: 1 }, () => { |
| | | if (!config.checkBid) { |
| | | this.loadData() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | this.setState({ |
| | | data: {$$BID: BID || '', $$BData: BData, $$empty: true}, |
| | | data: {$$BID: BID || '', $$BData: BData, $$empty: true, $$time: new Date().getTime()}, |
| | | }) |
| | | |
| | | if (!btn) { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {nodetype === 'node' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="标记将作为节点ID"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 标记 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sign', { |
| | | initialValue: data.sign || '' |
| | | })( |
| | | <Input placeholder="" autoComplete="off"/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('remark', { |
| | |
| | | |
| | | let _group = _config.subcards[0] |
| | | |
| | | if (_config.wrap.refocus) { |
| | | _group.setting.refocus = _config.wrap.refocus |
| | | } |
| | | |
| | | if (_group.subButton.enable === 'false' && (!_group.closeButton || _group.closeButton.enable !== 'true') && (!_group.resetButton || _group.resetButton.enable !== 'true')) { |
| | | _group.subButton.style.display = 'none' |
| | | _group.$button = 'no-button' |
| | |
| | | |
| | | /** |
| | | * @description 按钮执行完成后页面刷新 |
| | | * @param {*} menuId // 菜单Id |
| | | * @param {*} position // 刷新位置 |
| | | * @param {*} btn // 执行的按钮 |
| | | */ |
| | | refreshByButtonResult = (menuId, position, btn, id) => { |
| | | refreshByButtonResult = (menuId, position, btn, id, lines, res) => { |
| | | const { config, group, BID } = this.state |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | if (position === 'resetData') { |
| | | let _data = fromJS(this.state.data || {}).toJS() |
| | | |
| | | Object.keys(_data).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (typeof(res[_key]) !== 'undefined') { |
| | | _data[key] = res[_key] |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | data: _data |
| | | }) |
| | | return |
| | | } |
| | | if (position === 'grid' && config.wrap.refocus) { |
| | | let _group = fromJS(group).toJS() |
| | | _group.setting.focus = config.wrap.refocus |
| | |
| | | <div className="voucher-code"> |
| | | <Select value={charType} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({status: 'change', charType: val, charName: option.props.charName, charInt: option.props.charint})}> |
| | | {typeOptions.map(option => |
| | | <Select.Option key={option.voucher_char_int} value={option.voucher_class} charName={option.voucher_char} charint={option.voucher_char_int}>{option.voucher_char}</Select.Option> |
| | | <Select.Option key={option.id} value={option.voucher_class} charName={option.voucher_char} charint={option.voucher_char_int}>{option.voucher_char}</Select.Option> |
| | | )} |
| | | </Select> |
| | | <InputNumber precision={0} min={1} value={charInt} autoComplete="off" onChange={(val) => this.setState({status: 'change', charInt: val})}/> 号 |
| | |
| | | <div> |
| | | {photos.map((url, i) => ( |
| | | <Col key={i} span={col.span || 24}> |
| | | <MkPicture style={{paddingTop, backgroundSize: col.backgroundSize || 'cover'}} scale={scale} url={url} urls={photos}/> |
| | | <MkPicture lostTip={col.lostTip !== 'false'} style={{paddingTop, backgroundSize: col.backgroundSize || 'cover'}} scale={scale} url={url} urls={photos}/> |
| | | </Col> |
| | | ))} |
| | | </div> |
| | |
| | | pageOptions = pageOptions.sort((a, b) => a - b) |
| | | } |
| | | |
| | | if (setting.maxPageSize) { |
| | | pageOptions = pageOptions.filter(item => item <= setting.maxPageSize) |
| | | } |
| | | |
| | | let allColumns = null |
| | | if (colsCtrls) { |
| | | rowspans = null |
| | |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { return false } |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | const { config } = this.props |
| | | |
| | | if (config.checkBid && this.props.BID !== nextProps.BID) { |
| | | return true |
| | | } |
| | | return false |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新,清除快捷键设置 |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | let result = await Api.genericInterface(param, setting.js_script) |
| | | if (result.status) { |
| | | if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) { |
| | | let _pageIndex = Math.ceil(result.total / pageSize) |
| | |
| | | BID: id, |
| | | BData: data |
| | | }, () => { |
| | | if (!setting.checkBid) { |
| | | this.loadmaindata(true, 'true') |
| | | this.getStatFieldsValue() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | BID: id, |
| | | BData: data |
| | | }, () => { |
| | | if (!setting.checkBid) { |
| | | setTimeout(() => { |
| | | this.loadmaindata(true, 'true') |
| | | }, setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | |
| | | this.node.blur() |
| | | |
| | | if (config.enter === '$noAct') return |
| | | if (/\$noAct/.test(config.enter)) return |
| | | |
| | | if (/\$next/.test(config.enter)) { |
| | | MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', '')) |
| | |
| | | |
| | | this.props.onChange(values) |
| | | |
| | | if (config.enter === '$noAct') return |
| | | if (/\$noAct/.test(config.enter)) return |
| | | |
| | | if (/\$next/.test(config.enter)) { |
| | | MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', '')) |
| | |
| | | |
| | | this.props.onChange(values, val) |
| | | |
| | | if (config.enter === '$noActX') return |
| | | |
| | | this.node.blur() |
| | | |
| | | if (config.enter === '$noAct') return |
| | | if (/\$noAct/.test(config.enter)) return |
| | | |
| | | setTimeout(() => { |
| | | if (/\$next/.test(config.enter)) { |
| | |
| | | const { config, lineId } = this.props |
| | | |
| | | if (config.$ctrl) { |
| | | MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid) |
| | | MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid, true) |
| | | } |
| | | |
| | | setTimeout(() => { |
| | |
| | | |
| | | this.node.blur() |
| | | |
| | | if (config.enter === '$noAct') return |
| | | if (/\$noAct/.test(config.enter)) return |
| | | |
| | | if (/\$next/.test(config.enter)) { |
| | | MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', '')) |
| | |
| | | |
| | | this.node.blur() |
| | | |
| | | if (config.enter === '$noAct') return |
| | | if (/\$noAct/.test(config.enter)) return |
| | | |
| | | setTimeout(() => { |
| | | if (/\$next/.test(config.enter)) { |
| | |
| | | pageOptions = pageOptions.sort((a, b) => a - b) |
| | | } |
| | | |
| | | if (setting.maxPageSize) { |
| | | pageOptions = pageOptions.filter(item => item <= setting.maxPageSize) |
| | | } |
| | | |
| | | let allColumns = null |
| | | if (colsCtrls) { |
| | | allColumns = [..._columns] |
| | |
| | | MKEmitter.removeListener('changeRecord' + tableId, this.changeRecord) |
| | | } |
| | | |
| | | colBlur = (lineId) => { |
| | | colBlur = (lineId, colId, defer) => { |
| | | if (defer && this.focusId === lineId && this.colId !== colId) { |
| | | return |
| | | } |
| | | |
| | | this.blurId = lineId |
| | | this.focusId = '' |
| | | |
| | |
| | | |
| | | this.props.onBlur && this.props.onBlur() |
| | | |
| | | if (config.enter === '$noAct') return |
| | | if (/\$noAct/.test(config.enter)) return |
| | | |
| | | setTimeout(() => { |
| | | if (/\$next/.test(config.enter)) { |
| | |
| | | BID: id, |
| | | BData: data |
| | | }, () => { |
| | | if (!setting.checkBid) { |
| | | this.loadmaindata(true, 'true') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | item.type = 'card' |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | if (item.search) { |
| | | Utils.initSearchVal(item) |
| | | |
| | | item.$searches = Utils.initMainSearch(item.search) |
| | | } |
| | | |
| | | if (item.wrap && item.wrap.supType === 'multi') { // 数据卡多上级组件 |
| | | item.setting.supModule = item.supNodes[0].componentId |
| | | } else if (item.setting && item.setting.supModule && typeof(item.setting.supModule) !== 'string') { |
| | |
| | | } else { |
| | | item.setting.supModule = '' |
| | | } |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | if (item.search) { |
| | | Utils.initSearchVal(item) |
| | | |
| | | item.$searches = Utils.initMainSearch(item.search) |
| | | } |
| | | |
| | | let pass = skip |
| | |
| | | } |
| | | |
| | | if (cell.verify && cell.verify.preHandle === 'true') { |
| | | let script = cell.verify.pre_func |
| | | if (!/#position-/.test(script) || /#position-init/.test(script)) { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('btn', 'systemType', cell.verify.pre_func) |
| | | func(cell, window.GLOB.systemType) |
| | | let func = new Function('btn', 'position', 'systemType', script) |
| | | func(cell, 'init', window.GLOB.systemType) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | if (/#position-inner/.test(script)) { |
| | | cell.$innerScript = script |
| | | } |
| | | if (/#position-outer/.test(script)) { |
| | | cell.$outerScript = script |
| | | } |
| | | if (/#position-callback/.test(script)) { |
| | | cell.$callbackScript = script |
| | | } |
| | | } |
| | | |
| | | if (cell.syncComponentId) { |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | |
| | | top: calc(50vh - 70px); |
| | | } |
| | | |
| | | .common-table-copy { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 65px; |
| | | right: 30px; |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | .ant-btn-link:hover { |
| | | opacity: 0.8; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | if (item.search) { |
| | | Utils.initSearchVal(item) |
| | | |
| | | item.$searches = Utils.initMainSearch(item.search) |
| | | } |
| | | |
| | | if (item.wrap && item.wrap.supType === 'multi') { // 数据卡多上级组件 |
| | | item.setting.supModule = item.supNodes[0].componentId |
| | | } else if (item.setting && item.setting.supModule && typeof(item.setting.supModule) !== 'string') { |
| | |
| | | } else { |
| | | item.setting.supModule = '' |
| | | } |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | if (item.search) { |
| | | Utils.initSearchVal(item) |
| | | |
| | | item.$searches = Utils.initMainSearch(item.search) |
| | | } |
| | | |
| | | // 权限过滤 |
| | |
| | | } |
| | | |
| | | if (cell.verify && cell.verify.preHandle === 'true') { |
| | | let script = cell.verify.pre_func |
| | | if (!/#position-/.test(script) || /#position-init/.test(script)) { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('btn', 'systemType', cell.verify.pre_func) |
| | | func(cell, window.GLOB.systemType) |
| | | let func = new Function('btn', 'position', 'systemType', script) |
| | | func(cell, 'init', window.GLOB.systemType) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | if (/#position-inner/.test(script)) { |
| | | cell.$innerScript = script |
| | | } |
| | | if (/#position-outer/.test(script)) { |
| | | cell.$outerScript = script |
| | | } |
| | | if (/#position-callback/.test(script)) { |
| | | cell.$callbackScript = script |
| | | } |
| | | } |
| | | |
| | | if (cell.syncComponentId) { |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | |
| | | top: calc(50vh - 70px); |
| | | } |
| | | |
| | | .common-table-copy { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 65px; |
| | | right: 30px; |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | .ant-btn-link:hover { |
| | | opacity: 0.8; |
| | | } |
| | |
| | | import moment from 'moment' |
| | | import JsPDF from 'jspdf' |
| | | |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | |
| | |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | getInnerData = (params) => { |
| | | let param = params.shift() |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.downloadZipImage(res.data, this.props.btn.urlkey).then((res) => { |
| | | if (params.length === 0) { |
| | | if (res) { |
| | | this.execError({ErrCode: res}) |
| | | } else { |
| | | this.execSuccess() |
| | | } |
| | | } else { |
| | | this.getInnerData(params) |
| | | } |
| | | }, (err) => { |
| | | if (params.length === 0) { |
| | | this.execError({ErrCode: err}) |
| | | } else { |
| | | this.getInnerData(params) |
| | | } |
| | | }) |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | const FuncZip = asyncComponent(() => import('./funczip')) |
| | | const EditLine = asyncComponent(() => import('./editLine')) |
| | | const ExportPdf = asyncComponent(() => import('./exportPdf')) |
| | | const ShareLink = asyncComponent(() => import('./shareLink')) |
| | | |
| | | class ActionList extends Component { |
| | | static propTpyes = { |
| | |
| | | btn={item} |
| | | /> |
| | | ) |
| | | } else if (item.funcType === 'shareLink') { |
| | | return ( |
| | | <ShareLink |
| | | key={item.uuid} |
| | | BID={BID} |
| | | btn={item} |
| | | selectedData={selectedData} |
| | | /> |
| | | ) |
| | | } else if (item.funcType === 'addline' || item.funcType === 'delline') { |
| | | return ( |
| | | <EditLine |
| | |
| | | |
| | | if (btn.intertype === 'system') { |
| | | params = this.getSystemParam(data, formdata) |
| | | if (btn.returnValue === 'true') { |
| | | params = params.map(item => { |
| | | item.script_type = 'Y' |
| | | return item |
| | | }) |
| | | } |
| | | } else { |
| | | params = this.getInnerParam(data, formdata) |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | Api.genericInterface(param, btn.$innerScript, 'inner').then(res => { |
| | | record.mk_api_key = res.mk_api_key || '' |
| | | |
| | | if (res.status) { |
| | |
| | | param.menuname = param.menuname + '(回调)' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | Api.genericInterface(param, btn.$callbackScript, 'callback').then(res => { |
| | | if (res.status) { |
| | | this.triggerNote(res, param.ID) // 消息 |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | Api.genericInterface(param, btn.$innerScript, 'inner').then(res => { |
| | | if (res.status) { |
| | | if ((res.mk_ex_invoke === 'false' || res.mk_ex_invoke === false) && params.length === 0) { |
| | | this.execSuccess(res) |
| | |
| | | } |
| | | } |
| | | |
| | | Api.genericInterface(result).then(res => { |
| | | Api.genericInterface(result, btn.$outerScript, 'outer').then(res => { |
| | | if (!res) return // LoginError时中断请求 |
| | | if (ver_token && res.ErrCode === 'token_error') { |
| | | res.ErrCode = 'E' |
| | |
| | | param.menuname = param.menuname + '(回调)' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | Api.genericInterface(param, btn.$callbackScript, 'callback').then(res => { |
| | | if (res.status) { |
| | | this.triggerNote(res, param.ID) // 消息 |
| | | |
| | |
| | | const { autoMatic } = this.state |
| | | |
| | | if (btn.resetForms) { |
| | | MKEmitter.emit('resetForms', btn.uuid) |
| | | let data = {} |
| | | |
| | | Object.keys(res).forEach(key => { |
| | | data[key.toLowerCase()] = res[key] |
| | | }) |
| | | |
| | | delete data.errcode |
| | | delete data.errmesg |
| | | delete data.message |
| | | delete data.status |
| | | |
| | | MKEmitter.emit('resetForms', btn.uuid, data) |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'resetData', btn, null, null, data) |
| | | } |
| | | |
| | | if (this.preCallback) { |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | |
| | | if (btn.formCache === 'clear') { // 清除表单缓存 |
| | | window.GLOB.CacheMap = new Map() |
| | | } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId, 'table') |
| | | return |
| | |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | | if (btn.syncDelay) { |
| | | this.delayTimer && clearTimeout(this.delayTimer) |
| | | this.delayTimer = setTimeout(() => { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | }, btn.syncDelay) |
| | | } else { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, notification, message, Modal } from 'antd' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | |
| | | // import './index.scss' |
| | | |
| | | class ShareLink extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.string, |
| | | btn: PropTypes.object, |
| | | selectedData: PropTypes.any |
| | | } |
| | | |
| | | state = { |
| | | loading: false |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('triggerBtnId', this.actionTrigger) |
| | | } |
| | | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId) => { |
| | | const { btn, BID, selectedData } = this.props |
| | | const { loading } = this.state |
| | | |
| | | if (loading) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | |
| | | if (window.GLOB.systemType === 'production' && !btn.shareProUrl) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未设置正式系统链接地址!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let bid = BID || '' |
| | | let id = '' |
| | | if (selectedData && selectedData[0]) { |
| | | id = selectedData[0].$$uuid || '' |
| | | } |
| | | |
| | | let url = btn.shareUrl |
| | | if (window.GLOB.systemType === 'production') { |
| | | url = btn.shareProUrl |
| | | } |
| | | |
| | | url = url.replace(/@BID@/ig, bid).replace(/@ID@/ig, id) |
| | | |
| | | if (btn.shortUrl === 'true') { |
| | | this.setState({ |
| | | loading: true |
| | | }, () => { |
| | | this.getShortUrl(url) |
| | | }) |
| | | } else { |
| | | this.copyUrl(url) |
| | | } |
| | | } |
| | | |
| | | getShortUrl = (url) => { |
| | | let _rduri = window.atob('aHR0cHM6Ly9lcGMubWs5aC5$mkjbi93ZWJhcGkvZG9zdGFycw=='.replace(/\$mk/ig, '')) |
| | | let _id = window.atob('YmgwYmFwYWJ0ZDQ1ZXBz$mkZ3JhNzlzZWdiY2g2YzFpYms='.replace(/\$mk/ig, '')) |
| | | |
| | | let param = { |
| | | func: 's_url_db_adduptdel', |
| | | appkey: window.GLOB.appkey, |
| | | userid: _id, |
| | | LoginUID: _id, |
| | | type: 'add_only', |
| | | validity: 15, |
| | | linkurl: url, |
| | | nonc: '' + new Date().getTime(), |
| | | id: md5(url + window.GLOB.appkey) |
| | | } |
| | | |
| | | let keys = Object.keys(param).sort() |
| | | let values = '' |
| | | keys.forEach(key => { |
| | | values += key + param[key] |
| | | }) |
| | | param.sign = md5(values) |
| | | param.t = new Date().getTime() |
| | | |
| | | Api.directRequest({ |
| | | url: _rduri + '/s_url_db_adduptdel', |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | }).then(res => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | |
| | | if (res.status && res.id) { |
| | | this.copyUrl('https://mk9h.cn/m.asp?m=' + res.id) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message || '链接生成失败!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | copyUrl = (url) => { |
| | | const { btn } = this.props |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = url |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | |
| | | if (btn.shareTip) { |
| | | Modal.success({ |
| | | title: btn.shareTip |
| | | }) |
| | | } else { |
| | | message.success('已复制到剪切板。') |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { btn } = this.props |
| | | const { loading } = this.state |
| | | |
| | | let label = '' |
| | | let icon = '' |
| | | let type = 'link' |
| | | let className = '' |
| | | let style = {...btn.style} |
| | | |
| | | if (btn.show === 'button') { |
| | | label = btn.label |
| | | icon = btn.icon || '' |
| | | } else if (btn.show === 'link') { |
| | | label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | icon = '' |
| | | } else if (btn.show === 'icon') { |
| | | icon = btn.icon || '' |
| | | } else if (!btn.$toolbtn) { |
| | | icon = btn.icon || '' |
| | | label = btn.label |
| | | className = 'mk-btn mk-' + btn.class |
| | | } else { |
| | | type = '' |
| | | icon = btn.icon || '' |
| | | label = btn.label |
| | | className = 'mk-btn mk-' + btn.class |
| | | } |
| | | |
| | | return ( |
| | | <Button |
| | | type={type} |
| | | title={btn.show === 'icon' ? btn.label : ''} |
| | | style={style} |
| | | loading={loading} |
| | | icon={icon} |
| | | className={className} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | >{label}</Button> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ShareLink |
| | |
| | | send_type: '', |
| | | timestamp: '', |
| | | n_id: '', |
| | | focusId: '' |
| | | focusId: '', |
| | | reFocusId: '' |
| | | } |
| | | |
| | | record = {} |
| | |
| | | focusItem = fieldMap.get(action.setting.focus) |
| | | } |
| | | |
| | | this.setState({ formlist, ID, focusId: focusItem ? focusItem.uuid : '' }, () => { |
| | | let reFocusItem = null |
| | | if (action.setting.refocus && fieldMap.has(action.setting.refocus)) { |
| | | reFocusItem = fieldMap.get(action.setting.refocus) |
| | | } |
| | | |
| | | this.setState({ |
| | | formlist, |
| | | ID, |
| | | focusId: focusItem ? focusItem.uuid : '', |
| | | reFocusId: reFocusItem ? reFocusItem.uuid : '' |
| | | }, () => { |
| | | if (unload) return |
| | | |
| | | if (focusItem) { |
| | | if (focusItem.type === 'text' || focusItem.type === 'number') { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', focusItem.uuid) |
| | | }, 50) |
| | | }, 20) |
| | | } else { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', focusItem.uuid) |
| | |
| | | MKEmitter.removeListener('resetForms', this.resetForms) |
| | | } |
| | | |
| | | resetForms = (id) => { |
| | | resetForms = (id, data) => { |
| | | const { action } = this.props |
| | | const { focusId } = this.state |
| | | const { focusId, reFocusId } = this.state |
| | | |
| | | if (id !== action.uuid) return |
| | | |
| | |
| | | if (item.type !== 'text' && item.type !== 'number') return item |
| | | |
| | | if (resetForms.includes(item.field)) { |
| | | let key = item.field.toLowerCase() |
| | | if (typeof(data[key]) !== 'undefined') { |
| | | item.initval = data[key] |
| | | this.record[item.field] = data[key] |
| | | } else { |
| | | item.initval = item.orgval |
| | | this.record[item.field] = item.orgval |
| | | } |
| | | } |
| | | |
| | | return item |
| | |
| | | }) |
| | | }) |
| | | |
| | | if (focusId || this.submitId) { |
| | | if (reFocusId || focusId || this.submitId) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', this.submitId || focusId) |
| | | }, 50) |
| | | MKEmitter.emit('mkFC', 'focus', this.submitId || reFocusId || focusId) |
| | | }, 20) |
| | | } |
| | | } |
| | | |
| | |
| | | return ( |
| | | <div className="picture-col"> |
| | | {photos.map((url, i) => (<Col key={i} span={item.span || 24}> |
| | | <MkPicture style={style} scale={scale} url={url} urls={photos}/> |
| | | <MkPicture lostTip={item.lostTip !== 'false'} style={style} scale={scale} url={url} urls={photos}/> |
| | | </Col>))} |
| | | </div> |
| | | ) |
| | |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id,用于查询下拉选择项 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | BID: PropTypes.any, |
| | | config: PropTypes.object |
| | | } |
| | | |
| | | state = { |
| | |
| | | item.advanced = false |
| | | } |
| | | |
| | | if (item.checkShift && !item.initval) { |
| | | let d = '' |
| | | if (window.GLOB.CacheData.has(item.$supId)) { |
| | | d = window.GLOB.CacheData.get(item.$supId) |
| | | d = d[item.dateShift] || '' |
| | | if (d) { |
| | | d = moment(d).format('YYYY-MM-DD') |
| | | d = d === 'Invalid date' ? '' : d |
| | | } |
| | | } |
| | | |
| | | if (d) { |
| | | if (item.type === 'daterange') { |
| | | if (item.$initval === 'week') { |
| | | item.initval = [moment(d).startOf('week').format(item.format), moment(d).endOf('week').format(item.format)].join(',') |
| | | } else if (item.$initval === 'month') { |
| | | item.initval = [moment(d).startOf('month').format(item.format), moment(d).endOf('month').format(item.format)].join(',') |
| | | } else if (item.$initval === 'lastMonth') { |
| | | item.initval = [moment(d).subtract(1, 'months').startOf('month').format(item.format), moment(d).subtract(1, 'months').endOf('month').format(item.format)].join(',') |
| | | } else { |
| | | try { |
| | | let _initval = JSON.parse(item.$initval) |
| | | let _vals = [moment(d).subtract(_initval[0], 'days').format(item.format), moment(d).subtract(_initval[1], 'days').format(item.format)] |
| | | item.initval = _vals.join(',') |
| | | } catch (e) { |
| | | item.initval = '' |
| | | } |
| | | } |
| | | } else { |
| | | item.initval = moment(d).subtract(item.$initval, 'month').format('YYYY-MM') |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'group') { |
| | | record[item.field] = item.initType |
| | | record[item.datefield] = item.initval |
| | |
| | | if (item.resourceType === '1' && item.dataSource) { |
| | | let _option = Utils.getSelectQueryOptions(item) |
| | | |
| | | let exec = true |
| | | if (item.checkBid) { |
| | | item.sql = _option.sql |
| | | item.arr_field = _option.field |
| | | |
| | | exec = !!BID |
| | | } |
| | | |
| | | if (exec) { |
| | | _option.sql = _option.sql.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | |
| | | if (window.GLOB.debugger === true) { |
| | |
| | | mainItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql.replace(/%/ig, ' mpercent ')))}' as LText`) |
| | | } else { |
| | | localItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql.replace(/%/ig, ' mpercent ')))}' as LText`) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | searchlist: _list |
| | | }, () => { |
| | | if (!window.GLOB.mkHS && window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | this.improveSimpleSearch(deForms) |
| | | this.improveSimpleSearch(deForms, false) |
| | | } else if (mainItems.length > 0 || localItems.length > 0) { |
| | | this.improveSearch(mainItems, localItems) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | const { config, BID } = this.props |
| | | |
| | | if (config.checkBid && nextProps.BID !== BID) { |
| | | this.resetOptions(nextProps.BID) |
| | | } |
| | | } |
| | | |
| | | resetOptions = (BID) => { |
| | | let deForms = [] |
| | | let searchlist = fromJS(this.state.searchlist).toJS().map(item => { |
| | | if (item.checkBid) { |
| | | let sql = item.sql.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(sql) |
| | | } |
| | | |
| | | deForms.push({ |
| | | ...item, |
| | | arr_field: item.arr_field, |
| | | data_sql: Utils.formatOptions(sql) |
| | | }) |
| | | } else if (item.checkShift) { |
| | | let d = '' |
| | | if (window.GLOB.CacheData.has(item.$supId)) { |
| | | d = window.GLOB.CacheData.get(item.$supId) |
| | | d = d[item.dateShift] || '' |
| | | if (d) { |
| | | d = moment(d).format('YYYY-MM-DD') |
| | | d = d === 'Invalid date' ? '' : d |
| | | } |
| | | } |
| | | |
| | | if (d) { |
| | | if (item.type === 'daterange') { |
| | | if (item.$initval === 'week') { |
| | | item.initval = [moment(d).startOf('week').format(item.format), moment(d).endOf('week').format(item.format)].join(',') |
| | | } else if (item.$initval === 'month') { |
| | | item.initval = [moment(d).startOf('month').format(item.format), moment(d).endOf('month').format(item.format)].join(',') |
| | | } else if (item.$initval === 'lastMonth') { |
| | | item.initval = [moment(d).subtract(1, 'months').startOf('month').format(item.format), moment(d).subtract(1, 'months').endOf('month').format(item.format)].join(',') |
| | | } else { |
| | | try { |
| | | let _initval = JSON.parse(item.$initval) |
| | | let _vals = [moment(d).subtract(_initval[0], 'days').format(item.format), moment(d).subtract(_initval[1], 'days').format(item.format)] |
| | | item.initval = _vals.join(',') |
| | | } catch (e) { |
| | | item.initval = '' |
| | | } |
| | | } |
| | | } else { |
| | | item.initval = moment(d).subtract(item.$initval, 'month').format('YYYY-MM') |
| | | } |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | if (deForms.length > 0) { |
| | | this.improveSimpleSearch(deForms, true, searchlist) |
| | | } else { |
| | | this.setState({ |
| | | searchlist: searchlist |
| | | }) |
| | | |
| | | setTimeout(() => { |
| | | this.handleSubmit() |
| | | }, 20) |
| | | } |
| | | } |
| | | |
| | | resetCheckcard = (item) => { |
| | |
| | | delete result.message |
| | | delete result.status |
| | | |
| | | this.resetSearch(result) |
| | | this.resetSearch(result, false) |
| | | }) |
| | | } |
| | | |
| | | // 测试系统单个请求下拉选项 |
| | | improveSimpleSearch = (deForms) => { |
| | | improveSimpleSearch = (deForms, trigger, searchlist) => { |
| | | if (deForms.length === 0) return |
| | | |
| | | let deffers = deForms.map((item, index) => { |
| | |
| | | delete result.message |
| | | delete result.status |
| | | |
| | | this.resetSearch(result) |
| | | this.resetSearch(result, trigger, searchlist) |
| | | }) |
| | | } |
| | | |
| | | resetSearch = (result) => { |
| | | let trigger = false |
| | | let _searchlist = fromJS(this.state.searchlist).toJS().map(item => { |
| | | resetSearch = (result, submit, searchlist) => { |
| | | let trigger = submit |
| | | let _searchlist = fromJS(searchlist || this.state.searchlist).toJS().map(item => { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = [] |
| | | let map = new Map() |
| | |
| | | item.options = item.oriOptions |
| | | } |
| | | |
| | | if (item.$first && item.options.length > 0) { |
| | | if (item.$first) { |
| | | if (item.options.length > 0) { |
| | | item.initval = item.options[0].Value |
| | | trigger = true |
| | | } else { |
| | | item.initval = '' |
| | | } |
| | | } |
| | | |
| | | return item |
| | |
| | | if (trigger) { |
| | | setTimeout(() => { |
| | | this.handleSubmit() |
| | | }, 10) |
| | | }, 20) |
| | | } |
| | | } |
| | | |
| | |
| | | } else if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect') { |
| | | content = (<MKSelect config={item} onChange={(val, defer) => this.recordChange(val, defer, item)} />) |
| | | } else if (item.type === 'date' || item.type === 'datemonth' || item.type === 'dateweek' || item.type === 'daterange') { |
| | | content = (<MKDatePicker config={item} onChange={(val) => this.recordChange(val, false, item)} />) |
| | | content = (<MKDatePicker config={item} onChange={(val, defer) => this.recordChange(val, defer, item)} />) |
| | | } else if (item.type === 'group') { |
| | | field = item.datefield |
| | | content = <DateGroup position={index} config={item} onChange={(val, type) => this.dateGroupChange(val, type, item)} /> |
| | |
| | | const config = props.config |
| | | |
| | | let mode = 'date' |
| | | let format = 'YYYY-MM-DD' |
| | | let format = config.format || 'YYYY-MM-DD' |
| | | |
| | | if (config.type === 'datemonth') { |
| | | mode = 'month' |
| | | format = 'YYYY-MM' |
| | | } else if (config.type === 'week') { |
| | | mode = 'week' |
| | | format = 'YYYY-MM-DD' |
| | | } else { |
| | | if (config.type === 'daterange') { |
| | | } else if (config.type === 'daterange') { |
| | | mode = 'daterange' |
| | | } |
| | | if (config.precision === 'day') { |
| | | format = 'YYYY-MM-DD' |
| | | } else if (config.precision === 'hour') { |
| | | format = 'YYYY-MM-DD HH' |
| | | } else if (config.precision === 'minute') { |
| | | format = 'YYYY-MM-DD HH:mm' |
| | | } else if (config.precision === 'second') { |
| | | format = 'YYYY-MM-DD HH:mm:ss' |
| | | } |
| | | } |
| | | |
| | | let value = config.initval || null |
| | | |
| | | if (mode === 'daterange') { |
| | |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.props |
| | | |
| | | if (config.checkShift && nextProps.config.initval && nextProps.config.initval !== config.initval) { |
| | | let val = nextProps.config.initval.split(',') |
| | | |
| | | this.setState({ |
| | | value: [moment(val[0], config.format), moment(val[1], config.format)] |
| | | }) |
| | | |
| | | this.props.onChange(nextProps.config.initval, true) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | |
| | | if (_val && !_val[0]) { |
| | | _val = '' |
| | | } |
| | | this.props.onChange(_val ? `${moment(_val[0]).format(format)},${moment(_val[1]).format(format)}` : '') |
| | | this.props.onChange(_val ? `${moment(_val[0]).format(format)},${moment(_val[1]).format(format)}` : '', false) |
| | | } else { |
| | | this.props.onChange(val ? moment(val).format(format) : '') |
| | | this.props.onChange(val ? moment(val).format(format) : '', false) |
| | | } |
| | | } |
| | | |
| | |
| | | options: fromJS(nextProps.config.options).toJS() |
| | | }) |
| | | |
| | | if (config.$first && nextProps.config.initval) { |
| | | if (config.type !== 'multiselect') { |
| | | this.setState({ |
| | | value: nextProps.config.initval |
| | | }) |
| | | |
| | | this.props.onChange(nextProps.config.initval, true) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | }) |
| | | |
| | | let declare = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''` |
| | | let declare = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address=''` |
| | | |
| | | if (verify.defaultSql === 'false') { |
| | | _dataresource = '' |
| | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | | floor: PropTypes.any, // 是否为子表 |
| | | btnTab: PropTypes.any, // 表单标签页(按钮)参数 |
| | | config: PropTypes.any, // 表单标签页参数 |
| | | card: PropTypes.object, |
| | | columns: PropTypes.array |
| | |
| | | }) |
| | | |
| | | if (_customScript) { |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${declareSql} |
| | | ${_customScript} |
| | | ` |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'1949-10-01 15:00:00' |
| | | ` |
| | | } else if (_tailScript) { |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${declareSql} |
| | | ${_dataresource} |
| | | ${_tailScript} |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'1949-10-01 15:00:00' |
| | | ` |
| | | } else { |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${declareSql} |
| | | ${_dataresource}` |
| | | } |
| | |
| | | } |
| | | shows.push('linkField') |
| | | reRequired.linkField = false |
| | | } else if (type === 'daterange' || type === 'datemonth') { |
| | | if (this.record.initval) { |
| | | shows.push('dateShift') |
| | | } |
| | | } |
| | | |
| | | if (dateOptions.hasOwnProperty(type)) { // 根据搜索条件类型,选择初始值的类型及数据 |
| | |
| | | rules = [ |
| | | { required: item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | if (item.key === 'field' || item.key === 'datefield') { |
| | | if (item.key === 'field' || item.key === 'datefield' || item.key === 'dateShift') { |
| | | rules.push({ |
| | | pattern: (type === 'text' || type === 'select' || type === 'daterange') ? formRule.field.multipattern : formRule.field.pattern, |
| | | message: formRule.field.message |
| | |
| | | }) |
| | | |
| | | if (_customScript) { |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${_customScript} |
| | | ` |
| | | } |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,'1949-10-01 15:00:00' |
| | | ` |
| | | } else { |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | ${_dataresource}` |
| | | } |
| | | |
| | |
| | | _sql = _sql.replace(item.id, item.value) |
| | | }) |
| | | |
| | | _sql = _sql.replace(/,\n\s*/g, ',') |
| | | |
| | | this.setState({display: false, defaultVal: _sql}, () => { |
| | | this.setState({display: true}) |
| | | }) |
| | |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'dateShift', |
| | | label: '日期偏移', |
| | | initVal: card.dateShift || '', |
| | | tooltip: '可以填入上级字段,用于控制初始值,例如:上级字段值为2023-12-10,初始值为本月,则初始区间为 2023-12-01 ~ 2023-12-31。', |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'precision', |
| | | label: '精确度', |
| | |
| | | } else if (verify.accountdate === 'true' && !verify.accountfield) { |
| | | error = '开启账期时,需要选择验证公司!' |
| | | } else if (verify.preHandle === 'true' && !verify.pre_func) { |
| | | error = '开启按钮预处理时,需要填写处理函数!' |
| | | error = '开启自定义脚本时,需要填写处理函数!' |
| | | } else if (verify.wxNote === 'true') { |
| | | if (!verify.wxTemplateId) { |
| | | error = '开启公众号消息推送时,需要选择消息模板!' |
| | |
| | | <Col span={24}></Col> |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topRight" title="运行时修改按钮参数,入参为(btn, systemType)。注:systemType为系统类型,正式系统为production"> |
| | | <Tooltip placement="topRight" title="运行时修改按钮参数,入参为(btn, position, systemType),标记#position-(init,inner,outer,callback)"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 按钮预处理 |
| | | 自定义脚本 |
| | | </Tooltip> |
| | | }> |
| | | <Radio.Group value={verify.preHandle || 'false'} onChange={(e) => {this.onOptionChange(e.target.value, 'preHandle')}}> |
| | |
| | | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | | btnTab: PropTypes.any, // 表单标签页(按钮)参数 |
| | | config: PropTypes.any, // 表单标签页参数 |
| | | card: PropTypes.object, // 按钮信息 |
| | | columns: PropTypes.array |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { columns, config, card, btnTab } = this.props |
| | | const { columns, config, card } = this.props |
| | | const { appType } = this.state |
| | | let _verify = fromJS(card.verify || {}).toJS() |
| | | |
| | |
| | | oriVerify: fromJS(_verify).toJS() |
| | | }) |
| | | |
| | | if (card.intertype === 'inner') { |
| | | return |
| | | } |
| | | if (card.intertype === 'inner') return |
| | | |
| | | new Promise(resolve => { |
| | | let _fields = [] |
| | | if (card.OpenType === 'form') { |
| | | _fields.push({ |
| | |
| | | label: card.label, |
| | | type: 'text' |
| | | }) |
| | | resolve(_fields) |
| | | } else if (card.modal && (card.OpenType === 'pop' || !card.OpenType)) { |
| | | _fields = card.modal.fields || [] |
| | | resolve(_fields) |
| | | // } else if (card.OpenType === 'pop') { |
| | | // Api.getCloudConfig({ |
| | | // func: 'sPC_Get_LongParam', |
| | | // MenuID: card.uuid |
| | | // }).then(res => { |
| | | // if (res.status) { |
| | | // let _LongParam = '' |
| | | // if (res.LongParam) { |
| | | // try { |
| | | // _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | // } catch (e) { |
| | | // console.warn('Parse Failure') |
| | | // _LongParam = '' |
| | | // } |
| | | // } |
| | | |
| | | // if (!_LongParam) { |
| | | // message.warning('未获取到表单信息,部分验证将无法设置!') |
| | | // } else { |
| | | // _LongParam = updateForm(_LongParam) |
| | | // _fields = _LongParam.fields || [] |
| | | // } |
| | | // } else { |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: res.message, |
| | | // duration: 5 |
| | | // }) |
| | | // } |
| | | // resolve(_fields) |
| | | // }) |
| | | } else { |
| | | resolve(_fields) |
| | | } |
| | | }).then(_fields => { |
| | | |
| | | let _usefulfields = ['UserName', 'FullName', 'RoleID', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode', 'tbid', 'mk_deleted'] |
| | | let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)', '@RoleID nvarchar(512)', '@mk_departmentcode nvarchar(512)', '@mk_organization nvarchar(512)', '@mk_user_type nvarchar(20)', '@mk_nation nvarchar(50)', '@mk_province nvarchar(50)', '@mk_city nvarchar(50)', '@mk_district nvarchar(50)', '@mk_address nvarchar(100)', '@ErrorCode nvarchar(50)', '@retmsg nvarchar(4000)', '@BillCode nvarchar(50)', '@BVoucher nvarchar(50)', '@FIBVoucherDate nvarchar(50)', '@FiYear nvarchar(50)', '@ModularDetailCode nvarchar(50)', '@bid nvarchar(50)', '@tbid nvarchar(50)', '@mk_deleted int'] |
| | | let _select = ['@UserName=\'\'', '@FullName=\'\'', '@RoleID=\'\'', '@mk_departmentcode=\'\'', '@mk_organization=\'\'', '@mk_user_type=\'\'', '@mk_nation=\'\'', '@mk_province=\'\'', '@mk_city=\'\'', '@mk_district=\'\'', '@mk_address=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\'', '@bid=\'\'', '@mk_deleted=1'] |
| | |
| | | _fields.unshift({ uuid: 'BID', field: 'BID', label: 'BID', type: 'text' }) |
| | | } |
| | | |
| | | let hasColumn = false |
| | | if (columns && columns.length > 0) { |
| | | if (btnTab) { // 表单标签 |
| | | hasColumn = btnTab.Ot !== 'notRequired' |
| | | } else if (card.Ot !== 'notRequired') { |
| | | hasColumn = true |
| | | } |
| | | } |
| | | |
| | | let unionFields = fromJS(_fields).toJS() |
| | | let formArr = _fields.map(_f => _f.field.toLowerCase()) |
| | | |
| | | if (hasColumn) { |
| | | if (card.Ot !== 'notRequired' && columns) { |
| | | columns.forEach(_f => { |
| | | if (_f.field && !formArr.includes(_f.field.toLowerCase())) { |
| | | formArr.push(_f.field.toLowerCase()) |
| | | if (!_f.field) return |
| | | |
| | | let key = _f.field.toLowerCase() |
| | | |
| | | if (!formArr.includes(key)) { |
| | | formArr.push(key) |
| | | unionFields.push(_f) |
| | | } |
| | | if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return |
| | | |
| | | fieldArr.push(_f.field.toLowerCase()) |
| | | if (fieldArr.includes(key)) return |
| | | |
| | | fieldArr.push(key) |
| | | _usefulfields.push(_f.field) |
| | | |
| | | if (_f.datatype) { // 自定义字段 |
| | |
| | | unionFields, |
| | | uniqueFields |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | componentDidMount() { |
| | |
| | | } |
| | | |
| | | scriptsChange = (values) => { |
| | | const { columns, card } = this.props |
| | | |
| | | let verify = fromJS(this.state.verify).toJS() |
| | | |
| | | if (values.uuid) { |
| | |
| | | verify.scripts.push(values) |
| | | } |
| | | |
| | | if (/@bvoucher(\s|\))/ig.test(values.sql)) { |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | |
| | | } else if (card.Ot !== 'notRequired' && columns) { |
| | | let hasvoucher = false |
| | | columns.forEach(_f => { |
| | | if (!_f.field) return |
| | | |
| | | if (_f.field.toLowerCase() === 'bvoucher') { |
| | | hasvoucher = true |
| | | } |
| | | }) |
| | | |
| | | if (!hasvoucher) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未启用创建凭证,且字段集中不存在凭证字段(bvoucher)。', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未启用创建凭证,且字段集中不存在凭证字段(bvoucher)。', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | MKEmitter.emit('editLineId', values.uuid) |
| | | |
| | | this.setState({ verify }) |
| | |
| | | import nortable from '@/assets/img/normaltable.jpg' |
| | | // import mainsubtable from '@/assets/img/mainsubtable.jpg' |
| | | // import treepage from '@/assets/img/treepage.jpg' |
| | | import customImg from '@/assets/img/custom.jpg' |
| | | import newpage from '@/assets/img/newpage.jpg' |
| | | import rolemanage from '@/assets/img/rolemanage.jpg' |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (['pop', 'prompt', 'exec'].includes(cell.OpenType) && cell.verify && !cell.output) { |
| | | if (cell.verify.noteEnable === 'true') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值短信发送无效!`}) |
| | | } else if (cell.verify.emailEnable === 'true') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (card.$c_ac) { |
| | |
| | | } else { |
| | | param.$token = setting.exInterface || '' |
| | | } |
| | | } else if (setting.sysInterface === 'custom') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | param.rduri = setting.proInterface |
| | | } else { |
| | | param.rduri = setting.interface |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && setting.proInterface) { |
| | | param.rduri = setting.proInterface |
| | |
| | | param.menuname = setting.$name |
| | | } |
| | | |
| | | param.custom_script = Utils.formatOptions(_customScript) |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.DateCount = Utils.formatOptions(DateCount) |
| | | param.custom_script = Utils.formatOptions(_customScript, param.exec_type) |
| | | param.LText = Utils.formatOptions(LText, param.exec_type) |
| | | param.DateCount = Utils.formatOptions(DateCount, param.exec_type) |
| | | |
| | | if (setting.sub_field) { |
| | | param.sub_name = setting.subdata |
| | |
| | | param.s_debug_type = 'Y' |
| | | } |
| | | |
| | | if (window.GLOB.forcedUpdate) { |
| | | param.s_version_up = 'true' |
| | | } |
| | | |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | |
| | |
| | | if (setting.tableName === 's_custom_script' && window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (window.GLOB.forcedUpdate) { |
| | | param.s_version_up = 'true' |
| | | } |
| | | |
| | | return param |
| | |
| | | |
| | | /** |
| | | * @description 生成sPC_Get_structured_data请求参数 |
| | | * 1、把大接口sPC_Get_structured_data的ltext拆成三份,第一段:@LText1,第二段@LText,第三段@LText2 |
| | | */ |
| | | export function getStructuredParams (params, config, BID) { |
| | | let LText_field = [] |
| | |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_structured_data', |
| | | LText: _LText.join(' union all '), |
| | | LText_field: LText_field.join(' union all '), |
| | | BID: BID, |
| | | username: sessionStorage.getItem('User_Name') || '', |
| | | fullName: sessionStorage.getItem('Full_Name') || '' |
| | |
| | | param.menuname = config.MenuName |
| | | } |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | | param.LText1 = LText1 |
| | | param.LText = LText |
| | | param.LText2 = LText2 |
| | | param.LText_field = Utils.formatOptions(param.LText_field) |
| | | param.exec_type = 'y' |
| | | param.LText = Utils.formatOptions(_LText.join(' union all ')) |
| | | param.custom_script = Utils.formatOptions(LText_field.join(' union all ')) |
| | | // param.LText1 = LText1 |
| | | // param.LText = LText |
| | | // param.LText2 = LText2 |
| | | // param.LText_field = Utils.formatOptions(param.LText_field) |
| | | |
| | | if (config.cacheUseful === 'true') { |
| | | param.time_type = config.timeUnit |
| | |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | return param |
| | | } |
| | |
| | | import React from 'react' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | // import NodeRSA from 'node-rsa' |
| | | |
| | | const formatKeys = [ |
| | | { key: 'select', value: ' msltk ' }, |
| | |
| | | * @description sql加密 |
| | | * @return {String} value |
| | | */ |
| | | static formatOptions (value) { |
| | | static formatOptions (value, exec_type = '') { |
| | | if (!value) return '' |
| | | |
| | | let salt = 'minKe' // 盐值 |
| | | |
| | | value = value.replace(/\n/ig, ' \n ') |
| | | // 替换关键字 |
| | |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | value = value.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | | } |
| | | |
| | | // if (exec_type === 'x') { |
| | | // // let publicKey = `-----BEGIN PUBLIC KEY----- |
| | | // // MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwGxFURiCrk5a2xfWuM3W |
| | | // // 2lkS3ioZhUFXpkK1inMivItsA/J8MTaBB3EAVxC29xdVCU+xOzs512PuD2b1sjzX |
| | | // // jwO6kx433NtB2okqGiP4RkzhEJHwdyc9dPUKdjirDznUWI9R7WayAf5Z4COhMsj2 |
| | | // // IbkyJgkb6Ivn0UgU0GSWc92HqJJmnb3Ti2gk6A2+oybz2RE3+xB/yOaNu3xav4yi |
| | | // // xxo6harVLNBiaU+D7aDed1W3kE20gLOnEAvcLMjpe3n/QvF5RtELsm3T+vH3TIT2 |
| | | // // GI9+8cT20NZ2d7i41+j/AQZiPJNS3MVmc3aIhuyCOsNPLmvbZZi1KPSJIqkCwdEg |
| | | // // mQIDAQAB |
| | | // // -----END PUBLIC KEY-----` |
| | | |
| | | // // let pubKey = new NodeRSA(publicKey, 'pkcs8-public') |
| | | |
| | | // // value = window.encodeURIComponent(value) |
| | | // // value = pubKey.encrypt(value, 'base64') |
| | | |
| | | // // const priKey = new NodeRSA(privateKey, 'pkcs8-private') |
| | | // // const res = priKey.decrypt(value, 'utf8') |
| | | // } else { |
| | | // encode编码(中文字符超出base64加密范围) |
| | | // let str = window.encodeURIComponent(value) |
| | | |
| | | // if (str.length % 3 === 1) { |
| | | // str += '%2F*123*%2F' |
| | | // } else if (str.length % 3 === 2) { |
| | | // str += '%2F*12*%2F' |
| | | // } |
| | | |
| | | value = window.btoa(window.encodeURIComponent(value)) |
| | | // 插入字符 |
| | | let salt = 'minKe' // 盐值 |
| | | let index = Math.floor(value.length / 2) |
| | | value = value.slice(0, index) + salt + value.slice(index) |
| | | // base64加密 |
| | | value = window.btoa(value) |
| | | // } |
| | | |
| | | return value |
| | | } |
| | |
| | | |
| | | // return value |
| | | // } |
| | | |
| | | /** |
| | | * @description sPC_TableData_InUpDe sql加密 |
| | | * @return {String} value |
| | | */ |
| | | static sPCInUpDeFormatOptions (value) { |
| | | if (!value) return {LText: '', LText1: '', LText2: ''} |
| | | let salt = 'minKe' // 盐值 |
| | | |
| | | value = value.replace(/\n/ig, ' \n ') |
| | | // 替换关键字 |
| | | formatKeys.forEach(item => { |
| | | let reg = new RegExp('(^|\\s)' + item.key + '(\\s|$)', 'ig') |
| | | value = value.replace(reg, item.value) |
| | | }) |
| | | |
| | | // 1、替换%符(数据库中解析后sql报错) |
| | | value = value.replace(/%/ig, ' mpercent ') |
| | | // 外联数据库替换 |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | value = value.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | | } |
| | | |
| | | let encodesql = (val) => { |
| | | if (!val) return '' |
| | | |
| | | let _value = window.btoa(window.encodeURIComponent(val)) |
| | | |
| | | // 插入字符 |
| | | let index = Math.floor(_value.length / 2) |
| | | _value = _value.slice(0, index) + salt + _value.slice(index) |
| | | |
| | | // base64加密 |
| | | return window.btoa(_value) |
| | | } |
| | | |
| | | let len = value.length |
| | | // 注:LText 与 LText1 顺序颠倒 |
| | | if (len > 1000) { |
| | | let limit = Math.floor(len / 3) |
| | | return { |
| | | LText1: encodesql(value.substring(0, limit)), |
| | | LText: encodesql(value.substring(limit, limit * 2)), |
| | | LText2: encodesql(value.substring(limit * 2)) |
| | | } |
| | | } else { |
| | | return { |
| | | LText1: '', |
| | | LText: encodesql(value), |
| | | LText2: '' |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 初始化搜索条件初始值 |
| | |
| | | format = 'YYYY-MM-DD HH:mm:ss' |
| | | } |
| | | |
| | | item.format = format |
| | | item.initval = item.initval ? moment().subtract(item.initval, 'days').format(format) : '' |
| | | } else if (item.type === 'datemonth') { |
| | | item.initval = item.initval ? moment().subtract(item.initval, 'month').format('YYYY-MM') : '' |
| | | item.format = 'YYYY-MM' |
| | | |
| | | if (item.initval) { |
| | | if (!item.dateShift) { |
| | | item.initval = moment().subtract(item.initval, 'month').format('YYYY-MM') |
| | | } else { |
| | | item.$initval = item.initval |
| | | item.$supId = config.$pageId |
| | | if (config.setting && config.setting.supModule) { |
| | | item.$supId = config.setting.supModule |
| | | |
| | | config.checkBid = true |
| | | config.setting.checkBid = true |
| | | item.checkShift = true |
| | | } |
| | | |
| | | item.initval = '' |
| | | |
| | | let d = '' |
| | | if (window.GLOB.CacheData.has(item.$supId)) { |
| | | d = window.GLOB.CacheData.get(item.$supId) |
| | | d = d[item.dateShift] || '' |
| | | if (d) { |
| | | d = moment(d).format('YYYY-MM-DD') |
| | | d = d === 'Invalid date' ? '' : d |
| | | } |
| | | } |
| | | |
| | | if (d) { |
| | | item.initval = moment(d).subtract(item.initval, 'month').format('YYYY-MM') |
| | | } |
| | | } |
| | | } |
| | | } else if (item.type === 'dateweek') { |
| | | item.format = 'YYYY-MM-DD' |
| | | item.initval = item.initval ? moment().subtract(item.initval * 7, 'days').format('YYYY-MM-DD') : '' |
| | | } else if (item.type === 'daterange') { |
| | | let format = 'YYYY-MM-DD' |
| | |
| | | } else if (item.precision === 'second') { |
| | | format = 'YYYY-MM-DD HH:mm:ss' |
| | | } |
| | | |
| | | item.format = format |
| | | |
| | | if (item.initval) { |
| | | if (!item.dateShift) { |
| | | if (item.initval === 'week') { |
| | | item.initval = [moment().startOf('week').format(format), moment().endOf('week').format(format)].join(',') |
| | | } else if (item.initval === 'month') { |
| | |
| | | item.initval = _vals.join(',') |
| | | } catch (e) { |
| | | item.initval = '' |
| | | } |
| | | } |
| | | } else { |
| | | item.$initval = item.initval |
| | | item.$supId = config.$pageId |
| | | if (config.setting && config.setting.supModule) { |
| | | item.$supId = config.setting.supModule |
| | | |
| | | config.checkBid = true |
| | | config.setting.checkBid = true |
| | | item.checkShift = true |
| | | } |
| | | |
| | | item.initval = '' |
| | | |
| | | let d = '' |
| | | if (window.GLOB.CacheData.has(item.$supId)) { |
| | | d = window.GLOB.CacheData.get(item.$supId) |
| | | d = d[item.dateShift] || '' |
| | | if (d) { |
| | | d = moment(d).format('YYYY-MM-DD') |
| | | d = d === 'Invalid date' ? '' : d |
| | | } |
| | | } |
| | | |
| | | if (d) { |
| | | if (item.$initval === 'week') { |
| | | item.initval = [moment(d).startOf('week').format(format), moment(d).endOf('week').format(format)].join(',') |
| | | } else if (item.$initval === 'month') { |
| | | item.initval = [moment(d).startOf('month').format(format), moment(d).endOf('month').format(format)].join(',') |
| | | } else if (item.$initval === 'lastMonth') { |
| | | item.initval = [moment(d).subtract(1, 'months').startOf('month').format(format), moment(d).subtract(1, 'months').endOf('month').format(format)].join(',') |
| | | } else { |
| | | try { |
| | | let _initval = JSON.parse(item.$initval) |
| | | let _vals = [moment(d).subtract(_initval[0], 'days').format(format), moment(d).subtract(_initval[1], 'days').format(format)] |
| | | item.initval = _vals.join(',') |
| | | } catch (e) { |
| | | item.initval = '' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (item.type === 'group') { |
| | |
| | | item.initval = '' |
| | | item.initType = '' |
| | | } |
| | | } else if ((item.type === 'select' || item.type === 'link') && item.initval === '$first' && item.resourceType === '1') { |
| | | } else if ((item.type === 'select' || item.type === 'link') && item.resourceType === '1') { |
| | | if (/@BID@/ig.test(item.dataSource) && config.setting && config.setting.supModule) { |
| | | config.checkBid = true |
| | | config.setting.checkBid = true |
| | | item.checkBid = true |
| | | } |
| | | if (item.initval === '$first') { |
| | | item.initval = '' |
| | | item.$first = true |
| | | } |
| | | } |
| | | |
| | | item.oriInitval = item.initval |
| | |
| | | z_debug_end: select @ErrorCode='E',@retmsg='debug_end' goto aaa` |
| | | } |
| | | |
| | | if (retmsg) { |
| | | if (retmsg || btn.returnValue === 'true') { |
| | | _sql += ` |
| | | aaa: if @ErrorCode!='' |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@` |
| | |
| | | visible: false, |
| | | rePos: false, |
| | | loading: false, |
| | | auto: true |
| | | auto: true, |
| | | ismob: /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(navigator.userAgent) |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | sessionStorage.setItem('LoginUID', result.LoginUID || '') |
| | | sessionStorage.setItem('dataM', 'false') |
| | | |
| | | this.getMenuParam() |
| | | |
| | | // 获取系统信息 |
| | | let _param = { |
| | | func: 's_Get_style', |
| | |
| | | document.getElementsByTagName('head')[0].appendChild(link) |
| | | } |
| | | } |
| | | |
| | | this.getMenuParam() |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | |
| | | lostmsg: '抱歉,您访问的页面未启用,请联系管理员。' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (config.webTitle) { |
| | | document.title = config.webTitle |
| | | } |
| | | |
| | | config.style = config.style || {} |
| | |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_structured_data', |
| | | LText: LText.join(' union all '), |
| | | LText_field: LText_field.join(' union all '), |
| | | BID: BID || '', |
| | | username: userName, |
| | | fullName: fullName |
| | |
| | | param.menuname = MenuName |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText_field = Utils.formatOptions(param.LText_field) |
| | | param.exec_type = 'y' |
| | | param.LText = Utils.formatOptions(LText.join(' union all ')) |
| | | param.custom_script = Utils.formatOptions(LText_field.join(' union all ')) |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | return param |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { loadingview, viewlost, config, pages, auto, rePos, loading } = this.state |
| | | const { loadingview, viewlost, config, pages, auto, rePos, loading, ismob } = this.state |
| | | |
| | | return ( |
| | | <div className="bill-print-wrap" > |
| | |
| | | </div> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | {config && window.GLOB.breakpoint ? <DebugTable /> : null} |
| | | {pages && !loadingview && !viewlost ? <div className="print-button"><Button icon="printer" size="large" shape="circle" onClick={this.print}></Button></div> : null} |
| | | {!loadingview && !viewlost ? <div className="refresh-button"><Button icon="reload" size="large" shape="circle" onClick={this.reload}></Button></div> : null} |
| | | {pages && !loadingview && !viewlost && !ismob ? <div className="print-button"><Button icon="printer" size="large" shape="circle" onClick={this.print}></Button></div> : null} |
| | | {!loadingview && !viewlost && !ismob ? <div className="refresh-button"><Button icon="reload" size="large" shape="circle" onClick={this.reload}></Button></div> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | .header-menu.level4 { |
| | | li { |
| | | cursor: default; |
| | | &:hover { |
| | | span { |
| | | cursor: default; |
| | | color: rgba(255, 255, 255, 0.65); |
| | | border-bottom: none; |
| | | } |
| | | } |
| | | &.active { |
| | | span { |
| | | color: #ffffff; |
| | | border-bottom: 4px solid #1890ff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // .header-menu.level4 { |
| | | // li { |
| | | // cursor: default; |
| | | // &:hover { |
| | | // span { |
| | | // cursor: default; |
| | | // color: rgba(255, 255, 255, 0.65); |
| | | // border-bottom: none; |
| | | // } |
| | | // } |
| | | // &.active { |
| | | // span { |
| | | // color: #ffffff; |
| | | // border-bottom: 4px solid #1890ff; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | .header-setting { |
| | | float: right; |
| | |
| | | <Row> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="首页不进行权限控制。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 权限验证 |
| | | </Tooltip> |
| | | }> |
| | | <Radio.Group value={'false'} disabled={true}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="数据会缓存到用户本地,方便页面快速呈现。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 本地缓存 |
| | |
| | | })(<Input onChange={(e) => this.selectChange('callNo', e.target.value)}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="可自定义在浏览器标题栏中显示的网页标题。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 网页标题 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('webTitle', { |
| | | initialValue: config.webTitle || '' |
| | | })(<Input onChange={(e) => this.selectChange('webTitle', e.target.value)}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |