Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
93f05cc3
Commit
93f05cc3
authored
Dec 18, 2023
by
tyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎈
perf(企业详情左侧菜单 根据map映射动态生成,遗弃下标取值 方便后期维护):
parent
4e409f63
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
85 deletions
+88
-85
Sidebar.vue
...operate-ui/src/views/detail/party-a/component/Sidebar.vue
+28
-4
index.vue
dsk-operate-ui/src/views/detail/party-a/index.vue
+59
-80
busclue.vue
...i/src/views/detail/party-a/overview/component/busclue.vue
+1
-1
No files found.
dsk-operate-ui/src/views/detail/party-a/component/Sidebar.vue
View file @
93f05cc3
...
@@ -218,7 +218,10 @@ export default {
...
@@ -218,7 +218,10 @@ export default {
});
});
},
},
createSideBarWithServerData
(
value
)
{
createSideBarWithServerData
(
value
)
{
this
.
sideRoute
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
defaultRoute
));
this
.
sideRoute
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
defaultRoute
));
// server返回菜单统计数据
const
_sideBarData
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
const
_sideBarData
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
// {basic,behavior,business,combineMember,credit,evaluation,global,performance,personnel,qualification}
// {basic,behavior,business,combineMember,credit,evaluation,global,performance,personnel,qualification}
...
@@ -229,11 +232,13 @@ export default {
...
@@ -229,11 +232,13 @@ export default {
_tempMap
.
forEach
((
value
,
key
,
mapOrigin
)
=>
{
_tempMap
.
forEach
((
value
,
key
,
mapOrigin
)
=>
{
// 找到对应的数据源
// 找到对应的数据源
const
data
=
this
.
findDataOrigin
(
this
.
statisticObj
,
key
);
const
data
=
this
.
findDataOrigin
(
_sideBarData
,
key
);
const
sideBarOption
=
this
.
findSideBarOption
s
(
this
.
sideRoute
,
value
);
const
sideBarOption
=
this
.
findSideBarOption
(
this
.
sideRoute
,
value
);
// 禁用菜单
// 禁用菜单
if
(
data
<
1
)
{
if
(
data
<
1
)
{
if
(
sideBarOption
)
{
sideBarOption
instanceof
Array
?
sideBarOption
.
forEach
(
item
=>
this
.
$set
(
item
,
"disabled"
,
true
))
:
this
.
$set
(
sideBarOption
,
"disabled"
,
true
);
}
}
}
});
});
...
@@ -258,7 +263,26 @@ export default {
...
@@ -258,7 +263,26 @@ export default {
},
},
// 找菜单对象
// 找菜单对象
findSideBarOption
(
sideBarData
,
key
)
{
findSideBarOption
(
sideBarData
,
key
)
{
for
(
const
iterator
of
sideBarData
)
{
if
(
iterator
.
pathName
===
key
)
{
return
iterator
;
}
// map的值是数组的情况
if
(
key
instanceof
Array
)
{
const
_tempArray
=
[];
key
.
forEach
(
item
=>
{
// 找到数组中的每一个菜单对象
const
itemNode
=
this
.
findSideBarOption
(
sideBarData
,
item
);
if
(
itemNode
)
_tempArray
.
push
(
itemNode
);
});
if
(
_tempArray
.
length
==
key
.
length
)
return
_tempArray
;
}
// 有children 递归处理
if
(
iterator
?.
children
?.
length
)
{
const
_result
=
this
.
findSideBarOption
(
iterator
?.
children
,
key
);
if
(
_result
)
return
_result
;
}
}
},
},
handleOpen
(
key
,
keyPath
)
{
handleOpen
(
key
,
keyPath
)
{
...
...
dsk-operate-ui/src/views/detail/party-a/index.vue
View file @
93f05cc3
...
@@ -229,28 +229,25 @@ export default {
...
@@ -229,28 +229,25 @@ export default {
}
}
}
}
},
},
beforeRouteLeave
(
to
,
from
,
next
)
{
next
(
vm
=>
{
});
},
beforeRouteEnter
(
to
,
from
,
next
)
{
next
(
vm
=>
{
});
},
created
()
{
created
()
{
if
(
this
.
$route
.
params
.
id
)
{
// 获取companyId
this
.
init
();
let
companyId
=
this
.
$route
.
params
.
id
;
this
.
getCompanyId
(
companyId
);
}
if
(
this
.
$route
.
query
.
path
)
{
// 获取跳转对应板块
this
.
currentPath
.
pathName
=
this
.
$route
.
query
.
path
;
}
},
},
mounted
()
{
mounted
()
{
},
},
methods
:
{
methods
:
{
async
init
()
{
try
{
if
(
this
.
$route
.
params
.
id
)
{
// 获取companyId
let
companyId
=
this
.
$route
.
params
.
id
;
await
this
.
getCompanyId
(
companyId
);
}
if
(
this
.
$route
.
query
.
path
)
{
// 获取跳转对应板块
this
.
currentPath
.
pathName
=
this
.
$route
.
query
.
path
;
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
showPartPage
(
e
)
{
showPartPage
(
e
)
{
this
.
currentPath
=
e
;
this
.
currentPath
=
e
;
},
},
...
@@ -259,12 +256,11 @@ export default {
...
@@ -259,12 +256,11 @@ export default {
let
{
data
}
=
await
idRemark
({
mark
:
companyId
});
let
{
data
}
=
await
idRemark
({
mark
:
companyId
});
if
(
data
)
{
if
(
data
)
{
this
.
companyId
=
data
;
this
.
companyId
=
data
;
this
.
$nextTick
(()
=>
{
await
this
.
$nextTick
();
this
.
listenSider
();
this
.
listenSider
();
});
await
this
.
getStatistic
();
this
.
getStatistic
();
await
this
.
handleQuery
();
this
.
handleQuery
();
await
this
.
association
(
this
.
$route
.
query
.
customerId
);
this
.
association
(
this
.
$route
.
query
.
customerId
);
this
.
$refs
.
sidebar
.
financial
(
data
);
this
.
$refs
.
sidebar
.
financial
(
data
);
}
}
},
},
...
@@ -286,27 +282,21 @@ export default {
...
@@ -286,27 +282,21 @@ export default {
provinceIds
:
[
this
.
companyInfo
.
provinceId
],
provinceIds
:
[
this
.
companyInfo
.
provinceId
],
cityIds
:
[
this
.
companyInfo
.
cityId
],
cityIds
:
[
this
.
companyInfo
.
cityId
],
};
};
urbanInvestmentPage
(
data
).
then
(
res
=>
{
const
result
=
await
urbanInvestmentPage
(
data
);
if
(
res
.
code
==
200
)
{
if
(
result
.
code
==
200
)
{
if
(
res
.
data
.
totalCount
<
1
)
{
if
(
result
.
data
.
totalCount
<
1
)
{
let
arr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
$refs
.
sidebar
.
sideRoute
));
let
arr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
$refs
.
sidebar
.
sideRoute
));
arr
[
4
].
children
[
2
].
disabled
=
true
;
arr
[
4
].
children
[
2
].
disabled
=
true
;
this
.
$refs
.
sidebar
.
sideRoute
=
arr
;
this
.
$refs
.
sidebar
.
sideRoute
=
arr
;
}
}
}
}
);
}
if
(
this
.
companyInfo
&&
this
.
companyInfo
.
companyName
)
{
if
(
this
.
companyInfo
&&
this
.
companyInfo
.
companyName
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
document
.
getElementById
(
'tagTitle'
).
innerText
=
this
.
companyInfo
.
companyName
;
document
.
getElementById
(
'tagTitle'
).
innerText
=
this
.
companyInfo
.
companyName
;
// let lists = this.$store.state.tagsView.visitedViews
// lists.forEach(item=>{
// if(item.fullPath == this.$route.fullPath){
let
titlename
=
document
.
getElementById
(
'tagTitles'
);
let
titlename
=
document
.
getElementById
(
'tagTitles'
);
if
(
titlename
)
{
if
(
titlename
)
{
titlename
.
innerText
=
this
.
companyInfo
.
companyName
;
titlename
.
innerText
=
this
.
companyInfo
.
companyName
;
}
}
// }
// })
});
});
}
}
}
}
...
@@ -324,60 +314,49 @@ export default {
...
@@ -324,60 +314,49 @@ export default {
this
.
cooDetail
=
false
;
this
.
cooDetail
=
false
;
},
},
// 判断客户是否关联显示修改
// 判断客户是否关联显示修改
association
(
id
)
{
as
ync
as
sociation
(
id
)
{
if
(
id
)
{
if
(
id
)
{
customerInfo
(
id
).
then
(
res
=>
{
try
{
const
res
=
await
customerInfo
(
id
);
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
.
userId
==
this
.
$store
.
state
.
user
.
userId
)
{
if
(
res
.
data
.
userId
==
this
.
$store
.
state
.
user
.
userId
)
{
this
.
$nextTick
(()
=>
{
await
this
.
$nextTick
();
this
.
customerInfo
=
res
.
data
;
this
.
customerInfo
=
res
.
data
;
this
.
customerId
=
res
.
data
.
customerId
;
this
.
customerId
=
res
.
data
.
customerId
;
});
if
(
res
.
data
.
companyId
==
this
.
companyId
)
{
if
(
res
.
data
.
companyId
==
this
.
companyId
)
{
this
.
$nextTick
(()
=>
{
await
this
.
$nextTick
();
this
.
isCustomer
=
true
;
this
.
isCustomer
=
true
;
this
.
isCompany
=
true
;
this
.
isCompany
=
true
;
});
}
else
{
}
else
{
this
.
$nextTick
(()
=>
{
await
this
.
$nextTick
();
this
.
isCustomer
=
true
;
this
.
isCustomer
=
true
;
this
.
isCompany
=
false
;
this
.
isCompany
=
false
;
this
.
currentPath
.
pathName
=
this
.
$route
.
query
.
path
||
'business'
;
this
.
currentPath
.
pathName
=
this
.
$route
.
query
.
path
||
'business'
;
this
.
companyInfo
=
{
this
.
companyInfo
=
{
companyName
:
this
.
customerInfo
.
companyName
companyName
:
this
.
customerInfo
.
companyName
};
};
document
.
getElementById
(
'tagTitle'
).
innerText
=
this
.
customerInfo
.
companyName
;
document
.
getElementById
(
'tagTitle'
).
innerText
=
this
.
customerInfo
.
companyName
;
// let lists = this.$store.state.tagsView.visitedViews
let
titlename
=
document
.
getElementById
(
'tagTitles'
);
// lists.forEach(item=>{
if
(
titlename
)
{
// if(item.fullPath == this.$route.fullPath){
titlename
.
innerText
=
this
.
customerInfo
.
companyName
;
let
titlename
=
document
.
getElementById
(
'tagTitles'
);
}
if
(
titlename
)
{
titlename
.
innerText
=
this
.
customerInfo
.
companyName
;
}
// }
// })
});
}
}
}
else
{
}
else
{
this
.
$nextTick
(()
=>
{
await
this
.
$nextTick
();
this
.
isCustomer
=
true
;
this
.
isCustomer
=
true
;
this
.
isCompany
=
true
;
this
.
isCompany
=
true
;
this
.
currentPath
.
pathName
=
'overview'
;
this
.
currentPath
.
pathName
=
'overview'
;
});
}
}
}
}
}).
catch
(
err
=>
{
}
catch
(
err
)
{
this
.
$nextTick
(()
=>
{
await
this
.
$nextTick
();
this
.
currentPath
.
pathName
=
'overview'
;
this
.
currentPath
.
pathName
=
'overview'
;
this
.
isCompany
=
true
;
});
});
}
else
{
this
.
$nextTick
(()
=>
{
this
.
isCompany
=
true
;
this
.
isCompany
=
true
;
// this.currentPath.pathName = 'overview';
}
this
.
currentPath
.
pathName
=
this
.
$routes
.
query
.
path
;
}
else
{
});
await
this
.
$nextTick
();
this
.
isCompany
=
true
;
this
.
currentPath
.
pathName
=
'overview'
;
}
}
},
},
...
...
dsk-operate-ui/src/views/detail/party-a/overview/component/busclue.vue
View file @
93f05cc3
...
@@ -72,7 +72,7 @@ export default {
...
@@ -72,7 +72,7 @@ export default {
let
res
=
await
projectTenderDataGroup
({
cid
:
this
.
companyId
,
type
:
this
.
activeIndex
});
let
res
=
await
projectTenderDataGroup
({
cid
:
this
.
companyId
,
type
:
this
.
activeIndex
});
if
(
res
.
code
==
200
&&
res
.
data
)
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
this
.
isSkeleton
=
false
;
this
.
isSkeleton
=
false
;
let
data
=
res
.
data
,
totalVal
=
data
.
map
(
item
=>
item
.
value
).
reduce
((
prev
,
cur
)
=>
prev
+
cur
);
let
data
=
res
.
data
,
totalVal
=
data
.
map
(
item
=>
item
.
value
).
reduce
((
prev
,
cur
)
=>
{
prev
+
cur
},
0
);
this
.
viewData
=
data
.
map
(
item
=>
{
this
.
viewData
=
data
.
map
(
item
=>
{
let
it
=
{
name
:
item
.
name
,
value
:
item
.
value
,
percent
:
parseFloat
(
Number
(
Number
(
item
.
value
)
/
Number
(
totalVal
)
*
100
).
toFixed
(
2
))
};
let
it
=
{
name
:
item
.
name
,
value
:
item
.
value
,
percent
:
parseFloat
(
Number
(
Number
(
item
.
value
)
/
Number
(
totalVal
)
*
100
).
toFixed
(
2
))
};
return
it
;
return
it
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment