Browse Source

Merge branch 'dev-shuju' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-shuju

shibei_prod
13176889840 4 years ago
parent
commit
ee085a1dc7
  1. 19
      src/assets/scss/modules/visual/distributionAnalyze.scss
  2. 67
      src/js/dai/request.js
  3. 14
      src/views/modules/communityParty/regionalParty/activitys.vue
  4. 13
      src/views/modules/communityParty/regionalParty/activitysForm.vue
  5. 19
      src/views/modules/communityService/dqfwzx/cpts/edit.vue
  6. 10
      src/views/modules/communityService/dqfwzx/cpts/order.vue
  7. 37
      src/views/modules/communityService/dqfwzx/index.vue
  8. 4
      src/views/modules/communityService/shzz/cpts/edit.vue
  9. 25
      src/views/modules/communityService/shzz/index.vue
  10. 7
      src/views/modules/communityService/sqzzz/cpts/edit.vue
  11. 25
      src/views/modules/communityService/sqzzz/index.vue
  12. 222
      src/views/modules/visual/communityGovern/distributionAnalyze.vue
  13. 12
      src/views/modules/visual/warning/components/screen-table/index.vue

19
src/assets/scss/modules/visual/distributionAnalyze.scss

@ -28,7 +28,7 @@
display: block; display: block;
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 20px;
.second-title-label { .second-title-label {
position: relative; position: relative;
padding-left: 40px; padding-left: 40px;
@ -117,11 +117,11 @@
flex-direction: row; flex-direction: row;
// flex-wrap: wrap; // flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
height: calc(100vh - 230px); height: calc(100vh - 190px);
.g-l { .g-l {
width: 40%; width: 40%;
height: calc(100vh - 240px); height: calc(100vh - 200px);
.echart-line { .echart-line {
margin-left: 30px; margin-left: 30px;
@ -135,16 +135,25 @@
width: 100%; width: 100%;
height: 90%; height: 90%;
} }
> img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
} }
} }
.g-r { .g-r {
width: 55%; width: 55%;
height: calc(100vh - 250px); height: calc(100vh - 210px);
.r-map { .r-map {
position: relative; position: relative;
height: calc(100vh - 250px - 50px); height: calc(100vh - 210px - 50px);
width: 100%; width: 100%;
.map { .map {

67
src/js/dai/request.js

@ -1,87 +1,90 @@
/*--------------------------------------------------------------- /*---------------------------------------------------------------
| 请求接口封装 | | 请求接口封装 |
---------------------------------------------------------------*/ ---------------------------------------------------------------*/
import axios from 'axios' import axios from "axios";
import log from 'dai-js/modules/log' import message from "dai-js/modules/message/message";
import curry from 'dai-js/tools/curry' import curry from "dai-js/tools/curry";
const request = curry( const request = curry(
(method, url, data = {}, headers = {}, progress = () => {}) => { (method, url, data = {}, headers = {}, progress = () => {}) => {
return new Promise((reslove) => { return new Promise((reslove) => {
let returnIniData = { let returnIniData = {
httpCode: '', httpCode: "",
data: {}, data: {},
msg: '', msg: "",
code: '' code: "",
} };
// 添加服务器端URL // 添加服务器端URL
function processUrl(url) { function processUrl(url) {
if (url.indexOf('http://') > -1 || url.indexOf('https://') > -1) { if (url.indexOf("http://") > -1 || url.indexOf("https://") > -1) {
return url return url;
} }
return process.env.VUE_APP_API_SERVER + url return process.env.VUE_APP_API_SERVER + url;
} }
url = processUrl(url) url = processUrl(url);
const succFn = (res) => { const succFn = (res) => {
// log(`[request成功] ${url}`, data, res); // log(`[request成功] ${url}`, data, res);
let retData = { let retData = {
...returnIniData, ...returnIniData,
...res.data, ...res.data,
httpCode: res.statusCode httpCode: res.statusCode,
} };
// if(typeof Vue.$afterRequestHook == 'function'){ // if(typeof Vue.$afterRequestHook == 'function'){
// retData = Vue.$afterRequestHook(retData); // retData = Vue.$afterRequestHook(retData);
// } // }
if (res.data.code > 8000 && res.data.code < 10000) {
message.error(res.data.msg);
}
reslove(retData) reslove(retData);
} };
const failFn = (err) => { const failFn = (err) => {
// log(`[request失败] ${url}`, data, err); // log(`[request失败] ${url}`, data, err);
reslove( reslove(
Object.assign({}, returnIniData, { Object.assign({}, returnIniData, {
httpCode: '9999', //访问出现意外 httpCode: "9999", //访问出现意外
msg: '网络错误' msg: "网络错误",
}) })
) );
} };
if (method.toUpperCase() == 'POST') { if (method.toUpperCase() == "POST") {
axios axios
.post(url, data, { .post(url, data, {
headers, headers,
responseType: 'json' responseType: "json",
// progress, // progress,
// credentials: false, // credentials: false,
}) })
.then(succFn) .then(succFn)
.catch(failFn) .catch(failFn);
} else { } else {
axios axios
.get(url, { .get(url, {
params: data, params: data,
headers, headers,
responseType: 'json' responseType: "json",
// credentials: true, // credentials: true,
}) })
.then(succFn) .then(succFn)
.catch(failFn) .catch(failFn);
} }
}) });
} }
) );
export const requestGet = request('get') export const requestGet = request("get");
export const requestPost = request('post') export const requestPost = request("post");
export default { export default {
install(Vue) { install(Vue) {
Vue.prototype.$requestGet = requestGet Vue.prototype.$requestGet = requestGet;
Vue.prototype.$requestPost = requestPost Vue.prototype.$requestPost = requestPost;
} },
} };

14
src/views/modules/communityParty/regionalParty/activitys.vue

@ -148,6 +148,16 @@
label="活动时间" label="活动时间"
width="230"> width="230">
</el-table-column> </el-table-column>
<el-table-column prop="activityTime"
header-align="center"
align="center"
label="来源"
width="100">
<template slot-scope="scope">
<span v-if="scope.row.actId">小程序</span>
<span v-else>管理平台</span>
</template>
</el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
@ -161,7 +171,8 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="!scope.row.actId"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
@ -199,6 +210,7 @@
@dialogCancle="addFormCancle" @dialogCancle="addFormCancle"
@dialogOk="addFormOk"></activitys-form> @dialogOk="addFormOk"></activitys-form>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="detailShow" <el-dialog :visible.sync="detailShow"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"

13
src/views/modules/communityParty/regionalParty/activitysForm.vue

@ -244,6 +244,8 @@ export default {
} }
this.endLoading() this.endLoading()
}, },
// //
@ -258,7 +260,16 @@ export default {
if (code === 0) { if (code === 0) {
this.formData = data this.formData = data
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) console.log(this.formData.content)
let style_img = "style='width:50px;height:40px;' "
if (this.formData.content) {
this.formData.content = this.formData.content.replace(/<img/g, "<img style='width:200px;height:120px;'")
// let array=this.formData.content.split('<img')
}
console.log(this.formData.content)
map.setCenter(new TMap.LatLng(parseFloat(this.formData.latitude), parseFloat(this.formData.longitude)))
this.setMarker(this.formData.latitude, this.formData.longitude) this.setMarker(this.formData.latitude, this.formData.longitude)
} else { } else {
this.$message.error(msg) this.$message.error(msg)

19
src/views/modules/communityService/dqfwzx/cpts/edit.vue

@ -408,18 +408,31 @@ export default {
}, },
]; ];
}, },
handleDelStaff(index) { async handleDelStaff(index) {
const { matterList } = this.dataForm; const { matterList } = this.dataForm;
let delItem = matterList.splice(index, 1); let list = [...matterList];
let delItem = list.splice(index, 1);
console.log(delItem); console.log(delItem);
if (delItem[0].matterId) { if (delItem[0].matterId) {
if (!confirm("删除后无法恢复,确认删除?"))
return console.log("不删了");
if (!(await this.delStaff(delItem[0].matterId))) return;
this.dataForm.delMatterList = [ this.dataForm.delMatterList = [
...this.dataForm.delMatterList, ...this.dataForm.delMatterList,
delItem[0].matterId, delItem[0].matterId,
]; ];
} }
this.dataForm.matterList = matterList; this.dataForm.matterList = list;
},
async delStaff(matterId) {
const { data, code, msg } = await requestPost(
"/gov/org/icpartyservicecenter/delmatter",
{
matterId,
}
);
return code === 0;
}, },
// init // init
initMap() { initMap() {

10
src/views/modules/communityService/dqfwzx/cpts/order.vue

@ -139,6 +139,7 @@ import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // Loading import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import dateFormat from "dai-js/tools/dateFormat"; import dateFormat from "dai-js/tools/dateFormat";
import formVltHelper from "dai-js/tools/formVltHelper";
const deepClone = function (arg) { const deepClone = function (arg) {
if (typeof arg == "object" || typeof arg == "array") { if (typeof arg == "object" || typeof arg == "array") {
@ -295,6 +296,9 @@ export default {
} }
console.log(list); console.log(list);
this.timeList = list; this.timeList = list;
this.dataForm.timeId = list
.filter((item) => item.selected && item.isAppointment)
.map((item) => item.timeId);
return false; return false;
}, },
@ -350,6 +354,12 @@ export default {
app.util.validateRule(messageObj); app.util.validateRule(messageObj);
this.btnDisable = false; this.btnDisable = false;
} else { } else {
if (!formVltHelper.userOrMobile(this.dataForm.appointmentPhone)) {
return this.$message({
type: "error",
message: "手机号格式有误",
});
}
this.submit(); this.submit();
} }
}); });

