| | |
| | | defaultLang -- 打开的子应用语言类型,默认为zh-CN |
| | | WXAppID -- 使用公众号时,绑定的公众号ID |
| | | WXminiAppID -- 使用微信小程序时,绑定的小程序ID |
| | | nginx -- 是否开启了nginx服务,值为 true 时开启,如需使用微信模板消息等服务,请先设置nginx服务并开启此配置 |
| | | debugger -- 值为 true 时开启调试模式,开启后移动端子应用中会有控制台 |
| | | licenseKey -- 许可密钥,在内部网络中使用系统时,会跳过epc验证 |
| | | probation -- 试用期(YYYY-MM-DD),在正式系统中,试用期内调用系统接口的脚本会记录下来 |
| | |
| | | { |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mk", |
| | | "defaultApp": "mkindustry", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "WXminiAppID": "", |
| | | "nginx": "true", |
| | | "debugger": false, |
| | | "licenseKey": "", |
| | | "probation": "", |
| | | "transfer": "false", |
| | | "keepPassword": "true", |
| | | "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "MKWMS/" |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | } |
| | |
| | | GLOB.watermark = config.watermark + '' !== 'false' |
| | | GLOB.transfer = config.transfer + '' === 'true' |
| | | GLOB.keepKey = config.keepPassword + '' !== 'false' |
| | | GLOB.nginx = config.nginx + '' === 'true' |
| | | GLOB.WXAppID = config.WXAppID || '' |
| | | GLOB.WXminiAppID = config.WXminiAppID || '' |
| | | GLOB.accessToken = {} |
| | |
| | | } |
| | | GLOB.memberLevel = _level |
| | | |
| | | if (sessionStorage.getItem('breakpoint')) { |
| | | window.debugger = true |
| | | GLOB.breakpoint = sessionStorage.getItem('breakpoint') |
| | | } else { |
| | | GLOB.breakpoint = false |
| | | } |
| | | |
| | | Object.defineProperty(GLOB, 'appId', { |
| | | writable: false, |
| | | value: GLOB.appId |
| | |
| | | writable: false, |
| | | value: GLOB |
| | | }) |
| | | Object.defineProperty(window, 'debug', { |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | sessionStorage.removeItem('breakpoint') |
| | | } else { |
| | | sessionStorage.setItem('breakpoint', value) |
| | | } |
| | | console.info('请刷新页面。') |
| | | } |
| | | }) |
| | | |
| | | window.GLOB.CacheMap = new Map() // 缓存配置信息 |
| | | window.GLOB.UserCacheMap = new Map() // 缓存用户自定义设置 |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from './options' |
| | |
| | | card.errors.push({ level: 1, detail: `卡片中动态字段“${cell.field}”无效`}) |
| | | } |
| | | }) |
| | | card.$tables = getTables(card) |
| | | } else { |
| | | let columns = card.columns.map(c => c.field) |
| | | |
| | |
| | | card.errors.push({ level: 0, detail: '主键已失效!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from './options' |
| | |
| | | } else if (card.wrap.supType !== 'multi' && !card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.action.forEach(cell => { |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from '../data-card/options' |
| | |
| | | } |
| | | |
| | | if (card.wrap.datatype === 'static') { |
| | | card.$tables = getTables(card) |
| | | |
| | | card.subcards.forEach((item, i) => { |
| | | let linkbtn = item.setting.linkbtn || '' |
| | | |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach((item, i) => { |
| | | let linkbtn = item.setting.linkbtn || '' |
| | | item.elements.forEach(cell => { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from '../data-card/options' |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach((item, i) => { |
| | | let linkbtn = item.setting.linkbtn || '' |
| | | item.elements.forEach(cell => { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from './options' |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach((item, i) => { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from '../data-card/options' |
| | |
| | | } |
| | | |
| | | if (card.wrap.datatype === 'static') { |
| | | card.$tables = getTables(card) |
| | | card.subcards.forEach(item => { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach((item, i) => { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import { chartColors } from '@/utils/option.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | if (!card.plot.Xaxis) { |
| | | card.errors.push({ level: 0, detail: '坐标轴尚未设置!'}) |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import './index.scss' |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | if (!card.plot.valueField) { |
| | | card.errors.push({ level: 0, detail: '显示值尚未设置!'}) |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | if (!card.plot.Xaxis) { |
| | | card.errors.push({ level: 0, detail: '名称字段尚未设置!'}) |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | if (!card.plot.Xaxis) { |
| | | card.errors.push({ level: 0, detail: '坐标轴尚未设置!'}) |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | this.setState({ |
| | | card: card |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { getTables } from '@/utils/utils-custom.js' |
| | | import getWrapForm from './options' |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { getModalForm } from '@/templates/zshare/formconfig' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from './options' |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | |
| | | } else { |
| | | let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : '' |
| | | |
| | | card.$tables = getTables(card) |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { getModalForm } from '@/templates/zshare/formconfig' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from './options' |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | |
| | | } else { |
| | | let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : '' |
| | | |
| | | card.$tables = getTables(card) |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { getModalForm } from '@/templates/zshare/formconfig' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from '../step-form/options' |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | |
| | | } else { |
| | | let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : '' |
| | | |
| | | card.$tables = getTables(card) |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import getWrapForm from './options' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.action.forEach(cell => { |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import getWrapForm from './options' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.action.forEach(cell => { |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from './options' |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach(col => { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import getWrapForm from './options' |
| | | |
| | |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | if (!card.wrap.parentField || !card.wrap.valueField || !card.wrap.labelField) { |
| | | card.errors.push({ level: 0, detail: '未设置基本信息!'}) |
| | | } |
| | |
| | | this.setState({checkParam: check_param}) |
| | | } |
| | | |
| | | if (window.GLOB.breakpoint) { |
| | | param.func = 'sPC_TableData_InUpDe_debug' |
| | | } |
| | | |
| | | _params.push(param) |
| | | } else if (btn.Ot === 'required') { |
| | | _params = data.map((cell, index) => { |
| | |
| | | param.menuname = btn.logLabel |
| | | if (window.GLOB.probation) { |
| | | param.s_debug_type = 'Y' |
| | | } |
| | | |
| | | if (window.GLOB.breakpoint) { |
| | | param.func = 'sPC_TableData_InUpDe_debug' |
| | | } |
| | | |
| | | return param |
| | |
| | | } |
| | | |
| | | sendWxMessage = (verify, id) => { |
| | | if (!window.GLOB.nginx) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'nginx服务尚未开启,不可发送模板消息。', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_get_sms_weixin_local', |
| | | upid: id |
| | |
| | | sqlverify = (_resolve, _reject, scripts) => { |
| | | const { searches, verify } = this.state |
| | | |
| | | if (verify.dataType !== 'custom') { |
| | | _resolve() |
| | | return |
| | | } |
| | | |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let sql = SettingUtils.getDebugSql(verify, scripts, searches, Utils, timestamp) |
| | | let param = { |
| | |
| | | |
| | | Api.getSystemCacheConfig(param).then(res => { |
| | | if (res.status) { |
| | | let tbNames = res.data.map(item => item.TbName).join(',') |
| | | sessionStorage.setItem('mk_tb_names', ',' + tbNames.toLowerCase() + ',') |
| | | this.setState({ |
| | | tables: res.data |
| | | }) |
| | |
| | | } |
| | | |
| | | gettableFields = () => { |
| | | let deffers = this.state.selectedTables.map(item => { |
| | | let deffers = this.state.selectedTables.map((item, i) => { |
| | | return new Promise(resolve => { |
| | | let param = {func: 'sPC_Get_FieldName', TBName: item.TbName} |
| | | if (options.cloudServiceApi) { // 且存在云端地址 |
| | |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } |
| | | |
| | | Api.getSystemCacheConfig(param).then(res => { |
| | | res.TBName = item.TbName |
| | | resolve(res) |
| | | }) |
| | | setTimeout(() => { |
| | | Api.getSystemCacheConfig(param).then(res => { |
| | | res.TBName = item.TbName |
| | | resolve(res) |
| | | }) |
| | | }, i * 50) |
| | | }) |
| | | }) |
| | | Promise.all(deffers).then(response => { |
| | |
| | | const { verify } = this.props |
| | | let wxTemps = sessionStorage.getItem('wxTemplates') |
| | | |
| | | if (window.GLOB.WXAppID && !wxTemps) { |
| | | if (window.GLOB.WXAppID && window.GLOB.nginx && !wxTemps) { |
| | | Api.wxAccessToken().then(res => { |
| | | let wxtoken = res.oa_access_token || '' |
| | | // let minitoken = res.mini_access_token || '' |
| | |
| | | } |
| | | |
| | | return JSON.parse(_style) |
| | | } |
| | | |
| | | /** |
| | | * @description 获取表名 |
| | | */ |
| | | export function getTables (config) { |
| | | let tables = [] |
| | | let cuts = [] |
| | | let cutreg = /(from|update|insert\s+into)\s+(@db@)?[a-z_]+/ig |
| | | let trimreg = /(from|update|insert\s+into)\s+(@db@)?/ig |
| | | |
| | | if (!config.wrap || !config.wrap.datatype || config.wrap.datatype === 'dynamic') { |
| | | if (config.setting.interType === 'system') { |
| | | if (config.setting.execute !== 'false') { |
| | | let tbs = config.setting.dataresource.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | } |
| | | config.scripts && config.scripts.forEach(script => { |
| | | if (script.status === 'false') return |
| | | let tbs = script.sql.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | }) |
| | | } else { |
| | | let tb = config.setting.tableName.replace(/@db@|\s+/ig, '') |
| | | if (/[a-z_]+/ig.test(tb)) { |
| | | tables.push(tb) |
| | | } |
| | | } |
| | | } |
| | | |
| | | let action = [] |
| | | |
| | | if (config.type === 'form') { |
| | | config.subcards.forEach(item => { |
| | | action.push(item.subButton) |
| | | }) |
| | | } else if (config.subcards) { |
| | | config.subcards.forEach(item => { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType === 'button' && ['form', 'pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) { |
| | | action.push(cell) |
| | | } |
| | | }) |
| | | |
| | | if (item.backElements && item.setting.type === 'multi') { |
| | | item.backElements.forEach(cell => { |
| | | if (cell.eleType === 'button' && ['form', 'pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) { |
| | | action.push(cell) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | config.cols && config.cols.forEach(col => { |
| | | if (col.type === 'action') { |
| | | col.elements.forEach(cell => { |
| | | if (['form', 'pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) { |
| | | action.push(cell) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | config.elements && config.elements.forEach(cell => { |
| | | if (cell.eleType === 'button' && ['form', 'pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) { |
| | | action.push(cell) |
| | | } |
| | | }) |
| | | |
| | | config.action && config.action.forEach(cell => { |
| | | if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) { |
| | | action.push(cell) |
| | | } |
| | | }) |
| | | |
| | | action.forEach(btn => { |
| | | if (btn.OpenType === 'excelIn') { |
| | | if (!btn.verify) return |
| | | if (btn.intertype !== 'system' || btn.verify.default !== 'false') { |
| | | let tb = btn.sheet.replace(/@db@|\s+/ig, '') |
| | | if (/[a-z_]+/ig.test(tb)) { |
| | | tables.push(tb) |
| | | } |
| | | } |
| | | if (btn.intertype === 'system' && btn.verify.scripts) { |
| | | btn.verify.scripts.forEach(script => { |
| | | if (script.status === 'false') return |
| | | let tbs = script.sql.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | }) |
| | | } |
| | | } else if (btn.OpenType === 'excelOut') { |
| | | if (btn.intertype !== 'system' || !btn.verify) return |
| | | if (btn.verify.dataType === 'custom') { |
| | | if (btn.verify.defaultSql !== 'false') { |
| | | let tbs = btn.verify.dataresource.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | } |
| | | btn.verify.scripts && btn.verify.scripts.forEach(script => { |
| | | if (script.status === 'false') return |
| | | let tbs = script.sql.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | }) |
| | | } |
| | | if (btn.verify.enable === 'true' && btn.verify.script) { |
| | | let tbs = btn.verify.script.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | } |
| | | } else { |
| | | if (btn.intertype === 'inner') return |
| | | if (btn.intertype === 'outer' || btn.intertype === 'custom') { |
| | | if (btn.procMode === 'system' && btn.verify) { |
| | | if (btn.verify.default !== 'false' && btn.sql) { |
| | | let tb = btn.sql.replace(/@db@|\s+/ig, '') |
| | | if (/[a-z_]+/ig.test(tb)) { |
| | | tables.push(tb) |
| | | } |
| | | } |
| | | btn.verify.customverifys && btn.verify.customverifys.forEach(script => { |
| | | if (script.status === 'false') return |
| | | let tbs = script.sql.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | }) |
| | | btn.verify.scripts && btn.verify.scripts.forEach(script => { |
| | | if (script.status === 'false') return |
| | | let tbs = script.sql.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | }) |
| | | } |
| | | if (btn.callbackType === 'script' && btn.verify) { |
| | | btn.verify.cbScripts && btn.verify.cbScripts.forEach(script => { |
| | | if (script.status === 'false') return |
| | | let tbs = script.sql.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | }) |
| | | } |
| | | } else if (btn.verify) { |
| | | if (btn.verify.default !== 'false' && btn.sql) { |
| | | let tb = btn.sql.replace(/@db@|\s+/ig, '') |
| | | if (/[a-z_]+/ig.test(tb)) { |
| | | tables.push(tb) |
| | | } |
| | | } |
| | | btn.verify.customverifys && btn.verify.customverifys.forEach(script => { |
| | | if (script.status === 'false') return |
| | | let tbs = script.sql.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | }) |
| | | btn.verify.scripts && btn.verify.scripts.forEach(script => { |
| | | if (script.status === 'false') return |
| | | let tbs = script.sql.match(cutreg) |
| | | tbs && cuts.push(...tbs) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | cuts = cuts.map(item => item.replace(trimreg, '')) |
| | | tables.push(...cuts) |
| | | tables = tables.filter(Boolean) |
| | | tables = Array.from(new Set(tables)) |
| | | |
| | | return tables |
| | | } |
| | |
| | | _sql = _sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | | _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | |
| | | if (window.GLOB.breakpoint) { |
| | | let start = new RegExp('\\/\\*\\$breakpoint_begin_' + window.GLOB.breakpoint + '@', 'ig') |
| | | let end = new RegExp('@breakpoint_end_' + window.GLOB.breakpoint + '\\$\\*\\/', 'ig') |
| | | |
| | | _sql = _sql.replace(start, '').replace(end, '') |
| | | if (retmsg) { |
| | | _callbacksql = _callbacksql.replace(start, '').replace(end, '') |
| | | } |
| | | } |
| | | |
| | | if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { |
| | | // _sql = _sql.replace(/\n\s{8}/ig, '\n') |
| | | console.info(_sql) |
| | |
| | | import { ConfigProvider, notification, Modal, Collapse, Card, Switch, Button, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import html2canvas from 'html2canvas' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import options from '@/store/options.js' |
| | |
| | | }) |
| | | } |
| | | |
| | | getMenuMessage = (delButtons) => { |
| | | getMenuMessage = (delButtons, tbs) => { |
| | | const { config } = this.state |
| | | let buttons = [] |
| | | let _sort = 1 |
| | | |
| | | let traversal = (components) => { |
| | | components.forEach(item => { |
| | | if (item.$tables) { |
| | | tbs.push(...item.$tables) |
| | | } |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | traversal(tab.components) |
| | |
| | | config.enabled = false |
| | | } |
| | | |
| | | let tbs = [] |
| | | let delButtons = fromJS(this.state.delButtons).toJS() |
| | | let btns = this.getMenuMessage(delButtons, tbs) |
| | | tbs = Array.from(new Set(tbs)) |
| | | tbs.sort() |
| | | if (tbs.length && sessionStorage.getItem('mk_tb_names')) { |
| | | let names = sessionStorage.getItem('mk_tb_names') |
| | | tbs = tbs.filter(tb => names.indexOf(',' + tb.toLowerCase() + ',') > -1) |
| | | } |
| | | tbs = tbs.join(';') |
| | | |
| | | let key = md5(config.uuid + window.GLOB.appkey + tbs) |
| | | let url = '' |
| | | |
| | | if (config.tbkey === key) { |
| | | key = '' |
| | | } else { |
| | | let urlparam = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) |
| | | urlparam.type = 'admin' |
| | | url = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam))) |
| | | config.tbkey = key |
| | | } |
| | | |
| | | let param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | | FstID: config.fstMenuId || '', |
| | |
| | | Template: 'CustomPage', |
| | | MenuName: config.MenuName || '', |
| | | PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false'}), |
| | | LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config))), |
| | | open_edition: config.open_edition, |
| | | LText: '', |
| | | LTexttb: '' |
| | | LTexttb: '', |
| | | debug_md5: key, |
| | | debug_url: url, |
| | | debug_list: window.btoa(window.encodeURIComponent(tbs)), |
| | | LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config))) |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | |
| | | LText: [] |
| | | } |
| | | |
| | | let delButtons = fromJS(this.state.delButtons).toJS() |
| | | let btnIds = '' // 用于复制按钮的过滤 |
| | | if (MenuType !== 'billPrint') { |
| | | btnParam.LText = this.getMenuMessage(delButtons) |
| | | btnParam.LText = btns |
| | | btnParam.LText = btnParam.LText.join(' union all ') |
| | | |
| | | btnIds = btnParam.LText |