Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wbx-PCAndMobi
pc
Commits
0e61c95c
Commit
0e61c95c
authored
Mar 12, 2021
by
Gakki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签点击保存后调用labelResource接口,判断是否存在筛选结果后调用保存接口
parent
1e070dd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
32 deletions
+58
-32
labelRightSide.vue
src/views/label/labelRightSide.vue
+58
-32
No files found.
src/views/label/labelRightSide.vue
View file @
0e61c95c
...
...
@@ -87,7 +87,13 @@
</a-form-item>
</div>
</a-form>
<a-button
type=
'link'
v-if=
"loopContent.data.length == 0"
@
click=
"addInitRow()"
>
新增配置
</a-button>
<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
:visible=
'deleteVisible'
@
ok=
'handleDeleteOk'
@
cancel=
'handleCancelOk'
>
确定删除该标签【
{{
labelId
}}
】吗?
</a-modal>
...
...
@@ -113,7 +119,19 @@ export default {
finish
:
false
,
parentLabelList
:
[],
availableKeyList
:
[],
initKey
:
''
initKey
:
''
,
resultList
:
[],
columns
:
[
// {
// title: '小区名称',
// // width: 240,
// dataIndex: 'position',
// key: 'position',
// width: '20%',
// align: 'center',
// }
]
}
},
mounted
()
{
...
...
@@ -291,50 +309,58 @@ export default {
selMet
:
formData
[
'selMet'
+
i
]
})
}
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_LABEL_BIND_FILTER_RESULT
,
params
:
this
.
jsonData
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
res
.
data
.
content
)
// 如果查询到content里有内容,则在下方以表格的形式展示出来。否则提示无匹配数据。
this
.
resultList
=
res
.
data
.
content
if
(
this
.
resultList
.
length
>
0
)
{
// 提交标签内容, 如果有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
(
'该标签无搜索结果,标签添加失败!'
)
}
// this.$message.success('修改成功!')
// this.resetFormFields()
// this.finish = true
// this.$emit('finish', this.finish)
}
else
{
this
.
$message
.
success
(
'修改失败!
'
)
this
.
$message
.
error
(
'接口报错,报错码 '
+
res
.
code
+
', 请稍后重试!
'
)
}
})
// 提交标签内容, 如果有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
(
'保存失败!'
)
}
})
}
}
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment