Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
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
谢林臻
sun
Commits
984da8fd
Commit
984da8fd
authored
Nov 29, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化用户查询
parent
1b827b1c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
29 deletions
+53
-29
base.py
utils/base.py
+1
-1
PushDetail.vue
vu/src/views/push/components/PushDetail.vue
+5
-0
TagDetail.vue
vu/src/views/tag/components/TagDetail.vue
+40
-17
UserDetail.vue
vu/src/views/user/components/UserDetail.vue
+1
-1
list.vue
vu/src/views/user/list.vue
+6
-10
No files found.
utils/base.py
View file @
984da8fd
...
...
@@ -286,7 +286,7 @@ class APIView(View):
def
make_pair
(
self
,
data
):
val
=
data
.
pop
(
'value'
,
''
)
key
=
data
.
pop
(
'key'
,
''
)
if
key
and
key
not
in
[
'id'
]:
if
key
and
key
not
in
[
'id'
,
'user_id'
]:
key
+=
'__contains'
if
key
:
data
.
update
({
key
:
val
})
...
...
vu/src/views/push/components/PushDetail.vue
View file @
984da8fd
...
...
@@ -201,6 +201,11 @@ export default {
})
},
effectPush
()
{
if
(
this
.
postForm
.
push_time
<
Date
.
now
()){
this
.
$message
.
error
(
"推送时间已过期, 请重新设置!!"
);
return
false
}
this
.
is_effect
=
Boolean
(
1
);
const
id
=
this
.
$route
.
params
&&
this
.
$route
.
params
.
id
EffectPushTask
(
id
).
then
(
response
=>
{
...
...
vu/src/views/tag/components/TagDetail.vue
View file @
984da8fd
...
...
@@ -22,13 +22,17 @@
<div
class=
"postInfo-container"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"标签ID:"
prop=
"position"
v-if=
"isEdit"
>
<el-input
:rows=
"1"
v-model=
"postForm.id"
type=
"number"
class=
"article-textarea"
style=
"width: 300px"
disabled
/>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"标签ID:"
prop=
"position"
v-if=
"isEdit"
>
<el-input
:rows=
"1"
v-model=
"postForm.id"
type=
"number"
class=
"article-textarea"
style=
"width: 300px"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"创建时间:"
prop=
"position"
v-if=
"isEdit"
>
<el-input
:rows=
"1"
v-model=
"postForm.create_time"
type=
"text"
class=
"article-textarea"
style=
"width: 300px"
disabled
/>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"创建时间:"
prop=
"position"
v-if=
"isEdit"
>
<el-input
:rows=
"1"
v-model=
"postForm.create_time"
type=
"text"
class=
"article-textarea"
style=
"width: 300px"
disabled
/>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -38,9 +42,11 @@
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label-width=
"75px"
label=
"上级标签:"
class=
"postInfo-container-item"
>
<el-select
v-model=
"postForm.up_tags"
:remote-method=
"getRemoteTagList"
filterable
remote
multiple
value-key=
"id"
<el-select
v-model=
"postForm.up_tags"
:remote-method=
"getRemoteTagList"
filterable
remote
multiple
value-key=
"id"
placeholder=
"搜索标签"
style=
"width: 70%"
>
<el-option
v-for=
"(item,index) in TagListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
<el-option
v-for=
"(item,index) in TagListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-form-item>
</el-col>
...
...
@@ -59,7 +65,8 @@
:loading=
"loading"
value-key=
"id"
>
<el-option
v-for=
"(item, index) in TagListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
<el-option
v-for=
"(item, index) in TagListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-form-item>
</el-col>
...
...
@@ -80,12 +87,12 @@
import
Sticky
from
'@/components/Sticky'
// 粘性header组件
import
{
fetchTagDetail
,
CreateTag
}
from
'@/api/tag'
import
{
tagSearch
}
from
'@/api/remoteSearch'
import
{
isInArray
,
removeByvale
}
from
"@/utils"
;
import
{
isInArray
,
removeByvale
}
from
"@/utils"
;
function
Assembledata
(
target
,
source
)
{
var
region_data
=
[]
for
(
var
i
=
0
;
i
<
target
.
length
;
i
++
)
{
if
(
isInArray
(
source
,
target
[
i
][
'name'
])){
for
(
var
i
=
0
;
i
<
target
.
length
;
i
++
)
{
if
(
isInArray
(
source
,
target
[
i
][
'name'
]))
{
region_data
.
push
(
target
[
i
][
'id'
])
removeByvale
(
source
,
target
[
i
][
'name'
]);
}
...
...
@@ -131,8 +138,8 @@
name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
},
tempRoute
:
{},
temparray
:{
'up_tags'
:[],
temparray
:
{
'up_tags'
:
[],
'down_tags'
:
[],
}
}
...
...
@@ -159,13 +166,12 @@
let
rep
=
response
.
data
.
data
.
data
;
let
up_temp
=
[]
let
down_temp
=
[]
console
.
log
(
rep
.
up_tags
,
'-========='
,
rep
.
up_tags
.
length
)
for
(
let
i
=
0
;
i
<
rep
.
up_tags
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
rep
.
up_tags
.
length
;
i
++
)
{
up_temp
.
push
(
rep
.
up_tags
[
i
][
'name'
]);
this
.
temparray
[
'up_tags'
].
push
(
rep
.
up_tags
[
i
])
}
console
.
log
(
rep
.
down_tags
.
length
)
for
(
let
i
=
0
;
i
<
rep
.
down_tags
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
rep
.
down_tags
.
length
;
i
++
)
{
down_temp
.
push
(
rep
.
down_tags
[
i
][
'name'
]);
this
.
temparray
[
'down_tags'
].
push
(
rep
.
down_tags
[
i
])
}
...
...
@@ -181,14 +187,31 @@
this
.
$refs
.
postForm
.
validate
(
valid
=>
{
if
(
valid
)
{
this
.
loading
=
true
;
if
(
this
.
isEdit
){
if
(
this
.
isEdit
)
{
this
.
postForm
.
up_tags
=
Assembledata
(
this
.
temparray
[
'up_tags'
],
this
.
postForm
.
up_tags
);
this
.
postForm
.
down_tags
=
Assembledata
(
this
.
temparray
[
'down_tags'
],
this
.
postForm
.
down_tags
);
}
else
{
}
else
{
this
.
postForm
.
up_tags
=
this
.
postForm
.
up_tags
.
join
(
','
)
this
.
postForm
.
down_tags
=
this
.
postForm
.
down_tags
.
join
(
','
)
}
let
flag
=
false
;
let
up_tag_arrays
=
this
.
postForm
.
up_tags
.
split
(
','
)
let
down_tags_arrays
=
this
.
postForm
.
down_tags
.
split
(
','
)
for
(
let
i
=
0
;
i
<
up_tag_arrays
.
length
;
i
++
){
if
(
isInArray
(
down_tags_arrays
,
up_tag_arrays
[
i
])){
this
.
$message
.
error
(
'上下级标签不能存相同标签'
)
this
.
postForm
.
up_tags
=
[];
this
.
postForm
.
down_tags
=
[];
flag
=
true
;
break
}
}
if
(
flag
){
return
false
;
}
CreateTag
(
this
.
postForm
).
then
(
response
=>
{
this
.
$notify
({
title
:
'成功'
,
...
...
vu/src/views/user/components/UserDetail.vue
View file @
984da8fd
...
...
@@ -220,7 +220,7 @@
const
defaultForm
=
{
status
:
'draft'
,
uploadType
:
''
,
is_recommend
:
1
,
is_recommend
:
0
,
user_id
:
''
,
create_time
:
''
,
topic_nums
:
0
,
...
...
vu/src/views/user/list.vue
View file @
984da8fd
...
...
@@ -149,13 +149,9 @@
is_recommend
:
''
,
},
},
BooleanTypeOptions
:
[
{
'key'
:
1
,
'display_name'
:
'是'
},
{
'key'
:
0
,
'display_name'
:
'否'
}
],
ReBooleanTypeOptions
:
[
{
'key'
:
1
,
'display_name'
:
'是'
},
{
'key'
:
0
,
'display_name'
:
'否'
}
{
'key'
:
'1'
,
'display_name'
:
'是'
},
{
'key'
:
'0'
,
'display_name'
:
'否'
}
],
IdentifyTypeOptions
:
[
{
'key'
:
1
,
'display_name'
:
'组长'
},
...
...
@@ -164,14 +160,14 @@
{
'key'
:
4
,
'display_name'
:
'普通群员'
},
],
UserTypeOptions
:
[
{
'key'
:
0
,
'display_name'
:
'普通用户'
},
{
'key'
:
1
,
'display_name'
:
'马甲用户'
}
{
'key'
:
'0'
,
'display_name'
:
'普通用户'
},
{
'key'
:
'1'
,
'display_name'
:
'马甲用户'
}
],
SearchTypeOptions
:
[
{
'key'
:
'id'
,
'display_name'
:
'ID'
},
{
'key'
:
'user_id'
,
'display_name'
:
'用户ID'
},
{
'key'
:
'name'
,
'display_name'
:
'用户名'
},
{
'key'
:
'phone'
,
'display_name'
:
'联系电话'
},
{
'key'
:
'n
ick_n
ame'
,
'display_name'
:
'用户名'
},
{
'key'
:
'phone
_num
'
,
'display_name'
:
'联系电话'
},
]
}
},
...
...
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