Browse Source

可视化话题详情组件

shibei_master
dai 4 years ago
parent
commit
3105b5a91f
  1. 2
      public/index.html
  2. 51
      src/assets/scss/modules/visual/incident-info.scss
  3. 261
      src/views/modules/visual/basicinfo/cpts/incident-info.vue
  4. 804
      src/views/modules/visual/basicinfo/cpts/topic-info.vue
  5. 13
      src/views/modules/visual/basicinfo/people.vue
  6. 214
      src/views/modules/visual/cpts/line-chart.vue

2
public/index.html

@ -6,6 +6,8 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" />
<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service&key=LWBBZ-TIGC3-VFP3L-YNMWH-FJB7T-JFBLO"></script>
<!-- f2图表 -->
<script src="https://gw.alipayobjects.com/os/antv/assets/f2/3.4.2/f2.min.js"></script>
<!-- 站点配置 -->
<script>

51
src/assets/scss/modules/visual/incident-info.scss

@ -10,7 +10,7 @@
.wrap {
position: relative;
margin: 120px auto;
width: 1000px;
width: 1020px;
.title {
padding: 10px;
@ -144,7 +144,7 @@
.m-case {
@include scrollBar;
height: 400px;
height: 600px;
padding: 20px 0 20px 0;
overflow-y: auto;
}
@ -154,6 +154,53 @@
justify-content: space-between;
}
.m-yanpan {
padding-left: 62px;
padding-right: 0;
min-height: 300px;
}
.m-hint {
position: relative;
height: 300px;
// 暂无数据
img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
}
.m-line {
.stat {
margin: 20px 0 10px;
display: flex;
.stat-item {
width: 33%;
text-align: center;
div {
font-size: 17px;
font-family: Source Han Serif SC;
font-weight: 500;
color: rgba(#fff, 0.5);
line-height: 24px;
&.z-weak {
font-size: 12px;
font-family: Source Han Serif SC;
font-weight: 500;
color: rgba(#fff, 0.5);
line-height: 24px;
}
}
}
}
}
.m-tb {
padding-left: 62px;
padding-right: 40px;

261
src/views/modules/visual/basicinfo/cpts/incident-info.vue

@ -63,6 +63,25 @@
</div>
<div class="m-case">
<div class="m-yanpan" v-if="groupIndex == 0">
<div v-if="info.projectId">
<analyse
v-if="yanPan.loading"
singleTitle="智能随手拍"
:userList="yanPan.houseUserList"
:userName="yanPan.icUserName"
:singleList="yanPan.categoryList"
@user="toUserInfo"
/>
<screen-loading v-else>加载中</screen-loading>
</div>
<div v-else class="m-hint">
<img
src="@/assets/img/modules/visual/noData.png"
class="no-data-img"
/>
</div>
</div>
<div class="m-tb" v-if="groupIndex == 1">
<cpt-tb
:col-list="comment.colList"
@ -72,98 +91,108 @@
></cpt-tb>
</div>
<div class="m-row" v-if="groupIndex == 2">
<div class="m-info">
<div class="info-prop">
<span>项目标题</span>
<span>{{ projectInfo.projectTitle }}</span>
</div>
<div class="info-prop">
<span>项目方案</span>
<span>{{ projectInfo.projectTitle }}</span>
</div>
<div class="info-prop">
<span>内部备注</span>
<span>{{ projectInfo.internalRemark || "--" }}</span>
</div>
<div class="info-prop">
<span>当前处理部门</span>
<span>{{ projectInfo.departmentNameList.join("、") }}</span>
</div>
<div class="info-prop">
<span>分类</span>
<div>
<div :key="item" v-for="item in projectCate">
{{ item.name }}
<div v-if="groupIndex == 2">
<div class="m-row" v-if="info.projectId">
<div class="m-info">
<div class="info-prop">
<span>项目标题</span>
<span>{{ projectInfo.projectTitle }}</span>
</div>
<div class="info-prop">
<span>项目方案</span>
<span>{{ projectInfo.projectTitle }}</span>
</div>
<div class="info-prop">
<span>内部备注</span>
<span>{{ projectInfo.internalRemark || "--" }}</span>
</div>
<div class="info-prop">
<span>当前处理部门</span>
<span>{{ projectInfo.departmentNameList.join("、") }}</span>
</div>
<div class="info-prop" v-if="projectCate.length>0">
<span>分类</span>
<div>
<div :key="item.name" v-for="item in projectCate">
{{ item.name }}
</div>
</div>
</div>
</div>
<div class="info-prop">
<span>标签</span>
<div>
<div :key="item" v-for="item in projectTag">
{{ item.name }}
<div class="info-prop" v-if="projectTag.length>0">
<span>标签</span>
<div>
<div :key="item.name" v-for="item in projectTag">
{{ item.name }}
</div>
</div>
</div>
</div>
</div>
<div class="m-process" v-if="projectProcess.length > 0">
<div class="process-title">处理进展</div>
<div class="list">
<div
class="item"
:class="index === 0 ? 'z-on' : ''"
:key="item.processId"
v-for="(item, index) in projectProcess"
>
<div class="item-row">
<div class="name">{{ item.processName }}</div>
<div class="date">
{{ item.processTime }}
<div class="m-process" v-if="projectProcess.length > 0">
<div class="process-title">处理进展</div>
<div class="list">
<div
class="item"
:class="index === 0 ? 'z-on' : ''"
:key="item.processId"
v-for="(item, index) in projectProcess"
>
<div class="item-row">
<div class="name">{{ item.processName }}</div>
<div class="date">
{{ item.processTime }}
</div>
</div>
</div>
<div class="detail">
<div class="detail-field">处理部门</div>
<div class="detail-value">{{ item.departmentName }}</div>
</div>
<div class="detail">
<div class="detail-field">处理部门</div>
<div class="detail-value">{{ item.departmentName }}</div>
</div>
<div
class="detail"
v-if="item.processName != '转项目' && item.publicReply"
>
<div class="detail-field"> </div>
<div class="detail-value">
<fold-text :row="3">{{ item.publicReply }}</fold-text>
<div
class="detail"
v-if="item.processName != '转项目' && item.publicReply"
>
<div class="detail-field"> </div>
<div class="detail-value">
<fold-text :row="3">{{ item.publicReply }}</fold-text>
</div>
</div>
</div>
<div
class="detail"
v-if="item.processName != '转项目' && item.internalRemark"
>
<div class="detail-field">内部备注</div>
<div class="detail-value">
<fold-text :row="3">{{ item.internalRemark }}</fold-text>
<div
class="detail"
v-if="item.processName != '转项目' && item.internalRemark"
>
<div class="detail-field">内部备注</div>
<div class="detail-value">
<fold-text :row="3">{{
item.internalRemark
}}</fold-text>
</div>
</div>
</div>
<div class="detail">
<div class="attachement-list">
<a
:href="att.url"
target="_blank"
:key="att.url"
v-for="att in item.internalFile"
>
<i class="el-icon-folder-opened"></i>
{{ att.name }}
</a>
<div class="detail">
<div class="attachement-list">
<a
:href="att.url"
target="_blank"
:key="att.url"
v-for="att in item.internalFile"
>
<i class="el-icon-folder-opened"></i>
{{ att.name }}
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div v-else class="m-hint">
<img
src="@/assets/img/modules/visual/noData.png"
class="no-data-img"
/>
</div>
</div>
</div>
</cpt-card>
@ -173,8 +202,10 @@
<script>
import cptCard from "@/views/modules/visual/cpts/card";
import screenLoading from "@/views/modules/visual/cpts/loading";
import { requestPost } from "@/js/dai/request";
import cptTb from "@/views/modules/visual/cpts/tb";
import analyse from "@/views/modules/visual/cpts/analyse";
import dateFormat from "dai-js/tools/dateFormat";
export default {
@ -184,11 +215,21 @@ export default {
type: String,
default: "",
},
epmetUserIdList: {
type: Array,
default: [],
},
icResiUserId: {
type: String,
default: "",
},
},
components: {
cptCard,
cptTb,
analyse,
screenLoading,
},
data() {
@ -267,6 +308,29 @@ export default {
projectCate: [],
projectTag: [],
yanPan: {
loading: false,
icResiUserId: "",
houseId: "",
icUserName: "",
epmetUserIdList: [],
houseUserList: [
// {
// icResiUserId: '',
// icUserName: '',
// }
],
categoryList: [],
projectData: [
// {
// firstCategoryCode: '',
// firstCategoryName: '',
// projectList: [],
// }
],
},
};
},
@ -309,6 +373,7 @@ export default {
this.getProjectProcess();
this.getProjectInfo();
this.getProjectCate();
this.getYanPan();
},
//
@ -358,7 +423,10 @@ export default {
if (code === 0) {
this.projectProcess = data.map((item) => {
item.processTime = dateFormat(new Date(item.processTime * 1000), "yyyy-MM-dd hh:mm");
item.processTime = dateFormat(
new Date(item.processTime * 1000),
"yyyy-MM-dd hh:mm"
);
return item;
});
} else {
@ -403,6 +471,47 @@ export default {
this.$message.error(msg);
}
},
//
async getYanPan() {
const url = "/gov/project/resievent/research-analysis";
const { data, code, msg } = await requestPost(url, {
resiEventId: this.resiEventId,
epmetUserIdList: this.epmetUserIdList,
icResiUserId: this.icResiUserId,
projectId: this.info.projectId,
});
if (code === 0) {
data.categoryList = data.projectData.map((item) => {
return {
categoryCode: item.firstCategoryCode,
categoryName: item.firstCategoryName,
showItem: true,
projectList: item.projectList.map((subItem) => {
return {
title: subItem.projectTitle,
status: subItem.projectStatus,
statusName:
subItem.projectStatus == "pending" ? "待处理" : "结案",
projectId: subItem.projectId,
};
}),
};
});
this.yanPan = { ...this.yanPan, ...data };
this.yanPan.loading = true;
} else {
this.$message.error(msg);
}
},
toUserInfo(item) {
this.$router.push({
path: `/main-shuju/visual-basicinfo-people/${item.icResiUserId}`,
});
},
},
};
</script>

804
src/views/modules/visual/basicinfo/cpts/topic-info.vue

@ -4,62 +4,31 @@
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<span>更多信息</span>
<span>话题详情</span>
</div>
<div class="btn-close" @click="handleClose">
<img src="@/assets/img/shuju/people/close.png" />
</div>
<div
:key="'fieldSubList' + index"
v-for="(fieldSubList, index) in fieldList"
>
<div class="list">
<div class="item" v-if="index == 0">
<span class="item-field">所属网格</span>
<span>{{ gridName }}</span>
</div>
<div class="item" v-if="index == 0">
<span class="item-field">所属小区</span>
<span>{{ xiaoquName }}</span>
</div>
<div class="item" v-if="index == 0">
<span class="item-field">所属楼宇</span>
<span>{{ louName }}-{{ danyuanName }}</span>
</div>
<div class="item" v-if="index == 0">
<span class="item-field">所属家庭</span>
<span>{{ homeName }}</span>
</div>
<div class="item" :key="field.itemId" v-for="field in fieldSubList">
<span class="item-field">{{ field.label }}</span>
<span
v-if="
field.itemType == 'select' ||
field.itemType == 'radio' ||
field.itemType == 'checkbox' ||
field.itemType == 'cascader'
"
>{{
info[field.columnName] == null
? "--"
: getOptionLabel(
field.options,
info[field.columnName],
field.itemType
)
}}</span
>
<span v-else>{{
info[field.columnName] == null ? "--" : info[field.columnName]
}}</span>
</div>
<div class="m-info">
<div class="info-title">话题内容</div>
<div class="info-content">{{ info.topicContent }}</div>
<div class="info-pics">
<img :src="src" :key="src" v-for="src in info.topicImgs" />
</div>
<div class="info-prop">
<span>发布时间</span>
<span>{{ info.releaseTime }}</span>
</div>
<div class="info-prop">
<span>话题地址</span>
<span>{{ info.releaseAddress }}</span>
</div>
<div class="info-prop">
<span>所属网格</span>
<span>{{ info.gridName }}</span>
</div>
<div class="line"></div>
</div>
<div class="tabs">
@ -89,81 +58,197 @@
</div>
</div>
<div
:key="'group' + index"
v-show="groupIndex % groupList.length == index"
v-for="(group, index) in groupList"
>
<div v-if="group.tableName == 'ic_resi_demand' && Array.isArray(allInfo.ic_resi_demand) && allInfo.ic_resi_demand.length>0">
<div
class="list"
:key="'ic_resi_demand' + infoIndex"
v-for="(infoItem, infoIndex) in allInfo.ic_resi_demand"
>
<div
class="item"
:key="field.itemId"
v-for="field in group.itemList"
>
<span class="item-field">{{ field.label }}</span>
<span
v-if="
field.itemType == 'select' ||
field.itemType == 'radio' ||
field.itemType == 'checkbox' ||
field.itemType == 'cascader'
"
>{{
infoItem[field.columnName] == null
? "--"
: getOptionLabel(
field.options,
infoItem[field.columnName],
field.itemType
)
}}</span
>
<span v-else>{{
infoItem[field.columnName] == null
? "--"
: infoItem[field.columnName]
}}</span>
<div class="m-case">
<div class="m-yanpan" v-if="groupIndex == 0">
<div v-if="issueInfo.projectId">
<analyse
v-if="yanPan.loading"
singleTitle="楼院小组"
:userList="yanPan.houseUserList"
:userName="yanPan.icUserName"
:singleList="yanPan.categoryList"
@user="toUserInfo"
/>
<screen-loading v-else>加载中</screen-loading>
</div>
<div v-else class="m-hint">
<img
src="@/assets/img/modules/visual/noData.png"
class="no-data-img"
/>
</div>
</div>
<div class="m-tb" v-if="groupIndex == 1">
<cpt-tb
:col-list="comment.colList"
:loading="comment.loading"
:header="comment.header"
:list="comment.list"
@operate="checkTopicCommentImg"
></cpt-tb>
</div>
<div v-if="groupIndex == 2">
<div class="m-row" v-if="info.issueId">
<div class="m-info">
<div class="info-prop">
<span>议题标题</span>
<span>{{ issueInfo.issueTitle }}</span>
</div>
<div class="info-prop">
<span>议题建议</span>
<span>{{ issueInfo.issueSuggestion }}</span>
</div>
<div class="info-prop">
<span>所属网格</span>
<span>{{ issueInfo.belongsGridName || "--" }}</span>
</div>
<div class="info-prop">
<span>议题发起人</span>
<span>{{ issueInfo.issueInitiator }}</span>
</div>
<div class="info-prop">
<span>议题来源</span>
<span>{{ issueInfo.topicInfo.groupName }}</span>
</div>
<div class="info-prop">
<span>转议题时间</span>
<span>{{ issueInfo.shiftIssueTime }}</span>
</div>
</div>
<div class="m-line">
<div class="stat">
<div class="stat-item">
<div>
{{ issueTrend.realityVoteCount }}/{{
issueTrend.shouldVoteCount
}}
</div>
<div class="z-weak">已表决/应表决</div>
</div>
<div class="stat-item">
<div>{{ issueTrend.supportAmount }}</div>
<div class="z-weak">支持</div>
</div>
<div class="stat-item">
<div>{{ issueTrend.oppositionAmount }}</div>
<div class="z-weak">反对</div>
</div>
</div>
<line-chart :list="issueChartData" />
</div>
</div>
<div v-else class="m-hint">
<img
src="@/assets/img/modules/visual/noData.png"
class="no-data-img"
/>
</div>
</div>
<div class="list" v-else>
<div
class="item"
:key="field.itemId"
v-for="field in group.itemList"
>
<span class="item-field">{{ field.label }}</span>
<span
v-if="
field.itemType == 'select' ||
field.itemType == 'radio' ||
field.itemType == 'checkbox' ||
field.itemType == 'cascader'
"
>{{
!allInfo[group.tableName] ||
allInfo[group.tableName][0][field.columnName] == null
? "--"
: getOptionLabel(
field.options,
allInfo[group.tableName][0][field.columnName],
field.itemType
)
}}</span
>
<span v-else>{{
!allInfo[group.tableName] ||
allInfo[group.tableName][0][field.columnName] == null
? "--"
: allInfo[group.tableName][0][field.columnName]
}}</span>
<div v-if="groupIndex == 3">
<div class="m-row" v-if="issueInfo.projectId">
<div class="m-info">
<div class="info-prop">
<span>项目标题</span>
<span>{{ projectInfo.projectTitle }}</span>
</div>
<div class="info-prop">
<span>项目方案</span>
<span>{{ projectInfo.projectTitle }}</span>
</div>
<div class="info-prop">
<span>内部备注</span>
<span>{{ projectInfo.internalRemark || "--" }}</span>
</div>
<div class="info-prop">
<span>当前处理部门</span>
<span>{{ projectInfo.departmentNameList.join("、") }}</span>
</div>
<div class="info-prop" v-if="projectCate.length > 0">
<span>分类</span>
<div>
<div :key="item.name" v-for="item in projectCate">
{{ item.name }}
</div>
</div>
</div>
<div class="info-prop" v-if="projectTag.length > 0">
<span>标签</span>
<div>
<div :key="item.name" v-for="item in projectTag">
{{ item.name }}
</div>
</div>
</div>
</div>
<div class="m-process" v-if="projectProcess.length > 0">
<div class="process-title">处理进展</div>
<div class="list">
<div
class="item"
:class="index === 0 ? 'z-on' : ''"
:key="item.processId"
v-for="(item, index) in projectProcess"
>
<div class="item-row">
<div class="name">{{ item.processName }}</div>
<div class="date">
{{ item.processTime }}
</div>
</div>
<div class="detail">
<div class="detail-field">处理部门</div>
<div class="detail-value">{{ item.departmentName }}</div>
</div>
<div
class="detail"
v-if="item.processName != '转项目' && item.publicReply"
>
<div class="detail-field"> </div>
<div class="detail-value">
<fold-text :row="3">{{ item.publicReply }}</fold-text>
</div>
</div>
<div
class="detail"
v-if="item.processName != '转项目' && item.internalRemark"
>
<div class="detail-field">内部备注</div>
<div class="detail-value">
<fold-text :row="3">{{
item.internalRemark
}}</fold-text>
</div>
</div>
<div class="detail">
<div class="attachement-list">
<a
:href="att.url"
target="_blank"
:key="att.url"
v-for="att in item.internalFile"
>
<i class="el-icon-folder-opened"></i>
{{ att.name }}
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div v-else class="m-hint">
<img
src="@/assets/img/modules/visual/noData.png"
class="no-data-img"
/>
</div>
</div>
</div>
@ -174,16 +259,25 @@
<script>
import cptCard from "@/views/modules/visual/cpts/card";
import screenLoading from "@/views/modules/visual/cpts/loading";
import { requestPost } from "@/js/dai/request";
import cptTb from "@/views/modules/visual/cpts/tb";
import lineChart from "@/views/modules/visual/cpts/line-chart";
import analyse from "@/views/modules/visual/cpts/analyse";
import dateFormat from "dai-js/tools/dateFormat";
export default {
name: "demandInfo",
props: {
userId: {
topicId: {
type: String,
default: "",
},
gridName: {
epmetUserIdList: {
type: Array,
default: [],
},
icResiUserId: {
type: String,
default: "",
},
@ -191,94 +285,143 @@ export default {
components: {
cptCard,
cptTb,
analyse,
screenLoading,
lineChart,
},
data() {
return {
fieldList: [],
groupList: [],
groupList: [
{ label: "研判分析" },
{ label: "话题评论" },
{ label: "查看议题" },
{ label: "查看项目" },
],
groupIndex: 0,
startGroupIndex: 0,
info: {},
allInfo: {},
xiaoquList: [],
louList: [],
danyuanList: [],
homeList: [],
info: {
badgeList: [],
closeDetail: {
closeUserName: "",
closeDateTime: "-1",
closeReason: "",
closeUserHeadPhoto: "",
},
dimension: "",
hiddenDetail: null,
issueId: "",
longitude: "",
releaseAddress: "",
releaseTime: "",
releaseUserHeadPhoto: "",
releaseUserName: "",
shiftIssueFlag: true,
topicContent: "",
topicId: "",
topicImgs: [],
topicStatus: "discussing",
},
comment: {
loading: true,
colList: [
{
align: "center",
width: "20%",
},
{
align: "center",
width: "20%",
},
{
align: "left",
width: "50%",
},
{
align: "left",
width: "10%",
},
],
header: ["评论者", "评论时间", "评论内容", "评论图片"],
list: [],
},
issueInfo: {
attitude: "",
belongsGridName: "",
issueIdea: "",
issueInitiator: "",
issueStatus: "",
issueSuggestion: "",
issueTitle: "",
joinVote: true,
projectId: "",
projectStatus: false,
publishIdeaFlag: false,
},
issueTrend: {},
issueChartData: [],
projectProcess: [],
projectInfo: {
backGround: "",
departmentList: [
// { departmentName: "-", staffList: [""] },
],
departmentNameList: [],
internalRemark: "",
isSend: false,
locateAddress: "",
locateDimension: "",
locateLongitude: "",
origin: "",
originId: "",
platformIds: [],
processable: false,
projectId: "",
projectStatus: "pending",
projectTitle: "",
publicReply: "",
returnable: false,
},
projectCate: [],
projectTag: [],
yanPan: {
loading: false,
icResiUserId: "",
houseId: "",
icUserName: "",
epmetUserIdList: [],
houseUserList: [
// {
// icResiUserId: '',
// icUserName: '',
// }
],
categoryList: [],
projectData: [
// {
// firstCategoryCode: '',
// firstCategoryName: '',
// projectList: [],
// }
],
},
};
},
computed: {
xiaoquName() {
const {
xiaoquList,
info: { VILLAGE_ID },
} = this;
if (Array.isArray(xiaoquList) && xiaoquList.length > 0 && VILLAGE_ID) {
let item = xiaoquList.find((item) => item.value == VILLAGE_ID);
if (item) {
return item.label;
}
}
return "";
},
louName() {
const {
louList,
info: { BUILD_ID },
} = this;
if (Array.isArray(louList) && louList.length > 0 && BUILD_ID) {
let item = louList.find((item) => item.value == BUILD_ID);
if (item) {
return item.label;
}
}
return "";
},
danyuanName() {
const {
danyuanList,
info: { UNIT_ID },
} = this;
if (Array.isArray(danyuanList) && danyuanList.length > 0 && UNIT_ID) {
let item = danyuanList.find((item) => item.value == UNIT_ID);
if (item) {
return item.label;
}
}
return "";
},
danyuanName() {
const {
danyuanList,
info: { UNIT_ID },
} = this;
if (Array.isArray(danyuanList) && danyuanList.length > 0 && UNIT_ID) {
let item = danyuanList.find((item) => item.value == UNIT_ID);
if (item) {
return item.label;
}
}
return "";
},
homeName() {
const {
homeList,
info: { HOME_ID },
} = this;
if (Array.isArray(homeList) && homeList.length > 0 && HOME_ID) {
let item = homeList.find((item) => item.value == HOME_ID);
if (item) {
return item.label;
}
}
return "";
},
},
computed: {},
watch: {
userId() {
topicId() {
this.getApiData();
},
},
@ -309,195 +452,228 @@ export default {
},
async getApiData() {
await this.getField();
this.getComment();
await this.getInfo();
this.getXiaoquList();
this.getLouList();
this.getDanyuanList();
this.getHomeList();
await this.getIssueInfo();
this.getIssueTrend();
this.getProjectProcess();
this.getProjectInfo();
this.getProjectCate();
this.getYanPan();
},
getOptionLabel(options, value, type = "") {
if (Array.isArray(options)) {
let valueArr = value.split(",");
if (type == "cascader") {
if (valueArr.length > 0) {
let level1 = options.find((item) => item.value == valueArr[0]);
if (level1) {
if (valueArr.length > 1 && level1.children) {
let level2 = level1.children.find(
(item) => item.value == valueArr[1]
);
if (level2) {
return level1.label + "-" + level2.label;
}
}
return level1.label;
}
}
} else {
return valueArr
.map((val) => {
let item = options.find((item) => item.value == val);
if (item && item.label) {
return item.label;
}
return "--";
})
.join("、");
}
//
async getInfo() {
const url = "/resi/group/topic/gettopicdetail";
const { data, code, msg } = await requestPost(url, {
topicId: this.topicId,
});
if (code === 0) {
this.info = data;
} else {
this.$message.error(msg);
}
return "--";
},
//
async getField() {
const url = "/oper/customize/icform/getcustomerform";
async getComment() {
const url = "/resi/group/comment/getcommentlistoftopic";
const { data, code, msg } = await requestPost(url, {
dynamic: true,
formCode: "resi_base_info",
topicId: this.topicId,
pageNo: 1,
pageSize: 100,
});
this.comment.loading = false;
if (code === 0) {
this.groupList = data.groupList;
this.fieldList = (function (arr) {
let col = [];
let ele = [];
for (let i = 0; i < arr.length; i++) {
let item = arr[i];
if (item.itemType == "divider" || i == arr.length - 1) {
col.push([...ele]);
ele = [];
} else {
ele.push(item);
}
}
return col;
})(data.itemList);
this.fieldList.forEach((subList, index) => {
subList.forEach(async (item, subIndex) => {
if (item.optionSourceType == "remote" && item.optionSourceValue) {
this.fieldList[index][subIndex].options = await this.getOptions(
item.optionSourceValue
);
}
});
this.comment.list = data.map((item) => {
return [
item.commentUserName,
item.commentTime,
item.commentContent,
item.imageList.length > 0
? { type: "operate", list: ["查看"] }
: "",
];
});
this.comment.srcList = data;
} else {
this.$message.error(msg);
}
},
checkTopicCommentImg(index) {
const {
comment: { srcList },
} = this;
if (srcList[index] && srcList[index].imageList) {
window.open(srcList[index].imageList[0].url);
}
},
//
async getInfo() {
const url = "/epmetuser/icresiuser/detail";
async getIssueInfo() {
const {
info: { issueId },
} = this;
if (!issueId) return;
const url = "/resi/hall/issue/detail";
const { data, code, msg } = await requestPost(url, {
icResiUserId: this.userId,
formCode: "resi_base_info",
issueId,
});
if (code === 0) {
this.info = data.ic_resi_user[0];
this.allInfo = data;
this.fieldList.forEach((subList, index) => {
subList.forEach((item, subIndex) => {
if (
item.itemType == "radio" &&
item.childGroup &&
this.allInfo[item.tableName] &&
this.allInfo[item.tableName][0][item.columnName] == "1"
) {
this.groupList = [...this.groupList, item.childGroup];
}
});
});
console.log("1111111111111111111111111", this.groupList);
this.groupList.forEach((subList, index) => {
subList.itemList.forEach(async (item, subIndex) => {
if (item.optionSourceType == "remote" && item.optionSourceValue) {
this.groupList[index].itemList[subIndex].options =
await this.getOptions(item.optionSourceValue);
}
});
});
this.issueInfo = data;
} else {
this.$message.error(msg);
}
},
//
async getOptions(url) {
if (!url) return [];
async getIssueTrend() {
const {
info: { issueId },
} = this;
if (!issueId) return;
const url = "/resi/hall/issue/votingtrend";
const { data, code, msg } = await requestPost(url, {});
const { data, code, msg } = await requestPost(url, {
issueId,
});
if (code === 0) {
return data;
this.issueTrend = data;
let chartData = [];
data.polyLine.forEach((item) => {
let date = dateFormat(new Date(item.voteDate * 1000), "yyyy-MM-dd");
console.log("date:" + date);
chartData.push(
{
date,
value: item.supportIncrement,
type: "支持",
},
{
date,
value: item.oppositionIncrement,
type: "反对",
}
);
});
this.issueChartData = chartData;
} else {
return [];
this.$message.error(msg);
}
},
async getXiaoquList() {
const url = "/gov/org/icneighborhood/neighborhoodoption";
//
async getProjectProcess() {
const { issueInfo } = this;
if (!issueInfo || !issueInfo.projectId) return;
const url = "/gov/project/trace/processlist-v2";
const { data, code, msg } = await requestPost(url, {
agencyId: this.info.AGENCY_ID,
gridId: this.info.GRID_ID,
projectId: issueInfo.projectId,
});
if (code === 0) {
this.xiaoquList = data;
this.projectProcess = data.map((item) => {
item.processTime = dateFormat(
new Date(item.processTime * 1000),
"yyyy-MM-dd hh:mm"
);
return item;
});
} else {
this.$message.error(msg);
}
},
async getLouList() {
const url = "/gov/org/icbuilding/buildingoption";
//
async getProjectInfo() {
const { issueInfo } = this;
if (!issueInfo || !issueInfo.projectId) return;
const url = "/gov/project/trace/projectdetail";
const { data, code, msg } = await requestPost(url, {
neighborHoodId: this.info.VILLAGE_ID,
projectId: issueInfo.projectId,
});
if (code === 0) {
this.louList = data;
this.projectInfo = data;
} else {
this.$message.error(msg);
}
},
async getDanyuanList() {
const url = "/gov/org/icbuildingunit/unitoption";
async getProjectCate() {
const { issueInfo } = this;
if (!issueInfo || !issueInfo.projectId) return;
const url = "/gov/project/projectcategory/categorytaglist";
const { data, code, msg } = await requestPost(url, {
buildingId: this.info.BUILD_ID,
projectId: issueInfo.projectId,
});
if (code === 0) {
this.danyuanList = data;
this.projectCate = data.categoryList;
this.projectTag = data.tagList;
} else {
this.$message.error(msg);
}
},
async getHomeList() {
const url = "/gov/org/ichouse/houseoption";
//
async getYanPan() {
const url = "/gov/project/project/topic-research-analysis";
if (!this.issueInfo.projectId) return;
const { data, code, msg } = await requestPost(url, {
unitId: this.info.UNIT_ID,
epmetUserIdList: this.epmetUserIdList,
icResiUserId: this.icResiUserId,
projectId: this.issueInfo.projectId,
});
if (code === 0) {
this.homeList = data;
data.categoryList = data.projectData.map((item) => {
return {
categoryCode: item.firstCategoryCode,
categoryName: item.firstCategoryName,
showItem: true,
projectList: item.projectList.map((subItem) => {
return {
title: subItem.projectTitle,
status: subItem.projectStatus,
statusName:
subItem.projectStatus == "pending" ? "待处理" : "结案",
projectId: subItem.projectId,
};
}),
};
});
this.yanPan = { ...this.yanPan, ...data };
this.yanPan.loading = true;
} else {
this.$message.error(msg);
}
},
toUserInfo(item) {
this.$router.push({
path: `/main-shuju/visual-basicinfo-people/${item.icResiUserId}`,
});
},
},
};
</script>
<style lang="scss" src="@/assets/scss/modules/visual/people.scss" scoped></style>
<style
lang="scss"
src="@/assets/scss/modules/visual/incident-info.scss"
scoped
></style>

13
src/views/modules/visual/basicinfo/people.vue

@ -448,17 +448,18 @@
/>
<incident-info
v-show="incident.showedInfo"
v-if="incident.list.length > 0"
v-if="incident.list.length > 0 && incident.showedInfo"
:resiEventId="incident.list[incident.currentIndex].resiEventId"
:epmetUserIdList="info.epmetUserIdList"
:icResiUserId="userId"
@close="incident.showedInfo = false"
/>
<topic-info
v-show="topic.showedInfo"
v-if="userId"
:userId="userId"
:gridName="info.gridName"
v-if="topic.list.length > 0 && topic.showedInfo"
:topicId="topic.list[topic.currentIndex].topicId"
:epmetUserIdList="info.epmetUserIdList"
:icResiUserId="userId"
@close="topic.showedInfo = false"
/>
</div>

214
src/views/modules/visual/cpts/line-chart.vue

@ -0,0 +1,214 @@
<template>
<div class="m-chart">
<canvas id="myChart" width="400" height="260"></canvas>
</div>
</template>
<script>
import nextTick from "dai-js/tools/nextTick";
// iosbug
const fontFamily = "PingFang SC";
const fontSize = 14;
let chart;
let srcData = [];
let textShapeList = [];
const addTextShape = () => {
if (textShapeList.length > 0) {
textShapeList.forEach((item) => {
item.remove(true);
});
textShapeList = [];
}
// 线
const canvas = chart.get("canvas");
const group = canvas.addGroup();
const shapes = {};
function addFn(list) {
const listLength = list.length;
list.forEach(function (obj, index) {
//
if (listLength > 7 && index > 0 && index < listLength - 1) {
if (index % Math.ceil(listLength / 5) != 0) {
return;
}
}
const offsetX = 6;
const offsetY = 1;
const point = chart.getPosition(obj);
const text = group.addShape("text", {
attrs: {
x: obj.type === "支持" ? point.x + 2 * offsetX : point.x - offsetX,
y: point.y + offsetY,
text: obj.value,
textAlign: "center",
textBaseline: "bottom",
fill: "#333",
fontWeight: 500,
fontFamily,
fontSize,
},
});
textShapeList.push(text); // shape, 便
});
}
srcData.sort((a, b) => {
return new Date(a.date).getTime() - new Date(b.date).getTime();
});
let supData = srcData.filter((item) => item.type == "支持");
let oppData = srcData.filter((item) => item.type == "反对");
addFn(supData);
addFn(oppData);
};
const iniChart = function (config, srcData) {
chart = new window.F2.Chart({
id: "myChart",
...config,
});
const supColor = "#FFDA0E";
const oppColor = "#00E5ED";
chart.source(srcData, {
date: {
range: [0, 1],
type: "timeCat",
mask: "MM-DD",
},
value: {
// type: "linear",
},
});
//
chart.axis("date", {
line: {
lineWidth: 1,
stroke: "#E7EEEE",
},
label: {
fontWeight: 500,
fontSize,
fill: "#B5B7BF",
textBaseline: "middle",
},
labelOffset: 25,
country: {
range: [0.1, 0.9], // range 使
},
grid: null,
});
chart.axis("value", {
line: {
lineWidth: 1,
stroke: "#E7EEEE",
},
labelOffset: 20,
label: {
fontWeight: 500,
fontSize,
fill: "#B5B7BF",
},
});
//
chart.legend({
position: "bottom",
align: "center",
offsetY: -30,
custom: true,
nameStyle: {
fill: "#999",
fontWeight: 500,
fontSize,
},
itemWidth: 150,
wordSpace: 25,
items: [
{
name: "支持",
marker(x, y, r, ctx) {
ctx.lineWidth = 10;
ctx.strokeStyle = supColor;
ctx.moveTo(x - r - 15, y);
ctx.lineTo(x + r + 15, y);
ctx.stroke();
ctx.fill();
},
},
{
name: "反对",
marker(x, y, r, ctx) {
ctx.lineWidth = 10;
ctx.strokeStyle = oppColor;
ctx.moveTo(x - r - 15, y);
ctx.lineTo(x + r + 15, y);
ctx.stroke();
ctx.fill();
},
},
],
});
// 线
chart
.line()
.position("date*value")
.color("type", (type) => {
if (type === "支持") {
return supColor;
}
return oppColor;
})
.style("type", {
lineWidth: 1,
})
.animate();
chart.render();
addTextShape();
// chart return
return chart;
};
export default {
name: "chart",
props: {
list: {
type: Array,
default: () => {
return [];
},
},
config: {
type: Object,
default: () => {
return {};
},
},
},
data() {
return {
iniLoading: false,
};
},
watch: {
list(data) {
chart.changeData(data);
srcData = data;
addTextShape();
},
},
async created() {
await nextTick(200);
iniChart(this.config, this.list);
await nextTick(200);
this.iniLoading = true;
},
};
</script>
<style lang="scss" scoped></style>
Loading…
Cancel
Save