| | |
| | | |
| | | appId -- 云端生成的应用ID |
| | | appkey -- 云端生成的应用密钥 |
| | | mainSystemApi -- sso系统的接口路径,注:业务系统需要填写,且值为通用接口的完整路径 |
| | | systemType -- 判断业务系统为测试 (空) 或正式 (production) ,正式系统开发权限只含有系统升级等限定功能 |
| | | mainSystemApi -- 业务系统的单点登录链接地址,开发系统地址为http://sso.mk9h.cn/cloud/webapi/dostars,生产系统需要依据搭建的单点登录系统自行修改配置 |
| | | systemType -- 系统类型,正式系统是填production,开发系统为空,开发系统会有一部分的数据模糊化 |
| | | externalDatabase -- 外联库,不使用时默认为false |
| | | lineColor -- 登录页分割线颜色 |
| | | filter -- 页面滤镜,值为'true'时,页面显示为黑白色 |
| | | defaultApp -- 默认应用,系统需默认打开某个子应用时需填写应用编码,空值时跳转到管理后台 |
| | | defaultLang -- 默认打开的子应用语言类型,填入defaultApp时有效 |
| | | defaultApp -- 默认应用,系统默认打开某个子应用时需填写应用编码 |
| | | defaultLang -- 打开的子应用语言类型,默认为zh-CN |
| | | WXAppID -- 使用公众号时,绑定的公众号ID |
| | | debugger -- debugger模式是否开启,开启后移动端子应用中会有控制台 |
| | | debugger -- 值为true时开启调试模式,开启后移动端子应用中会有控制台 |
| | | licenseKey -- 许可密钥,在内部网络中使用系统时,会跳过epc验证 |
| | | probation -- 试用期(YYYY-MM-DD),在正式系统中,试用期内调用系统接口的脚本会记录下来 |
| | |
| | | { |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "appId": "202109161556242376DEC38C96FFF414E8DEF", |
| | | "appkey": "20210916155606327FB54C811DE824AFEB22C", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "externalDatabase": "", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "", |
| | |
| | | "debugger": false, |
| | | "licenseKey": "E1A8FE", |
| | | "probation": "", |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "mkwms/" |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "kalai_mes/" |
| | | } |
| | |
| | | initMenuPermission, |
| | | logout |
| | | } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import options from '@/store/options.js' |
| | |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import avatar from '@/assets/img/avatar.jpg' |
| | | import Resetpwd from './resetpwd' |
| | | import LoginForm from './loginform' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | const { Search } = Input |
| | | const Resetpwd = asyncComponent(() => import('./resetpwd')) |
| | | const LoginForm = asyncComponent(() => import('./loginform')) |
| | | |
| | | class Header extends Component { |
| | | static propTpyes = { |
| | |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: this.state.dict['main.password.resetsuccess'], |
| | | message: '修改成功,请重新登录。', |
| | | duration: 2 |
| | | }) |
| | | setTimeout(() => { |
| | | sessionStorage.clear() |
| | | this.props.logout() |
| | | this.props.history.replace('/login') |
| | | }, 2000) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Input } from 'antd' |
| | | |
| | | class Resetpwd extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object |
| | | } |
| | | |
| | | state = { |
| | | confirmDirty: false, |
| | | autoCompleteResult: [] |
| | | autoCompleteResult: [], |
| | | level: localStorage.getItem(window.location.href.split('#')[0] + 'pwdlevel') || '' |
| | | } |
| | | |
| | | onEnterSubmit = (e) => { |
| | |
| | | compareToFirstPassword = (rule, value, callback) => { |
| | | const { form } = this.props |
| | | if (value && value !== form.getFieldValue('password')) { |
| | | callback(this.props.dict['main.password.diff']) |
| | | callback('两次输入密码不一致!') |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | |
| | | validateToNextPassword = (rule, value, callback) => { |
| | | const { form } = this.props |
| | | const { level } = this.state |
| | | |
| | | if (value && this.state.confirmDirty) { |
| | | form.validateFields(['confirm'], { force: true }) |
| | | } |
| | | callback() |
| | | |
| | | if (level === 'letter_num' && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*)$/.test(value)) { |
| | | callback('密码中必须含有数字和字母。') |
| | | } else if ((level === 'char_num' || level === 'char_num_90') && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(value)) { |
| | | callback('密码中必须含有数字、字母和特殊字符。') |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { level } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | } |
| | | } |
| | | |
| | | let rules = [] |
| | | if (level) { |
| | | rules.push({ |
| | | min: 8, |
| | | message: '密码长度不可小于8位!' |
| | | }) |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} onKeyDown={this.onEnterSubmit} id="reset-password-form"> |
| | | <Form.Item label={this.props.dict['main.password.origin']}> |
| | | <Form.Item label="原密码"> |
| | | {getFieldDecorator('originpwd', { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['main.password.origin.required'] |
| | | message: '请输入原密码!' |
| | | } |
| | | ] |
| | | })(<Input.Password autoFocus/>)} |
| | | </Form.Item> |
| | | <Form.Item label={this.props.dict['main.password.new']} hasFeedback> |
| | | <Form.Item label="新密码" hasFeedback> |
| | | {getFieldDecorator('password', { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['main.password.new.required'] |
| | | message: '请输入新密码!' |
| | | }, |
| | | { |
| | | pattern: /^[0-9a-zA-Z!@#$%^&*()_]*$/ig, |
| | | message: '密码只允许包含数字、字母以及!@#$%&*()_。' |
| | | }, |
| | | ...rules, |
| | | { |
| | | max: 50, |
| | | message: this.props.dict['main.password.maxlen'] |
| | | message: '最大密码长度为50位!' |
| | | }, |
| | | { |
| | | validator: this.validateToNextPassword |
| | |
| | | ] |
| | | })(<Input.Password />)} |
| | | </Form.Item> |
| | | <Form.Item label={this.props.dict['main.password.confirm']} hasFeedback> |
| | | <Form.Item label="确认密码" hasFeedback> |
| | | {getFieldDecorator('confirm', { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['main.password.confirm.required'] |
| | | message: '请确认密码!' |
| | | }, |
| | | { |
| | | validator: this.compareToFirstPassword |
| | |
| | | 'main.logout.hint': 'Are you sure you want to log out?', |
| | | 'main.verup': 'Version upgrade', |
| | | 'main.password': 'Change the password', |
| | | 'main.password.origin': 'Original Password', |
| | | 'main.password.origin.required': 'Please input your original password!', |
| | | 'main.password.new': 'Password', |
| | | 'main.password.new.required': 'Please input your password!', |
| | | 'main.password.confirm': 'Confirm Password', |
| | | 'main.password.confirm.required': 'Please confirm your password!', |
| | | 'main.password.maxlen': 'The maximum password length is 12 bits!', |
| | | 'main.password.diff': 'Two passwords that you enter is inconsistent!', |
| | | 'main.password.resetsuccess': 'Password modified successfully!', |
| | | 'main.login.develop': 'Login developer', |
| | | 'main.revert.default': 'Restore default Settings', |
| | | 'main.copy.success': 'Copy success', |
| | |
| | | 'main.logout.hint': '您确定要退出吗?', |
| | | 'main.verup': '版本升级', |
| | | 'main.password': '修改密码', |
| | | 'main.password.origin': '原密码', |
| | | 'main.password.origin.required': '请输入原密码!', |
| | | 'main.password.new': '新密码', |
| | | 'main.password.new.required': '请输入新密码!', |
| | | 'main.password.confirm': '确认密码', |
| | | 'main.password.confirm.required': '请确认密码!', |
| | | 'main.password.maxlen': '最大密码长度为12位!', |
| | | 'main.password.diff': '两次输入密码不一致!', |
| | | 'main.password.resetsuccess': '密码修改成功!', |
| | | 'main.login.develop': '登录开发机', |
| | | 'main.revert.default': '恢复默认设置', |
| | | 'main.copy.success': '复制成功', |
| | |
| | | </div> |
| | | } trigger="hover"> |
| | | <div className="page-card" style={{ opacity: opacity}}> |
| | | <div ref={node => drag(drop(node))}> |
| | | <div ref={node => drag(drop(node))} style={{ border: '0.5px solid transparent'}}> |
| | | {card.type === 'split' ? formItem : <Form.Item |
| | | style={{marginTop: card.marginTop || 0, marginBottom: card.marginBottom || 0}} |
| | | className={'ant-form-item' + (card.required === 'true' ? ' required' : '') + (card.splitline === 'false' ? ' no-boder' : '')} |
| | | > |
| | | {formItem} |
| | |
| | | if (syncConfig) { |
| | | if (!syncConfig.setting.supModule || syncConfig.setting.supModule !== MenuID) return |
| | | |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({ show: id ? true : false }) |
| | | } |
| | | |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data, pageIndex: 1 }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting || !config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data, pageIndex: 1 }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id, BData: data }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | resetParentParam = (MenuID, id) => { |
| | | const { config } = this.state |
| | | if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | resetParentParam = (MenuID, id) => { |
| | | const { config } = this.state |
| | | if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | const { setting } = this.state |
| | | |
| | | if (!setting.supModule || setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ |
| | | pageIndex: 1, |
| | | BID: id, |
| | |
| | | const { setting } = this.state |
| | | |
| | | if (!setting.supModule || setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ |
| | | pageIndex: 1, |
| | | BID: id, |
| | |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | return |
| | | } |
| | | } |
| | | |
| | | |
| | | if (this.props.Tab.supMenu && !BID) { // 主表ID不存在时,不查询子表 |
| | | this.setState({ |
| | | data: [], |
| | |
| | | |
| | | this.setState({BData: data, BID: id}) |
| | | |
| | | if (id !== this.state.BID) { |
| | | if (id !== this.state.BID || id !== '') { |
| | | MKEmitter.emit('resetTable', this.props.Tab.uuid) // 列表重置 |
| | | this.setState({ |
| | | pageIndex: 1 |
| | |
| | | if (!_arr.includes('modifyuserid')) { |
| | | _form.push('modifyuserid=@userid@') |
| | | } |
| | | if (!_arr.includes('modifyuser')) { |
| | | _form.push('modifyuser=@username') |
| | | } |
| | | if (hasvoucher) { |
| | | if (!_arr.includes('bvoucher')) { |
| | | _arr.push('bvoucher') |
| | |
| | | } else if (_actionType === 'LogicDelete') { // 逻辑删除 |
| | | _sql += ` |
| | | /* 默认sql */ |
| | | update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;` |
| | | update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;` |
| | | |
| | | } else if (_actionType === 'delete') { // 物理删除 |
| | | let _msg = '' |
| | |
| | | options: inputfields |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'marginTop', |
| | | label: '上边距(px)', |
| | | initVal: card.marginTop || 0, |
| | | min: 0, |
| | | max: 1000, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'marginBottom', |
| | | label: '下边距(px)', |
| | | initVal: card.marginBottom || 0, |
| | | min: 0, |
| | | max: 1000, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | |
| | | const DataTable = asyncComponent(() => import('./datatable')) |
| | | |
| | | const modalTypeOptions = { |
| | | text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place'], |
| | | number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place'], |
| | | select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown'], |
| | | checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'arrange'], |
| | | radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'setAll', 'emptyText', 'splitline', 'arrange'], |
| | | checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'fieldlength', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'width', 'multiple', 'borderColor', 'splitline'], |
| | | multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra'], |
| | | link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkField', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown'], |
| | | fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'splitline'], |
| | | switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline'], |
| | | date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline'], |
| | | datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'splitline'], |
| | | datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline'], |
| | | textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder'], |
| | | color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra'], |
| | | hint: ['label', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline'], |
| | | split: ['label', 'type'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption'], |
| | | funcvar: ['span', 'labelwidth', 'splitline'], |
| | | linkMain: ['readonly', 'required', 'hidden', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra'] |
| | | text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom'], |
| | | number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom'], |
| | | select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom'], |
| | | checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'arrange', 'marginTop', 'marginBottom'], |
| | | radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'setAll', 'emptyText', 'splitline', 'arrange', 'marginTop', 'marginBottom'], |
| | | checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'fieldlength', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'width', 'multiple', 'borderColor', 'splitline', 'marginTop', 'marginBottom'], |
| | | multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'], |
| | | link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkField', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom'], |
| | | fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'splitline', 'marginTop', 'marginBottom'], |
| | | switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], |
| | | date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom'], |
| | | datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'splitline', 'marginTop', 'marginBottom'], |
| | | datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom'], |
| | | textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom'], |
| | | color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'], |
| | | hint: ['label', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | split: ['label', 'type', 'marginTop', 'marginBottom'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom'], |
| | | funcvar: ['span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | linkMain: ['readonly', 'required', 'hidden', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'] |
| | | } |
| | | |
| | | class MainSearch extends Component { |
| | |
| | | if (!_arr.includes('submituserid')) { |
| | | _form.push('submituserid=@userid@') |
| | | } |
| | | if (!_arr.includes('submituser')) { |
| | | _form.push('submituser=@username') |
| | | } |
| | | } else { |
| | | if (!_arr.includes('modifydate')) { |
| | | _form.push('modifydate=getdate()') |
| | | } |
| | | if (!_arr.includes('modifyuser')) { |
| | | _form.push('modifyuser=@username') |
| | | } |
| | | if (!_arr.includes('modifyuserid')) { |
| | | _form.push('modifyuserid=@userid@') |
| | |
| | | if (_verify.voucher && _verify.voucher.enabled) { |
| | | _voucher = ',BVoucher=@BVoucher,FIBVoucherDate=@FIBVoucherDate,FiYear=@FiYear' |
| | | } |
| | | _defaultsql = `update ${card.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@${_voucher} where ${config.setting.primaryKey || 'id'}${card.Ot !== 'requiredOnce' ? '=@ID@' : ' in (select ID from dbo.SplitComma(@ID@))'};` |
| | | _defaultsql = `update ${card.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifyuserid=@userid@${_voucher} where ${config.setting.primaryKey || 'id'}${card.Ot !== 'requiredOnce' ? '=@ID@' : ' in (select ID from dbo.SplitComma(@ID@))'};` |
| | | } else if (card.sqlType === 'delete') { |
| | | let _msg = '' |
| | | if (columns && columns.length > 0 && card.Ot !== 'notRequired' && card.Ot !== 'requiredOnce') { |
| | |
| | | if (!_arr.includes('submituserid')) { |
| | | _form.push('submituserid=@userid@') |
| | | } |
| | | if (!_arr.includes('submituser')) { |
| | | _form.push('submituser=@username') |
| | | } |
| | | } else { |
| | | if (!_arr.includes('modifydate')) { |
| | | _form.push('modifydate=getdate()') |
| | | } |
| | | if (!_arr.includes('modifyuser')) { |
| | | _form.push('modifyuser=@username') |
| | | } |
| | | if (!_arr.includes('modifyuserid')) { |
| | | _form.push('modifyuserid=@userid@') |
| | |
| | | |
| | | _sql += ` |
| | | /* 默认sql */ |
| | | update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${primaryKey}${_ID};` |
| | | update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifyuserid=@userid@ where ${primaryKey}${_ID};` |
| | | |
| | | } else if (_actionType === 'delete') { // 物理删除 |
| | | let _msg = '' |
| | |
| | | form = ` |
| | | insert into ${param.name} (${field1},createuserid) select ${field2},@UserID |
| | | |
| | | update ${param.name} set ${field3},modifydate=getdate(),modifyuserid=@UserID |
| | | update ${param.name} set ${field3},modifydate=getdate(),modifyuser=@username,modifyuserid=@UserID |
| | | ` |
| | | } else if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { |
| | | form = ` |
| | |
| | | import React, { Component } from 'react' |
| | | import { message, Modal } from 'antd' |
| | | import { message, Modal, notification } from 'antd' |
| | | import { connect } from 'react-redux' |
| | | import md5 from 'md5' |
| | | import moment from 'moment' |
| | |
| | | import options, { styles } from '@/store/options.js' |
| | | import zhCN from '@/locales/zh-CN/login.js' |
| | | import enUS from '@/locales/en-US/login.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | import { modifyMemberLevel } from '@/store/action' |
| | | import './index.scss' |
| | | |
| | | const LoginForm = asyncLoadComponent(() => import('./loginform')) |
| | | const LoginCloudForm = asyncLoadComponent(() => import('./logincloudform')) |
| | | const Resetpwd = asyncLoadComponent(() => import('@/components/header/resetpwd')) |
| | | const LoginCloudForm = asyncComponent(() => import('./logincloudform')) |
| | | const iszhCN = sessionStorage.getItem('lang') !== 'en-US' |
| | | |
| | | const _href = window.location.href.split('#')[0] |
| | |
| | | loginWays: null, |
| | | touristLogin: false, |
| | | syncing: false, |
| | | visible: false |
| | | visible: false, |
| | | resetLoading: false |
| | | } |
| | | |
| | | changelang (item) { |
| | |
| | | localStorage.removeItem(_url) |
| | | } |
| | | |
| | | // let level = localStorage.getItem(_url + 'pwdlevel') |
| | | let level = localStorage.getItem(_url + 'pwdlevel') |
| | | |
| | | // if (level) { |
| | | // let visible = false |
| | | // let tip = '密码强度不够,请修改密码!' |
| | | // if (param.password.length < 8) { |
| | | // visible = true |
| | | // } else if (level === 'letter_num' && /^([^0-9]*|[^a-zA-Z]*)$/.test(param.password)) { |
| | | // visible = true |
| | | // } else if ((level === 'char_num' || level === 'char_num_90') && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(param.password)) { |
| | | // visible = true |
| | | // } else if (level === 'char_num_90' && res.modifydate) { |
| | | // let s = (new Date().getTime() - new Date(res.modifydate).getTime()) / (1000 * 24 * 60 * 60) |
| | | // if (!isNaN(s) && s > 90) { |
| | | // visible = true |
| | | // tip = '您已90天未修改密码,请更换密码后使用!' |
| | | // } |
| | | // } |
| | | if (level) { |
| | | let visible = false |
| | | let tip = '密码强度不够,请修改密码!' |
| | | if (param.password.length < 8) { |
| | | visible = true |
| | | } else if (level === 'letter_num' && /^([^0-9]*|[^a-zA-Z]*)$/.test(param.password)) { |
| | | visible = true |
| | | } else if ((level === 'char_num' || level === 'char_num_90') && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(param.password)) { |
| | | visible = true |
| | | } else if (level === 'char_num_90' && res.modifydate) { |
| | | let s = (new Date().getTime() - new Date(res.modifydate).getTime()) / (1000 * 24 * 60 * 60) |
| | | if (!isNaN(s) && s > 90) { |
| | | visible = true |
| | | tip = '您已90天未修改密码,请更换密码后使用!' |
| | | } |
| | | } |
| | | |
| | | // if (visible) { |
| | | // message.warning(tip) |
| | | // this.setState({ |
| | | // isDisabled: false, |
| | | // visible: true |
| | | // }) |
| | | // return |
| | | // } |
| | | // } |
| | | if (visible) { |
| | | message.warning(tip) |
| | | this.setState({ |
| | | isDisabled: false, |
| | | visible: true |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | let _history = sessionStorage.getItem('history') |
| | | if (_history) { |
| | |
| | | app_version: res.app_version |
| | | } |
| | | |
| | | let level = res.pwd_level || 'char_num_90' |
| | | let level = res.pwd_level || '' |
| | | |
| | | if (level && !['letter_num', 'char_num', 'char_num_90'].includes(level)) { |
| | | level = '' |
| | |
| | | param.rduri = options.cloudServiceApi.replace('dostars', 'dostar') |
| | | } |
| | | |
| | | |
| | | this.logincloudRef.handleConfirm().then(result => { |
| | | param.UserName = result.cloudusername |
| | | param.Password = result.cloudpassword |
| | |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | resetPwdSubmit = () => { |
| | | this.formRef.handleConfirm().then(res => { |
| | | this.setState({ |
| | | resetLoading: true |
| | | }) |
| | | |
| | | let _param = { |
| | | func: 's_PwdUpt', |
| | | LText: `select '${res.originpwd}','${res.password}'` |
| | | } |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') // 时间戳 |
| | | _param.LText = Utils.formatOptions(_param.LText) // 关键字符替换,base64加密 |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) // md5密钥 |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | this.setState({ |
| | | visible: !result.status, |
| | | resetLoading: false |
| | | }) |
| | | |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '修改成功,请重新登录。', |
| | | duration: 2 |
| | | }) |
| | | const input = document.getElementById('password') |
| | | if (input) { |
| | | input.select() |
| | | } |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, () => {}) |
| | | } |
| | | |
| | | /** |
| | |
| | | > |
| | | <LoginCloudForm handleSubmit={() => this.syncSubmit()} wrappedComponentRef={(inst) => this.logincloudRef = inst}/> |
| | | </Modal> |
| | | {/* 修改密码 */} |
| | | <Modal |
| | | title="修改密码" |
| | | okText={this.state.dict['login.ok']} |
| | | cancelText={this.state.dict['login.cancel']} |
| | | visible={this.state.visible} |
| | | onOk={this.resetPwdSubmit} |
| | | confirmLoading={this.state.resetLoading} |
| | | onCancel={() => this.setState({visible: false, resetLoading: false})} |
| | | destroyOnClose |
| | | > |
| | | <Resetpwd wrappedComponentRef={(inst) => this.formRef = inst} resetPwdSubmit={this.resetPwdSubmit}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |