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
9bfefe59
提交
9bfefe59
authored
1月 07, 2023
作者:
wk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用名称长度处理
父级
ef2efdfe
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
113 行增加
和
5 行删除
+113
-5
common/stringUtils.js
+14
-0
pages/index/bussConfig/bussConfig.vue
+90
-4
pages/index/index.vue
+8
-1
pages/login/bindLogin/bindLogin.vue
+1
-0
没有找到文件。
common/stringUtils.js
0 → 100644
View file @
9bfefe59
const
stringUtils
=
{
stringLength
(
text
,
length
)
{
if
(
text
)
{
if
(
text
.
length
>
length
)
{
return
text
.
substr
(
0
,
length
)
+
"..."
}
else
{
return
text
}
}
return
""
}
}
export
default
stringUtils
pages/index/bussConfig/bussConfig.vue
View file @
9bfefe59
...
...
@@ -48,10 +48,12 @@
appList
:
[{}],
current
:
0
,
tabs
:
[
"生活服务"
,
"综合办公"
,
"岗位工作"
],
groups
:
[]
}
},
onLoad
()
{
//获取当前设置常用应用
this
.
getDefaultApp
()
//获取所有的应用
},
methods
:
{
...
...
@@ -59,10 +61,12 @@
this
.
current
=
e
},
getDefaultApp
()
{
Api
.
getNormalApp
({
}).
then
((
result
)
=>
{
Api
.
getNormalApp
().
then
((
result
)
=>
{
if
(
result
.
code
==
0
)
{
this
.
selList
=
result
.
data
.
list
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
sureConfig
()
{
...
...
@@ -79,7 +83,89 @@
},
toDef
()
{
this
.
getDefaultApp
()
},
getAppGroup
()
{
Api
.
getCodeList
({
data
:
{
"code_type"
:
"applicationGroup"
}
}).
then
((
result
)
=>
{
if
(
result
.
code
==
0
)
{
let
list
=
result
.
data
[
0
].
sub_data
this
.
groups
=
[]
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
this
.
groups
.
push
({
"key"
:
list
[
i
].
value
,
"val"
:
list
[
i
].
name
})
}
this
.
groups
.
push
({
"key"
:
"0"
,
"val"
:
"其他"
})
this
.
getAppList
()
}
else
{
this
.
origin_data
=
[]
if
(
result
.
code
==
10201
)
{
this
.
refreshToken
()
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
}
})
},
getAppList
:
function
()
{
let
that
=
this
Api
.
getAppList
({
data
:
this
.
requestParam
}).
then
((
result
)
=>
{
if
(
result
.
code
===
0
)
{
let
list
=
result
.
data
.
list
that
.
apps
=
that
.
sortGroup
(
list
)
console
.
log
(
that
.
apps
);
if
(
that
.
groups
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
that
.
apps
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
that
.
groups
.
length
;
j
++
)
{
if
(
that
.
groups
[
j
].
key
==
that
.
apps
[
i
].
app_group
)
{
that
.
apps
[
i
].
group_name
=
that
.
groups
[
j
].
val
}
}
}
}
}
else
{
if
(
result
.
code
===
-
1
)
{
this
.
$toast
.
showToast
(
result
.
msg
)
if
(
result
.
action
===
'Laravel_public_permission_fail'
)
{
that
.
refreshToken
()
}
}
}
})
},
sortGroup
:
function
(
arr
)
{
var
map
=
{},
dest
=
[];
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
var
app
=
arr
[
i
];
if
(
!
map
[
app
.
app_group
])
{
dest
.
push
({
app_group
:
app
.
app_group
,
data
:
[
app
]
});
map
[
app
.
app_group
]
=
app
;
}
else
{
for
(
var
j
=
0
;
j
<
dest
.
length
;
j
++
)
{
var
dj
=
dest
[
j
];
if
(
dj
.
app_group
==
app
.
app_group
)
{
dj
.
data
.
push
(
app
);
break
;
}
}
}
}
return
dest
},
}
}
</
script
>
...
...
pages/index/index.vue
View file @
9bfefe59
...
...
@@ -50,7 +50,8 @@
<uni-grid
column=
"2"
v-if=
"isOrg"
>
<uni-grid-item
v-for=
"(app,index) in appList"
:key=
"index"
>
<view
class=
"app-item"
@
click=
"toLink(app)"
>
<view
:class=
"isLineVisil(index)?'app-name-left':'app-name-right'"
>
{{
app
.
app_name
}}
</view>
<view
:class=
"isLineVisil(index)?'app-name-left':'app-name-right'"
>
{{
nameLengthDeal
(
app
.
app_name
)
}}
</view>
<image
class=
"app-logo"
src=
"../../static/ic-score-logo.png"
></image>
<view
class=
"line"
v-if=
"isLineVisil(index)"
></view>
</view>
...
...
@@ -112,6 +113,7 @@
import
App
from
"../../api/mta.js"
import
qqmapsdk
from
"../../common/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js"
import
Api
from
"../../api/api.js"
import
StringUtils
from
"../../common/stringUtils.js"
export
default
{
data
()
{
return
{
...
...
@@ -157,6 +159,8 @@
uni
.
$once
(
"refreshApp"
,
res
=>
{
if
(
this
.
isCommonSel
)
{
this
.
getCommonApp
()
}
else
{
this
.
getRecentlyApp
()
}
})
},
...
...
@@ -475,6 +479,9 @@
})
}
})
},
nameLengthDeal
(
name
)
{
return
StringUtils
.
stringLength
(
name
,
5
)
}
}
}
...
...
pages/login/bindLogin/bindLogin.vue
View file @
9bfefe59
...
...
@@ -26,6 +26,7 @@
</
template
>
<
script
>
import
Api
from
"../../../api/api.js"
export
default
{
data
()
{
return
{
...
...
Write
Preview
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
Please
register
or
sign in
to comment