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
b3b86e77
Commit
b3b86e77
authored
Apr 29, 2019
by
member
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of 115.159.76.241:memberTag/memberTag-web into dev
parents
46d47610
ec084423
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
46 deletions
+40
-46
selected-tags-list.vue
src/components/selected-tags-list.vue
+8
-3
memberGroupDetail.vue
src/view/memberGroup/memberGroupDetail.vue
+0
-3
memberGroupEdit.vue
src/view/memberGroup/memberGroupEdit.vue
+32
-40
No files found.
src/components/selected-tags-list.vue
View file @
b3b86e77
<
template
>
<div
class=
"flex m-t-20 tags"
>
<div
v-for=
"(tags, index) in tagsList"
:key=
"tags"
:style=
"`width: $
{100 / tagsList.length}%`" class="tag-group">
<div
v-for=
"(tags, index) in tagsList
Filter
"
:key=
"tags"
:style=
"`width: $
{100 / tagsList.length}%`" class="tag-group">
<ul
class=
"tag-list"
>
<li
class=
"tag-item"
v-for=
"tag in tags"
:key=
"tag.tagId"
>
<span>
{{
tag
.
tagName
}}
</span>
<span
class=
"tags-item__name"
>
【选择:
{{
getTagVal
(
tag
)
}}
】
</span>
</li>
</ul>
<div
v-if=
"(index === 0 && tagsList
.length > 1) || (index === 1 && tagsList
.length > 2)"
class=
"tag-relation"
>
<div
v-if=
"(index === 0 && tagsList
Filter.length > 1) || (index === 1 && tagsListFilter
.length > 2)"
class=
"tag-relation"
>
<span
class=
"tag-relation__wrap"
>
<i
class=
"tag-relation__cont"
>
{{
tags
List
[
index
][
0
].
levelType
===
'or'
?
'或者'
:
tagsList
[
index
]
[
0
].
levelType
===
'andNot'
?
'剔除'
:
''
}}
{{
tags
[
0
].
levelType
===
'or'
?
'或者'
:
tags
[
0
].
levelType
===
'andNot'
?
'剔除'
:
''
}}
</i>
</span>
</div>
...
...
@@ -27,6 +27,11 @@ export default {
required
:
true
}
},
computed
:
{
tagsListFilter
()
{
return
this
.
tagsList
.
filter
(
tags
=>
tags
.
length
>
0
);
}
},
methods
:
{
getTagVal
(
tagData
)
{
const
tag
=
JSON
.
parse
(
tagData
.
tagParams
);
...
...
src/view/memberGroup/memberGroupDetail.vue
View file @
b3b86e77
...
...
@@ -418,9 +418,6 @@ export default {
list
.
forEach
(
li
=>
{
li
.
tagParams
&&
(
li
.
tagParams
=
JSON
.
parse
(
li
.
tagParams
));
});
list
[
0
][
0
].
levelType
=
'or'
;
list
[
1
]
=
list
[
0
];
list
[
2
]
=
list
[
0
];
this
.
selectedTagData
=
list
;
})
.
catch
(
e
=>
{
...
...
src/view/memberGroup/memberGroupEdit.vue
View file @
b3b86e77
...
...
@@ -50,7 +50,7 @@
</el-select>
</el-form-item>
<el-form-item
label=
""
>
<el-button
type=
"primary"
@
click
.
stop=
"
postSave
"
>
保存
</el-button>
<el-button
type=
"primary"
@
click
.
stop=
"
confirmSavePost
"
>
保存
</el-button>
<el-button>
<router-link
to=
"/memberGroupList"
>
返回
</router-link>
</el-button>
...
...
@@ -99,7 +99,6 @@ import tagContainer from '@/view/platformTag/tag-container.vue';
import
editTag
from
'./edit-tag'
;
import
tagsGroupList
from
'./tags-group-list.vue'
;
import
showMsg
from
'@/common/js/showmsg'
;
import
{
_debounce
}
from
'@/common/js/public'
;
import
{
postRequest
}
from
'@/api/api'
;
import
{
getMemberTagCount
}
from
'@/request/memberGroup.js'
;
import
{
getMemberTagList
}
from
'@/request/api.js'
;
...
...
@@ -279,6 +278,21 @@ export default {
];
}
},
/**
* 检查标签是不是实时
* 1=实时 0=非实时
*/
watch
:
{
'ruleForm.selectedTags'
:
{
deep
:
true
,
handler
()
{
let
flag
=
this
.
ruleForm
.
selectedTags
.
length
===
0
||
this
.
ruleForm
.
selectedTags
.
some
(
tagsGroup
=>
{
return
tagsGroup
.
length
===
0
||
tagsGroup
.
some
(
tag
=>
parseInt
(
tag
.
isActive
)
===
0
);
});
this
.
ruleForm
.
isActive
=
flag
?
0
:
1
;
}
}
},
methods
:
{
/**
* 路由跳转
...
...
@@ -339,50 +353,20 @@ export default {
this
.
ruleForm
.
selectedTags
.
splice
(
this
.
activeTagsGroupIndex
,
1
,
tagsGroup
);
break
;
}
this
.
checkRealTime
();
},
/**
* 已选标签-删除-检查实时
*/
checkRealTime
()
{
if
(
this
.
ruleForm
.
selectedTags
.
length
===
0
)
{
this
.
rule
.
isActive
=
0
;
return
;
}
let
flag
=
this
.
ruleForm
.
selectedTags
.
some
(
tagsGroup
=>
{
return
tagsGroup
.
some
(
tag
=>
parseInt
(
tag
.
isActive
)
===
0
);
});
this
.
ruleForm
.
isActive
=
flag
?
0
:
1
;
},
/**
* 点击保存
*/
confirmSave
:
_debounce
(
function
()
{
// 优化掉
return
;
confirmSavePost
()
{
this
.
$refs
.
ruleForm
.
validate
(
valid
=>
{
if
(
valid
)
this
.
postSave
();
});
},
500
),
confirmSavePost
(
formName
)
{
// 优化掉
return
;
const
that
=
this
;
that
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
console
.
log
(
'valid'
,
that
.
ruleForm
);
const
flag
=
that
.
ruleForm
.
isActive
==
0
&&
that
.
ruleForm
.
updateType
!=
1
&&
that
.
ruleForm
.
updateDay
==
''
;
if
(
!!
flag
)
{
that
.
$message
.
error
({
message
:
'请选择更新频率!'
});
const
flag
=
this
.
ruleForm
.
isActive
===
0
&&
this
.
ruleForm
.
updateType
!==
1
&&
this
.
ruleForm
.
updateDay
===
''
;
if
(
flag
)
{
this
.
$message
.
error
({
message
:
'请选择更新频率!'
});
return
false
;
}
that
.
postSave
(
that
.
ruleForm
);
}
else
{
return
false
;
this
.
postSave
();
}
});
},
...
...
@@ -393,6 +377,12 @@ export default {
postSave
()
{
let
ruleForm
=
this
.
ruleForm
;
ruleForm
.
selectedTags
.
forEach
((
tagsGroup
,
tagsGroupIndex
)
=>
{
let
relation
=
ruleForm
.
tagsGroupRelation
[
tagsGroupIndex
];
tagsGroup
.
forEach
(
item
=>
{
item
.
levelType
=
relation
?
relation
:
'or'
;
})
});
const
para
=
{
memberTagGroupId
:
ruleForm
.
memberTagGroupId
,
groupName
:
ruleForm
.
groupName
,
...
...
@@ -410,12 +400,14 @@ export default {
postRequest
(
postUrl
,
para
)
.
then
(
res
=>
{
if
(
res
.
data
.
errorCode
===
1
)
{
showMsg
.
showmsg
(
'编辑
成功'
,
'success'
);
showMsg
.
showmsg
(
this
.
ruleForm
.
memberTagGroupId
?
'编辑成功'
:
'新增
成功'
,
'success'
);
this
.
changeRoute
(
'/memberGroupList'
);
}
else
{
this
.
$message
.
warning
(
res
.
data
.
message
);
}
})
.
catch
(
function
(
error
)
{
console
.
lo
g
(
error
);
.
catch
(
error
=>
{
this
.
$message
.
warnin
g
(
error
);
});
},
...
...
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