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
52f17473
authored
2022-11-28 10:57:02 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:工作台
1 parent
4e6b0ef1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
19 deletions
src/utils/request.js
src/views/home/components/addProject.vue
src/views/home/index.vue
src/utils/request.js
View file @
52f1747
...
...
@@ -39,13 +39,13 @@ service.interceptors.response.use(
* 如果请求不成功,就在拦截器这里统一处理(组件的代码就不用关注错误的情况了)
*/
if
(
response
.
status
==
200
)
{
if
(
response
.
data
.
code
==
500
)
{
Message
({
message
:
response
.
data
.
message
,
type
:
'error'
,
duration
:
5
*
1000
})
}
//
if (response.data.code == 500) {
//
Message({
//
message: response.data.message,
//
type: 'error',
//
duration: 5 * 1000
//
})
//
}
return
response
.
data
;
}
else
{
handleErrorData
(
response
.
data
);
...
...
src/views/home/components/addProject.vue
View file @
52f1747
<
template
>
<dialogBox
title=
"配置常办项目"
@
submitForm=
"submitForm"
saveButton=
"保存"
:isFullscreen=
"false"
width=
"50%"
@
closeDialog=
"closeDialog"
v-model=
"value"
>
<el-form
ref=
"ruleForm"
:model=
"ruleForm"
label-width=
"100px"
>
<el-tree
:data=
"projectList"
show-checkbox
node-key=
"id"
ref=
"tree"
default-expand-all
:props=
"defaultProps"
@
check-change=
"handleClick"
></el-tree>
</el-form>
@
closeDialog=
"closeDialog"
v-model=
"myValue"
>
<el-tree
:data=
"projectList"
show-checkbox
node-key=
"id"
:default-checked-keys=
"defaultCheckeds"
ref=
"tree"
default-expand-all
:props=
"defaultProps"
@
check-change=
"handleClick"
></el-tree>
</dialogBox>
</
template
>
<
script
>
import
{
getMenuInfo
}
from
"@/api/user.js"
;
import
{
saveFrequentProjectsList
}
from
"@/api/home.js"
;
import
{
saveFrequentProjectsList
,
getHomeFrequentProjects
}
from
"@/api/home.js"
;
export
default
{
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
},
...
...
@@ -17,10 +15,9 @@ export default {
},
data
()
{
return
{
myValue
:
false
,
defaultCheckeds
:
[],
projectList
:
[],
ruleForm
:
{
},
checkedItem
:
[],
defaultProps
:
{
children
:
"children"
,
...
...
@@ -36,8 +33,15 @@ export default {
uniqueValue
:
''
//最后拿到的唯一选择的moduldCode值,相当于id
}
},
watch
:
{
value
(
val
)
{
this
.
myValue
=
val
if
(
val
)
{
this
.
queryClick
()
}
}
},
mounted
()
{
this
.
queryClick
()
this
.
dealCheckedItem
();
},
methods
:
{
...
...
@@ -58,9 +62,19 @@ export default {
})
},
queryClick
()
{
let
that
=
this
getMenuInfo
().
then
(
res
=>
{
this
.
projectList
=
res
.
result
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
)
}
return
arr
}
that
.
defaultCheckeds
=
lookForAllId
()
console
.
log
(
that
.
defaultCheckeds
);
},
dealCheckedItem
()
{
},
...
...
src/views/home/index.vue
View file @
52f1747
...
...
@@ -9,7 +9,7 @@
<el-button
type=
"primary"
@
click=
"setFrequencyProject()"
>
配置常办
</el-button>
</div>
<ul
class=
"workbench flexst"
>
<li
v-for=
"(item, index) in projectList"
class=
"pointer"
:key=
"index"
<li
v-for=
"(item, index) in projectList"
@
click=
"handleProject(item)"
class=
"pointer"
:key=
"index"
:style=
"
{ backgroundColor: newsListColor[index] }">
<i
class=
"el-icon-s-claim"
></i>
{{
item
.
name
}}
...
...
@@ -188,6 +188,10 @@ export default {
this
.
queryProjectList
();
//获取常办项目列表
},
methods
:
{
handleProject
(
item
)
{
let
url
=
item
.
uri
.
split
(
'/'
).
slice
(
0
,
3
).
join
(
'/'
)
this
.
$router
.
push
(
url
)
},
handleView
(
pdfUrl
)
{
const
href
=
pdfUrl
window
.
open
(
href
,
'_blank'
);
...
...
Please
register
or
sign in
to post a comment