diff --git a/pc4mobx/organization/apis/qtxConfig.js b/pc4mobx/organization/apis/qtxConfig.js index 08e84ad..0424d9c 100644 --- a/pc4mobx/organization/apis/qtxConfig.js +++ b/pc4mobx/organization/apis/qtxConfig.js @@ -2,5 +2,8 @@ import { WeaTools } from 'ecCom'; export const getQtxConfigInfo = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/getCardButtonTable', 'GET', params); -} \ No newline at end of file + return WeaTools.callApi('/api/bs/hrmorganization/config/selectConfigInfo', 'GET', params); +} +export const saveQtxConfigInfo = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/config/saveConfigInfo', 'POST', params); + } \ No newline at end of file diff --git a/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js b/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js index 115515c..42ffc21 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js +++ b/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js @@ -90,7 +90,8 @@ export default class QtxConfig extends React.Component { const { qtxConfig } = this.props; - //qtxConfig.saveQuickSearchInfo(); + let result = this.tableEdit.refs.edit.doRequiredCheck(); + result.pass && qtxConfig.saveQtxConfigInfo(); } login = () => { @@ -157,6 +158,7 @@ export default class QtxConfig extends React.Component { {this.tableEdit = el}} draggable deleteConfirm showCopy={false} diff --git a/pc4mobx/organization/stores/qtxConfig.js b/pc4mobx/organization/stores/qtxConfig.js index b773c9b..fe0bd2e 100644 --- a/pc4mobx/organization/stores/qtxConfig.js +++ b/pc4mobx/organization/stores/qtxConfig.js @@ -64,9 +64,9 @@ export class QtxConfigStore { columns: columns, loading: false }); - // this.configForm.updateFields({ - // isquicksearch: data.setting.isquicksearch, - // }); + this.configForm.updateFields({ + isopenconfig: data.isopenconfig, + }); } else { message.error(`[${getLabel(127353, "错误") + code}]:${msg}`); } @@ -74,7 +74,6 @@ export class QtxConfigStore { } setTableEditDatas = (e) => { - debugger; if(e.length > 1) { e.pop(); message.error("默认只能添加一条配置数据!!!") @@ -85,35 +84,40 @@ export class QtxConfigStore { } @action("保存页面") saveQtxConfigInfo = () => { - // let datas = this.quickSearchData.datas; - // datas.map((data, index) => { - // data.orderid = index - // }); - - // let formparm = this.configForm.getFormParams(); - // if (!this.checkQuickSearchData()) { - // message.error(getLabel('387954', "条件字段不能重复")); - // return; - // } - // let id = this.quickSearchData.setting.id; - // if (id == null) { - // return; - // } - // API.saveQuickSearchInfo({ - // id: id, - // data: JSON.stringify(datas), ...formparm - // }).then(({ code, data, msg }) => { - // if (code == 200) { - // message.success(getLabel(83551, '保存成功!')); - // this.qcSelectedRowKeys = []; - // this.getQuickSearchInfo(); - // } else { - // message.error(`[${getLabel(127353, "错误") + code}]:${msg}`); - // } - // }); - // this.quickSearchData.setting.id = null; + if(this.editTableData.datas.length == 0) { + return message.error("至少保存一条配置数据!!") + } + let editTable = JSON.stringify(this.editTableData.datas[0]); + API.saveQtxConfigInfo({ + ...this.configForm.getFormParams(), + editTable, + }).then(({ code, data, msg }) => { + if (code == 200) { + message.success(getLabel(83551, '保存成功!')); + this.getQtxConfigInfo(); + } else { + message.error(`[${getLabel(127353, "错误") + code}]:${msg}`); + } + }); } + arrToJson = (arr) => { + let json = {}; + const _rows = isEmpty(arr) ? [] : rows; + _rows && _rows.map(index => { + arr[index][rowKey] = "1"; + }); + arr.map((item, index) => { + if (!item[rowKey]) item[rowKey] = "0"; + for (let key in item) { + json[key + "_" + index] = item[key]; + } + }); + + return json; + } + + /**===========================buttons=========================== */ rightMenu = [ {