Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
587c5305
authored
2023-07-20 14:09:59 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
docs:注释增加
1 parent
ecb27d8c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
271 additions
and
256 deletions
src/components/CheckBox/checkbox.vue
src/components/DialogBox/dialogBox.vue
src/views/components/addProject.vue
src/views/components/comMsg.vue
src/components/CheckBox/checkbox.vue
View file @
587c530
This diff is collapsed.
Click to expand it.
src/components/DialogBox/dialogBox.vue
View file @
587c530
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-20 13:33:07
-->
<
template
>
<el-dialog
:visible
.
sync=
"dialogVisible"
v-if=
"dialogVisible"
:width=
"width"
:fullscreen=
"fullscreen"
top=
"0"
:append-to-body=
"appendToBody"
:lock-scroll=
"true"
:close-on-click-modal=
"false"
@
close=
"closeDialog"
:key=
"key"
...
...
@@ -23,117 +28,117 @@
</el-dialog>
</
template
>
<
script
>
export
default
{
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
},
isMain
:
{
type
:
Boolean
,
default
:
false
},
appendToBody
:
{
type
:
Boolean
,
default
:
true
},
isButton
:
{
type
:
Boolean
,
default
:
true
,
},
width
:
{
type
:
String
,
default
:
'70%'
,
},
title
:
{
type
:
String
,
default
:
''
,
},
isFullscreen
:
{
type
:
Boolean
,
default
:
true
,
},
isSave
:
{
type
:
Boolean
,
default
:
true
,
},
saveButton
:
{
type
:
String
,
default
:
'提交'
,
},
isReset
:
{
type
:
Boolean
,
default
:
true
,
},
saveloding
:
{
type
:
Boolean
,
default
:
false
,
export
default
{
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
},
isMain
:
{
type
:
Boolean
,
default
:
false
},
appendToBody
:
{
type
:
Boolean
,
default
:
true
},
isButton
:
{
type
:
Boolean
,
default
:
true
,
},
width
:
{
type
:
String
,
default
:
'70%'
,
},
title
:
{
type
:
String
,
default
:
''
,
},
isFullscreen
:
{
type
:
Boolean
,
default
:
true
,
},
isSave
:
{
type
:
Boolean
,
default
:
true
,
},
saveButton
:
{
type
:
String
,
default
:
'提交'
,
},
isReset
:
{
type
:
Boolean
,
default
:
true
,
},
saveloding
:
{
type
:
Boolean
,
default
:
false
,
},
btnDisabled
:
{
type
:
Boolean
,
default
:
false
},
height
:
{
type
:
String
,
default
:
''
}
},
btnDisabled
:
{
type
:
Boolean
,
default
:
false
data
()
{
return
{
key
:
0
,
dialogVisible
:
false
,
fullscreen
:
false
,
scrollerHeight
:
''
}
},
height
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
key
:
0
,
dialogVisible
:
false
,
fullscreen
:
false
,
scrollerHeight
:
''
}
},
watch
:
{
value
(
val
)
{
this
.
$nextTick
(()
=>
{
this
.
dialogVisible
=
val
})
this
.
height
&&
(
this
.
scrollerHeight
=
this
.
height
+
'px'
)
}
},
methods
:
{
/**
* @description: handleFullscreen
* @author: renchao
*/
handleFullscreen
()
{
this
.
fullscreen
=
!
this
.
fullscreen
if
(
!
this
.
fullscreen
)
{
this
.
scrollerHeight
=
''
}
else
{
this
.
scrollerHeight
=
(
window
.
innerHeight
-
120
)
+
'px'
watch
:
{
value
(
val
)
{
this
.
$nextTick
(()
=>
{
this
.
dialogVisible
=
val
})
this
.
height
&&
(
this
.
scrollerHeight
=
this
.
height
+
'px'
)
}
},
/**
* @description: submitForm
* @author: renchao
*/
submitForm
()
{
if
(
this
.
isButton
)
{
this
.
$emit
(
'submitForm'
);
methods
:
{
/**
* @description: handleFullscreen
* @author: renchao
*/
handleFullscreen
()
{
this
.
fullscreen
=
!
this
.
fullscreen
if
(
!
this
.
fullscreen
)
{
this
.
scrollerHeight
=
''
}
else
{
this
.
scrollerHeight
=
(
window
.
innerHeight
-
120
)
+
'px'
}
},
/**
* @description: submitForm
* @author: renchao
*/
submitForm
()
{
if
(
this
.
isButton
)
{
this
.
$emit
(
'submitForm'
);
}
},
/**
* @description: closeDialog
* @author: renchao
*/
closeDialog
()
{
this
.
key
++
this
.
$emit
(
'input'
,
false
)
this
.
$emit
(
'closeDialog'
)
}
},
/**
* @description: closeDialog
* @author: renchao
*/
closeDialog
()
{
this
.
key
++
this
.
$emit
(
'input'
,
false
)
this
.
$emit
(
'closeDialog'
)
}
},
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
>
@import
"~@/styles/mixin.scss"
;
@import
"~@/styles/dialogBox.scss"
;
@import
"~@/styles/mixin.scss"
;
@import
"~@/styles/dialogBox.scss"
;
</
style
>
<
style
rel=
"stylesheet/scss"
scoped
lang=
"scss"
>
/
deep
/
.is-fullscreen
{
position
:
absolute
;
top
:
50%
!important
;
left
:
50%
!important
;
transform
:
translate
(
-50%
,
-50%
)
!important
;
}
/
deep
/
.is-fullscreen
{
position
:
absolute
;
top
:
50%
!important
;
left
:
50%
!important
;
transform
:
translate
(
-50%
,
-50%
)
!important
;
}
</
style
>
...
...
src/views/components/addProject.vue
View file @
587c530
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-20 13:40:27
-->
<
template
>
<dialogBox
title=
"配置常办项目"
@
submitForm=
"submitForm"
saveButton=
"保存"
:isFullscreen=
"false"
width=
"50%"
@
closeDialog=
"closeDialog"
v-model=
"myValue"
>
...
...
@@ -6,103 +11,103 @@
</dialogBox>
</
template
>
<
script
>
import
{
getMenuInfo
}
from
"@/api/user.js"
;
import
Tree
from
"@/components/Tree/src/tree.vue"
import
{
saveFrequentProjectsList
,
getHomeFrequentProjects
}
from
"@/api/home.js"
;
export
default
{
components
:
{
Tree
},
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
},
bindItem
:
{
type
:
Array
,
default
:
[]
}
},
data
()
{
return
{
myValue
:
false
,
defaultCheckeds
:
[],
projectList
:
[],
checkedItem
:
[],
defaultProps
:
{
children
:
"children"
,
label
:
"name"
,
disabled
:
function
(
data
,
node
)
{
if
(
data
.
children
&&
data
.
children
.
length
>
0
)
{
return
true
}
else
{
return
false
import
{
getMenuInfo
}
from
"@/api/user.js"
;
import
Tree
from
"@/components/Tree/src/tree.vue"
import
{
saveFrequentProjectsList
,
getHomeFrequentProjects
}
from
"@/api/home.js"
;
export
default
{
components
:
{
Tree
},
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
},
bindItem
:
{
type
:
Array
,
default
:
[]
}
},
data
()
{
return
{
myValue
:
false
,
defaultCheckeds
:
[],
projectList
:
[],
checkedItem
:
[],
defaultProps
:
{
children
:
"children"
,
label
:
"name"
,
disabled
:
function
(
data
,
node
)
{
if
(
data
.
children
&&
data
.
children
.
length
>
0
)
{
return
true
}
else
{
return
false
}
}
}
},
uniqueValue
:
''
//最后拿到的唯一选择的moduldCode值,相当于id
}
},
watch
:
{
value
(
val
)
{
this
.
myValue
=
val
if
(
val
)
{
this
.
queryClick
()
},
uniqueValue
:
''
//最后拿到的唯一选择的moduldCode值,相当于id
}
}
},
mounted
()
{
this
.
dealCheckedItem
();
},
methods
:
{
submitForm
()
{
var
checkedNodes
=
this
.
$refs
.
tree
.
getCheckedNodes
();
if
(
checkedNodes
.
length
>
6
)
{
this
.
$message
.
error
(
"最多选择6个项目!"
);
return
}
saveFrequentProjectsList
(
checkedNodes
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$parent
.
queryProjectList
();
this
.
$message
.
success
(
"保存成功"
);
this
.
$emit
(
"input"
,
false
);
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
})
},
queryClick
()
{
let
that
=
this
getMenuInfo
().
then
(
res
=>
{
this
.
projectList
=
res
.
result
.
slice
(
0
,
-
2
)
})
function
lookForAllId
(
arr
=
[])
{
for
(
let
item
of
that
.
bindItem
)
{
arr
.
push
(
item
.
id
)
if
(
item
.
children
&&
item
.
children
.
length
)
lookForAllId
(
item
.
children
,
arr
)
watch
:
{
value
(
val
)
{
this
.
myValue
=
val
if
(
val
)
{
this
.
queryClick
()
}
return
arr
}
this
.
defaultCheckeds
=
lookForAllId
()
},
dealCheckedItem
()
{
mounted
()
{
this
.
dealCheckedItem
();
},
//关闭窗口
closeDialog
()
{
this
.
$emit
(
"input"
,
false
);
},
//节点选择状态发生改变时
handleClick
(
data
,
checked
,
node
)
{
var
checkedNodes
=
this
.
$refs
.
tree
.
getCheckedNodes
();
if
(
checkedNodes
.
length
>
6
)
{
this
.
$message
({
message
:
'最后选择6条数据'
,
type
:
'warning'
,
customClass
:
'messageIndex'
methods
:
{
submitForm
()
{
var
checkedNodes
=
this
.
$refs
.
tree
.
getCheckedNodes
();
if
(
checkedNodes
.
length
>
6
)
{
this
.
$message
.
error
(
"最多选择6个项目!"
);
return
}
saveFrequentProjectsList
(
checkedNodes
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$parent
.
queryProjectList
();
this
.
$message
.
success
(
"保存成功"
);
this
.
$emit
(
"input"
,
false
);
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
})
},
queryClick
()
{
let
that
=
this
getMenuInfo
().
then
(
res
=>
{
this
.
projectList
=
res
.
result
.
slice
(
0
,
-
2
)
})
this
.
$refs
.
tree
.
setChecked
(
data
,
false
)
// 取消当前节点的选中状态
function
lookForAllId
(
arr
=
[])
{
for
(
let
item
of
that
.
bindItem
)
{
arr
.
push
(
item
.
id
)
if
(
item
.
children
&&
item
.
children
.
length
)
lookForAllId
(
item
.
children
,
arr
)
}
return
arr
}
this
.
defaultCheckeds
=
lookForAllId
()
},
dealCheckedItem
()
{
},
//关闭窗口
closeDialog
()
{
this
.
$emit
(
"input"
,
false
);
},
//节点选择状态发生改变时
handleClick
(
data
,
checked
,
node
)
{
var
checkedNodes
=
this
.
$refs
.
tree
.
getCheckedNodes
();
if
(
checkedNodes
.
length
>
6
)
{
this
.
$message
({
message
:
'最后选择6条数据'
,
type
:
'warning'
,
customClass
:
'messageIndex'
})
this
.
$refs
.
tree
.
setChecked
(
data
,
false
)
// 取消当前节点的选中状态
}
}
}
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
/
deep
/
.el-tree-node.is-expanded
>
.el-tree-node__children
{
display
:
flex
;
flex-wrap
:
wrap
;
}
/
deep
/
.el-tree-node.is-expanded
>
.el-tree-node__children
{
display
:
flex
;
flex-wrap
:
wrap
;
}
</
style
>
...
...
src/views/components/comMsg.vue
View file @
587c530
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-20 13:40:32
-->
<
template
>
<div
class=
"model"
>
<div
class=
"mask"
>
123
</div>
...
...
@@ -18,71 +23,71 @@
<
style
scoped
lang=
'scss'
>
//
css
部分
.mask
{
position
:
fixed
;
//这里用固定定位,后面设置动画时才不受影响
top
:
0
;
height
:
100%
;
width
:
100%
;
background-color
:
rgba
(
167
,
165
,
165
,
0.486
);
opacity
:
0.5
;
z-index
:
9
;
}
.model-dialog
{
position
:
absolute
;
//让弹框居中显示
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
background-color
:
#fff
;
border-radius
:
12px
;
width
:
600px
;
height
:
300px
;
border
:
1px
solid
#f5f5f5
;
overflow
:
hidden
;
z-index
:
10
;
//这里注意层级要比mask大,覆盖它
}
.model-header
{
position
:
relative
;
height
:
50px
;
padding-left
:
10px
;
padding-top
:
10px
;
font-size
:
20px
;
line-height
:
50px
;
background-color
:
#f5f5f5
;
border-bottom
:
1px
solid
rgb
(
177
,
176
,
176
);
}
.model-body
{
height
:
150px
;
line-height
:
150px
;
font-size
:
28px
;
text-align
:
center
;
background-color
:
#fff
;
}
.model-footer
{
background-color
:
#f5f5f5
;
height
:
100px
;
text-align
:
center
;
line-height
:
100px
;
}
.btn
{
width
:
180px
;
height
:
40px
;
border-radius
:
8px
;
background-color
:
rgb
(
180
,
103
,
103
);
color
:
#fff
;
font-size
:
18px
;
border
:
none
;
}
.icon-close
{
position
:
absolute
;
//如果不加绝对布局,图表显示不出来
background-color
:
pink
;
right
:
15px
;
top
:
16px
;
width
:
30px
;
height
:
30px
;
z-index
:
10
;
//
background
:
url("../assets/icon-close.png")
no-repeat
;
background-size
:
contain
;
}
//
css
部分
.mask
{
position
:
fixed
;
//这里用固定定位,后面设置动画时才不受影响
top
:
0
;
height
:
100%
;
width
:
100%
;
background-color
:
rgba
(
167
,
165
,
165
,
0.486
);
opacity
:
0.5
;
z-index
:
9
;
}
.model-dialog
{
position
:
absolute
;
//让弹框居中显示
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
background-color
:
#fff
;
border-radius
:
12px
;
width
:
600px
;
height
:
300px
;
border
:
1px
solid
#f5f5f5
;
overflow
:
hidden
;
z-index
:
10
;
//这里注意层级要比mask大,覆盖它
}
.model-header
{
position
:
relative
;
height
:
50px
;
padding-left
:
10px
;
padding-top
:
10px
;
font-size
:
20px
;
line-height
:
50px
;
background-color
:
#f5f5f5
;
border-bottom
:
1px
solid
rgb
(
177
,
176
,
176
);
}
.model-body
{
height
:
150px
;
line-height
:
150px
;
font-size
:
28px
;
text-align
:
center
;
background-color
:
#fff
;
}
.model-footer
{
background-color
:
#f5f5f5
;
height
:
100px
;
text-align
:
center
;
line-height
:
100px
;
}
.btn
{
width
:
180px
;
height
:
40px
;
border-radius
:
8px
;
background-color
:
rgb
(
180
,
103
,
103
);
color
:
#fff
;
font-size
:
18px
;
border
:
none
;
}
.icon-close
{
position
:
absolute
;
//如果不加绝对布局,图表显示不出来
background-color
:
pink
;
right
:
15px
;
top
:
16px
;
width
:
30px
;
height
:
30px
;
z-index
:
10
;
//
background
:
url("../assets/icon-close.png")
no-repeat
;
background-size
:
contain
;
}
</
style
>
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment