Browse Source

社区查询

feature
dai 4 years ago
parent
commit
f41f127f54
  1. 1
      package.json
  2. 2
      public/index.html
  3. BIN
      src/assets/img/shequ/close.png
  4. 217
      src/assets/scss/modules/search.scss
  5. 2
      src/js/store/index.js
  6. 2
      src/main.js
  7. 2
      src/router/index.js
  8. 2
      src/store/index.js
  9. 184
      src/views/main-content.vue
  10. 211
      src/views/modules/shequ/cpts/fangwu-info.vue
  11. 184
      src/views/modules/shequ/cpts/pan-chart.vue
  12. 513
      src/views/modules/shequ/cpts/people-more.vue
  13. 205
      src/views/modules/shequ/cpts/xuqiu-info.vue
  14. 1018
      src/views/modules/shequ/index.vue
  15. 24
      src/views/modules/visual/cpts/line-chart.vue

1
package.json

@ -50,6 +50,7 @@
"xlsx": "^0.17.1"
},
"devDependencies": {
"@antv/f2": "^3.8.10-beta.1",
"@vue/cli-plugin-babel": "^3.10.0",
"@vue/cli-plugin-eslint": "^3.10.0",
"@vue/cli-service": "^3.10.0",

2
public/index.html

@ -7,7 +7,7 @@
<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 src="https://gw.alipayobjects.com/os/lib/antv/f2/3.8.1/dist/f2.min.js"></script> -->
<!-- 站点配置 -->
<script>

BIN
src/assets/img/shequ/close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

217
src/assets/scss/modules/search.scss

@ -0,0 +1,217 @@
@import "../c/config";
@import "../c/function";
.m-info {
padding: 0;
.wrap {
background-color: #fff;
border-radius: 10px;
padding: 30px 40px;
.logo {
margin-bottom: 30px;
img {
display: block;
margin: 0 auto;
}
}
.search {
margin: 0 auto 30px;
width: 750px;
height: 53px;
border: 2px solid #0082fb;
border-radius: 8px;
display: flex;
align-items: center;
.input {
position: relative;
select {
border: none;
font-size: 16px;
width: 90px;
line-height: 32px;
text-align: center;
color: #0082fb;
}
input {
margin-left: 20px;
width: 500px;
border: none;
line-height: 24px;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #333;
}
.close-btn {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto 0;
width: 30px;
height: 30px;
background-color: #eee;
border-radius: 100%;
cursor: pointer;
img {
display: block;
margin: 8px auto;
width: 14px;
height: 14px;
opacity: 0.3;
}
}
}
.btn {
margin-left: auto;
width: 120px;
line-height: 49px;
background: #0082fb;
border-radius: 0px 6 px 6 px 0px;
font-size: 22px;
text-align: center;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
cursor: pointer;
}
}
}
}
.m-panel {
padding: 0 10px;
.operate {
text-align: right;
}
}
.m-list {
.list-title {
margin-bottom: 20px;
font-size: 24px;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
.list-title2 {
margin-bottom: 10px;
font-size: 16px;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
.list {
display: flex;
flex-wrap: wrap;
.item {
position: relative;
margin-right: 46px;
margin-bottom: 20px;
width: 80px;
text-align: center;
cursor: pointer;
.corner-mark {
position: absolute;
top: -4px;
right: -4px;
color: #ccc;
font-size: 20px;
z-index: 1;
&.z-on {
color: #0082fb;
}
}
.icon {
position: relative;
display: block;
margin: 0 auto;
width: 78px;
height: 78px;
&::before {
content: "";
position: absolute;
z-index: 0;
display: block;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: 64px;
height: 64px;
border-radius: 10px;
background-color: #f4f4f4;
}
img {
position: relative;
width: 78px;
height: 78px;
object-fit: cover;
}
.icon-svg {
position: relative;
display: block;
margin: auto;
width: 78px;
height: 78px;
object-fit: cover;
}
}
p {
margin: 0;
line-height: 24px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
}
}
}
}
.m-tb {
margin-bottom: 20px;
}
.m-data {
padding: 0;
margin-top: 20px;
.wrap {
background-color: #fff;
border-radius: 10px;
padding: 30px 40px;
.headline {
margin-bottom: 20px;
font-size: 24px;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
.cnt {
display: flex;
.chart {
width: 500px;
}
.tb {
width: calc(100% - 500px);
}
}
}
}

2
src/js/store/index.js

@ -28,7 +28,7 @@ export default new Vuex.Store({
{
...window.SITE_CONFIG["contentTabDefault"],
name: "indexWork",
title: "indexWork",
title: "首页",
},
],
contentTabsActiveName: "indexWork",

2
src/main.js

@ -32,10 +32,10 @@ import getQueryPara from "dai-js/modules/getQueryPara";
// 兼容token传参登录
if (getQueryPara("token")) {
console.log('token', getQueryPara("token"));
Cookies.set("token", getQueryPara("token"));
}
window.app = Object.assign(
{},
{

2
src/router/index.js

@ -443,7 +443,7 @@ function fnAddDynamicMenuRoutes2(menuList = [], routes = []) {
component: null,
name: "",
meta: {
...window.SITE_CONFIG["contentTabDefault"],
// ...window.SITE_CONFIG["contentTabDefault"],
menuId: menuList[i].id,
title: menuList[i].name,
},

2
src/store/index.js

@ -24,7 +24,7 @@ export default new Vuex.Store({
{
...window.SITE_CONFIG['contentTabDefault'],
'name': 'indexWork',
'title': 'indexWork'
'title': '首页'
}
],
contentTabsActiveName: 'indexWork',

184
src/views/main-content.vue

@ -4,44 +4,61 @@
<template v-if="$route.meta.isTab && !$store.state.inIframe">
<el-dropdown class="aui-content--tabs-tools">
<i class="el-icon-arrow-down"></i>
<el-dropdown-menu slot="dropdown"
:show-timeout="0">
<el-dropdown-item @click.native="tabRemoveHandle($store.state.contentTabsActiveName)">{{ $t('contentTabs.closeCurrent') }}</el-dropdown-item>
<el-dropdown-item @click.native="tabsCloseOtherHandle()">{{ $t('contentTabs.closeOther') }}</el-dropdown-item>
<el-dropdown-item @click.native="tabsCloseAllHandle()">{{ $t('contentTabs.closeAll') }}</el-dropdown-item>
<el-dropdown-menu slot="dropdown" :show-timeout="0">
<el-dropdown-item
@click.native="tabRemoveHandle($store.state.contentTabsActiveName)"
>{{ $t("contentTabs.closeCurrent") }}</el-dropdown-item
>
<el-dropdown-item @click.native="tabsCloseOtherHandle()">{{
$t("contentTabs.closeOther")
}}</el-dropdown-item>
<el-dropdown-item @click.native="tabsCloseAllHandle()">{{
$t("contentTabs.closeAll")
}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-tabs v-model="$store.state.contentTabsActiveName"
@tab-click="tabSelectedHandle"
@tab-remove="tabRemoveHandle">
<el-tab-pane v-for="item in $store.state.contentTabs"
:key="item.name"
:name="item.name"
:label="item.title"
:closable="item.name !== 'home'"
:class="{ 'is-iframe': tabIsIframe(item.iframeURL) }">
<template v-if="item.name === 'home'">
<svg slot="label"
class="icon-svg aui-content--tabs-icon-nav"
aria-hidden="true">
<el-tabs
v-model="$store.state.contentTabsActiveName"
@tab-click="tabSelectedHandle"
@tab-remove="tabRemoveHandle"
>
<el-tab-pane
v-for="item in $store.state.contentTabs"
:key="item.name"
:name="item.name"
:label="item.title"
:closable="item.name !== 'indexWork'"
:class="{ 'is-iframe': tabIsIframe(item.iframeURL) }"
>
<template v-if="item.name === 'indexWork'">
<svg
slot="label"
class="icon-svg aui-content--tabs-icon-nav"
aria-hidden="true"
>
<use xlink:href="#icon-home"></use>
</svg>
</template>
<template v-if="tabIsIframe(item.iframeURL)">
<iframe :src="item.iframeURL + '?token=' + token + '&customerId=' + customerId"
ref="iframes"
class="iframes"
id="iframes"
width="100%"
height="100%"
frameborder="0"
scrolling="yes"
></iframe>
<!-- <div v-if="tabIsIframe(item.iframeURL)" id="addend-iframe" style="height: 100%;"> </div> -->
<iframe
:src="
item.iframeURL + '?token=' + token + '&customerId=' + customerId
"
ref="iframes"
class="iframes"
id="iframes"
width="100%"
height="100%"
frameborder="0"
scrolling="yes"
></iframe>
<!-- <div v-if="tabIsIframe(item.iframeURL)" id="addend-iframe" style="height: 100%;"> </div> -->
</template>
<keep-alive v-else>
<router-view v-if="item.name === $store.state.contentTabsActiveName"
@changeCustomerName="changeCustomerName" />
<router-view
v-if="item.name === $store.state.contentTabsActiveName"
@changeCustomerName="changeCustomerName"
/>
</keep-alive>
</el-tab-pane>
</el-tabs>
@ -56,86 +73,107 @@
</template>
<script>
import { isURL } from '@/utils/validate'
import Cookie from 'js-cookie'
import { isURL } from "@/utils/validate";
import Cookie from "js-cookie";
export default {
data () {
data() {
return {
iframeUrl: '',
token: '',
customerId: ''
}
iframeUrl: "",
token: "",
customerId: "",
};
},
created () {
created() {
// this.$nextTick(() => {
// this.sendMessage()
// })
this.token = Cookie.get('token')
this.customerId = localStorage.getItem('customerId')
this.token = Cookie.get("token");
this.customerId = localStorage.getItem("customerId");
},
methods: {
changeCustomerName (customerName) {
this.$emit('changeCustomerName', customerName)
changeCustomerName(customerName) {
this.$emit("changeCustomerName", customerName);
},
// tabs, iframe
tabIsIframe (url) {
tabIsIframe(url) {
// this.appendIframe(url)
this.iframeUrl = url + '?token=' + Cookie.get('token') + '&customerId=' + localStorage.getItem('customerId')
return isURL(url)
this.iframeUrl =
url +
"?token=" +
Cookie.get("token") +
"&customerId=" +
localStorage.getItem("customerId");
return isURL(url);
},
// tabs, tab
tabSelectedHandle (tab) {
tab = this.$store.state.contentTabs.filter(item => item.name === tab.name)[0]
tabSelectedHandle(tab) {
tab = this.$store.state.contentTabs.filter(
(item) => item.name === tab.name
)[0];
if (tab) {
this.$router.push({
'name': tab.name,
'params': { ...tab.params },
'query': { ...tab.query }
})
name: tab.name,
params: { ...tab.params },
query: { ...tab.query },
});
}
},
// tabs, tab
tabRemoveHandle (tabName) {
if (tabName === 'home') {
return false
tabRemoveHandle(tabName) {
if (tabName === "home") {
return false;
}
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name !== tabName
);
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
return false
this.$store.state.sidebarMenuActiveName =
this.$store.state.contentTabsActiveName = "home";
return false;
}
// tab
if (tabName === this.$store.state.contentTabsActiveName) {
let tab = this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1]
let tab =
this.$store.state.contentTabs[
this.$store.state.contentTabs.length - 1
];
this.$router.push({
name: tab.name,
params: { ...tab.params },
query: { ...tab.query }
})
query: { ...tab.query },
});
}
},
// tabs,
tabsCloseOtherHandle () {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => {
return item.name === 'home' || item.name === this.$store.state.contentTabsActiveName
})
tabsCloseOtherHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => {
return (
item.name === "home" ||
item.name === this.$store.state.contentTabsActiveName
);
}
);
},
// tabs,
tabsCloseAllHandle () {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name === 'home')
this.$router.push({ name: 'home' })
tabsCloseAllHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name === "home"
);
this.$router.push({ name: "home" });
},
sendMessage () {
sendMessage() {
// const iframe = this.$refs.iframes.contentWindow
const iframe = document.getElementsByClassName('iframes')[0].contentWindow
const iframe =
document.getElementsByClassName("iframes")[0].contentWindow;
console.log('iframe', iframe)
console.log("iframe", iframe);
// iframe.postMessage({
// token: Cookie.get('token'),
// customerId: localStorage.getItem('customerId')
// }, '*')
iframe.postMessage({ name: 'lalalal' }, '*')
iframe.postMessage({ name: "lalalal" }, "*");
},
}
}
},
};
</script>

211
src/views/modules/shequ/cpts/fangwu-info.vue

@ -0,0 +1,211 @@
<template>
<div>
<div>
<el-form
ref="ref_form"
:inline="false"
:model="dataForm"
:disabled="formType === 'detail'"
class="form"
>
<el-form-item
label="所属小区"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.neighborHoodName }}</span>
</el-form-item>
<el-form-item
label="所属楼栋"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.buildingName }}</span>
</el-form-item>
<el-form-item
label="单元号"
prop="buildingUnitId"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.unitNum }}</span>
</el-form-item>
<el-form-item
label="门牌号"
prop="doorName"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.doorName }}</span>
</el-form-item>
<el-form-item
label="房屋类型"
prop="houseType"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.houseType }}</span>
</el-form-item>
<el-form-item
label="房屋用途"
prop="purpose"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.purpose }}</span>
</el-form-item>
<el-form-item
label="是否出租"
prop="rentFlag"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.rentFlag }}</span>
</el-form-item>
<el-form-item
label="房主姓名"
prop="ownerName"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.ownerName }}</span>
</el-form-item>
<el-form-item
label="房主电话"
prop="ownerPhone"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.ownerPhone }}</span>
</el-form-item>
<el-form-item
label="房主身份证"
prop="ownerIdCard"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.ownerIdCard }}</span>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button @click="handleCancle">关闭</el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request";
let loading; //
export default {
data() {
return {
formType: "detail", // addeditdetail
dataForm: {
neighborHoodId: "", // ID
buildingId: "", //ID
buildingUnitId: "", //ID
doorName: "", //
houseType: "", //
purpose: "", //
rentFlag: 1, //10
ownerPhone: "", //
ownerName: "", //
ownerIdCard: "", //
},
};
},
components: {},
mounted() {},
methods: {
async initForm(type, row) {
this.$refs.ref_form.resetFields();
this.formType = type;
if (row) {
this.dataForm = JSON.parse(JSON.stringify(row));
}
},
handleCancle() {
this.$emit("dialogCancle");
this.resetData();
},
resetData() {
this.dataForm = {
neighborHoodId: "", // ID
buildingId: "", //ID
buildingUnitId: "", //ID
doorName: "", //
houseType: "1", //
purpose: "1", //
rentFlag: 1, //10
ownerPhone: "", //
ownerName: "", //
ownerIdCard: "", //
};
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
computed: {},
props: {},
};
</script>
<style lang="scss" scoped>
.item_width_1 {
width: 500px;
}
.item_width_2 {
width: 400px;
}
.item_width_3 {
margin-left: 10px;
width: 200px;
}
.div_btn {
display: flex;
justify-content: flex-end;
}
.el-tabs {
margin: 0 20px;
}
.el-upload__tip {
color: rgb(155, 155, 155);
margin: 0;
}
.form {
margin-top: 30px;
}
</style>
<style>
.el-dialog__body {
padding: 0 10px 20px !important;
}
</style>

184
src/views/modules/shequ/cpts/pan-chart.vue

@ -0,0 +1,184 @@
<template>
<div class="m-chart">
<canvas id="myChart" :width="width" :height="height" />
</div>
</template>
<script>
import nextTick from "dai-js/tools/nextTick";
import F2 from "@antv/f2/lib/index-all";
// iosbug
const fontFamily = "PingFang SC";
const fontSize = 14;
let chart;
let srcData = [];
const iniChart = function (config, srcData, total) {
chart = new F2.Chart({
id: "myChart",
...config,
});
let data = [
{
const: "const",
name: "交通出行",
count: 51.39,
},
{
const: "const",
name: "饮食",
count: 356.68,
},
{
const: "const",
name: "生活日用",
count: 20.0,
},
{
const: "const",
name: "住房缴费",
count: 116.53,
},
];
console.log("-----------------------------------", srcData);
data = srcData;
chart.source(data);
chart.coord("polar", {
transposed: true,
radius: 0.9,
innerRadius: 0.6,
});
chart.axis(false);
chart.legend(false);
// chart.legend({
// position: "bottom",
// align: "center",
// });
chart.tooltip(false);
chart.guide().html({
position: ["50%", "50%"],
html: `<div style="text-align: center;width:150px;height: 35px;">\n <p style="font-size: 18px;color: #999;margin: 0" id="title">总人数</p>\n <p style="font-size: 30px;color: #343434;margin: 0;font-weight: bold;" id="count">${total}</p>\n </div>`,
});
chart
.interval()
.position("const*count")
.adjust("stack")
.color("name", [
"#e70014",
"#ea6200",
"#f59701",
"#fcc900",
"#fef200",
"#cedc01",
"#8fc41e",
"#22ad38",
"#009b44",
"#009c6c",
"#019e97",
"#00a1be",
"#00a2c1",
"#00a0ea",
"#0085d2",
"#0067b6",
"#00469b",
"#1d2089",
"#5e1986",
"#920784",
"#bd0081",
"#e5007f",
"#e5026d",
"#e4024e",
"#e40031",
]);
chart.pieLabel({
sidePadding: 30,
activeShape: true,
label1: function label1(data) {
return {
text: data.count + "人",
fill: "#343434",
fontWeight: "bold",
fontSize: 14
};
},
label2: function label2(data) {
return {
text: data.name,
fill: "#999",
fontSize: 14
};
},
onClick: function onClick(ev) {
const data = ev.data;
if (data) {
// $("#title").text(data.name);
// $("#count").text(data.count);
}
},
});
chart.render();
// chart return
return chart;
};
export default {
name: "chart",
props: {
list: {
type: Array,
default: () => {
return [];
},
},
total: {
type: Number,
default: 0,
},
config: {
type: Object,
default: () => {
return {};
},
},
width: {
type: Number,
default: 400,
},
height: {
type: Number,
default: 260,
},
},
data() {
return {
iniLoading: false,
};
},
watch: {
list(data) {
// chart.changeData(data);
srcData = data;
},
},
async created() {
await nextTick(200);
iniChart(this.config, this.list, this.total);
await nextTick(200);
this.iniLoading = true;
},
methods: {
setList(data) {
chart.changeData(data);
srcData = data;
},
},
};
</script>
<style lang="scss" scoped></style>

513
src/views/modules/shequ/cpts/people-more.vue

@ -0,0 +1,513 @@
<template>
<div class="m-pop">
<div class="wrap">
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<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>
<div class="line"></div>
</div>
<div class="tabs">
<div
class="tab-btn"
@click="subStartGroupIndex"
v-if="groupList.length > 9"
>
<img src="@/assets/img/shuju/people/arrow-double-left.png" />
</div>
<div
v-show="index >= startGroupIndex && index < startGroupIndex + 9"
class="tab"
:class="groupIndex % groupList.length == index ? 'z-on' : ''"
:key="'tab' + index"
@click="groupIndex = index"
v-for="(item, index) in groupList"
>
{{ item.label }}
</div>
<div
class="tab-btn"
@click="addStartGroupIndex"
v-if="groupList.length > 9"
>
<img src="@/assets/img/shuju/people/arrow-double-right.png" />
</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>
</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>
</div>
</div>
</cpt-card>
</div>
</div>
</template>
<script>
import cptCard from "@/views/modules/visual/cpts/card";
import { requestPost } from "@/js/dai/request";
export default {
name: "peopleMore",
props: {
userId: {
type: String,
default: "",
},
gridName: {
type: String,
default: "",
},
},
components: {
cptCard,
},
data() {
return {
fieldList: [],
groupList: [],
groupIndex: 0,
startGroupIndex: 0,
info: {},
allInfo: {},
xiaoquList: [],
louList: [],
danyuanList: [],
homeList: [],
};
},
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 "";
},
},
watch: {
userId() {
this.getApiData();
},
},
mounted() {
this.getApiData();
},
methods: {
addStartGroupIndex() {
const { startGroupIndex, groupList } = this;
if (startGroupIndex < groupList.length - 9) {
this.startGroupIndex = startGroupIndex + 1;
} else {
this.startGroupIndex = groupList.length - 9;
}
},
subStartGroupIndex() {
const { startGroupIndex, groupList } = this;
if (startGroupIndex > 0) {
this.startGroupIndex = startGroupIndex - 1;
} else {
this.startGroupIndex = 0;
}
},
handleClose() {
this.$emit("close");
},
async getApiData() {
await this.getField();
await this.getInfo();
this.getXiaoquList();
this.getLouList();
this.getDanyuanList();
this.getHomeList();
},
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("、");
}
}
return "--";
},
//
async getField() {
const url = "/oper/customize/icform/getcustomerform";
const { data, code, msg } = await requestPost(url, {
dynamic: true,
formCode: "resi_base_info",
});
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
);
}
});
});
} else {
this.$message.error(msg);
}
},
//
async getInfo() {
const url = "/epmetuser/icresiuser/detail";
const { data, code, msg } = await requestPost(url, {
icResiUserId: this.userId,
formCode: "resi_base_info",
});
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);
}
});
});
} else {
this.$message.error(msg);
}
},
//
async getOptions(url) {
if (!url) return [];
const { data, code, msg } = await requestPost(url, {});
if (code === 0) {
return data;
} else {
return [];
}
},
async getXiaoquList() {
const url = "/gov/org/icneighborhood/neighborhoodoption";
const { data, code, msg } = await requestPost(url, {
agencyId: this.info.AGENCY_ID,
gridId: this.info.GRID_ID,
});
if (code === 0) {
this.xiaoquList = data;
} else {
this.$message.error(msg);
}
},
async getLouList() {
const url = "/gov/org/icbuilding/buildingoption";
const { data, code, msg } = await requestPost(url, {
neighborHoodId: this.info.VILLAGE_ID,
});
if (code === 0) {
this.louList = data;
} else {
this.$message.error(msg);
}
},
async getDanyuanList() {
const url = "/gov/org/icbuildingunit/unitoption";
const { data, code, msg } = await requestPost(url, {
buildingId: this.info.BUILD_ID,
});
if (code === 0) {
this.danyuanList = data;
} else {
this.$message.error(msg);
}
},
async getHomeList() {
const url = "/gov/org/ichouse/houseoption";
const { data, code, msg } = await requestPost(url, {
unitId: this.info.UNIT_ID,
});
if (code === 0) {
this.homeList = data;
} else {
this.$message.error(msg);
}
},
},
};
</script>
<style
lang="scss"
src="@/assets/scss/modules/visual/people.scss"
scoped
></style>

