From 530579e52bffa27f75c023c393f56914b1443fab Mon Sep 17 00:00:00 2001 From: dd3s_206 Date: Sat, 16 May 2026 17:55:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BAh5=E7=AB=AF-=E6=8F=90?= =?UTF-8?q?=E6=A1=88=E7=AE=A1=E7=90=86-=E6=92=B0=E5=86=99=E6=8F=90?= =?UTF-8?q?=E6=A1=88-=E9=82=80=E8=AF=B7=E9=99=84=E8=AE=AE=E4=BA=BA?= =?UTF-8?q?=EF=BC=9A=20=E6=96=B0=E5=A2=9E=E6=B8=85=E7=A9=BA=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=88=E5=A6=82=E6=9C=89=E5=80=BC=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A1=86=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BA=8B=E4=BB=B6=EF=BC=88300=E6=AF=AB?= =?UTF-8?q?=E7=A7=92=E9=98=B2=E6=8A=96=E5=8A=A8=EF=BC=89=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8F=96=E6=B6=88=E5=8B=BE=E9=80=89=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proposal/transact/mine/inviteSeconder.js | 73 ++++++++++++++----- 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/inviteSeconder.js b/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/inviteSeconder.js index 3b18c5f..e39b7b6 100644 --- a/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/inviteSeconder.js +++ b/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/inviteSeconder.js @@ -4,15 +4,18 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = { - + @@ -62,13 +66,21 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = { }, config: {}, isInvite: "0", - tableSelection: [] + selectedLoginNames: [], + selectedSeconders: {}, + searchTimer: null } }, methods: { async onOpen(record) { this.visible = true this.record = record + this.isInvite = "0" + this.pageForm.isInvite = false + this.pageForm.pageNumber = 1 + this.pageForm.searchKeyword = null + this.selectedLoginNames = [] + this.selectedSeconders = {} await this.getConfig() this.pageData() @@ -77,15 +89,15 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = { detail(id) { }, invite() { - if (this.tableSelection.length === 0) { + if (this.selectedLoginNames.length === 0) { this.$toast("请先选择附议人后在点击邀请") return } - const loginNames = [...new Set(this.tableSelection.map((s) => s.loginName))] - const userName = [...new Set(this.tableSelection.map((s) => s.userName))] - - console.log(this.tableSelection) + const loginNames = [...new Set(this.selectedLoginNames)] + const userName = loginNames.map((loginName) => { + return this.selectedSeconders[loginName]?.userName || loginName + }) this.$dialog.confirm({ title: '提示', @@ -98,7 +110,8 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = { if (res.code === 0) { this.pageData() this.$toast.success(res.msg) - this.tableSelection = [] + this.selectedLoginNames = [] + this.selectedSeconders = {} // this.visible = false this.$emit("refresh", null) } @@ -117,20 +130,14 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = { if (res.code === 0) { this.tableData = res.data.list this.pageForm.totalCount = res.data.totalCount - this.echoCheckBox() + this.cacheCurrentPageSeconders() } }) }, - // 翻页回显勾选 - echoCheckBox() { - this.$nextTick(() => { - this.tableData.forEach((item) => { - const checkboxRef = this.$refs['checkboxes' + item.loginName] - if (checkboxRef && this.tableSelection.map((s) => s.loginName).includes(item.loginName)) { - checkboxRef[0].toggle() - } - }) + cacheCurrentPageSeconders() { + this.tableData.forEach((item) => { + this.$set(this.selectedSeconders, item.loginName, item) }) }, @@ -139,13 +146,39 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = { this.pageData() }, + onSearchInput(val) { + clearTimeout(this.searchTimer) + this.searchTimer = setTimeout(() => { + this.doSearch() + }, 300) + }, + + clearSearch() { + clearTimeout(this.searchTimer) + this.pageForm.searchKeyword = null + this.doSearch() + }, + isInviteClick(index, title) { this.pageForm.isInvite = index === "1" this.doSearch() }, tableRowToggle(index) { - console.log(index) + if (this.pageForm.isInvite) { + return + } + const item = this.tableData[index] + if (!item) { + return + } + this.$set(this.selectedSeconders, item.loginName, item) + const checkedIndex = this.selectedLoginNames.indexOf(item.loginName) + if (checkedIndex > -1) { + this.selectedLoginNames.splice(checkedIndex, 1) + } else { + this.selectedLoginNames.push(item.loginName) + } }, async getConfig() {