From 08cce3334a2dc81d690b518136b0aaea64e48b0b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 14 六月 2023 09:55:50 +0800 Subject: [PATCH] 2023-06-14 --- src/menu/components/card/balcony/index.jsx | 72 +++++++++++++---------------------- 1 files changed, 27 insertions(+), 45 deletions(-) diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx index d495918..691e7f3 100644 --- a/src/menu/components/card/balcony/index.jsx +++ b/src/menu/components/card/balcony/index.jsx @@ -6,7 +6,7 @@ import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' -import { resetStyle, getTables } from '@/utils/utils-custom.js' +import { resetStyle, getTables, checkComponent } from '@/utils/utils-custom.js' import MKEmitter from '@/utils/events.js' import Utils from '@/utils/utils.js' import getWrapForm from './options' @@ -126,51 +126,15 @@ return } - card.errors = [] + card.$c_ds = card.wrap.datatype === 'dynamic' + card.$c_ac = false + card.$c_sc = false + card.$c_el = true + + card.errors = checkComponent(card) - if (card.wrap.datatype === 'static') { - card.elements.forEach(cell => { - if (cell.eleType === 'button') { - if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { - if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) - } - } - } else if (cell.datatype === 'dynamic' && cell.field) { - card.errors.push({ level: 1, detail: `鍗$墖涓姩鎬佸瓧娈碘��${cell.field}鈥濇棤鏁坄}) - } - }) + if (card.errors.length === 0) { card.$tables = getTables(card) - } else { - let columns = card.columns.map(c => c.field) - - if (card.wrap.datatype === 'dynamic') { - if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) { - card.errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'}) - } else if (card.setting.interType === 'system' && card.setting.execute === 'false' && card.scripts.filter(script => script.status !== 'false').length === 0) { - card.errors.push({ level: 0, detail: '鏁版嵁婧愪腑鏃犲彲鐢ㄨ剼鏈紒'}) - } else if (!card.setting.primaryKey) { - card.errors.push({ level: 0, detail: '鏈缃富閿紒'}) - } else if (!columns.includes(card.setting.primaryKey)) { - card.errors.push({ level: 0, detail: '涓婚敭宸插け鏁堬紒'}) - } - } - - if (card.errors.length === 0) { - card.$tables = getTables(card) - } - - card.elements.forEach(cell => { - if (cell.eleType === 'button') { - if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { - if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) - } - } - } else if (cell.datatype === 'dynamic' && cell.field && !columns.includes(cell.field)) { - card.errors.push({ level: 1, detail: `鍗$墖涓姩鎬佸瓧娈碘��${cell.field}鈥濇棤鏁坄}) - } - }) } this.setState({ @@ -211,6 +175,10 @@ newcard.datatype = 'dynamic' newcard.height = 1 + if (card.wrap.datatype === 'static') { + newcard.datatype = 'static' + } + // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌 MKEmitter.emit('cardAddElement', card.uuid, newcard) } @@ -239,6 +207,7 @@ MKEmitter.emit('cardAddElement', card.uuid, res) } else { res.eleType = 'button' + res.width = res.width || 12 MKEmitter.emit('cardAddElement', card.uuid, res) } resolve({status: true}) @@ -272,6 +241,19 @@ if (d) { _card.columns = fromJS(d.columns).toJS() + } + } + + if (_card.wrap.position === 'fixed') { + if (_card.wrap.top && _card.wrap.bottom && _card.wrap.top.indexOf('vh') > -1 && _card.wrap.bottom.indexOf('vh') > -1) { + if (parseFloat(_card.wrap.top) + parseFloat(_card.wrap.bottom) >= 100) { + message.warning('鍏冪礌璺濅笂璺濅笅涔嬪拰瓒呭嚭100%锛屽彲鑳藉鑷村厓绱犳棤娉曟樉绀恒��') + } + } + if (_card.wrap.left && _card.wrap.right && _card.wrap.left.indexOf('vw') > -1 && _card.wrap.right.indexOf('vw') > -1) { + if (parseFloat(_card.wrap.left) + parseFloat(_card.wrap.right) >= 100) { + message.warning('鍏冪礌璺濆乏璺濆彸涔嬪拰瓒呭嚭100%锛屽彲鑳藉鑷村厓绱犳棤娉曟樉绀恒��') + } } } @@ -310,7 +292,7 @@ <div className="center"> <div className="title" onDoubleClick={() => { let oInput = document.createElement('input') - oInput.value = card.uuid + oInput.value = 'anchor' + card.uuid document.body.appendChild(oInput) oInput.select() document.execCommand('Copy') -- Gitblit v1.8.0