| | |
| | | "display": "standalone", |
| | | "theme_color": "#000000", |
| | | "background_color": "#ffffff", |
| | | "mk_version": "20250402" |
| | | "mk_version": "20250502" |
| | | } |
| | |
| | | return Promise.reject(response.data) |
| | | } else { |
| | | if (response.data.ErrCode === 'E') { |
| | | if (/死锁/.test(response.data.message)) { |
| | | response.data.message = window.GLOB.dict['server_busy'] || '服务器繁忙,请稍后重试!' |
| | | if (/死锁|尚未从池中获取连接/.test(response.data.message)) { |
| | | response.data.message = (window.GLOB.dict['server_busy'] || '服务器繁忙,请稍后重试!') + (/死锁/.test(response.data.message) ? '01' : '02') |
| | | response.data.ErrMesg = response.data.message |
| | | } else if (/无法打开登录所请求的数据库|在与\s*SQL\s+Server\s*建立连接时出现/.test(response.data.message)) { |
| | | response.data.message = '服务器链接不可用,请关闭浏览器重新打开!' |
| | |
| | | login_id_address: sessionStorage.getItem('ipAddress') || '', |
| | | kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), |
| | | device_id: localStorage.getItem('SessionUid'), |
| | | appkey: window.GLOB.appkey || '' |
| | | appkey: window.GLOB.appkey || '', |
| | | lang: sessionStorage.getItem('lang') || '' |
| | | } |
| | | |
| | | let url = '/webapi/dologon' |
| | |
| | | kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), |
| | | device_id: localStorage.getItem('SessionUid'), |
| | | timestamp: moment().add(shim, 'seconds').format('YYYY-MM-DD HH:mm:ss'), |
| | | appkey: window.GLOB.appkey || '' |
| | | appkey: window.GLOB.appkey || '', |
| | | lang: sessionStorage.getItem('lang') || '' |
| | | } |
| | | |
| | | // Type: 'S' 时 |
| | |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | sessionStorage.clear() |
| | | that.props.history.replace('/login') |
| | | window.location.reload() |
| | | setTimeout(() => { |
| | | that.props.history.replace('/login') |
| | | window.location.reload() |
| | | }, 100) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | GLOB.externalDatabase = null |
| | | } |
| | | |
| | | if (config.probation && /^20\d{2}-\d{2}-\d{2}$/.test(config.probation) && new Date(config.probation).getTime() > new Date().getTime()) { |
| | | if (config.probation && /^[1-9]\d{3}-\d{2}-\d{2}$/.test(config.probation) && new Date(config.probation).getTime() > new Date().getTime()) { |
| | | GLOB.probation = true |
| | | } |
| | | if (config.forcedUpdate && /^20\d{2}-\d{2}-\d{2}$/.test(config.forcedUpdate) && new Date(config.forcedUpdate).getTime() > new Date().getTime()) { |
| | | if (config.forcedUpdate && /^[1-9]\d{3}-\d{2}-\d{2}$/.test(config.forcedUpdate) && new Date(config.forcedUpdate).getTime() > new Date().getTime()) { |
| | | GLOB.forcedUpdate = true |
| | | } |
| | | |
| | |
| | | GLOB.appkey = config.mainkey |
| | | } |
| | | |
| | | let lang = localStorage.getItem(window.location.href.split('#')[0] + 'lang') || GLOB.defLang || 'zh-CN' |
| | | let lang = sessionStorage.getItem('lang') || localStorage.getItem(window.location.href.split('#')[0] + 'lang') || GLOB.defLang || 'zh-CN' |
| | | sessionStorage.setItem('lang', lang) |
| | | |
| | | GLOB.sysSign = GLOB.service + 'admin/' + lang + '/' |
| | |
| | | GLOB.mainlogo = _systemMsg.mainlogo |
| | | GLOB.doclogo = _systemMsg.doclogo |
| | | GLOB.webSite = _systemMsg.webSite |
| | | GLOB.prolType = _systemMsg.prolType || '' |
| | | GLOB.prolCont = _systemMsg.prolCont || '' |
| | | GLOB.style = _systemMsg.style || 'bg_black_style_blue' |
| | | GLOB.showline = _systemMsg.showline || '' |
| | | GLOB.navBar = _systemMsg.navBar || 'shutter' |
| | |
| | | |
| | | document.title = GLOB.platTitle || '' |
| | | |
| | | if (config.filter === 'true' || (/^20\d{2}-\d{2}-\d{2}$/.test(config.filter) && new Date(config.filter).getTime() + 86400000 >= new Date().getTime())) { |
| | | if (config.filter === 'true' || (/^[1-9]\d{3}-\d{2}-\d{2}$/.test(config.filter) && new Date(config.filter).getTime() + 86400000 >= new Date().getTime())) { |
| | | GLOB.filter = true |
| | | } |
| | | |
| | |
| | | |
| | | if (this.record.type === 'prev') { |
| | | shows = ['typeName', 'label', 'actionType'] |
| | | if (this.record.actionType === 'close') { |
| | | shows.push('refreshTab', 'reload') |
| | | } |
| | | } else if (this.record.type === 'next') { |
| | | shows = ['typeName', 'label', 'actionType'] |
| | | } else if (this.record.type === 'close' || this.record.type === 'reset') { |
| | | if (this.record.actionType === 'close') { |
| | | shows.push('refreshTab', 'reload') |
| | | } |
| | | } else if (this.record.type === 'close') { |
| | | shows = ['typeName', 'label', 'refreshTab', 'reload'] |
| | | } else if (this.record.type === 'reset') { |
| | | shows = ['typeName', 'label'] |
| | | } else { |
| | | shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload', 'preButton', 'refreshTab'] // 选项列表 |
| | |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''} mk-size-${card.wrap.searchSize || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''} mk-order-${card.wrap.searchSize || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <FieldsComponent config={card} type="search" /> |
| | | <Switch checkedChildren="开" size="small" unCheckedChildren="关" defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | |
| | | } |
| | | } |
| | | |
| | | .main-search-edit-list.mk-size-small { |
| | | .main-search-edit-list.mk-order-small { |
| | | .page-card { |
| | | height: 45px; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | .main-search-edit-list.mk-order-updown { |
| | | .mk-search-item-wrap { |
| | | .page-card { |
| | | height: auto; |
| | | } |
| | | .ant-form-item { |
| | | display: block; |
| | | .ant-form-item-label { |
| | | display: block; |
| | | width: 100% !important; |
| | | text-align: left; |
| | | float: none; |
| | | line-height: 2; |
| | | height: 24px; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | display: block; |
| | | width: 100% !important; |
| | | float: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .main-search-edit-list:not(.show-field) { |
| | | .ant-form-explain { |
| | |
| | | { |
| | | type: 'radio', |
| | | field: 'searchSize', |
| | | label: '搜索间距', |
| | | initval: wrap.searchSize || 'middle', |
| | | tooltip: '搜索条件的上下间距。', |
| | | label: '搜索样式', |
| | | initval: wrap.searchSize === 'middle' ? '' : wrap.searchSize || '', |
| | | required: false, |
| | | options: [ |
| | | {value: 'middle', label: '默认'}, |
| | | {value: 'small', label: '小'}, |
| | | {value: '', label: '默认'}, |
| | | {value: 'small', label: '小间距'}, |
| | | {value: 'updown', label: '上下排列'}, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'radio', |
| | | field: 'searchSize', |
| | | label: '搜索间距', |
| | | initval: wrap.searchSize || 'middle', |
| | | tooltip: '搜索条件的上下间距。', |
| | | label: '搜索样式', |
| | | initval: wrap.searchSize === 'middle' ? '' : wrap.searchSize || '', |
| | | required: false, |
| | | options: [ |
| | | {value: 'middle', label: '默认'}, |
| | | {value: 'small', label: '小'}, |
| | | {value: '', label: '默认'}, |
| | | {value: 'small', label: '小间距'}, |
| | | {value: 'updown', label: '上下排列'}, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | addSearch = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('plusSearch', card.uuid, {uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '='}, 'simple') |
| | | let ratio = 6 |
| | | |
| | | if (card.search.length) { |
| | | ratio = card.search[card.search.length - 1].ratio |
| | | } |
| | | |
| | | MKEmitter.emit('plusSearch', card.uuid, {uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '=', ratio}, 'simple') |
| | | } |
| | | |
| | | addButton = () => { |
| | |
| | | { |
| | | type: 'radio', |
| | | field: 'searchSize', |
| | | label: '搜索间距', |
| | | initval: wrap.searchSize || 'middle', |
| | | tooltip: '搜索条件的上下间距。', |
| | | label: '搜索样式', |
| | | initval: wrap.searchSize === 'middle' ? '' : wrap.searchSize || '', |
| | | required: false, |
| | | options: [ |
| | | {value: 'middle', label: '默认'}, |
| | | {value: 'small', label: '小'}, |
| | | {value: '', label: '默认'}, |
| | | {value: 'small', label: '小间距'}, |
| | | {value: 'updown', label: '上下排列'}, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | addSearch = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('plusSearch', card.uuid, {uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '='}, 'simple') |
| | | let ratio = 6 |
| | | |
| | | if (card.search.length) { |
| | | ratio = card.search[card.search.length - 1].ratio |
| | | } |
| | | |
| | | MKEmitter.emit('plusSearch', card.uuid, {uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '=', ratio}, 'simple') |
| | | } |
| | | |
| | | addButton = () => { |
| | |
| | | { |
| | | type: 'radio', |
| | | field: 'searchSize', |
| | | label: '搜索间距', |
| | | initval: wrap.searchSize || 'middle', |
| | | tooltip: '搜索条件的上下间距。', |
| | | label: '搜索样式', |
| | | initval: wrap.searchSize === 'middle' ? '' : wrap.searchSize || '', |
| | | required: false, |
| | | options: [ |
| | | {value: 'middle', label: '默认'}, |
| | | {value: 'small', label: '小'}, |
| | | {value: '', label: '默认'}, |
| | | {value: 'small', label: '小间距'}, |
| | | {value: 'updown', label: '上下排列'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | |
| | | return |
| | | } |
| | | |
| | | if (type === 'submit' && config.subtype === 'dualdatacard' && setting.subdata === 'sub_data_string' && !columns.find(col => col.field === 'sub_data_string')) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '主表字段集中需添加 sub_data_string 字段!', |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | | return |
| | | } |
| | | |
| | | if (type === 'change' && columns.length === 0) { |
| | | reject() |
| | | return |
| | |
| | | |
| | | if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let _columns = columns |
| | | if (config.subtype === 'dualdatacard') { |
| | | if (config.subtype === 'dualdatacard' && setting.subdata !== 'sub_data_string') { |
| | | _columns = [...columns, ...subColumns] |
| | | } |
| | | |
| | |
| | | |
| | | drop table #${setting.tableName || 'tb'}${extend} |
| | | |
| | | select top 99999 @mk_total as mk_total * from #${setting.tableName || 'tb'} order by sort_id` |
| | | select top 99999 @mk_total as mk_total, * from #${setting.tableName || 'tb'} order by sort_id` |
| | | |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | |
| | | </Col> : null} |
| | | {config.subtype === 'dualdatacard' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="子表在主表中的数据集名称。"> |
| | | <Tooltip placement="topLeft" title="子表在主表中的数据集名称,使用 sub_data_string 时数据以 JSON 字符串形式返回(字段集中需添加 sub_data_string 字段);当主表字段存在 sub_data_string 且值不为空时,优先使用主表的 sub_data_string。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 子表字段 |
| | | </Tooltip> |
| | |
| | | searches = formatSearch(searches) |
| | | |
| | | let _columns = [] |
| | | if (item.subtype === 'dualdatacard') { |
| | | if (item.subtype === 'dualdatacard' && item.setting.subdata !== 'sub_data_string') { |
| | | _columns = [...item.columns, ...item.subColumns] |
| | | } else if (item.columns) { |
| | | _columns = [...item.columns] |
| | |
| | | m.linkurl = m.linkurl.toLowerCase() |
| | | } |
| | | if (m.modal && m.modal.fields) { |
| | | if (m.modal.setting && m.modal.setting.focus) { |
| | | m.modal.setting.focus = m.modal.setting.focus.toLowerCase() |
| | | if (m.modal.setting) { |
| | | if (m.modal.setting.focus) { |
| | | m.modal.setting.focus = m.modal.setting.focus.toLowerCase() |
| | | } |
| | | if (m.modal.setting.errFocus) { |
| | | m.modal.setting.errFocus = m.modal.setting.errFocus.toLowerCase() |
| | | } |
| | | } |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | resetForm(col) |
| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import { setLangSingleTrans } from '@/utils/utils-custom.js' |
| | | import SettingForm from './settingform' |
| | | import { queryTableSql } from '@/utils/option.js' |
| | | import './index.scss' |
| | |
| | | |
| | | this.execLabel(map) |
| | | } |
| | | } else if (res.resource === 'langs') { |
| | | this.getDicts() |
| | | } else { |
| | | let param = {func: 'sPC_Get_FieldName', TBName: res.table} |
| | | if (window.GLOB.cloudServiceApi) { // 且存在云端地址 |
| | |
| | | }) |
| | | } |
| | | |
| | | getDicts = () => { |
| | | let sql = `select mother_tongue as reg,translation as value,use_type as type,case when use_type='menu' then '菜单' when use_type='button' then '按钮' when use_type='title' then '标题' when use_type='list' then '选项' else '文本' end as use_type_text from s_app_lang_translation where appkey=@appkey@ and deleted=0 and translation != '' and lang='${sessionStorage.getItem('lang') || ''}'` |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: Utils.formatOptions(sql, 'x'), |
| | | obj_name: 'data', |
| | | arr_field: 'reg,value,type', |
| | | exec_type: 'x' |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | |
| | | this.$Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | | confirming: false |
| | | }) |
| | | return |
| | | } else if (!result.data || result.data.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '替换数据为空,请检查当前语言下是否存在语言包!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | | confirming: false |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let btnDict = {} |
| | | let titDict = {} |
| | | let lisDict = {} |
| | | let menuDict = {} |
| | | let regs = [] |
| | | |
| | | result.data.forEach(item => { |
| | | if (item.type === 'button') { |
| | | btnDict[item.reg] = item.value |
| | | } else if (item.type === 'title') { |
| | | titDict[item.reg] = item.value |
| | | } else if (item.type === 'list') { |
| | | lisDict[item.reg] = item.value |
| | | } else if (item.type === 'text') { |
| | | regs.push({reg: new RegExp(item.reg, 'g'), value: item.value, sort: item.reg.length}) |
| | | } else if (item.type === 'menu') { |
| | | menuDict[item.reg] = item.value |
| | | } |
| | | }) |
| | | |
| | | regs.sort((a, b) => b.sort - a.sort) |
| | | |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | setLangSingleTrans(config, btnDict, titDict, lisDict, menuDict, regs) |
| | | |
| | | this.setState({ |
| | | confirming: false, |
| | | visible: false |
| | | }) |
| | | |
| | | if (is(fromJS(this.props.config), fromJS(config))) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '未发现需要替换的信息。', |
| | | duration: 3 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '替换已完成。', |
| | | duration: 3 |
| | | }) |
| | | this.props.updateConfig(config) |
| | | }) |
| | | } |
| | | |
| | | // 依据原字段替换为新字段 |
| | | exec = (map) => { |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let getVal = (val) => { |
| | | let _val = val.toLowerCase() |
| | | if (map[_val]) { |
| | | return map[_val].FieldName |
| | | } |
| | | return val |
| | | } |
| | | |
| | | let resetForm = (m) => { |
| | | if (m.field) { |
| | | m.field = getVal(m.field) |
| | | } |
| | | if (m.type === 'split' && m.splitctrl) { |
| | | m.splitctrl = getVal(m.splitctrl) |
| | | } |
| | | if (m.tabField) { |
| | | m.tabField = getVal(m.tabField) |
| | | } |
| | | if (m.linkField) { |
| | | m.linkField = getVal(m.linkField) |
| | | } |
| | | if (m.supField) { |
| | | m.supField = getVal(m.supField) |
| | | } |
| | | if (m.phoneField) { |
| | | m.phoneField = getVal(m.phoneField) |
| | | } |
| | | if (m.linkSubField) { |
| | | m.linkSubField = m.linkSubField.map(n => getVal(n)) |
| | | m.linkSubField = Array.from(new Set(m.linkSubField)) |
| | | } |
| | | } |
| | | let resetMark = (m) => { |
| | | m.marks = m.marks.map(n => { |
| | | if (n.field && Array.isArray(n.field)) { |
| | | if (n.field[1] === 'static') { |
| | | n.field[0] = getVal(n.field[0]) |
| | | } else { |
| | | if (n.field[0]) { |
| | | n.field[0] = getVal(n.field[0]) |
| | | } |
| | | if (n.field[2]) { |
| | | n.field[2] = getVal(n.field[2]) |
| | | } |
| | | } |
| | | } |
| | | |
| | | return n |
| | | }) |
| | | } |
| | | let resetElement = (m) => { |
| | | if (m.field) { |
| | | m.field = getVal(m.field) |
| | | } |
| | | if (m.posterField) { |
| | | m.posterField = getVal(m.posterField) |
| | | } |
| | | if (m.bgImage) { |
| | | m.bgImage = getVal(m.bgImage) |
| | | } |
| | | if (m.linkurl && /^[a-zA-Z0-9_]+$/.test(m.linkurl)) { |
| | | m.linkurl = getVal(m.linkurl) |
| | | } |
| | | if (m.modal && m.modal.fields) { |
| | | if (m.modal.setting) { |
| | | if (m.modal.setting.focus) { |
| | | m.modal.setting.focus = getVal(m.modal.setting.focus) |
| | | } |
| | | if (m.modal.setting.errFocus) { |
| | | m.modal.setting.errFocus = getVal(m.modal.setting.errFocus) |
| | | } |
| | | } |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | resetForm(col) |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify) { |
| | | if (m.verify.columns) { |
| | | m.verify.columns = m.verify.columns.map(col => { |
| | | if (col.Column) { |
| | | col.Column = getVal(col.Column) |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify.uniques) { |
| | | m.verify.uniques = m.verify.uniques.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.split(',').map(_field => { |
| | | if (_field === 'BID') return _field |
| | | return getVal(_field) |
| | | }).join(',') |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify.billcodes) { |
| | | m.verify.billcodes = m.verify.billcodes.map(col => { |
| | | if (col.field) { |
| | | col.field = getVal(col.field) |
| | | } |
| | | if (col.linkField && col.linkField !== 'BID') { |
| | | col.linkField = getVal(col.linkField) |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | if (m.verify.accountfield && m.verify.accountfield !== 'BID') { |
| | | m.verify.accountfield = getVal(m.verify.accountfield) |
| | | } |
| | | if (m.verify.voucher && m.verify.voucher.linkField && m.verify.voucher.linkField !== 'BID') { |
| | | m.verify.voucher.linkField = getVal(m.verify.voucher.linkField) |
| | | } |
| | | } |
| | | if (m.controlField) { |
| | | m.controlField = getVal(m.controlField) |
| | | } |
| | | |
| | | if (m.marks && m.marks.length) { |
| | | resetMark(m) |
| | | } |
| | | |
| | | if (m.config && m.config.components) { |
| | | m.config.components = _replace(m.config.components) |
| | | } |
| | | } |
| | | |
| | | let _replace = (components) => { |
| | | return components.map(item => { |
| | | if (item.type === 'tabs') { |
| | |
| | | } |
| | | if (item.search) { |
| | | item.search = item.search.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | if (col.field) { |
| | | col.field = getVal(col.field) |
| | | } |
| | | return col |
| | | }) |
| | |
| | | |
| | | if (item.action) { |
| | | item.action.forEach(m => { |
| | | if (m.modal && m.modal.fields) { |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify && m.verify.columns) { |
| | | m.verify.columns = m.verify.columns.map(col => { |
| | | if (col.Column && map[col.Column.toLowerCase()]) { |
| | | col.Column = map[col.Column.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.config && m.config.components) { |
| | | m.config.components = _replace(m.config.components) |
| | | } |
| | | resetElement(m) |
| | | }) |
| | | } |
| | | |
| | | if (item.subcards) { |
| | | item.subcards.forEach(card => { |
| | | if (card.setting) { |
| | | if (card.setting.controlField) { |
| | | card.setting.controlField = getVal(card.setting.controlField) |
| | | } |
| | | if (card.setting.bgField) { |
| | | card.setting.bgField = getVal(card.setting.bgField) |
| | | } |
| | | if (card.setting.menuType) { |
| | | card.setting.menuType = getVal(card.setting.menuType) |
| | | } |
| | | } |
| | | |
| | | if (card.elements) { // 卡片 |
| | | card.elements = card.elements.map(m => { |
| | | if (m.datatype === 'dynamic' && map[m.field.toLowerCase()]) { |
| | | m.field = map[m.field.toLowerCase()].FieldName |
| | | } |
| | | if (m.modal && m.modal.fields) { |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify && m.verify.columns) { |
| | | m.verify.columns = m.verify.columns.map(col => { |
| | | if (col.Column && map[col.Column.toLowerCase()]) { |
| | | col.Column = map[col.Column.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.config && m.config.components) { |
| | | m.config.components = _replace(m.config.components) |
| | | } |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (card.backElements) { // 卡片 |
| | | card.backElements = card.backElements.map(m => { |
| | | if (m.datatype === 'dynamic' && map[m.field.toLowerCase()]) { |
| | | m.field = map[m.field.toLowerCase()].FieldName |
| | | } |
| | | if (m.modal && m.modal.fields) { |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify && m.verify.columns) { |
| | | m.verify.columns = m.verify.columns.map(col => { |
| | | if (col.Column && map[col.Column.toLowerCase()]) { |
| | | col.Column = map[col.Column.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.config && m.config.components) { |
| | | m.config.components = _replace(m.config.components) |
| | | } |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (card.fields) { // 表单 |
| | | card.fields = card.fields.map(m => { |
| | | if (m.field && map[m.field.toLowerCase()]) { |
| | | m.field = map[m.field.toLowerCase()].FieldName |
| | | } |
| | | resetForm(m) |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (card.subButton) { |
| | | resetElement(card.subButton) |
| | | |
| | | if (card.subButton.resetForms) { |
| | | card.subButton.resetForms = card.subButton.resetForms.map(n => getVal(n)) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.elements) { |
| | | item.elements = item.elements.map(m => { |
| | | if (m.datatype === 'dynamic' && map[m.field.toLowerCase()]) { |
| | | m.field = map[m.field.toLowerCase()].FieldName |
| | | } |
| | | if (m.modal && m.modal.fields) { |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify && m.verify.columns) { |
| | | m.verify.columns = m.verify.columns.map(col => { |
| | | if (col.Column && map[col.Column.toLowerCase()]) { |
| | | col.Column = map[col.Column.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.config && m.config.components) { |
| | | m.config.components = _replace(m.config.components) |
| | | } |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (item.plot) { |
| | | if (item.plot.Xaxis && map[item.plot.Xaxis.toLowerCase()]) { |
| | | item.plot.Xaxis = map[item.plot.Xaxis.toLowerCase()].FieldName |
| | | if (item.plot.Xaxis) { |
| | | item.plot.Xaxis = getVal(item.plot.Xaxis) |
| | | } |
| | | // 统计图 |
| | | if (item.plot.InfoValue && map[item.plot.InfoValue.toLowerCase()]) { |
| | | item.plot.InfoValue = map[item.plot.InfoValue.toLowerCase()].FieldName |
| | | if (item.plot.InfoValue) { |
| | | item.plot.InfoValue = getVal(item.plot.InfoValue) |
| | | } |
| | | if (item.plot.InfoType && map[item.plot.InfoType.toLowerCase()]) { |
| | | item.plot.InfoType = map[item.plot.InfoType.toLowerCase()].FieldName |
| | | if (item.plot.InfoType) { |
| | | item.plot.InfoType = getVal(item.plot.InfoType) |
| | | } |
| | | // 占比图 |
| | | if (item.plot.valueField && map[item.plot.valueField.toLowerCase()]) { |
| | | item.plot.valueField = map[item.plot.valueField.toLowerCase()].FieldName |
| | | if (item.plot.valueField) { |
| | | item.plot.valueField = getVal(item.plot.valueField) |
| | | } |
| | | if (item.plot.labelField && map[item.plot.labelField.toLowerCase()]) { |
| | | item.plot.labelField = map[item.plot.labelField.toLowerCase()].FieldName |
| | | if (item.plot.labelField) { |
| | | item.plot.labelField = getVal(item.plot.labelField) |
| | | } |
| | | // 饼图 |
| | | if (item.plot.type && map[item.plot.type.toLowerCase()]) { |
| | | item.plot.type = map[item.plot.type.toLowerCase()].FieldName |
| | | if (item.plot.type) { |
| | | item.plot.type = getVal(item.plot.type) |
| | | } |
| | | // 散点图 |
| | | if (item.plot.gender && map[item.plot.gender.toLowerCase()]) { |
| | | item.plot.gender = map[item.plot.gender.toLowerCase()].FieldName |
| | | if (item.plot.gender) { |
| | | item.plot.gender = getVal(item.plot.gender) |
| | | } |
| | | if (item.Yaxis) { |
| | | if (Array.isArray(item.Yaxis)) { |
| | | item.Yaxis = item.Yaxis.map(m => { |
| | | if (map[m.toLowerCase()]) { |
| | | return map[m.toLowerCase()].FieldName |
| | | } |
| | | return m |
| | | }) |
| | | item.Yaxis = item.Yaxis.map(m => getVal(m)) |
| | | } else { |
| | | if (item.Yaxis && map[item.Yaxis.toLowerCase()]) { |
| | | item.Yaxis = map[item.Yaxis.toLowerCase()].FieldName |
| | | } |
| | | item.Yaxis = getVal(item.Yaxis) |
| | | } |
| | | } |
| | | } |
| | |
| | | return cols.map(col => { |
| | | if (col.type === 'custom' && col.elements) { |
| | | col.elements = col.elements.map(m => { |
| | | if (m.eleType === 'button') { |
| | | if (m.modal && m.modal.fields) { |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify && m.verify.columns) { |
| | | m.verify.columns = m.verify.columns.map(col => { |
| | | if (col.Column && map[col.Column.toLowerCase()]) { |
| | | col.Column = map[col.Column.toLowerCase()].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.config && m.config.components) { |
| | | m.config.components = _replace(m.config.components) |
| | | } |
| | | } else { |
| | | if (m.datatype === 'dynamic' && map[m.field.toLowerCase()]) { |
| | | m.field = map[m.field.toLowerCase()].FieldName |
| | | } |
| | | } |
| | | |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } else if (col.type === 'colspan') { |
| | | col.subcols = _update(col.subcols) |
| | | } else if (col.field) { |
| | | if (map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | } |
| | | col.field = getVal(col.field) |
| | | } |
| | | |
| | | return col |
| | |
| | | } |
| | | |
| | | item.cols = _update(item.cols) |
| | | |
| | | if (item.lineMarks) { |
| | | item.lineMarks = item.lineMarks.map(n => { |
| | | if (n.field && Array.isArray(n.field)) { |
| | | if (n.field[1] === 'static') { |
| | | n.field[0] = getVal(n.field[0]) |
| | | } else { |
| | | if (n.field[0]) { |
| | | n.field[0] = getVal(n.field[0]) |
| | | } |
| | | if (n.field[2]) { |
| | | n.field[2] = getVal(n.field[2]) |
| | | } |
| | | } |
| | | } |
| | | |
| | | return n |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (item.subtype === 'basetable') { |
| | | item.cols = item.cols.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | if (item.subMenus) { |
| | | item.subMenus = item.subMenus.map(m => { |
| | | if (m.setting && m.setting.tip) { |
| | | m.setting.tip = getVal(m.setting.tip) |
| | | } |
| | | return col |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (item.wrap) { |
| | | if (item.wrap.field) { |
| | | item.wrap.field = getVal(item.wrap.field) |
| | | } |
| | | if (item.wrap.tipField) { |
| | | item.wrap.tipField = getVal(item.wrap.tipField) |
| | | } |
| | | if (item.wrap.controlField) { |
| | | item.wrap.controlField = getVal(item.wrap.controlField) |
| | | } |
| | | if (item.wrap.valueField) { |
| | | item.wrap.valueField = getVal(item.wrap.valueField) |
| | | } |
| | | if (item.wrap.labelField) { |
| | | item.wrap.labelField = getVal(item.wrap.labelField) |
| | | } |
| | | if (item.wrap.parentField) { |
| | | item.wrap.parentField = getVal(item.wrap.parentField) |
| | | } |
| | | if (item.wrap.broadcast) { |
| | | item.wrap.broadcast = getVal(item.wrap.broadcast) |
| | | } |
| | | if (item.wrap.jumpField) { |
| | | item.wrap.jumpField = getVal(item.wrap.jumpField) |
| | | } |
| | | if (item.wrap.link) { |
| | | item.wrap.link = getVal(item.wrap.link) |
| | | } |
| | | if (item.wrap.linkField) { |
| | | item.wrap.linkField = getVal(item.wrap.linkField) |
| | | } |
| | | if (item.wrap.focus) { |
| | | item.wrap.focus = getVal(item.wrap.focus) |
| | | } |
| | | if (item.wrap.refocus) { |
| | | item.wrap.refocus = getVal(item.wrap.refocus) |
| | | } |
| | | if (item.wrap.statusControl) { |
| | | item.wrap.statusControl = getVal(item.wrap.statusControl) |
| | | } |
| | | if (item.wrap.timeField) { |
| | | item.wrap.timeField = getVal(item.wrap.timeField) |
| | | } |
| | | if (item.wrap.endField) { |
| | | item.wrap.endField = getVal(item.wrap.endField) |
| | | } |
| | | if (item.wrap.remarkField) { |
| | | item.wrap.remarkField = getVal(item.wrap.remarkField) |
| | | } |
| | | if (item.wrap.colorField) { |
| | | item.wrap.colorField = getVal(item.wrap.colorField) |
| | | } |
| | | if (item.wrap.menuType) { |
| | | item.wrap.menuType = getVal(item.wrap.menuType) |
| | | } |
| | | |
| | | if (item.type === 'timeline') { |
| | | if (item.wrap.label) { |
| | | item.wrap.label = getVal(item.wrap.label) |
| | | } |
| | | if (item.wrap.node) { |
| | | item.wrap.node = getVal(item.wrap.node) |
| | | } |
| | | } |
| | | } |
| | | |
| | | return item |
| | |
| | | confirming: false, |
| | | visible: false |
| | | }) |
| | | |
| | | if (is(fromJS(this.props.config), fromJS(config))) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '未查询到需要替换的字段。', |
| | | duration: 3 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | |
| | | item.cols = _update(item.cols) |
| | | } |
| | | |
| | | if (item.subtype === 'basetable') { |
| | | item.cols = item.cols.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.label = map[col.field.toLowerCase()].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | } |
| | |
| | | visible: false |
| | | }) |
| | | |
| | | if (is(fromJS(this.props.config), fromJS(config))) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '未查询到需要替换的字段。', |
| | | duration: 3 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '更新已完成。', |
| | |
| | | <Radio.Group onChange={(e) => {this.setState({resource: e.target.value});this.props.form.setFieldsValue({reType: 'field'})}}> |
| | | <Radio value="dict">数据字典</Radio> |
| | | <Radio value="custom">自定义</Radio> |
| | | <Radio value="langs">语言包</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={20}> |
| | | {resource !== 'langs' ? <Col span={20}> |
| | | <Form.Item label="替换依据"> |
| | | {getFieldDecorator('reType', { |
| | | initialValue: 'field' |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | {resource === 'dict' ? <Col span={20}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="用于字段替换的表名。"> |
| | |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: MenuID |
| | | } |
| | | |
| | | if (window.GLOB.mkHS) { |
| | | _param.lang = 'zh-CN' |
| | | } |
| | | |
| | | let result = await Api.getCacheConfig(_param) |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | _config.setting.sub_field = subconfig.columns.map(col => col.field).join(',') |
| | | _config.setting.all_field = _config.setting.arr_field + ',' + _config.setting.sub_field |
| | | if (_config.setting.subdata !== 'sub_data_string') { |
| | | _config.setting.sub_field = subconfig.columns.map(col => col.field).join(',') |
| | | _config.setting.all_field = _config.setting.arr_field + ',' + _config.setting.sub_field |
| | | } |
| | | |
| | | let pageOptions = ['10', '25', '50', '100', '500', '1000'] |
| | | |
| | |
| | | if (config.$cache) { |
| | | let getData = (res) => { |
| | | return res.map((item, index) => { |
| | | let _children = item[config.setting.subdata] |
| | | |
| | | delete item[config.setting.subdata] |
| | | if (config.setting.subdata === 'sub_data_string') { |
| | | _children = this.parseSubData(_children) |
| | | } else if (item.sub_data_string) { |
| | | _children = this.parseSubData(item.sub_data_string) |
| | | } |
| | | |
| | | let children = [] |
| | | |
| | | if (item[config.setting.subdata]) { |
| | | let _children = item[config.setting.subdata] |
| | | |
| | | delete item[config.setting.subdata] |
| | | |
| | | if (_children) { |
| | | _children.forEach((cell, i) => { |
| | | cell.key = i |
| | | cell.$$uuid = cell[config.setting.subKey] || '' |
| | |
| | | this.loadData() |
| | | }, config.setting.delay || 0) |
| | | } |
| | | } |
| | | |
| | | parseSubData = (data) => { |
| | | try { |
| | | data = JSON.parse(data) |
| | | if (typeof(data) !== 'object') { |
| | | data = [] |
| | | } else if (!Array.isArray(data)) { |
| | | data = [data] |
| | | } |
| | | } catch(e) { |
| | | console.warn('Data parsing error.') |
| | | data = [] |
| | | } |
| | | return data |
| | | } |
| | | |
| | | autoExec = (times) => { |
| | |
| | | if (type === 'plus') { |
| | | let _data = (this.state.data || []).concat(result.data || []) |
| | | data = _data.map((item, index) => { |
| | | if (item[config.setting.subdata]) { |
| | | let children = [] |
| | | let _children = item[config.setting.subdata] |
| | | let _children = item[config.setting.subdata] |
| | | |
| | | delete item[config.setting.subdata] |
| | | if (config.setting.subdata === 'sub_data_string') { |
| | | _children = this.parseSubData(_children) |
| | | } else if (item.sub_data_string) { |
| | | _children = this.parseSubData(item.sub_data_string) |
| | | } |
| | | |
| | | delete item[config.setting.subdata] |
| | | |
| | | let children = [] |
| | | if (_children) { |
| | | _children.forEach((cell, i) => { |
| | | cell.key = i |
| | | cell.$$uuid = cell[config.setting.subKey] || '' |
| | |
| | | children.push(cell) |
| | | } |
| | | }) |
| | | item.children = children |
| | | } else if (!item.children) { |
| | | item.children = [] |
| | | } |
| | | |
| | | item.children = children |
| | | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | |
| | | }) |
| | | } else { |
| | | data = result.data.map((item, index) => { |
| | | let _children = item[config.setting.subdata] |
| | | |
| | | delete item[config.setting.subdata] |
| | | if (config.setting.subdata === 'sub_data_string') { |
| | | _children = this.parseSubData(_children) |
| | | } else if (item.sub_data_string) { |
| | | _children = this.parseSubData(item.sub_data_string) |
| | | } |
| | | |
| | | let children = [] |
| | | |
| | | if (item[config.setting.subdata]) { |
| | | let _children = item[config.setting.subdata] |
| | | |
| | | delete item[config.setting.subdata] |
| | | |
| | | if (_children) { |
| | | _children.forEach((cell, i) => { |
| | | cell.key = i |
| | | cell.$$uuid = cell[config.setting.subKey] || '' |
| | |
| | | |
| | | data = data.map(item => { |
| | | if (item.$$uuid === _data.$$uuid) { |
| | | let _children = _data[config.setting.subdata] |
| | | |
| | | delete _data[config.setting.subdata] |
| | | |
| | | if (config.setting.subdata === 'sub_data_string') { |
| | | _children = this.parseSubData(_children) |
| | | } else if (_data.sub_data_string) { |
| | | _children = this.parseSubData(_data.sub_data_string) |
| | | } |
| | | |
| | | let children = [] |
| | | |
| | | if (_data[config.setting.subdata]) { |
| | | let _children = _data[config.setting.subdata] |
| | | |
| | | delete _data[config.setting.subdata] |
| | | |
| | | if (_children) { |
| | | _children.forEach((cell, i) => { |
| | | cell.key = i |
| | | cell.$$uuid = cell[config.setting.subKey] || '' |
| | |
| | | const { group } = this.state |
| | | |
| | | MKEmitter.emit('closeTabView', group.subButton.$MenuID) |
| | | |
| | | let tabId = '' |
| | | if (group.closeButton.refreshTab && group.closeButton.refreshTab.length > 0 && window.GLOB.appType !== 'pc') { |
| | | tabId = group.closeButton.refreshTab[group.closeButton.refreshTab.length - 1] |
| | | } |
| | | if (tabId && group.subButton.$MenuID !== tabId) { // 刷新当前菜单时无效 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | } |
| | | } |
| | | |
| | | resetTab = () => { |
| | |
| | | |
| | | if (group.prevButton.actionType === 'close') { |
| | | MKEmitter.emit('closeTabView', group.subButton.$MenuID) |
| | | |
| | | let tabId = '' |
| | | if (group.prevButton.refreshTab && group.prevButton.refreshTab.length > 0 && window.GLOB.appType !== 'pc') { |
| | | tabId = group.prevButton.refreshTab[group.prevButton.refreshTab.length - 1] |
| | | } |
| | | if (tabId && group.subButton.$MenuID !== tabId) { // 刷新当前菜单时无效 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | } |
| | | return |
| | | } |
| | | |
| | |
| | | |
| | | if (group.nextButton.actionType === 'close') { |
| | | MKEmitter.emit('closeTabView', group.subButton.$MenuID) |
| | | |
| | | let tabId = '' |
| | | if (group.nextButton.refreshTab && group.nextButton.refreshTab.length > 0 && window.GLOB.appType !== 'pc') { |
| | | tabId = group.nextButton.refreshTab[group.nextButton.refreshTab.length - 1] |
| | | } |
| | | if (tabId && group.subButton.$MenuID !== tabId) { // 刷新当前菜单时无效 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | } |
| | | return |
| | | } |
| | | |
| | |
| | | let sup_data = [] |
| | | let voucherMap = new Map() |
| | | let supMap = new Map() |
| | | let extract = localStorage.getItem(window.GLOB.host + '_voucher_extract') |
| | | let extract = localStorage.getItem(window.GLOB.sysSign + '_voucher_extract') |
| | | extract = extract ? JSON.parse(extract) : [] |
| | | |
| | | data.forEach(item => { |
| | |
| | | if (extract.length > 20) { |
| | | extract.length = 20 |
| | | } |
| | | localStorage.setItem(window.GLOB.host + '_voucher_extract', JSON.stringify(extract)) |
| | | localStorage.setItem(window.GLOB.sysSign + '_voucher_extract', JSON.stringify(extract)) |
| | | } |
| | | |
| | | voucherMap.forEach(item => { |
| | |
| | | extra = <PlusOutlined onClick={this.plusLine}/> |
| | | |
| | | if (editing) { |
| | | let options = localStorage.getItem(window.GLOB.host + '_voucher_extract') |
| | | let options = localStorage.getItem(window.GLOB.sysSign + '_voucher_extract') |
| | | options = options ? JSON.parse(options) : [] |
| | | |
| | | children = <AutoComplete |
| | |
| | | MenuID: MenuID |
| | | } |
| | | |
| | | if (window.GLOB.mkHS) { |
| | | _param.lang = 'zh-CN' |
| | | } |
| | | |
| | | let result = await Api.getCacheConfig(_param) |
| | | |
| | | if (result.status) { |
| | |
| | | |
| | | let param = { |
| | | func: 's_rolemenu_get_Menulist', |
| | | RoleID: selectRoleId |
| | | RoleID: selectRoleId, |
| | | version: 1 |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | RoleID: selectRoleId, |
| | | TypeCharOne: selectApp.kei_no, |
| | | typename: selectSubApp.typename, |
| | | lang: selectSubApp.lang |
| | | lang: selectSubApp.lang, |
| | | version: 1 |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | let _param = { id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM')} |
| | | let item = data[0] |
| | | |
| | | Object.keys(item).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (typeof(item[key]) !== 'string' && typeof(item[key]) !== 'number') return |
| | | if (typeof(item[key]) === 'string' && item[key].length > 50) return |
| | | if (['id', 'tempid', 'pageid', 'datam'].includes(key.toLowerCase())) return |
| | | |
| | | _param[key.toLowerCase()] = item[key] |
| | | }) |
| | | if (item) { |
| | | Object.keys(item).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (typeof(item[key]) !== 'string' && typeof(item[key]) !== 'number') return |
| | | if (typeof(item[key]) === 'string' && item[key].length > 50) return |
| | | if (['id', 'tempid', 'pageid', 'datam'].includes(key.toLowerCase())) return |
| | | |
| | | _param[key.toLowerCase()] = item[key] |
| | | }) |
| | | } |
| | | |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))) |
| | | } |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | |
| | | if (window.backend && btn.outerFunc && ['bd_workers_create_user_sso', 's_susers_del', 's_susers_add', 's_susers_update', 's_susers_start', 's_susers_admin'].includes(btn.outerFunc)) { |
| | | this.clearBackSqlCache() |
| | | if (window.backend && btn.outerFunc && ['bd_workers_create_user_sso', 's_susers_del', 's_susers_add', 's_susers_update', 's_susers_start', 's_susers_admin'].includes(btn.outerFunc.toLowerCase())) { |
| | | setTimeout(() => { |
| | | this.clearBackSqlCache() |
| | | }, 300) |
| | | } |
| | | |
| | | if (btn.openmenu && Array.isArray(btn.openmenu) && btn.openmenu.length > 0 && sign !== '@no_target_menu@') { |
| | |
| | | _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}} |
| | | _setting.borderRadius = config.wrap.borderRadius |
| | | _setting.resetContrl = config.wrap.resetContrl || 'init' |
| | | _setting.size = config.wrap.searchSize || '' |
| | | _setting.order = config.wrap.searchSize || '' |
| | | |
| | | if (config.wrap.searchBtn === 'show') { |
| | | _setting.showBtn = true |
| | |
| | | |
| | | return ( |
| | | <> |
| | | <Form {...formItemLayout} className={`mk-search-wrap mk-float-${setting.float} mk-size-${setting.size}`} style={setting.style}> |
| | | <Form {...formItemLayout} className={`mk-search-wrap mk-float-${setting.float} mk-order-${setting.order}`} style={setting.style}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | {advanceValues.length && (setting.advanceType !== 'pulldown' || (setting.advanceType === 'pulldown' && !visible)) ? <Row gutter={24}> |
| | | <div className="advanced-list"> |
| | |
| | | text-align: right; |
| | | } |
| | | } |
| | | .mk-search-wrap.mk-size-small { |
| | | .mk-search-wrap.mk-order-small { |
| | | .ant-form-item, .search-button { |
| | | min-height: 45px; |
| | | } |
| | | } |
| | | .mk-search-wrap.mk-order-updown { |
| | | .mk-search-col { |
| | | .ant-form-item { |
| | | display: block; |
| | | min-height: auto; |
| | | margin-bottom: 15px; |
| | | |
| | | .ant-form-item-label { |
| | | display: block; |
| | | width: 100% !important; |
| | | text-align: left; |
| | | float: none; |
| | | line-height: 2; |
| | | height: 24px; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | display: block; |
| | | width: 100% !important; |
| | | float: none; |
| | | } |
| | | } |
| | | } |
| | | .mk-search-col:last-child { |
| | | .ant-form-item { |
| | | margin-bottom: 20px; |
| | | } |
| | | } |
| | | } |
| | | .mk-search-drawer { |
| | | .ant-drawer-wrapper-body { |
| | | position: relative; |
| | |
| | | |
| | | let size = '' |
| | | if (config.wrap && config.wrap.searchSize) { |
| | | size = ' mk-size-' + config.wrap.searchSize |
| | | size = ' mk-order-' + config.wrap.searchSize |
| | | } |
| | | |
| | | return ( |
| | |
| | | } |
| | | } |
| | | } |
| | | .model-table-search-list.mk-size-small { |
| | | .model-table-search-list.mk-order-small { |
| | | .page-card { |
| | | height: 45px; |
| | | } |
| | |
| | | height: 45px!important; |
| | | } |
| | | } |
| | | } |
| | | .model-table-search-list.mk-order-updown { |
| | | .mk-search-item-wrap { |
| | | .page-card { |
| | | height: auto; |
| | | } |
| | | .ant-form-item { |
| | | display: block; |
| | | .ant-form-item-label { |
| | | display: block; |
| | | width: 100% !important; |
| | | text-align: left; |
| | | float: none; |
| | | line-height: 2; |
| | | height: 24px; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | display: block; |
| | | width: 100% !important; |
| | | float: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (/,\./ig.test(sql)) { |
| | | let lines = [] |
| | | sql.split(/\n/).forEach((s, i) => { |
| | | if (/,\./ig.test(s)) { |
| | | lines.push(i + 1) |
| | | } |
| | | }) |
| | | |
| | | lines = lines.join('、') |
| | | lines = lines ? '(第' + lines + '行)' : '' |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: label + `${lines},不可出现英文逗号,.`, |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (/\.,/ig.test(sql)) { |
| | | let lines = [] |
| | | sql.split(/\n/).forEach((s, i) => { |
| | | if (/\.,/ig.test(s)) { |
| | | lines.push(i + 1) |
| | | } |
| | | }) |
| | | |
| | | lines = lines.join('、') |
| | | lines = lines ? '(第' + lines + '行)' : '' |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: label + `${lines},不可出现英文逗号.,`, |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (/‘|’/ig.test(sql)) { |
| | | let lines = [] |
| | | sql.split(/\n/).forEach((s, i) => { |
| | |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (/,\./ig.test(sql)) { |
| | | let lines = [] |
| | | sql.split(/\n/).forEach((s, i) => { |
| | | if (/,\./ig.test(s)) { |
| | | lines.push(i + 1) |
| | | } |
| | | }) |
| | | |
| | | lines = lines.join('、') |
| | | lines = lines ? '(第' + lines + '行)' : '' |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: label + `${lines},不可出现英文逗号,.`, |
| | | duration: 5 |
| | | }) |
| | | } else if (/\.,/ig.test(sql)) { |
| | | let lines = [] |
| | | sql.split(/\n/).forEach((s, i) => { |
| | | if (/\.,/ig.test(s)) { |
| | | lines.push(i + 1) |
| | | } |
| | | }) |
| | | |
| | | lines = lines.join('、') |
| | | lines = lines ? '(第' + lines + '行)' : '' |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: label + `${lines},不可出现英文逗号.,`, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | return true |
| | |
| | | * @description 获取语言转换信息 |
| | | */ |
| | | export function getLangTrans (config) { |
| | | if (sessionStorage.getItem('lang') !== 'zh-CN') return '' |
| | | |
| | | let langList = sessionStorage.getItem('langList') |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | |
| | | langList = sessionStorage.getItem('applangList') |
| | | } |
| | | |
| | | if (!langList) return |
| | | |
| | | let defLang = '' |
| | | if (!langList) return '' |
| | | |
| | | try { |
| | | langList = JSON.parse(langList) |
| | | defLang = langList[0] |
| | | } catch (e) { |
| | | defLang = '' |
| | | langList = '' |
| | | } |
| | | |
| | | if (!defLang) return '' |
| | | if (!langList) return '' |
| | | |
| | | langList = langList.filter(n => n !== 'zh-CN') |
| | | |
| | | if (langList.length === 0) return '' |
| | | |
| | | let sql = [] |
| | | let btn = [] |
| | |
| | | let filterBtn = (btn) => { |
| | | if (!btn.verify) return |
| | | |
| | | btn.verify.columns && btn.verify.columns.forEach(col => { |
| | | if (col.Text) { |
| | | sql.push(col.Text) |
| | | } |
| | | }) |
| | | |
| | | btn.verify.customverifys && btn.verify.customverifys.forEach(script => { |
| | | filterSql(script.sql) |
| | | |
| | | if (script.errmsg) { |
| | | sql.push(script.errmsg) |
| | | } |
| | | }) |
| | | btn.verify.scripts && btn.verify.scripts.forEach(script => { |
| | | filterSql(script.sql) |
| | |
| | | } else { |
| | | if (item.wrap && item.wrap.title) { |
| | | sql.push(item.wrap.title) |
| | | } |
| | | if (item.plot && item.plot.title) { |
| | | sql.push(item.plot.title) |
| | | } |
| | | |
| | | if (item.setting && (!item.wrap || !item.wrap.datatype || item.wrap.datatype === 'dynamic')) { |
| | |
| | | text = text.filter(Boolean) |
| | | menu = menu.filter(Boolean) |
| | | |
| | | sql = sql.map(n => n.replace(/(:|:)$/g, '')) |
| | | sql = sql.map(n => n.replace(/^\s+|\s+$/g, '').replace(/(:|:)$/g, '')) |
| | | btn = btn.map(n => n.replace(/^\s+|\s+$/g, '')) |
| | | ops = ops.map(n => n.replace(/^\s+|\s+$/g, '')) |
| | | menu = menu.map(n => n.replace(/^\s+|\s+$/g, '')) |
| | | |
| | | sql = sql.filter(Boolean) |
| | | btn = btn.filter(Boolean) |
| | | ops = ops.filter(Boolean) |
| | | menu = menu.filter(Boolean) |
| | | |
| | | sql = Array.from(new Set(sql)) |
| | | btn = Array.from(new Set(btn)) |
| | |
| | | let result = [] |
| | | |
| | | langList.forEach(lan => { |
| | | if (lan === defLang) return |
| | | |
| | | list.forEach(n => { |
| | | result.push(`'${lan}',${n}`) |
| | | }) |
| | |
| | | } |
| | | |
| | | let replaceTitle = (val) => { |
| | | let s = '' |
| | | let e = '' |
| | | if (/^\s+/g) { |
| | | val = val.replace(/^\s+/g, (w) => { |
| | | s = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/\s+$/g) { |
| | | val = val.replace(/\s+$/g, (w) => { |
| | | e = w |
| | | return '' |
| | | }) |
| | | } |
| | | |
| | | if (/(:|:)$/g.test(val)) { |
| | | let _val = val.replace(/(:|:)$/g, '') |
| | | if (titDict[_val]) { |
| | |
| | | } else if (titDict[val]) { |
| | | val = titDict[val] |
| | | } |
| | | |
| | | val = s + val + e |
| | | |
| | | return val |
| | | } |
| | | |
| | | let replaceBtn = (val) => { |
| | | let s = '' |
| | | let e = '' |
| | | if (/^\s+/g) { |
| | | val = val.replace(/^\s+/g, (w) => { |
| | | s = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/\s+$/g) { |
| | | val = val.replace(/\s+$/g, (w) => { |
| | | e = w |
| | | return '' |
| | | }) |
| | | } |
| | | |
| | | if (btnDict[val]) { |
| | | val = btnDict[val] |
| | | } |
| | | |
| | | val = s + val + e |
| | | |
| | | return val |
| | | } |
| | | |
| | | let replaceList = (val) => { |
| | | let s = '' |
| | | let e = '' |
| | | if (/^\s+/g) { |
| | | val = val.replace(/^\s+/g, (w) => { |
| | | s = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/\s+$/g) { |
| | | val = val.replace(/\s+$/g, (w) => { |
| | | e = w |
| | | return '' |
| | | }) |
| | | } |
| | | |
| | | if (lisDict[val]) { |
| | | val = lisDict[val] |
| | | } |
| | | |
| | | val = s + val + e |
| | | |
| | | return val |
| | | } |
| | | |
| | | let replaceMenu = (val) => { |
| | | let s = '' |
| | | let e = '' |
| | | if (/^\s+/g) { |
| | | val = val.replace(/^\s+/g, (w) => { |
| | | s = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/\s+$/g) { |
| | | val = val.replace(/\s+$/g, (w) => { |
| | | e = w |
| | | return '' |
| | | }) |
| | | } |
| | | |
| | | if (menuDict[val]) { |
| | | val = menuDict[val] |
| | | } |
| | | |
| | | val = s + val + e |
| | | |
| | | return val |
| | | } |
| | |
| | | } |
| | | |
| | | let filterBtn = (btn) => { |
| | | if (btn.label && btnDict[btn.label]) { |
| | | btn.label = btnDict[btn.label] |
| | | if (btn.label) { |
| | | btn.label = replaceBtn(btn.label) |
| | | } |
| | | |
| | | if (btn.OpenType === 'tab' && btn.linkmenu) { |
| | |
| | | |
| | | if (!btn.verify) return |
| | | |
| | | btn.verify.columns && btn.verify.columns.forEach(col => { |
| | | if (col.Text) { |
| | | col.Text = replaceTitle(col.Text) |
| | | } |
| | | }) |
| | | |
| | | btn.verify.uniques && btn.verify.uniques.forEach(col => { |
| | | if (col.fieldlabel) { |
| | | col.fieldlabel = col.fieldlabel.split(',').map(n => replaceTitle(n)).join(',') |
| | | } |
| | | }) |
| | | |
| | | btn.verify.customverifys && btn.verify.customverifys.forEach(script => { |
| | | script.sql = filterSql(script.sql) |
| | | |
| | | if (script.errmsg) { |
| | | script.errmsg = replaceTitle(script.errmsg) |
| | | } |
| | | }) |
| | | btn.verify.scripts && btn.verify.scripts.forEach(script => { |
| | | script.sql = filterSql(script.sql) |
| | |
| | | n.dataSource = filterSql(n.dataSource) |
| | | } else if (n.options) { |
| | | n.options.forEach(o => { |
| | | if (o.Text && lisDict[o.Text]) { |
| | | o.Text = lisDict[o.Text] |
| | | if (o.Text) { |
| | | o.Text = replaceList(o.Text) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } else { |
| | | if (item.wrap && item.wrap.title) { |
| | | item.wrap.title = replaceTitle(item.wrap.title) |
| | | } |
| | | if (item.plot && item.plot.title) { |
| | | item.plot.title = replaceTitle(item.plot.title) |
| | | } |
| | | if (item.wrap && (item.wrap.click === 'menu' || item.wrap.click === 'menus')) { |
| | | if (item.wrap.click === 'menu') { |
| | |
| | | item.wrap.linkmenu = item.wrap.linkmenu.slice(0, 24) + tail |
| | | } else if (item.type === 'menubar') { |
| | | item.subMenus = item.subMenus.map(cell => { |
| | | if (cell.setting.name && menuDict[cell.setting.name]) { |
| | | cell.setting.name = menuDict[cell.setting.name] |
| | | if (cell.setting.name) { |
| | | cell.setting.name = replaceMenu(cell.setting.name) |
| | | } |
| | | if (cell.setting.type === 'linkmenu') { |
| | | cell.setting.linkMenuId = cell.setting.linkMenuId.slice(0, 24) + tail |
| | |
| | | } else if (card.setting.click === 'menu') { |
| | | resetMenu(card.setting) |
| | | } |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | filterBtn(cell) |
| | | if (cell.OpenType === 'popview' && cell.config) { |
| | | traversal(cell.config.components) |
| | | } else if (cell.OpenType === 'pop') { |
| | | if (cell.modal && cell.modal.fields.length) { |
| | | cell.modal.fields.forEach(n => { |
| | | filterForm(n) |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | filterElement(cell) |
| | | } |
| | | }) |
| | | card.backElements && card.backElements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | filterBtn(cell) |
| | | if (cell.OpenType === 'popview' && cell.config) { |
| | | traversal(cell.config.components) |
| | | } else if (cell.OpenType === 'pop') { |
| | | if (cell.modal && cell.modal.fields.length) { |
| | | cell.modal.fields.forEach(n => { |
| | | filterForm(n) |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | filterElement(cell) |
| | | } |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | filterBtn(cell) |
| | | if (cell.OpenType === 'popview' && cell.config) { |
| | | traversal(cell.config.components) |
| | | } else if (cell.OpenType === 'pop') { |
| | | if (cell.modal && cell.modal.fields.length) { |
| | | cell.modal.fields.forEach(n => { |
| | | filterForm(n) |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | filterElement(cell) |
| | | } |
| | | }) |
| | | } else if (item.type === 'table') { |
| | | let loopCol = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.label) { |
| | | col.label = replaceTitle(col.label) |
| | | } |
| | | if (col.prefix) { |
| | | col.prefix = replaceTitle(col.prefix) |
| | | } |
| | | if (col.postfix) { |
| | | col.postfix = replaceTitle(col.postfix) |
| | | } |
| | | if (col.type === 'colspan') { |
| | | loopCol(col.subcols) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | filterBtn(cell) |
| | | if (cell.OpenType === 'popview' && cell.config) { |
| | | traversal(cell.config.components) |
| | | } else if (cell.OpenType === 'pop') { |
| | | if (cell.modal && cell.modal.fields.length) { |
| | | cell.modal.fields.forEach(n => { |
| | | filterForm(n) |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | filterElement(cell) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | loopCol(item.cols) |
| | | } else if (item.type === 'form') { |
| | | item.subcards.forEach(cell => { |
| | | filterBtn(cell.subButton) |
| | | cell.fields.forEach(n => { |
| | | filterForm(n) |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (config.interfaces) { |
| | | config.interfaces.forEach(item => { |
| | | if (item.setting.interType === 'system') { |
| | | item.setting.dataresource = filterSql(item.setting.dataresource) |
| | | item.scripts && item.scripts.forEach(script => { |
| | | script.sql = filterSql(script.sql) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | traversal(config.components) |
| | | } |
| | | |
| | | /** |
| | | * @description 语言转换 |
| | | */ |
| | | export function setLangSingleTrans (config, btnDict, titDict, lisDict, menuDict, regs) { |
| | | let filterElement = (card) => { |
| | | if (card.datatype === 'static' && card.eleType === 'text' && !/@.+@/g.test(card.value)) { |
| | | if (card.value) { |
| | | card.value = replaceTitle(card.value) |
| | | } |
| | | } |
| | | if (card.prefix) { |
| | | card.prefix = replaceTitle(card.prefix) |
| | | } |
| | | if (card.postfix) { |
| | | card.postfix = replaceTitle(card.postfix) |
| | | } |
| | | } |
| | | |
| | | let replaceTitle = (val) => { |
| | | let s = '' |
| | | let e = '' |
| | | if (/^\s+/g) { |
| | | val = val.replace(/^\s+/g, (w) => { |
| | | s = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/\s+$/g) { |
| | | val = val.replace(/\s+$/g, (w) => { |
| | | e = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/(:|:)$/g.test(val)) { |
| | | let _val = val.replace(/(:|:)$/g, '') |
| | | if (titDict[_val]) { |
| | | val = titDict[_val] + val.substr(-1) |
| | | } else if (titDict[val]) { |
| | | val = titDict[val] |
| | | } |
| | | } else if (titDict[val]) { |
| | | val = titDict[val] |
| | | } |
| | | |
| | | val = s + val + e |
| | | |
| | | return val |
| | | } |
| | | |
| | | let replaceBtn = (val) => { |
| | | let s = '' |
| | | let e = '' |
| | | if (/^\s+/g) { |
| | | val = val.replace(/^\s+/g, (w) => { |
| | | s = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/\s+$/g) { |
| | | val = val.replace(/\s+$/g, (w) => { |
| | | e = w |
| | | return '' |
| | | }) |
| | | } |
| | | |
| | | if (btnDict[val]) { |
| | | val = btnDict[val] |
| | | } |
| | | |
| | | val = s + val + e |
| | | |
| | | return val |
| | | } |
| | | |
| | | let replaceList = (val) => { |
| | | let s = '' |
| | | let e = '' |
| | | if (/^\s+/g) { |
| | | val = val.replace(/^\s+/g, (w) => { |
| | | s = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/\s+$/g) { |
| | | val = val.replace(/\s+$/g, (w) => { |
| | | e = w |
| | | return '' |
| | | }) |
| | | } |
| | | |
| | | if (lisDict[val]) { |
| | | val = lisDict[val] |
| | | } |
| | | |
| | | val = s + val + e |
| | | |
| | | return val |
| | | } |
| | | |
| | | let replaceMenu = (val) => { |
| | | let s = '' |
| | | let e = '' |
| | | if (/^\s+/g) { |
| | | val = val.replace(/^\s+/g, (w) => { |
| | | s = w |
| | | return '' |
| | | }) |
| | | } |
| | | if (/\s+$/g) { |
| | | val = val.replace(/\s+$/g, (w) => { |
| | | e = w |
| | | return '' |
| | | }) |
| | | } |
| | | |
| | | if (menuDict[val]) { |
| | | val = menuDict[val] |
| | | } |
| | | |
| | | val = s + val + e |
| | | |
| | | return val |
| | | } |
| | | |
| | | let getuuid = () => { |
| | | let uuid = [] |
| | | let _options = '0123456789abcdefghigklmnopqrstuv' |
| | | for (let i = 0; i < 19; i++) { |
| | | uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) |
| | | } |
| | | return uuid.join('') |
| | | } |
| | | |
| | | let filterSql = (sl) => { |
| | | if (!sl) return |
| | | |
| | | let arr = [] |
| | | |
| | | sl = sl.replace(/\/\*[^*/]+\*\//g, (word) => { |
| | | let uuid = getuuid() |
| | | arr.push({id: `/*${uuid}*/`, value: word}) |
| | | return `/*${uuid}*/` |
| | | }) |
| | | |
| | | regs.forEach(item => { |
| | | sl = sl.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | arr.forEach(item => { |
| | | sl = sl.replace(item.id, item.value) |
| | | }) |
| | | |
| | | return sl |
| | | } |
| | | |
| | | let filterBtn = (btn) => { |
| | | if (btn.label) { |
| | | btn.label = replaceBtn(btn.label) |
| | | } |
| | | |
| | | if (!btn.verify) return |
| | | |
| | | btn.verify.columns && btn.verify.columns.forEach(col => { |
| | | if (col.Text) { |
| | | col.Text = replaceTitle(col.Text) |
| | | } |
| | | }) |
| | | |
| | | btn.verify.uniques && btn.verify.uniques.forEach(col => { |
| | | if (col.fieldlabel) { |
| | | col.fieldlabel = col.fieldlabel.split(',').map(n => replaceTitle(n)).join(',') |
| | | } |
| | | }) |
| | | |
| | | btn.verify.customverifys && btn.verify.customverifys.forEach(script => { |
| | | script.sql = filterSql(script.sql) |
| | | |
| | | if (script.errmsg) { |
| | | script.errmsg = replaceTitle(script.errmsg) |
| | | } |
| | | }) |
| | | btn.verify.scripts && btn.verify.scripts.forEach(script => { |
| | | script.sql = filterSql(script.sql) |
| | | }) |
| | | btn.verify.cbScripts && btn.verify.cbScripts.forEach(script => { |
| | | script.sql = filterSql(script.sql) |
| | | }) |
| | | |
| | | if (btn.OpenType === 'funcbutton') { |
| | | if (btn.intertype === 'system' && btn.verify.dataType === 'custom' && btn.verify.setting) { |
| | | btn.verify.setting.dataresource = filterSql(btn.verify.setting.dataresource) |
| | | } |
| | | } else if (btn.OpenType === 'excelOut' && btn.verify.dataresource) { |
| | | btn.verify.dataresource = filterSql(btn.verify.dataresource) |
| | | } |
| | | } |
| | | |
| | | let filterForm = (n) => { |
| | | if (n.label) { |
| | | n.label = replaceTitle(n.label) |
| | | } |
| | | if (n.resourceType === '1') { |
| | | n.dataSource = filterSql(n.dataSource) |
| | | } else if (n.options) { |
| | | n.options.forEach(o => { |
| | | if (o.Text) { |
| | | o.Text = replaceList(o.Text) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | let traversal = (components) => { |
| | | if (!components) return |
| | | |
| | | components.forEach(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | if (tab.label) { |
| | | tab.label = replaceTitle(tab.label) |
| | | } |
| | | traversal(tab.components) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | traversal(item.components) |
| | | } else { |
| | | if (item.wrap && item.wrap.title) { |
| | | item.wrap.title = replaceTitle(item.wrap.title) |
| | | } |
| | | if (item.plot && item.plot.title) { |
| | | item.plot.title = replaceTitle(item.plot.title) |
| | | } |
| | | if (item.setting && (!item.wrap || !item.wrap.datatype || item.wrap.datatype === 'dynamic')) { |
| | | if (item.setting.interType === 'system') { |
| | | item.setting.dataresource = filterSql(item.setting.dataresource) |
| | | item.scripts && item.scripts.forEach(script => { |
| | | script.sql = filterSql(script.sql) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (item.columns) { |
| | | item.columns.forEach(cell => { |
| | | if (cell.label) { |
| | | cell.label = replaceTitle(cell.label) |
| | | } |
| | | }) |
| | | } |
| | | if (item.search) { |
| | | if (item.type === 'topbar') { |
| | | if (item.search.fields) { |
| | | item.search.fields.forEach(cell => { |
| | | filterForm(cell) |
| | | }) |
| | | } |
| | | if (item.search.groups) { |
| | | item.search.groups.forEach(group => { |
| | | if (group.fields) { |
| | | group.fields.forEach(cell => { |
| | | filterForm(cell) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | item.search.forEach(cell => { |
| | | filterForm(cell) |
| | | }) |
| | | } |
| | | } |
| | | if (item.action) { |
| | | item.action.forEach(cell => { |
| | | filterBtn(cell) |
| | | if (cell.OpenType === 'popview' && cell.config) { |
| | | traversal(cell.config.components) |
| | | } else if (cell.OpenType === 'pop') { |
| | | if (cell.modal && cell.modal.fields.length) { |
| | | cell.modal.fields.forEach(n => { |
| | | filterForm(n) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.type === 'menubar') { |
| | | item.subMenus = item.subMenus.map(cell => { |
| | | if (cell.setting.name) { |
| | | cell.setting.name = replaceMenu(cell.setting.name) |
| | | } |
| | | return cell |
| | | }) |
| | | } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards.forEach(card => { |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | filterBtn(cell) |
| | |
| | | let sFields = getSearches(searches) |
| | | |
| | | let _columns = [] |
| | | if (item.subtype === 'dualdatacard') { |
| | | if (item.subtype === 'dualdatacard' && item.setting.subdata !== 'sub_data_string') { |
| | | _columns = [...item.columns, ...item.subColumns] |
| | | } else if (item.columns) { |
| | | _columns = [...item.columns] |
| | |
| | | } else if (item.setting.laypage === 'true' && item.setting.order) { |
| | | LText = `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') { |
| | | if (item.subtype === 'dualdatacard' && item.setting.subdata !== 'sub_data_string') { |
| | | DateCount = `select count(1) as total from (select distinct ${item.setting.primaryKey || 'ID'} from ${_dataresource} ${_search})a` |
| | | } else { |
| | | DateCount = `select count(1) as total from ${_dataresource} ${_search}` |
| | |
| | | let parid = '' |
| | | let sub_field = '' |
| | | |
| | | if (item.subtype === 'dualdatacard') { |
| | | if (item.subtype === 'dualdatacard' && item.setting.subdata !== 'sub_data_string') { |
| | | arr_field = item.columns.map(col => col.field).join(',') |
| | | sub_name = item.setting.subdata |
| | | tabid = item.setting.primaryKey || '' |
| | |
| | | }) |
| | | } |
| | | if (applangList.length) { |
| | | applangList.unshift('zh-CN') |
| | | applangList = JSON.stringify(applangList) |
| | | } else { |
| | | applangList = '' |
| | |
| | | }) |
| | | } |
| | | if (applangList.length) { |
| | | applangList.unshift('zh-CN') |
| | | applangList = JSON.stringify(applangList) |
| | | } else { |
| | | applangList = '' |
| | |
| | | params.unshift(_pars) |
| | | } else if (window.backend && config.allSqls && params.length > 0) { |
| | | let data = [] |
| | | let ids = [] |
| | | params = params.filter(item => { |
| | | if (!item.$backend || item.public) return true |
| | | |
| | | ids.push(item.componentId) |
| | | item.data[0].exps.forEach(cell => { |
| | | if (cell.key === 'mk_obj_name') { |
| | | cell.value = 'mk' + item.componentId.slice(-18) |
| | |
| | | $backend: true, |
| | | $type: 's_Get_TableData', |
| | | componentId: '', |
| | | componentIds: ids, |
| | | data |
| | | }) |
| | | } |
| | |
| | | |
| | | if (params.length === 0 && initInters.length === 0) { |
| | | this.setState({loadingview: false, pages: [config.components]}) |
| | | |
| | | this.autoExec() |
| | | } else if (initInters.length > 0) { |
| | | this.loadinit(initInters, params) |
| | | } else { |
| | |
| | | Promise.all(deffers).then(() => { |
| | | if (params.length === 0) { |
| | | this.setState({loadingview: false, pages: [this.state.config.components]}) |
| | | |
| | | this.autoExec() |
| | | } else { |
| | | this.loadmaindata(params) |
| | | } |
| | |
| | | |
| | | let deffers = params.map(item => { |
| | | let componentId = item.componentId |
| | | let ids = item.componentIds |
| | | delete item.componentId |
| | | delete item.componentIds |
| | | delete item.public |
| | | return new Promise(resolve => { |
| | | Api.genericInterface(item).then(res => { |
| | |
| | | }) |
| | | } |
| | | resolve(false) |
| | | } else if (ids) { |
| | | ids.forEach(id => { |
| | | let _id = 'mk' + id.slice(-18) |
| | | |
| | | if (res[_id]) { |
| | | let _data = { $$empty: true } |
| | | if (res[_id][0]) { |
| | | _data = res[_id][0] |
| | | } |
| | | window.GLOB.CacheData.set(id, _data) |
| | | } |
| | | }) |
| | | |
| | | resolve(res) |
| | | } else { |
| | | res.componentId = componentId |
| | | |
| | |
| | | }) |
| | | |
| | | this.setState({loadingview: false, pages, rePos}) |
| | | |
| | | this.autoExec() |
| | | }) |
| | | } |
| | | |
| | | autoExec = () => { |
| | | const { config } = this.state |
| | | |
| | | if (config.autoExec !== 'true') return |
| | | |
| | | setTimeout(() => { |
| | | this.print() |
| | | }, config.autoExecSplit || 500) |
| | | } |
| | | |
| | | reloadTabs = () => { |
| | | if (this.reloading) return |
| | | |
| | |
| | | userName: sessionStorage.getItem('CloudUserName'), |
| | | avatar: Utils.getrealurl(sessionStorage.getItem('CloudAvatar')), |
| | | logo: sessionStorage.getItem('CloudLogo') || MainLogo, |
| | | subLang: sessionStorage.getItem('subLangList') !== null, |
| | | visible: false, |
| | | loading: false |
| | | } |
| | |
| | | |
| | | render () { |
| | | const { mainMenu, editLevel } = this.props |
| | | const { menulist, visible, loading, logo, subLang } = this.state |
| | | const { menulist, visible, loading, logo } = this.state |
| | | |
| | | return ( |
| | | <header className={'sys-header-container ant-menu-dark ' + (['level2', 'level3'].includes(editLevel) ? 'mask' : '')} id="main-header-container"> |
| | |
| | | 编辑 |
| | | </Button> |
| | | </div> : null} |
| | | {window.GLOB.systemType !== 'production' && subLang ? <div className="entrance"> |
| | | {window.GLOB.systemType !== 'production' && sessionStorage.getItem('lang') !== 'zh-CN' ? <div className="entrance"> |
| | | <div className="icon"><PlusOutlined /></div> |
| | | <div className="title">菜单转换</div> |
| | | <div className="detail">可选择母语系统的菜单,快速转换到当前语言。打印模板请在HS下复制后,在此处选择指定模板进行语言转换。</div> |
| | |
| | | visible: false, |
| | | loading: false, |
| | | saveing: false, |
| | | lang: '', |
| | | type: '', |
| | | dicts: [], |
| | | menus: [], |
| | |
| | | } |
| | | |
| | | trigger = () => { |
| | | let langs = sessionStorage.getItem('subLangList') |
| | | langs = JSON.parse(langs) |
| | | |
| | | this.setState({ |
| | | lang: langs[0], |
| | | loading: true, |
| | | visible: true, |
| | | saveing: false, |
| | |
| | | }) |
| | | |
| | | this.getDicts() |
| | | this.getMenus(langs[0]) |
| | | this.getMenus() |
| | | } |
| | | |
| | | getDicts = () => { |
| | |
| | | }) |
| | | } |
| | | |
| | | getMenus = (lang) => { |
| | | getMenus = () => { |
| | | if (this.state.menus.length > 0) { |
| | | this.setState({loading: false}) |
| | | return |
| | |
| | | func: 's_get_pc_menus', |
| | | systemType: window.GLOB.sysType, |
| | | pro_sys: '', |
| | | lang: lang, |
| | | lang: 'zh-CN', |
| | | debug: 'Y' |
| | | } |
| | | |
| | |
| | | |
| | | transThdMenu = (menu, reload) => { |
| | | const { menulist } = this.props |
| | | const { lang, dicts } = this.state |
| | | const { dicts } = this.state |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: menu.value, |
| | | lang: lang |
| | | lang: 'zh-CN' |
| | | } |
| | | |
| | | let creat = true |
| | |
| | | ICP: window.GLOB.ICP || '', |
| | | lineColor: window.GLOB.lineColor || '', |
| | | webSite: window.GLOB.webSite || '', |
| | | prolType: window.GLOB.prolType || '', |
| | | prolCont: window.GLOB.prolCont || '', |
| | | langList: [], |
| | | syncApp: false, |
| | | loginWays: null, |
| | |
| | | // md5("/ws/location/v1/ip?callback=callbackFunction&key=key&output=jsonp secret key") |
| | | // md5("/ws/location/v1/ip?callback=callbackFunction&key=BA7BZ-4QB65-LFCIA-QPDA6-4G6O7-MJB4Q&output=jsonpuThL4ZM3XOj642ksEQh76tyHFjh4") |
| | | |
| | | sessionStorage.removeItem('subLangList') |
| | | sessionStorage.removeItem('langList') |
| | | |
| | | setTimeout(() => { |
| | |
| | | style: res.CSS || '', |
| | | showline: res.split_line_show || 'true', |
| | | webSite: res.WebSite || '', |
| | | prolType: '', |
| | | prolCont: '', |
| | | navBar: res.menu_type, // shutter 百叶窗、linkage_navigation 联动菜单、linkage 联动菜单_无导航栏、menu_board 菜单面板、menu_board_navigation 菜单面板_标签页 |
| | | app_version: res.app_version, |
| | | Member_Level: 0, |
| | | appname: res.appname || '', |
| | | loginOtop: loginOtop, |
| | | loginOleft: loginOleft |
| | | } |
| | | |
| | | if (['every_time', 'once', 'not_required'].includes(res.require_legal_consent) && res.legal_documents) { |
| | | systemMsg.prolCont = res.legal_documents |
| | | try { |
| | | systemMsg.prolCont = window.decodeURIComponent(window.atob(systemMsg.prolCont)) |
| | | if (res.require_legal_consent !== 'not_required') { |
| | | systemMsg.prolType = res.require_legal_consent |
| | | } |
| | | } catch(e) { |
| | | systemMsg.prolType = '' |
| | | systemMsg.prolCont = '' |
| | | } |
| | | } |
| | | |
| | | if ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100].includes(res.member_level)) { |
| | |
| | | } |
| | | |
| | | if (res.lang_data && res.lang_data.length > 1 && window.GLOB.systemType !== 'production') { |
| | | let list = res.lang_data.map(item => item.Lang) |
| | | let lang = 'zh-CN' |
| | | if (window.GLOB.defLang && list.includes(window.GLOB.defLang)) { |
| | | lang = window.GLOB.defLang |
| | | } |
| | | |
| | | if (list.includes(lang)) { |
| | | list = [lang, ...list.filter(item => item !== lang)] |
| | | if (lang === sessionStorage.getItem('lang')) { |
| | | sessionStorage.setItem('langList', JSON.stringify(list)) |
| | | } else { |
| | | sessionStorage.setItem('subLangList', JSON.stringify(list)) |
| | | } |
| | | } |
| | | let list = res.lang_data.map(item => item.Lang).filter(n => n !== 'zh-CN') |
| | | sessionStorage.setItem('langList', JSON.stringify(list)) |
| | | } |
| | | |
| | | if (res.lang_data.length === 1 && res.lang_data[0].Lang !== sessionStorage.getItem('lang')) { |
| | |
| | | return |
| | | } |
| | | |
| | | let langList = res.lang_data.map(item => ({Lang: item.Lang, LangName: item.LangName})) |
| | | |
| | | localStorage.setItem(window.GLOB.sysSign + 'langList', JSON.stringify(langList)) |
| | | |
| | | window.GLOB.loginOtop = systemMsg.loginOtop |
| | | window.GLOB.loginOleft = systemMsg.loginOleft |
| | | |
| | | this.setState({ |
| | | loginWays: login_ways, |
| | | langList: res.lang_data || [], |
| | | langList: langList, |
| | | ...systemMsg |
| | | }) |
| | | |
| | |
| | | |
| | | this.setState({ |
| | | loginWays: loginWays |
| | | }) |
| | | } |
| | | |
| | | let langs = localStorage.getItem(window.GLOB.sysSign + 'langList') |
| | | if (langs) { |
| | | try { |
| | | langs = JSON.parse(langs) |
| | | } catch (e) { |
| | | langs = [] |
| | | } |
| | | |
| | | this.setState({ |
| | | langList: langs |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { lineColor, loginlogo, bgImage, copyRight, webSite, ICP, loginWays, platName } = this.state |
| | | const { lineColor, bgImage, loginlogo, copyRight, webSite, ICP, loginWays, platName, prolType, prolCont } = this.state |
| | | |
| | | let wrapStyle = {} |
| | | |
| | |
| | | authError={this.state.authError} |
| | | platName={platName} |
| | | loginWays={loginWays} |
| | | prolType={prolType} |
| | | prolCont={prolCont} |
| | | langList={this.state.langList} |
| | | isDisabled={this.state.isDisabled} |
| | | handleSubmit={() => this.handleSubmit()} |
| | |
| | | /> : null} |
| | | </div> |
| | | <div className="login-bottom"> |
| | | {webSite && copyRight ? |
| | | <a target="_blank" rel="noopener noreferrer" href={webSite} dangerouslySetInnerHTML={{ __html: copyRight.replace(/\s/ig, ' ') }}></a> : |
| | | <p dangerouslySetInnerHTML={{ __html: copyRight ? copyRight.replace(/\s/ig, ' ') : '' }}></p> |
| | | } |
| | | <p> |
| | | {webSite && copyRight ? |
| | | <a target="_blank" rel="noopener noreferrer" href={webSite} dangerouslySetInnerHTML={{ __html: copyRight.replace(/\s/ig, ' ') }}></a> : |
| | | <span dangerouslySetInnerHTML={{ __html: copyRight ? copyRight.replace(/\s/ig, ' ') : '' }}></span> |
| | | } |
| | | {prolCont && !prolType ? <span style={{marginLeft: '15px'}} dangerouslySetInnerHTML={{ __html: prolCont }}></span> : null} |
| | | </p> |
| | | {ICP ? <a target="_blank" rel="noopener noreferrer" href="https://beian.miit.gov.cn/#/Integrated/index" dangerouslySetInnerHTML={{ __html: ICP.replace(/\s/ig, ' ') }}></a> : null} |
| | | </div> |
| | | {/* 编辑状态登录 */} |
| | |
| | | background-color: var(--mk-sys-color5); |
| | | border-color: var(--mk-sys-color5); |
| | | } |
| | | .login-form-button.disabled { |
| | | background-color: var(--mk-sys-color5); |
| | | border-color: var(--mk-sys-color5); |
| | | color: #ffffff; |
| | | cursor: not-allowed; |
| | | opacity: 0.9; |
| | | } |
| | | |
| | | .login-way-wrap { |
| | | .login-way.active, .login-way:hover { |
| | |
| | | .btn-login { |
| | | margin-bottom: 3vh; |
| | | clear: both; |
| | | height: auto; |
| | | } |
| | | .register-line { |
| | | font-size: 14px; |
| | |
| | | display: inline-block; |
| | | margin-bottom: 3vh; |
| | | margin-top: -10px; |
| | | height: 35px; |
| | | } |
| | | .minline.right { |
| | | float: right; |
| | |
| | | } |
| | | } |
| | | } |
| | | .proline { |
| | | display: inline-block; |
| | | margin-bottom: 10px; |
| | | height: auto; |
| | | margin-top: calc(-3vh + 10px); |
| | | font-size: 13px; |
| | | .ant-form-item-children { |
| | | display: flex; |
| | | align-items: flex-start; |
| | | line-height: 1.5; |
| | | color: rgba(0, 0, 0, 0.5); |
| | | |
| | | // .ant-checkbox-inner { |
| | | // width: 15px; |
| | | // height: 15px; |
| | | // } |
| | | input[type="checkbox"] { |
| | | width: 35px; |
| | | height: 22px; |
| | | top: -4px; |
| | | left: -4px; |
| | | } |
| | | |
| | | a { |
| | | color: var(--mk-sys-color); |
| | | } |
| | | } |
| | | } |
| | | button.vercode { |
| | | border: 0; |
| | | color: var(--mk-sys-color); |
| | |
| | | username: '', |
| | | password: '', |
| | | remember: true, |
| | | protocol: null, |
| | | delay: null, |
| | | loginWays: [], |
| | | smsId: '', |
| | |
| | | localStorage.setItem(window.GLOB.sysSign + 'users', window.btoa(window.encodeURIComponent(JSON.stringify(_users)))) |
| | | } |
| | | |
| | | changeAgree = (val) => { |
| | | this.setState({protocol: val}) |
| | | |
| | | if (this.scanParam && val) { |
| | | this.props.authLogin(this.scanParam.thd_party_appid, this.scanParam.thd_party_openid, this.scanParam.thd_party_member_id, this.scanParam.scanId) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { langList } = this.props |
| | | const { langList, isDisabled } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { remember, users, dict, lang, vispwd } = this.state |
| | | |
| | |
| | | )} |
| | | </Form.Item> : null} |
| | | <Form.Item className="btn-login"> |
| | | <Button type="primary" htmlType="submit" className="login-form-button" disabled={this.props.isDisabled} loading={this.props.isDisabled}> |
| | | {dict['log_in'] || '登录'} |
| | | <Button type="primary" htmlType="submit" className="login-form-button" disabled={isDisabled} loading={isDisabled}> |
| | | {dict['log_in'] || '登录'} |
| | | </Button> |
| | | </Form.Item> |
| | | </div> |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="启用时,在菜单完成数据加载后自动触发打印预览。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 自动打印 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('autoExec', { |
| | | initialValue: config.autoExec || 'false' |
| | | })( |
| | | <Radio.Group onChange={(e) => this.selectChange('autoExec', e.target.value)}> |
| | | <Radio value="false">不启用</Radio> |
| | | <Radio value="true">启用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.autoExec === 'true' ? <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="自动触发打印预览的延迟时间,单位毫秒。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 延迟时间 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('autoExecSplit', { |
| | | initialValue: config.autoExecSplit || 500 |
| | | })(<InputNumber min={1} max={9999} precision={0} onChange={(val) => this.selectChange('autoExecSplit', val)}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label="回调"> |
| | | {getFieldDecorator('callback', { |
| | | initialValue: config.callback || 'false' |
| | |
| | | document.body.className = 'mk-blue-black' |
| | | window.GLOB.dataFormat = false // 去除水印 |
| | | window.GLOB.mkHS = true |
| | | window.GLOB.dict = {} |
| | | |
| | | // HS下不可开启断点调试 |
| | | window.GLOB.breakpoint = false |