fix:简化ns-step组件 设备告警样式 设备告警 能源告警 添加字段

This commit is contained in:
zhaohy
2024-07-19 11:37:14 +08:00
parent a6f77afe70
commit f636f426b0
12 changed files with 596 additions and 453 deletions

View File

@@ -10,15 +10,7 @@
@close="handleClose">
<div style="width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden">
<!-- top -->
<div
style="
width: 100%;
height: 35px;
display: flex;
position: relative;
font-size: 16px;
border-bottom: 1px solid #2778ff; /* 设置底部边框为1像素实线并指定颜色 */
">
<div class="box">
<div class="card"></div>
<div style="left: 25px; position: absolute; height: 35px; line-height: 35px">
告警编号20230310001
@@ -201,7 +193,7 @@
itemStyle: {
normal: {
barBorderRadius: 0,
color: '#6395F9',
color: '#2778FF',
},
},
symbol: 'circle', // 数据点的形状,这里设置为圆形
@@ -227,13 +219,21 @@
});
</script>
<style scoped lang="less">
.box {
width: 100%;
height: 35px;
display: flex;
position: relative;
font-size: @font-size-base;
border-bottom: 1px solid @primary-color;
}
.card {
position: absolute;
left: 0px;
top: 0px;
width: 5px;
height: 35px;
background-color: #2778ff;
background-color: @primary-color;
}
:deep(.ant-descriptions-item-label) {
width: 25%;

View File

@@ -19,12 +19,19 @@
placeholder="请选择设备点位"
style="width: 85%"
:options="statusOptions"
:disabled="showEdit"
:filter-option="filterDevicePoint" />
<ns-icon
size="20"
@click="() => (showEdit = !showEdit)"
style="margin-left: 20px"
:name="showEdit ? 'bianji' : 'baocun'" />
</a-form-item>
<a-form-item label="备注" name="desc">
<a-textarea
v-model:value="infoObject.desc"
placeholder="请输入异常描述"
:disabled="showEdit"
style="width: 85%"
:autoSize="{ minRows: 4, maxRows: 4 }" />
</a-form-item>
@@ -53,6 +60,7 @@
setup() {
const visible = ref(false);
const showEdit = ref(true);
const infoObject = ref({});
const statusOptions = ref([
{ value: '0', label: '待处理' },
@@ -62,11 +70,11 @@
{ value: '4', label: '已关闭' },
]);
const logList = ref([
{ name: '李四', status: '2' },
{ name: '王五', status: '4' },
{ name: '王五', status: '3' },
{ name: '王五', status: '1' },
{ name: '赵六', status: '0' },
{ name: '李四', status: '2', time: '2024-03-10 10:00:00', desc: '完成' },
{ name: '王五', status: '4', time: '2024-03-10 10:00:00' },
{ name: '王五', status: '3', time: '2024-03-10 10:00:00' },
{ name: '王五', status: '1', time: '2024-03-10 10:00:00', desc: '创建工单' },
{ name: '赵六', status: '0', time: '2024-03-10 10:00:00' },
]);
const config = ref({
size: logList.value.length,
@@ -79,9 +87,26 @@
console.log('btnClick');
};
const toggle = (data) => {
console.log(data, 'data');
infoObject.value = logList.value[0];
console.log(infoObject.value, 'infoObject.value');
infoObject.value = { ...logList.value[0] };
let statusMap = {
0: '待处理',
1: '处理中',
2: '已完成',
3: '超时',
4: '已关闭',
};
let colorMap = {
0: '#ff7602',
1: '#00a1e6',
2: '#04d919',
3: '#d9001b',
4: '#a6a6a6',
};
logList.value.forEach((item) => {
item.statusName = statusMap[item.status];
item.color = colorMap[item.status];
item.src = 'status-' + item.status;
});
visible.value = true;
};
const createOrder = () => {
@@ -112,6 +137,7 @@
};
return {
infoObject,
showEdit,
statusOptions,
btnClick,
createOrder,