From d38dc481492878c04ddf2d6bc2e9bf7d44c57fd7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 23 十二月 2019 18:29:38 +0800 Subject: [PATCH] 2019-12-23 --- src/templates/comtableconfig/index.jsx | 131 ++++++++++++++++++------------------------- 1 files changed, 55 insertions(+), 76 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 02c1f4d..447b25a 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -69,7 +69,7 @@ delActions: [], // 鍒犻櫎鎸夐挳鍒楄〃 funcLoading: false, // 瀛樺偍杩囩▼鍒涘缓涓� showColumnName: false, // 鏄剧ず鍒楀瓧娈靛悕鎺у埗 - tabviews: false // 鎵�鏈夋爣绛鹃〉 + tabviews: [] // 鎵�鏈夋爣绛鹃〉 } /** @@ -261,30 +261,21 @@ }) }) - // let param = { - // func: 'sPC_Get_SelectedList', - // LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0', - // obj_name: 'data', - // arr_field: 'TbName,Remark' - // } - - // param.LText = Utils.formatOptions(param.LText) - // param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - // param.secretkey = Utils.encrypt(param.LText, param.timestamp) - - // Api.getSystemConfig(param).then(res => { - // if (res.status) { - // this.setState({ - // tables: res.data - // }) - // } else { - // notification.warning({ - // top: 92, - // message: res.message, - // duration: 10 - // }) - // } - // }) + Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { + if (res.status) { + this.setState({ + tabviews: res.UserTemp.map(temp => { + return { + uuid: temp.MenuID, + value: temp.MenuID, + text: temp.MenuName, + type: temp.Template, + MenuNo: temp.MenuNo + } + }) + }) + } + }) } handleList = (type, list, card) => { @@ -986,19 +977,7 @@ label: '鍏宠仈鏍囩', initVal: card.linkTab || '', required: false, - options: [{ - value: '', - text: '鏂板缓' - }, { - value: 'jadisfjiasodjIjjaidfoasdf', - text: '瀛愯〃1' - }, { - value: 'dasjfsioafjiaga', - text: '瀛愯〃2' - }, { - value: 'jadsifjasgfisag', - text: '瀛愯〃3' - }] + options: [] }, { type: 'select', @@ -2465,47 +2444,46 @@ } }) } else if (type === 'tab') { - if (btn.linkTab) { - - } else { - let _tab = { - uuid: btn.linkId, - create: true - } - this.props.handleSubConfig(btn, originMenu, _tab, type) - } this.setState({ loading: true }) - // Api.getSystemConfig({ - // func: 'sPC_Get_LongParam', - // MenuID: btn.linkId - // }).then(res => { - // if (res.status) { - // this.setState({ - // loading: false - // }) - // let _LongParam = '' - // if (res.LongParam) { - // _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) - // try { - // _LongParam = JSON.parse(_LongParam) - // } catch (e) { - // _LongParam = '' - // } - // } - // console.log(_LongParam) - // } else { - // this.setState({ - // loading: false - // }) - // notification.warning({ - // top: 92, - // message: res.message, - // duration: 10 - // }) - // } - // }) + Api.getSystemConfig({ + func: 'sPC_Get_LongParam', + MenuID: btn.linkTab + }).then(res => { + if (res.status) { + this.setState({ + loading: false + }) + let _LongParam = '' + if (res.LongParam) { + _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) + try { + _LongParam = JSON.parse(_LongParam) + } catch (e) { + _LongParam = '' + } + } + if (!_LongParam) { + _LongParam = { + ...btn, + uuid: btn.linkTab, + create: true + } + } + + this.props.handleSubConfig(btn, originMenu, _LongParam, type) + } else { + this.setState({ + loading: false + }) + notification.warning({ + top: 92, + message: res.message, + duration: 10 + }) + } + }) } }, () => { notification.warning({ @@ -2801,6 +2779,7 @@ {this.state.formtemp === 'tabs' ? <TabForm type="tabs" + tabs={this.state.tabviews} dict={this.state.dict} card={this.state.card} formlist={this.state.formlist} -- Gitblit v1.8.0