Commit 14ffc5f4 authored by Gakki's avatar Gakki

1

parent 0e61c95c
// 小区列表 // 小区列表
<template> <template>
<div class="routerWapper"> <div class="routerWapper">
{{checkedKeys}}
<a-row type='flex'> <a-row type='flex'>
<a-col flex='250px' style="overflow: hidden"> <a-col flex='250px' style="overflow: hidden">
<div v-if="$route.path == '/houseData/basicInfo'" class="layoutMargin layoutPadding"> <div v-if="$route.path == '/houseData/basicInfo'" class="layoutMargin layoutPadding">
<a-tree <a-tree
@check='onCheck'
checkable
:tree-data="treeData"
:replace-fields="replaceFields"
/>
<!-- <a-tree
v-model='checkedKeys'
checkable
:tree-data="treeData" :tree-data="treeData"
:replace-fields="replaceFields" :replace-fields="replaceFields"
:selected-keys="selectedKeys" :selected-keys="selectedKeys"
@select="onSelect" @select="onSelect"
/> /> -->
</div> </div>
</a-col> </a-col>
<a-col flex='78%'> <a-col flex='78%'>
...@@ -185,6 +194,7 @@ export default { ...@@ -185,6 +194,7 @@ export default {
title: 'labelName', title: 'labelName',
key: 'id' key: 'id'
}, },
checkedKeys: [],
simpleSearchForm: true, // 展示、收取简单搜索开关,true为简单搜索 simpleSearchForm: true, // 展示、收取简单搜索开关,true为简单搜索
levelType: [ levelType: [
...@@ -429,6 +439,10 @@ export default { ...@@ -429,6 +439,10 @@ export default {
} }
}, },
methods: { methods: {
onCheck(keys, node) {
console.log(keys, node.checkedNodesPositions)
},
getLabelList() { getLabelList() {
this.$ajax.get({ this.$ajax.get({
url: this.$api.GET_LABEL_LIST, url: this.$api.GET_LABEL_LIST,
...@@ -591,6 +605,7 @@ export default { ...@@ -591,6 +605,7 @@ export default {
this.form.setFieldsValue({'c.cspId': this.$route.query.name+'#'+this.$route.query.id}) this.form.setFieldsValue({'c.cspId': this.$route.query.name+'#'+this.$route.query.id})
searchParams = Object.assign(searchParams, {}, {'c.cspId': this.$route.query.id, 'c.createTime_desc': 'desc'}) searchParams = Object.assign(searchParams, {}, {'c.cspId': this.$route.query.id, 'c.createTime_desc': 'desc'})
} }
this.searchParams = searchParams this.searchParams = searchParams
this.$ajax.get({ this.$ajax.get({
url: this.$api.GET_BASIC_LIST, url: this.$api.GET_BASIC_LIST,
......
...@@ -89,13 +89,16 @@ ...@@ -89,13 +89,16 @@
</a-form> </a-form>
<a-button type='link' v-if="loopContent.data.length == 0" @click="addInitRow()">新增配置</a-button> <a-button type='link' v-if="loopContent.data.length == 0" @click="addInitRow()">新增配置</a-button>
<div v-if="resultList.length > 0"> <!-- <div v-if="resultList.length > 0">
<a-divider type='horizontal' /> <a-divider type='horizontal' />
<a-row style="font-weight: bold">筛选结果</a-row> <a-row style="font-weight: bold">筛选结果</a-row>
<a-table class="portalTable" size="small" row-key="id" :columns="columns" :dataSource="resultList"></a-table> <a-table class="portalTable" size="small" row-key="id" :columns="columns" :dataSource="resultList"></a-table>
</div> </div> -->
<a-modal :visible='deleteVisible' @ok='handleDeleteOk' @cancel='handleCancelOk'> <a-modal :visible='deleteVisible' @ok='handleDeleteOk' @cancel='handleCancelOk'>
确定删除该标签【{{labelId}}】吗? 确定删除标签【{{labelNameForDel}}】吗?
</a-modal>
<a-modal width='800px' :bordered='true' :title='`搜索到`+resultList.length + `条结果,确认保存吗?`' :visible='confirmVisible' @ok='handleConfirmVisible' @cancel='handleConfirmCancel'>
<a-table class="portalTable" size="small" row-key="id" :columns="columns" :dataSource="resultList"></a-table>
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -116,21 +119,49 @@ export default { ...@@ -116,21 +119,49 @@ export default {
}, },
jsonData: {}, jsonData: {},
deleteVisible: false, deleteVisible: false,
confirmVisible: false,
finish: false, finish: false,
parentLabelList: [], parentLabelList: [],
availableKeyList: [], availableKeyList: [],
initKey: '', initKey: '',
resultList: [], resultList: [],
labelNameForDel: '',
columns: [ columns: [
// { {
// title: '小区名称', title: '小区名称',
// // width: 240, // width: 240,
// dataIndex: 'position', dataIndex: 'stNameFrst',
// key: 'position', key: 'stNameFrst',
// width: '20%', align: 'center',
// 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',
},
] ]
} }
}, },
...@@ -203,6 +234,7 @@ export default { ...@@ -203,6 +234,7 @@ export default {
parentId: res.data.content.parentId, parentId: res.data.content.parentId,
tableName: res.data.content.tableName tableName: res.data.content.tableName
}) })
this.labelNameForDel = res.data.content.labelName
this.loopContent.data = res.data.content.selParams this.loopContent.data = res.data.content.selParams
console.log(res.data.content.selParams) console.log(res.data.content.selParams)
this.initKeyList() this.initKeyList()
...@@ -289,6 +321,41 @@ export default { ...@@ -289,6 +321,41 @@ export default {
resetFormFields() { resetFormFields() {
this.loopContent.data = [] this.loopContent.data = []
this.labelForm.resetFields() this.labelForm.resetFields()
this.resultList = []
},
handleConfirmVisible() {
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.$message.success('修改失败!')
}
})
} 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
}, },
save() { save() {
this.jsonData = {selParams: []} this.jsonData = {selParams: []}
...@@ -320,36 +387,8 @@ export default { ...@@ -320,36 +387,8 @@ export default {
// 如果查询到content里有内容,则在下方以表格的形式展示出来。否则提示无匹配数据。 // 如果查询到content里有内容,则在下方以表格的形式展示出来。否则提示无匹配数据。
this.resultList = res.data.content this.resultList = res.data.content
if(this.resultList.length > 0) { if(this.resultList.length > 0) {
this.confirmVisible = !this.confirmVisible
// 提交标签内容, 如果有labelId则调用put接口,反之调用post接口 // 提交标签内容, 如果有labelId则调用put接口,反之调用post接口
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.$message.success('修改失败!')
}
})
} 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('保存失败!')
}
})
}
} else { } else {
this.$message.error('该标签无搜索结果,标签添加失败!') this.$message.error('该标签无搜索结果,标签添加失败!')
} }
......
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