|
@@ -1,104 +1,92 @@
|
|
|
<template>
|
|
|
<div class="table_item">
|
|
|
<s-table ref="tableRef" :columns="columns" :data="loadData" :row-key="(record) => record.code">
|
|
|
- <template #operator> </template>
|
|
|
+ <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 #headerCell="{ title, column }">
|
|
|
+ <template v-if="column.dataIndex === 'type'">
|
|
|
+ <text>{{ title }}</text>
|
|
|
+ <a-select ref="select" v-model:value="value1" style="width: 250px; margin-left: 10px">
|
|
|
+ <a-select-option value="1">二氧化碳浓度</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </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>
|
|
|
+ <unitSearch ref="unitSearchRef" />
|
|
|
</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>
|
|
|
+ <monitorSearch ref="monitorSearchRef" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import tool from '@/utils/tool'
|
|
|
import jobApi from '@/api/dev/jobApi'
|
|
|
+ import unitSearch from './unitSearch.vue'
|
|
|
+ import monitorSearch from './monitorSearch.vue'
|
|
|
|
|
|
- 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 unitSearchRef = ref(null)
|
|
|
+ const monitorSearchRef = ref(null)
|
|
|
+
|
|
|
+ const value1 = ref('1') //选择器
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ unitSearchRef.value.onOpen() //获取单位数据
|
|
|
+ monitorSearchRef.value.onOpen() //获取监控点数据
|
|
|
+ })
|
|
|
|
|
|
+ // 搜索表单
|
|
|
const searchFormState = ref({
|
|
|
type: 'qst',
|
|
|
isshow: '1'
|
|
|
})
|
|
|
const tableRef = ref()
|
|
|
+
|
|
|
const columns = [
|
|
|
{
|
|
|
- title: '',
|
|
|
- dataIndex: 'aaa',
|
|
|
- align: 'center',
|
|
|
- ellipsis: true
|
|
|
+ title: '采集类型',
|
|
|
+ dataIndex: 'type'
|
|
|
}
|
|
|
]
|
|
|
|
|
@@ -115,11 +103,6 @@
|
|
|
return obj
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- // 点击树查询
|
|
|
- const treeSelect = (selectedKeys) => {
|
|
|
- console.log(selectedKeys, 'x')
|
|
|
- }
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
@@ -128,18 +111,31 @@
|
|
|
display: flex;
|
|
|
padding: 15px 20px;
|
|
|
|
|
|
- .table-head {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
-
|
|
|
- .head-left {
|
|
|
+ .table-wrapper {
|
|
|
+ width: 75%;
|
|
|
+ // 搜索及操作按钮区域
|
|
|
+ .table-head {
|
|
|
+ width: 100%;
|
|
|
display: flex;
|
|
|
- }
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
|
|
|
- .ant-btn {
|
|
|
- margin-left: 10px;
|
|
|
+ .head-left {
|
|
|
+ width: 90%;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .ant-form-inline {
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .ant-form-item {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-btn {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -158,20 +154,19 @@
|
|
|
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;
|
|
|
+ padding: 5px 0 !important;
|
|
|
border: 1px solid #eaeaea;
|
|
|
}
|
|
|
+
|
|
|
+ // 分页居中显示
|
|
|
+ :deep(.ant-table-pagination-right) {
|
|
|
+ justify-content: center !important;
|
|
|
+ }
|
|
|
</style>
|