Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
memberTag-web
Overview
Overview
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
memberTag
memberTag-web
Commits
504d9048
Commit
504d9048
authored
Apr 15, 2019
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决编辑之后的新数据不更新的问题
parent
18104794
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
memberGroupEdit.vue
src/view/memberGroup/memberGroupEdit.vue
+16
-7
tags-group-list.vue
src/view/memberGroup/tags-group-list.vue
+1
-1
No files found.
src/view/memberGroup/memberGroupEdit.vue
View file @
504d9048
...
...
@@ -51,7 +51,7 @@
<div
class=
"form-tip-text"
><label>
*更新时间预计选择日期的凌晨0点至6点
</label></div>
</el-form-item>
<el-form-item
label=
""
>
<el-button
type=
"primary"
@
click
.
stop=
"
confirm
Save"
>
保存
</el-button>
<el-button
type=
"primary"
@
click
.
stop=
"
post
Save"
>
保存
</el-button>
<el-button>
<router-link
to=
"/memberGroupList"
>
返回
</router-link>
</el-button>
...
...
@@ -302,22 +302,27 @@ export default {
editTags
()
{
this
.
editPopType
=
'edit'
;
this
.
showEditTagPop
=
true
;
this
.
tagData
=
[...
this
.
ruleForm
.
selectedTags
[
this
.
activeTagsGroupIndex
][
this
.
activeTagIndex
]]
;
this
.
tagData
=
Object
.
assign
({},
this
.
tagData
,
this
.
ruleForm
.
selectedTags
[
this
.
activeTagsGroupIndex
][
this
.
activeTagIndex
])
;
},
// 选择标签
selectedTag
(
tagData
)
{
this
.
showEditTagPop
=
true
;
this
.
tagData
=
{
...
tagData
}
;
this
.
tagData
=
Object
.
assign
({},
this
.
tagData
,
tagData
)
;
},
// 保存选择的标签数据
returnTagData
(
data
)
{
let
tagParams
=
JSON
.
parse
(
data
.
tagParams
);
data
.
newTagVal
=
JSON
.
stringify
(
tagParams
.
selectedVal
);
switch
(
this
.
editPopType
)
{
case
'add'
:
this
.
ruleForm
.
selectedTags
[
this
.
activeTagsGroupIndex
].
push
(
data
);
break
;
case
'edit'
:
this
.
ruleForm
.
selectedTags
[
this
.
activeTagsGroupIndex
][
this
.
activeTagIndex
]
=
{
...
data
};
// 注意有坑
let
tagsGroup
=
this
.
ruleForm
.
selectedTags
[
this
.
activeTagsGroupIndex
];
tagsGroup
.
splice
(
this
.
activeTagIndex
,
1
,
{
...
tagsGroup
[
this
.
activeTagIndex
],
...
data
});
this
.
ruleForm
.
selectedTags
.
splice
(
this
.
activeTagsGroupIndex
,
1
,
tagsGroup
);
break
;
}
},
...
...
@@ -359,9 +364,10 @@ export default {
* 点击保存
*/
confirmSave
:
_debounce
(
function
()
{
const
that
=
this
;
that
.
$refs
.
ruleForm
.
validate
(
valid
=>
{
if
(
valid
)
that
.
postSave
();
// 优化掉
return
;
this
.
$refs
.
ruleForm
.
validate
(
valid
=>
{
if
(
valid
)
this
.
postSave
();
});
},
500
),
...
...
@@ -524,6 +530,9 @@ export default {
});
});
this
.
ruleForm
.
selectedTags
=
this
.
ruleForm
.
selectedTags
.
filter
(
item
=>
item
.
length
>
0
);
this
.
ruleForm
.
selectedTags
.
map
(
tagsGroup
=>
{
this
.
ruleForm
.
tagsGroupRelation
.
push
(
tagsGroup
[
0
].
levelType
);
});
}
})
.
catch
(
error
=>
{
...
...
src/view/memberGroup/tags-group-list.vue
View file @
504d9048
...
...
@@ -2,7 +2,7 @@
<div
class=
"m-l-60"
>
<tags-group
v-for=
"(item, index) in selectedTagsData"
:key=
"i
ndex
"
:key=
"i
tem
"
:tagsData=
"item"
:showTagsRelation=
"(index === 0 && selectedTagsData.length > 1) || (index === 1 && selectedTagsData.length > 2)"
:tagsGroupIndex=
"index"
...
...
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