Commit d74ffebc by Lin

feat: 预警信息字段对齐

1 parent fe3088b6
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<div class="card-body"> <div class="card-body">
<div class="row-item"> <div class="row-item">
<span class="label">主营品牌:</span> <span class="label">主营品牌:</span>
<el-tooltip effect="dark" placement="top" popper-class="dark-tooltip" :disabled="!cardData.brand"> <el-tooltip effect="dark" placement="top" popper-class="dark-tooltip" :disabled="!cardData.mainBrands">
<div slot="content" style="max-width:236px;line-height:1.6;word-break:break-all;">{{ cardData.brand }}</div> <div slot="content" style="max-width:236px;line-height:1.6;word-break:break-all;">{{ cardData.mainBrands }}</div>
<span class="val">{{ cardData.brand }}</span> <span class="val">{{ cardData.mainBrands }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="row-item"> <div class="row-item">
...@@ -25,27 +25,23 @@ ...@@ -25,27 +25,23 @@
</div> </div>
<div class="row-item"> <div class="row-item">
<span class="label">区域运营:</span> <span class="label">区域运营:</span>
<el-tooltip v-if="cardData.regionOps" effect="dark" placement="top" popper-class="dark-tooltip"> <el-tooltip v-if="cardData.regionalOperators" effect="dark" placement="top" popper-class="dark-tooltip">
<div slot="content" style="max-width:236px;line-height:1.6;">{{ cardData.regionOps }}</div> <div slot="content" style="max-width:236px;line-height:1.6;">{{ cardData.regionalOperators }}</div>
<span class="val">{{ cardData.regionOps }}</span> <span class="val">{{ cardData.regionalOperators }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<!-- 预警标签组 --> <!-- 预警标签组 -->
<div v-if="cardData.alertCount" class="alert-group"> <div v-if="cardData.warningSummary && cardData.warningSummary.length > 0" class="alert-group">
<div v-if="cardData.bottomAlert" class="alert-tag red"> <div v-for="(item, index) in cardData.warningSummary" :key="index" :class="['alert-tag', index === 0 ? 'red' : 'orange']">
<img src="@/assets/strategy/icon-strategy-type01.png" alt="" class="icon-img"> <img :src="getAlertIcon(index)" alt="" class="icon-img">
<span>兜底指标:{{ cardData.bottomAlert }}</span> <span>{{ getAlertLabel(index) }}{{ item }}</span>
</div>
<div v-if="cardData.ecoAlert" class="alert-tag orange">
<img src="@/assets/strategy/icon-strategy-type02.png" alt="" class="icon-img">
<span>生态预警:{{ cardData.ecoAlert }}</span>
</div> </div>
</div> </div>
</div> </div>
<div class="card-foot"> <div class="card-foot">
<span class="info">共{{ cardData.alertCount }}项预警</span> <span class="info">共{{ cardData.warningTotalCount }}项预警</span>
<span class="link" @click="handleViewDetail">查看详情 <img src="@/assets/strategy/icon-strategy-arrow-r.png" alt="" srcset="" class="icon-arrow"></span> <span class="link" @click="handleViewDetail">查看详情 <img src="@/assets/strategy/icon-strategy-arrow-r.png" alt="" srcset="" class="icon-arrow"></span>
</div> </div>
</div> </div>
...@@ -82,6 +78,16 @@ export default { ...@@ -82,6 +78,16 @@ export default {
} }
}); });
} }
},
// 获取预警图标
getAlertIcon(index) {
return index === 0
? require('@/assets/strategy/icon-strategy-type01.png')
: require('@/assets/strategy/icon-strategy-type02.png');
},
// 获取预警标签文本
getAlertLabel(index) {
return index === 0 ? '兜底指标:' : '生态预警:';
} }
} }
}; };
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<!-- 3. 卡片内容区 --> <!-- 3. 卡片内容区 -->
<div class="content-area"> <div class="content-area">
<el-row :gutter="16" v-if="cardList.length > 0"> <el-row :gutter="16" v-if="cardList.length > 0">
<el-col :span="8" v-for="(item, index) in cardListWithAlertCount" :key="index" class="col-item"> <el-col :span="8" v-for="(item, index) in cardList" :key="index" class="col-item">
<monitor-card <monitor-card
:card-data="item" :card-data="item"
:index="index" :index="index"
...@@ -170,13 +170,6 @@ export default { ...@@ -170,13 +170,6 @@ export default {
}; };
}, },
computed: { computed: {
// 计算预警数量
cardListWithAlertCount() {
return this.cardList.map(item => ({
...item,
alertCount: [item.trafficAlert, item.bottomAlert, item.ecoAlert].filter(Boolean).length
}));
},
// 判断是否全部选中 // 判断是否全部选中
isAllSelected() { isAllSelected() {
if (this.cardList.length === 0) return false; if (this.cardList.length === 0) return false;
...@@ -249,83 +242,97 @@ export default { ...@@ -249,83 +242,97 @@ export default {
{ {
merchantNo:'1234567890', merchantNo:'1234567890',
storeName: '银川市金凤区众豪汽车销售服务有限公司银川市金凤区众豪汽车销售服务有限公司', storeName: '银川市金凤区众豪汽车销售服务有限公司银川市金凤区众豪汽车销售服务有限公司',
brand: '鸿蒙智行/阿维塔', mainBrands: '鸿蒙智行/阿维塔',
onlineOps: '谢万新/叶雪', onlineOperators: '谢万新/叶雪',
regionOps: '叶雪', regionalOperators: '叶雪',
bottomAlert: '周环比下降超过20%', bottomAlert: '周环比下降超过20%',
fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康', fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康',
ecoAlert: '整车延保渗透率低于兜底目标80%', ecoAlert: '整车延保渗透率低于兜底目标80%',
warningSummary:['周环比下降超过20%','整车延保渗透率低于兜底目标80%'],
warningTotalCount: 2,
checked: false checked: false
}, },
{ {
merchantNo:'1234557890', merchantNo:'1234557890',
storeName: '银川市金凤区众豪汽车销售服务有限公司银川市金凤区众豪汽车销售服务有限公司', storeName: '银川市金凤区众豪汽车销售服务有限公司银川市金凤区众豪汽车销售服务有限公司',
brand: '鸿蒙智行/阿维塔', mainBrands: '鸿蒙智行/阿维塔',
onlineOps: '谢万新/叶雪', onlineOperators: '谢万新/叶雪',
regionOps: '叶雪', regionalOperators: '叶雪',
fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康', fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康',
bottomAlert: '周环比下降超过20%', bottomAlert: '周环比下降超过20%',
warningSummary:['周环比下降超过20%','整车延保渗透率低于兜底目标80%'],
ecoAlert: '整车延保生态系数低于1.0', ecoAlert: '整车延保生态系数低于1.0',
warningTotalCount: 2,
checked: true checked: true
}, },
{ {
merchantNo:'123447890', merchantNo:'123447890',
storeName: '银川市金凤区众豪汽车销售服务有限公司...', storeName: '银川市金凤区众豪汽车销售服务有限公司...',
brand: '鸿蒙智行/阿维塔', mainBrands: '鸿蒙智行/阿维塔',
isLong: true, isLong: true,
onlineOps: '马小铭/刘德康/谢万新/叶雪...', onlineOperators: '马小铭/刘德康/谢万新/叶雪...',
fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康', fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康',
regionOps: '叶雪', regionalOperators: '叶雪',
warningSummary:['周环比下降超过20%','整车延保渗透率低于兜底目标80%'],
bottomAlert: '周环比下降超过20%', bottomAlert: '周环比下降超过20%',
ecoAlert: '整车延保生态系数低于1.0', ecoAlert: '整车延保生态系数低于1.0',
warningTotalCount: 2,
checked: false checked: false
}, },
{ {
merchantNo:'1234567894', merchantNo:'1234567894',
storeName: '银川市金凤区众豪汽车销售服务有限公司...', storeName: '银川市金凤区众豪汽车销售服务有限公司...',
brand: '鸿蒙智行/阿维塔', mainBrands: '鸿蒙智行/阿维塔',
isLong: true, isLong: true,
onlineOps: '马小铭/刘德康/谢万新/叶雪...', onlineOperators: '马小铭/刘德康/谢万新/叶雪...',
fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康', fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康',
regionOps: '叶雪', regionalOperators: '叶雪',
bottomAlert: '周环比下降超过20%', bottomAlert: '周环比下降超过20%',
warningSummary:['周环比下降超过20%','整车延保渗透率低于兜底目标80%'],
ecoAlert: '整车延保生态系数低于1.0', ecoAlert: '整车延保生态系数低于1.0',
warningTotalCount: 2,
checked: false checked: false
}, },
{ {
merchantNo:'1234567895', merchantNo:'1234567895',
storeName: '银川市金凤区众豪汽车销售服务有限公司...', storeName: '银川市金凤区众豪汽车销售服务有限公司...',
brand: '鸿蒙智行/阿维塔', mainBrands: '鸿蒙智行/阿维塔',
isLong: true, isLong: true,
onlineOps: '马小铭/刘德康/谢万新/叶雪...', onlineOperators: '马小铭/刘德康/谢万新/叶雪...',
fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康', fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康',
regionOps: '叶雪', regionalOperators: '叶雪',
warningSummary:['周环比下降超过20%','整车延保渗透率低于兜底目标80%'],
bottomAlert: '周环比下降超过20%', bottomAlert: '周环比下降超过20%',
ecoAlert: '整车延保生态系数低于1.0', ecoAlert: '整车延保生态系数低于1.0',
warningTotalCount: 2,
checked: false checked: false
}, },
{ {
merchantNo:'1234567896', merchantNo:'1234567896',
storeName: '银川市金凤区众豪汽车销售服务有限公司...', storeName: '银川市金凤区众豪汽车销售服务有限公司...',
brand: '鸿蒙智行/阿维塔', mainBrands: '鸿蒙智行/阿维塔',
isLong: true, isLong: true,
onlineOps: '马小铭/刘德康/谢万新/叶雪...', onlineOperators: '马小铭/刘德康/谢万新/叶雪...',
fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康', fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康',
regionOps: '叶雪', regionalOperators: '叶雪',
bottomAlert: '周环比下降超过20%', bottomAlert: '周环比下降超过20%',
warningSummary:['周环比下降超过20%','整车延保渗透率低于兜底目标80%'],
ecoAlert: '整车延保生态系数低于1.0', ecoAlert: '整车延保生态系数低于1.0',
warningTotalCount: 2,
checked: false checked: false
}, },
{ {
merchantNo:'1234567897', merchantNo:'1234567897',
storeName: '银川市金凤区众豪汽车销售服务有限公司...', storeName: '银川市金凤区众豪汽车销售服务有限公司...',
brand: '鸿蒙智行/阿维塔', mainBrands: '鸿蒙智行/阿维塔',
isLong: true, isLong: true,
onlineOps: '马小铭/刘德康/谢万新/叶雪...', onlineOperators: '马小铭/刘德康/谢万新/叶雪...',
fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康', fullOnlineOps: '马小铭/刘德康/谢万新/叶雪/马小铭/刘德康',
regionOps: '叶雪', regionalOperators: '叶雪',
bottomAlert: '周环比下降超过20%', bottomAlert: '周环比下降超过20%',
warningSummary:['周环比下降超过20%','整车延保渗透率低于兜底目标80%'],
ecoAlert: '整车延保生态系数低于1.0', ecoAlert: '整车延保生态系数低于1.0',
warningTotalCount: 12,
checked: false checked: false
}]; }];
// getMonitorList(params).then((res) => { // getMonitorList(params).then((res) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!