Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
Sign in / Register
Toggle navigation
S
site-uniapp
概览
Overview
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
王柯
site-uniapp
Commits
d0b38113
提交
d0b38113
authored
1月 09, 2023
作者:
wk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
组织切换
父级
c2a3aedb
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
162 行增加
和
3 行删除
+162
-3
pages/gallery/app/modeFormList/modeFormList.vue
+2
-1
pages/gallery/app/originalIndex/originalIndex.vue
+2
-1
pages/mine/changeOrg/changeOrg.vue
+158
-1
static/icon_drop_arrow.png
+0
-0
static/icon_up_arrow.png
+0
-0
没有找到文件。
pages/gallery/app/modeFormList/modeFormList.vue
View file @
d0b38113
...
@@ -779,7 +779,8 @@
...
@@ -779,7 +779,8 @@
this
.
$http
.
get
({
this
.
$http
.
get
({
url
:
"/api/v1/project/project_list"
,
url
:
"/api/v1/project/project_list"
,
data
:
{
data
:
{
is_all
:
1
is_all
:
1
,
org_no
:
uni
.
getStorageInfoSync
(
"org_no"
)
},
},
header
:
{
header
:
{
"access_token"
:
this
.
getToken
()
"access_token"
:
this
.
getToken
()
...
...
pages/gallery/app/originalIndex/originalIndex.vue
View file @
d0b38113
...
@@ -62,7 +62,8 @@
...
@@ -62,7 +62,8 @@
loadProject
(
access_token
)
{
loadProject
(
access_token
)
{
Api
.
getProjectList
({
Api
.
getProjectList
({
data
:
{
data
:
{
is_all
:
1
is_all
:
1
,
org_no
:
uni
.
getStorageInfoSync
(
"org_no"
)
}
}
}).
then
((
result
)
=>
{
}).
then
((
result
)
=>
{
console
.
log
(
"项目列表:"
,
result
);
console
.
log
(
"项目列表:"
,
result
);
...
...
pages/mine/changeOrg/changeOrg.vue
View file @
d0b38113
<
template
>
<
template
>
<view
class=
"content"
>
<view
class=
"content"
>
<titleBar
title=
"切换组织"
></titleBar>
<titleBar
title=
"切换组织"
></titleBar>
<view
class=
"org-content"
>
<view
class=
"org-list"
>
<view
class=
"org-item"
v-for=
"(tree,index) in trees"
:key=
"index"
>
<view
class=
"org"
>
<image
:src=
"tree.isOpen?'../../../static/icon_up_arrow.png':'../../../static/icon_drop_arrow.png'"
class=
"image"
@
click=
"toNextLevel(tree,index)"
>
</image>
<view
class=
"name"
@
click=
"toNextLevel(tree,index)"
>
{{
tree
.
name
}}
</view>
<view
class=
" enter"
@
click=
"itemClick(tree)"
>
进入
</view>
</view>
<view
v-if=
"tree.isOpen"
style=
"margin-top: 20rpx;"
>
<view
class=
"org-item"
v-for=
"(oneLevel,oneIndex) in tree.children_list"
:key=
"oneIndex"
>
<view
class=
"org"
>
<image
:src=
"oneLevel.isOpen?'../../../static/icon_up_arrow.png':'../../../static/icon_drop_arrow.png'"
class=
"image"
@
click=
"toNextChild(index,oneLevel,oneIndex)"
></image>
<view
class=
"name"
@
click=
"toNextChild(index,oneLevel,oneIndex)"
>
{{
oneLevel
.
name
}}
</view>
<view
class=
"enter"
@
click=
"itemClick(oneLevel)"
>
进入
</view>
</view>
<view
v-if=
"oneLevel.isOpen"
style=
"margin-top: 20rpx;"
>
<view
class=
"org-item"
v-for=
"(twoLevel,twoIndex) in oneLevel.children_list"
:key=
"twoIndex"
>
<view
class=
"org"
>
<view
class=
"name"
>
{{
twoLevel
.
name
}}
</view>
<view
class=
"enter"
@
click=
"itemClick(oneLevel)"
>
进入
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -9,7 +44,7 @@
...
@@ -9,7 +44,7 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
trees
:
[]
}
}
},
},
onLoad
()
{
onLoad
()
{
...
@@ -19,8 +54,89 @@
...
@@ -19,8 +54,89 @@
getOrgTree
()
{
getOrgTree
()
{
Api
.
getOrgTree
().
then
((
result
)
=>
{
Api
.
getOrgTree
().
then
((
result
)
=>
{
console
.
log
(
"组织树"
,
result
);
console
.
log
(
"组织树"
,
result
);
if
(
result
.
code
==
0
)
{
this
.
trees
=
result
.
data
}
})
})
},
toNextLevel
(
item
,
index
)
{
let
children
=
item
.
children_list
if
(
item
.
isOpen
)
{
item
.
isOpen
=
false
}
else
{
if
(
children
&&
children
.
length
>
0
)
{
item
.
isOpen
=
true
}
else
{
item
.
isOpen
=
false
}
}
this
.
$set
(
this
.
trees
,
index
,
item
)
},
toNextChild
(
index
,
item
,
oneIndex
)
{
let
children
=
item
.
children_list
if
(
item
.
isOpen
)
{
item
.
isOpen
=
false
}
else
{
if
(
children
&&
children
.
length
>
0
)
{
item
.
isOpen
=
true
}
else
{
item
.
isOpen
=
false
}
}
}
this
.
$set
(
this
.
trees
[
index
].
children_list
,
oneIndex
,
item
)
},
itemClick
:
function
(
item
)
{
let
that
=
this
uni
.
showModal
({
title
:
'提示'
,
content
:
'确定切换到该组织?'
,
showCancel
:
true
,
confirmText
:
"切换"
,
confirmColor
:
'#1890FF'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
that
.
switchCompany
(
item
)
}
}
})
},
switchCompany
:
function
(
company
)
{
this
.
$http
.
consolePut
({
url
:
"/api/v1/user/user/switch_company"
,
data
:
{
company_id
:
company
.
company_id
},
header
:
{
access_token
:
this
.
getToken
()
}
}).
then
((
res
)
=>
{
let
result
=
res
.
data
if
(
result
.
code
==
0
)
{
uni
.
setStorageSync
(
"token"
,
result
.
data
.
access_token
)
uni
.
setStorageSync
(
"refresh_token"
,
result
.
data
.
refresh_token
)
uni
.
setStorageSync
(
"company_id"
,
company
.
company_id
)
uni
.
setStorageSync
(
"org_no"
,
company
.
org_no
)
this
.
currentCompany
=
company
uni
.
setStorageSync
(
"user_info"
,
result
.
data
)
this
.
getUserInfo
()
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
getUserInfo
()
{
Api
.
getUserInfo
().
then
((
result
)
=>
{
if
(
result
.
code
==
0
)
{
getApp
().
globalData
.
userInfo
=
result
.
data
uni
.
navigateBack
({
delta
:
1
})
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
}
}
}
}
</
script
>
</
script
>
...
@@ -29,5 +145,46 @@
...
@@ -29,5 +145,46 @@
.content
{
.content
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
.org-content
{
display
:
flex
;
flex-direction
:
column
;
margin
:
30
rpx
;
}
.org-item
{
padding
:
30
rpx
0
30
rpx
30
rpx
;
display
:
flex
;
flex-direction
:
column
;
border-radius
:
30
rpx
;
background-color
:
#fff
;
}
.org
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
image
{
width
:
48
rpx
;
height
:
24
rpx
;
}
.name
{
font-size
:
28
rpx
;
color
:
#333
;
margin-left
:
20
rpx
;
flex
:
1
;
font-weight
:
500
;
}
.enter
{
font-size
:
28
rpx
;
margin-right
:
30
rpx
;
color
:
#3B73FE
;
font-weight
:
600
;
}
}
}
}
</
style
>
</
style
>
static/icon_drop_arrow.png
0 → 100644
View file @
d0b38113
326 Bytes
static/icon_up_arrow.png
0 → 100644
View file @
d0b38113
314 Bytes
Write
Preview
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
Please
register
or
sign in
to comment