From 1a87a3f1180d8118f8630589df86d0175b0e69c2 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 16 Aug 2023 13:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E6=9D=A1=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/resource.js | 5 + .../components/fieldDefinedSet/FieldDef.js | 6 +- .../fieldDefinedSet/QuickSearchTableEdit.js | 4 +- pc4mobx/organization/components/job/Job.js | 2 +- .../components/resource/resource.js | 7 +- pc4mobx/organization/index.js | 6 + pc4mobx/organization/stores/resource.js | 127 +++++++----------- 7 files changed, 67 insertions(+), 90 deletions(-) diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index f4c16ee..d8a8aeb 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -31,6 +31,11 @@ export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getHasRight', 'GET', params); } +export const getQuickSearchCondition = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/quicksearch/getQuickSearchCondition', 'GET', params); +} + + export const editResource = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/updateForm', 'POST', params); } diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js index ffb3bd2..38f3576 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js @@ -105,9 +105,9 @@ export default class FieldDef extends Component { } const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)] return ( -
{ - this.tabDom = dom -}}> +
{ + this.tabDom = dom + }}> setEditTable(editTable, 'fieldDef')} diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchTableEdit.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchTableEdit.js index c496438..914d31b 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchTableEdit.js +++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchTableEdit.js @@ -46,8 +46,8 @@ export default class QuickSearchTableEdit extends React.Component { label: '', type: 'SELECT', key: 'showmodel', - viewAttr: 2, - options: [{ key: '0', showname: getLabel(149, '默认') }, { key: '1', showname: getLabel(19852, '平铺') },] + viewAttr: 1, + options: [ { key: '0', showname: getLabel(19852, '平铺') },] }] } ]; diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index e15d141..f6cd5cd 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2023-08-02 17:09:24 + * @LastEditTime: 2023-08-14 11:39:45 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index e73148e..56a3ed3 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -82,6 +82,7 @@ export default class Resource extends React.Component { resource } = this.props; resource.getHasRight(); + resource.getQuickSearchCondition(); let { hash } = window.location; hash = hash.split("?")[1].split("&"); if (hash.length >= 2) { @@ -507,7 +508,7 @@ export default class Resource extends React.Component { } = this.props; const { isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition, - form, dialogLoading, isEdit, date, hasRight, defaultShowLeft + form, dialogLoading, isEdit, date, hasRight, defaultShowLeft,enable } = store; if (hasRight === false) { @@ -542,10 +543,10 @@ export default class Resource extends React.Component { advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} hasMask={false} buttonsAd={this.getTabBtn()} - onSearch={() => store.getTableInfo()} + onSearch={() => {store.hideRadioGroup();store.getTableInfo();}} onSearchChange={val => this.onSearchChange(val)} /> - + {enable && } this.reCalculateTableHeight = new Date().getTime(), 500); } - rangeConditions = [ - { - label: '联动类型', - options: [ - {key:'0',showname:'全部'}, - {key:'1',showname:'今天', selected: true}, - {key:'2',showname:'本周'}, - {key:'3',showname: '时间'}, - {key:'5',showname:'本年'}, - {key:'7',showname:'上个月'}, - {key:'8',showname:'数值区间'}, - {key:'6',showname:'指定日期范围'}, - ], - domkey: ['dateFrom'], - selectLinkageDatas: { - '1': { - conditionType: 'INPUT', - domkey: ['INPUT'], - }, - '3': { - conditionType: 'DATEPICKER', - domkey: ['INPUT111111121'], - viewAttr: 3, - format: 'YYYY', - }, - '2': { - conditionType: 'CHECKBOX', - domkey: ['CHECKBOX'], - }, - '8': { - conditionType: 'SCOPE', - domkey: ['CHECKBOX1', 'CHECKBOX2'], - }, - '6': { - conditionType: 'RANGEPICKER', - domkey: ['start', 'end'], - } - }, - labelcol: 6, - fieldcol: 18, - }, - { - label: '不联动类型', - options: [ - {key:'0',showname:'全部', selected: true}, - {key:'1',showname:'外勤签到'}, - {key:'2',showname:'考勤签到/签退'}, - ], - domkey: ['checking'], - labelcol: 6, - fieldcol: 18, - }, - { - label: '只读类型', - viewAttr: '1', - options: [ - {key:'0',showname:'全部'}, - {key:'1',showname:'外勤签到'}, - {key:'2',showname:'考勤签到/签退'}, - ], - labelcol: 6, - fieldcol: 18, - }, - { - label: '自定义类型', - com:
自定义组件
, - labelcol: 6, - fieldcol: 18, - } - ]; + @observable rangeConditions = []; + @observable radioParams = {}; + @observable refreshRadioGroup = new Date().getTime(); @computed get radioGroupConfig(){ this.refreshRadioGroup; @@ -167,24 +101,39 @@ export class ResourceStore { } @action onRadioGroupChangeHandle = params => { - console.log(params); + this.radioParams = params; + this.getTableInfo(); } @action("列表") getTableInfo() { - let params; this.tableStore = new TableStore(); - if (this.isEmptyObject(this.form2.getFormParams())) { + let params = {}; + debugger; + if(this.isEmptyObject(this.radioParams)) { params = { ...this.selectTreeNodeInfo, - lastName: this.lastName - }; - } else { + isQuickSearch:false + } + if (this.isEmptyObject(this.form2.getFormParams())) { + params = { + ...params, + lastName: this.lastName, + }; + } else { + params = { + ...params, + ...this.form2.getFormParams() + }; + } + }else { params = { + ...this.radioParams, ...this.selectTreeNodeInfo, - ...this.form2.getFormParams() - }; + isQuickSearch:true + } } + this.form2.resetForm(); Api.getSearchList(params).then(res => { if (res.code === 200) { res.data.datas && this.tableStore.getDatas(res.data.datas, 1); @@ -198,6 +147,7 @@ export class ResourceStore { @action("nodetree事件") doSearch(params) { this.selectTreeNodeInfo = params; + this.showRadioGroup = true; this.getTableInfo(); } @@ -211,7 +161,7 @@ export class ResourceStore { return response.json() }).then(data => { if (data.code === 200) { - message.success(data.msg); + message.success(data.msg,1); this.getTableInfo(); this.setVisible(false); } else { @@ -270,6 +220,18 @@ export class ResourceStore { }) } + @action("快捷搜索") getQuickSearchCondition() { + Api.getQuickSearchCondition().then(res => { + if (res.code === 200) { + this.rangeConditions = res.data.rangeConditions; + this.enable = res.data.enable; + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } @action("顶部按钮") getHasRight() { Api.getHasRight().then(res => { @@ -793,8 +755,6 @@ export class ResourceStore { }); } - - updateFields(val) { this.form2.updateFields({ lastname: { @@ -803,6 +763,11 @@ export class ResourceStore { }); } + hideRadioGroup() { + this.radioParams = {}; + this.showRadioGroup = false; + } + setSearchCondition(condition) { this.searchCondition = condition; }