From db905fa4e3aefc96ce56bd9222055869db7edc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=89=BE=E8=B4=A4=E5=87=8C?= Date: Tue, 18 Jan 2022 15:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sass/AppAskForm/AppAskForm.vue | 2 +- src/sass/AppAskForm/Result.vue | 2 +- src/sass/AppMeetingNotice/addMeeting.vue | 8 ++++---- src/sass/AppNotification/add.vue | 8 ++++---- src/store/index.js | 21 +++++++++++++++++++++ 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/sass/AppAskForm/AppAskForm.vue b/src/sass/AppAskForm/AppAskForm.vue index b2a0387e..03f36a9a 100644 --- a/src/sass/AppAskForm/AppAskForm.vue +++ b/src/sass/AppAskForm/AppAskForm.vue @@ -39,7 +39,7 @@ export default { document.title = "问卷表单" this.$refs?.TabPage?.show() this.$nextTick(() => { - this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact', 'shareAppMessage', 'shareWechatMessage']).then(() => { + this.injectJWeixin(['sendChatMessage', 'shareAppMessage', 'shareWechatMessage']).then(() => { this.$dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType']) }) }) diff --git a/src/sass/AppAskForm/Result.vue b/src/sass/AppAskForm/Result.vue index 4da4bc8f..b2eb18da 100644 --- a/src/sass/AppAskForm/Result.vue +++ b/src/sass/AppAskForm/Result.vue @@ -40,7 +40,7 @@ export default { } }, mounted() { - this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact']) + this.injectJWeixin(['sendChatMessage']) }, methods: { ...mapActions(['injectJWeixin', 'wxInvoke']), diff --git a/src/sass/AppMeetingNotice/addMeeting.vue b/src/sass/AppMeetingNotice/addMeeting.vue index eb5bc848..56b577bf 100644 --- a/src/sass/AppMeetingNotice/addMeeting.vue +++ b/src/sass/AppMeetingNotice/addMeeting.vue @@ -159,16 +159,16 @@ export default { } }, methods: { - ...mapActions(['selectEnterpriseContact']), + ...mapActions(['selectPrivilegedContact']), handleSelectUser() { if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") this.clickedUserSelect = true - this.selectEnterpriseContact({ + this.selectPrivilegedContact({ fromDepartmentId: 0, - type: ["user"], - selectedUserIds: this.form.attendees?.map(e => e.id) + selectedOpenUserIds: this.form.attendees?.map(e => e.id) }).then(res => { this.change(res?.userList || []) + this.form.ticket = res?.selectedTicket || "" this.clickedUserSelect = false }).catch(() => { this.clickedUserSelect = false diff --git a/src/sass/AppNotification/add.vue b/src/sass/AppNotification/add.vue index 0bc718c0..a6e15e4a 100644 --- a/src/sass/AppNotification/add.vue +++ b/src/sass/AppNotification/add.vue @@ -105,16 +105,16 @@ export default { }, methods: { - ...mapActions(['selectEnterpriseContact']), + ...mapActions(['selectPrivilegedContact']), handleSelectUser() { if (this.clickedUserSelect) return this.$u.toast("正在打开人员选择器") this.clickedUserSelect = true - this.selectEnterpriseContact({ + this.selectPrivilegedContact({ fromDepartmentId: 0, - type: ["user"], - selectedUserIds: this.form.persons?.map(e => e.id) + selectedOpenUserIds: this.form.persons?.map(e => e.id) }).then(res => { this.form.persons = res?.userList || [] + this.form.ticket = res?.selectedTicket this.clickedUserSelect = false }).catch(() => { this.clickedUserSelect = false diff --git a/src/store/index.js b/src/store/index.js index 5813b384..57cd43b5 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -351,6 +351,27 @@ const store = new Vuex.Store({ }) }) }, + selectPrivilegedContact(state, params) { + return new Promise(resolve => { + state.dispatch("injectJWeixin", "selectPrivilegedContact").then(() => { + setTimeout(() => { + let sdk = typeof wx?.invoke == 'function' ? wx : jWeixin + sdk?.invoke("selectEnterpriseContact", { + fromDepartmentId: -1, + mode: "multi", + ...params + }, res => { + if (res.err_msg == "selectPrivilegedContact:ok") { + if (typeof res.result == 'string') { + res.result = JSON.parse(res.result) + } + resolve(res.result) + } + }) + }, 500) + }) + }) + }, }, getters: { getDict: state => key => {