From 8a43166243284277be998a14283559c0d2ce19a8 Mon Sep 17 00:00:00 2001 From: liuye Date: Tue, 14 Jun 2022 11:07:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AiPagePicker.vue | 1 + src/components/pages/selectDept.vue | 175 ++++++++++++++++++ .../AppMessageNotification.vue | 85 ++++++--- .../{SelectUser.vue => chooseUser.vue} | 133 ++++++++----- .../components/img/xz.png | Bin 0 -> 1489 bytes .../components/img/xzh.png | Bin 0 -> 1730 bytes 6 files changed, 328 insertions(+), 66 deletions(-) create mode 100644 src/components/pages/selectDept.vue rename src/project/police/AppMessageNotification/{SelectUser.vue => chooseUser.vue} (60%) create mode 100644 src/project/police/AppMessageNotification/components/img/xz.png create mode 100644 src/project/police/AppMessageNotification/components/img/xzh.png diff --git a/src/components/AiPagePicker.vue b/src/components/AiPagePicker.vue index e8b764c9..78c6e241 100644 --- a/src/components/AiPagePicker.vue +++ b/src/components/AiPagePicker.vue @@ -32,6 +32,7 @@ export default { sysUser: {url: "/components/pages/selectSysUser", label: "name"}, gird: {url: "/components/pages/selectGird", label: "girdName"}, party: {url: "/components/pages/selectParty", label: "name"}, + dept: {url: "/components/pages/selectDept", label: "name"}, custom: {...this.ops} }, } diff --git a/src/components/pages/selectDept.vue b/src/components/pages/selectDept.vue new file mode 100644 index 00000000..11c8b41e --- /dev/null +++ b/src/components/pages/selectDept.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/project/police/AppMessageNotification/AppMessageNotification.vue b/src/project/police/AppMessageNotification/AppMessageNotification.vue index d58a30e8..703ae5cb 100644 --- a/src/project/police/AppMessageNotification/AppMessageNotification.vue +++ b/src/project/police/AppMessageNotification/AppMessageNotification.vue @@ -9,7 +9,7 @@
用户选择
- 全部 + 全部 已选择 @@ -39,24 +39,24 @@
{{ form.content.length }}/1000
-
+
-
+

图片

- +
-
+

视频

- +
-
+

附件

- +
@@ -144,6 +144,9 @@ export default { sendTime: '' }, formData: { + fileListImg: [], + fileListVideo: [], + fileListFile: [], fileList: [], imgList: [], accessImgurl: '', @@ -155,6 +158,8 @@ export default { }, areaIdList: [], tagIdList: [], + deptList: [], + userList: [], timeShow: false, timeParams: { year: true, @@ -164,19 +169,20 @@ export default { minute: true, second: true }, - fileData: null + fileDataImg: null, + fileDataVideo: null, + fileDataFile: null } }, computed: {...mapState(['user'])}, methods: { radioChange(e) { - this.formDataInit() - this.$nextTick(() => { - this.form.contentType = e - }) + // this.$nextTick(() => { + // this.form.contentType = e + // }) }, toSelect() { - uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`}) + uni.navigateTo({url: `./chooseUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}&deptList=${this.deptList}&userList=${this.userList}`}) }, timeSelect(e) { var nowTime = new Date().getTime() * 1 @@ -192,6 +198,7 @@ export default { // if(!this.areaIdList.length) { // return this.$u.toast('请选择用户') // } + this.$loading() if(this.form.sendType == 1 && !this.form.sendTime) { return this.$u.toast('请选择群发时间') } @@ -207,16 +214,48 @@ export default { if(this.form.contentType == 'file' && !this.formData.fileList.length) { return this.$u.toast('请上传文件') } - if(this.formData.fileList.length) { - this.formData.file = this.formData.fileList[0] - this.formData.accessUrl = this.formData.fileList[0].url - this.formData.mediaId = this.fileData.media.mediaId + this.formData.fileList = [] + var contentFile = { + content: this.form.content, + contentType: 'text' + } + // if(this.formData.fileList.length) { + // this.formData.file = this.formData.fileList[0] + // this.formData.accessUrl = this.formData.fileList[0].url + // this.formData.mediaId = this.fileData.media.mediaId + // } + this.formData.fileList.push(contentFile) + if(this.formData.fileListImg.length) { + var info = { + contentType: 'image', + mediaId: this.fileDataImg.media.mediaId, + accessUrl: this.formData.fileListImg[0].url + } + this.formData.fileList.push(info) + } + if(this.formData.fileListVideo.length) { + var info = { + contentType: 'video', + mediaId: this.fileDataVideo.media.mediaId, + accessUrl: this.formData.fileListVideo[0].url + } + this.formData.fileList.push(info) + } + if(this.formData.fileListFile.length) { + var info = { + contentType: 'file', + mediaId: this.fileDataFile.media.mediaId, + accessUrl: this.formData.fileListFile[0].url + } + this.formData.fileList.push(info) } var params = { ...this.form, ...this.formData, areaId: this.areaIdList.join(','), tag: this.tagIdList.join(','), + deptList: this.deptList, + userList: this.userList } this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => { if (res?.code == 0) { @@ -241,9 +280,9 @@ export default { for(let key in this.formData) { this.formData[key] = '' } - this.formData.imgList = [] - this.formData.fileList = [] - this.formData.file = {} + this.formData.fileListImg = [] + this.formData.fileListVideo = [] + this.formData.fileListFile = [] }, back() { uni.navigateBack() @@ -255,6 +294,8 @@ export default { uni.$on('selectTag', res => { this.tagIdList = res.tagIdList this.areaIdList = res.areaIdList + this.deptList = res.deptList + this.userList = res.userList }) }, } diff --git a/src/project/police/AppMessageNotification/SelectUser.vue b/src/project/police/AppMessageNotification/chooseUser.vue similarity index 60% rename from src/project/police/AppMessageNotification/SelectUser.vue rename to src/project/police/AppMessageNotification/chooseUser.vue index a9df4744..a34b7ddc 100644 --- a/src/project/police/AppMessageNotification/SelectUser.vue +++ b/src/project/police/AppMessageNotification/chooseUser.vue @@ -1,40 +1,36 @@