Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
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
罗超
confucius
Commits
33d835fb
Commit
33d835fb
authored
Dec 02, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
057ced88
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
165 additions
and
192 deletions
+165
-192
select-search.vue
src/components/common/select-search.vue
+104
-109
dept-form.vue
src/components/system/dept-form.vue
+19
-25
post-form.vue
src/components/system/post-form.vue
+24
-23
dept.vue
src/pages/system/dept.vue
+18
-35
No files found.
src/components/common/select-search.vue
View file @
33d835fb
<
template
>
<q-select
filled
stack-label
:option-value=
"optionValue"
:option-label=
"optionLabel"
v-model=
"vdata_model"
ref=
"DeptTier"
:options=
"newData"
:label=
"label"
:class=
"classStr"
:dense =
'densetype'
:reactive-rules =
'reactiveRules'
emit-value
map-options
clearable
:use-input=
"useInput"
@
input=
"resetSearch"
@
filter=
"filterFn"
>
<!--带搜索功能的下拉框-->
<q-select
filled
stack-label
:option-value=
"optionValue"
:option-label=
"optionLabel"
v-model=
"vdata_model"
:ref=
"id"
:options=
"newData"
:label=
"label"
:class=
"classStr"
:dense=
'densetype'
:reactive-rules=
'reactiveRules'
emit-value
map-options
clearable
:use-input=
"useInput"
@
input=
"resetSearch"
@
filter=
"filterFn"
>
<template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
...
...
@@ -27,7 +12,6 @@
</
template
>
</q-select>
</template>
<
script
>
export
default
{
name
:
"select-search"
,
...
...
@@ -38,8 +22,8 @@
default
:
''
},
//选中数据
vModel
:
{
type
:
String
,
vModel
:
{
type
:
Number
,
default
:
''
},
//下拉的数据
...
...
@@ -48,17 +32,17 @@
default
:
[]
},
//是否紧凑
densetype
:
{
densetype
:
{
type
:
Boolean
,
default
:
false
},
//是否能输入
useInput
:
{
useInput
:
{
type
:
Boolean
,
default
:
false
},
//是否验证
reactiveRules
:
{
reactiveRules
:
{
type
:
Boolean
,
default
:
false
},
...
...
@@ -73,50 +57,61 @@
default
:
''
},
//名称
label
:
{
label
:
{
type
:
String
,
default
:
''
},
//指定的下拉 当前是那个下啦模块
type
:{
type
:
String
,
default
:
''
}
},
data
(){
return
{
vdata_model
:
''
,
newData
:[]
data
()
{
return
{
id
:
'select-search'
+
(
Math
.
floor
((
Math
.
random
()
*
10000
)
+
1
)),
vdata_model
:
0
,
newData
:
[]
}
},
created
(){
this
.
vdata_model
=
this
.
vModel
.
toString
();
//赋值
this
.
newData
=
this
.
Data
//监听数据变化
watch
:
{
//有默认值
Data
:
{
handler
(
newValue
)
{
this
.
newData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
Data
));
},
immediate
:
true
},
//值改变
vModel
:
{
handler
(
newValue
)
{
this
.
vdata_model
=
this
.
vModel
;
},
immediate
:
true
},
},
created
()
{
methods
:{
resetSearch
(){
let
data
=
this
.
vdata_model
!=
null
?
this
.
vdata_model
.
toString
():
''
;
this
.
$emit
(
'returnData'
,
data
,
this
.
type
);
},
methods
:
{
resetSearch
()
{
let
data
=
this
.
vdata_model
!=
null
?
this
.
vdata_model
:
0
;
this
.
$emit
(
'returnData'
,
data
);
},
//搜索方法
filterFn
(
val
,
update
)
{
update
(()
=>
{
let
Name
=
this
.
optionLabel
if
(
val
===
''
)
{
this
.
newData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
Data
))
this
.
newData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
Data
));
}
else
{
const
needle
=
val
.
toLowerCase
()
let
that
=
this
that
.
newData
=
[]
that
.
newData
=
that
.
Data
.
filter
(
v
=>
v
[
Name
].
indexOf
(
needle
)
>
-
1
)
const
needle
=
val
.
toLowerCase
();
let
that
=
this
;
that
.
newData
=
[];
that
.
newData
=
that
.
Data
.
filter
(
v
=>
v
[
Name
].
indexOf
(
needle
)
>
-
1
);
}
})
},
}
}
</
script
>
</
script
>
<
style
scoped
>
</
style
>
src/components/system/dept-form.vue
View file @
33d835fb
...
...
@@ -7,23 +7,10 @@
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
部门信息
</div>
<div
class=
"row wrap"
>
<!--
<q-select
filled
stack-label
option-value=
"SId"
option-label=
"SName"
v-model=
"objOption.School_Id"
--
>
<!-- ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value-->
<!-- map-options />-->
<div
class=
"col-6"
>
<selectSearch
classStr=
"col-12 q-pr-lg q-pb-lg"
:Data=
'schoolList'
optionValue=
"SId"
optionLabel=
"SName"
:densetype=
"false"
:vModel=
"objOption.School_Id"
label=
"所属校区"
@
returnData=
"returnData"
:useInput=
"true"
:reactiveRules=
"false"
type=
"1"
>
<selectSearch
classStr=
"col-12 q-pr-lg q-pb-lg"
:Data=
'schoolList'
optionValue=
"SId"
optionLabel=
"SName"
:densetype=
"false"
:vModel=
"objOption.School_Id"
label=
"所属校区"
@
returnData=
"returnData"
:useInput=
"true"
:reactiveRules=
"false"
>
</selectSearch>
</div>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.DeptName"
ref=
"DeptName"
...
...
@@ -105,7 +92,7 @@
DeptTel
:
""
,
//部门联系电话
ManagerIds
:
""
,
//部门负责人编号
Status
:
0
,
//状态(0-正常,1-禁用),
School_Id
:
''
,
//校区编号
School_Id
:
0
,
//校区编号
DeptTier
:
0
,
//部门层级
DeptSort
:
0
,
//部门排序
},
...
...
@@ -163,8 +150,18 @@
//获取校区
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
;
if
(
res
.
Code
==
1
)
{
var
tempSchoolArray
=
res
.
Data
;
if
(
!
tempSchoolArray
)
{
tempSchoolArray
=
[];
}
tempSchoolArray
.
unshift
({
SId
:
0
,
SName
:
"不限"
});
this
.
schoolList
=
tempSchoolArray
;
this
.
$forceUpdate
();
}
})
},
//获取选中的部门
...
...
@@ -212,7 +209,7 @@
this
.
objOption
.
Status
=
0
;
this
.
objOption
.
DeptSort
=
0
;
this
.
objOption
.
DeptTier
=
0
;
this
.
objOption
.
School_Id
=
''
;
this
.
objOption
.
School_Id
=
0
;
this
.
tempManager
=
[];
}
},
...
...
@@ -252,12 +249,9 @@
this
.
saveLoading
=
false
})
},
returnData
(
data
,
type
){
if
(
type
==
1
){
returnData
(
data
)
{
this
.
objOption
.
School_Id
=
data
;
}
}
},
}
...
...
src/components/system/post-form.vue
View file @
33d835fb
<
style
>
.post-form
.tranbox
.el-transfer-panel
{
.post-form
.tranbox
.el-transfer-panel
{
width
:
300px
;
}
.post-form
.tranbox
.el-button
{
}
.post-form
.tranbox
.el-button
{
padding
:
7px
10px
;
}
}
</
style
>
<
template
>
<q-dialog
v-model=
"persistent"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
...
...
@@ -27,16 +29,10 @@
</div>
</div>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
绑定角色
</div>
<div
class=
"row wrap tranbox"
>
<div
class=
"row wrap tranbox"
>
<template>
<el-transfer
filterable
:filter-method=
"filterMethod"
filter-placeholder=
"请输入城市拼音"
:props=
"
{key: 'RoleId',label: 'RoleName'}"
v-model="value"
:titles="['可选角色', '已选角色']"
:data="data">
<el-transfer
filterable
:filter-method=
"filterMethod"
filter-placeholder=
"请输入城市拼音"
:props=
"
{key: 'RoleId',label: 'RoleName'}" v-model="value" :titles="['可选角色', '已选角色']" :data="data">
</el-transfer>
</
template
>
...
...
@@ -95,7 +91,7 @@
RoleList
:
[],
//角色列表
data
:
[],
value
:
[],
filterMethod
(
query
,
item
)
{
//根据名称搜索
filterMethod
(
query
,
item
)
{
//根据名称搜索
return
item
.
RoleName
.
indexOf
(
query
)
>
-
1
;
}
}
...
...
@@ -141,12 +137,11 @@
this
.
returnString
.
push
(
this
.
objOption
.
RB_Dept_Id
);
this
.
objOption
.
PostName
=
res
.
Data
.
PostName
;
this
.
objOption
.
Status
=
res
.
Data
.
Status
;
if
(
res
.
Data
.
PostRoleList
.
length
>
0
)
{
res
.
Data
.
PostRoleList
.
forEach
(
x
=>
{
if
(
res
.
Data
.
PostRoleList
.
length
>
0
)
{
res
.
Data
.
PostRoleList
.
forEach
(
x
=>
{
this
.
value
.
push
(
x
.
RoleId
)
})
}
})
this
.
optionTitle
=
"修改岗位信息"
}
else
{
...
...
@@ -157,7 +152,6 @@
this
.
objOption
.
Status
=
0
;
}
},
//关闭弹窗
closeSaveForm
()
{
this
.
$emit
(
'close'
)
...
...
@@ -168,14 +162,21 @@
var
tempRole
=
[];
if
(
this
.
RoleList
&&
this
.
RoleList
.
length
>
0
)
{
this
.
RoleList
.
forEach
(
x
=>
{
this
.
value
.
forEach
(
j
=>
{
if
(
x
.
RoleId
==
j
)
{
this
.
value
.
forEach
(
j
=>
{
if
(
x
.
RoleId
==
j
)
{
tempRole
.
push
(
x
)
}
})
})
}
this
.
objOption
.
PostRoleList
=
tempRole
;
if
(
this
.
objOption
.
RB_Dept_Id
)
{
if
(
this
.
objOption
.
RB_Dept_Id
==
""
)
{
this
.
objOption
.
RB_Dept_Id
=
0
;
}
}
else
{
this
.
objOption
.
RB_Dept_Id
=
0
;
}
this
.
objOption
.
PostRoleList
=
tempRole
;
this
.
saveLoading
=
true
;
savePostInfo
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveLoading
=
false
...
...
src/pages/system/dept.vue
View file @
33d835fb
...
...
@@ -2,26 +2,10 @@
<div
class=
"page-body"
>
<div
class=
"page-search row items-center"
>
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
<!--
<div
class=
"col-3"
>
-->
<!--
<q-select
@
input=
"resetSearch"
filled
stack-label
option-value=
"SId"
option-label=
"SName"
--
>
<!-- v-model="msg.School_Id" :options="schoolList" label="校区" :dense="false" class="col-6 q-pr-lg q-pb-lg"-->
<!-- emit-value map-options clearable @clear="resetSearch" />-->
<!--
</div>
-->
<div
class=
"col-3"
>
<selectSearch
classStr=
"col-12 q-pr-lg q-pb-lg"
:Data=
'schoolList'
optionValue=
"SId"
optionLabel=
"SName"
:densetype=
"false"
:vModel=
"msg.School_Id"
label=
"校区"
@
returnData=
"returnData"
:useInput=
"true"
:reactiveRules=
"false"
type=
"1"
>
<selectSearch
classStr=
"col-12 q-pr-lg q-pb-lg"
:Data=
'schoolList'
optionValue=
"SId"
optionLabel=
"SName"
:densetype=
"false"
:vModel=
"msg.School_Id"
label=
"校区"
@
returnData=
"returnData"
:useInput=
"true"
:reactiveRules=
"false"
>
</selectSearch>
</div>
<div
class=
"col-3"
>
...
...
@@ -175,7 +159,7 @@
DeptName
:
""
,
//部门名称
DeptId
:
0
,
//部门编号
Status
:
"-1"
,
School_Id
:
""
,
School_Id
:
0
,
DeptTier
:
""
,
ParentId
:
""
,
},
...
...
@@ -222,7 +206,15 @@
//获取校区
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
;
var
tempSchoolArray
=
res
.
Data
;
if
(
!
tempSchoolArray
)
{
tempSchoolArray
=
[];
}
tempSchoolArray
.
unshift
({
SId
:
0
,
SName
:
"不限"
});
this
.
schoolList
=
tempSchoolArray
;
this
.
$forceUpdate
();
})
},
...
...
@@ -244,9 +236,6 @@
},
//获取部门分页列表
queryDeptPage
()
{
if
(
this
.
msg
.
School_Id
==
""
||
this
.
msg
.
School_Id
==
null
)
{
this
.
msg
.
School_Id
=
"0"
;
}
if
(
this
.
msg
.
DeptTier
==
""
||
this
.
msg
.
DeptTier
==
null
)
{
this
.
msg
.
DeptTier
=
"0"
}
...
...
@@ -258,9 +247,7 @@
this
.
loading
=
false
;
this
.
data
=
res
.
Data
.
PageData
;
this
.
pageCount
=
res
.
Data
.
PageCount
;
if
(
this
.
msg
.
School_Id
==
"0"
)
{
this
.
msg
.
School_Id
=
""
;
}
if
(
this
.
msg
.
DeptTier
==
"0"
)
{
this
.
msg
.
DeptTier
=
""
}
...
...
@@ -331,14 +318,10 @@
obj
.
Status
=
obj
.
Status
==
1
?
0
:
1
;
});
},
returnData
(
data
,
type
){
if
(
type
==
1
){
returnData
(
data
)
{
this
.
msg
.
School_Id
=
data
;
}
this
.
resetSearch
()
}
}
}
...
...
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