From 89a8bfae913e3b702bf16d6d5bc6818ba6501267 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 08 九月 2023 20:23:12 +0800 Subject: [PATCH] 2023-09-08 --- src/menu/components/card/double-data-card/options.jsx | 16 ---- src/tabviews/custom/components/carousel/prop-card/index.jsx | 1 src/tabviews/custom/components/card/double-data-card/index.scss | 18 ---- src/tabviews/custom/components/carousel/cardItem/index.jsx | 35 ++++---- src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 117 ++++++++++++++++++++--------- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 53 +++++++++++-- 6 files changed, 143 insertions(+), 97 deletions(-) diff --git a/src/menu/components/card/double-data-card/options.jsx b/src/menu/components/card/double-data-card/options.jsx index dac4c9e..1334c99 100644 --- a/src/menu/components/card/double-data-card/options.jsx +++ b/src/menu/components/card/double-data-card/options.jsx @@ -60,22 +60,6 @@ precision: 0, required: true }, - // { - // type: 'radio', - // field: 'layout', - // label: '鍗$墖甯冨眬', - // initval: wrap.layout || 'grid', - // tooltip: appType === 'mob' ? '寮规�у竷灞�鏃讹紝婊戝姩鍔犺浇鏃犳晥' : '', - // required: false, - // options: [ - // {value: 'grid', label: '鏍呮牸甯冨眬'}, - // {value: 'flex', label: '寮规�у竷灞�'}, - // ], - // controlFields: [ - // {field: 'printHeight', values: ['flex']}, - // {field: 'cardFloat', values: ['grid']}, - // ] - // }, { type: 'radio', field: 'pagestyle', diff --git a/src/tabviews/custom/components/card/double-data-card/index.scss b/src/tabviews/custom/components/card/double-data-card/index.scss index c6a13e8..7d2191b 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.scss +++ b/src/tabviews/custom/components/card/double-data-card/index.scss @@ -44,24 +44,6 @@ flex: 1; } } - .card-row-list.float-center { - text-align: center; - >.ant-col { - display: inline-block; - float: none; - text-align: left; - vertical-align: top; - } - } - .card-row-list.float-right { - text-align: right; - >.ant-col { - display: inline-block; - float: none; - text-align: left; - vertical-align: top; - } - } .card-item-box { position: relative; background-color: #ffffff; diff --git a/src/tabviews/custom/components/carousel/cardItem/index.jsx b/src/tabviews/custom/components/carousel/cardItem/index.jsx index e502391..1ed6197 100644 --- a/src/tabviews/custom/components/carousel/cardItem/index.jsx +++ b/src/tabviews/custom/components/carousel/cardItem/index.jsx @@ -16,10 +16,6 @@ data: PropTypes.object, } - state = { - card: null, // 鍗$墖淇℃伅锛屽寘鎷鍙嶉潰 - } - /** * @description 鎼滅储鏉′欢鍒濆鍖� */ @@ -45,29 +41,34 @@ if (!card.setting.click || data.$disabled) return - if (card.setting.click === 'menu' && card.setting.MenuID) { - let menu = { - MenuID: card.setting.MenuID, - MenuName: card.setting.MenuName, - MenuNo: card.setting.MenuNo, - type: card.setting.tabType + if (card.setting.click === 'menu') { + let menuId = card.setting.menu.slice(-1)[0] + let menu = null + + if (window.GLOB.mkThdMenus.has(menuId)) { + menu = {...window.GLOB.mkThdMenus.get(menuId)} + } else if (card.setting.MenuID) { + menu = { + MenuID: card.setting.MenuID, + MenuName: card.setting.MenuName, + type: card.setting.tabType + } } - let newtab = { - ...menu, - param: {} - } + if (!menu) return + + menu.param = {} if (card.setting.joint === 'true') { - newtab.param.$BID = data.$$uuid || '' + menu.param.$BID = data.$$uuid || '' Object.keys(data).forEach(key => { if (/^\$/.test(key)) return - newtab.param[key] = data[key] + menu.param[key] = data[key] }) } - MKEmitter.emit('modifyTabs', newtab, true) + MKEmitter.emit('modifyTabs', menu, true) } else if (card.setting.click === 'link') { let src = card.setting.linkurl diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index e600f77..572b869 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -241,7 +241,6 @@ let code = config.wrap.code || ('modal' + config.uuid) let tip = localStorage.getItem(code) - tip = null if ((data.$$uuid && tip === data.$$uuid) || (!data.$$uuid && tip)) return diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index cb4990f..c834b60 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -388,48 +388,91 @@ const { verify } = this.state let _columns = JSON.parse(JSON.stringify(verify.columns)) - - let _cols = _columns.map(col => col.Column) + let _cols = _columns.map(col => col.Column.toLowerCase()) + let names = {$up: false} columns.forEach(col => { - if (col.field && !_cols.includes(col.field)) { - let _type = 'Nvarchar(50)' - let _limit = '50' - if (col.type === 'number' && !col.decimal) { - _type = 'Int' - _limit = '' - } else if (col.type === 'number') { - _type = 'Decimal(18,' + col.decimal + ')' - _limit = col.decimal - } - - let _cell = { - uuid: col.uuid, - Column: col.field, - Text: col.label, - type: _type, - limit: _limit, - import: 'true', - required: 'true' - } - - if (_type !== 'Nvarchar(50)') { - _cell.min = 0 - _cell.max = 999999 - } - - _columns.push(_cell) + if (!col.field) return + if (_cols.includes(col.field.toLowerCase())) { + names.$up = true + names[col.field.toLowerCase()] = col.label + return } + + let _type = 'Nvarchar(50)' + let _limit = '50' + if (col.type === 'number' && !col.decimal) { + _type = 'Int' + _limit = '' + } else if (col.type === 'number') { + _type = 'Decimal(18,' + col.decimal + ')' + _limit = col.decimal + } + + let _cell = { + uuid: col.uuid, + Column: col.field, + Text: col.label, + type: _type, + limit: _limit, + import: 'true', + required: 'true' + } + + if (_type !== 'Nvarchar(50)') { + _cell.min = 0 + _cell.max = 999999 + } + + _columns.push(_cell) }) - this.setState({ - verify: { - ...verify, - columns: _columns - } - }, () => { - this.resetUniqueColumns() - }) + if (names.$up) { + const that = this + + confirm({ + content: '閮ㄥ垎瀛楁鍚嶇О涓庢樉绀哄垪涓嶄竴鑷达紝鏄惁鏇存柊锛�', + onOk() { + _columns = _columns.map(item => { + let key = item.Column.toLowerCase() + + if (names[key]) { + item.Text = names[key] + } + + return item + }) + + that.setState({ + verify: { + ...verify, + columns: _columns + } + }, () => { + that.resetUniqueColumns() + }) + }, + onCancel() { + that.setState({ + verify: { + ...verify, + columns: _columns + } + }, () => { + that.resetUniqueColumns() + }) + } + }) + } else { + this.setState({ + verify: { + ...verify, + columns: _columns + } + }, () => { + this.resetUniqueColumns() + }) + } } clearField = () => { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index ebce7e5..b6acd2e 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -600,11 +600,16 @@ const { verify } = this.state let columns = fromJS(verify.columns).toJS() - let fields = columns.map(item => item.Column) + let fields = columns.map(item => item.Column.toLowerCase()) + let names = {$up: false} config.columns.forEach(item => { - if (fields.includes(item.field) || !item.field) return - fields.push(item.field) + if (!item.field) return + if (fields.includes(item.field.toLowerCase())) { + names.$up = true + names[item.field.toLowerCase()] = item.label + return + } let cell = { Column: item.field, @@ -627,8 +632,12 @@ if (config.subtype === 'dualdatacard') { config.subColumns.forEach(item => { - if (fields.includes(item.field) || !item.field) return - fields.push(item.field) + if (!item.field) return + if (fields.includes(item.field.toLowerCase())) { + names.$up = true + names[item.field.toLowerCase()] = item.label + return + } let cell = { Column: item.field, @@ -650,9 +659,37 @@ }) } - this.setState({ - verify: {...verify, columns: columns} - }) + if (names.$up) { + const that = this + + confirm({ + content: '閮ㄥ垎瀛楁鍚嶇О涓庢樉绀哄垪涓嶄竴鑷达紝鏄惁鏇存柊锛�', + onOk() { + columns = columns.map(item => { + let key = item.Column.toLowerCase() + + if (names[key]) { + item.Text = names[key] + } + + return item + }) + + that.setState({ + verify: {...verify, columns: columns} + }) + }, + onCancel() { + that.setState({ + verify: {...verify, columns: columns} + }) + } + }) + } else { + this.setState({ + verify: {...verify, columns: columns} + }) + } } clearField = () => { -- Gitblit v1.8.0