205
src/views/modules/shequ/cpts/xuqiu-info.vue

@ -0,0 +1,205 @@
<template>
<div>
<div>
<el-form
ref="ref_form"
:inline="false"
:model="dataForm"
:disabled="formType === 'detail'"
class="form"
>
<el-form-item
label="状态"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.statusName }}</span>
</el-form-item>
<el-form-item
label="所属网格"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.gridName }}</span>
</el-form-item>
<el-form-item
label="需求类型"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.categoryName }}</span>
</el-form-item>
<el-form-item
label="需求内容"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.content }}</span>
</el-form-item>
<el-form-item
label="上报类型"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.reportTypeName }}</span>
</el-form-item>
<el-form-item
label="上报人"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.reportUserName }}</span>
</el-form-item>
<el-form-item
label="上报时间"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.reportTime }}</span>
</el-form-item>
<el-form-item
label="需求人"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.demandUserName }}</span>
</el-form-item>
<el-form-item
label="服务方"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.serviceShowName }}</span>
</el-form-item>
<el-form-item
label="服务时间"
label-width="150px"
style="display: block"
>
<span>{{ dataForm.wantServiceTime }}</span>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button @click="handleCancle">关闭</el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request";
let loading; //
export default {
data() {
return {
formType: "detail", // addeditdetail
dataForm: {
neighborHoodId: "", // ID
buildingId: "", //ID
buildingUnitId: "", //ID
doorName: "", //
houseType: "", //
purpose: "", //
rentFlag: 1, //10
ownerPhone: "", //
ownerName: "", //
ownerIdCard: "", //
},
};
},
components: {},
mounted() {},
methods: {
async initForm(type, row) {
this.$refs.ref_form.resetFields();
this.formType = type;
if (row) {
this.dataForm = JSON.parse(JSON.stringify(row));
}
},
handleCancle() {
this.$emit("dialogCancle");
this.resetData();
},
resetData() {
this.dataForm = {
neighborHoodId: "", // ID
buildingId: "", //ID
buildingUnitId: "", //ID
doorName: "", //
houseType: "1", //
purpose: "1", //
rentFlag: 1, //10
ownerPhone: "", //
ownerName: "", //
ownerIdCard: "", //
};
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
computed: {},
props: {},
};
</script>
<style lang="scss" scoped>
.item_width_1 {
width: 500px;
}
.item_width_2 {
width: 400px;
}
.item_width_3 {
margin-left: 10px;
width: 200px;
}
.div_btn {
display: flex;
justify-content: flex-end;
}
.el-tabs {
margin: 0 20px;
}
.el-upload__tip {
color: rgb(155, 155, 155);
margin: 0;
}
.form {
margin-top: 30px;
}
</style>
<style>
.el-dialog__body {
padding: 0 10px 20px !important;
}
</style>

1018
src/views/modules/shequ/index.vue

File diff suppressed because it is too large

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

@ -1,13 +1,13 @@
<template>
<div class="m-chart">
<canvas id="myChart"
:width="width"
:height="height" />
<canvas id="myChart" :width="width" :height="height" />
</div>
</template>
<script>
import nextTick from "dai-js/tools/nextTick";
import F2 from "@antv/f2/lib/index-all";
// iosbug
const fontFamily = "PingFang SC";
const fontSize = 14;
@ -28,7 +28,7 @@ const addTextShape = () => {
const group = canvas.addGroup();
const shapes = {};
function addFn (list) {
function addFn(list) {
const listLength = list.length;
list.forEach(function (obj, index) {
//
@ -68,7 +68,7 @@ const addTextShape = () => {
};
const iniChart = function (config, srcData) {
chart = new window.F2.Chart({
chart = new F2.Chart({
id: "myChart",
...config,
});
@ -132,7 +132,7 @@ const iniChart = function (config, srcData) {
items: [
{
name: "支持",
marker (x, y, r, ctx) {
marker(x, y, r, ctx) {
ctx.lineWidth = 10;
ctx.strokeStyle = supColor;
ctx.moveTo(x - r - 15, y);
@ -143,7 +143,7 @@ const iniChart = function (config, srcData) {
},
{
name: "反对",
marker (x, y, r, ctx) {
marker(x, y, r, ctx) {
ctx.lineWidth = 10;
ctx.strokeStyle = oppColor;
ctx.moveTo(x - r - 15, y);
@ -200,19 +200,19 @@ export default {
default: 260,
},
},
data () {
data() {
return {
iniLoading: false,
};
},
watch: {
list (data) {
list(data) {
chart.changeData(data);
srcData = data;
addTextShape();
},
},
async created () {
async created() {
await nextTick(200);
iniChart(this.config, this.list);
await nextTick(200);
@ -220,12 +220,12 @@ export default {
},
methods: {
setList (data) {
setList(data) {
chart.changeData(data);
srcData = data;
addTextShape();
},
}
},
};
</script>

Loading…
Cancel
Save