Commit 75ae1f5e authored by levante's avatar levante

标签合并

parents 3d3e0ddf 9ef682ef
{ {
"Layout": [ "Layout": [
{ {
"path": "/documents/fiveSearch", "name": "fiveSearch", "path": "/month", "name": "month",
"meta": { "title": "物业三查", "menuPath": true,"authCode":"0007", "menuIcon": "profile", "hideInBread": true }, "meta": { "title": "检查单", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [ "children": [
{ {
"path": "/documents/fiveSearch/managerSelfCheckList", "name": "managerSelfCheckList", "path": "/month/monthList", "name": "month",
"meta": { "title": "小区经理自查", "menuPath": true,"authCode":"000701", "hideInBread": false}, "meta": { "title": "房办月查", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [ "children": [
{ {
"path": "/documents/fiveSearch/managerSelfCheckList/managerCheckList", "name": "managerCheckList", "path": "/month/monthList/monthListSect", "name": "monthListSect",
"meta": { "title": "小区经理自查检查单列表","authCode":"000701", "menuPath": false, "hideInBread": false } "meta": { "title": "房办月查小区列表", "menuPath": false, "hideInBread": false},
},
{
"path": "/documents/fiveSearch/managerSelfCheckList/managerCheckInfo", "name": "managerCheckInfo",
"meta": { "title": "小区经理自查检查单详情","authCode":"00070101", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/fiveSearch/managerSelfCheckList/managerAllIn", "name": "allIn",
"meta": { "title": "街道检查情况汇总","authCode":"00070102", "menuPath": false, "hideInBread": false }
}
]
},
{
"path": "/documents/fiveSearch/doubleWeekCheckList", "name": "doubleWeekCheckList",
"meta": { "title": "物企双周查","authCode":"000702", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/fiveSearch/doubleWeekCheckList/doubleCheckList", "name": "doubleCheckList",
"meta": { "title": "物企双周查列表","authCode":"000702" ,"menuPath": false, "hideInBread": false }
},
{
"path": "/documents/fiveSearch/doubleWeekCheckList/doubleCheckInfo", "name": "doubleCheckInfo",
"meta": { "title": "物企双周查详情","authCode":"00070201", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/fiveSearch/doubleWeekCheckList/doubleAllIn", "name": "allIn",
"meta": { "title": "街道检查情况汇总","authCode":"00070202", "menuPath": false, "hideInBread": false}
}
]
},
{
"path": "/documents/fiveSearch/monthList", "name": "month",
"meta": { "title": "房办月查","authCode":"000704", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/fiveSearch/monthList/monthListSect", "name": "monthListSect",
"meta": { "title": "房办月查小区列表","authCode":"000704", "menuPath": true, "hideInBread": false },
"children": [ "children": [
{ {
"path": "/documents/fiveSearch/monthList/monthListSect/monthInfo", "name": "monthInfo", "path": "/month/monthList/monthListSect/monthInfo", "name": "monthInfo",
"meta": { "title": "检查详情","authCode":"00070401", "menuPath": false, "hideInBread": false } "meta": { "title": "检查详情", "menuPath": false, "hideInBread": false}
} }
] ]
} }
] ]
}, }
{ ]
"path": "/documents/fiveSearch/mutableList", "name": "mutableList", },
"meta": { "title": "整改单列表","authCode":"000703", "menuPath": true, "hideInBread": false }, {
"path": "/repair", "name": "repairList",
"meta": { "title": "应急报修", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/repair/repairList", "name": "repairInnerList",
"meta": { "title": "应急报修列表", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [ "children": [
{ {
"path": "/documents/fiveSearch/mutableList/info", "name": "mutableInfo", "path": "/repair/repairInfo", "name": "repairInfo",
"meta": { "title": "整改单详情","authCode":"00070301", "menuPath": false, "hideInBread": false } "meta": { "title": "报修详情", "menuPath": false, "hideInBread": false}
} }
] ]
} }
] ]
}, },
{ {
"path": "/documents/repair", "name": "repairList", "path": "/tousu", "name": "tousu",
"meta": { "title": "应急报修","authCode":"0005", "menuIcon": "profile", "menuPath": true, "hideInBread": false }, "meta": { "title": "投诉信息", "menuPath": true, "menuIcon": "profile", "hideInBread": true },
"children": [ "children": [
{ {
"path": "/documents/repair/repairList", "name": "repairInnerList", "path": "/tousu/tousuQuestion", "name": "tousuQuestion",
"meta": { "title": "应急报修列表","authCode":"000501", "menuIcon": "profile", "menuPath": true, "hideInBread": false }, "meta": { "title": "投诉问题排行", "menuIcon": "profile", "menuPath": true, "hideInBread": false},
"children": [ "children": [
{ {
"path": "/documents/repair/repairInfo", "name": "repairInfo", "path": "/tousu/tousuQuestion/questionInfo", "name": "questionInfo",
"meta": { "title": "报修详情","authCode":"000501", "menuPath": false, "hideInBread": false } "meta": { "title": "投诉问题列表", "menuPath": false, "hideInBread": false}
},
{
"path": "/tousu/tousuQuestion/tousuDetails", "name": "tousuDetails",
"meta": { "title": "投诉问题详情", "menuPath": false, "hideInBread": false}
} }
] ]
},
{
"path": "/tousu/tousuDensity", "name": "tousuDensity",
"meta": { "title": "投诉密度排行", "menuIcon": "profile", "menuPath": true, "hideInBread": false}
} }
] ]
}, },
{ {
"path": "/documents/tousu", "name": "tousu", "path": "/fiveSearch", "name": "fiveSearch",
"meta": { "title": "投诉信息","authCode":"0006", "menuPath": true, "menuIcon": "profile", "hideInBread": true }, "meta": { "title": "物业五查", "menuPath": true, "menuIcon": "profile", "hideInBread": true },
"children": [ "children": [
{ {
"path": "/documents/tousu/tousuQuestion", "name": "tousuQuestion", "path": "/fiveSearch/managerSelfCheckList", "name": "managerSelfCheckList",
"meta": { "title": "投诉问题排行","authCode":"000601", "menuIcon": "profile", "menuPath": true, "hideInBread": false }, "meta": { "title": "小区经理自查", "menuPath": true, "hideInBread": false },
"children": [ "children": [
{ {
"path": "/documents/tousu/tousuQuestion/questionInfo", "name": "questionInfo", "path": "/fiveSearch/managerSelfCheckList/managerCheckList", "name": "managerCheckList",
"meta": { "title": "投诉问题列表","authCode":"000601", "menuPath": false, "hideInBread": false } "meta": { "title": "小区经理自查检查单列表", "menuPath": false, "hideInBread": false }
}, },
{ {
"path": "/documents/tousu/tousuQuestion/tousuDetails", "name": "tousuDetails", "path": "/fiveSearch/managerSelfCheckList/managerCheckInfo", "name": "managerCheckInfo",
"meta": { "title": "投诉问题详情","authCode":"00060101", "menuPath": false, "hideInBread": false } "meta": { "title": "小区经理自查检查单详情", "menuPath": false, "hideInBread": false }
},
{
"path": "/fiveSearch/managerSelfCheckList/managerAllIn", "name": "allIn",
"meta": { "title": "街道检查情况汇总", "menuPath": false, "hideInBread": false }
} }
] ]
}, },
{ {
"path": "/documents/tousu/tousuDensity", "name": "tousuDensity", "path": "/fiveSearch/doubleWeekCheckList", "name": "doubleWeekCheckList",
"meta": { "title": "投诉密度排行","authCode":"000602", "menuIcon": "profile", "menuPath": true, "hideInBread": false } "meta": { "title": "物企双周查", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/fiveSearch/doubleWeekCheckList/doubleCheckList", "name": "doubleCheckList",
"meta": { "title": "物企双周查列表", "menuPath": false, "hideInBread": false }
},
{
"path": "/fiveSearch/doubleWeekCheckList/doubleCheckInfo", "name": "doubleCheckInfo",
"meta": { "title": "物企双周查详情", "menuPath": false, "hideInBread": false }
},
{
"path": "/fiveSearch/doubleWeekCheckList/doubleAllIn", "name": "allIn",
"meta": { "title": "街道检查情况汇总", "menuPath": false, "hideInBread": false }
}
]
},
{
"path": "/fiveSearch/mutableList", "name": "mutableList",
"meta": { "title": "整改单列表", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/fiveSearch/mutableList/info", "name": "mutableInfo",
"meta": { "title": "整改单详情", "menuPath": false, "hideInBread": false }
}
]
},
{
"path": "/fiveSearch/monthList", "name": "month",
"meta": { "title": "房办月查", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/fiveSearch/monthList/monthListSect", "name": "monthListSect",
"meta": { "title": "房办月查小区列表", "menuPath": false, "hideInBread": false },
"children": [
{
"path": "/fiveSearch/monthList/monthListSect/monthInfo", "name": "monthInfo",
"meta": { "title": "检查详情", "menuPath": false, "hideInBread": false }
}
]
}
]
} }
] ]
}, },
{ {
"path": "/documents/ledger", "name": "ledger", "path": "/ledger", "name": "ledger",
"meta": { "title": "区房屋台账","authCode":"0008", "menuIcon": "profile", "menuPath": true, "hideInBread": false }, "meta": { "title": "区房屋台账", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [ "children": [
{ {
"path": "/documents/ledger/community", "name": "communityList", "path": "/ledger/community", "name": "communityList",
"meta": { "title": "住宅房屋","authCode":"0008", "menuIcon": "profile", "menuPath": true, "hideInBread": false }, "meta": { "title": "住宅房屋", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [ "children": [
{ {
"path": "/documents/ledger/community/info", "name": "communityInfo", "path": "/ledger/community/info", "name": "communityInfo",
"meta": { "title": "详情","authCode":"0008", "menuIcon": "profile", "menuPath": false, "hideInBread": false } "meta": { "title": "详情", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
}, },
{ {
"path": "/documents/ledger/community/equipment", "name": "equipment", "path": "/ledger/community/equipment", "name": "equipment",
"meta": { "title": "设备信息","authCode":"0008", "menuIcon": "profile", "menuPath": false, "hideInBread": false } "meta": { "title": "设备信息", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
}, },
{ {
"path": "/documents/ledger/community/building", "name": "communityBuilding", "path": "/ledger/community/building", "name": "communityBuilding",
"meta": { "title": "门牌幢列表","authCode":"0008", "menuIcon": "profile", "menuPath": false, "hideInBread": false } "meta": { "title": "门牌幢列表", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
} }
] ]
}, },
{ {
"path": "/documents/ledger/NonResident", "name": "NonResident", "path": "/ledger/NonResident", "name": "NonResident",
"meta": { "title": "非居房屋","authCode":"0008", "menuIcon": "profile", "menuPath": true, "hideInBread": false }, "meta": { "title": "非居房屋", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [ "children": [
{ {
"path": "/documents/ledger/NonResident/info", "name": "NonResidentInfo", "path": "/ledger/NonResident/info", "name": "NonResidentInfo",
"meta": { "title": "非居详情","authCode":"0008", "menuIcon": "profile", "menuPath": false, "hideInBread": false } "meta": { "title": "非居详情", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
}, },
{ {
"path": "/documents/ledger/NonResident/building", "name": "NonResidentBuilding", "path": "/ledger/NonResident/building", "name": "NonResidentBuilding",
"meta": { "title": "非居门牌幢列表","authCode":"0008", "menuIcon": "profile", "menuPath": false, "hideInBread": false } "meta": { "title": "非居门牌幢列表", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
} }
] ]
} }
......
...@@ -25,4 +25,4 @@ router.beforeEach((to, from, next) => { ...@@ -25,4 +25,4 @@ router.beforeEach((to, from, next) => {
} }
}) })
export default router export default router
\ No newline at end of file
...@@ -140,12 +140,20 @@ const appRoutes = [ ...@@ -140,12 +140,20 @@ const appRoutes = [
}, },
] ]
}, },
{ // 标签管理
path: '/systemManagement/lvot', name: 'lvot', component: resolve => require(['@/views/label/labelList'], resolve), //Tbls,
meta: { title: '标签管理', menuPath: true, menuIcon: 'setting', hideInBread: false, },
},
] ]
}, },
{ {
path: '/house', name: 'house', component: resolve => require(['@/components/Layout/content-wrapper'], resolve), // ContentWrapper, path: '/house', name: 'house', component: resolve => require(['@/components/Layout/content-wrapper'], resolve), // ContentWrapper,
meta: { title: '住宅信息', menuPath: true, menuIcon: 'home', hideInBread: true, requirePerm: false, authCode: '0001' }, meta: { title: '住宅信息', menuPath: true, menuIcon: 'profile', hideInBread: true, requirePerm: false },
children: [ children: [
{
path: '/houseData/basicInfoByLabel', name: 'basicInfoByLabel', component: resolve => require(['@/views/houseData/basicInfoByLabel'], resolve), //basicInfo,
meta: { title: '小区列表-标签', menuPath: true, hideInBread: false, },
},
{ // 小区列表 { // 小区列表
path: '/houseData/basicInfo', name: 'basicInfo', component: resolve => require(['@/views/houseData/basicInfo'], resolve), //basicInfo, path: '/houseData/basicInfo', name: 'basicInfo', component: resolve => require(['@/views/houseData/basicInfo'], resolve), //basicInfo,
meta: { title: '住宅小区', menuPath: true, hideInBread: false, authCode: '000101', menuIcon: 'home'}, meta: { title: '住宅小区', menuPath: true, hideInBread: false, authCode: '000101', menuIcon: 'home'},
......
...@@ -39,8 +39,10 @@ default: // 默认环境下(开发环境) ...@@ -39,8 +39,10 @@ default: // 默认环境下(开发环境)
// BASE_URL = 'http://211.136.105.193/apiv2' // BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://yangpu.hm.omniview.pro/api/v2' // BASE_URL = 'http://yangpu.hm.omniview.pro/api/v2'
// BASE_URL = 'http://huangpu-hm.omniview.pro/api/v2' // BASE_URL = 'http://huangpu-hm.omniview.pro/api/v2'
BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2' // BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
// BASE_URL = 'http://pudong.hm.omniview.pro/api/v2' // BASE_URL = 'http://pudong.hm.omniview.pro/api/v2'
// BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
// BASE_URL = 'http://211.136.105.193/apiv2' // BASE_URL = 'http://211.136.105.193/apiv2'
break break
} }
...@@ -209,4 +211,19 @@ export default { ...@@ -209,4 +211,19 @@ export default {
GET_RIZHI_INFO: '/service-log/operateRecord/{id}', //日志详情 GET_RIZHI_INFO: '/service-log/operateRecord/{id}', //日志详情
GET_XIAOQUTOTAL: '/service-basicdatasync-ddd/summary/community/totare', //查询小区住宅面积,总楼栋数,总户数信息 GET_XIAOQUTOTAL: '/service-basicdatasync-ddd/summary/community/totare', //查询小区住宅面积,总楼栋数,总户数信息
GET_LABEL_LIST: '/service-customkey-ddd/label/tree', // 获取标签列表
GET_LABEL_DETAIL: '/service-customkey-ddd/label/{id}', // 查看标签详情
DELETE_SINGLE_LABEL: '/service-customkey-ddd/label/{id}', // 根据id删除某个标签
POST_SINGLE_LABEL: '/service-customkey-ddd/label', // 新增标签
PUT_LABEL_INFO: '/service-customkey-ddd/label/{id}', // 修改标签信息
POST_AVAILABLE_KEY: '/service-customkey-ddd/entityKeyDic', // 可查询字段新增
PUT_AVAILABLE_KEY: '/service-customkey-ddd/entityKeyDic/{id}', // 可查询字段修改
GET_AVAILABLE_KEY_LIST: '/service-customkey-ddd/entityKeyDics', // 可查询字段列表
DELETE_AVAILABLE_KEY: '/service-customkey-ddd/entityKeyDic/{id}', // 删除字段
GET_SINGLE_KEY_INFO: '/service-customkey-ddd/entityKeyDic/{id}', //可查询字段详情
GET_LABEL_BIND_FILTER_RESULT: '/service-customkey-ddd/labelResource', // 点击保存后查询是否有结果,有结果则调用绑定接口
POST_LABEL_RESULT_PREVIEW: '/service-customkey-ddd/findLabelObject', // 标签预览
POST_LABEL_CREATE_CONFIRM: '/service-customkey-ddd/label/confirm',
GET_ID_INFO_BY_LABEL: '/service-customkey-ddd/label/resource/datas',
GET_WY_AND_YWH_LIST: '/service-customkey-ddd/datas'
} }
// 多选框,表格,批量操作的组件
<template>
<div>
<div class="portalTableOperates">
<p style="textAlign:left;margin:-10px;marginLeft:10px;" v-if="$route.name == 'basicInfo'">
小区总数: {{pagination.total != '' ? pagination.total+'个': '暂无数据'}},&nbsp;&nbsp;&nbsp;
房屋总面积: {{pagination.totStCnstArea != '0' ? pagination.totStCnstArea+'平方米': '暂无数据'}} ,&nbsp;&nbsp;&nbsp;
总门牌数: {{pagination.totUnits != '0' ? pagination.totUnits+'幢': '暂无数据'}} ,&nbsp;&nbsp;&nbsp;
总分户数: {{pagination.totHous != '0' ? pagination.totHous+'户': '暂无数据'}}&nbsp;&nbsp;&nbsp;
</p>
<a-table class="portalTable"
size="small"
:rowSelection="rowSelection"
rowKey="id"
:pagination="pagination"
:columns="customKeyEnable=='true' ? newColumns: $parent.columns"
:dataSource="tableData"
bordered
>
<span slot="action" slot-scope="text, record">
<span class="actionBtn" @click="toView(tbl, record)">查看 </span>
<a-dropdown :trigger="['click']" v-if="customKeyEnable == 'true' || $route.name=='basicInfo' || $route.name=='propertyInfo' || $route.name=='indCous'">
<a class="ant-dropdown-link" href="#">| 更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item key="0" v-if="$route.name == 'basicInfo' || $route.name == 'nonResidents'">
<a @click="$parent.toBul(record)"> 门牌幢 </a>
</a-menu-item>
<!-- <a-menu-item key="1" v-if="$route.name == 'basicInfo'">
<a @click="$parent.toShebei(record)"> 设施设备 </a>
</a-menu-item> -->
<a-menu-item key="2" v-if="$route.name == 'indCous'">
<a @click="$parent.toMem(record)"> 成员列表 </a>
</a-menu-item>
<a-menu-item key="3" v-if="$route.name == 'propertyInfo'">
<a @click="$parent.toList(record.cspId)"> 小区列表 </a>
</a-menu-item>
<a-menu-item key="4" v-if="customKeyEnable == 'true'">
<a @click="showModal(record)"> 拓展信息维护</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
<zdyModal ref="modal" :selectedRowKeys="selectedRowKeys" :searchParams="searchParams" :isSingle="isSingle" :resourceId="resourceId" :tbl="tbl" :extList="extList" :isAll="isAll" @saveSingleKeys="saveSingleKeys" @saveSomeKeys="saveSomeKeys"/>
<!-- <BatchOperation v-if="customKeyEnable== 'true'" @choose="choose" @chooseAll="chooseAll"/> -->
</div>
</div>
</template>
<script>
export default {
name: 'tableAndMut',
props: {
tableData: {
type: Array
},
pagination: {
type: Object
},
tbl: {
type: String
},
},
data(){
return {
formTab: this.$form.createForm(this),
// form : this.$form.createForm(this),
nowNum: 0, // 当前已选字段的数量
newColumns: [], // 开启自定义字段展示的列(根据多选框变化的展示列)
allKeys: [], // 所有可展示的字段(对象数组,含keyname 和key)
selKeys: [], // 选中展示字段(含key和keyName)
selKeysList: [], // 选中展示字段(仅key), 给多选框用
maxLength: 6, // 最大展示的数量
customKeyEnable: false, // cookie里存的 是否开启自定义字段
extList: [], // ext请求到的所有自定义字段列表
resourceId: '', // 当前小区的id
selectList: [], // 批量操作小区id数组
isSingle: true, // 批量还是单个
isAll: true, // 全量还是已选中
searchList: [], // 动态渲染的搜索列表
keyCodeList: [], // 动态搜索的keycode列表
searchParams: {}, // 搜索的列表
selectedRowKeys: []
}
},
created () { // 进页面获取数据
this.customKeyEnable=this.$cookie.get('customKeyEnable')
if(this.customKeyEnable && this.customKeyEnable == 'true'){
this.getKeys()
this.getAllKeys()
// this.$parent.getList()
}else {
this.$parent.getList()
}
},
mounted(){
console.log(this.$parent)
},
computed: {
rowSelection() {
const { selectedRowKeys } = this
return {
selectedRowKeys,
onChange: this.onSelectChange,
onSelection: this.onSelection,
}
},
},
methods: {
toView(tbl, record) {
switch (tbl) {
case 'tbl_community':
this.$router.push({path: `/houseData/basicInfo/${record.id}`, query: {id: record.id, name: record.cspName}})
break
case 'tbl_building':
this.$router.push({path: `/houseData/buildings/${record.id}`})
break
case 'tbl_prop_company':
this.$router.push({path: `/houseData/propertyInfo/${record.id}`, query: {id: record.id, name: record.cspName }})
break
case 'tbl_industry_council':
this.$router.push({path: `/houseData/indCou/${record.id}`, query: {id: record.id}})
break
default:
break
}
},
selKeysNew(val) { //重新赋值选中项数组
this.selKeysList = val
},
/**
* 重新赋值展示的列 和当前选中数
*/
changeColumnsList(value){
// 当前已选中数
this.nowNum = value.length-1
// 重新赋值给展示的列 newColumns
this.newColumns = value
// 存入cookie
this.$com.saveColumnsCookie(this.tbl, this.selKeysList, this.allKeys)
},
onSelectChange(selectedRowKeys) { // 被勾选的数据
this.selectedRowKeys = selectedRowKeys
},
getKeys(){ // 获取可显示全部表格字段 和 maxlength
this.$ajax.get({
url: this.$api.GET_KEYS.replace('{table}', this.tbl),
}).then(res => {
if (res.code == 200) {
this.maxLength = !!this.$com.confirm(res, 'data.content.maxLength', []) ? this.$com.confirm(res, 'data.content.maxLength', []) : this.maxLength
this.allKeys = this.$com.confirm(res, 'data.content.allKeys', []) // 全部字段存入allkeys
// 优先获取本地已选字段,没有则取allkeys里面的
this.selKeys = this.$cookie.get(this.tbl) ? JSON.parse(this.$cookie.get(this.tbl)) : this.allKeys.slice(0, this.maxLength)
// 判断本地的已选字段是否在全部字段当中,被删除的自定义字段会被删除 (处理可能被删除的自定义字段)
const newArr= []
this.selKeys.forEach(col => {
this.allKeys.forEach(item => {
if (col.key == item.key) {
newArr.push(col)
return
}
})
})
// 重新赋值已选中字段 (处理可能被删除的自定义字段)
this.selKeys = newArr
// 此时得到了allkeys和selkeys (带key 和 keyName) 需要变成 只有key的数组(多选框要用)
this.selKeys.forEach(col => {
this.selKeysList.push(col.key)
})
// 已选中的数根据selkeys的长度实时展示
this.nowNum = this.selKeys.length
// 1.根据allkeys重写全部的列
console.log(this.$parent.columns, '99999')
this.$parent.columns = []
this.allKeys.forEach(col => {
if(col.key.indexOf('&') != -1){ // 如果有& 就取xx.xx
this.$parent.columns.push( {
title: col.keyName,
dataIndex: col.key.split('&')[0] +'.'+ col.key.split('&')[1],
key: col.key.split('&')[0] +'.'+ col.key.split('&')[1]
}, )
}else{
this.$parent.columns.push( {
title: col.keyName,
dataIndex: col.key,
key: col.key
}, )
}
})
// 2.根据selkeys重写选中的列
this.newColumns = []
this.selKeys.forEach(col => {
if(col.key.indexOf('&') != -1){ // 如果有& 就取xx.xx
this.newColumns.push( {
title: col.keyName,
dataIndex: col.key.split('&')[0] +'.'+ col.key.split('&')[1],
key: col.key.split('&')[0] +'.'+ col.key.split('&')[1]
}, )
}else{
this.newColumns.push( {
title: col.keyName,
dataIndex: col.key,
key: col.key
}, )
}
})
// 增加 操作
this.newColumns.push({
title: '操作',
dataIndex: 'action',
width: 160,
scopedSlots: {
customRender: 'action'
}
})
this.newColumns.forEach(col => {
if(col.key == 'addrFrst'){
col.width = '30%'
}
})
}
})
},
showModal(row) { //展开模态框
this.resourceId = row.id
this.isAll = false
this.isSingle = true
this.getExtKey(row)
},
async getExtKey(row){
// 处理过的返回数值
await this.$ajax.get({
url: this.$api.GET_SAFE_EXT.replace('{table}', this.tbl).replace('{id}', row.id),
}).then(res => {
if (res.code == 200) {
this.extList = this.$com.confirm(res, 'data.content', [])
this.$refs.modal.isShow = true
}
})
this.$refs.modal.seeData()
},
async getAllKeys(){ // 获取当前列表下所有的自定义字段
await this.$ajax.get({
url: this.$api.GET_TBLS_KEYS,
params: {
tbl: this.tbl,
pageSize: 10000
}
}).then(res => {
if (res.code == 200) {
this.searchList = []
this.extList = this.$com.confirm(res, 'data.content', [])
this.extList.forEach(col => { // 遍历所有字段拿到 支持搜索的所有字段
if (col.canSearch==true) {
if (col.compntType == 'checkbox' || col.compntType == 'radio'||col.compntType == 'date'||col.compntType == 'select') {
} else {
col.keyCode = col.keyCode+ '_l'
}
this.searchList.push(col)
}
})
this.keyCodeList =[]
this.searchList.forEach(col => { // 支持搜索的字段遍历,取出keyCode
this.keyCodeList.push(col.keyCode)
})
this.$parent.searchList = this.searchList
this.$parent.keyCodeList = this.keyCodeList
}
})
},
saveSingleKeys(params){ // post保存一条自定义数据
this.$ajax.post({
url: this.$api.POST_EXT,
params: params,
}).then(() => {
this.$parent.getList()
this.$refs.modal.isShow = false
this.$refs.modal.formExt.resetFields()
})
},
saveSomeKeys(params){ // 批量post保存自定义
this.$ajax.post({
url: this.$api.POST_EXT_BATCH,
params: params,
}).then(res => {
if (res.code== '200') {
this.$refs.modal.formExt.resetFields()
this.$parent.getList()
this.$refs.modal.isShow = false
}
})
},
chooseAll(){
this.isAll = true
this.isSingle = false
this.$refs.modal.isShow = true
this.$refs.modal.seeData() // 打开弹窗恢复默认的选项
},
choose(){
this.isAll = false
this.isSingle = false
if (this.selectedRowKeys.length <1) {
this.$message.error('请勾选至少一条数据')
}else{
this.$refs.modal.isShow = true
}
this.$refs.modal.seeData() // 打开弹窗恢复默认的选项
},
},
}
</script>
<style>
</style>
...@@ -397,8 +397,8 @@ export default { ...@@ -397,8 +397,8 @@ export default {
this.getStreet() this.getStreet()
}, },
mounted(){ mounted(){
console.log(this.$api.BASE_URL.indexOf('10.220.105.137')!=-1 ) console.log(this.$api.BASE_URL.indexOf('211.136.105')!=-1 )
console.log(this.$parent)
if(this.$route.name == 'basicInfo'){ if(this.$route.name == 'basicInfo'){
this.$nextTick(function () { this.$nextTick(function () {
// setTimeout(() => { // setTimeout(() => {
......
// 小区列表
<template>
<div class="routerWapper">
<!-- {{checkedKeys}} -->
<div class="layoutMargin layoutPadding">
<a-row>
<a-col :span="4" style="height:100%; position:relative;" v-if="leftPanelShow">
<span style="display: block; width: 90%; color:#1890ff; font-size: 16px; font-weight: 500; padding-bottom:5px; border-bottom:1px solid #1890ff;">
标签筛选条件
</span>
<a-tree
@check='onCheck'
checkable
:tree-data="treeData"
:replace-fields="replaceFields"
/>
</a-col>
<a-button v-if="!leftPanelShow" @click="showNHide" type='link' icon='right' style="position: absolute; left: -2%; top: 14%; color: grey"/>
<a-button v-else @click="showNHide" type='link' icon='left' style="position: absolute; left: 14.5%; top: 14%; color: grey"/>
<a-col :span="!!leftPanelShow ? 20 : 24" :style="!!leftPanelShow? `padding-left: 10px; border-left:1px solid #ccc;`:`padding-left: 10px;`">
<!-- <p class="gayLine noline" /> -->
<div class="portalTableOperates">
<a-button type='primary' @click="searchXXXByLabel">查询</a-button>
<a-tabs default-active-key="1" @change="changeTbl">
<a-tab-pane key="tbl_community" tab="小区">
<TAM ref="childTab" :tableData="tableData_sect" :pagination="pagination" :tbl="tbl" />
</a-tab-pane>
<a-tab-pane key="tbl_building" tab="门牌">
<TAM ref="childTab" :tableData="tableData_mpz" :pagination="pagination" :tbl="tbl" />
</a-tab-pane>
<a-tab-pane key="tbl_prop_company" tab="物业">
<TAM ref="childTab" :tableData="tableData_wy" :pagination="pagination" :tbl="tbl" />
</a-tab-pane>
<a-tab-pane key="tbl_industry_council" tab="业委会">
<TAM ref="childTab" :tableData="tableData_ywh" :pagination="pagination" :tbl="tbl" />
</a-tab-pane>
</a-tabs>
</div>
<!-- </div> -->
<!-- <RouterWapper v-else></RouterWapper> -->
</a-col>
</a-row>
</div>
</div>
</template>
<script>
import TAM from '@/views/components/tableAndMutWithoutMulSel.vue'
const treeData = []
export default {
name: 'basicInfo',
components: {
TAM
},
data() {
return {
treeData,
tbl: 'tbl_community',
selectedKeys: [],
replaceFields: {
children: 'children',
title: 'labelName',
key: 'id'
},
checkedKeys: [],
simpleSearchForm: true, // 展示、收取简单搜索开关,true为简单搜索
levelType: [
{
name: '高层',
key: '1'
},
{
name: '多层',
key: '2'
},
{
name: '别墅',
key: '3'
},
],
leftPanelShow: true,
finishDate: [
{
name: '2000年以前',
key: '1'
},
{
name: '2000年以后',
key: '2'
},
],
neighbourType: [
{
name: '未成立',
key: '1'
},
{
name: '已成立',
key: '2'
},
{
name: '前期筹备中',
key: '3'
},
],
wuyeServiceType: [
{
name: '专业委托物业管理(前期阶段)',
key: '1'
},
{
name: '专业委托物业管理(业主大会阶段)',
key: '2'
},
{
name: '无人管理',
key: '3'
},
{
name: '自治管理',
key: '4'
},
{
name: '直管物业(公房)',
key: '5'
},
{
name: '单位自管(公房)',
key: '6'
},
],
customKeyEnable: false, // cookie里存的是否开启自定义字段
typeList: [ //小区性质的数据
{
name: '商品房',
key: '01'
},
{
name: '动迁房',
key: '02'
},
{
name: '共有产权保障房',
key: '03'
},
{
name: '售后房',
key: '04'
},
{
name: '直管公房',
key: '05'
},
{
name: '混合',
key: '06'
},
{
name: '系统公房',
key: '07'
},
{
name: '集体土地集资房',
key: '08'
},
{
name: '军产',
key: '09'
},
{
name: '私产',
key: '10'
},
{
name: '公租房',
key: '11'
},
],
searchList: [], // 动态渲染的搜索列表
keyCodeList: [], // 动态搜索的keycode列表
searchParams: {}, // 搜索的列表
searchForm: {},
street: [], // 街道数据
hos: [], // 房办数据
wuye: [], // 物业数据
columns: [ //表格展示的列
{
title: '小区名称',
dataIndex: 'stNameFrst',
key: 'stNameFrst'
},
{
title: '小区地址',
dataIndex: 'addrFrst',
key: 'addrFrst'
}, {
title: '房管办',
dataIndex: 'hoName',
key: 'hoName'
},
{
title: '街道',
dataIndex: 'strName',
key: 'strName'
},
{
title: '小区性质',
dataIndex: 'stKind',
key: 'stKind'
}, {
title: '小区类型',
dataIndex: 'sectType',
key: 'sectType'
}, {
title: '物业服务企业',
dataIndex: 'cspName',
key: 'cspName'
}, {
title: '小区管理处',
dataIndex: 'csName',
key: 'csName'
},
{
title: '是否成立业主大会',
dataIndex: 'hocId',
key: 'hocId'
},
{
title: '操作',
dataIndex: 'action',
width: 160,
scopedSlots: {
customRender: 'action'
}
}
],
pagination: { // 分页信息
pageNo: 1,
pageSize: 20,
current: 1,
defaultCurrent: 1,
defaultPageSize: 20,
showQuickJumper: true,
onChange: this.pageChange,
showSizeChanger: true,
onShowSizeChange: this.showSizeChange,
pageSizeOptions: ['10', '20', '50', '100'],
total: 0, // 小区总数
showTotal: total => `总条数: ${total}`,
totStCnstArea: '', // 房屋总面积 平方米
totUnits: '', // 总门牌数 幢
totHous: '', // 总分户数 户
},
tableData_sect: [],
tableData_mpz: [],
tableData_wy: [],
tableData_ywh: [],
stLevel: '',
cspServiceType: '',
tableName: '', // 邻里小汇
formed: '', // 邻里小汇
type: '', // 邻里小汇
isBeforeTwoThousand: '',
twoThousandValue: '',
personalizedKey: ''
}
},
beforeCreate() { // 页面进来创建form
this.form = this.$form.createForm(this)
},
computed: {
formItemLabelCol() {
let labelCol = {}
if (this.simpleSearchForm) {
labelCol = { span: 0 }
} else {
labelCol = { span: 8 }
}
return labelCol
},
formItemWrapperCol() {
let wrapperCol = {}
if (this.simpleSearchForm) {
wrapperCol = { span: 24 }
} else {
wrapperCol = { span: 16 }
}
return wrapperCol
}
},
created () { // 进页面获取数据
this.customKeyEnable=this.$cookie.get('customKeyEnable')
this.getHos()
this.getWy()
this.getStreet()
},
mounted(){
console.log(this.$api.BASE_URL.indexOf('211.136.105')!=-1 )
if(this.$route.name == 'basicInfoByLabel'){
this.$nextTick(function () {
this.getLabelList()
})
}
},
methods: {
changeTbl(tbl) {
this.tbl = tbl
if(this.checkedKeys.length > 0) {
this.$ajax.get({
url: this.$api.GET_ID_INFO_BY_LABEL,
params: {
tableName: this.tbl,
labelId_in: this.checkedKeys.toString()
}
}).then(res => {
let keyType = ''
if (res.code == 200) {
switch (this.tbl) {
case 'tbl_community':
if(res.data.content.sectId_in == '') {
this.clearAllTableData()
} else {
this.getListSect(res.data.content)
}
break
case 'tbl_building':
if(res.data.content.unit_in == '') {
this.clearAllTableData()
} else {
this.getListMpz(res.data.content)
}
break
case 'tbl_prop_company':
if(res.data.content.cspId_in == '') {
this.clearAllTableData()
} else {
this.getListWy(res.data.content)
}
break
case 'tbl_industry_council':
if(res.data.content.hocId_in == '') {
this.clearAllTableData()
} else {
this.getListYwh(res.data.content)
}
break
default:
break
}
}
})
} else {
this.clearAllTableData()
}
},
clearAllTableData() {
this.tableData_sect = []
this.tableData_mpz = []
this.tableData_wy = []
this.tableData_ywh = []
},
searchXXXByLabel() {
console.log(this.checkedKeys)
if(this.checkedKeys.length > 0) {
this.$ajax.get({
url: this.$api.GET_ID_INFO_BY_LABEL,
params: {
tableName: this.tbl,
labelId_in: this.checkedKeys.toString()
}
}).then(res => {
let keyType = ''
if (res.code == 200) {
switch (this.tbl) {
case 'tbl_community':
if(res.data.content.sectId_in == '') {
this.clearAllTableData()
} else {
this.getListSect(res.data.content)
}
break
case 'tbl_building':
if(res.data.content.unit_in == '') {
this.clearAllTableData()
} else {
this.getListMpz(res.data.content)
}
break
case 'tbl_prop_company':
if(res.data.content.cspId_in == '') {
this.clearAllTableData()
} else {
this.getListWy(res.data.content)
}
break
case 'tbl_industry_council':
if(res.data.content.hocId_in == '') {
this.clearAllTableData()
} else {
this.getListYwh(res.data.content)
}
break
default:
break
}
}
})
} else {
this.clearAllTableData()
}
},
onCheck(keys, node) {
// console.log(keys, node.node.$children.length)
this.checkedKeys = []
console.log(keys, node)
for(let i = 0; i < keys.length; i++) {
console.log(keys[i])
// this.$ajax.get({
// url: this.$api.DELETE_SINGLE_LABEL.replace('{id}', keys[i]),
// }).then(res => {
// if (res.code == 200) {
// if(res.data.content.parentId == '0') {} else {
// this.checkedKeys.push(keys[i])
// }
// }
// })
this.checkedKeys.push(keys[i])
}
// if(node.node.$children.length > 0) { // 一级菜单(有若干个二级菜单)
// console.log('一级菜单')
// for(let i = 0; i < node.node.$children.length; i++) {
// if(node.checkedNodesPositions[i].pos.split('-').length == 3) {
// this.checkedKeys.push(keys[i])
// }
// }
// } else {
// console.log('二级菜单')
// for(let i = 0; i < node.checkedNodesPositions.length; i++) {
// console.log(node.checkedNodesPositions[i].pos.split('-'))
// if(node.checkedNodesPositions[i].pos.split('-').length == 2) {
// this.checkedKeys.push(keys[i])
// }
// }
// }
// this.$ajax.get({
// url: this.$api.GET_LABEL_DETAIL.replace('{id}', selectedKeys[0]),
// params: Object.assign({}, searchParams, {
// pageSize: this.pagination.pageSize,
// pageNo: this.pagination.pageNo
// })
// }).then(res => {
// })
// console.log(this.checkedKeys.toString())
},
getLabelList() {
this.$ajax.get({
url: this.$api.GET_LABEL_LIST,
}).then(res => {
if (res.code == 200) {
this.treeData = this.$com.confirm(res, 'data.content', [])
console.log(JSON.stringify(this.treeData))
}
})
},
showNHide() {
this.leftPanelShow = !this.leftPanelShow
},
onSelect(selectedKeys, node) {
console.log(selectedKeys, node.node.$children.length)
},
getConfig() {
this.$ajax.get({
url: this.$api.GET_CONFIG,
}).then(res => {
if (res.code === '200') {
let inner = res.data.content
this.personalizedKey = inner.formedKey
}
})
},
closeMoreSearch() {
this.simpleSearchForm = true
},
showMoreSearch() {
this.simpleSearchForm = false
},
pageChange(page){ //分页切换
this.pagination.pageNo = page
this.pagination.current = page
this.getList()
},
showSizeChange(current, size) { //每页条数切换
this.pagination.pageNo = 1
this.pagination.current = 1
this.pagination.pageSize = size
this.getList()
},
reset(){ // 重置表单
this.form.resetFields()
this.stLevel = ''
this.cspServiceType = ''
this.type = ''
this.isBeforeTwoThousand = ''
this.pagination.pageNo = 1
this.pagination.current = 1
this.pagination.pageSize = 20
this.getList()
},
search() { // 搜索按钮
this.pagination.current = 1
this.pagination.pageNo = 1
//需要发送ajax
this.getList()
},
changeWy(value){ // 切换物业
let query=JSON.parse(JSON.stringify(this.$route.query))
query={id: '', name: ''}
this.$router.push({path: '/houseData/basicInfoByLabel', query: query})
this.form.setFieldsValue({
'c.cspId': value
})
this.search()
},
changeStreet(value) { // 切换街道
this.form.setFieldsValue({
'c.streetId': value
})
this.search()
},
changeIsHoc(value) { // 切换是否成立业主大会
this.form.setFieldsValue({
'isHoc': value
})
this.search()
},
changeType(val) { // 切换小区性质
this.form.setFieldsValue({
'stKind_in': val
})
this.getList()
},
handleChangefb(value) { //切换房办
this.form.setFieldsValue({
'c.hoId': value
})
this.search()
},
handleChangeZdy(i, e){ // 自定义字段 - 搜索条件的 change
if (Object.prototype.toString.call(e)== '[object Array]') {
e2 = e.join(',')
} else if (Object.prototype.toString.call(e)== '[object Object]') {
e2 = this.$moment(e).format('YYYY-MM-DD')
}
this.form.setFieldsValue({ // 传入的i 是i.keyCode 将form表单设置成最新的值
i: e2
})
setTimeout(() => { // 延时器,去掉会拿不到最新的value
this.getList()
}, 0)
},
getListSect(id){ // 获取小区数据
//处理动态的搜索条件,耦合到搜索列表
this.$ajax.get({
url: this.$api.GET_BASIC_LIST,
params: {
pageSize: this.pagination.pageSize,
pageNo: this.pagination.pageNo,
...id
},
}).then(res => {
if (res.code == 200 ) {
/**
* 存导出的数据? 暂时废弃
*/
// searchParams.token = this.$cookie.get('token')
// let a = this.tbl + '?'
// for(let k in searchParams){
// a = a+k+'='+ searchParams[k]+ '&'
// }
// this.exportParams = a
// 小区的展示统计量信息数据
this.pagination.total= this.$com.confirm(res, 'data.totalRows', 0)
this.pagination.totStCnstArea= this.$com.confirm(res, 'data.totStCnstArea', 0)
this.pagination.totUnits= this.$com.confirm(res, 'data.totUnits', 0)
this.pagination.totHous= this.$com.confirm(res, 'data.totHous', 0)
this.tableData_sect = this.$com.confirm(res, 'data.content', [])
// 处理显示的字段
this.tableData_sect.forEach(col => {
if (col.stKind == '01') {
col.stKind = '商品房'
} else if(col.stKind == '02') {
col.stKind = '动迁房'
}else if(col.stKind == '03') {
col.stKind = '共有产权保障房'
}else if(col.stKind == '04') {
col.stKind = '售后房'
}else if(col.stKind == '05') {
col.stKind = '直管公房'
}else if(col.stKind == '06') {
col.stKind = '混合'
}else if(col.stKind == '07') {
col.stKind = '系统公房'
}else if(col.stKind == '08') {
col.stKind = '集体土地集资房'
}else if(col.stKind == '09') {
col.stKind = '军产'
}else if(col.stKind == '10') {
col.stUseType = '私产'
}else if(col.stKind == '11') {
col.stUseType = '公租房'
}
if (col.sectType == '1') {
col.sectType = '住宅'
} else if(col.sectType == '2') {
col.sectType = '非住宅'
}else if(col.sectType == '3') {
col.sectType = '虚拟小区'
}
if (col.hocId == '' || col.hocId == null || col.hocId == 0) {
col.hocId = '否'
} else {
col.hocId = '是'
}
if (col.hocId == '' || col.hocId == null || col.hocId == 0) {
col.hocId = '否'
} else {
col.hocId = '是'
}
//特殊处理更新时间
if (!!col.syncTime) {
col.syncTime = col.syncTime.slice(0, 4)+'-'+col.syncTime.slice(4, 6)+'-'+col.syncTime.slice(6, 8)+' '+col.syncTime.slice(8, 10)+':'+col.syncTime.slice(10, 12)+':'+col.syncTime.slice(12, 14)
}
})
}
})
},
getListMpz(id){ // 获取小区数据
//处理动态的搜索条件,耦合到搜索列表
this.$ajax.get({
url: this.$api.GET_BUILDINGS_LIST,
params: {
pageSize: this.pagination.pageSize,
pageNo: this.pagination.pageNo,
...id
},
}).then(res => {
if (res.code == 200 ) {
/**
* 存导出的数据? 暂时废弃
*/
// searchParams.token = this.$cookie.get('token')
// let a = this.tbl + '?'
// for(let k in searchParams){
// a = a+k+'='+ searchParams[k]+ '&'
// }
// this.exportParams = a
// 小区的展示统计量信息数据
this.pagination.total= this.$com.confirm(res, 'data.totalRows', 0)
this.pagination.totStCnstArea= this.$com.confirm(res, 'data.totStCnstArea', 0)
this.pagination.totUnits= this.$com.confirm(res, 'data.totUnits', 0)
this.pagination.totHous= this.$com.confirm(res, 'data.totHous', 0)
this.tableData_mpz = this.$com.confirm(res, 'data.content', [])
// 处理显示的字段
this.tableData_mpz.forEach(col => {
if (col.stKind == '01') {
col.stKind = '商品房'
} else if(col.stKind == '02') {
col.stKind = '动迁房'
}else if(col.stKind == '03') {
col.stKind = '共有产权保障房'
}else if(col.stKind == '04') {
col.stKind = '售后房'
}else if(col.stKind == '05') {
col.stKind = '直管公房'
}else if(col.stKind == '06') {
col.stKind = '混合'
}else if(col.stKind == '07') {
col.stKind = '系统公房'
}else if(col.stKind == '08') {
col.stKind = '集体土地集资房'
}else if(col.stKind == '09') {
col.stKind = '军产'
}else if(col.stKind == '10') {
col.stUseType = '私产'
}else if(col.stKind == '11') {
col.stUseType = '公租房'
}
if (col.sectType == '1') {
col.sectType = '住宅'
} else if(col.sectType == '2') {
col.sectType = '非住宅'
}else if(col.sectType == '3') {
col.sectType = '虚拟小区'
}
if (col.hocId == '' || col.hocId == null || col.hocId == 0) {
col.hocId = '否'
} else {
col.hocId = '是'
}
if (col.hocId == '' || col.hocId == null || col.hocId == 0) {
col.hocId = '否'
} else {
col.hocId = '是'
}
//特殊处理更新时间
if (!!col.syncTime) {
col.syncTime = col.syncTime.slice(0, 4)+'-'+col.syncTime.slice(4, 6)+'-'+col.syncTime.slice(6, 8)+' '+col.syncTime.slice(8, 10)+':'+col.syncTime.slice(10, 12)+':'+col.syncTime.slice(12, 14)
}
})
}
})
},
getListWy(id){ // 获取小区数据
//处理动态的搜索条件,耦合到搜索列表
this.$ajax.get({
url: this.$api.GET_WY_AND_YWH_LIST,
params: {
tableName: this.tbl,
pageSize: this.pagination.pageSize,
pageNo: this.pagination.pageNo,
...id
},
}).then(res => {
if (res.code == 200 ) {
/**
* 存导出的数据? 暂时废弃
*/
// searchParams.token = this.$cookie.get('token')
// let a = this.tbl + '?'
// for(let k in searchParams){
// a = a+k+'='+ searchParams[k]+ '&'
// }
// this.exportParams = a
// 小区的展示统计量信息数据
this.pagination.total= this.$com.confirm(res, 'data.totalRows', 0)
this.pagination.totStCnstArea= this.$com.confirm(res, 'data.totStCnstArea', 0)
this.pagination.totUnits= this.$com.confirm(res, 'data.totUnits', 0)
this.pagination.totHous= this.$com.confirm(res, 'data.totHous', 0)
this.tableData_wy = this.$com.confirm(res, 'data.content', [])
// 处理显示的字段
this.tableData_wy.forEach(col => {
if (col.stKind == '01') {
col.stKind = '商品房'
} else if(col.stKind == '02') {
col.stKind = '动迁房'
}else if(col.stKind == '03') {
col.stKind = '共有产权保障房'
}else if(col.stKind == '04') {
col.stKind = '售后房'
}else if(col.stKind == '05') {
col.stKind = '直管公房'
}else if(col.stKind == '06') {
col.stKind = '混合'
}else if(col.stKind == '07') {
col.stKind = '系统公房'
}else if(col.stKind == '08') {
col.stKind = '集体土地集资房'
}else if(col.stKind == '09') {
col.stKind = '军产'
}else if(col.stKind == '10') {
col.stUseType = '私产'
}else if(col.stKind == '11') {
col.stUseType = '公租房'
}
if (col.sectType == '1') {
col.sectType = '住宅'
} else if(col.sectType == '2') {
col.sectType = '非住宅'
}else if(col.sectType == '3') {
col.sectType = '虚拟小区'
}
if (col.hocId == '' || col.hocId == null || col.hocId == 0) {
col.hocId = '否'
} else {
col.hocId = '是'
}
if (col.hocId == '' || col.hocId == null || col.hocId == 0) {
col.hocId = '否'
} else {
col.hocId = '是'
}
//特殊处理更新时间
if (!!col.syncTime) {
col.syncTime = col.syncTime.slice(0, 4)+'-'+col.syncTime.slice(4, 6)+'-'+col.syncTime.slice(6, 8)+' '+col.syncTime.slice(8, 10)+':'+col.syncTime.slice(10, 12)+':'+col.syncTime.slice(12, 14)
}
})
}
})
},
getListYwh(id){ // 获取小区数据
//处理动态的搜索条件,耦合到搜索列表
this.$ajax.get({
url: this.$api.GET_WY_AND_YWH_LIST,
params: {
tableName: this.tbl,
pageSize: this.pagination.pageSize,
pageNo: this.pagination.pageNo,
...id
},
}).then(res => {
if (res.code == 200 ) {
/**
* 存导出的数据? 暂时废弃
*/
// searchParams.token = this.$cookie.get('token')
// let a = this.tbl + '?'
// for(let k in searchParams){
// a = a+k+'='+ searchParams[k]+ '&'
// }
// this.exportParams = a
// 小区的展示统计量信息数据
this.pagination.total= this.$com.confirm(res, 'data.totalRows', 0)
this.pagination.totStCnstArea= this.$com.confirm(res, 'data.totStCnstArea', 0)
this.pagination.totUnits= this.$com.confirm(res, 'data.totUnits', 0)
this.pagination.totHous= this.$com.confirm(res, 'data.totHous', 0)
this.tableData_ywh = this.$com.confirm(res, 'data.content', [])
// 处理显示的字段
this.tableData_ywh.forEach(col => {
if (col.stKind == '01') {
col.stKind = '商品房'
} else if(col.stKind == '02') {
col.stKind = '动迁房'
}else if(col.stKind == '03') {
col.stKind = '共有产权保障房'
}else if(col.stKind == '04') {
col.stKind = '售后房'
}else if(col.stKind == '05') {
col.stKind = '直管公房'
}else if(col.stKind == '06') {
col.stKind = '混合'
}else if(col.stKind == '07') {
col.stKind = '系统公房'
}else if(col.stKind == '08') {
col.stKind = '集体土地集资房'
}else if(col.stKind == '09') {
col.stKind = '军产'
}else if(col.stKind == '10') {
col.stUseType = '私产'
}else if(col.stKind == '11') {
col.stUseType = '公租房'
}
if (col.sectType == '1') {
col.sectType = '住宅'
} else if(col.sectType == '2') {
col.sectType = '非住宅'
}else if(col.sectType == '3') {
col.sectType = '虚拟小区'
}
if (col.hocId == '' || col.hocId == null || col.hocId == 0) {
col.hocId = '否'
} else {
col.hocId = '是'
}
if (col.hocId == '' || col.hocId == null || col.hocId == 0) {
col.hocId = '否'
} else {
col.hocId = '是'
}
//特殊处理更新时间
if (!!col.syncTime) {
col.syncTime = col.syncTime.slice(0, 4)+'-'+col.syncTime.slice(4, 6)+'-'+col.syncTime.slice(6, 8)+' '+col.syncTime.slice(8, 10)+':'+col.syncTime.slice(10, 12)+':'+col.syncTime.slice(12, 14)
}
})
}
})
},
getStreet(){ //获取街道下拉
this.$ajax.get({
url: this.$api.GET_STREET_LIST,
params: {
pageSize: 10000
}
}).then(res => {
this.street = this.$com.confirm(res, 'data.content', [])
})
},
getHos(){ // 获取房办的下拉选项
this.$ajax.get({
url: this.$api.GET_HOS_LIST,
params: {
pageSize: 100000,
sectType_in: '1'
}
}).then(res => {
this.hos = this.$com.confirm(res, 'data.content', [])
})
},
getWy(){ // 获取物业的下拉选项
this.$ajax.get({
url: this.$api.GET_PROPCOMPANIES_LIST,
params: {
pageSize: 100000,
sectType_in: '1'
}
}).then(res => {
this.wuye= this.$com.confirm(res, 'data.content', [])
})
},
/**
* 从vuex中或已存储的搜索条件,判断此条件是否为当前路由的 。如果是则使用
*/
getSearchParams(){
const searchParams = !this.$store.state.listSearchParams?null:this.$store.state.listSearchParams[this.$route.name]
if(!!searchParams && !!searchParams.routeName && (this.$route.name == searchParams.routeName)){
if(!!searchParams.params){
Object.keys(searchParams.params).forEach(elem => {
switch (elem) {
case 'stNameFrst_l':
this.form.setFieldsValue({ 'stNameFrst_l': searchParams.params[elem] })
break
case 'addrFrst_l':
this.form.setFieldsValue({ 'addrFrst_l': searchParams.params[elem] })
break
case 'c.cspId':
if (searchParams.params[elem] != '') {
this.form.setFieldsValue({ 'c.cspId': searchParams.params[elem] })
}
break
case 'c.hoId':
if (searchParams.params[elem] != '') {
this.form.setFieldsValue({ 'c.hoId': searchParams.params[elem] })
}
break
case 'stKind_in':
if (searchParams.params[elem] != '') {
this.form.setFieldsValue({ 'stKind_in': searchParams.params[elem] })
}
break
case 'c.streetId':
if (searchParams.params[elem] != '') {
this.form.setFieldsValue({ 'c.streetId': searchParams.params[elem] })
}
break
case 'isHoc':
if (searchParams.params[elem] != '') {
this.form.setFieldsValue({ 'isHoc': searchParams.params[elem] })
}
break
default:
break
}
// 无法回显自定义的值,store里面有数据但是会报 You cannot set a form field before rendering a field associated with the value.
// setTimeout(()=>{
// this.form.setFieldsValue({ elem : searchParams.params[elem] })
// },0)
})
}
if(!!searchParams.pagination){
if(!!searchParams.pagination.pageNo){
this.pagination.pageNo = searchParams.pagination.pageNo
this.pagination.current = searchParams.pagination.current
this.pagination.pageSize = searchParams.pagination.pageSize
}
}
}
this.getList()
},
test() {
console.log('ajsdojsidjoasd')
},
toView(row){ // 操作里面去详情
this.$router.push({path: `/houseData/basicInfoByLabel/${row.id}`, query: {id: row.id, name: row.cspName}})
},
toBul(row){
this.$router.push({path: '/houseData/buildings', query: {id: row.id}})
},
toShebei(row){
this.$router.push({path: `/houseData/shebei/${row.id}`})
},
exportList(){ //导出功能
const formValue = this.form.getFieldsValue()
let newUrl = this.tbl + '?'
let newObj = {}
//拼接除 c.xxx 和 是否成立业主大会 之外的数据
for(const k in formValue){
if (k!= 'isHoc') { // 排除isHoc 是否成立业主大会 后续判断
if (formValue[k]!= undefined ) { // 判断是否值为 undefined
if ( k == 'c') { // 排除 c.xxx 的键
newObj = formValue[k] //有c.xx存入 b对象 下面处理,
} else if(Object.prototype.toString.call(formValue[k])== '[object Array]'){
// 数组的话就拼接字符串
newUrl += k +'=' + formValue[k].join(',') + '&'
}else if (Object.prototype.toString.call(formValue[k]) === '[object Object]') {
//时间格式对象就转换成字符串
newUrl += k +'=' +this.$moment(formValue[k]).format('YYYY-MM-DD') +'&'
}else {
newUrl += k +'=' +formValue[k] +'&' //没有特殊情况 直接拼接到 newUrl
}
}
}
}
// 处理 c.xxx 里面的数据
for(const k in newObj ){
if (newObj[k] != undefined) { // 排除值为undefined的键
newUrl += 'c.'+ k +'=' +newObj[k].split('#')[1] +'&' // 拼接到 newUrl
}
}
// 处理是否成立业主大会
if (formValue.isHoc) {
if (formValue.isHoc=='false') { // 判断业主大会是否选择了, 再根据 选项 拼接参数到 newUrl
newUrl= newUrl+ 'hocId=null&'
} else {
newUrl= newUrl+ 'hocId_ne=null&'
}
}
let token = this.$cookie.get('token') // 获取token 并拼接到 newUrl
newUrl += 'sectType=1&access_token=' + token.split('bearer ')[1]
window.open (this.$api.BASE_URL+'/service-basicdatasync-ddd/export/'+ newUrl)
},
/**
* 导出二维码
*/
exportEWM(){
const formValue = this.form.getFieldsValue()
let token = this.$cookie.get('token')
let selectedKeys = this.$refs.childTab.rowSelection.selectedRowKeys
if(selectedKeys.length>0){
let sectId=selectedKeys.join(',')
// console.log('https://hm.omniview.pro/common/public/qrCodeGenerate?sectId='+sectId+'&token='+token)
window.open (this.$api.GET_EXPORT_EWM+'?sectId='+sectId+'&access_token=' + token.split('bearer ')[1] )
}else{
let streetsId = formValue.c.streetId
if(streetsId){
streetsId=streetsId.split('#')[1]
}else{
streetsId=''
}
let stNameFrst_l = formValue.stNameFrst_l?formValue.stNameFrst_l:''
// console.log(this.$api.GET_EXPORT_EWM+'?streetId='+streetsId+'&stNameFrst_l='+stNameFrst_l+'&token='+token)
window.open (this.$api.GET_EXPORT_EWM+'?streetId='+streetsId+'&stNameFrst_l='+stNameFrst_l+'&access_token=' + token.split('bearer ')[1])
}
},
changeLevel(val) {
console.log(val)
this.stLevel = val.join(',')
// if(val.indexOf('1')!=-1 && val.indexOf('2')!=-1) {
// this.stLevel = '8'
// } else {
// this.stLevel = val[0]
// }
// this.getList()
},
changeServiceType(val) {
this.cspServiceType = val
this.getList()
},
changeNeighbourType(val) {
switch (val) {
case '1':
this.tableName = 'tbl_community'
this.formed = ''
this.type = 'un'
break
case '2':
this.tableName = 'tbl_community'
this.formed = '10,' + (this.$moment().format('L').split('/')).join('')
this.type = 'bet'
break
case '3':
this.tableName = 'tbl_community'
this.formed = '前期筹备中'
this.type = 'l'
break
default:
this.type = ''
this.formed = ''
break
}
// this.getList()
},
changeFinishDate(val) {
switch (val) {
case '1':
this.isBeforeTwoThousand = '1'
break
case '2':
this.isBeforeTwoThousand = '2'
break
default:
this.isBeforeTwoThousand = 'none'
break
}
// this.getList()
}
},
}
</script>
<style>
</style>
<template>
<div class="routerWapper">
<div class="portalDetailTitle" v-if="$route.name=='lvot'">
<span class="title">标签维护</span>
<!-- {{currentState}} -->
<div class="detailOperations">
<a-button @click="backPage"> 返回 </a-button>
</div>
</div>
<div class="layoutMargin layoutPadding" v-if="$route.name == 'lvot'">
<a-row v-if="$route.name=='lvot'">
<a-col :span="4" style="border-right:1px solid #ccc;height:100%; position:relative">
<span style="display: block; width: 90%; color:#1890ff; font-size: 16px; font-weight: 500; padding-bottom:5px;"><a-button style="width: 100%" type="default" @click="addLabel"> <a-icon type="plus" />添加标签 </a-button></span>
<a-tree
style="height: 700px"
:tree-data="treeData"
:replace-fields="replaceFields"
:selected-keys="selectedKeys"
@select="onSelect"
/>
</a-col>
<a-col :span="19" :offset="1">
<RightPanel v-if="currentState == 'create'" :trigger-type='currentState' @finish='getFinishState' />
<RightPanel v-else-if="currentState == 'loadChildLabel'" :trigger-type='currentState' :label-id='labelId' @finish='getFinishState' />
<ParentRightPanel v-else-if="currentState == 'loadParentLabel'" :trigger-type='currentState' :label-id='labelId' @finish='getFinishState' />
<EmptyRightPanel v-else />
</a-col>
</a-row>
</div>
<!-- <div v-if="$route.name=='lvot'">
<a-row>
<a-col :span='4' class="layoutMargin layoutPadding" style="height: 680px">
<a-row style="height: 36px">
<a-button style="width: 100%" size='small' type="default" @click="addLabel"> <a-icon type="plus" />添加标签 </a-button>
</a-row>
<a-tree
:tree-data="treeData"
:replace-fields="replaceFields"
:selected-keys="selectedKeys"
@select="onSelect"
/>
</a-col>
<a-col :span='1'></a-col>
<a-col :span='18' class="layoutMargin layoutPadding" style="height: 680px">
<RightPanel v-if="currentState == 'create'" :trigger-type='currentState' @finish='getFinishState' />
<RightPanel v-else-if="currentState == 'loadChildLabel'" :trigger-type='currentState' :label-id='labelId' @finish='getFinishState' />
<ParentRightPanel v-else-if="currentState == 'loadParentLabel'" :trigger-type='currentState' :label-id='labelId' @finish='getFinishState' />
<EmptyRightPanel v-else />
</a-col>
</a-row>
</div> -->
<RouterWapper v-else />
</div>
</template>
<script>
import RightPanel from '@/views/label/labelRightSide.vue'
import ParentRightPanel from '@/views/label/parentLabelRightPanel.vue'
import EmptyRightPanel from '@/views/label/labelRightSideEmpty.vue'
const treeData = []
export default {
name: 'lvot',
components: {
RightPanel,
EmptyRightPanel,
ParentRightPanel
},
data() {
return {
treeData,
replaceFields: {
children: 'children',
title: 'labelName',
key: 'id'
},
selectedKeys: [],
currentState: null,
labelId: null
}
},
mounted() {
this.getLabelList()
},
methods: {
getFinishState(state) {
if(state == true) {
this.currentState = null
this.getLabelList()
}
},
getLabelList() {
this.$ajax.get({
url: this.$api.GET_LABEL_LIST,
}).then(res => {
if (res.code == 200) {
this.treeData = this.$com.confirm(res, 'data.content', [])
console.log(JSON.stringify(this.treeData))
}
})
},
backPage(){ // 返回按钮
this.$router.back()
},
onSelect(selectedKeys, node) {
console.log(selectedKeys, node.node.$children.length)
this.$ajax.get({
url: this.$api.GET_LABEL_DETAIL.replace('{id}', selectedKeys[0]),
}).then(res => {
if (res.code == 200) {
let result = this.$com.confirm(res, 'data.content', [])
this.labelId = selectedKeys[0]
console.log(result.parentId, node.node.$children.length)
if(result.parentId !== '0' && node.node.$children.length == 0 || result.parentId == '0' && node.node.$children.length == 0) { // 为二级菜单
this.currentState = 'loadChildLabel'
} else { // 为一级菜单
this.currentState = 'loadParentLabel'
}
}
})
},
onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info)
},
addLabel() {
this.currentState = 'create'
console.log('add')
}
},
}
</script>
<style>
.ant-tree li {
margin: 0;
padding: 10px 0;
white-space: nowrap;
list-style: none;
outline: 0;
}
.ant-tree-child-tree > li:first-child {
padding-top: 20px;
}
</style>
<template>
<div class="routerWapper">
<div>
<a-row>
<!-- <a-col :span='1' v-if="triggerType == 'create'"> -->
<a-col :span='1'>
<div class="detailOperations">
<a-button @click="backPage"> 返回 </a-button>
</div>
</a-col>
<a-col :span='1' v-if="triggerType !== 'create' && triggerType !== 'loadParentLabel'" :offset='1'>
<a-button type='danger' @click="deleteLabel(labelId)">删除</a-button>
</a-col>
<a-col :span='1' :offset='1'>
<a-button type='primary' @click="preview()">预览</a-button>
</a-col>
<a-col :span='1' :offset='1'>
<a-button type='primary' @click="save()">保存</a-button>
</a-col>
<a-col :span='19'></a-col>
</a-row>
</div>
<a-divider type='horizontal' />
<div style="height: 580px; overflow-y: scroll">
<a-form :form='labelForm'>
<!-- {{loopContent.data}} -->
<a-form-item label='标签名' :label-col="{span:3}" :wrapper-col="{span:15}">
<a-input placeholder='请输入标签名' v-decorator="['labelName',{validateTrigger:'blur', initialValue: jsonData.labelName?jsonData.labelName: '', rules: [{required: true, message: '请填写标签名!'}]}]"></a-input>
</a-form-item>
<a-row>
<a-col :span='12'>
<a-form-item label='标签分组' :label-col="{span:6}" :wrapper-col="{span:16}">
<a-select v-decorator="['parentId',{validateTrigger:'blur', initialValue: jsonData.parentId?jsonData.parentId: '', rules: [{required: verifySelect, message: '请选择标签分组!'}]}] " placeholder='请选择分组'>
<a-select-option value=''>其他</a-select-option>
<a-select-option v-for="(item, index) in parentLabelList" :key='index' :value='item.id'>
{{item.labelName}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='12'>
<a-form-item :label-col="{span:1}" :wrapper-col="{span:12}" v-if="labelForm.getFieldValue('parentId') == ''">
<a-input placeholder='请输入分组名称' v-decorator="['parentName',{validateTrigger:'blur', initialValue: jsonData.parentName?jsonData.parentName: '', rules: [{required: verifyInput, message: '请填写标签分组名!'}]}]"></a-input>
</a-form-item>
</a-col>
</a-row>
<!-- <a-form-item label='标记对象' :label-col="{span:3}" :wrapper-col="{span:15}">
<a-select placeholder='请选择业务对象' @change='handleObjChange' v-decorator="['tableName',{validateTrigger:'blur', initialValue: jsonData.tableName?jsonData.tableName: '', rules: [{required: true, message: '请选择业务对象!'}]}]">
<a-select-option value='tbl_community'>小区</a-select-option>
<a-select-option value='tbl_building'>门牌幢</a-select-option>
</a-select>
</a-form-item> -->
<a-form-item label='标记对象' :label-col="{span:3}" :wrapper-col="{span:15}">
<a-radio-group v-decorator="['tableName',{validateTrigger:'blur', initialValue: jsonData.tableName?jsonData.tableName: '', rules: [{required: true, message: '请选择业务对象!'}]}]">
<a-radio value="tbl_community">
小区
</a-radio>
<a-radio value="tbl_building">
门牌
</a-radio>
<a-radio value="tbl_prop_company">
物业
</a-radio>
<a-radio value="tbl_industry_council">
业委会
</a-radio>
</a-radio-group>
</a-form-item>
</a-form>
<!-- <div style="background-color: #F0F2F5; height: 10px; "></div> -->
<!-- {{loopContent}} -->
<a-form :form='infoSettingForm' layout='inline'>
<div v-for="(item66, index66) in loopContent.data" :key="index66" style="margin-top: 20px; padding: 20px; border: 1px solid lightgrey">
<a-row type='flex' style="font-weight: bold; font-size: 16px; margin-bottom: 20px; border-bottom: 1px solid lightgrey" align='middle'>
<a-col :span='21'>
<span style="font-weight: bold">条件分组{{index66+1}}</span>
</a-col>
<a-col :span='3'>
<a-button style="color: darkred" type="link" @click="delGroup(index66)"><a-icon type="delete" />删除分组 </a-button>
</a-col>
</a-row>
<div style="width: 90%; padding: 20px; margin-bottom: 20px">
<div v-for="(item, index) in item66.labelSelConditionList" :key='index' style="margin-bottom: 20px">
<a-form-item>
<a-select style="width: 80px" placeholder='请选择条件' v-decorator="['relation-' + index66 +'-' + index,{initialValue: item.relation, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option value='and'></a-select-option>
<a-select-option value='or'></a-select-option>
<a-select-option value='ne'></a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<a-select style="width: 80px" placeholder='请选择标记对象' v-decorator="['tableName-' + index66 +'-' + index,{initialValue: item.tableName, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option v-for="(item, index) in objSelectOptions" :key='index' :value='item.value'>{{item.name}}</a-select-option>
</a-select>
</a-form-item>
<!-- {{cnonvertObj(availableKeyList, infoSettingForm.getFieldValue('tableName-' + index66 +'-' + index))}} -->
<!-- {{infoSettingForm.getFieldValue('tableName-' + index66 +'-' + index)}} -->
<!-- <div v-for="(item1) in availableKeyList" :key='item1.id'>{{item1.tableName}}</div> -->
<a-form-item>
<a-select style="width: 180px" placeholder='请选择业务属性' v-decorator="['key-' + index66 +'-' + index,{initialValue: item.key, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option v-for="(item1) in cnonvertObj(availableKeyList, infoSettingForm.getFieldValue('tableName-' + index66 +'-' + index))" :key='item1.id' :value='item1.tblKey'>{{item1.tblKeyName}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<a-select style="width: 80px" placeholder='区间' v-decorator="['codition-' + index66 +'-' + index,{initialValue: item.codition, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option value='eq'>等于</a-select-option>
<a-select-option value='gt'>大于</a-select-option>
<a-select-option value='gte'>大于等于</a-select-option>
<a-select-option value='lt'>小于</a-select-option>
<a-select-option value='lte'>小于等于</a-select-option>
<a-select-option value='btw'>区间</a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<a-input style="width: 100px" placeholder='请输入' v-decorator="['inputOne-' + index66 +'-' + index,{initialValue: getInitialValueOne(item.val), validateTrigger:'blur',rules: [],}]"></a-input>
</a-form-item>
<a-form-item v-if="infoSettingForm.getFieldValue('codition-'+index66 +'-' + index) == 'btw'">
<a-input style="width: 100px" placeholder='请输入' v-decorator="['inputTwo-' + index66 +'-' + index,{initialValue: getInitialValueTwo(item.val), validateTrigger:'blur',rules: []}]"></a-input>
</a-form-item>
<a-form-item>
<a-select style="width: 80px" placeholder='查询方式' v-decorator="['selMet-' + index66 +'-' + index,{initialValue: item.selMet, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option value='equels'>精确</a-select-option>
<a-select-option value='like'>模糊</a-select-option>
</a-select>
</a-form-item>
<!-- {{index + `,` + loopContent.data[index66].labelSelConditionList.length}} -->
<a-form-item>
<a-icon v-if="index+1 == loopContent.data[index66].labelSelConditionList.length" theme='filled' style="color:lightgreen;" type="plus-circle" @click="addRow(index66)" />
<a-icon v-if="index+1 == loopContent.data[index66].labelSelConditionList.length" theme='filled' style="color:red; margin-left: 5px" type="minus-circle" @click="deleteRow(index66, index)" />
</a-form-item>
</div>
</div>
</div>
</a-form>
<a-row style="text-align: center; margin-top: 10px; border: 2px dashed lightblue; padding: 10px 0px">
<a-button type="link" @click="addGroup"> <a-icon type="plus" />添加分组 </a-button>
</a-row>
<!-- <a-button type='link' v-if="loopContent.data.length == 0" @click="addInitRow()"><a-icon type="plus" />新增配置</a-button> -->
<a-row v-if="Object.keys(this.loopContent).length == 0" style="border: 1px solid pink; padding: 20px">
<a-icon type="info-circle" />
<span>请选择业务对象后填写筛选配置</span>
</a-row>
</div>
<a-modal title='以下是预览结果,确定保存吗?' width='55%' v-model='resultModalVisible'>
<template slot="footer">
<a-button key="cancel" @click="handleResultCancel">
返回
</a-button>
<a-button key="ok" type="primary" @click='handleResultOk'>
确认并保存
</a-button>
</template>
<a-table class="portalTable" size="small" row-key="id" :columns="columns[0][labelForm.getFieldValue('tableName')]" :dataSource="resultList"></a-table>
</a-modal>
<!-- <div v-if="resultList.length > 0">
<a-divider type='horizontal' />
<a-row style="font-weight: bold">筛选结果</a-row>
<a-table class="portalTable" size="small" row-key="id" :columns="columns" :dataSource="resultList"></a-table>
</div> -->
<a-modal v-model='deleteVisible' @ok='handleDeleteOk' @cancel='handleCancelOk'>
确定删除标签【{{labelNameForDel}}】吗?
</a-modal>
<a-modal width='400px' :bordered='true' title='提示' v-model='confirmVisible' @ok='handleConfirmVisible' @cancel='handleConfirmCancel'>
确定保存吗?
<!-- <a-table class="portalTable" size="small" row-key="id" :columns="columns" :dataSource="resultList"></a-table> -->
</a-modal>
</div>
</template>
<script>
import Vue from 'vue'
export default {
data() {
return {
labelForm: this.$form.createForm(this),
infoSettingForm: this.$form.createForm(this),
resultModalVisible: false,
loopContent: {
// data: [{
// key: '',
// tableName: '',
// codition: 'eq',
// val: '',
// selMet: ''
// }],
},
objSelectOptions: [
{
name: '小区',
value: 'tbl_community'
},
{
name: '门牌',
value: 'tbl_building'
},
{
name: '物业',
value: 'tbl_prop_company'
},
{
name: '业委会',
value: 'tbl_industry_council'
}
],
verifySelect: false,
verifyInput: false,
jsonData: {},
deleteVisible: false,
confirmVisible: false,
finish: false,
parentLabelList: [],
availableKeyList: [],
initKey: '',
resultList: [],
labelNameForDel: '',
columns: [
{
tbl_community: [
{
title: '小区名称',
// width: 240,
dataIndex: 'stNameFrst',
key: 'stNameFrst',
align: 'center',
},
{
title: '小区地址',
// width: 240,
dataIndex: 'addrFrst',
key: 'addrFrst',
align: 'center',
},
{
title: '房管办',
// width: 240,
dataIndex: 'hoName',
key: 'hoName',
align: 'center',
},
{
title: '小区性质',
// width: 240,
dataIndex: 'stKindName',
key: 'stKindName',
align: 'center',
},
{
title: '小区类型',
// width: 240,
dataIndex: 'sectTypeName',
key: 'sectTypeName',
align: 'center',
},
],
tbl_building: [
{
title: '门牌地址',
// width: 240,
dataIndex: 'unitAddr',
key: 'unitAddr',
align: 'center',
},
{
title: '门牌类型',
// width: 240,
dataIndex: 'unitKindName',
key: 'unitKindName',
align: 'center',
},
{
title: '门牌所在路',
// width: 240,
dataIndex: 'uLoad',
key: 'uLoad',
align: 'center',
},
{
title: '门牌所在弄',
// width: 240,
dataIndex: 'uLong',
key: 'uLong',
align: 'center',
},
],
tbl_prop_company: [
{
title: '物业名称',
// width: 240,
dataIndex: 'cspName',
key: 'cspName',
align: 'center',
},
{
title: '物业联系人',
// width: 240,
dataIndex: 'cspContacter',
key: 'cspContacter',
align: 'center',
},
{
title: '物业地址',
// width: 240,
dataIndex: 'cspAddr',
key: 'cspAddr',
align: 'center',
},
{
title: '注册地址',
// width: 240,
dataIndex: 'registerAddress',
key: 'registerAddress',
align: 'center',
},
],
tbl_industry_council: [
{
title: '业委会名称',
// width: 240,
dataIndex: 'hocName',
key: 'hocName',
align: 'center',
},
{
title: '业委会地址',
// width: 240,
dataIndex: 'hocAddr',
key: 'hocAddr',
align: 'center',
},
{
title: '竞选时间',
// width: 240,
dataIndex: 'electionDate',
key: 'electionDate',
align: 'center',
},
{
title: '开始时间',
// width: 240,
dataIndex: 'conStartDate',
key: 'conStartDate',
align: 'center',
},
{
title: '结束时间',
// width: 240,
dataIndex: 'conEndDate',
key: 'conEndDate',
align: 'center',
},
]
}
]
}
},
mounted() {
console.log('得到的' + this.labelId)
this.getLabelDetail()
this.getParentLabelList()
// this.getKeyList()
this.initKeyList()
},
props: [
'triggerType',
'labelId'
],
watch: {
triggerType: {
handler: function(newV, oldV) {
console.log(111)
this.resetFormFields()
this.getLabelDetail()
},
immediate: true
},
labelId: {
handler: function(newV, oldV) {
console.log(222)
this.initKeyList()
this.resetFormFields()
this.getLabelDetail()
},
immediate: true
},
},
methods: {
handleResultCancel() {
this.resultModalVisible = !this.resultModalVisible
},
clearNextKey(col) {
console.log(col)
// console.log(this.infoSettingForm.resetFields());
},
cnonvertObj(options, tableName) {
let tbRealName = ''
switch (tableName) {
case 'tbl_community':
tbRealName = '小区'
break
case 'tbl_building':
tbRealName = '自然幢'
break
case 'tbl_prop_company':
tbRealName = '物业公司'
break
case 'tbl_industry_council':
tbRealName = '业委会'
break
default:
break
}
console.log(tbRealName)
let optionsPush = []
for (let i = 0; i < options.length; i++) {
if(options[i].tableName == tbRealName) {
optionsPush.push(options[i])
}
}
console.log(optionsPush)
return optionsPush
},
handleResultOk() {
this.resultModalVisible = !this.resultModalVisible
if(Object.keys(this.loopContent).length == 0) {
this.$message.error('请至少添加一组配置!')
} else {
// 判断是否选择分组或填写分组
console.log(!!this.labelForm.getFieldValue('parentId'))
if(!!this.labelForm.getFieldValue('parentId')) {
this.verifyInput = false
this.verifySelect = true
} else {
this.verifyInput = true
this.verifySelect = false
}
this.labelForm.validateFields((err, values) => {
if(!err) {
const labelFormData = this.labelForm.getFieldsValue()
this.jsonData = Object.assign(this.jsonData, labelFormData)
this.infoSettingForm.validateFields((err1, values) => {
if(!err1) {
let loopGroup = this.loopContent // 有多少组
console.log(loopGroup)
let innerResult = []
let formData = this.infoSettingForm.getFieldsValue()
loopGroup.data.forEach((item, i) => {
let rowList = []
item.labelSelConditionList.forEach((ele, index) => {
// console.log(formData)
rowList.push({
key: formData['key-' + i + '-'+index ],
tableName: formData['tableName-' + i + '-'+index ],
val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index],
codition: formData['codition-' + i + '-' +index],
relation: formData['relation-' + i + '-' + index],
selMet: formData['selMet-' + i + '-' + index]
})
})
innerResult.push({
'serial': 1,
'relation': formData['relation-' + i + '-0'],
'labelSelConditionList': rowList
})
})
this.jsonData.selParams = innerResult
this.$ajax.post({
url: this.$api.POST_LABEL_CREATE_CONFIRM,
params: Object.assign(this.jsonData, {id: this.labelId})
}).then(res => {
if (res.code == 200) {
this.$message.success('保存成功!')
this.resetFormFields()
this.finish = true
this.$emit('finish', this.finish)
} else {
this.$message.error('保存失败!')
}
})
}
})
}
})
}
},
addGroup() {
// 添加分组前,先查询当前有几个分组
const groupTotal = Object.keys(this.loopContent.data).length
console.log(groupTotal)
console.log(this.loopContent)
// this.loopContent.data.push(
// { serial: 1, relation: 'and', labelSelConditionList: [ { key: '', val: '', tableName: '', codition: 'eq', selMet: '', relation: '' } ] }
// )
Vue.set(this.loopContent, 'data', [
...this.loopContent.data, { serial: 1, relation: 'and', labelSelConditionList: [ { key: '', val: '', tableName: '', codition: 'eq', selMet: '', relation: '' } ] }
])
this.$forceUpdate()
console.log(JSON.stringify(this.loopContent))
},
delGroup(key) {
console.log(key)
Vue.delete(this.loopContent.data, key)
this.$forceUpdate()
},
initKeyList() {
// 获取当前的对象
this.initKey = this.labelForm.getFieldValue('tableName')
this.getKeyList(this.initKey)
},
handleObjChange(val) {
// 确定插入到哪一行
console.log(val)
// let needValue = this.labelForm.getFieldValue('tableName')
// this.getKeyList(needValue)
// this.loopContent = {data: [{
// key: '',
// codition: 'eq',
// val: '',
// selMet: ''
// }]}
// this.infoSettingForm.resetFields()
// 重置key表项的值为空 或 业务对象干脆disable掉
},
getKeyList(val) {
this.availableKeyList = []
this.$ajax.get({
url: this.$api.GET_AVAILABLE_KEY_LIST,
params: {
pageNo: 1,
pageSize: 999
}
}).then(res => {
if (res.code == 200) {
this.availableKeyList = res.data.content
}
})
},
getLabelDetail() {
if(!!this.labelId && this.labelId !== 'undefined') {
this.$ajax.get({
url: this.$api.DELETE_SINGLE_LABEL.replace('{id}', this.labelId),
}).then(res => {
if (res.code == 200) {
this.labelForm.setFieldsValue({
labelName: res.data.content.labelName,
parentId: res.data.content.parentId,
tableName: res.data.content.tableName
})
this.labelNameForDel = res.data.content.labelName
this.loopContent.data = res.data.content.selParams
console.log(this.loopContent.data)
}
})
} else {
this.resetFormFields()
}
},
getParentLabelList() {
this.$ajax.get({
url: this.$api.GET_LABEL_LIST,
}).then(res => {
let list = this.$com.confirm(res, 'data.content', [])
for(let i = 0; i < list.length; i++) {
this.parentLabelList.push({
'labelName': list[i].labelName,
'id': list[i].id
})
}
})
},
getInitialValueOne(val) {
// return ''
if(val.indexOf(',') > -1) {
return val.split(',')[0]
} else {
return val
}
},
getInitialValueTwo(val) {
// return ''
if(val.indexOf(',') > -1) {
return val.split(',')[1]
} else {
return ''
}
},
backPage(){ // 返回按钮
this.finish = true
this.$emit('finish', this.finish)
},
// addInitRow() {
// this.loopContent.data.push({
// key: '',
// codition: 'eq',
// val: '',
// selMet: ''
// })
// },
addRow(whichGroup) {
console.log(whichGroup)
this.loopContent.data[whichGroup].labelSelConditionList.push({
key: '',
tableName: '',
codition: 'eq',
val: '',
relation: 'and',
selMet: ''
})
this.$forceUpdate()
console.log(this.loopContent)
},
deleteRow(whichGroup, whichRow) {
console.log(whichGroup, whichRow)
this.loopContent.data[whichGroup].labelSelConditionList.splice(whichRow, 1)
this.$forceUpdate()
// console.log(JSON.stringify(this.loopContent.data))
// console.log(index)
// this.loopContent.data.splice(index, 1)
// console.log(JSON.stringify(this.loopContent.data))
},
deleteLabel(id) {
console.log(id, this.deleteVisible)
// 查询该标签是否是一级标签,是一级标签直接删除。
this.deleteVisible = !this.deleteVisible
},
handleDeleteOk() {
this.$ajax.delete({
url: this.$api.DELETE_SINGLE_LABEL.replace('{id}', this.labelId),
}).then(res => {
if (res.code == 200) {
this.$message.success('删除标签成功!')
this.finish = true
this.$emit('finish', this.finish)
}
})
this.deleteVisible = !this.deleteVisible
},
handleCancelOk() {
this.deleteVisible = !this.deleteVisible
},
resetFormFields() {
this.loopContent.data = [ { serial: 1, relation: 'and', labelSelConditionList: [ { key: '', val: '', tableName: '', codition: 'eq', selMet: '', relation: '' } ] } ]
this.resultList = []
this.labelForm.resetFields()
this.infoSettingForm.resetFields()
this.jsonData = {selParams: []}
},
handleConfirmVisible() {
console.log(this.jsonData)
if(!!this.labelId) {
this.$ajax.put({
url: this.$api.PUT_LABEL_INFO.replace('{id}', this.labelId),
params: Object.assign(this.jsonData, {id: this.labelId})
}).then(res => {
if (res.code == 200) {
this.$message.success('修改成功!')
this.resetFormFields()
this.finish = true
this.$emit('finish', this.finish)
}
})
} else {
this.$ajax.post({
url: this.$api.POST_SINGLE_LABEL,
params: Object.assign(this.jsonData)
}).then(res => {
if (res.code == 200) {
this.$message.success('保存成功!')
this.resetFormFields()
this.finish = true
this.$emit('finish', this.finish)
} else {
this.$message.success('保存失败!')
}
})
}
},
handleConfirmCancel() {
this.confirmVisible = !this.confirmVisible
},
preview() {
this.infoSettingForm.validateFields((err1, values) => {
if(!err1) {
let loopGroup = this.loopContent // 有多少组
console.log(loopGroup)
let innerResult = []
let formData = this.infoSettingForm.getFieldsValue()
loopGroup.data.forEach((item, i) => {
let rowList = []
item.labelSelConditionList.forEach((ele, index) => {
// console.log(formData)
rowList.push({
key: formData['key-' + i + '-'+index ],
tableName: formData['tableName-' + i + '-'+index ],
val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index],
codition: formData['codition-' + i + '-' +index],
relation: formData['relation-' + i + '-' + index],
selMet: formData['selMet-' + i + '-' + index]
})
})
innerResult.push({
'serial': 1,
'relation': formData['relation-' + i + '-0'],
'labelSelConditionList': rowList
})
})
// 调用预览接口
const tableName = this.labelForm.getFieldValue('tableName')
this.sendToPreview(innerResult, tableName)
}
})
},
sendToPreview(body, tableName) {
this.$ajax.post({
url: this.$api.POST_LABEL_RESULT_PREVIEW+'?pageNo=0&pageSize=999&tableName=' + tableName,
params: body
}).then(res => {
if (res.code == 200) {
this.resultModalVisible = !this.resultModalVisible
this.resultList = this.$com.confirm(res, 'data.content', [])
// this.resetFormFields()
// this.finish = true
// this.$emit('finish', this.finish)
} else {
this.$message.success('发生错误!')
}
})
},
save() {
// if(this.loopContent.data.length == 0) {
if(Object.keys(this.loopContent).length == 0) {
this.$message.error('请至少添加一组配置!')
} else {
// 判断是否选择分组或填写分组
console.log(!!this.labelForm.getFieldValue('parentId'))
if(!!this.labelForm.getFieldValue('parentId')) {
this.verifyInput = false
this.verifySelect = true
} else {
this.verifyInput = true
this.verifySelect = false
}
this.labelForm.validateFields((err, values) => {
if(!err) {
const labelFormData = this.labelForm.getFieldsValue()
this.jsonData = Object.assign(this.jsonData, labelFormData)
this.infoSettingForm.validateFields((err1, values) => {
if(!err1) {
let loopGroup = this.loopContent // 有多少组
console.log(loopGroup)
let innerResult = []
let formData = this.infoSettingForm.getFieldsValue()
loopGroup.data.forEach((item, i) => {
let rowList = []
item.labelSelConditionList.forEach((ele, index) => {
// console.log(formData)
rowList.push({
key: formData['key-' + i + '-'+index ],
tableName: formData['tableName-' + i + '-'+index ],
val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index],
codition: formData['codition-' + i + '-' +index],
relation: formData['relation-' + i + '-' + index],
selMet: formData['selMet-' + i + '-' + index]
})
})
innerResult.push({
'serial': 1,
'relation': formData['relation-' + i + '-0'],
'labelSelConditionList': rowList
})
})
this.jsonData.selParams = innerResult
this.confirmVisible = !this.confirmVisible
}
})
}
})
}
},
},
}
</script>
\ No newline at end of file
<template>
<div style="position: relative">
<div style="border: 1px dotted lightgrey; padding: 150px;">
<a-row style="text-align: center; margin-bottom: 50px;">
<img src="@/assets/icon/labelNone.png" />
</a-row>
<a-row style="text-align: center; font-weight: bold; font-size: 16px">
<span>请先在左侧选择一个标签或添加标签。</span>
</a-row>
</div>
</div>
</template>
<script>
export default {
}
</script>
\ No newline at end of file
<template>
<div class="routerWapper">
<!-- {{labelId}} -->
<div>
<a-row>
<a-col :span='1'>
<div class="detailOperations">
<a-button @click="backPage"> 返回 </a-button>
</div>
</a-col>
<a-col :span='1' :offset='1'>
<a-button type='primary' @click="save()">保存</a-button>
</a-col>
<a-col :span='19'></a-col>
</a-row>
</div>
<div>
<a-divider type='horizontal' />
<a-form :form='labelForm'>
<a-form-item label='标签名' :label-col="{span:2}" :wrapper-col="{span:14}">
<a-input v-decorator="['labelName',{validateTrigger:'blur', initialValue: '', rules: [{required: true, message: '请填写标签名!'}]}]"></a-input>
</a-form-item>
</a-form>
</div>
</div>
</template>
<script>
export default {
data() {
return {
labelForm: this.$form.createForm(this),
labelList: {},
finish: false,
}
},
props: [
'triggerType',
'labelId'
],
mounted() {
this.getLabelInfo()
},
watch: {
triggerType: {
handler: function(newV, oldV) {
this.resetFormFields()
this.getLabelInfo()
},
immediate: true
},
labelId: {
handler: function(newV, oldV) {
this.resetFormFields()
this.getLabelInfo()
},
immediate: true
}
},
methods: {
getLabelInfo() {
if(!!this.labelId) {
this.$ajax.get({
url: this.$api.GET_LABEL_DETAIL.replace('{id}', this.labelId),
}).then(res => {
if (res.code == 200) {
this.labelList = res.data.content
this.labelForm.setFieldsValue({
labelName: res.data.content.labelName
})
}
})
}
},
resetFormFields() {
this.labelForm.resetFields()
},
backPage(){ // 返回按钮
this.finish = true
this.$emit('finish', this.finish)
},
save() {
this.labelForm.validateFields((err1, values) => {
if(!err1) {
this.labelList.labelName = this.labelForm.getFieldValue('labelName')
this.$ajax.put({
url: this.$api.PUT_LABEL_INFO.replace('{id}', this.labelId),
params: Object.assign(this.labelList, {id: this.labelId})
}).then(res => {
if (res.code == 200) {
this.$message.success('修改成功!')
this.resetFormFields()
this.finish = true
this.$emit('finish', this.finish)
} else {
this.$message.success('修改失败!')
}
})
}
})
},
},
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment