| | |
| | | const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) |
| | | const FlowFloat = asyncComponent(() => import('@/tabviews/zshare/flowFloat')) |
| | | const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes')) |
| | | const DeepSeek = asyncComponent(() => import('@/tabviews/zshare/deepseek')) |
| | | const MkInterfaces = asyncComponent(() => import('@/tabviews/custom/components/interfaces')) |
| | | |
| | | class CustomPage extends Component { |
| | |
| | | loading: false, // 列表数据加载中 |
| | | visible: false, // 标签页控制 |
| | | shortcuts: null, // 快捷键 |
| | | loadinginter: false |
| | | loadinginter: false, |
| | | noParam: false |
| | | } |
| | | |
| | | stepInter = null |
| | |
| | | */ |
| | | async loadconfig () { |
| | | const { MenuID, MenuName, param } = this.props |
| | | const { noParam } = this.state |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: MenuID |
| | | } |
| | | |
| | | if (window.GLOB.mkHS) { |
| | | _param.lang = 'zh-CN' |
| | | } |
| | | |
| | | let result = await Api.getCacheConfig(_param) |
| | |
| | | let skip = config.permission === 'false' || window.GLOB.mkHS |
| | | let urlparam = {} // url参数 |
| | | if (param) { |
| | | Object.keys(param).forEach(key => { |
| | | if (/^\$/.test(key)) { |
| | | urlparam[key] = param[key] |
| | | } else { |
| | | urlparam[key.toLowerCase()] = param[key] |
| | | } |
| | | if (!noParam) { |
| | | Object.keys(param).forEach(key => { |
| | | if (/^\$/.test(key)) { |
| | | urlparam[key] = param[key] |
| | | } else { |
| | | urlparam[key.toLowerCase()] = param[key] |
| | | } |
| | | }) |
| | | } else { |
| | | urlparam.$BID = param.$BID |
| | | } |
| | | } |
| | | |
| | | if (config.urlFields && config.urlFields.length) { |
| | | config.urlFields.forEach(field => { |
| | | let key = field.toLowerCase() |
| | | if (urlparam[key] !== undefined) return |
| | | |
| | | urlparam[key] = '' |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | if (config.urlFields) { |
| | | config.urlFields.forEach(field => { |
| | | let val = `'${urlparam[field.toLowerCase()] || ''}'` |
| | | let val = `'${urlparam[field.toLowerCase()]}'` |
| | | regs.push({ |
| | | reg: new RegExp('@' + field + '@', 'ig'), |
| | | value: val |
| | |
| | | Utils.initSearchVal(item) |
| | | |
| | | if (urlparam.$searchkey) { |
| | | let reg = new RegExp('(^|,)' + urlparam.$searchkey + '($|,)', 'ig') |
| | | item.search.forEach(cell => { |
| | | if (urlparam.$searchkey === cell.field.toLowerCase() && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { |
| | | if (reg.test(cell.field) && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { |
| | | cell.initval = urlparam.$searchval |
| | | } |
| | | }) |
| | |
| | | delete item.scripts |
| | | item.setting.$name = item.$menuname || '' |
| | | item.setting.execute = item.setting.execute !== 'false' // 默认sql是否执行,转为boolean 统一格式 |
| | | |
| | | |
| | | if (!item.setting.execute) { |
| | | item.setting.dataresource = '' |
| | | } |
| | | if (/\s/.test(item.setting.dataresource)) { |
| | | item.setting.dataresource = '(' + item.setting.dataresource + ') tb' |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | |
| | | item.setting.customScript = _customScript // 整理后自定义脚本 |
| | | item.setting.tailScript = _tailScript // 后置自定义脚本 |
| | | |
| | | item.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript) |
| | | item.setting.custompage = false |
| | | |
| | | if (item.setting.$tree) { |
| | | if (/order\s+by\s+sort_id\s*$/i.test(item.setting.dataresource)) { |
| | | item.setting.custompage = true |
| | | } else if (item.setting.$tree || /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript)) { |
| | | item.setting.custompage = true |
| | | } |
| | | |
| | | if (/\s/.test(item.setting.dataresource)) { |
| | | item.setting.dataresource = '(' + item.setting.dataresource + ') tb' |
| | | } |
| | | |
| | | if (!item.setting.execute || item.setting.custompage) { |
| | |
| | | if (!inter.setting.execute) { |
| | | inter.setting.dataresource = '' |
| | | } |
| | | if (/\s/.test(inter.setting.dataresource)) { |
| | | inter.setting.dataresource = '(' + inter.setting.dataresource + ') tb' |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | inter.setting.dataresource = inter.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | |
| | | |
| | | inter.setting.customScript = _customScript // 整理后自定义脚本 |
| | | inter.setting.tailScript = _tailScript // 后置自定义脚本 |
| | | inter.setting.custompage = false |
| | | |
| | | inter.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(inter.setting.dataresource + inter.setting.customScript) |
| | | if (/order\s+by\s+sort_id\s*$/i.test(inter.setting.dataresource)) { |
| | | inter.setting.custompage = true |
| | | } else if (/@pageSize@|@orderBy@|@mk_total/i.test(inter.setting.dataresource + inter.setting.customScript)) { |
| | | inter.setting.custompage = true |
| | | } |
| | | |
| | | if (/\s/.test(inter.setting.dataresource)) { |
| | | inter.setting.dataresource = '(' + inter.setting.dataresource + ') tb' |
| | | } |
| | | |
| | | return inter |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | reloadMenuView = (menuId) => { |
| | | reloadMenuView = (menuId, clear) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | this.reloadview() |
| | | this.reloadview(clear) |
| | | } |
| | | |
| | | resetActiveMenu = (menuId) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | reloadview = () => { |
| | | reloadview = (clear) => { |
| | | window.GLOB.CacheData.delete(this.props.MenuID) |
| | | |
| | | if (this.state.config) { |
| | |
| | | viewlost: false, // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用 |
| | | config: null, // 页面配置信息,包括组件等 |
| | | loading: false, // 列表数据加载中 |
| | | shortcuts: null |
| | | shortcuts: null, |
| | | noParam: clear === true |
| | | }, () => { |
| | | this.loadconfig() |
| | | }) |
| | |
| | | {config.process === 'true' ? <FlowFloat config={config}/> : null} |
| | | <SettingComponent config={config} shortcuts={shortcuts || []}/> |
| | | <TableNodes config={config} /> |
| | | <DeepSeek/> |
| | | </div> |
| | | </div> |
| | | ) |