From a5bc5689a358eba0d5b62a18b04f5d36d09383c6 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Mon, 18 Jul 2022 17:14:58 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AE=A3=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Announce/AppAnnounce/components/Add.vue | 246 ++++++++++++++---- .../Announce/AppAnnounce/components/List.vue | 56 ++-- 2 files changed, 215 insertions(+), 87 deletions(-) diff --git a/project/sass/apps/Announce/AppAnnounce/components/Add.vue b/project/sass/apps/Announce/AppAnnounce/components/Add.vue index e5b13b0f..5a5d0a9f 100644 --- a/project/sass/apps/Announce/AppAnnounce/components/Add.vue +++ b/project/sass/apps/Announce/AppAnnounce/components/Add.vue @@ -11,13 +11,13 @@ -
+
+ + +
+ +
+
@@ -110,31 +154,20 @@ }, data () { - const validatorPhone = function (rule, value, callback) { - if (value === '') { - callback(new Error('请输入手机号')) - } else if (!/^1\d{10}$/.test(value)) { - callback(new Error('手机号格式错误')) - } else { - callback() - } - } return { info: {}, department: [], - validatorPhone: validatorPhone, + fileList: [], form: { - position: '', + choiceTime: '', + contents: {}, + enableExamine: '0', + examines: [], + wxGroups: [], + sendScope: '0', + sendType: 0, name: '', - email: '', - telephone: '', - gender: '', - mobile: '', - departmentName: '', - departmentIds: [], - tagIds: [], - id: '', - status: false + taskTitle: '' }, id: '', tagsList: [] @@ -173,6 +206,64 @@ }) }, + removeFile (index) { + this.fileList.splice(index, 1) + }, + + mapIcon (type) { + return { + image: 'https://cdn.cunwuyun.cn/dvcp/announce/img.png', + video: 'https://cdn.cunwuyun.cn/dvcp/announce/video.png', + folder: 'https://cdn.cunwuyun.cn/dvcp/announce/folder.png', + site: 'https://cdn.cunwuyun.cn/dvcp/announce/site.png', + miniapp: 'https://cdn.cunwuyun.cn/dvcp/announce/miniapp.png' + }[type] + }, + + onBeforeUpload(event) { + return this.onOverSize(event) + }, + + getExtension(name) { + return name.substring(name.lastIndexOf('.')) + }, + + handleChange (e, size, accept) { + const isLt10M = e.size / 1024 / 1024 < size + const suffixName = this.getExtension(e.name) + const suffixNameList = accept.split(',') + + if (suffixNameList.indexOf(`${suffixName.toLowerCase()}`) === -1) { + this.$message.error(`不支持该格式`) + return false + } + + if (!isLt10M) { + this.$message.error(`大小不超过${10}MB!`) + return false + } + + return true + }, + + submitUpload (file, type) { + let formData = new FormData() + formData.append('file', file.file) + formData.append('type', type) + this.instance.post(`/app/wxcp/upload/uploadFile`, formData, { + withCredentials: false + }).then(res => { + if (res.code == 0) { + this.fileList.push({ + ...res.data.file, + media: res.data.media + }) + + this.$message.success('上传成功') + } + }) + }, + onChange (e) { if (e.length) { this.form.departmentIds = e.map(v => v.id) @@ -304,6 +395,35 @@ font-size: 14px; } } + + .fileList { + margin-bottom: 12px; + + .add-item { + justify-content: space-between; + margin-bottom: 8px; + + .left { + display: flex; + align-items: center; + } + + i { + font-size: 14px; + cursor: pointer; + font-style: normal; + color: red; + + &:hover { + opacity: 0.6; + } + } + + &:last-child { + margin-bottom: 0; + } + } + } } .AppAnnounceDetail-container { @@ -321,10 +441,26 @@ .right { position: sticky; top: 0; - width: 400px; - height: 688px; - background: url(https://cdn.cunwuyun.cn/dvcp/announce/phone.png); - background-size: 400px 100%; + width: 338px; + height: 675px; + + .phone { + position: absolute; + left: 14px; + top: 14px; + z-index: 1; + width: 310px; + height: 647px; + } + + .phone-wrapper { + position: absolute; + left: 0; + top: 0; + z-index: 2; + width: 338px; + height: 675px; + } } } @@ -340,7 +476,7 @@ } i { - color: #c0c9db; + color: #8899bb; } em { diff --git a/project/sass/apps/Announce/AppAnnounce/components/List.vue b/project/sass/apps/Announce/AppAnnounce/components/List.vue index 962bec08..038f1507 100644 --- a/project/sass/apps/Announce/AppAnnounce/components/List.vue +++ b/project/sass/apps/Announce/AppAnnounce/components/List.vue @@ -12,32 +12,34 @@ @@ -86,20 +88,21 @@ export default { search: { current: 1, size: 10, - name: '', - startDate: '', - endDate: '' + status: '', + taskTitle: '', + startTime: '', + endTime: '' }, tableData: [], loading: false, total: 0, colConfigs: [ - { prop: 'position', label: '任务名称' }, - { prop: 'mobile', label: '群发类型' }, - { prop: 'position', label: '创建人' }, - { prop: 'mobile', label: '群发时间' }, - { prop: 'position', label: '状态' }, - { prop: 'mobile', label: '任务完成率' } + { prop: 'taskTitle', label: '任务名称' }, + { prop: 'sendType', label: '群发类型', formart: v => v === '0' ? '立即发送' : '定时发送', align: 'center' }, + { prop: 'createUserId', label: '创建人', openType: 'userName', align: 'center' }, + { prop: 'createTime', label: '群发时间', align: 'center' }, + { prop: 'status', label: '状态', formart: v => this.dict.getLabel('mstStatus', v), align: 'center' }, + { prop: 'completionRate', label: '任务完成率', align: 'center' } ] } }, @@ -108,29 +111,18 @@ export default { ...mapState(['user']) }, - created() { - this.getList() + created () { + this.dict.load('mstStatus', 'mstSendType').then(() => { + this.getList() + }) }, methods: { - removeDepart(id, parentid) { - this.$confirm('确定删除该数据?').then(() => { - this.instance.post(`/app/wxcp/wxdepartment/delete?id=${id}`).then(res => { - if (res.code == 0) { - this.defaultChecked = [parentid] - this.$message.success('删除成功!') - this.getTree() - } - }) - }) - }, - getList() { this.loading = true - this.instance.post(`/app/wxcp/wxuser/list`, null, { + this.instance.post(`/app/appmasssendingtask/list`, null, { params: { ...this.search, - departmentId: this.tabIndex === 0 ? this.search.departmentId : '' } }).then(res => { if (res.code == 0) { @@ -151,7 +143,7 @@ export default { remove(id) { this.$confirm('确定删除该数据?').then(() => { - this.instance.post(`/app/wxcp/wxuser/delete?id=${id}`).then(res => { + this.instance.post(`/app/appmasssendingtask/delete?ids=${id}`).then(res => { if (res.code == 0) { this.$message.success('删除成功!') this.getList() From 4b67e33ae9a4e2e1151979b66bb85f01ed18d496 Mon Sep 17 00:00:00 2001 From: liuye Date: Tue, 19 Jul 2022 09:43:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppAnnounceStatistics.vue | 69 ++++++++++++++----- 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/project/sass/apps/Announce/AppAnnounceStatistics/AppAnnounceStatistics.vue b/project/sass/apps/Announce/AppAnnounceStatistics/AppAnnounceStatistics.vue index 82bec521..aed0a879 100644 --- a/project/sass/apps/Announce/AppAnnounceStatistics/AppAnnounceStatistics.vue +++ b/project/sass/apps/Announce/AppAnnounceStatistics/AppAnnounceStatistics.vue @@ -100,6 +100,13 @@
+ + + + + 确认 + @@ -132,7 +139,8 @@ dateTypeList: ['近7天', '近30天', '近1年', '自定义'], departData: {}, departBarChart: null, - + dialogDate: false, + timeList: '', type: '', } @@ -188,6 +196,22 @@ this.dict.load("mstSendType") }, methods: { + selectDete() { + console.log(this.timeList) + if(!this.timeList || !this.timeList.length) { + return this.$message.error('请选择自定义时间'); + } + + if(this.effectType == 3) { //宣发效果 + this.getEffect() + } + + if(this.departType == 3) { //宣发明细 + this.getDepart() + } + + this.dialogDate = false + }, searchMonthChange() { this.calendarDate = this.searchMonth + '-1' }, @@ -204,10 +228,16 @@ }, changeEffectType(type) { this.effectType = type - this.getEffect() + if(type == 3) { + this.dialogDate = true + this.timeList = [] + }else { + this.getEffect() + } }, getEffect() { - this.instance.post(`/app/appmasssendingtask/statisticsEffect?type=${this.effectType}`).then(res => { + var startTime = this.timeList[0] || '' , endTime = this.timeList[1] || '' + this.instance.post(`/app/appmasssendingtask/statisticsEffect?type=${this.effectType}&startTime=${startTime}&endTime=${endTime}`).then(res => { if (res.code == 0) { this.effectData = res.data var xData = [], createData = [], executeData = [], receiveData = [] @@ -259,10 +289,16 @@ }, changeDepartType(type) { this.departType = type - this.getDepart() + if(type == 3) { + this.dialogDate = true + this.timeList = [] + }else { + this.getDepart() + } }, - getDepart() { // ${this.departType} - this.instance.post(`/app/appmasssendingtask/statisticsDepart?type=1`).then(res => { + getDepart() { + var startTime = this.timeList[0] || '' , endTime = this.timeList[1] || '' + this.instance.post(`/app/appmasssendingtask/statisticsDepart?type=${this.departType}&startTime=${startTime}&endTime=${endTime}`).then(res => { if (res.code == 0) { // this.dateList = res.data // this.getTaskList(this.chooseDay) @@ -291,16 +327,16 @@ bottom: 90, containLabel: true }, - toolbox: { - feature: { - dataZoom: { - yAxisIndex: false - }, - saveAsImage: { - pixelRatio: 2 - } - } - }, + // toolbox: { + // feature: { + // dataZoom: { + // yAxisIndex: false + // }, + // saveAsImage: { + // pixelRatio: 2 + // } + // } + // }, tooltip: { trigger: 'axis', axisPointer: { @@ -501,6 +537,7 @@ border: 1px solid #D0D4DC; margin-right: 8px; box-sizing: border-box; + cursor: pointer; } .active{ border: 1px solid #26f; From 6d50374606b8548cfcb30a8ba731066fcc7fdc41 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Tue, 19 Jul 2022 10:02:54 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AE=A3=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Announce/AppAnnounce/components/Add.vue | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/project/sass/apps/Announce/AppAnnounce/components/Add.vue b/project/sass/apps/Announce/AppAnnounce/components/Add.vue index 5a5d0a9f..b70c0120 100644 --- a/project/sass/apps/Announce/AppAnnounce/components/Add.vue +++ b/project/sass/apps/Announce/AppAnnounce/components/Add.vue @@ -36,8 +36,8 @@ - - + +
@@ -88,10 +88,21 @@

视频

-
+ +
-

文件

-
+

文件

+
+

网页

@@ -159,8 +170,9 @@ department: [], fileList: [], form: { + content: '', choiceTime: '', - contents: {}, + contents: [], enableExamine: '0', examines: [], wxGroups: [], From 62f92569b3c75c891560fac7a665e3e301548ee2 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Tue, 19 Jul 2022 10:58:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=8D=8F=E5=90=8C=E5=AE=A3=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Announce/AppAnnounce/components/Add.vue | 97 ++++++++++++++++--- 1 file changed, 81 insertions(+), 16 deletions(-) diff --git a/project/sass/apps/Announce/AppAnnounce/components/Add.vue b/project/sass/apps/Announce/AppAnnounce/components/Add.vue index b70c0120..4d8901f2 100644 --- a/project/sass/apps/Announce/AppAnnounce/components/Add.vue +++ b/project/sass/apps/Announce/AppAnnounce/components/Add.vue @@ -42,7 +42,7 @@
- + {{ item.name }}
删除 @@ -67,7 +67,7 @@ :limit="9" action="/app/wxcp/upload/uploadFile" accept=".jpg,.png,.jpeg" - :http-request="v => submitUpload(v, 'image')"> + :http-request="v => submitUpload(v, '1')">

图片

@@ -82,7 +82,7 @@ :limit="9" action="/app/wxcp/upload/uploadFile" accept=".mp4" - :http-request="v => submitUpload(v, 'video')"> + :http-request="v => submitUpload(v, '2')">

视频

@@ -97,13 +97,13 @@ :limit="9" action="/app/wxcp/upload/uploadFile" accept=".zip、.rar、.doc、.docx、.xls、.xlsx、.ppt、.pptx、.pdf、.txt" - :http-request="v => submitUpload(v, 'file')"> + :http-request="v => submitUpload(v, '3')">

文件

-
+

网页

@@ -144,6 +144,41 @@
+ + +
+ + + + + + + + + + + + + + + +
+
+