大屏项目初始化
This commit is contained in:
@@ -22,6 +22,17 @@ export function getItemInfoList(params) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指标信息列表
|
||||
*/
|
||||
export function getIndexInfoList(params) {
|
||||
return request({
|
||||
url: '/biz/indexInfo/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账号信息列表
|
||||
*/
|
||||
@@ -53,4 +64,4 @@ export function getErpTransactionFlowList(params) {
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
<div class="icon-box">
|
||||
<img
|
||||
:src="item.iconImg"
|
||||
alt="icon"
|
||||
class="icon-img"
|
||||
:style="{ filter: item.iconFilter }"
|
||||
>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
<div class="desc-text">{{ item.desc }}</div>
|
||||
<div class="desc-text">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-right">
|
||||
@@ -25,49 +24,21 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { getIndexInfoList } from '@/api/bizApi'
|
||||
const cardList = ref()
|
||||
|
||||
const cardList = ref([
|
||||
{
|
||||
module: '生产管理',
|
||||
desc: '业务运行指标',
|
||||
value: 12,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/logo/production.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
},
|
||||
{
|
||||
module: '基建管理',
|
||||
desc: '工程建设指标',
|
||||
value: 7,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/icons/construction.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
},
|
||||
{
|
||||
module: '项目管理',
|
||||
desc: '项目管控指标',
|
||||
value: 8,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/icons/project.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
},
|
||||
{
|
||||
module: '物资管理',
|
||||
desc: '物资调配指标',
|
||||
value: 8,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/icons/material.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
},
|
||||
{
|
||||
module: '综合管理',
|
||||
desc: '综合管控指标',
|
||||
value: 15,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/icons/comprehensive.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: "werpIndex"
|
||||
}
|
||||
const res = await getIndexInfoList(reqParams)
|
||||
cardList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error)
|
||||
cardList.value = []
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
const resizeHandler = () => {
|
||||
const container = document.querySelector('.chart-top-container')
|
||||
@@ -78,8 +49,7 @@ const resizeHandler = () => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
resizeHandler()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
getList()
|
||||
})
|
||||
|
||||
watch(
|
||||
@@ -112,7 +82,7 @@ watch(
|
||||
background: rgba(15, 52, 96, 0.95);
|
||||
border: 1px solid #1a508b;
|
||||
border-radius: 8px;
|
||||
padding: 0 8px; /* 从0 12px缩减为0 8px */
|
||||
padding: 0 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -131,7 +101,7 @@ watch(
|
||||
.card-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px; /* 从10px缩减为6px */
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.icon-box {
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
<div class="icon-box">
|
||||
<img
|
||||
:src="item.iconImg"
|
||||
alt="icon"
|
||||
class="icon-img"
|
||||
:style="{ filter: item.iconFilter }"
|
||||
>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
<div class="desc-text">{{ item.desc }}</div>
|
||||
<div class="desc-text">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-right">
|
||||
@@ -25,49 +24,21 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { getIndexInfoList } from '@/api/bizApi'
|
||||
const cardList = ref()
|
||||
|
||||
const cardList = ref([
|
||||
{
|
||||
module: '生产管理',
|
||||
desc: '业务运行指标',
|
||||
value: 12,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/logo/production.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
},
|
||||
{
|
||||
module: '基建管理',
|
||||
desc: '工程建设指标',
|
||||
value: 7,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/icons/construction.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
},
|
||||
{
|
||||
module: '项目管理',
|
||||
desc: '项目管控指标',
|
||||
value: 8,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/icons/project.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
},
|
||||
{
|
||||
module: '物资管理',
|
||||
desc: '物资调配指标',
|
||||
value: 8,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/icons/material.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
},
|
||||
{
|
||||
module: '综合管理',
|
||||
desc: '综合管控指标',
|
||||
value: 15,
|
||||
label: '指标项',
|
||||
iconImg: '/assets/icons/comprehensive.png',
|
||||
iconFilter: 'brightness(0.95) contrast(1.1)'
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: "workIndex"
|
||||
}
|
||||
const res = await getIndexInfoList(reqParams)
|
||||
cardList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error)
|
||||
cardList.value = []
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
const resizeHandler = () => {
|
||||
const container = document.querySelector('.chart-top-container')
|
||||
@@ -78,8 +49,7 @@ const resizeHandler = () => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
resizeHandler()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
getList()
|
||||
})
|
||||
|
||||
watch(
|
||||
@@ -112,7 +82,7 @@ watch(
|
||||
background: rgba(15, 52, 96, 0.95);
|
||||
border: 1px solid #1a508b;
|
||||
border-radius: 8px;
|
||||
padding: 0 8px; /* 从0 12px缩减为0 8px */
|
||||
padding: 0 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -131,7 +101,7 @@ watch(
|
||||
.card-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px; /* 从10px缩减为6px */
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.icon-box {
|
||||
|
||||
Reference in New Issue
Block a user