Commit 14ffc5f4 authored by Gakki's avatar Gakki

1

parent 0e61c95c
// 小区列表
<template>
<div class="routerWapper">
{{checkedKeys}}
<a-row type='flex'>
<a-col flex='250px' style="overflow: hidden">
<div v-if="$route.path == '/houseData/basicInfo'" class="layoutMargin layoutPadding">
<a-tree
@check='onCheck'
checkable
:tree-data="treeData"
:replace-fields="replaceFields"
/>
<!-- <a-tree
v-model='checkedKeys'
checkable
:tree-data="treeData"
:replace-fields="replaceFields"
:selected-keys="selectedKeys"
@select="onSelect"
/>
/> -->
</div>
</a-col>
<a-col flex='78%'>
......@@ -185,6 +194,7 @@ export default {
title: 'labelName',
key: 'id'
},
checkedKeys: [],
simpleSearchForm: true, // 展示、收取简单搜索开关,true为简单搜索
levelType: [
......@@ -429,6 +439,10 @@ export default {
}
},
methods: {
onCheck(keys, node) {
console.log(keys, node.checkedNodesPositions)
},
getLabelList() {
this.$ajax.get({
url: this.$api.GET_LABEL_LIST,
......@@ -591,6 +605,7 @@ export default {
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'})
}
this.searchParams = searchParams
this.$ajax.get({
url: this.$api.GET_BASIC_LIST,
......
......@@ -89,13 +89,16 @@
</a-form>
<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-row style="font-weight: bold">筛选结果</a-row>
<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'>
确定删除该标签【{{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>
</div>
</template>
......@@ -116,21 +119,49 @@ export default {
},
jsonData: {},
deleteVisible: false,
confirmVisible: false,
finish: false,
parentLabelList: [],
availableKeyList: [],
initKey: '',
resultList: [],
labelNameForDel: '',
columns: [
// {
// title: '小区名称',
// // width: 240,
// dataIndex: 'position',
// key: 'position',
// width: '20%',
// align: 'center',
// }
{
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',
},
]
}
},
......@@ -203,6 +234,7 @@ export default {
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(res.data.content.selParams)
this.initKeyList()
......@@ -289,6 +321,41 @@ export default {
resetFormFields() {
this.loopContent.data = []
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() {
this.jsonData = {selParams: []}
......@@ -320,36 +387,8 @@ export default {
// 如果查询到content里有内容,则在下方以表格的形式展示出来。否则提示无匹配数据。
this.resultList = res.data.content
if(this.resultList.length > 0) {
this.confirmVisible = !this.confirmVisible
// 提交标签内容, 如果有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 {
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