From 29432c9167e3fcdf83f35d0bb9dbe9acb7c7ffbf Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 22 六月 2021 14:35:23 +0800 Subject: [PATCH] 2021-06-22 --- src/index.js | 2 src/templates/zshare/modalform/index.jsx | 18 ++ src/views/login/loginform.jsx | 74 ++++++++---- src/views/pcdesign/index.jsx | 4 src/templates/zshare/formconfig.jsx | 14 ++ src/menu/components/share/actioncomponent/formconfig.jsx | 2 src/templates/zshare/verifycard/index.jsx | 13 +- src/tabviews/zshare/mutilform/checkCard/index.jsx | 15 ++ src/mob/components/formdragelement/card.jsx | 2 src/templates/modalconfig/checkCard/index.jsx | 26 ++- src/templates/zshare/modalform/index.scss | 8 + src/views/appmanage/index.jsx | 58 +++++++++ src/views/appmanage/submutilform/index.scss | 6 package.json | 2 src/tabviews/zshare/actionList/normalbutton/index.jsx | 9 + src/templates/modalconfig/dragelement/card.jsx | 2 src/views/appmanage/submutilform/index.jsx | 69 ++++++++++ src/views/mobdesign/index.jsx | 4 src/views/login/index.jsx | 8 19 files changed, 264 insertions(+), 72 deletions(-) diff --git a/package.json b/package.json index aaef24f..e9d796b 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,7 @@ ] ] }, - "homepage": ".", + "homepage": "./build", "devDependencies": { "typescript": "^4.0.2" } diff --git a/src/index.js b/src/index.js index 3882a86..fcc809d 100644 --- a/src/index.js +++ b/src/index.js @@ -59,7 +59,7 @@ // 鏂扮郴缁熸枃浠剁疆浜巃dmin涓� ../options.json -fetch('../options.json') +fetch('./options.json') .then(response => response.json()) .catch(() => { document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">绯荤粺閰嶇疆淇℃伅鑾峰彇澶辫触锛岃鑱旂郴绠$悊鍛橈紒</div>' diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 5ddd19f..b4a2e38 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -198,7 +198,7 @@ label: '閾炬帴鏂瑰紡', initVal: card.open || 'blank', required: true, - forbid: !isApp, + forbid: sessionStorage.getItem('appType') === 'pc', options: [{ value: 'blank', text: '鏂扮獥鍙�' diff --git a/src/mob/components/formdragelement/card.jsx b/src/mob/components/formdragelement/card.jsx index 31bed88..cef6188 100644 --- a/src/mob/components/formdragelement/card.jsx +++ b/src/mob/components/formdragelement/card.jsx @@ -168,7 +168,7 @@ <div className="am-list-line"> <div className="am-input-label">{card.label}</div> <div className="am-input-control"> - <CheckCard width={card.width} ratio={card.ratio} display={card.display} fields={card.fields} options={card.options} /> + <CheckCard config={card} /> </div> </div> </div>) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 9802db7..2fc84a8 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1321,6 +1321,7 @@ let _param = { templatecode: verify.noteCode, // 妯℃澘缂栫爜 TypeCharOne: verify.noteTemp, // N涓嶅悓鍐呭锛孻鐩稿悓鍐呭 + ID: verify.noteId || '' // 妯℃澘Id锛屾殏鏃舵湭浣跨敤 } _param.submitdate = res.submitdate @@ -1385,10 +1386,12 @@ _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) - _param.rduri = 'http://sso.mk9h.cn/webapi/dostar' - _param.appkey = window.GLOB.appkey || '' + _param.rduri = 'http://sso.mk9h.cn/webapi/dostars' - Api.dostarInterface(_param).then(result => { + _param.userid = 'bh0bapabtd45epsgra79segbch6c1ibk' + _param.LoginUID = 'bh0bapabtd45epsgra79segbch6c1ibk' + + Api.getLocalConfig(_param).then(result => { if (!result.status) { notification.warning({ top: 92, diff --git a/src/tabviews/zshare/mutilform/checkCard/index.jsx b/src/tabviews/zshare/mutilform/checkCard/index.jsx index f9e8ecf..8fa13b6 100644 --- a/src/tabviews/zshare/mutilform/checkCard/index.jsx +++ b/src/tabviews/zshare/mutilform/checkCard/index.jsx @@ -57,7 +57,7 @@ } getCards = () => { - const { display, width, options, fields, ratio, multiple } = this.props.card + const { display, width, options, fields, ratio, multiple, backgroundColor, borderColor } = this.props.card const { selectKeys } = this.state let paddingTop = '100%' @@ -69,11 +69,20 @@ paddingTop = '56.25%' } + let style = {} + + if (borderColor) { + style.borderColor = borderColor + } + if (!options || options.length === 0) { return null } else if (display !== 'picture') { if (!fields || fields.length === 0) { return null + } + if (backgroundColor) { + style.backgroundColor = backgroundColor } return options.map(item => { let _active = false @@ -84,7 +93,7 @@ } return <Col span={width} key={item.key}> - <div className={'card-cell ' + (_active ? 'active' : '')} onClick={() => this.changeCard(item)}> + <div className={'card-cell ' + (_active ? 'active' : '')} style={style} onClick={() => this.changeCard(item)}> {fields.map(col => { return <span key={col.key} style={{color: col.color, fontSize: col.fontSize + 'px', height: col.fontSize * 1.5 + 'px', textAlign: col.align}}>{item[col.field]}</span> })} @@ -101,7 +110,7 @@ } return <Col span={width} key={item.key}> - <div className={'card-pic-cell ' + (_active ? 'active' : '')} onClick={() => this.changeCard(item)} style={{paddingTop, backgroundImage: `url(${item.$url})`}}> + <div className={'card-pic-cell ' + (_active ? 'active' : '')} onClick={() => this.changeCard(item)} style={{...style, paddingTop, backgroundImage: `url(${item.$url})`}}> </div> </Col> }) diff --git a/src/templates/modalconfig/checkCard/index.jsx b/src/templates/modalconfig/checkCard/index.jsx index 63c3164..60a6e3e 100644 --- a/src/templates/modalconfig/checkCard/index.jsx +++ b/src/templates/modalconfig/checkCard/index.jsx @@ -6,19 +6,14 @@ class CheckCard extends Component { static propTpyes = { - multiple: PropTypes.bool, // 鏄惁鍙閫� - ratio: PropTypes.string, // 鍥剧墖姣斾緥 - width: PropTypes.number, // 瀹藉害 - display: PropTypes.string, // 鏄剧ず涓猴細text锛堟枃鏈級銆乸icture锛堝浘鐗囷級 - fields: PropTypes.array, // 瀛楁闆� - options: PropTypes.array, // 鏁版嵁鍒楄〃 + config: PropTypes.object, // 琛ㄥ崟閰嶇疆淇℃伅 onChange: PropTypes.func, // 鏁版嵁鍒囨崲 } state = {} getCards = () => { - const { display, width, options, fields, ratio } = this.props + const { display, width, options, fields, ratio, backgroundColor, borderColor } = this.props.config let paddingTop = '100%' if (ratio === '4:3') { @@ -29,10 +24,19 @@ paddingTop = '56.25%' } + let style = {} + + if (borderColor) { + style.borderColor = borderColor + } + if (display !== 'picture') { + if (backgroundColor) { + style.backgroundColor = backgroundColor + } if (!options || options.length === 0) { return <Col span={width}> - <div className="card-cell"> + <div className="card-cell" style={style}> {fields ? fields.map(col => { return <span key={col.key} style={{color: col.color, fontSize: col.fontSize + 'px', height: col.fontSize * 1.5 + 'px', textAlign: col.align}}>{col.field}</span> }) : null} @@ -42,7 +46,7 @@ } return options.map(item => { return <Col span={width} key={item.key}> - <div className="card-cell"> + <div className="card-cell" style={style}> {fields.map(col => { return <span key={col.key} style={{color: col.color, fontSize: col.fontSize + 'px', height: col.fontSize * 1.5 + 'px', textAlign: col.align}}>{item[col.field]}</span> })} @@ -52,13 +56,13 @@ } else { if (!options || options.length === 0) { return <Col span={width}> - <div className="card-pic-cell" style={{paddingTop, background: '#91d5ff'}}> + <div className="card-pic-cell" style={{...style, paddingTop, background: '#91d5ff'}}> </div> </Col> } return options.map(item => { return <Col span={width} key={item.key}> - <div className="card-pic-cell" style={{paddingTop, backgroundImage: `url(${item.$url})`}}> + <div className="card-pic-cell" style={{...style, paddingTop, backgroundImage: `url(${item.$url})`}}> </div> </Col> }) diff --git a/src/templates/modalconfig/dragelement/card.jsx b/src/templates/modalconfig/dragelement/card.jsx index 847e429..f5ad414 100644 --- a/src/templates/modalconfig/dragelement/card.jsx +++ b/src/templates/modalconfig/dragelement/card.jsx @@ -114,7 +114,7 @@ } else if (card.type === 'split') { formItem = <div className="split-line">{card.label}</div> } else if (card.type === 'checkcard') { - formItem = <CheckCard width={card.width} ratio={card.ratio} display={card.display} fields={card.fields} options={card.options} /> + formItem = <CheckCard config={card} /> } let _label = card.label diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index aa1b34a..1dd0495 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2527,6 +2527,20 @@ }] }, { + type: 'color', + key: 'backgroundColor', + label: '鑳屾櫙鑹�', + initVal: card.backgroundColor || '', + required: false + }, + { + type: 'color', + key: 'borderColor', + label: '杈规棰滆壊', + initVal: card.borderColor || '', + required: false + }, + { type: 'radio', key: 'declareType', label: '鏁版嵁绫诲瀷', diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 6225afa..fbe3588 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -8,10 +8,12 @@ import EditTable from './modaleditable' import DataTable from './datatable' import FieldsTable from './fieldtable' +import asyncComponent from '@/utils/asyncComponent' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' const { TextArea } = Input +const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) const modalTypeOptions = { text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'scan'], @@ -19,7 +21,7 @@ select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter'], checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'tooltip', 'extra'], radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'setAll', 'emptyText'], - checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'fieldlength', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'width', 'multiple'], + checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'fieldlength', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'width', 'multiple', 'borderColor'], multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra'], link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter'], fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress'], @@ -170,9 +172,9 @@ } } else { if (resourceType === '0') { // 鑷畾涔夎祫婧� - _options.push('options', 'fields') + _options.push('options', 'fields', 'backgroundColor') } else if (resourceType === '1') { // 鏁版嵁婧� - _options.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'database') + _options.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'database', 'backgroundColor') } } } else if (type === 'fileupload') { @@ -691,6 +693,16 @@ </Form.Item> </Col> ) + } else if (item.type === 'color') { + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.label} className="color-form-item"> + {getFieldDecorator(item.key, { + initialValue: item.initVal + })(<ColorSketch allowClear={true}/>)} + </Form.Item> + </Col> + ) } }) diff --git a/src/templates/zshare/modalform/index.scss b/src/templates/zshare/modalform/index.scss index 75706c5..672e7e4 100644 --- a/src/templates/zshare/modalform/index.scss +++ b/src/templates/zshare/modalform/index.scss @@ -33,4 +33,12 @@ .ant-input-number { width: 100%; } + .color-form-item { + .ant-form-item-control { + height: 40px; + .color-sketch-block { + margin-top: 7px; + } + } + } } \ No newline at end of file diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 5fbf286..5e448f2 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -941,8 +941,8 @@ }, { obj_name: 'noteCodes', - arr_field: 'templatecode,describe', - LText: window.btoa(window.encodeURIComponent(`select templatecode,'['+SignName+']'+describe as describe from (select * from bd_msn_sms_temp where deleted=0 and TypeDesc='QX' and status=20 ) t inner join (select openid from susers where uid=@userid@) u on t.openid =t.openid`)) + arr_field: 'templatecode,describe,id', + LText: window.btoa(window.encodeURIComponent(`select t.id,templatecode,'['+SignName+']'+describe as describe from (select * from bd_msn_sms_temp where deleted=0 and TypeDesc='QX' and status=20 ) t inner join (select openid from susers where uid=@userid@) u on t.openid =t.openid`)) }, { obj_name: 'scripts', @@ -982,7 +982,8 @@ notes: res.noteCodes.map(item => { return { name: item.describe, - value: item.templatecode + value: item.templatecode, + id: item.id } }), systemScripts: res.scripts.map(item => { @@ -1107,11 +1108,11 @@ this.setState({ verify }) } - onNoteCodeChange = (val) => { + onNoteCodeChange = (val, option) => { const { verify } = this.state this.setState({ - verify: {...verify, noteCode: val} + verify: {...verify, noteCode: val, noteId: option.props.id} }) } @@ -1482,7 +1483,7 @@ <Form.Item label="鐭俊妯℃澘"> <Select value={verify.noteCode} onSelect={this.onNoteCodeChange}> {notes.map(option => - <Select.Option key={option.value} value={option.value}> + <Select.Option key={option.value} id={option.id} value={option.value}> {option.name} </Select.Option> )} diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index 7b62f72..d2749f4 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -26,6 +26,8 @@ base_url = window.GLOB.location + '/' + window.GLOB.service } +sessionStorage.setItem('isEditState', 'true') + class AppManage extends Component { state = { loading: false, @@ -55,6 +57,20 @@ { title: '鏉冮檺绠$悊', dataIndex: 'role_type', key: 'role_type', align: 'center', render: (text, record) => text === 'false' ? '涓嶅惎鐢�' : '鍚敤' + }, + { + title: '鐢ㄦ埛缁戝畾', dataIndex: 'user_binding', key: 'user_binding', align: 'center', + render: (text, record) => { + let val = '' + if (!text) return '鏃�' + if (text.indexOf('uname_pwd') > -1) { + val = '鐢ㄦ埛鍚�' + } + if (text.indexOf('sms_vcode') > -1) { + val = val ? val + ',鎵嬫満鍙�' : '鎵嬫満鍙�' + } + return val + } }, { title: '鐨偆', dataIndex: 'css', key: 'css', align: 'center', @@ -125,6 +141,7 @@ UNSAFE_componentWillMount() { document.body.className = '' this.getAppList() + this.getSmStemp() } /** @@ -174,6 +191,39 @@ duration: 5 }) } + }) + } + + getSmStemp = () => { + let _sql = `select ID,TemplateCode,SignName from (select * from bd_msn_sms_temp where deleted=0 and status=20 ) a + inner join (select openid from sapp where id='${window.GLOB.appkey}') b + on a.openid=b.openid` + + _sql = Utils.formatOptions(_sql) + + let param = { + func: 'sPC_Get_SelectedList', + LText: _sql, + obj_name: 'data', + arr_field: 'ID,TemplateCode,SignName' + } + + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + param.secretkey = Utils.encrypt(param.LText, param.timestamp) + param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉 + + Api.getSystemConfig(param).then(res => { + let msgs = [] + if (!res.status) { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + } else if (res.data) { + msgs = res.data + } + sessionStorage.setItem('msgTemplate', JSON.stringify(msgs)) }) } @@ -243,7 +293,7 @@ sublist = sublist.filter(item => item.ID !== record.ID) // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) @@ -391,7 +441,7 @@ if (visible === 'edit') { // param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) - param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) + param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) } @@ -478,7 +528,7 @@ } // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) @@ -574,7 +624,7 @@ </Modal> <Modal title={'缂栬緫瀛愬簲鐢�'} - width={'750px'} + width={'850px'} maskClosable={false} visible={!!subVisible} onCancel={() => this.setState({subVisible: false})} diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx index b069b3e..571b23a 100644 --- a/src/views/appmanage/submutilform/index.jsx +++ b/src/views/appmanage/submutilform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Select, Radio, Input } from 'antd' +import { Form, Row, Col, Select, Radio, Input, Tooltip, Icon, notification } from 'antd' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -14,7 +14,21 @@ inputSubmit: PropTypes.func // input鍥炶溅鎻愪氦 } - state = {} + state = {msgs: [], typename: 'mob', user_binding: []} + + UNSAFE_componentWillMount() { + const { card } = this.props + let msgs = sessionStorage.getItem('msgTemplate') + let user_binding = [] + let typename = 'mob' + + if (card) { + typename = card.typename || 'mob' + user_binding = card.user_binding ? card.user_binding.split(',') : [] + } + + this.setState({msgs: JSON.parse(msgs), typename, user_binding}) + } /** * @description 鑾峰彇琛ㄥ崟鍊� @@ -23,6 +37,15 @@ return new Promise(resolve => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { + values.user_binding = values.user_binding ? values.user_binding.join(',') : '' + if (values.user_binding.indexOf('sms_vcode') > -1 && !values.sms_id) { + notification.warning({ + top: 92, + message: '鎵嬫満鍙风粦瀹氭椂锛岄渶瑕佺煭淇℃ā鏉匡紒', + duration: 5 + }) + return + } resolve(values) } }) @@ -40,6 +63,7 @@ render() { const { card, type } = this.props const { getFieldDecorator } = this.props.form + const { msgs, typename, user_binding } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -58,14 +82,14 @@ } return ( - <Form {...formItemLayout} className="mob-card-edit-form"> + <Form {...formItemLayout} className="sub-app-edit-form"> <Row gutter={24}> <Col span={12}> <Form.Item label="搴旂敤绫诲瀷"> {getFieldDecorator('typename', { - initialValue: card ? card.typename : 'mob' + initialValue: typename })( - <Select disabled={type === 'edit'}> + <Select disabled={type === 'edit'} onChange={(val) => this.setState({typename: val})}> <Select.Option value="mob">绉诲姩绔�(鍖呮嫭android銆乮os)</Select.Option> <Select.Option value="pad">Pad绔�</Select.Option> <Select.Option value="pc">PC绔�</Select.Option> @@ -109,6 +133,41 @@ )} </Form.Item> </Col> + {typename !== 'pc' ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="浣跨敤寰俊鎺堟潈鐧诲綍鏃讹紝鏄惁闇�瑕佺粦瀹氱敤鎴枫��"> + <Icon type="question-circle" /> + 鐢ㄦ埛缁戝畾 + </Tooltip> + }> + {getFieldDecorator('user_binding', { + initialValue: user_binding + })( + <Select mode="multiple"> + <Select.Option value="uname_pwd">鐢ㄦ埛鍚�</Select.Option> + <Select.Option value="sms_vcode">鎵嬫満鍙�</Select.Option> + </Select> + )} + </Form.Item> + </Col> : null} + {typename !== 'pc' ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鐭俊妯℃澘鍙湪绠$悊绯荤粺 HS-濂囦簯鐭俊妯℃澘 澶勬坊鍔犮��"> + <Icon type="question-circle" /> + 鐭俊妯℃澘 + </Tooltip> + }> + {getFieldDecorator('sms_id', { + initialValue: card ? card.sms_id || '' : '' + })( + <Select allowClear> + {msgs.map(option => + <Select.Option key={option.ID} value={option.ID}>{option.SignName + ' - ' + option.TemplateCode}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> : null} <Col span={12}> <Form.Item label="鐨偆"> {getFieldDecorator('css', { diff --git a/src/views/appmanage/submutilform/index.scss b/src/views/appmanage/submutilform/index.scss index 28344fe..b2364d9 100644 --- a/src/views/appmanage/submutilform/index.scss +++ b/src/views/appmanage/submutilform/index.scss @@ -1,4 +1,8 @@ -.mob-card-edit-form { +.sub-app-edit-form { padding: 0px 24px 20px; + .anticon-question-circle { + color: #c49f47; + margin-right: 3px; + } } \ No newline at end of file diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index d58564c..15916d9 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -325,9 +325,11 @@ navBar: res.menu_type } - sessionStorage.setItem('home_background', res.index_background_color) - sessionStorage.setItem('sys_datetime', res.sys_datetime) - sessionStorage.setItem('app_datetime', new Date().getTime()) + sessionStorage.setItem('home_background', res.index_background_color || '') + if (res.sys_datetime) { + sessionStorage.setItem('sys_datetime', res.sys_datetime) + sessionStorage.setItem('app_datetime', new Date().getTime()) + } // url鏍囬 document.title = systemMsg.platTitle diff --git a/src/views/login/loginform.jsx b/src/views/login/loginform.jsx index db3e842..8dff444 100644 --- a/src/views/login/loginform.jsx +++ b/src/views/login/loginform.jsx @@ -199,30 +199,61 @@ return } - let param = { - func: 'MSN_sms_send_code', + let _param = { + func: 'mes_sms_send_code_sso', send_type: 'login', mob: _phone, - timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), ID: smsId } + _param.LText = 'minke' + _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + _param.secretkey = md5(`${_param.LText}mingke${_param.timestamp}`) + + _param.userid = sessionStorage.getItem('visitorUserID') || '' + _param.LoginUID = sessionStorage.getItem('visitorLoginUID') || '' - param.LText = md5(`${_phone}mingke${window.GLOB.appkey}${param.timestamp}`) - param.secretkey = md5(`${param.LText}mingke${param.timestamp}`) + Api.getSystemConfig(_param).then(res => { + if (!res.status || !res.n_id) { + message.warning(res.message || '楠岃瘉鐮佽幏鍙栧け璐ワ紒') + return + } - param.userid = sessionStorage.getItem('visitorUserID') || '' - param.LoginUID = sessionStorage.getItem('visitorLoginUID') || '' + let param = { + func: 'MSN_sms_send_code', + send_type: 'login', + mob: _phone, + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + ID: smsId, + n_id: res.n_id + } + + param.LText = md5(`${_phone}mingke${window.GLOB.appkey}${param.timestamp}`) + param.secretkey = md5(`${param.LText}mingke${param.timestamp}`) - this.setState({ - verdisabled: true, - delay: 60 - }) - LoginVerCodeTimer = setTimeout(this.resetVerCodeDelay, 1000) - - Api.getSystemConfig(param).then(res => { - if (res.status) { - - } else { + param.rduri = 'http://sso.mk9h.cn/webapi/dostars' + param.userid = 'bh0bapabtd45epsgra79segbch6c1ibk' + param.LoginUID = 'bh0bapabtd45epsgra79segbch6c1ibk' + + this.setState({ + verdisabled: true, + delay: 60 + }) + LoginVerCodeTimer = setTimeout(this.resetVerCodeDelay, 1000) + + Api.getLocalConfig(param).then(res => { + if (res.status) { + + } else { + if (LoginVerCodeTimer) { + clearTimeout(LoginVerCodeTimer) + } + this.setState({ + verdisabled: false, + delay: null + }) + message.warning(res.message) + } + }, () => { if (LoginVerCodeTimer) { clearTimeout(LoginVerCodeTimer) } @@ -230,15 +261,6 @@ verdisabled: false, delay: null }) - message.warning(res.message) - } - }, () => { - if (LoginVerCodeTimer) { - clearTimeout(LoginVerCodeTimer) - } - this.setState({ - verdisabled: false, - delay: null }) }) } diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index 9f22b01..655e4f9 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -160,7 +160,9 @@ } getSmStemp = () => { - let _sql = `select ID,TemplateCode,SignName from bd_msn_sms_temp where deleted=0 and appkey='${window.GLOB.appkey}'` + let _sql = `select ID,TemplateCode,SignName from (select * from bd_msn_sms_temp where deleted=0 and status=20 ) a + inner join (select openid from sapp where id='${window.GLOB.appkey}') b + on a.openid=b.openid` _sql = Utils.formatOptions(_sql) diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index ae885f2..6528b49 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -250,7 +250,9 @@ } getSmStemp = () => { - let _sql = `select ID,TemplateCode,SignName from bd_msn_sms_temp where deleted=0 and appkey='${window.GLOB.appkey}'` + let _sql = `select ID,TemplateCode,SignName from (select * from bd_msn_sms_temp where deleted=0 and status=20 ) a + inner join (select openid from sapp where id='${window.GLOB.appkey}') b + on a.openid=b.openid` _sql = Utils.formatOptions(_sql) -- Gitblit v1.8.0