字典缓存

This commit is contained in:
仲么了
2023-12-28 11:27:03 +08:00
parent afeadbe26a
commit c1b08dabd4
7 changed files with 102 additions and 20 deletions

View File

@@ -20,7 +20,7 @@
</template>
<script setup lang="ts">
import { Plus } from '@element-plus/icons-vue'
import { ref, onMounted, provide } from 'vue'
import { ref, onMounted, provide, h } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
@@ -34,13 +34,49 @@ const tableStore = new TableStore({
method: 'POST',
column: [
{ title: '序号', type: 'seq', align: 'center', width: 60 },
{ title: '区域', field: 'userName', align: 'center', width: 120 },
{ title: '供电公司', field: 'operate', align: 'center', width: 220 },
{ title: '变电站', field: 'describe', align: 'center', showOverflow: true, minWidth: 200 },
{ title: '终端编号', field: 'type', align: 'center', width: 160 },
{ title: '投运时间', field: 'type', align: 'center', width: 100 },
{ title: '厂家', field: 'ip', align: 'center', width: 160 },
{ title: '', field: 'level', align: 'center', width: 100 }
{ title: '区域', field: 'areaName', align: 'center', width: 120 },
{ title: '供电公司', field: 'gdName', align: 'center', width: 120 },
{ title: '变电站', field: 'bdName', align: 'center', showOverflow: true, minWidth: 100 },
{ title: '终端编号', field: 'devName', align: 'center', width: 160 },
{ title: '投运时间', field: 'loginTime', align: 'center', width: 200 },
{ title: '厂家', field: 'manufacturer', align: 'center', width: 160 },
{ title: '型号', field: 'devType', align: 'center', width: 200 },
{ title: '网络参数', field: 'ip', align: 'center', width: 200 },
{ title: '端口', field: 'port', align: 'center', width: 100 },
{ title: '终端状态', field: 'runFlag', align: 'center', width: 100 },
{ title: '通讯状态', field: 'comFlag', align: 'center', width: 100 },
{ title: '最新数据', field: 'updateTime', align: 'center', width: 200 },
{
title: '评价',
field: 'onlineEvaluate',
align: 'center',
width: 100,
render: 'customTemplate',
customTemplate: row => {
return h(
'el-tag',
{
effect: 'dark',
type:
row.onlineEvaluate * 100 > 90
? 'success'
: row.onlineEvaluate * 100 > 60
? 'warning'
: 'danger'
},
row.onlineEvaluate * 100 + '%'
)
// if (row.onlineEvaluate == null) {
// return '-'
// } else if (row.onlineEvaluate * 100 > 90) {
// return `<el-tag effect="dark" type="success"> 优 </el-tag> `
// } else if (row.onlineEvaluate * 100 > 60) {
// return `<el-tag effect="dark" type="warning"> 良 </el-tag> `
// } else {
// return `<el-tag effect="dark" type="danger"> 差 </el-tag> `
// }
}
}
]
})
tableStore.table.params.deptIndex = '5699e5916a18a6381e1ac92da5bd2628'