| | |
| | | { |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mkindustry", |
| | | "defaultApp": "mk", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "WXAppID": "wx4d8a34c8d4494872", |
| | | "WXminiAppID": "", |
| | | "WXNotice": "true", |
| | | "nginx": "true", |
| | | "debugger": false, |
| | | "licenseKey": "", |
| | |
| | | "transfer": "false", |
| | | "keepPassword": "true", |
| | | "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "MKWMS/" |
| | | } |
| | |
| | | /** |
| | | * @description 微信业务请求 |
| | | */ |
| | | wxAccessToken () { |
| | | wxAccessToken (domain = '') { |
| | | let _url = window.GLOB.baseurl + 'wxpay/getaccesstoken' |
| | | if (process.env.NODE_ENV !== 'production') { |
| | | _url = document.location.origin + '/wxpay/getaccesstoken' |
| | | |
| | | if (domain) { |
| | | _url = domain + 'wxpay/getaccesstoken' |
| | | } |
| | | |
| | | return new Promise(resolve => { |
| | | if (window.GLOB.accessToken.accessTime && (parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.accessTime < 30)) { |
| | | if (window.GLOB.accessToken.domain === domain && window.GLOB.accessToken.accessTime && (parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.accessTime < 30)) { |
| | | resolve(window.GLOB.accessToken) |
| | | } else { |
| | | window.GLOB.accessToken = {} |
| | | window.GLOB.accessToken = {domain} |
| | | axios({ |
| | | url: _url, |
| | | method: 'get' |
| | |
| | | * @description 微信业务请求 |
| | | */ |
| | | wxNginxRequest (url, method, param) { |
| | | let _url = window.GLOB.location + '/' + url |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + '/' + url |
| | | } |
| | | if (/^http:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) { |
| | | _url = window.GLOB.location + ':8080/' + url |
| | | let _url = url |
| | | |
| | | if (!/^http/.test(url)) { |
| | | _url = window.GLOB.location + '/' + url |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8080/' + url |
| | | _url = document.location.origin + '/' + url |
| | | } |
| | | } else if (/^https:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) { |
| | | _url = window.GLOB.location + ':8443/' + url |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8443/' + url |
| | | if (/^http:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) { |
| | | _url = window.GLOB.location + ':8080/' + url |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8080/' + url |
| | | } |
| | | } else if (/^https:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) { |
| | | _url = window.GLOB.location + ':8443/' + url |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8443/' + url |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | getWxNativePay (param) { |
| | | let _url = window.GLOB.baseurl + 'wxpay/wxNativePay' |
| | | if (process.env.NODE_ENV !== 'production') { |
| | | _url = document.location.origin + '/wxpay/wxNativePay' |
| | | } |
| | | |
| | | return axios({ |
| | | url: _url, |
| | |
| | | const { confirm } = Modal |
| | | const { Search } = Input |
| | | const Resetpwd = asyncComponent(() => import('@/components/resetPassword')) |
| | | const QrCode = asyncComponent(() => import('@/components/qrcode')) |
| | | const LoginForm = asyncSpinComponent(() => import('./loginform')) |
| | | |
| | | class Header extends Component { |
| | |
| | | }) |
| | | } |
| | | |
| | | wxnotice = () => { |
| | | Modal.success({ |
| | | className: 'mk-wx-notice', |
| | | title: <QrCode card={{qrWidth: 320, color: '#000000'}} value={window.GLOB.baseurl + 'mob/wxnotice.html?userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')}/>, |
| | | okText: '关闭' |
| | | }) |
| | | } |
| | | |
| | | changeToHome = () => { |
| | | if (!['linkage', 'menu_board'].includes(window.GLOB.navBar)) return |
| | | |
| | |
| | | <Menu.Item key="verup" onClick={this.verup}> |
| | | 页面更新 |
| | | </Menu.Item> |
| | | {window.GLOB.WXNotice ? <Menu.Item key="wxnotice" onClick={this.wxnotice}> |
| | | 微信消息 |
| | | </Menu.Item> : null} |
| | | {window.GLOB.appVersion ? <Menu.Item key="version" onClick={this.about}> |
| | | 关于 |
| | | </Menu.Item> : null} |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .mk-wx-notice { |
| | | top: 100px!important; |
| | | .anticon-check-circle { |
| | | display: none; |
| | | } |
| | | .ant-modal-confirm-title { |
| | | text-align: center; |
| | | min-height: 320px; |
| | | } |
| | | .ant-modal-confirm-btns { |
| | | float: none!important; |
| | | text-align: center; |
| | | } |
| | | } |
| | |
| | | GLOB.nginx = config.nginx + '' === 'true' |
| | | GLOB.WXAppID = config.WXAppID || '' |
| | | GLOB.WXminiAppID = config.WXminiAppID || '' |
| | | GLOB.WXNotice = config.WXNotice + '' === 'true' |
| | | GLOB.accessToken = {} |
| | | GLOB.mkHS = false |
| | | |
| | |
| | | |
| | | if (options.sysType === 'cloud') { // cloud不可设置单点服务器地址,云端appkey为系统设置 |
| | | GLOB.appkey = options.cakey |
| | | GLOB.WXNotice = false |
| | | } else if (options.sysType === 'SSO') { // sso不可设置单点服务器地址 |
| | | GLOB.appkey = config.appkey |
| | | } else if (options.sysType === 'local') { // 业务系统 |
| | |
| | | } |
| | | |
| | | if (['text', 'picture'].includes(this.record.eleType) && this.record.link) { |
| | | _options.push('linkurl', 'joint', 'linkType') |
| | | _options.push('linkType') |
| | | if (this.record.linkType === 'linkmenu') { |
| | | _options.push('open', 'joint') |
| | | if (this.record.link === 'static') { |
| | | _options.push('linkmenu') |
| | | } else { |
| | | _options.push('linkurl') |
| | | } |
| | | } else if (this.record.linkType === 'other') { |
| | | _options.push('linkurl', 'joint') |
| | | } else { |
| | | _options.push('linkurl') |
| | | } |
| | | } else if (this.record.eleType === 'picture' && !this.record.link) { |
| | | _options.push('scale') |
| | | } else if (this.record.eleType === 'slider') { |
| | |
| | | return item |
| | | }) |
| | | }) |
| | | } else if (['datatype', 'showInfo', 'showType', 'fixStyle', 'posterType', 'eval'].includes(key)) { |
| | | } else if (['datatype', 'showInfo', 'showType', 'fixStyle', 'posterType', 'eval', 'linkType'].includes(key)) { |
| | | let _options = this.getOptions() |
| | | |
| | | this.setState({ |
| | |
| | | getPopupContainer={() => document.getElementById('card-winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}> |
| | | {option.text} |
| | | <Select.Option id={`${index}`} title={option.text || option.label} key={`${index}`} value={option.value}> |
| | | {option.text || option.label} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | width = +width.replace(/x/, '.5') |
| | | } |
| | | |
| | | let linkTypes = [ |
| | | { value: 'tel', text: '电话' }, |
| | | { value: 'email', text: '邮箱' }, |
| | | { value: 'other', text: '其他' } |
| | | ] |
| | | |
| | | if (appType === 'mob') { |
| | | linkTypes = [ |
| | | { value: 'tel', text: '电话' }, |
| | | { value: 'email', text: '邮箱' }, |
| | | { value: 'qywx', text: '企业微信' }, |
| | | { value: 'linkmenu', text: '关联菜单' }, |
| | | { value: 'other', text: '其他' } |
| | | ] |
| | | } else if (appType === 'pc') { |
| | | linkTypes = [ |
| | | { value: 'tel', text: '电话' }, |
| | | { value: 'email', text: '邮箱' }, |
| | | { value: 'linkmenu', text: '关联菜单' }, |
| | | { value: 'other', text: '其他' } |
| | | ] |
| | | } |
| | | |
| | | if (card.linkType === 'qywx') { |
| | | if (appType !== 'mob') { |
| | | card.link = '' |
| | | card.linkType = '' |
| | | card.linkurl = '' |
| | | } |
| | | } else if (card.linkType === 'linkmenu') { |
| | | if (appType !== 'mob' && appType !== 'pc') { |
| | | card.link = '' |
| | | card.linkType = '' |
| | | card.linkurl = '' |
| | | card.linkmenu = '' |
| | | } |
| | | } |
| | | |
| | | let appMenus = sessionStorage.getItem('appMenus') |
| | | if (['pc', 'mob'].includes(appType)) { |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | } catch (e) { |
| | | appMenus = [] |
| | | } |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | appMenus.push({value: 'goback', text: '返回(上一页)'}) |
| | | } |
| | | |
| | | let forms = [ |
| | | { |
| | | type: 'select', |
| | |
| | | forbid: isHeader |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | type: linkTypes.length > 4 ? 'select' : 'radio', |
| | | key: 'linkType', |
| | | label: '链接类型', |
| | | initVal: card.linkType || 'other', |
| | | required: false, |
| | | options: [ |
| | | { value: 'tel', text: '电话' }, |
| | | { value: 'email', text: '邮箱' }, |
| | | { value: 'qywx', text: '企业微信' }, |
| | | { value: 'other', text: '其他' } |
| | | ] |
| | | options: linkTypes |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkmenu', |
| | | label: '关联菜单', |
| | | initVal: card.linkmenu || '', |
| | | required: true, |
| | | options: appMenus || [], |
| | | forbid: !['pc', 'mob'].includes(appType) |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkurl', |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'open', |
| | | label: '打开方式', |
| | | initVal: card.open || 'blank', |
| | | tooltip: '菜单打开方式。', |
| | | required: true, |
| | | forbid: !['pc', 'mob'].includes(appType), |
| | | options: [ |
| | | {value: 'blank', text: appType !== 'mob' ? '新窗口' : '新页面'}, |
| | | {value: 'self', text: appType !== 'mob' ? '当前窗口' : '当前页面'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: '拼接参数', |
| | | initVal: card.joint || 'true', |
| | |
| | | values.verify.invalid = 'true' |
| | | } |
| | | } |
| | | } else if (values.OpenType === 'tab' && values.linkmenu) { |
| | | } else if (values.OpenType === 'tab' && values.linkmenu && Array.isArray(values.linkmenu)) { |
| | | if (sessionStorage.getItem('thdMenuList')) { |
| | | let list = null |
| | | try { |
| | |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | appMenus.push({value: 'goback', text: '返回(上一页)'}) |
| | | } else { |
| | | menulist = sessionStorage.getItem('fstMenuList') |
| | | if (menulist) { |
| | |
| | | extendName: 'MenuNo', |
| | | required: false, |
| | | allowClear: true, |
| | | options: appType === 'mob' || appType === 'pc' ? [...appMenus, {value: 'goback', text: '返回(上一页)'}] : menulist, |
| | | options: appType === 'mob' || appType === 'pc' ? appMenus : menulist, |
| | | forbid: viewType === 'popview' |
| | | }, |
| | | { |
| | |
| | | elements: PropTypes.array, // 元素集 |
| | | } |
| | | |
| | | state = {} |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props), fromJS(nextProps)) |
| | | return !is(fromJS(this.props), fromJS(nextProps)) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | window.open(_url) |
| | | return |
| | | } else if (card.linkType === 'qywx') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'PC不支持打开企业微信!', |
| | | duration: 5 |
| | | }) |
| | | } else if (card.linkType === 'qywx' || card.linkType === 'linkmenu') { |
| | | return |
| | | } |
| | | |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | let domain1 = '' |
| | | let domain2 = '' |
| | | if (['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok'].includes(verify.wxTemplateId) && options.sysType !== 'cloud') { |
| | | domain1 = 'https://cloud.mk9h.cn/' |
| | | domain2 = 'https://cloud.mk9h.cn:8443/' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: Utils.getuuid(), p1: '010000000001', p2: '明科', p3: 'dddd', p4: '顺风', p5: '成功'}] |
| | | // res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: Utils.getuuid(), p1: '010000000001', p2: '明科', p3: 'dddd', p4: '顺风', p5: '成功'}] |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | return m |
| | | }) |
| | | |
| | | Api.wxAccessToken().then(res => { |
| | | Api.wxAccessToken(domain1).then(res => { |
| | | if (!res.oa_access_token) return |
| | | |
| | | params.forEach(n => { |
| | | Api.wxNginxRequest(`cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', n).then(re => { |
| | | Api.wxNginxRequest(`${domain2}cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', n).then(re => { |
| | | if (verify.wxNoteCallback === 'true') { |
| | | let msg = re.errmsg || '' |
| | | |
| | |
| | | let _position = (_topline + lindex + 1) + '行 ' + _colindex + '列 ' |
| | | |
| | | if (/^Nvarchar/ig.test(col.type)) { |
| | | if (typeof(val) === 'number') { |
| | | val = val.toString() |
| | | } |
| | | val = val + '' |
| | | |
| | | if (/'/.test(val)) { |
| | | val = val.replace(/'/ig, '"') |
| | |
| | | } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) { |
| | | if (!val && val !== 0) { |
| | | errors.push(_position + '内容不可为空') |
| | | } else { |
| | | if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(val)) { // 检验是否为浮点数 |
| | | errors.push(_position + '内容应为数值') |
| | | } else if ((col.min || col.min === 0) && val < col.min) { // 最小值检验 |
| | | errors.push(_position + '小于最小值') |
| | | } else if ((col.max || col.max === 0) && val > col.max) { // 最大值检验 |
| | | errors.push(_position + '大于最大值') |
| | | } |
| | | } else if (isNaN(val)) { // 检验是否为数值 |
| | | errors.push(_position + '内容应为数值') |
| | | } else if ((col.min || col.min === 0) && val < col.min) { // 最小值检验 |
| | | errors.push(_position + '小于最小值') |
| | | } else if ((col.max || col.max === 0) && val > col.max) { // 最大值检验 |
| | | errors.push(_position + '大于最大值') |
| | | } |
| | | } else if (col.type === 'date') { |
| | | if (typeof(val) === 'number') { |
| | |
| | | }) |
| | | } |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.linkmenu && menuObj[cell.linkmenu]) { |
| | | menus.push(menuObj[cell.linkmenu]) |
| | | } else if (cell.openmenu && menuObj[cell.openmenu]) { |
| | |
| | | |
| | | if (item.subtype === 'dualdatacard') { |
| | | card.backElements && card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.linkmenu && menuObj[cell.linkmenu]) { |
| | | menus.push(menuObj[cell.linkmenu]) |
| | | } else if (cell.openmenu && menuObj[cell.openmenu]) { |
| | |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.linkmenu && menuObj[cell.linkmenu]) { |
| | | menus.push(menuObj[cell.linkmenu]) |
| | | } else if (cell.openmenu && menuObj[cell.openmenu]) { |
| | |
| | | loopCol(col.subcols) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.linkmenu && menuObj[cell.linkmenu]) { |
| | | menus.push(menuObj[cell.linkmenu]) |
| | | } else if (cell.openmenu && menuObj[cell.openmenu]) { |
| | |
| | | }) |
| | | } |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.linkmenu && menuObj[cell.linkmenu]) { |
| | | menus.push(menuObj[cell.linkmenu]) |
| | | } else if (cell.openmenu && menuObj[cell.openmenu]) { |
| | |
| | | }) |
| | | |
| | | card.backElements && card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.linkmenu && menuObj[cell.linkmenu]) { |
| | | menus.push(menuObj[cell.linkmenu]) |
| | | } else if (cell.openmenu && menuObj[cell.openmenu]) { |
| | |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | |
| | | if (cell.linkmenu && menuObj[cell.linkmenu]) { |
| | | menus.push(menuObj[cell.linkmenu]) |
| | | } else if (cell.openmenu && menuObj[cell.openmenu]) { |
| | |
| | | loopCol(col.subcols) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.linkmenu && menuObj[cell.linkmenu]) { |
| | | menus.push(menuObj[cell.linkmenu]) |
| | | } else if (cell.openmenu && menuObj[cell.openmenu]) { |