37
src/views/modules/communityService/dqfwzx/index.vue

@ -17,6 +17,13 @@
:key="'ct' + index" :key="'ct' + index"
v-for="(item, index) in tableData" v-for="(item, index) in tableData"
> >
<div
class="item-btn"
v-if="currentIndex == index"
@click="handleEdit"
>
修改
</div>
<div class="item-name">{{ item.centerName }}</div> <div class="item-name">{{ item.centerName }}</div>
<div class="item-prop"> <div class="item-prop">
<div class="prop-field">社区地址</div> <div class="prop-field">社区地址</div>
@ -38,11 +45,11 @@
</div> </div>
<div class="center-right"> <div class="center-right">
<div class="operate"> <!-- <div class="operate">
<el-button type="warning" size="small" @click="handleEdit" <el-button type="warning" size="small" @click="handleEdit"
>修改</el-button >修改</el-button
> >
</div> </div> -->
<div id="centerIndexApp" class="div_map"></div> <div id="centerIndexApp" class="div_map"></div>
@ -192,8 +199,6 @@ export default {
async mounted() { async mounted() {
await this.loadAgency(); await this.loadAgency();
await this.getTableData(); await this.getTableData();
this.initMap();
this.setMap();
}, },
methods: { methods: {
// init // init
@ -324,6 +329,7 @@ export default {
}, },
async getTableData() { async getTableData() {
const oldLen = this.tableData.length;
const url = "/gov/org/icpartyservicecenter/partyservicecenterlist"; const url = "/gov/org/icpartyservicecenter/partyservicecenterlist";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
orgId: this.agencyId, orgId: this.agencyId,
@ -333,7 +339,12 @@ export default {
console.log("列表请求成功!!!!!!!!!!!!!!"); console.log("列表请求成功!!!!!!!!!!!!!!");
this.tableData = data; this.tableData = data;
} else {
if (data.length > 0 && oldLen == 0) {
await nextTick(100);
this.initMap();
this.setMap();
}
} }
}, },
@ -367,6 +378,7 @@ export default {
width: 25%; width: 25%;
.list { .list {
.item { .item {
position: relative;
box-sizing: border-box; box-sizing: border-box;
margin-bottom: 10px; margin-bottom: 10px;
border: 2px solid #6aa; border: 2px solid #6aa;
@ -379,6 +391,21 @@ export default {
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0 0 10px #6aa; box-shadow: 0 0 10px #6aa;
} }
.item-btn {
position: absolute;
top: 5px;
right: 5px;
font-size: 14px;
color: rgb(235, 192, 4);
width: 50px;
line-height: 30px;
text-align: center;
cursor: pointer;
&:hover {
// text-decoration: underline;
color: rgb(250, 208, 23);
}
}
.item-name { .item-name {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;

4
src/views/modules/communityService/shzz/cpts/edit.vue

@ -345,7 +345,9 @@ export default {
if (row) { if (row) {
this.dataForm = { ...this.dataForm, ...row }; this.dataForm = { ...this.dataForm, ...row };
this.societyId = this.dataForm.societyId; this.societyId = this.dataForm.societyId;
map.setCenter(new TMap.LatLng(row.latitude, row.longitude)); if (row.latitude && row.longitude) {
map.setCenter(new TMap.LatLng(row.latitude, row.longitude));
}
} }
}, },

25
src/views/modules/communityService/shzz/index.vue

@ -284,31 +284,24 @@ export default {
url: window.SITE_CONFIG["apiURL"] + "/heart/societyorg/import", url: window.SITE_CONFIG["apiURL"] + "/heart/societyorg/import",
method: "post", method: "post",
data: formData, data: formData,
responseType: "blob", // responseType: "blob",
}) })
.then((res) => { .then((res) => {
this.importLoading = false; this.importLoading = false;
this.importBtnTitle = "excel导入"; this.importBtnTitle = "excel导入";
let fileName = window.decodeURI( console.log("resresresresresresres", res);
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
this.getTableData(); this.getTableData();
if (res.data.code == 0) {
return this.$message.success(res.data.data || '导入成功');
} else {
return this.$message.error(res.data.msg);
}
}) })
.catch((err) => { .catch((err) => {
console.log("失败", err); console.log("失败", err);
param.onError(); //
}); });
this.$refs.upload.clearFiles();
}, },
handleSizeChange(val) { handleSizeChange(val) {

7
src/views/modules/communityService/sqzzz/cpts/edit.vue

@ -209,6 +209,7 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // Loading import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import formVltHelper from "dai-js/tools/formVltHelper";
var map; var map;
var search; var search;
@ -389,6 +390,12 @@ export default {
app.util.validateRule(messageObj); app.util.validateRule(messageObj);
this.btnDisable = false; this.btnDisable = false;
} else { } else {
if (!formVltHelper.userOrMobile(this.dataForm.principalPhone)) {
return this.$message({
type: "error",
message: "手机号格式有误",
});
}
this.submit(); this.submit();
} }
}); });

