|
@@ -0,0 +1,375 @@
|
|
|
+<template>
|
|
|
+ <div class="table_item">
|
|
|
+ <s-table ref="tableRef" :columns="columns" :data="loadData" :row-key="(record) => record.code">
|
|
|
+ <template #operator>
|
|
|
+ <div class="table-head">
|
|
|
+ <div class="head-left">
|
|
|
+ <a-form
|
|
|
+ ref="searchFormRef"
|
|
|
+ name="advanced_search"
|
|
|
+ layout="inline"
|
|
|
+ :model="searchFormState"
|
|
|
+ class="ant-advanced-search-form"
|
|
|
+ >
|
|
|
+ <a-form-item label="" name="searchKey">
|
|
|
+ <a-range-picker v-model:value="searchFormState.searchKey" value-format="YYYY/MM/DD" />
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item label="报警类型" name="type">
|
|
|
+ <a-select v-model:value="searchFormState.type" placeholder="请选择报警类型">
|
|
|
+ <a-select-option value="qst">趋势图</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item label="是否展示全部区间" name="isshow">
|
|
|
+ <a-select v-model:value="searchFormState.isshow" placeholder="请选择是否展示全部区间">
|
|
|
+ <a-select-option value="1">是</a-select-option>
|
|
|
+ <a-select-option value="1">否</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ <a-button type="primary" @click="tableRef.refresh(true)">查询</a-button>
|
|
|
+ <a-button class="xn-mg08" @click="reset">重置</a-button>
|
|
|
+ </div>
|
|
|
+ <div class="head-right">
|
|
|
+ <a-button>
|
|
|
+ <template #icon><setting-outlined /></template>设置
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
+ <template v-if="column.dataIndex === 'state'">
|
|
|
+ <span>
|
|
|
+ <a-tag :color="record.state == '1' ? '#2db7f5' : record.state == '2' ? '#cd201f' : '#87d068'">
|
|
|
+ {{ record.stateVlaue }}
|
|
|
+ </a-tag>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+
|
|
|
+ <div class="item-right">
|
|
|
+ <!-- 单位 -->
|
|
|
+ <div class="unit">
|
|
|
+ <a-input-search
|
|
|
+ v-model:value="searchValue"
|
|
|
+ style="margin-bottom: 8px"
|
|
|
+ placeholder="请输入单位名称"
|
|
|
+ @search="treeSelect"
|
|
|
+ />
|
|
|
+ <a-tree
|
|
|
+ v-if="treeData"
|
|
|
+ show-icon
|
|
|
+ v-model:expandedKeys="defaultExpandedKeys"
|
|
|
+ :tree-data="treeData"
|
|
|
+ :field-names="treeFieldNames"
|
|
|
+ >
|
|
|
+ <template #icon="{ parentId }">
|
|
|
+ <template v-if="parentId == '0'">
|
|
|
+ <home-outlined />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <cluster-outlined />
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </a-tree>
|
|
|
+ </div>
|
|
|
+ <!-- 监控点 -->
|
|
|
+ <div class="monitor">
|
|
|
+ <div class="monitor-search">
|
|
|
+ <a-input-search
|
|
|
+ v-model:value="searchValue"
|
|
|
+ style="margin-bottom: 8px"
|
|
|
+ placeholder="请输入对象-监控点名称"
|
|
|
+ /><a-button type="link">全选</a-button>
|
|
|
+ </div>
|
|
|
+ <a-checkbox-group v-model:value="checkboxValue" style="width: 100%">
|
|
|
+ <a-checkbox v-for="(item, index) in checkboxList" :key="index" :value="item.id" style="width: 100%">{{
|
|
|
+ item.name
|
|
|
+ }}</a-checkbox>
|
|
|
+ </a-checkbox-group>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ import tool from '@/utils/tool'
|
|
|
+ import jobApi from '@/api/dev/jobApi'
|
|
|
+
|
|
|
+ const searchValue = ref('') //单位名称搜索字段
|
|
|
+ const treeData = ref([
|
|
|
+ {
|
|
|
+ id: '1',
|
|
|
+ parentId: '0',
|
|
|
+ name: '广州海关技术中心',
|
|
|
+ children: [
|
|
|
+ { id: '1-1', parentId: '1', name: '广州海关技术中心(生物岛)' },
|
|
|
+ { id: '1-2', parentId: '1', name: '广州海关技术中心(机场路)' },
|
|
|
+ { id: '1-3', parentId: '1', name: '广州海关技术中心(花都基地)' },
|
|
|
+ { id: '1-4', parentId: '1', name: '广州海关技术中心(国家新能源汽车重点实验室科学城基地)' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '2',
|
|
|
+ parentId: '0',
|
|
|
+ name: '海南海关技术中心'
|
|
|
+ }
|
|
|
+ ]) //单位树形结构
|
|
|
+ const defaultExpandedKeys = ref([]) // 默认展开二级树的节点id
|
|
|
+ // 替换treeNode 中 title,key,children
|
|
|
+ const treeFieldNames = { children: 'children', title: 'name', key: 'id' }
|
|
|
+
|
|
|
+ const checkboxValue = ref([]) //监控点搜索字段
|
|
|
+
|
|
|
+ const checkboxList = ref([
|
|
|
+ { name: '-89度超低温冷冻储存箱-监控点1', id: '1' },
|
|
|
+ { name: '医用冰箱-监控点1', id: '2' },
|
|
|
+ { name: '超低温冰箱-监控点1', id: '3' },
|
|
|
+ { name: '-100度超低温冷冻储存箱-监控点2', id: '4' },
|
|
|
+ { name: '医用冰箱-监控点2', id: '5' },
|
|
|
+ { name: '超低温冰箱-监控点2', id: '6' }
|
|
|
+ ]) //监控点数据
|
|
|
+
|
|
|
+ const searchFormState = ref({
|
|
|
+ type: 'qst',
|
|
|
+ isshow: '1'
|
|
|
+ })
|
|
|
+ const tableRef = ref()
|
|
|
+ const columns = [
|
|
|
+ {
|
|
|
+ title: '采集时间',
|
|
|
+ dataIndex: 'time',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true,
|
|
|
+ sorter: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所属部门',
|
|
|
+ dataIndex: 'bm',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true,
|
|
|
+ sorter: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '对象名称',
|
|
|
+ dataIndex: 'dxmc',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true,
|
|
|
+ sorter: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备状态',
|
|
|
+ dataIndex: 'state',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '监控点',
|
|
|
+ dataIndex: 'jkd',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true,
|
|
|
+ sorter: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上下限',
|
|
|
+ dataIndex: 'up',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '传感器类型',
|
|
|
+ dataIndex: 'type',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '采集值1',
|
|
|
+ dataIndex: 'cjz1',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '采集值2',
|
|
|
+ dataIndex: 'cjz2',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '对象类型',
|
|
|
+ dataIndex: 'dxtype',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true,
|
|
|
+ sorter: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '冷链编号',
|
|
|
+ dataIndex: 'code',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true,
|
|
|
+ sorter: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ const loadData = (parameter) => {
|
|
|
+ return jobApi.jobPage(Object.assign(parameter, searchFormState.value)).then((res) => {
|
|
|
+ // return res
|
|
|
+ const obj = {
|
|
|
+ current: 1,
|
|
|
+ pages: 1,
|
|
|
+ records: [
|
|
|
+ {
|
|
|
+ time: '2024-08-28 07:03:24',
|
|
|
+ bm: '上海海关基数中心1',
|
|
|
+ dxmc: '-70度超低温冷冻储存箱',
|
|
|
+ state: '2',
|
|
|
+ stateVlaue: '异常',
|
|
|
+ jkd: '监控点1',
|
|
|
+ up: '-30~-10℃',
|
|
|
+ type: '温度',
|
|
|
+ cjz1: '-18.9℃',
|
|
|
+ cjz2: '/',
|
|
|
+ dxtype: '冰箱',
|
|
|
+ code: '6578945621'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ time: '2024-08-28 09:21:51',
|
|
|
+ bm: '上海海关基数中心2',
|
|
|
+ dxmc: '-71度超低温冷冻储存箱',
|
|
|
+ state: '2',
|
|
|
+ stateVlaue: '异常',
|
|
|
+ jkd: '监控点2',
|
|
|
+ up: '-30~-10℃',
|
|
|
+ type: '温度',
|
|
|
+ cjz1: '-18.9℃',
|
|
|
+ cjz2: '/',
|
|
|
+ dxtype: '冰箱',
|
|
|
+ code: '6578945622'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ time: '2024-08-28 11:06:20',
|
|
|
+ bm: '上海海关基数中心3',
|
|
|
+ dxmc: '-72度超低温冷冻储存箱',
|
|
|
+ state: '2',
|
|
|
+ stateVlaue: '异常',
|
|
|
+ jkd: '监控点3',
|
|
|
+ up: '-30~-10℃',
|
|
|
+ type: '温度',
|
|
|
+ cjz1: '-18.9℃',
|
|
|
+ cjz2: '/',
|
|
|
+ dxtype: '冰箱',
|
|
|
+ code: '6578945623'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ time: '2024-08-28 11:54:19',
|
|
|
+ bm: '上海海关基数中心4',
|
|
|
+ dxmc: '-73度超低温冷冻储存箱',
|
|
|
+ state: '2',
|
|
|
+ stateVlaue: '异常',
|
|
|
+ jkd: '监控点4',
|
|
|
+ up: '-30~-10℃',
|
|
|
+ type: '温度',
|
|
|
+ cjz1: '-18.9℃',
|
|
|
+ cjz2: '/',
|
|
|
+ dxtype: '冰箱',
|
|
|
+ code: '6578945624'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ time: '2024-08-28 16:17:36',
|
|
|
+ bm: '上海海关基数中心5',
|
|
|
+ dxmc: '-74度超低温冷冻储存箱',
|
|
|
+ state: '2',
|
|
|
+ stateVlaue: '异常',
|
|
|
+ jkd: '监控点5',
|
|
|
+ up: '-30~-10℃',
|
|
|
+ type: '温度',
|
|
|
+ cjz1: '-18.9℃',
|
|
|
+ cjz2: '/',
|
|
|
+ dxtype: '冰箱',
|
|
|
+ code: '6578945625'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ time: '2024-08-28 19:35:58',
|
|
|
+ bm: '上海海关基数中心6',
|
|
|
+ dxmc: '-75度超低温冷冻储存箱',
|
|
|
+ state: '2',
|
|
|
+ stateVlaue: '异常',
|
|
|
+ jkd: '监控点6',
|
|
|
+ up: '-30~-10℃',
|
|
|
+ type: '温度',
|
|
|
+ cjz1: '-18.9℃',
|
|
|
+ cjz2: '/',
|
|
|
+ dxtype: '冰箱',
|
|
|
+ code: '6578945626'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ size: 10,
|
|
|
+ total: 6
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 点击树查询
|
|
|
+ const treeSelect = (selectedKeys) => {
|
|
|
+ console.log(selectedKeys, 'x')
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+ .table_item {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ padding: 15px 20px;
|
|
|
+ border: 1px solid red;
|
|
|
+
|
|
|
+ .table-head {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .head-left {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-btn {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 右边的搜索区域
|
|
|
+ .item-right {
|
|
|
+ width: 25%;
|
|
|
+ padding: 5px 10px;
|
|
|
+
|
|
|
+ .unit,
|
|
|
+ .monitor {
|
|
|
+ width: 100%;
|
|
|
+ height: 350px;
|
|
|
+ padding: 10px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ border-radius: 5px;
|
|
|
+ border: 1px solid #eaeaea;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .unit-head,
|
|
|
+ .monitor-search {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ :deep(.ant-table-pagination-right) {
|
|
|
+ justify-content: center !important;
|
|
|
+ }
|
|
|
+ :deep(.ant-tree-treenode) {
|
|
|
+ width: 100%;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ border-radius: 5px;
|
|
|
+ border: 1px solid #eaeaea;
|
|
|
+ }
|
|
|
+</style>
|