From 023895591327d0c210eec054d2c1d7991cefd413 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 02 三月 2022 00:14:23 +0800 Subject: [PATCH] 2022-03-02 --- src/mob/components/search/single-search/options.jsx | 12 ++++++ src/menu/components/table/edit-table/columns/editColumn/index.jsx | 72 ++++++++++++++--------------------- src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 17 ++++++++ src/views/login/index.jsx | 6 ++- 4 files changed, 62 insertions(+), 45 deletions(-) diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index dc695ac..50f3431 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -170,6 +170,23 @@ text: '鏄�' }] }, + // { + // type: 'radio', + // key: 'editType', + // label: '缂栬緫绫诲瀷', + // initVal: card.editType || 'text', + // required: true, + // options: [{ + // value: 'text', + // text: '鏂囨湰' + // }, { + // value: 'select', + // text: '涓嬫媺' + // }, { + // value: 'switch', + // text: '寮�鍏�' + // }] + // }, { type: 'radio', key: 'required', diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index d664236..8f7ea16 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -32,8 +32,10 @@ state = { visible: false, - formlist: null + formlist: null, } + + column = null UNSAFE_componentWillReceiveProps (nextProps) { if (nextProps.column && !is(fromJS(this.props.column), fromJS(nextProps.column))) { @@ -41,22 +43,29 @@ } } - editColumn = (column) => { - let formlist = getColumnForm(column, this.props.fields, this.props.columns) - let _options = fromJS(columnTypeOptions[column.type]).toJS() + getOptions = () => { + let _options = fromJS(columnTypeOptions[this.column.type]).toJS() - if (column.editable === 'true') { - if (column.type === 'text') { - _options.push('required', 'enter', 'footEnter') - } else if (column.type === 'number') { + if (this.column.editable === 'true') { + if (this.column.type === 'text') { + _options.push('editType', 'required', 'enter', 'footEnter') + } else if (this.column.type === 'number') { _options.push('max', 'min', 'enter', 'footEnter') } } + return _options + } + + editColumn = (column) => { + let formlist = getColumnForm(column, this.props.fields, this.props.columns) + + this.column = fromJS(column).toJS() + + let _options = this.getOptions() + this.setState({ visible: true, - editable: column.editable || 'false', - type: column.type, formlist: formlist.map(item => { item.hidden = !_options.includes(item.key) @@ -76,23 +85,15 @@ } typeChange = (key, value, option) => { - const { editable, type } = this.state - if (key === 'type') { - let _options = fromJS(columnTypeOptions[value]).toJS() + this.column[key] = value - if (editable === 'true') { - if (value === 'text') { - _options.push('required', 'enter', 'footEnter') - } else if (value === 'number') { - _options.push('max', 'min', 'enter', 'footEnter') - } - } + if (key === 'type') { + let _options = this.getOptions() this.setState({ - type: value, formlist: this.state.formlist.map(item => { if (item.key === 'editable') { - item.initVal = editable + item.initVal = this.column.editable || 'false' } item.hidden = !_options.includes(item.key) @@ -116,22 +117,16 @@ values.type = 'text' } - if (values.type !== this.state.type) { - let _options = fromJS(columnTypeOptions[values.type]).toJS() + let _type = this.column.type + this.column.type = values.type - if (editable === 'true') { - if (values.type === 'text') { - _options.push('required', 'enter', 'footEnter') - } else if (values.type === 'number') { - _options.push('max', 'min', 'enter', 'footEnter') - } - } + if (values.type !== _type) { + let _options = this.getOptions() this.setState({ - type: values.type, formlist: this.state.formlist.map(item => { if (item.key === 'editable') { - item.initVal = editable + item.initVal = this.column.editable || 'false' } item.hidden = !_options.includes(item.key) @@ -146,18 +141,9 @@ } else if (key === 'format' && value === 'percent') { this.props.form.setFieldsValue({postfix: '%'}) } else if (key === 'editable') { - let _options = fromJS(columnTypeOptions[type]).toJS() - - if (value === 'true') { - if (type === 'text') { - _options.push('required', 'enter', 'footEnter') - } else if (type === 'number') { - _options.push('max', 'min', 'enter', 'footEnter') - } - } + let _options = this.getOptions() this.setState({ - editable: value, formlist: this.state.formlist.map(item => { item.hidden = !_options.includes(item.key) diff --git a/src/mob/components/search/single-search/options.jsx b/src/mob/components/search/single-search/options.jsx index 8b31c35..7a75575 100644 --- a/src/mob/components/search/single-search/options.jsx +++ b/src/mob/components/search/single-search/options.jsx @@ -46,6 +46,18 @@ }, { type: 'radio', + field: 'focus', + label: '鑷姩鑱氱劍', + initval: wrap.focus || 'false', + tooltip: '娉細ios绯荤粺涓棤鏁堛��', + required: false, + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ] + }, + { + type: 'radio', field: 'required', label: '蹇呭~', initval: wrap.required || 'false', diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index a7fa087..9c08b0d 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -361,10 +361,12 @@ keys[char] = (offset + i) % 10 } - let lictime = +key2.replace(/[A-Z]/ig, (s) => { + let lictime = key2.replace(/[A-Z]/ig, (s) => { return keys[s] }) - let curtime = +moment().format('YYYYMMDD') + lictime = lictime.slice(0,4) + '/' + lictime.slice(4,6) + '/' + lictime.slice(6) + lictime = Math.floor(new Date(lictime).getTime() / 86400000) + let curtime = Math.floor(new Date().getTime() / 86400000) let licday = lictime - curtime let _mindUrl = window.location.href.split('#')[0] + 'notMind' -- Gitblit v1.8.0