25
src/views/modules/communityService/sqzzz/index.vue

@ -252,31 +252,24 @@ export default {
"/heart/iccommunityselforganization/importcommunityselforganization", "/heart/iccommunityselforganization/importcommunityselforganization",
method: "post", method: "post",
data: formData, data: formData,
responseType: "blob", // responseType: "blob",
}) })
.then((res) => { .then((res) => {
this.importLoading = false; this.importLoading = false;
this.importBtnTitle = "excel导入"; this.importBtnTitle = "excel导入";
let fileName = window.decodeURI( console.log("resresresresresresres", res);
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
this.getTableData(); this.getTableData();
if (res.data.code == 0) {
return this.$message.success(res.data.data || '导入成功');
} else {
return this.$message.error(res.data.msg);
}
}) })
.catch((err) => { .catch((err) => {
console.log("失败", err); console.log("失败", err);
param.onError(); //
}); });
this.$refs.upload.clearFiles();
}, },
handleSizeChange(val) { handleSizeChange(val) {

222
src/views/modules/visual/communityGovern/distributionAnalyze.vue

@ -4,31 +4,32 @@
<div class="card-title"> <div class="card-title">
<img src="@/assets/img/shuju/title-tip.png" /> <img src="@/assets/img/shuju/title-tip.png" />
<span>项目分布分析</span> <span>项目分布分析</span>
</div>
<div class="second-title">
<div class="second-title-label">不同事件类别在不同时间段的变化和分布</div>
<div class="second-select cascader">
<el-cascader class="customer_cascader"
ref="myCascader"
v-model="agencyIdArray"
:key="iscascaderShow"
:options="casOptions"
:props="optionProps"
:show-all-levels="false"
@change="handleChangeAgency"></el-cascader>
</div>
<div class="second-select">
<el-date-picker v-model="timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
prefix-icon="el-icon-caret-bottom"
value-format="yyyy-MM-dd"
@change="handleSelectChange">
</el-date-picker>
<div class="second-title">
<div class="second-select cascader">
<el-cascader class="customer_cascader"
ref="myCascader"
v-model="agencyIdArray"
:key="iscascaderShow"
:options="casOptions"
:props="optionProps"
:show-all-levels="false"
@change="handleChangeAgency"></el-cascader>
</div>
<div class="second-select">
<el-date-picker v-model="timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
prefix-icon="el-icon-caret-bottom"
value-format="yyyy-MM-dd"
@change="handleSelectChange">
</el-date-picker>
</div>
</div> </div>
</div> </div>
@ -36,19 +37,21 @@
<div class="g-cpt-resi"> <div class="g-cpt-resi">
<div class="g-l"> <div class="g-l">
<screen-echarts-frame class="echart-line" <screen-echarts-frame v-if="!showNoData"
class="echart-line"
@myChartMethod="lineInitOk" @myChartMethod="lineInitOk"
ref="lineChart"></screen-echarts-frame> ref="lineChart"></screen-echarts-frame>
<div v-else
class="echart-line">
<img src="../../../../assets/img/modules/visual/noData.png" />
</div>
<!-- <div class="table-status" <!-- <div class="table-status"
v-if="loading"> v-if="loading">
<screen-loading>加载中</screen-loading> <screen-loading>加载中</screen-loading>
</div> </div>
<div class="table-status" <div class="table-status"
v-if="lineList.length == 0 && !loading"> v-if="lineList.length == 0 && !loading">
<div class="no-data">
<img src="../../../../assets/img/modules/visual/noData.png"
class="no-data-img" />
</div>
</div> --> </div> -->
</div> </div>
@ -208,6 +211,7 @@ export default {
await this.getAgencylist()// await this.getAgencylist()//
await nextTick(500) await nextTick(500)
await this.loadOrgData() await this.loadOrgData()
await this.getApiData(); await this.getApiData();
}, },
@ -237,6 +241,15 @@ export default {
if (month2 < 10) { if (month2 < 10) {
month2 = '0' + month2; 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 t2 = year2 + '-' + month2 + '-' + day2;
var t1 = year + '-' + month + '-' + day; var t1 = year + '-' + month + '-' + day;
// let t3 = formate(t2, style); // let t3 = formate(t2, style);
@ -250,9 +263,19 @@ export default {
}, },
async getApiData () { async getApiData () {
await this.getLineChart()
await this.getLine()
await this.loadMapData(); await this.loadMapData();
this.assignData()
},
assignData () {
if (!this.showNoData) {
this.getLine()
}
this.loadMap()
this.isfirstInit = false
}, },
// //
@ -351,17 +374,17 @@ export default {
if (code === 0) { if (code === 0) {
this.legendArray = [] this.legendArray = []
if (data.under) { if (data.under === 0 || data.under) {
this.under = data.under this.under = data.under
this.legendArray.push( this.legendArray.push(
{ {
color: this.colorArray[0], color: this.colorArray[0],
name: data.under + '以下' name: data.under + '以下'
} }
) )
} }
if (data.above) { if (data.above === 0 || data.above) {
this.above = data.above this.above = data.above
this.legendArray.push( this.legendArray.push(
{ {
@ -372,7 +395,7 @@ export default {
this.legendArray.push( this.legendArray.push(
{ {
color: this.colorArray[2], color: this.colorArray[2],
name: data.above + '以上' name: data.above + '以上'
} }
) )
} }
@ -393,12 +416,12 @@ export default {
item.latitude = agencyItem.latitude item.latitude = agencyItem.latitude
item.coordinates = agencyItem.coordinates item.coordinates = agencyItem.coordinates
if (this.under) { if (this.under === 0 || this.under) {
if (item.count < this.under || item.count === this.under) { if (item.count < this.under || item.count === this.under) {
item.color = this.colorArray[0] item.color = this.colorArray[0]
item.fillColor = this.colorFillArray[0] item.fillColor = this.colorFillArray[0]
} else { } else {
if (this.above) { if (this.above === 0 || this.above) {
if (item.count > this.under && item.count < this.above) { if (item.count > this.under && item.count < this.above) {
item.color = this.colorArray[1] item.color = this.colorArray[1]
item.fillColor = this.colorFillArray[1] item.fillColor = this.colorFillArray[1]
@ -409,7 +432,6 @@ export default {
} }
} }
} }
break break
} }
@ -419,8 +441,7 @@ export default {
}); });
console.log(this.mapList) console.log(this.mapList)
this.loadMap()
this.isfirstInit = false
} else { } else {
this.$message.error(msg); this.$message.error(msg);
@ -445,7 +466,7 @@ export default {
}, },
getLine () { getLine () {
if (this.lineInitState) { if (this.lineInitState) {
this.getLineChart() this.assignLineChart()
} else { } else {
setTimeout(() => { setTimeout(() => {
this.getLine() this.getLine()
@ -454,9 +475,13 @@ export default {
}, },
// 线 // 线
async getLineChart () { async getLineChart () {
this.$refs.lineChart.clear() if (!this.showNoData) {
this.$refs.lineChart.clear()
this.$refs.lineChart.showLoading()
}
const _that = this const _that = this
this.$refs.lineChart.showLoading()
const url = "/gov/project/project/projectdistributionanalysisleft"; const url = "/gov/project/project/projectdistributionanalysisleft";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft";
let params = { let params = {
@ -466,28 +491,20 @@ export default {
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
this.$refs.lineChart.hideLoading() if (!this.showNoData) {
this.$refs.lineChart.hideLoading()
}
if (code === 0) { if (code === 0) {
// pieChart
this.lineOption = lineOption()
if (data && data.length > 0) { if (data && data.length > 0) {
this.lineList = data this.lineList = data
this.loadCategoryData() this.showNoData = false
this.$refs.lineChart.setOption(this.lineOption, true)
this.$refs.lineChart.setOption({
xAxis: { data: this.xaxis },
legend: { data: this.legend },
series: this.series
}, true)
} else { } else {
this.lineList = [] this.lineList = []
this.showNoData = true
} }
this.loadCategoryData()
} else { } else {
this.$message.error(msg); this.$message.error(msg);
@ -495,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 () { loadCategoryData () {
this.xaxis = [] this.xaxis = []
this.series = [] this.series = []
this.legend = [] this.legend = []
let num = this.lineList[0].categoryList.length if (this.lineList.length > 0) {
let dataArray = new Array(num)
//
this.lineList[0].categoryList.forEach((categoryItem, index) => {
this.legend.push(categoryItem.categoryName)
dataArray[index] = []
}); let num = this.lineList[0].categoryList.length
//
this.lineList.forEach(item => {
this.xaxis.push(item.time)
let dataArray = new Array(num)
// //
item.categoryList.forEach((categoryItem, index) => { this.lineList[0].categoryList.forEach((categoryItem, index) => {
dataArray[index].push(categoryItem.count) 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) { handleChangeAgency (value) {

12
src/views/modules/visual/warning/components/screen-table/index.vue

@ -23,7 +23,7 @@
:key="indexs" :key="indexs"
:style="tableContentStyle[indexs]" :style="tableContentStyle[indexs]"
> >
{{ item }} <span @click="toUserInfo(item)">{{ item }}</span>
<span <span
v-if="indexs + 1 == value.length && item.length > 8" v-if="indexs + 1 == value.length && item.length > 8"
class="more" class="more"
@ -31,7 +31,11 @@
ref="morePop" ref="morePop"
> >
更多> 更多>
<span class="more-pop" v-if="visiblePopList[index]"> <span
class="more-pop"
@click="toUserInfo(item)"
v-if="visiblePopList[index]"
>
<!-- 李佳琪刘阳赵欣丁一嘉敏李岩何嘉慧 <!-- 李佳琪刘阳赵欣丁一嘉敏李岩何嘉慧
李易峰赵敏何军曲树惠 --> 李易峰赵敏何军曲树惠 -->
{{ item }} {{ item }}
@ -180,6 +184,10 @@ export default {
created() {}, created() {},
methods: { methods: {
toUserInfo(uid) {
// this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` });
},
onClickMorePop(index) { onClickMorePop(index) {
this.visiblePopList.forEach((item, indexs) => { this.visiblePopList.forEach((item, indexs) => {
if (index == indexs) { if (index == indexs) {

Loading…
Cancel
Save