| | |
| | | WXMerchID -- 使用微信支付时,绑定的商户ID |
| | | WXNotice -- 是否开启明科云公众号消息提醒,值为 true 时开启,可通过明科云发送模板消息 |
| | | WXApps -- 存在多个公众号、小程序或商户时可使用微信APP列表,注意填写默认公众号、小程序与商户号,格式 [{"appId": "", "appName": "", "appType": "public/miniProgram/merchant"}] |
| | | debugger -- 值为 true 时开启调试模式,开启后移动端子应用中会有控制台 |
| | | devTools -- 值为 false 时不允许使用调试模式 |
| | | debugger -- 值为 true 时开启调试模式,开启后移动端子应用中会有控制台,值为 forbid 时,禁止系统打印脚本 |
| | | systemRun -- 系统接口的执行方式,值为 backend 时,在后端运行 |
| | | licenseKey -- 许可密钥,在内部网络中使用系统时,会跳过epc验证 |
| | | storeKey -- 电子档案本地授权码,使用本地许可密钥时有效 |
| | | probation -- 试用期(YYYY-MM-DD),在正式系统中,试用期内调用系统接口的脚本会记录下来 |
| | |
| | | "WXMerchID": "", |
| | | "WXNotice": "true", |
| | | "debugger": false, |
| | | "devTools": true, |
| | | "systemRun": "backend", |
| | | "licenseKey": "", |
| | | "storeKey": "", |
| | | "probation": "", |
| | |
| | | logout = () => { |
| | | const { dict } = this.state |
| | | // 退出登录 |
| | | let _this = this |
| | | let that = this |
| | | confirm({ |
| | | title: dict['logout_query'] || '您确定要退出吗?', |
| | | content: '', |
| | |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | sessionStorage.clear() |
| | | _this.props.history.replace('/login') |
| | | that.props.history.replace('/login') |
| | | window.location.reload() |
| | | }, |
| | | onCancel() {} |
| | |
| | | GLOB.memberLevel = 0 |
| | | } |
| | | |
| | | if (config.devTools === false) { |
| | | if (config.systemRun === 'backend') { |
| | | Object.defineProperty(window, 'backend', { |
| | | writable: false, |
| | | value: true |
| | | }) |
| | | } |
| | | if (config.debugger === 'forbid') { |
| | | sessionStorage.removeItem('breakpoint') |
| | | GLOB.debugger = false |
| | | |
| | | let getVal = () => { |
| | | let _i = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight |
| | | let _h = window.outerHeight - _i - 200 |
| | | let _w = window.outerWidth - window.innerWidth - 100 |
| | | |
| | | return Math.max(_h, _w) |
| | | } |
| | | |
| | | if (getVal() > 0) { |
| | | document.body.innerHTML = '<div style="text-align: center; font-size: 30px; padding-top: 40vh;">本系统禁止使用控制台,请关闭控制台重新刷新!</div>' |
| | | return |
| | | } else { |
| | | let timer = null |
| | | window.addEventListener('resize', () => { |
| | | timer && clearTimeout(timer) |
| | | |
| | | if (getVal() > 0) { |
| | | timer = setTimeout(() => { |
| | | document.body.innerHTML = '<div style="text-align: center; font-size: 30px; padding-top: 40vh;">本系统禁止使用控制台,请关闭控制台重新刷新!</div>' |
| | | }, 100) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (GLOB.sysType === 'cloud') { |
| | | Object.defineProperty(GLOB, 'debugger', { |
| | | writable: false, |
| | | value: GLOB.debugger |
| | | }) |
| | | } else if (GLOB.sysType === 'cloud') { |
| | | Object.defineProperty(GLOB, 'debugger', { |
| | | writable: false, |
| | | value: GLOB.debugger |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { elements } = this.state |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除元素吗?', |
| | | onOk() { |
| | | let _elements = elements.filter(item => item.uuid !== card.uuid) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | elements: _elements |
| | | }, () => { |
| | | _this.props.updateElement(_elements) |
| | | that.props.updateElement(_elements) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | */ |
| | | deleteCard = (cell) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除卡片吗?', |
| | | onOk() { |
| | | card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteCard = (cell) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除卡片吗?', |
| | | onOk() { |
| | | card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteCard = (cell) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除卡片吗?', |
| | | onOk() { |
| | | card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteCard = (cell) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除卡片吗?', |
| | | onOk() { |
| | | card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteCard = (cell) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除卡片吗?', |
| | | onOk() { |
| | | card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteCard = (cell) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除卡片吗?', |
| | | onOk() { |
| | | card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | changecols = (type) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | card.subcards[0].fields = card.subcards[0].fields.map(item => { |
| | | item.labelwidth = 33.3 |
| | |
| | | confirm({ |
| | | content: `确定切换为${type}列吗?`, |
| | | onOk() { |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | closeForm = (cell) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | card.subcards[0].fields = card.subcards[0].fields.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | confirm({ |
| | | content: `确定删除<<${cell.label}>>吗?`, |
| | | onOk() { |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | clearGroup = () => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | card.subcards[0].fields = [] |
| | | |
| | | confirm({ |
| | | content: `确定清空表单吗?`, |
| | | onOk() { |
| | | _this.updateComponent(card) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | closeGroup = (cell) => { |
| | | const { group } = this.state |
| | | let card = fromJS(this.state.card).toJS() |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除分组吗?', |
| | |
| | | _group = card.subcards[0] || null |
| | | } |
| | | |
| | | _this.setState({group: _group}) |
| | | _this.updateComponent(card) |
| | | that.setState({group: _group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | changecols = (type) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let config = fromJS(this.state.group).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | config.fields = config.fields.map(item => { |
| | | item.labelwidth = 33.3 |
| | |
| | | } |
| | | return item |
| | | }) |
| | | _this.setState({group: config}) |
| | | _this.updateComponent(card) |
| | | that.setState({group: config}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | closeForm = (cell) => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | group.fields = group.fields.filter(item => item.uuid !== cell.uuid) |
| | | |
| | |
| | | confirm({ |
| | | content: `确定删除<<${cell.label}>>吗?`, |
| | | onOk() { |
| | | _this.setState({group}) |
| | | _this.updateComponent(card) |
| | | that.setState({group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | clearGroup = () => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | group.fields = [] |
| | | |
| | |
| | | confirm({ |
| | | content: `确定清空表单吗?`, |
| | | onOk() { |
| | | _this.setState({group}) |
| | | _this.updateComponent(card) |
| | | that.setState({group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | closeGroup = (cell) => { |
| | | const { group } = this.state |
| | | let card = fromJS(this.state.card).toJS() |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除分组吗?', |
| | |
| | | _group = card.subcards[0] || null |
| | | } |
| | | |
| | | _this.setState({group: _group}) |
| | | _this.updateComponent(card) |
| | | that.setState({group: _group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | changecols = (type) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let config = fromJS(this.state.group).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | config.fields = config.fields.map(item => { |
| | | item.labelwidth = 33.3 |
| | |
| | | } |
| | | return item |
| | | }) |
| | | _this.setState({group: config}) |
| | | _this.updateComponent(card) |
| | | that.setState({group: config}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | closeForm = (cell) => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | group.fields = group.fields.filter(item => item.uuid !== cell.uuid) |
| | | |
| | |
| | | confirm({ |
| | | content: `确定删除<<${cell.label}>>吗?`, |
| | | onOk() { |
| | | _this.setState({group}) |
| | | _this.updateComponent(card) |
| | | that.setState({group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | clearGroup = () => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | group.fields = [] |
| | | |
| | |
| | | confirm({ |
| | | content: `确定清空表单吗?`, |
| | | onOk() { |
| | | _this.setState({group}) |
| | | _this.updateComponent(card) |
| | | that.setState({group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | if (group.components.length === 0) return |
| | | |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | title: '确定释放分组元素吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.props.unGroup(group.uuid) |
| | | that.props.unGroup(group.uuid) |
| | | |
| | | setTimeout(() => { |
| | | _this.updataGroup() |
| | | that.updataGroup() |
| | | }, 10) |
| | | }, |
| | | onCancel() {} |
| | |
| | | </>) |
| | | } |
| | | |
| | | let labelwidth = card.labelwidth || 33.3 |
| | | if (card.labelShow === 'false') { |
| | | labelwidth = 0 |
| | | } |
| | | |
| | | return ( |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | <div className={'page-card ' + (card.labelShow === 'false' ? 'label-hide ' : '') + card.type + (card.advanced === 'true' ? ' advanced' : '') + (card.query === 'false' ? ' no-query' : '')} style={{ opacity: opacity}}> |
| | | <div ref={node => drag(drop(node))}> |
| | | <Form.Item |
| | | labelCol={{xs: { span: 24 }, sm: { span: 8 }}} |
| | | wrapperCol = {{xs: { span: 24 }, sm: { span: 16 }}} |
| | | labelCol={{style: {width: labelwidth + '%'}}} |
| | | wrapperCol={{style: {width: (100 - labelwidth) + '%'}}} |
| | | label={card.labelShow !== 'false' ? card.label : ''} |
| | | required={card.required === 'true'} |
| | | help={card.field + (card.datefield ? ', ' + card.datefield : '') + (card.advanced === 'true' ? '(高级搜索)' : '')} |
| | |
| | | * @description 搜索条件删除 |
| | | */ |
| | | deleteElement = (cell) => { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${cell.label} ?`, |
| | | onOk() { |
| | | let _card = fromJS(_this.state.card).toJS() |
| | | let _card = fromJS(that.state.card).toJS() |
| | | _card.search = _card.search.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(_card) |
| | | that.updateComponent(_card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | .ant-form-item { |
| | | position: relative; |
| | | margin-bottom: 0px; |
| | | .ant-form-item-label { |
| | | float: left; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | float: left; |
| | | .ant-select { |
| | | width: 100%; |
| | | margin-top: 4px; |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${card.label} ?`, |
| | | onOk() { |
| | | let _actionlist = fromJS(_this.state.actionlist).toJS() |
| | | let _actionlist = fromJS(that.state.actionlist).toJS() |
| | | |
| | | _actionlist = _actionlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | actionlist: _actionlist |
| | | }, () => { |
| | | _this.props.updateaction({...config, action: _actionlist}) |
| | | that.props.updateaction({...config, action: _actionlist}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | _config.colsCtrls = colsCtrls |
| | | |
| | | if (this.customForm && this.customForm.state.editItem) { |
| | | const _this = this |
| | | const that = this |
| | | let title = '存在未保存项,确定忽略吗?' |
| | | if (s.length > 0) { |
| | | title = `存在未保存项,且第 ${s.join('、')} 行中字段在搜索条件中不存在,确定忽略吗?` |
| | |
| | | confirm({ |
| | | title: title, |
| | | onOk() { |
| | | _this.setState({ visible: false }) |
| | | _this.props.onSubmit(_config) |
| | | that.setState({ visible: false }) |
| | | that.props.onSubmit(_config) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else if (s.length > 0) { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | title: `第 ${s.join('、')} 行中字段在搜索条件中不存在,确定忽略吗?`, |
| | | onOk() { |
| | | _this.setState({ visible: false }) |
| | | _this.props.onSubmit(_config) |
| | | that.setState({ visible: false }) |
| | | that.props.onSubmit(_config) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | }) |
| | | this.props.onSubmit(marks) |
| | | } else { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | title: '存在未保存标记,确定忽略吗?', |
| | | onOk() { |
| | | _this.setState({ visible: false }) |
| | | _this.props.onSubmit(marks) |
| | | that.setState({ visible: false }) |
| | | that.props.onSubmit(marks) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${card.label} ?`, |
| | | onOk() { |
| | | let _searchlist = fromJS(_this.state.searchlist).toJS() |
| | | let _searchlist = fromJS(that.state.searchlist).toJS() |
| | | |
| | | _searchlist = _searchlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | searchlist: _searchlist |
| | | }, () => { |
| | | _this.props.updatesearch({...config, search: _searchlist}) |
| | | that.props.updatesearch({...config, search: _searchlist}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | class HeaderCol extends Component { |
| | | deleteCol = () => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除显示列吗?', |
| | | onOk() { |
| | | _this.props.deleteCol(_this.props.column) |
| | | that.props.deleteCol(that.props.column) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | class HeaderCol extends Component { |
| | | deleteCol = () => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除显示列吗?', |
| | | onOk() { |
| | | _this.props.deleteCol(_this.props.column) |
| | | that.props.deleteCol(that.props.column) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | columns.push(cell) |
| | | }) |
| | | |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定同步字段集吗?', |
| | | onOk() { |
| | | _this.setState({columns}, () => { |
| | | _this.props.updatecolumn({..._this.props.config, cols: columns}) |
| | | that.setState({columns}, () => { |
| | | that.props.updatecolumn({...that.props.config, cols: columns}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | } |
| | | |
| | | clear = () => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定清空显示列吗?', |
| | | onOk() { |
| | | _this.setState({columns: []}, () => { |
| | | _this.props.updatecolumn({..._this.props.config, cols: []}) |
| | | that.setState({columns: []}, () => { |
| | | that.props.updatecolumn({...that.props.config, cols: []}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | class HeaderCol extends Component { |
| | | deleteCol = () => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除显示列吗?', |
| | | onOk() { |
| | | _this.props.deleteCol(_this.props.column) |
| | | that.props.deleteCol(that.props.column) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | columns.push(cell) |
| | | }) |
| | | |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定同步字段集吗?', |
| | | onOk() { |
| | | _this.setState({columns}, () => { |
| | | _this.props.updatecolumn({..._this.props.config, cols: columns}) |
| | | that.setState({columns}, () => { |
| | | that.props.updatecolumn({...that.props.config, cols: columns}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | } |
| | | |
| | | clear = () => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定清空显示列吗?', |
| | | onOk() { |
| | | _this.setState({columns: []}, () => { |
| | | _this.props.updatecolumn({..._this.props.config, cols: []}) |
| | | that.setState({columns: []}, () => { |
| | | that.props.updatecolumn({...that.props.config, cols: []}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | delTab = (tab) => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | const _this = this |
| | | const that = this |
| | | |
| | | tabs.subtabs = tabs.subtabs.filter(t => t.uuid !== tab.uuid) |
| | | |
| | |
| | | title: '确定删除标签?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({tabs}) |
| | | _this.props.updateConfig(tabs) |
| | | that.setState({tabs}) |
| | | that.props.updateConfig(tabs) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | delTab = (tab) => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | const _this = this |
| | | const that = this |
| | | |
| | | tabs.subtabs = tabs.subtabs.filter(t => t.uuid !== tab.uuid) |
| | | |
| | |
| | | title: '确定删除标签?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({tabs}) |
| | | _this.props.updateConfig(tabs) |
| | | that.setState({tabs}) |
| | | that.props.updateConfig(tabs) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | verify.invalid = 'false' |
| | | } |
| | | } |
| | | if (verify.uniques && verify.uniques.length > 0 && btn.Ot === 'requiredOnce') { |
| | | if (component.wrap && (component.wrap.datatype === 'static' || component.wrap.datatype === 'public')) { |
| | | verify.uniques = [] |
| | | } |
| | | } |
| | | |
| | | if (verify.default !== 'false') { // 判断是否使用默认sql |
| | | _actionType = btn.sqlType |
| | |
| | | * @description 表单删除并刷新 |
| | | */ |
| | | closeForm = (card) => { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除${card.label ? `<<${card.label}>>` : ''}吗?`, |
| | | onOk() { |
| | | let _config = fromJS(_this.state.config).toJS() |
| | | let _config = fromJS(that.state.config).toJS() |
| | | _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | config: _config, |
| | | }) |
| | | }, |
| | |
| | | } |
| | | |
| | | clearConfig = () => { |
| | | const _this = this |
| | | const that = this |
| | | let _config = {...this.state.config, fields: []} |
| | | |
| | | confirm({ |
| | | content: '确定清空表单吗?', |
| | | onOk() { |
| | | _this.setState({ config: _config }) |
| | | that.setState({ config: _config }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | const { config, originConfig } = this.state |
| | | |
| | | if (!is(fromJS(config), fromJS(originConfig))) { |
| | | let _this = this |
| | | let that = this |
| | | confirm({ |
| | | content: '配置信息未保存,确定返回吗?', |
| | | onOk() { |
| | | _this.props.handleBack() |
| | | that.props.handleBack() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | changecols = (type) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | config.fields = config.fields.map(item => { |
| | | item.labelwidth = 33.3 |
| | |
| | | confirm({ |
| | | content: `确定切换为${type}列吗?`, |
| | | onOk() { |
| | | _this.setState({config}) |
| | | that.setState({config}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } |
| | | |
| | | deleteSource = (item) => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: '确定删除吗?', |
| | |
| | | if (res.status) { |
| | | if (item.typecharone === 'image') { |
| | | window.GLOB.app_pictures = res.data || [] |
| | | _this.resetPicture(res.data || []) |
| | | that.resetPicture(res.data || []) |
| | | } else if (item.typecharone === 'video') { |
| | | window.GLOB.app_videos = res.data || [] |
| | | _this.resetVideo(res.data || []) |
| | | that.resetVideo(res.data || []) |
| | | } else if (item.typecharone === 'color') { |
| | | window.GLOB.app_colors = res.data || [] |
| | | sessionStorage.setItem('app_colors', JSON.stringify(res.data || [])) |
| | | _this.resetColor(res.data || []) |
| | | that.resetColor(res.data || []) |
| | | } |
| | | } else { |
| | | notification.warning({ |
| | |
| | | } |
| | | |
| | | clear = () => { |
| | | let _this = this |
| | | let that = this |
| | | confirm({ |
| | | title: '确定清除历史记录吗?', |
| | | content: '', |
| | | onOk() { |
| | | localStorage.removeItem('replaceRecord') |
| | | _this.setState({fields: [], labels: []}) |
| | | that.setState({fields: [], labels: []}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | trigger = () => { |
| | | const { config } = this.props |
| | | const _this = this |
| | | const that = this |
| | | |
| | | if (!config.enabled) { |
| | | let tb = config.components[0] |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execUpdate(resolve, true) |
| | | that.execUpdate(resolve, true) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execUpdate(resolve) |
| | | that.execUpdate(resolve) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | deleteField = (field) => { |
| | | let config = JSON.stringify(this.props.config) |
| | | const _this = this |
| | | const that = this |
| | | |
| | | if (new RegExp('@' + field + '@', 'ig').test(config)) { |
| | | confirm({ |
| | | title: `配置中存在@${field}@,确定删除吗?`, |
| | | content: '', |
| | | onOk() { |
| | | _this.execDelete(field) |
| | | that.execDelete(field) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteCard = (cell, type) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | if (type !== 'direct') { |
| | | confirm({ |
| | |
| | | onOk() { |
| | | card.subMenus = card.subMenus.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.setState({card}) |
| | | _this.props.updateConfig(card) |
| | | that.setState({card}) |
| | | that.props.updateConfig(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } |
| | | |
| | | if (editMenu.MenuID && editMenu.property === 'menu' && res.property !== 'menu') { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | content: '菜单将被重置,确定修改吗?', |
| | | onOk() { |
| | |
| | | } |
| | | return item |
| | | }) |
| | | _this.setState({menus: _menus, editMenu: null, visible: false}, () => { |
| | | _this.props.updateConfig(_menus) |
| | | that.setState({menus: _menus, editMenu: null, visible: false}, () => { |
| | | that.props.updateConfig(_menus) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { menus } = this.state |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除《${card.name}》吗?`, |
| | | onOk() { |
| | | let _menus = menus.filter(item => item.MenuID !== card.MenuID) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | menus: _menus |
| | | }, () => { |
| | | _this.props.updateConfig(_menus) |
| | | that.props.updateConfig(_menus) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | delTab = (tab) => { |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | const _this = this |
| | | const that = this |
| | | |
| | | tabs.subtabs = tabs.subtabs.filter(t => t.uuid !== tab.uuid) |
| | | |
| | |
| | | title: '确定删除标签?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({tabs}) |
| | | _this.props.updateConfig(tabs) |
| | | that.setState({tabs}) |
| | | that.props.updateConfig(tabs) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | * @description 表单删除并刷新 |
| | | */ |
| | | closeForm = (card) => { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除${card.label ? `<<${card.label}>>` : ''}吗?`, |
| | | onOk() { |
| | | let _config = fromJS(_this.state.config).toJS() |
| | | let _config = fromJS(that.state.config).toJS() |
| | | _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | config: _config, |
| | | }) |
| | | }, |
| | |
| | | const { config, originConfig } = this.state |
| | | |
| | | if (!is(fromJS(config), fromJS(originConfig))) { |
| | | let _this = this |
| | | let that = this |
| | | confirm({ |
| | | content: '配置信息未保存,确定返回吗?', |
| | | onOk() { |
| | | _this.props.handleBack() |
| | | that.props.handleBack() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } |
| | | |
| | | clearConfig = () => { |
| | | const _this = this |
| | | const that = this |
| | | let _config = {...this.state.config, fields: []} |
| | | |
| | | confirm({ |
| | | content: '确定清空表单吗?', |
| | | onOk() { |
| | | _this.setState({ config: _config }) |
| | | that.setState({ config: _config }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | * @description 表单删除并刷新 |
| | | */ |
| | | closeForm = (card) => { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除${card.label ? `<<${card.label}>>` : ''}吗?`, |
| | | onOk() { |
| | | let _group = fromJS(_this.state.group).toJS() |
| | | let _group = fromJS(that.state.group).toJS() |
| | | _group.fields = _group.fields.filter(item => item.uuid !== card.uuid) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | group: _group, |
| | | }) |
| | | _this.resetConfig(_group) |
| | | that.resetConfig(_group) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | const { config, originConfig } = this.state |
| | | |
| | | if (!is(fromJS(config), fromJS(originConfig))) { |
| | | let _this = this |
| | | let that = this |
| | | confirm({ |
| | | content: '配置信息未保存,确定返回吗?', |
| | | onOk() { |
| | | _this.props.handleBack() |
| | | that.props.handleBack() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } |
| | | |
| | | closeGroup = (g) => { |
| | | const _this = this |
| | | const that = this |
| | | let _group = fromJS(this.state.group).toJS() |
| | | _group.groups = _group.groups.filter(item => item.uuid !== g.uuid) |
| | | |
| | | confirm({ |
| | | content: `确定删除分组《${g.wrap.name}》吗?`, |
| | | onOk() { |
| | | _this.setState({ group: _group }) |
| | | _this.resetConfig(_group) |
| | | that.setState({ group: _group }) |
| | | that.resetConfig(_group) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | delMenu = (record) => { |
| | | const { data } = this.state |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: '确定删除吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) |
| | | that.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | delMenu = (record) => { |
| | | const { menu } = this.props |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: '确定删除吗?', |
| | | content: '', |
| | | onOk() { |
| | | let _data = _this.state.data.filter(item => item.MenuID !== record.MenuID) |
| | | _this.setState({data: _data}) |
| | | _this.props.menuUpdate({...menu, sublist: _data}) |
| | | let _data = that.state.data.filter(item => item.MenuID !== record.MenuID) |
| | | that.setState({data: _data}) |
| | | that.props.menuUpdate({...menu, sublist: _data}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | }) |
| | | } |
| | | if (editMenu.MenuID && editMenu.property === 'menu' && _menu.property !== 'menu') { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | content: '菜单将被重置,确定修改吗?', |
| | | onOk() { |
| | |
| | | } |
| | | return item |
| | | }) |
| | | _this.setState({data: _data, editMenu: null, visible: false}) |
| | | _this.props.menuUpdate({...menu, sublist: _data}) |
| | | that.setState({data: _data, editMenu: null, visible: false}) |
| | | that.props.menuUpdate({...menu, sublist: _data}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | delMenu = (record) => { |
| | | const { menu } = this.props |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: (record.property === 'classify' && record.sublist.length > 0 ? '菜单下含有子菜单,' : '') + '确定删除吗?', |
| | | content: '', |
| | | onOk() { |
| | | let _data = _this.state.data.filter(item => item.MenuID !== record.MenuID) |
| | | _this.setState({data: _data}) |
| | | _this.props.menuUpdate({...menu, sublist: _data}) |
| | | let _data = that.state.data.filter(item => item.MenuID !== record.MenuID) |
| | | that.setState({data: _data}) |
| | | that.props.menuUpdate({...menu, sublist: _data}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | }) |
| | | } |
| | | if (editMenu.MenuID && editMenu.property === 'menu' && _menu.property !== 'menu') { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | content: '菜单将被重置,确定修改吗?', |
| | | onOk() { |
| | |
| | | } |
| | | return item |
| | | }) |
| | | _this.setState({data: _data, editMenu: null, visible: false}) |
| | | _this.props.menuUpdate({...menu, sublist: _data}) |
| | | that.setState({data: _data, editMenu: null, visible: false}) |
| | | that.props.menuUpdate({...menu, sublist: _data}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | delMenu = (record) => { |
| | | const { data } = this.state |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: (record.property === 'classify' && record.sublist.length > 0 ? '菜单下含有子菜单,' : '') + '确定删除吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) |
| | | that.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } |
| | | |
| | | if (editMenu.MenuID && editMenu.property === 'menu' && _menu.property !== 'menu') { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | content: '菜单将被重置,确定修改吗?', |
| | | onOk() { |
| | |
| | | } |
| | | return item |
| | | }) |
| | | _this.setState({data: _data, editMenu: null, visible: false}) |
| | | that.setState({data: _data, editMenu: null, visible: false}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | window.GLOB.CacheData.set(MenuID, urlparam) |
| | | |
| | | // if (window.backend && config.allSqls) { |
| | | // let keys = Object.keys(urlparam) |
| | | // config.allSqls.forEach(item => { |
| | | // if (item.type === 'datasource') { |
| | | // item.urlkeys = keys |
| | | // item.urlparam = urlparam |
| | | // if (config.flow_code) { |
| | | // item.works_flow_code = config.flow_code |
| | | // } |
| | | // } |
| | | // window.GLOB.CacheData.set('sql_' + item.uuid, item) |
| | | // }) |
| | | // } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | |
| | | |
| | | if (cell.verify) { |
| | | if (cell.verify.invalid === 'true') { |
| | | if (item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public')) { |
| | | cell.verify.invalid = 'false' |
| | | } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { |
| | | if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { |
| | | cell.verify.invalid = 'false' |
| | | } else if (cell.intertype !== 'system' && cell.procMode !== 'system') { |
| | | cell.verify.invalid = 'false' |
| | |
| | | return component |
| | | } |
| | | |
| | | component.setting.uuid = component.uuid |
| | | |
| | | let _customScript = '' |
| | | let _tailScript = '' |
| | | component.scripts && component.scripts.forEach(script => { |
| | |
| | | } |
| | | |
| | | if (tip) { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | content: tip + '确认要保存吗?', |
| | | onOk() { |
| | | _this.voucherSave(list, t) |
| | | that.voucherSave(list, t) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } |
| | | |
| | | if (cell.verify) { |
| | | let isStatic = item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public') |
| | | if (cell.verify.invalid === 'true') { |
| | | if (item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public')) { |
| | | if (isStatic) { |
| | | cell.verify.invalid = 'false' |
| | | } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { |
| | | cell.verify.invalid = 'false' |
| | |
| | | cell.verify.invalid = 'false' |
| | | } |
| | | } |
| | | if (cell.verify.uniques && cell.verify.uniques.length > 0 && cell.Ot === 'requiredOnce' && isStatic) { |
| | | cell.verify.uniques = [] |
| | | } |
| | | |
| | | if (cell.verify.linkEnable === 'true' && /@/.test(cell.verify.linkUrl)) { |
| | | cell.returnValue = 'true' |
| | |
| | | } |
| | | |
| | | if (cell.verify) { |
| | | let isStatic = item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public') |
| | | if (cell.verify.invalid === 'true') { |
| | | if (item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public')) { |
| | | if (isStatic) { |
| | | cell.verify.invalid = 'false' |
| | | } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { |
| | | cell.verify.invalid = 'false' |
| | |
| | | } |
| | | } |
| | | |
| | | if (cell.verify.uniques && cell.verify.uniques.length > 0 && cell.Ot === 'requiredOnce' && isStatic) { |
| | | cell.verify.uniques = [] |
| | | } |
| | | |
| | | if (cell.verify.linkEnable === 'true' && /@/.test(cell.verify.linkUrl)) { |
| | | cell.returnValue = 'true' |
| | | } |
| | |
| | | */ |
| | | changeUser = (primaryId) => { |
| | | const { setting, btn } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | let param = { |
| | | func: 'webapi_ChangeUser', |
| | |
| | | message: res.message || '执行失败!', |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 |
| | | }) |
| | | _this.setState({loading: false}) |
| | | that.setState({loading: false}) |
| | | } |
| | | }, () => { |
| | | resolve() |
| | | _this.setState({loading: false}) |
| | | that.setState({loading: false}) |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | _this.setState({loading: false}) |
| | | that.setState({loading: false}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | if (res.status) { |
| | | this.execSuccess(res) |
| | | } else if (res.ErrCode === 'C') { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | title: window.GLOB.dict['exec_sure'] || '请确认', |
| | | content: res.message, |
| | |
| | | return new Promise(resolve => { |
| | | Api.genericInterface(unCheckParam).then(result => { |
| | | if (result.status) { |
| | | _this.execSuccess(result) |
| | | that.execSuccess(result) |
| | | } else { |
| | | _this.execError(result) |
| | | that.execError(result) |
| | | } |
| | | resolve() |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | _this.execError(res) |
| | | that.execError(res) |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | width: auto; |
| | | padding: 0 15px; |
| | | } |
| | | .ant-btn.ant-btn-link { |
| | | border-color: #d9d9d9; |
| | | } |
| | | |
| | | .ant-btn.mk-btn-hover-bg:not([disabled]):hover { |
| | | opacity: 1!important; |
| | |
| | | |
| | | this.setState({autoMatic: type === 'autoMatic'}) |
| | | |
| | | let _this = this |
| | | let that = this |
| | | let data = record || selectedData || [] |
| | | |
| | | let valid = this.checkBtnData(data) |
| | |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execSubmit(data, resolve) |
| | | that.execSubmit(data, resolve) |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | _this.setState({loading: false}) |
| | | that.setState({loading: false}) |
| | | } |
| | | }) |
| | | } else if (btn.OpenType === 'exec') { |
| | |
| | | return |
| | | } |
| | | |
| | | let _this = this |
| | | let that = this |
| | | let data = selectedData || [] |
| | | |
| | | let valid = this.checkBtnData(data) |
| | |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execSubmit(data, resolve) |
| | | that.execSubmit(data, resolve) |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | callback() |
| | | _this.setState({loading: false}) |
| | | that.setState({loading: false}) |
| | | } |
| | | }) |
| | | } else if (btn.OpenType === 'exec') { |
| | |
| | | msg = msg.replace(/\n|\r/ig, '<br/>') |
| | | msg = <span dangerouslySetInnerHTML={{__html: msg}}></span> |
| | | } |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | title: window.GLOB.dict['exec_sure'] || '请确认', |
| | | content: msg, |
| | |
| | | return new Promise(resolve => { |
| | | Api.genericInterface(unCheckParam).then(result => { |
| | | if (result.status) { |
| | | _this.triggerNote(result, param.ID) // 消息 |
| | | that.triggerNote(result, param.ID) // 消息 |
| | | |
| | | if (params.length === 0) { |
| | | _this.execSuccess(result) |
| | | that.execSuccess(result) |
| | | _resolve() |
| | | } else { |
| | | _this.checkLoopRequest(params, _resolve) |
| | | that.checkLoopRequest(params, _resolve) |
| | | } |
| | | } else { |
| | | _this.execError(result) |
| | | that.execError(result) |
| | | _resolve() |
| | | } |
| | | resolve() |
| | |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | _this.execError(res) |
| | | that.execError(res) |
| | | _resolve() |
| | | } |
| | | }) |
| | |
| | | modelconfirm = () => { |
| | | const { BID } = this.props |
| | | const { btnconfig, selines, dict } = this.state |
| | | let _this = this |
| | | let that = this |
| | | |
| | | let result = [] |
| | | let _data = {} |
| | |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execSubmit(selines, resolve, result) |
| | | that.execSubmit(selines, resolve, result) |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | _this.preCallback && _this.preCallback() |
| | | _this.setState({ loading: false }) |
| | | that.preCallback && that.preCallback() |
| | | that.setState({ loading: false }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | this.setState({autoMatic: type === 'autoMatic'}) |
| | | |
| | | let _this = this |
| | | let that = this |
| | | let data = record || selectedData || [] |
| | | |
| | | if (btn.Ot !== 'notRequired' && data.length === 0) { |
| | |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | _this.triggerPrint(data) |
| | | that.triggerPrint(data) |
| | | }, |
| | | onCancel() { |
| | | _this.setState({ loading: false }) |
| | | that.setState({ loading: false }) |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | |
| | | modelconfirm = () => { |
| | | const { btnconfig, selines, dict } = this.state |
| | | let _this = this |
| | | let that = this |
| | | let result = [] |
| | | let _data = {} |
| | | let BData = {} |
| | |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | _this.triggerPrint(selines, result) |
| | | that.triggerPrint(selines, result) |
| | | }, |
| | | onCancel() { |
| | | _this.setState({ loading: false }) |
| | | that.setState({ loading: false }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } else if (!links.includes(item.verify.linkUrl)) { |
| | | links.push(item.verify.linkUrl) |
| | | } |
| | | }) |
| | | |
| | | let socket = null |
| | | socket = new WebSocket('ws://' + item.verify.linkUrl) |
| | | if (links.length === 0) return |
| | | |
| | | let defers = links.map(link => { |
| | | return new Promise((resolve) => { |
| | | let socket = new WebSocket('ws://' + link) |
| | | // 打开Socket |
| | | socket.onopen = () =>{ |
| | | let request = { |
| | |
| | | }) |
| | | } |
| | | |
| | | window.GLOB.UserCacheMap.set(item.verify.linkUrl, _printers) |
| | | } else if (data && data.cmd === 'getPrinters') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: data.message, |
| | | duration: 5 |
| | | }) |
| | | resolve({status: true, printers: _printers}) |
| | | } else if (data && data.cmd === 'getPrinters' && data.message) { |
| | | resolve({status: false, printers: null, message: data.message}) |
| | | } |
| | | } |
| | | |
| | | socket.onerror = () => { |
| | | let tool = item.verify.linkUrl |
| | | if (item.verify.linkUrl === '127.0.0.1:13529') { |
| | | let tool = link |
| | | |
| | | if (link === '127.0.0.1:13529') { |
| | | tool = '明科通讯组件' |
| | | } else if (item.verify.linkUrl === '127.0.0.1:13528') { |
| | | } else if (link === '127.0.0.1:13528') { |
| | | tool = 'CAINIAO打印组件' |
| | | } |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '无法连接到: ' + tool, |
| | | duration: 5 |
| | | }) |
| | | |
| | | resolve({status: false, printers: null, message: '无法连接到: ' + tool}) |
| | | |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | Promise.all(defers).then(results => { |
| | | let res = results.filter(item => item.status)[0] |
| | | if (res) { |
| | | links.forEach(link => { |
| | | window.GLOB.UserCacheMap.set(link, res.printers) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: results[0].message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | cancelConfig = () => { |
| | | // const { config, originMenu } = this.state |
| | | |
| | | // let _this = this |
| | | // let that = this |
| | | |
| | | // if (config.isAdd) { |
| | | // confirm({ |
| | | // content: '菜单尚未提交,确定放弃保存吗?', |
| | | // onOk() { |
| | | // _this.props.handleView() |
| | | // that.props.handleView() |
| | | // }, |
| | | // onCancel() {} |
| | | // }) |
| | |
| | | |
| | | trigger = () => { |
| | | const { config } = this.props |
| | | const _this = this |
| | | const that = this |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execUpdate(resolve) |
| | | that.execUpdate(resolve) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | saveConfig = (_resolve, _config, errors) => { |
| | | let err = errors.join(';') |
| | | let _this = this |
| | | let that = this |
| | | |
| | | if (err) { |
| | | _resolve() |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.saveNewMenu(resolve, _config) |
| | | that.saveNewMenu(resolve, _config) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | * @description 表单删除并刷新 |
| | | */ |
| | | closeForm = (card) => { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除${card.label ? `<<${card.label}>>` : ''}吗?`, |
| | | onOk() { |
| | | let _config = fromJS(_this.state.config).toJS() |
| | | let _config = fromJS(that.state.config).toJS() |
| | | _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | config: _config, |
| | | }) |
| | | }, |
| | |
| | | |
| | | cancelConfig = () => { |
| | | // const { config, originConfig } = this.state |
| | | // let _this = this |
| | | // let that = this |
| | | |
| | | // let isOrigin = config.fields.filter(item => item.origin).length > 0 |
| | | // if (isOrigin) { |
| | | // confirm({ |
| | | // content: '尚未提交,确定放弃保存吗?', |
| | | // onOk() { |
| | | // _this.handleViewBack() |
| | | // that.handleViewBack() |
| | | // }, |
| | | // onCancel() {} |
| | | // }) |
| | |
| | | |
| | | changecols = (type) => { |
| | | let config = fromJS(this.state.config).toJS() |
| | | let _this = this |
| | | let that = this |
| | | |
| | | config.fields = config.fields.map(item => { |
| | | item.labelwidth = 33.3 |
| | |
| | | confirm({ |
| | | content: `确定切换为${type}列吗?`, |
| | | onOk() { |
| | | _this.setState({config}) |
| | | that.setState({config}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } |
| | | |
| | | clearConfig = () => { |
| | | const _this = this |
| | | const that = this |
| | | let _config = {...this.state.config, fields: []} |
| | | |
| | | confirm({ |
| | | content: '确定清空表单吗?', |
| | | onOk() { |
| | | _this.setState({ config: _config }) |
| | | that.setState({ config: _config }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${card.label} ?`, |
| | | onOk() { |
| | | let _actionlist = fromJS(_this.state.actionlist).toJS() |
| | | let _actionlist = fromJS(that.state.actionlist).toJS() |
| | | |
| | | _actionlist = _actionlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | |
| | | card: card |
| | | } |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | actionlist: _actionlist |
| | | }, () => { |
| | | _this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, '', delcard) |
| | | that.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, '', delcard) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | clearField = () => { |
| | | const { verify } = this.state |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: `确定清空Excel列吗?`, |
| | | onOk() { |
| | | _this.setState({ |
| | | that.setState({ |
| | | verify: { |
| | | ...verify, |
| | | columns: [] |
| | | } |
| | | }, () => { |
| | | _this.resetUniqueColumns() |
| | | that.resetUniqueColumns() |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | clearField = () => { |
| | | const { verify } = this.state |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: `确定清空Excel列吗?`, |
| | | onOk() { |
| | | _this.setState({ |
| | | that.setState({ |
| | | verify: { |
| | | ...verify, |
| | | columns: [] |
| | |
| | | |
| | | deletedetail = (cell) => { |
| | | const { card } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${cell.content} ?`, |
| | |
| | | |
| | | _details = _details.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.plotChange({details: _details}) |
| | | that.plotChange({details: _details}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | deleteElem = (type) => { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除?', |
| | | onOk() { |
| | | let _subelement = fromJS(_this.props.card.subelement).toJS() |
| | | let _subelement = fromJS(that.props.card.subelement).toJS() |
| | | _subelement = _subelement.filter(_type => _type !== type) |
| | | |
| | | _this.plotChange({subelement: _subelement}) |
| | | that.plotChange({subelement: _subelement}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deletechart = (plot) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 ${plot.title} ?`, |
| | | onOk() { |
| | | let _chartlist = fromJS(_this.state.chartlist).toJS() |
| | | let _chartview = _this.state.chartview |
| | | let _chartlist = fromJS(that.state.chartlist).toJS() |
| | | let _chartview = that.state.chartview |
| | | |
| | | _chartlist = _chartlist.filter(item => item.uuid !== plot.uuid) |
| | | |
| | |
| | | _chartview = _chartlist[0].uuid |
| | | } |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | chartlist: _chartlist, |
| | | chartview: _chartview |
| | | }) |
| | | _this.props.updatechartgroup({...config, charts: _chartlist}, _chartview) |
| | | that.props.updatechartgroup({...config, charts: _chartlist}, _chartview) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${card.label} ?`, |
| | | onOk() { |
| | | let _columnlist = fromJS(_this.state.columnlist).toJS() |
| | | let _columnlist = fromJS(that.state.columnlist).toJS() |
| | | |
| | | _columnlist = _columnlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | columnlist: _columnlist |
| | | }, ()=> { |
| | | _this.props.updatecolumn({...config, columns: _columnlist}) |
| | | that.props.updatecolumn({...config, columns: _columnlist}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | if (type === 'search') { |
| | | // 添加搜索条件,字段集中存在搜索条件字段,使用搜索条件对象替换字段集,设置数据类型 |
| | | config.search.forEach(item => { |
| | | if (item.field && columns.has(item.field.toLowerCase())) { |
| | | let _datatype = columns.get(item.field.toLowerCase()).datatype |
| | | columns.set(item.field.toLowerCase(), {...item, origin: true, datatype: _datatype}) |
| | | if (item.field) { |
| | | if (/,/.test(item.field)) { |
| | | item.field.split(',').forEach(n => { |
| | | if (columns.has(n.toLowerCase())) { |
| | | let _datatype = columns.get(n.toLowerCase()).datatype |
| | | columns.set(n.toLowerCase(), {...item, field: n, origin: true, datatype: _datatype}) |
| | | } |
| | | }) |
| | | } else { |
| | | if (columns.has(item.field.toLowerCase())) { |
| | | let _datatype = columns.get(item.field.toLowerCase()).datatype |
| | | columns.set(item.field.toLowerCase(), {...item, origin: true, datatype: _datatype}) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } else if (type === 'columns') { |
| | |
| | | } |
| | | |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | // 获取已选字段集合 |
| | | let cards = selectCards |
| | | let columnsMap = new Map() |
| | | cards.forEach(card => { |
| | | columnsMap.set(card.field.toLowerCase(), card) |
| | | }) |
| | | |
| | | let items = [] |
| | | let keys = [] |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${card.label} ?`, |
| | | onOk() { |
| | | let _searchlist = fromJS(_this.state.searchlist).toJS() |
| | | let _searchlist = fromJS(that.state.searchlist).toJS() |
| | | |
| | | _searchlist = _searchlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | searchlist: _searchlist |
| | | }, () => { |
| | | _this.props.updatesearch({...config, search: _searchlist}) |
| | | that.props.updatesearch({...config, search: _searchlist}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | */ |
| | | deleteElement = (card, group) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | let tabgroups = fromJS(this.state.tabgroups).toJS() |
| | | |
| | | confirm({ |
| | |
| | | return _group |
| | | }) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | tabgroups: tabgroups |
| | | }, () => { |
| | | _this.props.updatetabs({...config, tabgroups: tabgroups}) |
| | | that.props.updatetabs({...config, tabgroups: tabgroups}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | */ |
| | | addTabGroup = () => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | let _tabgroups = fromJS(this.state.tabgroups).toJS() |
| | | |
| | | confirm({ |
| | |
| | | sublist:[] |
| | | }) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | tabgroups: _tabgroups |
| | | }, () => { |
| | | _this.props.updatetabs({...config, tabgroups: _tabgroups}) |
| | | that.props.updatetabs({...config, tabgroups: _tabgroups}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | */ |
| | | delTabGroup = (group) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | let _tabgroups = fromJS(this.state.tabgroups).toJS() |
| | | |
| | | confirm({ |
| | |
| | | onOk() { |
| | | _tabgroups = _tabgroups.filter(_group => _group.uuid !== group.uuid) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | tabgroups: _tabgroups |
| | | }, () => { |
| | | _this.props.updatetabs({...config, tabgroups: _tabgroups}, group.sublist) |
| | | that.props.updatetabs({...config, tabgroups: _tabgroups}, group.sublist) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | cancelConfig = () => { |
| | | // const { config, originConfig } = this.state |
| | | |
| | | // let _this = this |
| | | // let that = this |
| | | |
| | | // if (originConfig.isAdd) { |
| | | // confirm({ |
| | | // content: '菜单尚未提交,确定放弃保存吗?', |
| | | // onOk() { |
| | | // _this.handleViewBack() |
| | | // that.handleViewBack() |
| | | // }, |
| | | // onCancel() {} |
| | | // }) |
| | |
| | | */ |
| | | cancelConfig = () => { |
| | | // const { config, originMenu } = this.state |
| | | // let _this = this |
| | | // let that = this |
| | | |
| | | // if (config.isAdd) { |
| | | // confirm({ |
| | | // content: '菜单尚未提交,确定放弃保存吗?', |
| | | // onOk() { |
| | | // _this.props.handleView() |
| | | // that.props.handleView() |
| | | // }, |
| | | // onCancel() {} |
| | | // }) |
| | |
| | | |
| | | trigger = () => { |
| | | const { config } = this.props |
| | | const _this = this |
| | | const that = this |
| | | |
| | | if (!config.enabled) { |
| | | notification.warning({ |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execUpdate(resolve) |
| | | that.execUpdate(resolve) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | saveConfig = (_resolve, _config, errors) => { |
| | | let err = errors.join(';') |
| | | let _this = this |
| | | let that = this |
| | | |
| | | if (err) { |
| | | _resolve() |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.saveNewMenu(resolve, _config) |
| | | that.saveNewMenu(resolve, _config) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | } |
| | | |
| | | clear = () => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: '确定清空列表吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({ data: [], editingKey: '' }, () => { |
| | | _this.props.onChange([]) |
| | | that.setState({ data: [], editingKey: '' }, () => { |
| | | that.props.onChange([]) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | }; |
| | | |
| | | Formatter.prototype.getFormattedQueryFromTokens = function getFormattedQueryFromTokens() { |
| | | var _this = this; |
| | | var that = this; |
| | | var formattedQuery = ""; |
| | | this.tokens.forEach(function (token, index) { |
| | | _this.index = index; |
| | | that.index = index; |
| | | if (token.type === _tokenTypes2["default"].WHITESPACE) { |
| | | // ignore (we do our own whitespace formatting) |
| | | } else if (token.type === _tokenTypes2["default"].LINE_COMMENT) { |
| | | formattedQuery = _this.formatLineComment(token, formattedQuery); |
| | | formattedQuery = that.formatLineComment(token, formattedQuery); |
| | | } else if (token.type === _tokenTypes2["default"].BLOCK_COMMENT) { |
| | | formattedQuery = _this.formatBlockComment(token, formattedQuery); |
| | | formattedQuery = that.formatBlockComment(token, formattedQuery); |
| | | } else if (token.type === _tokenTypes2["default"].RESERVED_TOPLEVEL) { |
| | | formattedQuery = _this.formatToplevelReservedWord(token, formattedQuery); |
| | | _this.previousReservedWord = token; |
| | | formattedQuery = that.formatToplevelReservedWord(token, formattedQuery); |
| | | that.previousReservedWord = token; |
| | | } else if (token.type === _tokenTypes2["default"].RESERVED_NEWLINE) { |
| | | formattedQuery = _this.formatNewlineReservedWord(token, formattedQuery); |
| | | _this.previousReservedWord = token; |
| | | formattedQuery = that.formatNewlineReservedWord(token, formattedQuery); |
| | | that.previousReservedWord = token; |
| | | }else if (token.type === _tokenTypes2["default"].RESERVED) { |
| | | formattedQuery = _this.formatWithSpaces(token, formattedQuery); |
| | | _this.previousReservedWord = token; |
| | | formattedQuery = that.formatWithSpaces(token, formattedQuery); |
| | | that.previousReservedWord = token; |
| | | } else if (token.type === _tokenTypes2["default"].OPEN_PAREN) { |
| | | formattedQuery = _this.formatOpeningParentheses(token, formattedQuery); |
| | | formattedQuery = that.formatOpeningParentheses(token, formattedQuery); |
| | | } else if (token.type === _tokenTypes2["default"].CLOSE_PAREN) { |
| | | formattedQuery = _this.formatClosingParentheses(token, formattedQuery); |
| | | formattedQuery = that.formatClosingParentheses(token, formattedQuery); |
| | | } else if (token.type === _tokenTypes2["default"].PLACEHOLDER) { |
| | | formattedQuery = _this.formatPlaceholder(token, formattedQuery); |
| | | formattedQuery = that.formatPlaceholder(token, formattedQuery); |
| | | } else if (token.value === '$') { |
| | | formattedQuery = _this.formatNewWithSpaces(token, formattedQuery); |
| | | formattedQuery = that.formatNewWithSpaces(token, formattedQuery); |
| | | } else if (token.value === ",") { |
| | | formattedQuery = _this.formatComma(token, formattedQuery); |
| | | formattedQuery = that.formatComma(token, formattedQuery); |
| | | } else if (token.value === ":") { |
| | | formattedQuery = _this.formatWithSpaceAfter(token, formattedQuery); |
| | | formattedQuery = that.formatWithSpaceAfter(token, formattedQuery); |
| | | } else if (token.value === ".") { |
| | | formattedQuery = _this.formatWithoutSpaces(token, formattedQuery); |
| | | formattedQuery = that.formatWithoutSpaces(token, formattedQuery); |
| | | } else if (token.value === ";") { |
| | | formattedQuery = _this.formatQuerySeparator(token, formattedQuery); |
| | | formattedQuery = that.formatQuerySeparator(token, formattedQuery); |
| | | } else { |
| | | formattedQuery = _this.formatWithSpaces(token, formattedQuery); |
| | | formattedQuery = that.formatWithSpaces(token, formattedQuery); |
| | | } |
| | | }); |
| | | return formattedQuery; |
| | |
| | | }; |
| | | |
| | | Tokenizer.prototype.createParenRegex = function createParenRegex(parens) { |
| | | var _this = this; |
| | | var that = this; |
| | | |
| | | return new RegExp("^(" + parens.map(function (p) { |
| | | return _this.escapeParen(p); |
| | | return that.escapeParen(p); |
| | | }).join("|") + ")", "i"); |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | Tokenizer.prototype.getStringNamedPlaceholderToken = function getStringNamedPlaceholderToken(input) { |
| | | var _this2 = this; |
| | | var that2 = this; |
| | | |
| | | return this.getPlaceholderTokenWithKey({ |
| | | input: input, |
| | | regex: this.STRING_NAMED_PLACEHOLDER_REGEX, |
| | | parseKey: function parseKey(v) { |
| | | return _this2.getEscapedPlaceholderKey({ key: v.slice(2, -1), quoteChar: v.slice(-1) }); |
| | | return that2.getEscapedPlaceholderKey({ key: v.slice(2, -1), quoteChar: v.slice(-1) }); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | /** |
| | | * @description 获取执行脚本 |
| | | */ |
| | | export function getAllSqls (config) { |
| | | export function getAllSqls (conf) { |
| | | let config = fromJS(conf).toJS() |
| | | |
| | | let sqls = [] |
| | | let urlFields = config.urlFields |
| | | let appType = sessionStorage.getItem('appType') |
| | | let process = config.process === 'true' |
| | | |
| | | if (urlFields) { |
| | | urlFields = urlFields.map(n => n.toLowerCase()) |
| | | } |
| | | |
| | | let filterComponent = (components, mainSearch) => { |
| | | components.forEach(item => { |
| | |
| | | if (appType === 'mob' && item.type !== 'search' && item.type !== 'topbar' && item.search && item.search.length > 0) { |
| | | item.search = [] |
| | | } |
| | | if (appType !== 'mob' && item.search && item.search.length > 0) { |
| | | item.search.forEach(cell => { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { |
| | | let msg = getFormSql(cell) |
| | | |
| | | sqls.push({uuid: cell.uuid, type: 'sForm', ...msg}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.subtype === 'tablecard') { // 兼容 |
| | | item.type = 'card' |
| | |
| | | |
| | | let msg = getDataSource(item, mainSearch) |
| | | |
| | | sqls.push({uuid: item.uuid, ...msg}) |
| | | sqls.push({uuid: item.uuid, type: 'datasource', ...msg}) |
| | | } else if (item.setting && item.setting.useMSearch === 'true') { |
| | | let searches = item.search || [] |
| | | if (mainSearch.length > 0) { |
| | |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | } else if (item.subtype === 'editable' && col.editable === 'true') { |
| | | if (col.editType === 'select' && col.resourceType === '1') { |
| | | let msg = getFormSql(col) |
| | | |
| | | sqls.push({uuid: col.uuid, type: 'tbForm', ...msg}) |
| | | } else if (col.editType === 'popSelect') { |
| | | if (col.pops) { |
| | | col.pops.forEach(n => { |
| | | let msg = getPopSelectSql(n) |
| | | |
| | | sqls.push({uuid: n.uuid, type: 'popSource', ...msg}) |
| | | }) |
| | | } else { |
| | | let msg = getPopSelectSql(col) |
| | | |
| | | sqls.push({uuid: col.uuid, type: 'popSource', ...msg}) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | if (item.subtype === 'editable' && item.submit.intertype === 'system') { |
| | | let msg = getEditTableSql(item.submit, item.cols, item.columns) |
| | | |
| | | sqls.push({uuid: 'submit_' + item.uuid, ...msg}) |
| | | sqls.push({uuid: 'submit_' + item.uuid, type: 'editable', ...msg}) |
| | | } |
| | | } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards && item.subcards.forEach(card => { |
| | |
| | | |
| | | let msg = getSysDefaultSql(cell, _item) |
| | | |
| | | sqls.push({uuid: cell.uuid, ...msg}) |
| | | sqls.push({uuid: cell.uuid, type: 'button', ...msg}) |
| | | } else { |
| | | let msg = getSysDefaultSql(cell, item) |
| | | |
| | | sqls.push({uuid: cell.uuid, ...msg}) |
| | | sqls.push({uuid: cell.uuid, type: 'button', ...msg}) |
| | | } |
| | | } |
| | | if (cell.callbackType === 'script' && cell.verify && cell.verify.cbScripts) { |
| | |
| | | |
| | | let msg = getSysBackSql(cell, _item) |
| | | |
| | | sqls.push({uuid: 'back_' + cell.uuid, ...msg}) |
| | | sqls.push({uuid: 'back_' + cell.uuid, type: 'btnCallBack', ...msg}) |
| | | } else { |
| | | let msg = getSysBackSql(cell, item) |
| | | |
| | | sqls.push({uuid: 'back_' + cell.uuid, ...msg}) |
| | | sqls.push({uuid: 'back_' + cell.uuid, type: 'btnCallBack', ...msg}) |
| | | } |
| | | } |
| | | if (['pop', 'formSubmit'].includes(cell.OpenType) && cell.modal && cell.modal.fields) { |
| | | cell.modal.fields.forEach(form => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { |
| | | let msg = getFormSql(form) |
| | | |
| | | sqls.push({uuid: form.uuid, type: 'form', ...msg}) |
| | | } else if (form.type === 'popSelect') { |
| | | let msg = getPopSelectSql(form) |
| | | |
| | | sqls.push({uuid: form.uuid, type: 'popSource', ...msg}) |
| | | } |
| | | }) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn') { |
| | | if (cell.intertype === 'system') { |
| | | let msg = getExcelInSql(cell) |
| | | |
| | | sqls.push({uuid: cell.uuid, ...msg}) |
| | | sqls.push({uuid: cell.uuid, type: 'excelIn', ...msg}) |
| | | } |
| | | } else if (cell.OpenType === 'excelOut') { |
| | | if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { |
| | | let msg = getExcelOutSql(cell, item) |
| | | |
| | | sqls.push({uuid: cell.uuid, ...msg}) |
| | | sqls.push({uuid: cell.uuid, type: 'excelOut', ...msg}) |
| | | } |
| | | } else if (cell.OpenType === 'funcbutton') { |
| | | if (cell.funcType === 'print') { |
| | | if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { |
| | | let msg = getPrintSql(cell) |
| | | |
| | | sqls.push({uuid: cell.uuid, ...msg}) |
| | | sqls.push({uuid: cell.uuid, type: 'print', ...msg}) |
| | | } |
| | | if (cell.execMode === 'pop' && cell.modal && cell.modal.fields) { |
| | | cell.modal.fields.forEach(form => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { |
| | | let msg = getFormSql(form) |
| | | |
| | | sqls.push({uuid: form.uuid, type: 'form', ...msg}) |
| | | } else if (form.type === 'popSelect') { |
| | | let msg = getPopSelectSql(form) |
| | | |
| | | sqls.push({uuid: form.uuid, type: 'popSource', ...msg}) |
| | | } |
| | | }) |
| | | } |
| | | } else if ((cell.funcType === 'refund' || cell.funcType === 'pay') && cell.payMode === 'system') { |
| | | let msg = getPaySql(cell, item) |
| | | |
| | | sqls.push({uuid: cell.uuid, ...msg}) |
| | | sqls.push({uuid: cell.uuid, type: 'pay', ...msg}) |
| | | } |
| | | } else if (cell.OpenType === 'innerpage' || cell.OpenType === 'outerpage') { |
| | | if (cell.pageTemplate === 'pay' && cell.payMode === 'system') { |
| | | let msg = getPaySql(cell, item) |
| | | |
| | | sqls.push({uuid: cell.uuid, ...msg}) |
| | | sqls.push({uuid: cell.uuid, type: 'pay', ...msg}) |
| | | } |
| | | } else if (cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components) { |
| | |
| | | verify.invalid = 'false' |
| | | } else if (btn.Ot === 'notRequired') { |
| | | verify.invalid = 'false' |
| | | } |
| | | } |
| | | if (verify.uniques && verify.uniques.length > 0 && btn.Ot === 'requiredOnce') { |
| | | if (component.wrap && (component.wrap.datatype === 'static' || component.wrap.datatype === 'public')) { |
| | | verify.uniques = [] |
| | | } |
| | | } |
| | | |
| | |
| | | _sql = _sql.replace(/\$check@/ig, '@mk_check_begin@').replace(/@check\$/ig, '@mk_check_end@') |
| | | reps.push('mk_check_begin', 'mk_check_end') |
| | | } |
| | | if (/@db@/ig.test(_sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | reps = Array.from(new Set([...reps, ...colreps])) |
| | | |
| | |
| | | _sql = _sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(_sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | reps = Array.from(new Set([...reps, ...colreps])) |
| | | |
| | |
| | | let getDataSource = (item, mainSearch = []) => { |
| | | if (!item.setting || item.setting.interType !== 'system') return |
| | | |
| | | item.setting.primaryKey = item.setting.primaryKey || 'ID' |
| | | let searches = item.search || [] |
| | | if (item.setting.useMSearch === 'true' && mainSearch.length > 0) { |
| | | searches = [...searches, ...mainSearch] |
| | |
| | | select ${secSql.join(',')}` |
| | | |
| | | // 不需要单引号:orderBy、pageSize、pageIndex、db |
| | | let regs = [...sFields, 'orderBy', 'pageSize', 'pageIndex', 'typename', 'datam', 'ID', 'BID', 'time_id', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'lang', 'typename'] |
| | | let regs = [...sFields, 'orderBy', 'pageSize', 'pageIndex', 'ID', 'BID', 'time_id', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'lang', 'datam', 'typename'] |
| | | |
| | | if (item.hasExtend) { |
| | | regs.push('mk_time') |
| | |
| | | if (/@pageSize@|@orderBy@|@mk_total/i.test(testSql)) { |
| | | LText = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search} ` |
| | | } else if (item.setting.laypage === 'true' && item.setting.order) { |
| | | LText = `/*system_query*/select top @pageSize@ ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${_dataresource} ${_search}) tmptable where rows > @mk_rows_begin@ order by tmptable.rows ` |
| | | reps.push('pageSize', 'orderBy', 'mk_rows_begin') |
| | | LText = `/*system_query*/select top @pageSize@ ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${_dataresource} ${_search}) tmptable where rows > @pageSize@ * (@pageIndex@ - 1) order by tmptable.rows ` |
| | | reps.push('pageSize', 'orderBy', 'pageIndex') |
| | | if (item.subtype === 'dualdatacard') { |
| | | DateCount = `/*system_query*/select count(1) as total from (select distinct ${item.setting.primaryKey} from ${_dataresource} ${_search})a` |
| | | DateCount = `/*system_query*/select count(1) as total from (select distinct ${item.setting.primaryKey || 'ID'} from ${_dataresource} ${_search})a` |
| | | } else { |
| | | DateCount = `/*system_query*/select count(1) as total from ${_dataresource} ${_search}` |
| | | } |
| | |
| | | |
| | | reps = Array.from(new Set(reps)) |
| | | |
| | | LText = LText.replace(/\n\s{6,8}/g, '\n') |
| | | DateCount = DateCount.replace(/\n\s{6,8}/g, '\n') |
| | | _customScript = _customScript.replace(/\n\s{6,8}/g, '\n') |
| | | LText = LText.replace(/\n\s+\/\*/g, `\n/*`) |
| | | DateCount = DateCount.replace(/\n\s+\/\*/g, `\n/*`) |
| | | _customScript = _customScript.replace(/\n\s+\/\*/g, `\n/*`) |
| | | // LText = LText.replace(/\n\s{6,8}/g, '\n') |
| | | // DateCount = DateCount.replace(/\n\s{6,8}/g, '\n') |
| | | // _customScript = _customScript.replace(/\n\s{6,8}/g, '\n') |
| | | // LText = LText.replace(/\n\s+\/\*/g, `\n/*`) |
| | | // DateCount = DateCount.replace(/\n\s+\/\*/g, `\n/*`) |
| | | // _customScript = _customScript.replace(/\n\s+\/\*/g, `\n/*`) |
| | | |
| | | reps.forEach(n => { |
| | | if (['orderBy', 'pageSize', 'pageIndex', 'mk_rows_begin'].includes(n)) return |
| | | if (['orderBy', 'pageSize', 'pageIndex'].includes(n)) return |
| | | |
| | | LText = LText.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | DateCount = DateCount.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | |
| | | _customScript = _customScript.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(testSql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | // let sql = '' |
| | | // let sub_name = '' |
| | | // let tabid = '' |
| | | // let parid = '' |
| | | // let sub_field = '' |
| | | |
| | | // if (item.subtype === 'dualdatacard') { |
| | | // arr_field = item.columns.map(col => col.field).join(',') |
| | | // sub_name = item.setting.subdata |
| | | // tabid = item.setting.primaryKey || '' |
| | | // parid = item.setting.subBID || '' |
| | | // sub_field = item.subColumns.map(col => col.field).join(',') |
| | | // } |
| | | |
| | | // sql += ` |
| | | // SELECT obj_name='data',prm_field='',str_field='', |
| | | // arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}' |
| | | // ` |
| | | |
| | | // if (DateCount) { |
| | | // sql += `UNION ALL |
| | | // SELECT obj_name='DateCount',prm_field='total',str_field='', |
| | | // arr_field='',tabid='',parid='',sub_name='',sub_field='' |
| | | // ` |
| | | // } |
| | | |
| | | return {LText, DateCount, customScript: _customScript, reps} |
| | | } |
| | |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | return {LText: sql, reps} |
| | | } |
| | |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | return {LText: sql, reps} |
| | | } |
| | |
| | | item.setting.interType = 'system' |
| | | item.setting.execute = btn.verify.defaultSql || 'true' |
| | | item.setting.dataresource = btn.verify.dataresource || '' |
| | | item.setting.primaryKey = btn.verify.primaryKey || '' |
| | | item.setting.queryType = btn.verify.queryType |
| | | item.setting.laypage = btn.pagination |
| | | item.setting.order = btn.verify.order || '' |
| | |
| | | item.setting.interType = 'system' |
| | | item.setting.execute = btn.verify.setting.defaultSql || 'true' |
| | | item.setting.dataresource = btn.verify.setting.dataresource || '' |
| | | item.setting.primaryKey = '' |
| | | item.setting.queryType = btn.verify.setting.queryType |
| | | item.setting.laypage = 'false' |
| | | item.setting.order = btn.verify.setting.order || '' |
| | |
| | | _sql = _sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(_sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | return {LText: _sql, reps} |
| | | } |
| | | |
| | | let getFormSql = (item) => { |
| | | let arrfield = [item.valueField, item.valueText] |
| | | |
| | | if (item.type === 'checkcard') { |
| | | arrfield = item.fields ? item.fields.map(f => f.field) : [] |
| | | arrfield.push(item.cardValField) |
| | | if (item.urlField) { |
| | | arrfield.push(item.urlField) |
| | | } else if (item.colorField) { |
| | | arrfield.push(item.colorField) |
| | | } else if (item.parentField) { |
| | | arrfield.push(item.parentField) |
| | | } |
| | | } |
| | | |
| | | if (item.linkField) { |
| | | arrfield.push(item.linkField) |
| | | } |
| | | if (['select', 'radio', 'link', 'checkcard'].includes(item.type) && item.linkSubField && item.linkSubField.length > 0) { |
| | | arrfield.push(...item.linkSubField) |
| | | } else if (item.type === 'text' && item.editType === 'select' && item.linkSubField && item.linkSubField.length > 0) { // 可编辑表 |
| | | arrfield.push(...item.linkSubField) |
| | | } |
| | | if (item.disableField) { |
| | | arrfield.push(item.disableField) |
| | | } |
| | | |
| | | arrfield = Array.from(new Set(arrfield)) |
| | | |
| | | let _datasource = item.dataSource |
| | | let sql = '' |
| | | |
| | | if (/\s/.test(_datasource)) { // 拼接别名 |
| | | _datasource = '(' + _datasource + ') tb' |
| | | } |
| | | |
| | | arrfield = arrfield.join(',') |
| | | |
| | | if (item.orderBy) { |
| | | sql = `select distinct ${arrfield},${item.orderBy} as orderfield from ${_datasource} order by orderfield ${item.orderType}` |
| | | } else { |
| | | sql = `select distinct ${arrfield} from ${_datasource}` |
| | | } |
| | | |
| | | let reps = [] |
| | | |
| | | let decSql = [] |
| | | let secSql = [] |
| | | |
| | | let syses = ['mk_departmentcode', 'mk_organization', 'mk_user_type'] |
| | | syses.forEach(s => { |
| | | if (new RegExp('@' + s + '[^0-9a-z_]', 'ig').test(sql)) { |
| | | if (['mk_departmentcode', 'mk_organization'].includes(s)) { |
| | | decSql.push(`@${s} nvarchar(512)`) |
| | | } else { |
| | | decSql.push(`@${s} nvarchar(20)`) |
| | | } |
| | | secSql.push(`@${s}=@${s}@`) |
| | | reps.push(s) |
| | | } |
| | | }) |
| | | |
| | | decSql = decSql.join(',') |
| | | secSql = secSql.join(',') |
| | | |
| | | if (decSql) { |
| | | sql = `Declare ${decSql} select ${secSql} |
| | | ${sql} |
| | | ` |
| | | } |
| | | |
| | | let regs = ['ID', 'BID', 'datam', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'lang'] |
| | | |
| | | regs.forEach(s => { |
| | | if (new RegExp('@' + s + '@', 'ig').test(sql)) { |
| | | reps.push(s) |
| | | } |
| | | }) |
| | | |
| | | reps.forEach(n => { |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | return {LText: sql, reps} |
| | | } |
| | | |
| | | let getPopSelectSql = (item) => { |
| | | let arrfield = item.columns.map(f => f.field) |
| | | |
| | | if (item.linkSubField && item.linkSubField.length > 0) { |
| | | item.linkSubField.forEach(n => { |
| | | if (!arrfield.includes(n)) { |
| | | arrfield.push(n) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | arrfield = arrfield.join(',') |
| | | if (/\s/.test(item.dataSource)) { // 拼接别名 |
| | | item.dataSource = '(' + item.dataSource + ') tb' |
| | | } |
| | | |
| | | let sql = '' |
| | | let DateCount = '' |
| | | let _search = '' |
| | | let reps = [] |
| | | let sFields = [] |
| | | |
| | | if (item.searchKey) { |
| | | _search = '@search@' |
| | | sFields = item.searchKey.split(',') |
| | | } |
| | | |
| | | // 不需要单引号:orderBy、pageSize、pageIndex、db |
| | | let regs = [...sFields, 'orderBy', 'pageSize', 'pageIndex', 'ID', 'BID', 'time_id', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'lang', 'datam'] |
| | | |
| | | regs.forEach(s => { |
| | | if (new RegExp('@' + s + '@', 'ig').test(item.dataSource)) { |
| | | reps.push(s) |
| | | } |
| | | }) |
| | | |
| | | if (item.laypage === 'true') { |
| | | sql = `/*system_query*/select top @pageSize@ ${arrfield} from (select ${arrfield} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${item.dataSource} ${_search}) tmptable where rows > @pageSize@ * (@pageIndex@ - 1) order by tmptable.rows ` |
| | | DateCount = `/*system_query*/select count(1) as total from ${item.dataSource} ${_search}` |
| | | |
| | | reps.push('pageSize', 'orderBy', 'pageIndex') |
| | | } else { |
| | | sql = `/*system_query*/select ${arrfield} from ${item.dataSource} ${_search} order by @orderBy@ ` |
| | | reps.push('orderBy') |
| | | } |
| | | |
| | | let decSql = [] |
| | | let secSql = [] |
| | | |
| | | let syses = ['mk_departmentcode', 'mk_organization', 'mk_user_type'] |
| | | syses.forEach(s => { |
| | | if (new RegExp('@' + s + '[^0-9a-z_]', 'ig').test(sql)) { |
| | | if (['mk_departmentcode', 'mk_organization'].includes(s)) { |
| | | decSql.push(`@${s} nvarchar(512)`) |
| | | } else { |
| | | decSql.push(`@${s} nvarchar(20)`) |
| | | } |
| | | secSql.push(`@${s}=@${s}@`) |
| | | reps.push(s) |
| | | } |
| | | }) |
| | | |
| | | decSql = decSql.join(',') |
| | | secSql = secSql.join(',') |
| | | |
| | | if (decSql) { |
| | | sql = `Declare ${decSql} select ${secSql} |
| | | ${sql} |
| | | ` |
| | | } |
| | | |
| | | reps.forEach(n => { |
| | | if (['orderBy', 'pageSize', 'pageIndex'].includes(n)) return |
| | | |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | DateCount = DateCount.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | DateCount = DateCount.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | return {LText: sql, DateCount, reps} |
| | | } |
| | | |
| | | let _mainSearch = [] |
| | |
| | | } |
| | | search.push(...group.fields) |
| | | }) |
| | | |
| | | if (search.length > 0) { |
| | | search.forEach(cell => { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { |
| | | let msg = getFormSql(cell) |
| | | |
| | | sqls.push({uuid: cell.uuid, type: 'sForm', ...msg}) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (search.length > 0) { |
| | |
| | | |
| | | let msg = getDataSource(m, _mainSearch) |
| | | |
| | | sqls.push({uuid: m.uuid, ...msg}) |
| | | sqls.push({uuid: m.uuid, type: 'interface', ...msg}) |
| | | }) |
| | | } |
| | | |
| | |
| | | param.menuname = setting.$name |
| | | } |
| | | |
| | | // if (window.backend && window.GLOB.CacheData.has('sql_' + setting.uuid)) { |
| | | // let item = window.GLOB.CacheData.get('sql_' + setting.uuid) |
| | | |
| | | // let values = { |
| | | // userid: sessionStorage.getItem('UserID') || '', |
| | | // time_id: Utils.getguid(), |
| | | // username: userName, |
| | | // fullname: fullName, |
| | | // roleid: RoleID, |
| | | // mk_departmentcode: departmentcode, |
| | | // mk_organization: organization, |
| | | // mk_user_type: mk_user_type, |
| | | // mk_nation: nation, |
| | | // mk_province: province, |
| | | // mk_city: city, |
| | | // mk_district: district, |
| | | // mk_address: address, |
| | | // orderby: orderBy, |
| | | // pagesize: setting.laypage ? pageSize : '9999', |
| | | // pageindex: pageIndex, |
| | | // id: id || '', |
| | | // bid: BID || '', |
| | | // loginuid: sessionStorage.getItem('LoginUID') || '', |
| | | // sessionuid: localStorage.getItem('SessionUid') || '', |
| | | // appkey: window.GLOB.appkey || '', |
| | | // lang: sessionStorage.getItem('lang'), |
| | | // typename: 'admin', |
| | | // datam: sessionStorage.getItem('dataM') === 'true' ? 'Y' : '', |
| | | // datam_begin: sessionStorage.getItem('dataM') === 'true' ? '/*' : '', |
| | | // datam_end: sessionStorage.getItem('dataM') === 'true' ? '*/' : '', |
| | | // } |
| | | |
| | | // if (setting.hasExtend) { |
| | | // values.mk_time = setting.extendTime |
| | | // } |
| | | // if (setting.$re_year) { |
| | | // values.mk_year = year |
| | | // } |
| | | // if (window.GLOB.externalDatabase !== null) { |
| | | // values.db = window.GLOB.externalDatabase |
| | | // } |
| | | // if (item.works_flow_code) { |
| | | // values.works_flow_code = item.works_flow_code |
| | | // } |
| | | // item.urlkeys.forEach(key => { |
| | | // values[key] = item.urlparam[key] |
| | | // }) |
| | | |
| | | // let Ltext = item.LText |
| | | // let DateCount = item.DateCount |
| | | // let customScript = item.customScript |
| | | |
| | | // item.reps.forEach(n => { |
| | | // let key = n.toLowerCase() |
| | | // if (values.hasOwnProperty(key)) { |
| | | // Ltext = Ltext.replace(new RegExp('@' + key + '@', 'ig'), values[key]) |
| | | // DateCount = DateCount.replace(new RegExp('@' + key + '@', 'ig'), values[key]) |
| | | // customScript = customScript.replace(new RegExp('@' + key + '@', 'ig'), values[key]) |
| | | // } |
| | | // }) |
| | | |
| | | // if (search.length) { |
| | | |
| | | // } |
| | | // } |
| | | |
| | | 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) |
| | |
| | | } |
| | | |
| | | deleteTran = (record) => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | let param = { |
| | | func: 's_sVersion_del', |
| | |
| | | message: '操作成功!', |
| | | duration: 3 |
| | | }) |
| | | _this.getTransList() |
| | | that.getTransList() |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | } |
| | | |
| | | enableTran = (record) => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | let param = { |
| | | func: 's_sVersion_sub', |
| | |
| | | message: '操作成功!', |
| | | duration: 3 |
| | | }) |
| | | _this.getTransList() |
| | | that.getTransList() |
| | | } else { |
| | | Modal.error({ |
| | | title: result.message, |
| | |
| | | } |
| | | |
| | | deleteApp = (record) => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除《' + record.remark + '》吗?', |
| | |
| | | duration: 5 |
| | | }) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | selectApp: null, |
| | | selectSubApp: null, |
| | | loading: true |
| | | }) |
| | | _this.getAppList() |
| | | that.getAppList() |
| | | } else { |
| | | if (result.message.indexOf('kei_no已被菜单使用,不可删除') > -1) { |
| | | result.message = 'kei_no已被菜单使用,不可删除' |
| | |
| | | |
| | | deleteSubApp = (record) => { |
| | | const { selectApp } = this.state |
| | | const _this = this |
| | | const that = this |
| | | |
| | | let param = { |
| | | func: 's_kei_addupt', |
| | |
| | | duration: 5 |
| | | }) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | selectSubApp: null, |
| | | loading: true |
| | | }) |
| | | _this.getAppList() |
| | | that.getAppList() |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | } |
| | | }) |
| | | |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定要执行吗?', |
| | |
| | | message: '执行成功。', |
| | | duration: 3 |
| | | }) |
| | | _this.setState({ |
| | | that.setState({ |
| | | scriptIndex: 1 |
| | | }, () => { |
| | | _this.getScriptList() |
| | | that.getScriptList() |
| | | }) |
| | | } |
| | | resolve() |
| | |
| | | |
| | | trigger = () => { |
| | | const { config, menu, btnTab } = this.props |
| | | const _this = this |
| | | const that = this |
| | | |
| | | if (!config || !menu || !menu.LongParam) { |
| | | notification.warning({ |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execUpdate(resolve, _config) |
| | | that.execUpdate(resolve, _config) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | } |
| | | |
| | | componentDidMount() { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | if (window.GLOB.sysType !== 'cloud') { |
| | | Object.defineProperty(window, 'debugger', { |
| | |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | } |
| | | _this.debugChange() |
| | | that.debugChange() |
| | | } |
| | | }) |
| | | } |
| | |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | |
| | | _this.debugChange() |
| | | that.debugChange() |
| | | } |
| | | } |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | let _this = this |
| | | let that = this |
| | | confirm({ |
| | | title: `确定删除菜单《${item.MenuName}》吗?`, |
| | | content: '', |
| | |
| | | } |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | _this.props.reload() |
| | | that.props.reload() |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | |
| | | logout = () => { |
| | | // 退出登录 |
| | | let _this = this |
| | | let that = this |
| | | confirm({ |
| | | title: '您确定要退出吗?', |
| | | content: '', |
| | | onOk() { |
| | | sessionStorage.clear() |
| | | _this.props.history.replace('/login') |
| | | that.props.history.replace('/login') |
| | | window.location.reload() |
| | | }, |
| | | onCancel() {} |
| | |
| | | } |
| | | |
| | | clear = () => { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | content: 'Are you sure you want to clear all your history requests?', |
| | | onOk() { |
| | | Api.clearInterfaces() |
| | | |
| | | _this.setState({list: [], historys: []}) |
| | | that.setState({list: [], historys: []}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } else if (this.checklog()) { |
| | | if (sessionStorage.getItem('langList') && !config.trans) { |
| | | |
| | | // } else if (window.backend && config.enabled && !config.allSqls) { |
| | | |
| | | } else { |
| | | notification.success({ |
| | | top: 92, |
| | |
| | | delete config.force |
| | | } |
| | | |
| | | // let sqls = [] |
| | | // delete config.allSqls |
| | | // if (window.backend && config.enabled) { |
| | | // sqls = getAllSqls(config) |
| | | |
| | | // config.allSqls = sqls |
| | | // } |
| | | |
| | | if (config.cacheUseful !== 'true') { |
| | | config.components = this.resetSyncQuery(config.components) |
| | | } |
| | |
| | | } |
| | | |
| | | deleteItem = () => { |
| | | const _this = this |
| | | const that = this |
| | | const { editItemId, config } = this.state |
| | | |
| | | confirm({ |
| | |
| | | onOk() { |
| | | config.elements = config.elements.filter(item => item.uuid !== editItemId) |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | config: config, |
| | | editItemId: config.uuid, |
| | | editItemType: config.type, |
| | | formlist: getpageform(config) |
| | | }, () => { |
| | | _this.resetview() |
| | | that.resetview() |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | deleteMenu = (record) => { |
| | | const { app, appViewList } = this.state |
| | | const _this = this |
| | | const that = this |
| | | |
| | | let param = { |
| | | func: 'sPC_MainMenu_Del', |
| | |
| | | message: '操作成功!', |
| | | duration: 3 |
| | | }) |
| | | _this.getMenuList(true) |
| | | that.getMenuList(true) |
| | | |
| | | if (_param) { |
| | | Api.getCloudConfig(_param).then(res => { |
| | |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | _this.setState({appViewList: _appViewList}) |
| | | that.setState({appViewList: _appViewList}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | initTree = () => { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | content: '权限树会重新生成,确定执行吗?', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.getMenuList(true, resolve) |
| | | that.getMenuList(true, resolve) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | } |
| | | |
| | | syncTree = () => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '同步会根据菜单删除或新增节点,确定执行吗?', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.syncMenutree(resolve) |
| | | that.syncMenutree(resolve) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | |
| | | saveTree = () => { |
| | | // const { trees } = this.state |
| | | const _this = this |
| | | const that = this |
| | | |
| | | // if (!trees || trees.length === 0) { |
| | | // notification.warning({ |
| | |
| | | content: '确定执行吗?', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execSave(resolve) |
| | | that.execSave(resolve) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | } else if (this.checklog()) { |
| | | if (sessionStorage.getItem('langList') && !config.trans) { |
| | | |
| | | // } else if (window.backend && config.enabled && !config.allSqls) { |
| | | |
| | | } else { |
| | | notification.success({ |
| | | top: 92, |
| | |
| | | delete config.force |
| | | } |
| | | |
| | | // let sqls = [] |
| | | // delete config.allSqls |
| | | // if (window.backend && config.enabled) { |
| | | // sqls = getAllSqls(config) |
| | | |
| | | // config.allSqls = sqls |
| | | // } |
| | | |
| | | let tbs = [] |
| | | let btns = this.getMenuMessage(tbs) |
| | | let arr = [] |