|
@@ -8,6 +8,7 @@ import (
|
|
|
"hongze/hongze_yb/models/response"
|
|
|
"hongze/hongze_yb/models/tables/admin"
|
|
|
"hongze/hongze_yb/models/tables/chart_permission"
|
|
|
+ "hongze/hongze_yb/models/tables/chart_permission_first"
|
|
|
"hongze/hongze_yb/models/tables/company"
|
|
|
"hongze/hongze_yb/models/tables/company_product"
|
|
|
"hongze/hongze_yb/models/tables/company_report_permission"
|
|
@@ -613,17 +614,18 @@ func GetHomeFiccPermissions(user user.UserInfo) (ret response.PermissionFiccResp
|
|
|
}
|
|
|
permissionMap := make(map[uint64]bool)
|
|
|
permissionFirstMap := make(map[string]*response.PermissionFirstItem)
|
|
|
- permissionFirstMap["宏观经济"] = &response.PermissionFirstItem{
|
|
|
- Sort: 1001,
|
|
|
- }
|
|
|
- permissionFirstMap["化工产业"] = &response.PermissionFirstItem{
|
|
|
- Sort: 1002,
|
|
|
- }
|
|
|
- permissionFirstMap["建材产业"] = &response.PermissionFirstItem{
|
|
|
- Sort: 1003,
|
|
|
+
|
|
|
+ //查询首页展示的图标
|
|
|
+ permissionFirstList, err := chart_permission_first.GetIndexShowList()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
}
|
|
|
- permissionFirstMap["有色产业"] = &response.PermissionFirstItem{
|
|
|
- Sort: 1004,
|
|
|
+ for _, v := range permissionFirstList {
|
|
|
+ permissionFirstMap[v.ClassifyName] = &response.PermissionFirstItem{
|
|
|
+ Sort: v.YbIndexSort+1000,
|
|
|
+ YbIndexName: v.YbIndexName,
|
|
|
+ YbIndexIcon: v.YbIndexIcon,
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
for k, v := range permissionList {
|
|
@@ -658,26 +660,14 @@ func GetHomeFiccPermissions(user user.UserInfo) (ret response.PermissionFiccResp
|
|
|
}
|
|
|
|
|
|
var list response.PermissionFiccList
|
|
|
- for k, v := range permissionFirstMap {
|
|
|
+ for _, v := range permissionFirstMap {
|
|
|
temp := new(response.PermissionFiccItem)
|
|
|
temp.Sort = v.Sort
|
|
|
- temp.ClassifyName = k
|
|
|
- if strings.Contains(temp.ClassifyName, "宏观") {
|
|
|
- temp.ClassifyName = "宏观经济"
|
|
|
- temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST + "ficc_icon_idx_hongguan_select.png"
|
|
|
- temp.IconUrl = utils.ALIYUN_YBIMG_HOST + "ficc_icon_idx_hongguan.png"
|
|
|
- } else if temp.ClassifyName == "化工产业" {
|
|
|
- temp.ClassifyName = "化工"
|
|
|
- temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST + "ficc_icon_idx_huagong_select.png"
|
|
|
- temp.IconUrl = utils.ALIYUN_YBIMG_HOST + "ficc_icon_idx_huagong.png"
|
|
|
- } else if temp.ClassifyName == "建材产业" {
|
|
|
- temp.ClassifyName = "建材"
|
|
|
- temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST + "ficc_icon_idx_black_select.png"
|
|
|
- temp.IconUrl = utils.ALIYUN_YBIMG_HOST + "ficc_icon_idx_black.png"
|
|
|
- } else if temp.ClassifyName == "有色产业" {
|
|
|
- temp.ClassifyName = "有色"
|
|
|
- temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST + "ficc_icon_idx_youse_select.png"
|
|
|
- temp.IconUrl = utils.ALIYUN_YBIMG_HOST + "ficc_icon_idx_youse.png"
|
|
|
+ temp.ClassifyName = v.YbIndexName
|
|
|
+ temp.IconUrl = v.YbIndexIcon
|
|
|
+ if len(temp.IconUrl) > 4 {
|
|
|
+ tmpIcon := temp.IconUrl[:len(temp.IconUrl)-4]
|
|
|
+ temp.SelectIconUrl = tmpIcon + "_select.png"
|
|
|
}
|
|
|
if len(v.List) > 0 {
|
|
|
temp.List = v.List
|