From 92c966310c860ba1501f7c4b67b086d8de09b751 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 27 Oct 2025 14:55:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feature/3.0.1.2504.01-=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E5=A4=9A=E9=80=89=E6=94=AF=E6=8C=81=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CustomSelect/index.js | 80 +++++++++++++++++++ .../components/CustomSelect/index.less | 19 +++++ 2 files changed, 99 insertions(+) create mode 100644 pc4mobx/hrmSalary/components/CustomSelect/index.js create mode 100644 pc4mobx/hrmSalary/components/CustomSelect/index.less diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.js b/pc4mobx/hrmSalary/components/CustomSelect/index.js new file mode 100644 index 00000000..d65fe2ba --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.js @@ -0,0 +1,80 @@ +/* + * 自定义多选下拉框 + * 支持搜索 + * @Author: 黎永顺 + * @Date: 2024/9/13 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import classNames from "classnames"; +import { Select } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; +const Option = Select.Option; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + visible: false, dropdownWidth: 200, value: props.value ? props.value.split(",") : [] + }; + this.selectedData = {}; + } + + componentDidMount() { + const { dropdownWidth } = this.state; + const w = $(this.refs.customSelectMui).outerWidth(); + console.log($(this.refs.customSelectMui), w) + if (dropdownWidth < w) { + this.setState({ dropdownWidth: w }); + } + } + + handleChange = (value) => { + this.setState({ value }); + typeof this.props.onChange == "function" && + this.props.onChange(`${value}`); + }; + + render() { + const { dropdownWidth, visible, value } = this.state; + const { options = [], defaultValue } = this.props; + const clsname = classNames({ + "wea-associative-search-mult": true + }); + return ( +
+ +
+ {!visible ? : } +
+
+ ); + } +} + +export default Index; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.less b/pc4mobx/hrmSalary/components/CustomSelect/index.less new file mode 100644 index 00000000..ced4bc8e --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.less @@ -0,0 +1,19 @@ +.customMuiSelect { + .ant-input-group-wrap { + i { + padding-left: 2px !important; + padding-right: 2px !important; + padding-top: 0; + padding-bottom: 0; + line-height: 28px; + height: 28px; + border-radius: 2px; + color: #333 !important; + } + } + + .ant-select-selection--multiple { + max-height: 28px !important; + overflow-y: auto !important; + } +} From c00d3f446dc288416594acf2c663e98dbd31af6d Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 28 Oct 2025 15:09:36 +0800 Subject: [PATCH 2/4] =?UTF-8?q?release/3.0.1.2504.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CustomSelect/index.js | 137 ++++++++++++------ .../components/CustomSelect/index.less | 52 +++++-- 2 files changed, 130 insertions(+), 59 deletions(-) diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.js b/pc4mobx/hrmSalary/components/CustomSelect/index.js index d65fe2ba..43068096 100644 --- a/pc4mobx/hrmSalary/components/CustomSelect/index.js +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.js @@ -8,72 +8,119 @@ * @description: */ import React, { Component } from "react"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaCheckbox, WeaInput, WeaLocaleProvider, WeaNewScroll } from "ecCom"; import classNames from "classnames"; -import { Select } from "antd"; +import { Dropdown } from "antd"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; -const Option = Select.Option; class Index extends Component { constructor(props) { super(props); this.state = { - visible: false, dropdownWidth: 200, value: props.value ? props.value.split(",") : [] + visible: false, value: props.value ? props.value.split(",") : [], + keywords: "" }; - this.selectedData = {}; } - componentDidMount() { - const { dropdownWidth } = this.state; - const w = $(this.refs.customSelectMui).outerWidth(); - console.log($(this.refs.customSelectMui), w) - if (dropdownWidth < w) { - this.setState({ dropdownWidth: w }); + isAllChecked = () => { + const { options } = this.props, { value, keywords } = this.state; + let v = "0"; + if (_.uniq(value).length === options.filter(k => k.showname.indexOf(keywords) >= 0).length) v = "1"; + return v; + }; + + isChecked = (v) => { + const { value } = this.state; + return value.indexOf(v) > -1 ? "1" : "0"; + }; + onAllChange = (v) => { + const { options, onChange } = this.props, { keywords } = this.state; + let values = [], shownames = []; + if (v == 1) { + options.filter(k => k.showname.indexOf(keywords) >= 0).forEach(o => { + values.push(o.key); + shownames.push(o.showname); + }); } - } + this.setState({ value: values }); + onChange && onChange(values.join(","), shownames.join(",")); + }; - handleChange = (value) => { - this.setState({ value }); - typeof this.props.onChange == "function" && - this.props.onChange(`${value}`); + onItemChange = (v, id) => { + const { onChange, options } = this.props, { value } = this.state; + let values = !_.isEmpty(value) ? value : [], shownames = []; + if (v == "1") { + values.push(id); + } else { + values = values.filter(val => val !== id); + } + values.forEach(val => { + let target = options.filter((data) => data.key == val)[0]; + if (target) shownames.push(target.showname); + }); + this.setState({ value: values }); + onChange && onChange(values.join(","), shownames.join(",")); + }; + + getList = () => { + const { options } = this.props, { keywords } = this.state; + let style = {}; + if (options.length > 5) style = { height: 200 }; + return
+ +
+ this.setState({ keywords })}/> +
+
+ + +
+ {options && options.filter(k => k.showname.indexOf(keywords) >= 0).map(o => { + return
+ this.onItemChange(v, o.key)} + > + +
; + })} +
+
; + }; + + getShownames = () => { + const { options } = this.props; + let { value } = this.state; + let shownames = []; + value.forEach(val => { + let target = options.filter((data) => data.key == val)[0]; + if (target) shownames.push(target.showname); + }); + return shownames.join(","); }; render() { - const { dropdownWidth, visible, value } = this.state; - const { options = [], defaultValue } = this.props; + const { visible } = this.state, { layout } = this.props; const clsname = classNames({ "wea-associative-search-mult": true }); - return ( -
- -
- {!visible ? : } + return (
+ this.setState({ visible })} visible={visible} + getPopupContainer={() => (layout || document.body)}> +
+ {this.getShownames()} + {!this.state.visible ? : }
-
- ); + +
); } } diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.less b/pc4mobx/hrmSalary/components/CustomSelect/index.less index ced4bc8e..2f2d7288 100644 --- a/pc4mobx/hrmSalary/components/CustomSelect/index.less +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.less @@ -1,19 +1,43 @@ .customMuiSelect { - .ant-input-group-wrap { - i { - padding-left: 2px !important; - padding-right: 2px !important; - padding-top: 0; - padding-bottom: 0; - line-height: 28px; - height: 28px; - border-radius: 2px; - color: #333 !important; + border: none; + padding: 0; + + .wea-select-input { + min-width: 100px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + user-select: none; + + &:hover, &:focus { + border-color: #57c5f7; + } + + .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #979797; } } - .ant-select-selection--multiple { - max-height: 28px !important; - overflow-y: auto !important; - } } + +.wea-select-panel { + padding: 5px 0; + max-height: 200px; + border-radius: 3px; + background: #fff; + border: 1px solid #ddd; + + .wea-select-panel-item { + padding: 5px 10px; + + &:hover { + background-color: #e9f7ff; + } + } +} \ No newline at end of file From 9efeb109e9595a28ea957f7283c5a009a1bc20e9 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 30 Oct 2025 10:17:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?release/3.0.1.2504.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CustomSelect/index.less | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.less b/pc4mobx/hrmSalary/components/CustomSelect/index.less index 2f2d7288..1ce20fb4 100644 --- a/pc4mobx/hrmSalary/components/CustomSelect/index.less +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.less @@ -11,6 +11,23 @@ min-height: 30px; border: 1px solid #d9d9d9; user-select: none; + height: 30px; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + + .wdb { + word-break: break-all !important; + word-wrap: break-word !important; + } + + .cursor-pointer { + cursor: pointer; + } &:hover, &:focus { border-color: #57c5f7; From 372d9d53eee7f835141cb2b4664e2daa9f00c739 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 13 Nov 2025 16:40:45 +0800 Subject: [PATCH 4/4] =?UTF-8?q?release/3.0.1.2504.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index e8b7cc58..51fba0f7 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -13,9 +13,8 @@ import Content from "../../components/pcTemplate/content"; import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll"; import CaptchaModal from "../../components/captchaModal"; import "./index.less"; -import { getQueryString } from "../../util/url"; -const isIPhone = new RegExp("\\biPhone\\b|\\biPod\\b", "i").test(window.navigator.userAgent); +const isPhone = /(iPhone|iPad|iPod|iOS|Android)/i.test(window.navigator.userAgent); const isEm = window.navigator.userAgent.indexOf("E-Mobile7") >= 0; const { getLabel } = WeaLocaleProvider; @@ -132,8 +131,8 @@ export const ConfirmBtns = (props) => { } { - ((props.showFeedback === "1" && !isIPhone) || (props.showFeedback === "1" && isIPhone && isEm)) && + ((props.showFeedback === "1" && !isPhone) || (props.showFeedback === "1" && isEm)) && }
; -}; +}; \ No newline at end of file