diff --git a/pc4mobx/organization/apis/quickSearch.js b/pc4mobx/organization/apis/quickSearch.js index 5f1f10f..1fb0eb1 100644 --- a/pc4mobx/organization/apis/quickSearch.js +++ b/pc4mobx/organization/apis/quickSearch.js @@ -13,7 +13,7 @@ export const saveFieldDefinedInfo = (moduleName,params) => { }) } -export const getQuickSearchInfo = (params) => WeaTools.callApi(`/api/cube/list/getQuickSearchInfo`, 'GET', params); +export const getQuickSearchInfo = (params) => WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/getQuickSearchInfo`, 'GET', params); -export const getQuickSearchDetailInfo = (params) => WeaTools.callApi(`/api/cube/list/getQuickSearchDetailInfo`, 'GET', params); +export const getQuickSearchDetailInfo = (params) => WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/getQuickSearchDetailInfo`, 'GET', params); diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js index e69de29..b480154 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js +++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js @@ -0,0 +1,261 @@ +import React from 'react'; +import { observer } from 'mobx-react'; +import { WeaDialog, WeaNewScroll, WeaLocaleProvider, WeaRightMenu } from 'ecCom'; +import { WeaScope, WeaInput, WeaInputNumber, WeaSearchGroup, WeaTab, WeaError, WeaHelpfulTip } from 'ecCom'; +const getLabel = WeaLocaleProvider.getLabel; +import { Button, Table, Modal, message } from 'antd'; +import { observable, toJS, } from "mobx"; +import { WeaForm } from 'comsMobx'; +import $ from 'jquery'; + +@observer +export default class QuickSearchDetail extends React.Component { + constructor(props) { + super(props); + } + + + onSelectChange = (keys, rows) => { + let keyarr = []; + rows.map(row => { + keyarr.push(row.key); + }); + const { quickSearch } = this.props; + quickSearch.qcDetailRowKeys = keyarr; + } + + save = () => { + const { quickSearch } = this.props; + quickSearch.saveQuickSearchDetailInfo(); + } + + closeDialog = () => { + const { quickSearch } = this.props; + quickSearch.quickSearchDetailVisable = false; + } + + getSearchButton = () => { + const { quickSearch } = this.props; + const buttons = new Array(); + buttons.push(); + buttons.push(); + + return buttons; + } + + addRow = () => { + // const { CubeListStore } = this.props; + // let { quickSearchDetailData } = CubeListStore; + // let datas = quickSearchDetailData; + // let time = new Date().getTime(); + // let obj = { + // key: "new_" + time, + // customname: '', + // orderid: 0, + // minnum: '', + // maxnum: '', + // type: CubeListStore.qcData.qcType, + // fieldid: CubeListStore.qcData.fieldid, + // customid: CubeListStore.customid + // } + // datas = toJS(datas); + // datas.push(obj); + // CubeListStore.setQuickSearchDetailData(datas); + } + + delRow = () => { + // const { CubeListStore } = this.props; + // let { qcDetailRowKeys } = CubeListStore; + // if (qcDetailRowKeys.length <= 0) { + // message.error(getLabel(22346, '请选择要删除的信息', 'label')); + // return; + // } + // const that = this; + // Modal.confirm({ + // title: getLabel(83601, '您确认要删除选中的记录吗?'), + // onOk() { + // let datas = CubeListStore.quickSearchDetailData; + // datas = toJS(datas); + // datas = that.delFromArray(datas, qcDetailRowKeys); + // CubeListStore.qcDetailRowKeys = []; + // CubeListStore.setQuickSearchDetailData(datas); + // }, + // onCancel() { }, + // }); + } + + render() { + const { quickSearch: store } = this.props, { + qcDetailRowKeys + } = store; + const rowSelection = { + qcDetailRowKeys, + onChange: this.onSelectChange, + } + const Height = $(".wea-dialog-body")[0] && $(".wea-dialog-body")[0].style.height; + const buttons = [ + , + + ] + return ( + + + + + + + + + + ) + } + + +} + +@observer +class QuickSearchTableEdit extends React.Component{ + + getColumns = () => { + let columnArray = [ + { + title: getLabel(195, "名称"), dataIndex: "customname", key: "customname", width: "40%", + com: [{ label: '', type: 'INPUT', key: 'customname', viewAttr: 3, otherParams: { isBase64: true, inputType: "multilang" } }] + }, + { + title:
+ {getLabel(387588, "内容自定义条件")}  + +
, dataIndex: "condition", key: "condition", width: "40%", + com: [{ label: '', type: 'SCOP', key: 'condition', viewAttr: 3 }] + }, + { + title: getLabel(88, "顺序"), dataIndex: "orderid", key: "orderid", width: "20%", + com: [{ label: '', type: 'INPUTNUMBER', key: 'orderid', viewAttr: 2, otherParams: { max: 999, step: 1 } }] + } + ]; + columnArray = columnArray.map((col) => { + let _col = { ...col }; + _col.render = (text, record, index) => { + return this.getColRender(_col, text, record, index); + } + return _col + }); + return columnArray; + } + + getColRender = (_col, text, record, index) => { + const { datas } = this.props; + const { quickSearch: { quickSearchRefObj } } = this.props.ListProps; + const { com, } = _col; + let _com = []; + com.map((c) => { + if (typeof c.props === 'object') { + _com.push(); + } else { + const { key, viewAttr = 2, type = 'INPUT', width, otherParams = {} } = c; + const _type = type.toUpperCase(); + _com.push( + + { + _type === 'INPUT' && + quickSearchRefObj[`error_${key}_${index}`] = ref} + > + this.onEdit(record, index, key, value)} + {...otherParams} + /> + + } + { + _type === 'SCOP' && + quickSearchRefObj[`error_${key}_${index}`] = ref} + > +
+ this.onEdit(record, index, key, value)} + /> +
+
+ } + { + _type === 'INPUTNUMBER' && + this.onEdit(record, index, key, value1)} + {...otherParams} + /> + } +
+ ) + } + }); + return ( +
+ {_com} +
+ ) + } + + onEdit = (record, index, key, value) => { + const { datas } = this.props; + let _datas = [...datas]; + _datas[index][key] = value; + if (key == 'condition') { + _datas[index].minnum = value[0] === undefined ? "" : value[0]; + _datas[index].maxnum = value[1] === undefined ? "" : value[1]; + } + typeof this.props.onChange === 'function' && this.props.onChange(_datas); + } + render() { + const { datas, rowSelection } = this.props; + return ( +
+ + + ) + } +} diff --git a/pc4mobx/organization/stores/quickSearch.js b/pc4mobx/organization/stores/quickSearch.js index 8fccec9..b8d4725 100644 --- a/pc4mobx/organization/stores/quickSearch.js +++ b/pc4mobx/organization/stores/quickSearch.js @@ -33,6 +33,8 @@ export class QuickSearchStore { @observable qcData = { qcType: '', cid: '', fieldid: '' };//快速查询明细type @observable quickSearchDetailData = []; @observable precision = 0; + @observable qcDetailRowKeys = []; + quickSearchRefObj = {}; /**** ==============quickSearchForm ===============*/ @observable quickSearchFields = [ @@ -139,6 +141,25 @@ export class QuickSearchStore { } }); } + @action("明细保存") saveQuickSearchDetailInfo = () => { + // let datas = this.quickSearchDetailData; + // if (!this.checkQuickSearchDetailData()) { + // return; + // } + // API.saveQuickSearchDetailInfo({ + // cid: this.qcData.cid, + // data: JSON.stringify(datas) + // }).then(({ status, errorCode, error, setting, datas, options }: any) => { + // if (status == '1') { + // message.success(getLabel(83551, '保存成功!')); + // this.qcDetailRowKeys = []; + // this.getQuickSearchDetailInfo(this.qcData.cid); + // } else { + // message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`); + // } + // }); + } +