Merge branch 'positec' into dms
| | |
| | | |
| | | /** |
| | | * @description 使用dostar接口,跳过验证 |
| | | * @param {Object} param 查询及提交参数 |
| | | */ |
| | | dostarInterface (param) { |
| | | param.userid = param.userid || '' |
| | |
| | | if (window.GLOB.CacheMap.has(_param)) { |
| | | return Promise.resolve(window.GLOB.CacheMap.get(_param)) |
| | | } else { |
| | | return Promise.resolve({ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false}) |
| | | return Promise.resolve({ErrCode: 'S', LongParam: '', message: '', status: false}) |
| | | } |
| | | } |
| | | |
| | |
| | | token = JSON.parse(window.decodeURIComponent(window.atob(token))) |
| | | } catch (e) { |
| | | token = null |
| | | _resolve({status: false, ErrCode: 'E', message: '接口信息解析失败!', ErrMesg: 'token_error'}) |
| | | _resolve({status: false, ErrCode: 'token_error', message: '接口信息解析失败!'}) |
| | | } |
| | | |
| | | if (!token) return |
| | |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | if (param.$token === '') { |
| | | return Promise.resolve({status: false, ErrCode: 'E', message: '接口地址尚未设置!', ErrMesg: 'token_error'}) |
| | | return Promise.resolve({status: false, ErrCode: 'token_error', message: '接口地址尚未设置!'}) |
| | | } else if (param.$token) { |
| | | return new Promise(resolve => this.visitOuterSystem(param, resolve)) |
| | | } |
| | |
| | | GLOB.navBar = _systemMsg.navBar || 'shutter' |
| | | GLOB.appVersion = _systemMsg.app_version || '' |
| | | |
| | | let levels = [30, 10, 20, 40, 50, 60, 70, 80, 90, 100] |
| | | |
| | | levels.some(m => { |
| | | if (_systemMsg.Member_Level === md5('mksoft' + GLOB.appkey + m)) { |
| | | GLOB.memberLevel = m |
| | | return true |
| | | } |
| | | return false |
| | | }) |
| | | |
| | | if (GLOB.favicon) { |
| | | let link = document.querySelector("link[rel*='icon']") || document.createElement('link') |
| | | link.type = 'image/x-icon' |
| | |
| | | let lang = localStorage.getItem(_href + 'lang') || (config.defaultLang !== 'en-US' ? 'zh-CN' : 'en-US') |
| | | sessionStorage.setItem('lang', lang) |
| | | |
| | | let _level = 0 |
| | | let _Mlevel = sessionStorage.getItem('Member_Level') |
| | | |
| | | if (_Mlevel) { |
| | | if (_Mlevel === md5('mksoft' + GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 10)) { |
| | | _level = 10 |
| | | } else if (_Mlevel === md5('mksoft' + GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 20)) { |
| | | _level = 20 |
| | | } else if (_Mlevel === md5('mksoft' + GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 30)) { |
| | | _level = 30 |
| | | } |
| | | } |
| | | GLOB.memberLevel = _level |
| | | GLOB.mkThdMenus = [] // 三级菜单 |
| | | GLOB.mkActions = {} // 按钮权限集 |
| | | |
| | |
| | | value: GLOB.cloudServiceApi || '' |
| | | }) |
| | | |
| | | if (GLOB.memberLevel) { |
| | | Object.defineProperty(GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: GLOB.memberLevel |
| | | }) |
| | | } else { |
| | | GLOB.memberLevel = 0 |
| | | } |
| | | |
| | | if (GLOB.sysType === 'cloud') { |
| | | Object.defineProperty(GLOB, 'debugger', { |
| | | writable: false, |
| | |
| | | export default function (wrap, columns) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'menuType', values: ['menus']}, |
| | | {field: 'menus', values: ['menus']}, |
| | | ] |
| | | ], |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | initval: wrap.menuType || '', |
| | | required: true, |
| | | options: columns, |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | required: true, |
| | | extendName: 'MenuNo', |
| | | options: menulist, |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'table', |
| | |
| | | required: true, |
| | | span: 24, |
| | | actions: ['view'], |
| | | forbid: isprint, |
| | | columns: [ |
| | | { |
| | | title: '标识', |
| | |
| | | */ |
| | | export default function (wrap, buttons, columns) { |
| | | let menu = window.GLOB.customMenu |
| | | let MenuType = menu.parentId === 'BillPrintTemp' ? 'billPrint' : '' |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | let modules = MenuUtils.getLinkModules(menu.components) || [] |
| | | let supmodules = MenuUtils.getSupModules(menu.components, '', menu.interfaces) |
| | |
| | | {field: 'syncModule', values: ['sync']}, |
| | | {field: 'checkAll', values: ['sync']}, |
| | | ], |
| | | forbid: MenuType === 'billPrint' |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | initval: wrap.supModule || [], |
| | | // tooltip: '当上级组件不存在或没有权限时,当前组件不显示。', |
| | | required: true, |
| | | options: supmodules |
| | | options: supmodules, |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | options: [ |
| | | {value: 'hidden', label: '选行'}, |
| | | {value: 'show', label: '始终'}, |
| | | ] |
| | | ], |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | initval: wrap.syncModule || '', |
| | | tooltip: '当同步组件不存在或没有权限时,当前组件不显示。', |
| | | required: true, |
| | | options: modules |
| | | options: modules, |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | options: [ |
| | | {value: 'hidden', label: '隐藏'}, |
| | | {value: 'show', label: '显示'}, |
| | | ] |
| | | ], |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'content', label: '浮动卡'}, |
| | | {value: 'headerOrfooter', label: '页眉/页脚'}, |
| | | ], |
| | | forbid: MenuType !== 'billPrint' |
| | | forbid: !isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | initval: wrap.linkbtn || '', |
| | | required: false, |
| | | options: buttons, |
| | | forbid: MenuType === 'billPrint' |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | ] |
| | | |
| | |
| | | */ |
| | | export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting, buttons = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let MenuType = '' |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | let menu = window.GLOB.customMenu |
| | | let laypage = setting && setting.laypage !== 'false' |
| | | let interfaces = [] |
| | |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (menu.parentId === 'BillPrintTemp') { |
| | | MenuType = 'billPrint' |
| | | } |
| | | let modules = [] |
| | | if (subtype === 'propcard' || subtype === 'datacard') { |
| | |
| | | options: [ |
| | | {value: 'page', label: '页码'}, |
| | | {value: 'switch', label: '左右切换', forbid: appType === 'mob' || subtype === 'tablecard'}, |
| | | {value: 'slide', label: '滑动加载', forbid: appType !== 'mob' || sessionStorage.getItem('editMenuType') === 'popview'}, |
| | | {value: 'slide', label: '滑动加载', forbid: appType !== 'mob' || ispop}, |
| | | {value: 'more', label: '查看更多'}, |
| | | ], |
| | | controlFields: [ |
| | |
| | | controlFields: [ |
| | | {field: 'printHeight', values: ['content']}, |
| | | ], |
| | | forbid: subtype !== 'propcard' || MenuType !== 'billPrint' |
| | | forbid: subtype !== 'propcard' || !isprint |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | initval: wrap.printHeight || '', |
| | | tooltip: subtype !== 'propcard' ? '当前数据卡高度相当于几条数据。' : '当前属性卡高度相当于几条数据。', |
| | | required: false, |
| | | forbid: subtype === 'tablecard' || MenuType !== 'billPrint' |
| | | forbid: subtype === 'tablecard' || !isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'true', label: '验证'}, |
| | | {value: 'false', label: '忽略'}, |
| | | ], |
| | | forbid: subtype !== 'datacard' |
| | | forbid: subtype !== 'datacard' || isprint |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | |
| | | required: false, |
| | | options: modules, |
| | | allowClear: true, |
| | | forbid: subtype !== 'propcard' |
| | | forbid: subtype !== 'propcard' || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | initval: wrap.supType || 'single', |
| | | tooltip: '上级组件为单一组件或多个组件。', |
| | | required: false, |
| | | forbid: subtype !== 'datacard' || appType === 'mob', |
| | | forbid: subtype !== 'datacard' || appType === 'mob' || isprint, |
| | | options: [ |
| | | {value: 'single', label: '单组件'}, |
| | | {value: 'multi', label: '多组件'}, |
| | |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | label: '上级组件', |
| | | initval: supNodes, |
| | | required: true, |
| | | forbid: subtype !== 'datacard' || appType === 'mob', |
| | | forbid: subtype !== 'datacard' || appType === 'mob' || isprint, |
| | | span: 24, |
| | | columns: [ |
| | | { |
| | |
| | | */ |
| | | export default function (wrap, columns = [], setting) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | // let MenuType = '' |
| | | // let menu = window.GLOB.customMenu |
| | | let laypage = setting && setting.laypage !== 'false' |
| | | |
| | | // if (menu.parentId === 'BillPrintTemp') { |
| | | // MenuType = 'billPrint' |
| | | // } |
| | | |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | disabled: !laypage, |
| | | options: [ |
| | | {value: 'page', label: '页码'}, |
| | | {value: 'slide', label: '滑动加载', forbid: appType !== 'mob' || sessionStorage.getItem('editMenuType') === 'popview'}, |
| | | {value: 'slide', label: '滑动加载', forbid: appType !== 'mob' || ispop}, |
| | | {value: 'more', label: '查看更多'}, |
| | | ], |
| | | controlFields: [ |
| | |
| | | {value: 'true', label: '有'}, |
| | | ], |
| | | }, |
| | | // { |
| | | // type: 'number', |
| | | // field: 'printHeight', |
| | | // label: '换算高度', |
| | | // initval: wrap.printHeight || '', |
| | | // tooltip: '当前数据卡高度相当于几条数据。', |
| | | // required: false, |
| | | // forbid: MenuType !== 'billPrint' |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | export default function (wrap, subtype) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | export function getBaseForm (card, columns) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: card.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | export function getBaseForm (card, columns = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', text: '继承菜单'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | multi: true, |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | export function getBaseForm (card) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', text: '继承菜单'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | multi: true, |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | } |
| | | ] |
| | | } |
| | |
| | | let appType = sessionStorage.getItem('appType') |
| | | let isApp = appType === 'pc' || appType === 'mob' |
| | | let menulist = null |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (isApp) { |
| | | menulist = sessionStorage.getItem('appMenus') |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', text: '继承菜单'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | multi: true, |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | } |
| | | ] |
| | | } |
| | |
| | | export function getBaseForm (card) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', text: '继承菜单'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | multi: true, |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | } |
| | | ] |
| | | } |
| | |
| | | export function getBaseForm (card) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | |
| | | {value: 'true', text: '启用'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', text: '继承菜单'}, |
| | | {value: 'false', text: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | multi: true, |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | // { |
| | | // type: 'cascader', |
| | |
| | | export default function (wrap) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | ] |
| | | |
| | |
| | | export default function (wrap, columns) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | let menu = window.GLOB.customMenu |
| | | |
| | | let interfaces = [] |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | ] |
| | | |
| | |
| | | export default function (wrap, action = [], columns = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType !== '' |
| | | forbid: appType !== '' || isprint |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'true', label: '验证'}, |
| | | {value: 'false', label: '忽略'}, |
| | | ], |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | ] |
| | | |
| | |
| | | export default function (wrap, columns) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | export default function (wrap, columns = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: !appType || ispop |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: ispop |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | this.setState({loading: true}) |
| | | this.verifyRef.submitDataSource().then(res => { |
| | | |
| | | let MenuType = sessionStorage.getItem('MenuType') |
| | | |
| | | if (MenuType === 'billPrint') { |
| | | res.setting.supModule = ['empty'] |
| | | } |
| | | |
| | | if (res.columns) { |
| | | res.columns = res.columns.map(item => { |
| | | |
| | |
| | | <Select.Option value="Nvarchar(512)"> Nvarchar(512) </Select.Option> |
| | | <Select.Option value="Nvarchar(1024)"> Nvarchar(1024) </Select.Option> |
| | | <Select.Option value="Nvarchar(2048)"> Nvarchar(2048) </Select.Option> |
| | | <Select.Option value="Nvarchar(4000)"> Nvarchar(4000) </Select.Option> |
| | | <Select.Option value="Nvarchar(max)"> Nvarchar(max) </Select.Option> |
| | | <Select.Option value="Int"> Int </Select.Option> |
| | | <Select.Option value="Decimal(18,0)"> Decimal(18,0) </Select.Option> |
| | |
| | | { value: 'Nvarchar(512)', text: 'Nvarchar(512)' }, |
| | | { value: 'Nvarchar(1024)', text: 'Nvarchar(1024)' }, |
| | | { value: 'Nvarchar(2048)', text: 'Nvarchar(2048)' }, |
| | | { value: 'Nvarchar(4000)', text: 'Nvarchar(4000)' }, |
| | | { value: 'Nvarchar(max)', text: 'Nvarchar(max)' }, |
| | | { value: 'Int', text: 'Int' }, |
| | | { value: 'Decimal(18,0)', text: 'Decimal(18,0)' }, |
| | |
| | | modules: [], |
| | | innerRules: [], |
| | | innertip: '', |
| | | MenuType: '', |
| | | MenuType: sessionStorage.getItem('MenuType') || '', |
| | | ismain: false |
| | | } |
| | | |
| | |
| | | const { config, setting } = this.props |
| | | |
| | | let menu = window.GLOB.customMenu |
| | | let MenuType = '' |
| | | |
| | | if (menu.parentId === 'BillPrintTemp') { |
| | | MenuType = 'billPrint' |
| | | } |
| | | |
| | | let modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces) |
| | | let ismain = false |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | this.setState({modules, innerRules, innertip, setting: _setting, ismain, MenuType}) |
| | | this.setState({modules, innerRules, innertip, setting: _setting, ismain}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | import xflow from '@/assets/mobimg/xflow.png' |
| | | import Voucher from '@/assets/mobimg/voucher.png' |
| | | import Account from '@/assets/mobimg/account.png' |
| | | import canlendar from '@/assets/mobimg/canlendar.png' |
| | | |
| | | // 组件配置信息 |
| | | export const menuOptions = [ |
| | |
| | | { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '常用表', width: 24 }, |
| | | { type: 'menu', url: NormalTable, component: 'table', subtype: 'editable', title: '表格(可编辑)', width: 24, forbid: ['billPrint'] }, |
| | | { type: 'menu', url: timeline, component: 'timeline', subtype: 'timeline', title: '时间轴', width: 12 }, |
| | | { type: 'menu', url: timeline, component: 'calendar', subtype: 'calendar', title: '日历', width: 24 }, |
| | | { type: 'menu', url: canlendar, component: 'calendar', subtype: 'calendar', title: '日历', width: 24 }, |
| | | { type: 'menu', url: tree, component: 'tree', subtype: 'normaltree', title: '树形列表', width: 12, forbid: ['billPrint'] }, |
| | | { type: 'menu', url: line, component: 'line', subtype: 'line', title: '折线图', width: 24 }, |
| | | { type: 'menu', url: bar, component: 'bar', subtype: 'bar', title: '柱状图', width: 24 }, |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Modal, Tooltip, notification } from 'antd' |
| | | import { QuestionCircleOutlined, PlusOutlined, CloseOutlined } from '@ant-design/icons' |
| | | |
| | | import SettingForm from './settingform' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | class ProcessComponent extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.any, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | visible: false, |
| | | urlFields: this.props.config.urlFields || [] |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | editDataSource = () => { |
| | | this.setState({ |
| | | visible: true |
| | | }) |
| | | } |
| | | |
| | | verifySubmit = () => { |
| | | const { urlFields } = this.state |
| | | const { config } = this.props |
| | | |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | if (urlFields.filter(field => field === res.field).length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let _urlFields = [...urlFields, res.field] |
| | | |
| | | this.setState({ |
| | | visible: false, |
| | | urlFields: _urlFields |
| | | }) |
| | | |
| | | if (window.GLOB.urlFields) { |
| | | window.GLOB.urlFields = _urlFields |
| | | } |
| | | |
| | | this.props.updateConfig({...config, urlFields: _urlFields}) |
| | | }) |
| | | } |
| | | |
| | | deleteField = (field) => { |
| | | let config = JSON.stringify(this.props.config) |
| | | const _this = this |
| | | |
| | | if (new RegExp(field, 'ig').test(config)) { |
| | | confirm({ |
| | | title: `配置中存在@${field}@,确定删除吗?`, |
| | | content: '', |
| | | onOk() { |
| | | _this.execDelete(field) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | this.execDelete(field) |
| | | } |
| | | } |
| | | |
| | | execDelete = (_field) => { |
| | | const { config } = this.props |
| | | let _urlFields = this.state.urlFields.filter(field => field !== _field) |
| | | |
| | | this.setState({ |
| | | urlFields: _urlFields |
| | | }) |
| | | |
| | | if (window.GLOB.urlFields) { |
| | | window.GLOB.urlFields = _urlFields |
| | | } |
| | | |
| | | this.props.updateConfig({...config, urlFields: _urlFields}) |
| | | } |
| | | |
| | | render () { |
| | | const { visible, urlFields } = this.state |
| | | |
| | | return ( |
| | | <div className="url-field-component"> |
| | | <div className="field-plus"> |
| | | <Tooltip placement="topLeft" title="页面可接收的参数字段,在查询数据源或自定义脚本中使用 @字段@ 接收。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | url变量 |
| | | </Tooltip> |
| | | <PlusOutlined title="添加" onClick={() => this.editDataSource()} /> |
| | | </div> |
| | | <div> |
| | | {urlFields.map((field, index) => { |
| | | return ( |
| | | <div className="field-item" key={index}> |
| | | <CloseOutlined title="删除" onClick={() => this.deleteField(field)} /> |
| | | {field} |
| | | </div> |
| | | ) |
| | | })} |
| | | </div> |
| | | <Modal |
| | | title="字段添加" |
| | | visible={visible} |
| | | width={500} |
| | | maskClosable={false} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | <SettingForm |
| | | inputSubmit={this.verifySubmit} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ProcessComponent |
New file |
| | |
| | | .url-field-component { |
| | | margin-bottom: 15px; |
| | | .field-plus { |
| | | line-height: 35px; |
| | | padding-left: 16px; |
| | | >.anticon-plus { |
| | | color: #26C281; |
| | | padding: 2px 5px; |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | | .field-item { |
| | | position: relative; |
| | | border: 1px solid #e8e8e8; |
| | | padding: 5px 10px; |
| | | border-radius: 4px; |
| | | |
| | | >.anticon-close { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: 3px; |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Input } from 'antd' |
| | | |
| | | // import './index.scss' |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | inputSubmit: PropTypes.func // 回车事件 |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | handleSubmit = (e) => { |
| | | e.preventDefault() |
| | | |
| | | if (this.props.inputSubmit) { |
| | | this.props.inputSubmit() |
| | | } |
| | | } |
| | | |
| | | componentDidMount() { |
| | | try { |
| | | let _input = document.getElementById('field') |
| | | if (_input.focus) { |
| | | _input.focus() |
| | | } |
| | | } catch (e) { |
| | | console.warn('focus error!') |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 14 } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <div className="url-field-form"> |
| | | <Form {...formItemLayout}> |
| | | <Form.Item label="字段名"> |
| | | {getFieldDecorator('field', { |
| | | initialValue: '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入字段名!' |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9_]*$/ig, |
| | | message: '字段可使用英文、数字或_' |
| | | } |
| | | ] |
| | | })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Form> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(SettingForm) |
| | |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <ColorSketch defaultValue={item.initval} onChange={(value) => this.change(value, item.field)}/> |
| | | <ColorSketch config={{initval: item.initval}} onChange={(value) => this.change(value, item.field)}/> |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | loading: false, |
| | | data: null, |
| | | group: null, |
| | | BData: '', |
| | | step: 0 |
| | | BData: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | getStatFieldsValue = () => { |
| | | const { setting, config, search, BID, orderBy } = this.state |
| | | |
| | | if (!config.statFields) return |
| | | |
| | | if (setting.supModule && !BID) { // BID 不存在时,不做查询 |
| | | this.setState({ |
| | | statFValue: [] |
| | |
| | | if (res && res.ErrCode === 'S') { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.ErrMesg || '执行成功', |
| | | message: res.message || '执行成功', |
| | | duration: submit.stime ? submit.stime : 2 |
| | | }) |
| | | } else if (res && res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.ErrMesg || '执行成功' |
| | | title: res.message || '执行成功' |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || res.ErrMesg, |
| | | title: res.message || '执行失败!', |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: submit.ntime ? submit.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: submit.ftime ? submit.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || res.ErrMesg) |
| | | message.error(res.message || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | viewlost: false, // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用 |
| | | lostmsg: '', // 页面丢失时的提示信息 |
| | | config: null, // 页面配置信息,包括组件等 |
| | | userConfig: null, // 用户自定义设置 |
| | | loading: false, // 列表数据加载中 |
| | | visible: false, // 标签页控制 |
| | | shortcuts: null, // 快捷键 |
| | |
| | | }).then(response => { |
| | | if (!response || response.ErrCode === 'LoginError') return |
| | | // 回调请求 |
| | | if (ver_token && response.ErrMesg === 'token_error') { |
| | | if (ver_token && response.ErrCode === 'token_error') { |
| | | response.ErrCode = 'E' |
| | | this.execError(response) |
| | | } else if (btn.callbackFunc ) { |
| | | // 存在回调函数时,调用 |
| | |
| | | } |
| | | |
| | | if (error) { |
| | | this.execError({ErrCode: 'E', ErrMesg: error}) |
| | | this.execError({ErrCode: 'E', message: error}) |
| | | return |
| | | } |
| | | |
| | |
| | | if (datas.length > 0) { |
| | | this.addUser(ip, datas, sessionId) |
| | | } else { |
| | | this.execSuccess({ErrCode: 'S', ErrMesg: '执行成功。'}) |
| | | this.execSuccess({ErrCode: 'S', message: '执行成功。'}) |
| | | } |
| | | }, (err) => { |
| | | this.execPreError(err, data) |
| | |
| | | * 4、模态框执行成功后是否关闭 |
| | | * 5、通知主列表刷新 |
| | | */ |
| | | execSuccess = (res) => { |
| | | execSuccess = (res = {}) => { |
| | | const { btn } = this.props |
| | | |
| | | if (res && (res.ErrCode === 'S' || !res.ErrCode)) { // 执行成功 |
| | | if (res.ErrCode === 'S' || !res.ErrCode) { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.ErrMesg || '执行成功', |
| | | message: res.message || '执行成功', |
| | | duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 |
| | | }) |
| | | } else if (res && res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.ErrMesg || '执行成功' |
| | | title: res.message || '执行成功' |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || res.ErrMesg, |
| | | title: res.message || '执行失败!', |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || res.ErrMesg) |
| | | message.error(res.message || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | return |
| | | } else if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || res.ErrMesg, |
| | | title: res.message || '执行失败!', |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || res.ErrMesg) |
| | | message.error(res.message || '执行失败!') |
| | | } |
| | | |
| | | if (btn.execError !== 'never') { |
| | |
| | | if (!_vars.includes(_key)) { |
| | | _vars.push(_key) |
| | | |
| | | if (form.fieldlen && form.fieldlen > 2048) { |
| | | if (form.fieldlen && form.fieldlen > 4000) { |
| | | form.fieldlen = 'max' |
| | | } |
| | | |
| | |
| | | if (col.datatype) { |
| | | _declarefields.push(`@${_key} ${col.datatype}`) |
| | | } else { |
| | | if (col.fieldlength && col.fieldlength > 2048) { |
| | | if (col.fieldlength && col.fieldlength > 4000) { |
| | | col.fieldlength = 'max' |
| | | } |
| | | |
| | |
| | | result.status = false |
| | | result.message = result.$ErrMesg |
| | | result.ErrCode = 'E' |
| | | result.ErrMesg = result.$ErrMesg |
| | | } else { |
| | | result.status = result.status !== false |
| | | result.ErrCode = result.ErrCode || '-1' |
| | |
| | | |
| | | Api.genericInterface(result).then(res => { |
| | | if (!res) return // LoginError时中断请求 |
| | | if (ver_token && res.ErrMesg === 'token_error') { |
| | | if (ver_token && res.ErrCode === 'token_error') { |
| | | res.ErrCode = 'E' |
| | | this.execError(res) |
| | | return |
| | | } |
| | |
| | | errorMsg = { |
| | | ErrCode: 'N', |
| | | message: _temp.error, |
| | | ErrMesg: _temp.error, |
| | | status: false |
| | | } |
| | | } else { |
| | |
| | | _initvars.push(`@${_key}='${form.value}'`) |
| | | } |
| | | |
| | | if (form.fieldlen && form.fieldlen > 2048) { |
| | | if (form.fieldlen && form.fieldlen > 4000) { |
| | | form.fieldlen = 'max' |
| | | } |
| | | |
| | |
| | | }).then(response => { |
| | | if (!response || response.ErrCode === 'LoginError') return |
| | | |
| | | if (ver_token && response.ErrMesg === 'token_error') { |
| | | if (ver_token && response.ErrCode === 'token_error') { |
| | | response.ErrCode = 'E' |
| | | this.execError(response) |
| | | _resolve({next: false, list: []}) |
| | | } else if (btn.callbackFunc) { |
| | |
| | | |
| | | if (item.advanced && !forbid) { |
| | | _setting.showAdv = true |
| | | if (!['group', 'check', 'switch'].includes(item.type)) { |
| | | item.signValue = true |
| | | } |
| | | } else { |
| | | item.advanced = false |
| | | } |
| | | |
| | | if (item.advanced && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | | val = val.split(',').map(m => m + ':00').join(',') |
| | | } else { |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'group') { |
| | |
| | | if (item.type === 'checkcard' && item.multiple === 'dropdown' && item.resourceType === '0') { |
| | | this.resetCheckcard(item) |
| | | } |
| | | } |
| | | |
| | | if (item.signValue && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | | val = val.split(',').map(m => m + ':00').join(',') |
| | | } else { |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | |
| | | fieldMap.set(item.field, item) |
| | |
| | | if (visible) { |
| | | let advanceValues = [] |
| | | this.state.searchlist.forEach(item => { |
| | | if (!item.advanced) return |
| | | if (!item.signValue) return |
| | | |
| | | let val = this.record[item.field] |
| | | if (val || val === 0) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | }) |
| | | this.setState({advanceValues}) |
| | |
| | | } else { |
| | | record[item.field] = item.initval |
| | | } |
| | | if (item.advanced && item.initval) { |
| | | if (item.signValue && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | |
| | | return item |
| | |
| | | |
| | | let advanceValues = [] |
| | | this.state.searchlist.forEach(item => { |
| | | if (!item.advanced) return |
| | | if (!item.signValue) return |
| | | |
| | | let val = this.record[item.field] |
| | | if (val || val === 0) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | }) |
| | | |
| | |
| | | return ( |
| | | <div key={index}> |
| | | <span>{item.label}: </span> |
| | | <span className="advance-value">{item.value}</span> |
| | | <span className="advance-value">{item.text}</span> |
| | | <CloseOutlined onClick={() => this.closeAdvanceForm(item)} /> |
| | | </div>) |
| | | })} |
| | |
| | | <Select.Option value="Nvarchar(512)"> Nvarchar(512) </Select.Option> |
| | | <Select.Option value="Nvarchar(1024)"> Nvarchar(1024) </Select.Option> |
| | | <Select.Option value="Nvarchar(2048)"> Nvarchar(2048) </Select.Option> |
| | | <Select.Option value="Nvarchar(4000)"> Nvarchar(4000) </Select.Option> |
| | | <Select.Option value="Nvarchar(max)"> Nvarchar(max) </Select.Option> |
| | | <Select.Option value="Int"> Int </Select.Option> |
| | | <Select.Option value="Decimal(18,0)"> Decimal(18,0) </Select.Option> |
| | |
| | | { value: 'Nvarchar(512)', text: 'Nvarchar(512)' }, |
| | | { value: 'Nvarchar(1024)', text: 'Nvarchar(1024)' }, |
| | | { value: 'Nvarchar(2048)', text: 'Nvarchar(2048)' }, |
| | | { value: 'Nvarchar(4000)', text: 'Nvarchar(4000)' }, |
| | | { value: 'Nvarchar(max)', text: 'Nvarchar(max)' }, |
| | | { value: 'Int', text: 'Int' }, |
| | | { value: 'Decimal(18,0)', text: 'Decimal(18,0)' }, |
| | |
| | | { value: 'Nvarchar(512)', text: 'Nvarchar(512)' }, |
| | | { value: 'Nvarchar(1024)', text: 'Nvarchar(1024)' }, |
| | | { value: 'Nvarchar(2048)', text: 'Nvarchar(2048)' }, |
| | | { value: 'Nvarchar(4000)', text: 'Nvarchar(4000)' }, |
| | | { value: 'Nvarchar(max)', text: 'Nvarchar(max)' }, |
| | | { value: 'Int', text: 'Int' }, |
| | | { value: 'Decimal(18,0)', text: 'Decimal(18,0)' }, |
| | |
| | | _fieldlen = _f.decimal ? _f.decimal : 0 |
| | | } |
| | | |
| | | if (_fieldlen > 2048) { |
| | | if (_fieldlen > 4000) { |
| | | _fieldlen = 'max' |
| | | } |
| | | |
| | |
| | | try { // 存在max |
| | | _length = +_type.match(/\d+/)[0] || 50 |
| | | } catch (e) { |
| | | _length = 2048 |
| | | _length = 4000 |
| | | } |
| | | _type = 'text' |
| | | } else if (/^int/.test(_type)) { |
| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Select, DatePicker, Input, Popover, Form } from 'antd' |
| | | import { Select, DatePicker, Input, Popover, Form, Switch, Radio, Checkbox } from 'antd' |
| | | import { EditOutlined, CopyOutlined, CloseOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | } else if (card.type === 'checkcard') { |
| | | type = 'checkcard' |
| | | formItem = <CheckCard config={card} /> |
| | | } else if (card.type === 'switch') { |
| | | formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} checked={card.initval === card.openVal}/>) |
| | | } else if (card.type === 'radio') { |
| | | let options = card.options |
| | | if (options.length === 0) { |
| | | options = [{Value: '1', Text: '选项1'}, {Value: '2', Text: '选项2'}] |
| | | } |
| | | formItem = (<Radio.Group value={card.initval} style={{lineHeight: '36px'}}> |
| | | {options.map((item, i) => (<Radio key={i} value={item.Value}> {item.Text} </Radio>))} |
| | | </Radio.Group>) |
| | | } else if (card.type === 'check') { |
| | | formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox> |
| | | } |
| | | |
| | | let labelwidth = card.labelwidth || 33.3 |
| | |
| | | } else { |
| | | let datatype = 'Nvarchar(50)' |
| | | let fieldlength = 50 |
| | | if (col.fieldlength && [10, 20, 50, 100, 256, 512, 1024, 2048].includes(col.fieldlength)) { |
| | | if (col.fieldlength && [10, 20, 50, 100, 256, 512, 1024, 2048, 4000].includes(col.fieldlength)) { |
| | | fieldlength = col.fieldlength |
| | | datatype = `Nvarchar(${fieldlength})` |
| | | } |
| | |
| | | _fieldlen = _f.decimal ? _f.decimal : 0 |
| | | } |
| | | |
| | | if (_fieldlen > 2048) { |
| | | if (_fieldlen > 4000) { |
| | | _fieldlen = 'max' |
| | | } |
| | | |
| | |
| | | |
| | | let _fieldlen = _f.fieldlength || 50 |
| | | |
| | | if (_fieldlen > 2048) { |
| | | if (_fieldlen > 4000) { |
| | | _fieldlen = 'max' |
| | | } |
| | | |
| | |
| | | * @param {Number} pageIndex 页码 |
| | | * @param {Number} pageSize 每页数量 |
| | | * @param {String} BID 上级ID |
| | | * @return {Object} param |
| | | */ |
| | | static getQueryDataParams (setting, search = [], orderBy = '', pageIndex = 1, pageSize = 10, BID, id, year) { |
| | | let param = null |
| | |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | // _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '') |
| | | // _customScript = _customScript.replace(/@select\$|\$select@/ig, '') |
| | | // _dataresource = _dataresource.replace(/\$sum@/ig, '/*') |
| | | // _dataresource = _dataresource.replace(/@sum\$/ig, '*/') |
| | | // _customScript = _customScript.replace(/\$sum@/ig, '/*') |
| | | // _customScript = _customScript.replace(/@sum\$/ig, '*/') |
| | | |
| | | let _search = '' |
| | | if (setting.queryType !== 'statistics' && _dataresource) { |
| | | _search = Utils.joinMainSearchkey(searchlist) |
| | |
| | | primaryKey: setting.primaryKey || '', |
| | | foreign_key: '', |
| | | sql: _dataresource, |
| | | script: _customScript, |
| | | // transaction: setting.transaction === 'true' |
| | | script: _customScript |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | export default class Utils { |
| | | /** |
| | | * @description 获取会员等级 |
| | | * @return {String} level |
| | | */ |
| | | static getMemberLevel () { |
| | | let _level = 10 |
| | | let _Mlevel = sessionStorage.getItem('Member_Level') |
| | | |
| | | if (_Mlevel) { |
| | | if (_Mlevel === md5('mksoft' + window.GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 10)) { |
| | | _level = 10 |
| | | } else if (_Mlevel === md5('mksoft' + window.GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 20)) { |
| | | _level = 20 |
| | | } else if (_Mlevel === md5('mksoft' + window.GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 30)) { |
| | | _level = 30 |
| | | } |
| | | } |
| | | return _level |
| | | } |
| | | |
| | | /** |
| | | * @description 获取图表高度 |
| | | */ |
| | | static getHeight (val) { |
| | |
| | | if (!_vars.includes(_key)) { |
| | | _vars.push(_key) |
| | | |
| | | if (form.fieldlen && form.fieldlen > 2048) { |
| | | if (form.fieldlen && form.fieldlen > 4000) { |
| | | form.fieldlen = 'max' |
| | | } |
| | | |
| | |
| | | if (col.datatype) { |
| | | _declarefields.push(`@${_key} ${col.datatype}`) |
| | | } else { |
| | | if (col.fieldlength && col.fieldlength > 2048) { |
| | | if (col.fieldlength && col.fieldlength > 4000) { |
| | | col.fieldlength = 'max' |
| | | } |
| | | |
| | |
| | | _dataresource = `select top 1000 ${setting.arr_field} from ${_dataresource} ` |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true) { |
| | | _customScript && console.info(`${_dataresource ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | _dataresource && console.info(_dataresource) |
| | | } |
| | | |
| | | return { |
| | | name: dataName, |
| | | columns: columns, |
| | | par_tablename: '', |
| | | order: setting.order || '', |
| | | type: format === 'array' ? format : '', |
| | | primaryKey: setting.primaryKey || '', |
| | | foreign_key: '', |
| | |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | let regoptions = [ |
| | | { reg: /@pageSize@/ig, value: 9999 }, |
| | | { reg: /@pageIndex@/ig, value: 1}, |
| | | { reg: /@ID@/ig, value: `''`}, |
| | | { reg: /@BID@/ig, value: `'${BID || ''}'`}, |
| | | { reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID') || ''}'`}, |
| | | { reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid') || ''}'`}, |
| | | { reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID') || ''}'`}, |
| | | { reg: /@Appkey@/ig, value: `'${window.GLOB.appkey || ''}'`}, |
| | | { reg: /@typename@/ig, value: `'admin'`}, |
| | | ] |
| | | |
| | | let LText = params.map((item, index) => { |
| | | let _sql = item.sql |
| | | let _script = item.script |
| | |
| | | ` |
| | | } |
| | | |
| | | _sql = _sql.replace(/@orderBy@/ig, item.order) |
| | | _script = _script.replace(/@orderBy@/ig, item.order) |
| | | |
| | | regoptions.forEach(cell => { |
| | | _sql = _sql.replace(cell.reg, cell.value) |
| | | _script = _script.replace(cell.reg, cell.value) |
| | | }) |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true) { |
| | | _script && console.info(`${_sql ? '' : '/*不执行默认sql*/\n'}${_script}`) |
| | | _sql && console.info(_sql) |
| | | } |
| | | |
| | | item.columns.forEach(cell => { |
| | | LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`) |
| | | }) |
| | |
| | | menulist: null, // 一级菜单 |
| | | userName: sessionStorage.getItem('CloudUserName'), |
| | | avatar: Utils.getrealurl(sessionStorage.getItem('CloudAvatar')), |
| | | memberLevel: Utils.getMemberLevel(), |
| | | visible: false, |
| | | loading: false |
| | | } |
| | |
| | | trdItem.PageParam = {OpenType: 'newtab'} |
| | | } |
| | | |
| | | if (trdItem.type === 'CustomPage' && this.state.memberLevel < 20) { // 会员等级大于等于20时,有编辑权限 |
| | | if (trdItem.type === 'CustomPage' && window.GLOB.memberLevel < 20) { // 会员等级大于等于20时,有编辑权限 |
| | | trdItem.forbidden = true |
| | | } |
| | | |
| | |
| | | |
| | | render () { |
| | | const { mainMenu, editLevel } = this.props |
| | | const { menulist, memberLevel, visible, loading } = this.state |
| | | const { menulist, visible, loading } = this.state |
| | | |
| | | return ( |
| | | <header className={'sys-header-container ant-menu-dark ' + (['level2', 'level3'].includes(editLevel) ? 'mask' : '')} id="main-header-container"> |
| | |
| | | <div className="icon"><HomeOutlined /></div> |
| | | <div className="title">首页</div> |
| | | <div className="detail">基于自定义页面的首页设计,可实现灵活的元素配置及样式调整,展现当前系统的风格。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}> |
| | | <Button type="primary" disabled={window.GLOB.memberLevel < 20} title={window.GLOB.memberLevel < 20 ? '会员等级不够,无开发权限。' : ''} onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> : null |
| | |
| | | <div className="icon"><ApiOutlined /></div> |
| | | <div className="title">接口调试</div> |
| | | <div className="detail">可自动处理登录接口的参数加密,以及业务接口的签名计算,方便开发人员的接口测试工作。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/interface')}}> |
| | | <Button type="primary" disabled={window.GLOB.memberLevel < 20} title={window.GLOB.memberLevel < 20 ? '会员等级不够,无开发权限。' : ''} onClick={() => {window.open('#/interface')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> |
| | |
| | | <div className="title">应用管理</div> |
| | | <div className="detail">可创建及管理PC、pad及移动端等不同设备的应用,实现明科云APP、微信公众号、小程序等多平台的应用共享。</div> |
| | | {window.GLOB.systemType !== 'production' ? |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/appmanage')}}> |
| | | <Button type="primary" disabled={window.GLOB.memberLevel < 20} title={window.GLOB.memberLevel < 20 ? '会员等级不够,无开发权限。' : ''} onClick={() => {window.open('#/appmanage')}}> |
| | | 编辑 |
| | | </Button> : |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/appcheck')}}> |
| | | <Button type="primary" disabled={window.GLOB.memberLevel < 20} title={window.GLOB.memberLevel < 20 ? '会员等级不够,无开发权限。' : ''} onClick={() => {window.open('#/appcheck')}}> |
| | | 查看 |
| | | </Button> |
| | | } |
| | |
| | | |
| | | getUsedTemplate = () => { |
| | | let { sysTemplates } = this.state |
| | | let memberLevel = Utils.getMemberLevel() |
| | | |
| | | const illust = { // 模板图片,用于已使用模板 |
| | | BaseTable: mainsubtable, |
| | | TreePage: treepage, |
| | |
| | | res.UserTemp.forEach(temp => { |
| | | if (!['BaseTable', 'CustomPage'].includes(temp.Template)) { |
| | | return |
| | | } else if (temp.Template === 'CustomPage' && memberLevel < 20) { |
| | | } else if (temp.Template === 'CustomPage' && window.GLOB.memberLevel < 20) { |
| | | temp.disabled = true |
| | | temp.disTitle = '会员等级不够,无开发权限。' |
| | | } |
| | |
| | | }) |
| | | |
| | | sysTemplates = sysTemps.map(temp => { |
| | | if (temp.type === 'CustomPage' && memberLevel < 20) { |
| | | if (temp.type === 'CustomPage' && window.GLOB.memberLevel < 20) { |
| | | temp.disabled = true |
| | | temp.disTitle = '会员等级不够,无开发权限。' |
| | | } |
| | |
| | | showline: res.split_line_show || 'true', |
| | | webSite: res.WebSite || '', |
| | | navBar: res.menu_type, // shutter 百叶窗、linkage_navigation 联动菜单、linkage 联动菜单_无导航栏、menu_board 菜单面板、menu_board_navigation 菜单面板_标签页 |
| | | app_version: res.app_version |
| | | app_version: res.app_version, |
| | | Member_Level: 0 |
| | | } |
| | | |
| | | if ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100].includes(res.member_level)) { |
| | | systemMsg.Member_Level = md5('mksoft' + window.GLOB.appkey + res.member_level) |
| | | if (!window.GLOB.memberLevel) { |
| | | Object.defineProperty(window.GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: res.member_level |
| | | }) |
| | | } |
| | | } |
| | | |
| | | let level = res.pwd_level || '' |
| | |
| | | link.rel = 'shortcut icon' |
| | | link.href = res.titlelogo |
| | | document.getElementsByTagName('head')[0].appendChild(link) |
| | | } |
| | | |
| | | let memberLevel = res.member_level |
| | | |
| | | if (typeof(memberLevel) === 'number' && memberLevel > 0 && parseInt(memberLevel / 10) * 10 === memberLevel) { |
| | | sessionStorage.setItem('Member_Level', md5('mksoft' + window.GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + memberLevel)) |
| | | window.GLOB.memberLevel = memberLevel |
| | | } |
| | | |
| | | // positecgroup |
| | |
| | | try { |
| | | let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) |
| | | |
| | | sessionStorage.setItem('MenuType', param.MenuType || 'custom') |
| | | |
| | | this.setState({ |
| | | MenuType: param.MenuType, |
| | | MenuId: param.MenuId || param.MenuID, |
| | |
| | | <Collapse accordion defaultActiveKey="basedata" bordered={false}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" key="basedata"> |
| | | {/* 菜单信息 */} |
| | | {config && MenuType === 'custom' ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | parentId={ParentId} |
| | | MenuName={config.MenuName} |
| | | MenuNo={config.MenuNo} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config && MenuType === 'home' ? <HomeForm |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config && MenuType === 'billPrint' ? <PrintMenuForm |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config ? <UrlFieldComponent |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {/* 表名添加 */} |
| | | {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null} |
| | | {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null} |
| | | {config ? <NormalCss config={config} updateConfig={this.updateConfig}/> : null} |
| | | {config ? <> |
| | | {MenuType === 'custom' ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | parentId={ParentId} |
| | | MenuName={config.MenuName} |
| | | MenuNo={config.MenuNo} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {MenuType === 'home' ? <HomeForm |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {MenuType === 'billPrint' ? <PrintMenuForm |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | <UrlFieldComponent |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" key="component"> |
| | |
| | | window.GLOB.urlFields = [] // url变量 |
| | | window.GLOB.customMenu = null // 保存菜单信息 |
| | | |
| | | const memberLevel = Utils.getMemberLevel() |
| | | |
| | | class MobDesign extends Component { |
| | | state = { |
| | | loading: true, |
| | |
| | | return |
| | | } |
| | | |
| | | if (memberLevel < 30) return |
| | | if (window.GLOB.memberLevel < 30) return |
| | | |
| | | window.GLOB.developing = true |
| | | |
| | |
| | | |
| | | componentDidMount () { |
| | | if (!sessionStorage.getItem('UserID')) return |
| | | if (memberLevel < 30) { |
| | | if (window.GLOB.memberLevel < 30) { |
| | | document.getElementById('mk-mob-design-view').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh; height: 100vh; background: #fff;">本应用没有PC端页面的编辑权限,请联系管理员!</div>' |
| | | return |
| | | } |
| | |
| | | <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" forceRender className="basedata" key="basedata"> |
| | | {/* 菜单信息 */} |
| | | {config ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | adapters={adapters} |
| | | updateConfig={(con) => { |
| | | this.updateConfig(con) |
| | | if (con.direction !== config.direction) { |
| | | this.changeView(con.direction) |
| | | } |
| | | }} |
| | | /> : null} |
| | | {config ? <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> : null} |
| | | {/* 表名添加 */} |
| | | {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null} |
| | | {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null} |
| | | {config ? <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> : null} |
| | | {config ? <NormalCss config={config} updateConfig={this.updateConfig}/> : null} |
| | | {config ? <> |
| | | <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | adapters={adapters} |
| | | updateConfig={(con) => { |
| | | this.updateConfig(con) |
| | | if (con.direction !== config.direction) { |
| | | this.changeView(con.direction) |
| | | } |
| | | }} |
| | | /> |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" className="component" key="component"> |
| | |
| | | sessionStorage.setItem('typename', 'pc') |
| | | document.body.className = '' |
| | | |
| | | const memberLevel = Utils.getMemberLevel() |
| | | |
| | | class MenuDesign extends Component { |
| | | state = { |
| | | loading: true, |
| | |
| | | return |
| | | } |
| | | |
| | | if (memberLevel < 30) return |
| | | if (window.GLOB.memberLevel < 30) return |
| | | |
| | | sessionStorage.setItem('editMenuType', 'menu') // 编辑菜单类型 |
| | | |
| | |
| | | |
| | | componentDidMount () { |
| | | if (!sessionStorage.getItem('UserID')) return |
| | | if (memberLevel < 30) { |
| | | if (window.GLOB.memberLevel < 30) { |
| | | document.getElementById('mk-pc-design-view').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh; height: 100vh; background: #fff;">本应用没有PC端页面的编辑权限,请联系管理员!</div>' |
| | | return |
| | | } |
| | |
| | | <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" key="basedata"> |
| | | {/* 菜单信息 */} |
| | | {config ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config ? <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> : null} |
| | | {/* 表名添加 */} |
| | | {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null} |
| | | {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null} |
| | | {config ? <NormalCss config={config} updateConfig={this.updateConfig}/> : null} |
| | | {config ? <> |
| | | <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | updateConfig={this.updateConfig} |
| | | /> |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" key="component"> |
| | |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.ErrMesg, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: error.ErrMesg, |
| | | message: error.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.ErrMesg, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.ErrMesg, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | |
| | | showline: res.split_line_show || 'true', |
| | | webSite: res.WebSite || '', |
| | | navBar: res.menu_type, |
| | | app_version: res.app_version |
| | | app_version: res.app_version, |
| | | Member_Level: 0 |
| | | } |
| | | |
| | | if ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100].includes(res.member_level)) { |
| | | systemMsg.Member_Level = md5('mksoft' + window.GLOB.appkey + res.member_level) |
| | | if (!window.GLOB.memberLevel) { |
| | | Object.defineProperty(window.GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: res.member_level |
| | | }) |
| | | } |
| | | } |
| | | |
| | | let level = res.pwd_level || '' |
| | |
| | | document.getElementsByTagName('head')[0].appendChild(link) |
| | | } |
| | | |
| | | let memberLevel = res.member_level |
| | | |
| | | if (typeof(memberLevel) === 'number' && memberLevel > 0 && parseInt(memberLevel / 10) * 10 === memberLevel) { |
| | | sessionStorage.setItem('Member_Level', md5('mksoft' + window.GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + memberLevel)) |
| | | window.GLOB.memberLevel = memberLevel |
| | | } |
| | | this.props.history.replace('/main') |
| | | } else { |
| | | notification.warning({ |
| | |
| | | <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" key="basedata"> |
| | | {/* 菜单信息 */} |
| | | {config ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | parentId={ParentId} |
| | | MenuName={config.MenuName} |
| | | MenuNo={config.MenuNo} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {config ? <UrlFieldComponent |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | {/* 表名添加 */} |
| | | {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null} |
| | | {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null} |
| | | {config ? <> |
| | | <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | parentId={ParentId} |
| | | MenuName={config.MenuName} |
| | | MenuNo={config.MenuNo} |
| | | updateConfig={this.updateConfig} |
| | | /> |
| | | <UrlFieldComponent |
| | | config={config} |
| | | updateConfig={this.updateConfig} |
| | | /> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | </> : null} |
| | | </Panel> |
| | | <Panel header="搜索" key="search"> |
| | | {Source.searchItems.map((item, index) => (<SourceElement key={index} content={item}/>))} |