From f128d679cacda2a6b5b730ad0368b5fe73f887f7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 14 二月 2025 15:27:02 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/table/base-table/index.jsx | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx index c05c3d4..fe42ea2 100644 --- a/src/menu/components/table/base-table/index.jsx +++ b/src/menu/components/table/base-table/index.jsx @@ -60,8 +60,8 @@ columns: [], cols: [ { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: '', Hide: 'false', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, + { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: '', Hide: 'false', IsSort: 'false', type: 'text', Width: 120 }, + { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'false', type: 'text', Width: 120 }, ], scripts: [], isNew: true @@ -146,6 +146,10 @@ if (card.errors.length === 0) { card.$tables = getTables(card) } + + delete card.$c_ds + delete card.$c_ac + delete card.$c_cl } this.setState({ @@ -219,7 +223,7 @@ getWrapForms = () => { const { wrap, action, columns, cols } = this.state.card - let _actions = [...action] + let _actions = [] cols.forEach(col => { if (col.type === 'custom') { @@ -231,7 +235,7 @@ } }) - return getWrapForm(wrap, _actions, columns) + return getWrapForm(wrap, _actions, columns, action) } updateWrap = (res) => { @@ -259,12 +263,23 @@ config.cols.forEach(col => { if (!col.field) return if (['text', 'picture', 'video', 'textarea'].includes(col.type)) { + let datatype = `Nvarchar(${col.fieldlength || 50})` + let type = 'text' + + if (col.type === 'text') { + if (col.textFormat === 'YYYY-MM-DD') { + datatype = 'date' + } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss') { + datatype = 'datetime' + } + } + config.columns.push({ - datatype: `Nvarchar(${col.fieldlength || 50})`, + datatype: datatype, field: col.field, fieldlength: col.fieldlength || 50, label: col.label, - type: 'text', + type: type, uuid: col.uuid }) } else if (col.type === 'link') { @@ -308,6 +323,14 @@ config.absFields = null } + if (!config.setting.primaryKey && config.columns.length > 0) { + config.columns.forEach(col => { + if (col.field.toLowerCase() === 'id') { + config.setting.primaryKey = col.field + } + }) + } + this.updateComponent(config) } -- Gitblit v1.8.0