From 748c466f53ff5062cf3c1fbdc7ead627a9c42e7e Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Fri, 31 Dec 2021 15:03:36 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E4=BA=8B=E9=A1=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B0=81=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityService/dqfwzx/cpts/edit.vue | 238 +++++++++++++----- 1 file changed, 176 insertions(+), 62 deletions(-) diff --git a/src/views/modules/communityService/dqfwzx/cpts/edit.vue b/src/views/modules/communityService/dqfwzx/cpts/edit.vue index 74772f22..90ebcff9 100644 --- a/src/views/modules/communityService/dqfwzx/cpts/edit.vue +++ b/src/views/modules/communityService/dqfwzx/cpts/edit.vue @@ -173,67 +173,95 @@ :key="'staff' + index" v-for="(item, index) in dataForm.matterList" > - - - - + + + - - - - - - - - - - 删除 + + + + + + + + + + +
+ + + + + +
(事项封面,图片小于1M)
+ + 删除 +
- 添加 + 添加
@@ -266,6 +294,9 @@ let loading; // 加载动画 export default { data() { return { + uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2", + customerId: "", + formType: "add", //表单操作类型 add新增,edit编辑,detail详情 btnDisable: false, @@ -342,14 +373,39 @@ export default { watch: {}, async mounted() { + this.customerId = localStorage.getItem("customerId"); this.initMap(); }, methods: { + handleImgSuccess(index, res, file) { + if (res.code === 0 && res.msg === "success") { + console.log("res.data.url", res.data.url); + this.dataForm.matterList[index].matterImg = res.data.url; + } else { + this.$message.error(res.msg); + } + }, + + beforeImgUpload(file) { + const isLt1M = file.size / 1024 / 1024 < 1; + + if (!isLt1M) { + this.$message.error("上传图片大小不能超过 1MB!"); + } + return isLt1M; + }, + handleAddStaff() { this.dataForm.matterList = [ ...this.dataForm.matterList, - { matterName: "", appointmentType: "", startTime: "", endTime: "" }, + { + matterName: "", + appointmentType: "", + matterImg: "", + startTime: "", + endTime: "", + }, ]; }, handleDelStaff(index) { @@ -482,9 +538,28 @@ export default { this.dataForm.partyServiceCenterId = this.partyServiceCenterId; } + const matterList = this.dataForm.matterList.filter( + (item) => !item.matterId + ); + if ( + matterList.some( + (item) => + !item.matterImg || + !item.matterName || + !item.appointmentType || + !item.startTime || + !item.endTime + ) + ) { + return this.$message({ + type: "warning", + message: "请补充完整可预约事项信息", + }); + } + const { data, code, msg } = await requestPost(url, { ...this.dataForm, - matterList: this.dataForm.matterList.filter((item) => !item.matterId), + matterList, }); if (code === 0) { @@ -580,9 +655,48 @@ export default { width: 650px; .item { - display: flex; - justify-content: space-around; - margin-bottom: 7px; + .item-info { + display: flex; + justify-content: space-around; + margin-bottom: 7px; + } + .item-pic { + display: flex; + align-items: center; + .hint { + font-size: 14px; + color: #999999; + margin-left: 10px; + } + .avatar-uploader { + ::v-deep .el-upload { + cursor: pointer; + position: relative; + overflow: hidden; + } + img { + object-fit: cover; + } + .el-upload:hover { + border-color: #409eff; + } + .avatar { + width: 50px; + height: 50px; + display: block; + } + .avatar-uploader-icon { + border: 1px dashed #d9d9d9; + border-radius: 6px; + font-size: 28px; + color: #8c939d; + width: 50px; + height: 50px; + line-height: 50px; + text-align: center; + } + } + } } .item-add { } From 4fb93fa5a6436eea02610c6025d3e8f1980a3668 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 5 Jan 2022 09:24:29 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E5=B8=83?= =?UTF-8?q?=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/visual/distributionAnalyze.scss | 10 ++-- .../communityGovern/distributionAnalyze.vue | 49 ++++++++++--------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/assets/scss/modules/visual/distributionAnalyze.scss b/src/assets/scss/modules/visual/distributionAnalyze.scss index 438c0e30..c02c6b55 100644 --- a/src/assets/scss/modules/visual/distributionAnalyze.scss +++ b/src/assets/scss/modules/visual/distributionAnalyze.scss @@ -28,7 +28,7 @@ display: block; display: flex; align-items: center; - margin-top: 20px; + .second-title-label { position: relative; padding-left: 40px; @@ -117,11 +117,11 @@ flex-direction: row; // flex-wrap: wrap; justify-content: space-between; - height: calc(100vh - 230px); + height: calc(100vh - 190px); .g-l { width: 40%; - height: calc(100vh - 240px); + height: calc(100vh - 200px); .echart-line { margin-left: 30px; @@ -140,11 +140,11 @@ .g-r { width: 55%; - height: calc(100vh - 250px); + height: calc(100vh - 210px); .r-map { position: relative; - height: calc(100vh - 250px - 50px); + height: calc(100vh - 210px - 50px); width: 100%; .map { diff --git a/src/views/modules/visual/communityGovern/distributionAnalyze.vue b/src/views/modules/visual/communityGovern/distributionAnalyze.vue index 1ffc5d06..5110fe98 100644 --- a/src/views/modules/visual/communityGovern/distributionAnalyze.vue +++ b/src/views/modules/visual/communityGovern/distributionAnalyze.vue @@ -4,31 +4,32 @@
项目分布分析 -
-
-
不同事件类别在不同时间段的变化和分布
-
- - -
-
- - +
+ +
+ + +
+
+ + + +
From 49e60cfd525fd461adfa9b9e2be4c14497bfa02a Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 5 Jan 2022 10:47:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/visual/distributionAnalyze.scss | 9 + .../communityGovern/distributionAnalyze.vue | 173 +++++++++++------- 2 files changed, 111 insertions(+), 71 deletions(-) diff --git a/src/assets/scss/modules/visual/distributionAnalyze.scss b/src/assets/scss/modules/visual/distributionAnalyze.scss index c02c6b55..e341f70f 100644 --- a/src/assets/scss/modules/visual/distributionAnalyze.scss +++ b/src/assets/scss/modules/visual/distributionAnalyze.scss @@ -135,6 +135,15 @@ width: 100%; height: 90%; } + + > img { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + } } } diff --git a/src/views/modules/visual/communityGovern/distributionAnalyze.vue b/src/views/modules/visual/communityGovern/distributionAnalyze.vue index 5110fe98..b2ef7685 100644 --- a/src/views/modules/visual/communityGovern/distributionAnalyze.vue +++ b/src/views/modules/visual/communityGovern/distributionAnalyze.vue @@ -37,19 +37,21 @@
- +
+ +
@@ -209,6 +211,7 @@ export default { await this.getAgencylist()//获取组织级别 await nextTick(500) await this.loadOrgData() + await this.getApiData(); }, @@ -238,6 +241,15 @@ export default { if (month2 < 10) { month2 = '0' + month2; } + if (month < 10) { + month = '0' + month; + } + if (day < 10) { + day = '0' + day; + } + if (day2 < 10) { + day2 = '0' + day2; + } var t2 = year2 + '-' + month2 + '-' + day2; var t1 = year + '-' + month + '-' + day; // let t3 = formate(t2, style); @@ -251,9 +263,19 @@ export default { }, async getApiData () { - - await this.getLine() + await this.getLineChart() await this.loadMapData(); + + this.assignData() + }, + + assignData () { + if (!this.showNoData) { + this.getLine() + } + + this.loadMap() + this.isfirstInit = false }, // 获取当前登录人员信息及组织信息 @@ -352,17 +374,17 @@ export default { if (code === 0) { this.legendArray = [] - if (data.under) { + if (data.under === 0 || data.under) { this.under = data.under this.legendArray.push( { color: this.colorArray[0], - name: data.under + '以下' + name: data.under + '及以下' } ) } - if (data.above) { + if (data.above === 0 || data.above) { this.above = data.above this.legendArray.push( { @@ -373,7 +395,7 @@ export default { this.legendArray.push( { color: this.colorArray[2], - name: data.above + '以上' + name: data.above + '及以上' } ) } @@ -394,12 +416,12 @@ export default { item.latitude = agencyItem.latitude item.coordinates = agencyItem.coordinates - if (this.under) { + if (this.under === 0 || this.under) { if (item.count < this.under || item.count === this.under) { item.color = this.colorArray[0] item.fillColor = this.colorFillArray[0] } else { - if (this.above) { + if (this.above === 0 || this.above) { if (item.count > this.under && item.count < this.above) { item.color = this.colorArray[1] item.fillColor = this.colorFillArray[1] @@ -410,7 +432,6 @@ export default { } } - } break } @@ -420,8 +441,7 @@ export default { }); console.log(this.mapList) - this.loadMap() - this.isfirstInit = false + } else { this.$message.error(msg); @@ -446,7 +466,7 @@ export default { }, getLine () { if (this.lineInitState) { - this.getLineChart() + this.assignLineChart() } else { setTimeout(() => { this.getLine() @@ -455,9 +475,13 @@ export default { }, // 获取折线图 async getLineChart () { - this.$refs.lineChart.clear() + if (!this.showNoData) { + this.$refs.lineChart.clear() + this.$refs.lineChart.showLoading() + } + const _that = this - this.$refs.lineChart.showLoading() + const url = "/gov/project/project/projectdistributionanalysisleft"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft"; let params = { @@ -467,28 +491,20 @@ export default { }; const { data, code, msg } = await requestPost(url, params); - this.$refs.lineChart.hideLoading() + if (!this.showNoData) { + this.$refs.lineChart.hideLoading() + } if (code === 0) { - // 获取pieChart配置 - this.lineOption = lineOption() if (data && data.length > 0) { this.lineList = data - this.loadCategoryData() - - - - this.$refs.lineChart.setOption(this.lineOption, true) - this.$refs.lineChart.setOption({ - xAxis: { data: this.xaxis }, - legend: { data: this.legend }, - series: this.series - }, true) + this.showNoData = false } else { this.lineList = [] + this.showNoData = true } - + this.loadCategoryData() } else { this.$message.error(msg); @@ -496,60 +512,75 @@ export default { }, + assignLineChart () { + // 获取pieChart配置 + this.lineOption = lineOption() + + this.$refs.lineChart.setOption(this.lineOption, true) + this.$refs.lineChart.setOption({ + xAxis: { data: this.xaxis }, + legend: { data: this.legend }, + series: this.series + }, true) + }, + //解析折线图数据 loadCategoryData () { this.xaxis = [] this.series = [] this.legend = [] - let num = this.lineList[0].categoryList.length - - let dataArray = new Array(num) - //遍历每个分类 - this.lineList[0].categoryList.forEach((categoryItem, index) => { - this.legend.push(categoryItem.categoryName) - dataArray[index] = [] - - }); + if (this.lineList.length > 0) { - //遍历每个时间 - this.lineList.forEach(item => { - this.xaxis.push(item.time) + let num = this.lineList[0].categoryList.length + let dataArray = new Array(num) //遍历每个分类 - item.categoryList.forEach((categoryItem, index) => { - dataArray[index].push(categoryItem.count) + this.lineList[0].categoryList.forEach((categoryItem, index) => { + this.legend.push(categoryItem.categoryName) + dataArray[index] = [] + }); - }); - - //遍历第一组的分类 - this.lineList[0].categoryList.forEach((categoryItem, index) => { - - let object = { - name: categoryItem.categoryName, - type: 'line', - smooth: true, - barWidth: 15, - areaStyle: {}, - itemStyle: { - color: new echarts.graphic.LinearGradient( - 0, 1, 0, 0, - [ - { offset: 0, color: 'rgba(121, 55, 255, 0)' }, - { offset: 1, color: categoryItem.color } - ] - ) - }, - data: dataArray[index] - } - this.series.push(object) + //遍历每个时间 + this.lineList.forEach(item => { + this.xaxis.push(item.time) + //遍历每个分类 + item.categoryList.forEach((categoryItem, index) => { + dataArray[index].push(categoryItem.count) + }); - }); + }); + + //遍历第一组的分类 + this.lineList[0].categoryList.forEach((categoryItem, index) => { + + let object = { + name: categoryItem.categoryName, + type: 'line', + smooth: true, + barWidth: 15, + areaStyle: {}, + itemStyle: { + color: new echarts.graphic.LinearGradient( + 0, 1, 0, 0, + [ + { offset: 0, color: 'rgba(121, 55, 255, 0)' }, + { offset: 1, color: categoryItem.color } + ] + ) + }, + data: dataArray[index] + } + this.series.push(object) + + + }); + } }, handleChangeAgency (value) { From 5787640869df6ab4c9d8f6690f63afee486258b7 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Thu, 6 Jan 2022 13:29:54 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityParty/regionalParty/activitys.vue | 14 +++++++++++++- .../communityParty/regionalParty/activitysForm.vue | 13 ++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/views/modules/communityParty/regionalParty/activitys.vue b/src/views/modules/communityParty/regionalParty/activitys.vue index 1638a07c..18f9d315 100644 --- a/src/views/modules/communityParty/regionalParty/activitys.vue +++ b/src/views/modules/communityParty/regionalParty/activitys.vue @@ -148,6 +148,16 @@ label="活动时间" width="230"> + + + 查看 - 修改 @@ -199,6 +210,7 @@ @dialogCancle="addFormCancle" @dialogOk="addFormOk"> +