From c76e56d9cc6f8f5e93aaf355b269ec8cac8c6b95 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 15 二月 2020 02:18:10 +0800 Subject: [PATCH] 2020-02-15 --- src/templates/formtabconfig/index.jsx | 42 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index 830ea64..e2b0def 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -12,11 +12,11 @@ import enUS from '@/locales/en-US/comtable.js' import Utils from '@/utils/utils.js' import { getModalForm, getActionForm } from '@/templates/tableshare/formconfig' +import { queryTableSql } from '@/utils/option.js' import ModalForm from '@/templates/ushare/modalform' import ActionForm from './actionform' import SettingForm from './settingform' -// import ModalForm from './modalform' import DragElement from './dragelement' import GroupForm from './groupform' import TabForm from '@/templates/tableshare/tabform' @@ -63,8 +63,8 @@ funcLoading: false, // 瀛樺偍杩囩▼鍒涘缓涓� tabviews: [], // 鎵�鏈夋爣绛鹃〉 profileVisible: false, // 楠岃瘉淇℃伅妯℃�佹 - editgroup: null, - groupVisible: null + editgroup: null, // 褰撳墠缂栬緫缁� + groupVisible: false // 缂栬緫缁勬ā鎬佹 } /** @@ -123,8 +123,7 @@ componentDidMount () { let param = { func: 'sPC_Get_SelectedList', - // LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0', - LText: 'select TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t', + LText: queryTableSql, obj_name: 'data', arr_field: 'TbName,Remark' } @@ -1177,6 +1176,13 @@ let _LongParam = '' let _config = {...config, tables: this.state.selectedTables} + // 鏁版嵁鏉ユ簮涓烘煡璇笖鏈缃富閿椂锛屽惎鐢ㄤ负false + if (_config.setting.datatype === 'query' && !_config.setting.primaryKey) { + _config.enabled = false + } else if (_config.setting.datatype === 'query' && _config.setting.interType === 'inner' && !_config.setting.innerFunc && !_config.setting.dataresource) { + _config.enabled = false + } + // 鏍囩涓嶅悎娉曟椂锛屽惎鐢ㄧ姸鎬佷负false if (_config.tabgroups.length > 1) { _config.tabgroups.forEach(group => { @@ -1739,17 +1745,37 @@ } }) } + let forminvalid = true + if (config.groups.length > 1) { + config.groups.forEach(group => { + if (group.sublist.length === 0) { + forminvalid = false + } + }) + } - if (config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) { + if (config.setting.datatype === 'query' && config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) { notification.warning({ top: 92, - message: '鑿滃崟灏氭湭璁剧疆鏁版嵁婧愶紝涓嶅彲鍚敤锛�', + message: '灏氭湭璁剧疆鏁版嵁婧愶紝涓嶅彲鍚敤锛�', + duration: 10 + }) + } else if (config.setting.datatype === 'query' && config.setting.primaryKey) { + notification.warning({ + top: 92, + message: '灏氭湭璁剧疆涓婚敭锛屼笉鍙惎鐢紒', duration: 10 }) } else if (!tabinvalid) { notification.warning({ top: 92, - message: '鑿滃崟鏍囩椤佃缃敊璇紙澶氳鏍囩鍐咃紝琛屾爣绛句笉鍙负绌猴級锛屼笉鍙惎鐢紒', + message: '瀛樺湪澶氫綑鏍囩缁勶紝涓嶅彲鍚敤锛�', + duration: 10 + }) + } else if (!forminvalid) { + notification.warning({ + top: 92, + message: '瀛樺湪澶氫綑绌鸿〃鍗曠粍锛屼笉鍙惎鐢紒', duration: 10 }) } else { -- Gitblit v1.8.0