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
2fa5029d
Commit
2fa5029d
authored
Nov 30, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9547daf7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
10 deletions
+51
-10
select-search.vue
src/components/common/select-search.vue
+19
-4
dept-form.vue
src/components/system/dept-form.vue
+31
-6
dept.vue
src/pages/system/dept.vue
+1
-0
No files found.
src/components/common/select-search.vue
View file @
2fa5029d
...
...
@@ -9,13 +9,22 @@
: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"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
</template>
...
...
@@ -38,7 +47,7 @@
type
:
Array
,
default
:
[]
},
//是否紧凑
densetype
:{
type
:
Boolean
,
default
:
false
...
...
@@ -48,6 +57,11 @@
type
:
Boolean
,
default
:
false
},
//是否验证
reactiveRules
:{
type
:
Boolean
,
default
:
false
},
//选项的值
optionValue
:
{
type
:
String
,
...
...
@@ -76,24 +90,25 @@
}
},
created
(){
this
.
vdata_model
=
this
.
vModel
;
//赋值
this
.
vdata_model
=
this
.
vModel
.
toString
()
;
//赋值
this
.
newData
=
this
.
Data
},
methods
:{
resetSearch
(){
let
data
=
this
.
vdata_model
.
toString
()
let
data
=
this
.
vdata_model
!=
null
?
this
.
vdata_model
.
toString
():
''
;
this
.
$emit
(
'returnData'
,
data
,
this
.
type
);
},
filterFn
(
val
,
update
)
{
update
(()
=>
{
let
Name
=
this
.
optionLabel
if
(
val
===
''
)
{
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
.
SName
.
indexOf
(
needle
)
>
-
1
)
that
.
newData
=
that
.
Data
.
filter
(
v
=>
v
[
Name
]
.
indexOf
(
needle
)
>
-
1
)
}
})
...
...
src/components/system/dept-form.vue
View file @
2fa5029d
...
...
@@ -7,9 +7,25 @@
<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
/>
<!--
<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>
</div>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.DeptName"
ref=
"DeptName"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"部门名称"
:rules=
"[val => !!val || '请填写部门名称']"
/>
<q-select
filled
stack-label
option-value=
"value"
option-label=
"label"
v-model=
"objOption.DeptTier"
...
...
@@ -52,6 +68,8 @@
<
script
>
import
selectTree
from
'../common/select-tree'
import
selectSearch
from
'../../components/common/select-search'
import
{
getDeptTree
,
saveDeptInfo
,
...
...
@@ -74,7 +92,8 @@
}
},
components
:
{
selectTree
selectTree
,
selectSearch
},
data
()
{
return
{
...
...
@@ -86,7 +105,7 @@
DeptTel
:
""
,
//部门联系电话
ManagerIds
:
""
,
//部门负责人编号
Status
:
0
,
//状态(0-正常,1-禁用),
School_Id
:
0
,
//校区编号
School_Id
:
''
,
//校区编号
DeptTier
:
0
,
//部门层级
DeptSort
:
0
,
//部门排序
},
...
...
@@ -193,7 +212,7 @@
this
.
objOption
.
Status
=
0
;
this
.
objOption
.
DeptSort
=
0
;
this
.
objOption
.
DeptTier
=
0
;
this
.
objOption
.
School_Id
=
0
;
this
.
objOption
.
School_Id
=
''
;
this
.
tempManager
=
[];
}
},
...
...
@@ -232,6 +251,12 @@
}).
catch
(()
=>
{
this
.
saveLoading
=
false
})
},
returnData
(
data
,
type
){
if
(
type
==
1
){
this
.
objOption
.
School_Id
=
data
;
}
}
},
}
...
...
src/pages/system/dept.vue
View file @
2fa5029d
...
...
@@ -18,6 +18,7 @@
label=
"校区"
@
returnData=
"returnData"
:useInput=
"true"
:reactiveRules=
"false"
type=
"1"
>
...
...
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