UNPKG

ttk-app-core

Version:
258 lines (252 loc) 7.13 kB
export function getMeta() { return { name: 'root', component: 'Layout', className: 'edfx-app-login', children: [{ name: 'header', className: 'edfx-app-login-header', component: 'Layout', children: [{ name: 'header-left', component: 'Layout', className: 'edfx-app-login-header-left', children: [ // { // name: 'logo', // component: '::img', // className: 'edfx-app-login-header-left-logo', // src: '{{$getLogo()}}' // }, { name: 'sitename', component: '::span', className: 'edfx-app-login-header-left-sitename', children: '智能财税' }, { name: 'split', component: '::div', className: 'edfx-app-login-header-left-split', }, { name: 'item', className: 'edfx-app-login-header-left-login', component: '::span', children: '企业登录' }] }, { name: 'header-right', className: 'edfx-app-login-header-right', component: '::a', onClick: '{{$goRegisterA}}', children: ['立即注册'] }] }, { name: 'content', className: 'edfx-app-login-content', component: 'Layout', children: [{ name: 'bgs', className: 'edfx-app-login-content-bgs', component: '::div', children: '{{$renderCal()}}' }, { name: 'form', component: 'Form', className: 'edfx-app-login-content-form', onSubmit: '{{$login}}', children: [{ name: 'item1', component: 'Form.Item', className: 'edfx-app-login-content-form-title', children: '登录' }, { name: 'item2', component: 'Form.Item', validateStatus: "{{data.other.error.mobile?'error':'success'}}", help: '{{data.other.error.mobile}}', className: 'edfx-app-login-content-form-mobile', children: [{ name: 'mobile', component: 'Input', autoFocus: 'autoFocus', placeholder: '请输入手机号', onFocus: "{{function(e){$setField('data.other.error.mobile', undefined)}}}", onChange: "{{function(e){$fieldChange('data.form.mobile', e.target.value)}}}", onBlur: "{{function(e){$fieldChange('data.form.mobile', e.target.value, 'login')}}}", value: '{{data.form.mobile}}', prefix: { name: 'userIcon', component: 'Icon', fontFamily: 'edficon', type: 'yonghu', } }] }, { name: 'item3', component: 'Form.Item', validateStatus: "{{data.other.error.password?'error':'success'}}", help: '{{data.other.error.password}}', className: 'edfx-app-login-content-form-password', children: [{ name: 'password', component: 'Input', placeholder: '请输入密码', type: 'password', onFocus: "{{function(e){$setField('data.other.error.password', undefined)}}}", onChange: `{{function(e){$setField('data.other.error.password', undefined);$setField('data.other.userInput', true);$setField('data.form.password', e.target.value)}}}`, onBlur: `{{function(e){$fieldChange('data.form.password', e.target.value)}}}`, value: '{{data.form.password}}', prefix: { name: 'passwordIcon', component: 'Icon', fontFamily: 'edficon', type: 'mima', } }] }, { name: 'item4', component: 'Form.Item', className: 'edfx-app-login-content-form-login', children: [{ name: 'loginBtn', component: 'Button', type: 'softly', // disabled: '{{$checkLogin()}}', children: '登录', onClick: '{{$login}}' }] }, { name: 'item5', component: 'Form.Item', className: 'edfx-app-login-content-form-more', children: [{ name: 'remember', component: 'Checkbox', className: 'edfx-app-login-content-form-more-remember', checked: '{{data.form.remember}}', onChange: `{{function(e){$fieldChange('data.form.remember', e.target.checked)}}}`, children: '一周内自动登录' }, { name: 'register', className: 'edfx-app-login-content-form-more-register', component: '::a', style: { float: 'right' }, onClick: '{{$goRegisterB}}', children: '立即注册' }, { name: '', component: '::i', style: { float: 'right', margin: '0 10px', fontStyle: 'normal' }, children: '|' }, { name: 'forgot', className: 'edfx-app-login-content-form-more-forget', component: '::a', style: { float: 'right' }, onClick: '{{$goForgot}}', children: '忘记密码' }] }] }] }, { name: 'footer', className: 'edfx-app-login-footer', component: 'Layout', children: [{ name: 'item1', component: '::p', children: [{ name: 'item1', component: '::span', children: '智能财税平台' //版权所有 © 2018 金财互联数据服务有限公司 粤ICP备' }, { name: 'version', id: 'lbl-version', component: '::span', children: '{{data.other.version}}' }/*, { name: 'test', id: 'lbl-test', component: 'Button', onClick: '{{$testConnect}}', _visible: true, children: 'test' }*/ // , { // name: 'item2', // component: '::a', // href: 'http://www.miitbeian.gov.cn', // children: '14007298' // }, { // name: 'item3', // component: '::span', // children: '号' // } ] }] }, { name: 'browserCheck', className: 'edfx-app-login-browserCheck', _visible: "{{data.other.checkTips ? true :false}}", component: "::div", children: { name: 'browserCheck-middle', className: 'edfx-app-login-browserCheck-middle', component: "::span", children: [{ name: 'warning-ico', component: "::img", className: 'edfx-app-login-browserCheck-img', src: require('./img/warning.png') }, { name: 'warning-test', component: '::span', className: 'edfx-app-login-browserCheck-title', children: '不建议手机端登录,请前往PC端' }, { name: 'warning-close', component: "::img", onClick: "{{$closeTips}}", className: 'edfx-app-login-browserCheck-close', src: require('./img/close.png') }] } }/*{ name: 'stepTips', component: 'Step', enabled: true, stepsEnabled: true, initialStep: 0, steps: [ { element: '.edfx-app-login-content-form-more-register', intro: '点我注册账号', }, { element: '.edfx-app-login-content-form-more-forget', intro: '忘记密码怎么办?', } ], onExit: "{{$onExit}}" }*/] } } export function getInitState() { return { data: { form: { account: '', password: '', mobile: '', remember: false, }, other: { error: {}, selectedImgIndex: 0, imgs: [], userInput: false, checkTips: false, version: '' } } } }