Browse Source

排序修改

develop
fuguobin 1 year ago
parent
commit
ef2cd8fec3
  1. BIN
      src/assets/images/device02.jpg
  2. BIN
      src/assets/images/device03.jpg
  3. 1
      src/styles/index.scss
  4. 9
      src/views/monitoring/components/header.vue
  5. 7
      src/views/monitoring/screen/components/main.vue
  6. 18
      src/views/monitoring/screen/components/showTree.vue
  7. 4
      vite.config.ts

BIN
src/assets/images/device02.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 713 KiB

BIN
src/assets/images/device03.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 KiB

1
src/styles/index.scss

@ -114,6 +114,7 @@
padding: 80px; padding: 80px;
.waringTable { .waringTable {
--el-table-border-color:none;
background-color: transparent; background-color: transparent;
border: 1px solid #053872; border: 1px solid #053872;

9
src/views/monitoring/components/header.vue

@ -82,9 +82,16 @@
stripe> stripe>
<el-table-column prop="deviceName" label="设备名称" align="center" /> <el-table-column prop="deviceName" label="设备名称" align="center" />
<el-table-column prop="paramName" label="变量名称" align="center" /> <el-table-column prop="paramName" label="变量名称" align="center" />
<el-table-column prop="alertName" label="告警级别" align="center" /> <el-table-column prop="alertName" label="告警级别" align="center">
<template #default="scope">
<span class="level">{{ scope.row.alertName }}</span>
</template>
</el-table-column>
<el-table-column prop="totalCounts" label="告警累计" align="center" /> <el-table-column prop="totalCounts" label="告警累计" align="center" />
<el-table-column label="报警时间" align="center">
<el-table-column prop="alertFirstTime" label="首次告警时间" align="center" /> <el-table-column prop="alertFirstTime" label="首次告警时间" align="center" />
<el-table-column prop="alertLastTime" label="末次告警时间" align="center" />
</el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button class="confirm" type="info" size="small" @click="waringConfirm(scope.row)">确认</el-button> <el-button class="confirm" type="info" size="small" @click="waringConfirm(scope.row)">确认</el-button>

7
src/views/monitoring/screen/components/main.vue

@ -247,11 +247,12 @@ function tableHeader() {
// //
const tableCessText = [ const tableCessText = [
{ {
id: 1, id: 0,
title: '设备名称', title: 'ID',
field: 'deviceuuid', field: 'id',
type: 'html', type: 'html',
formatter: formatRole, formatter: formatRole,
visible:false
}, },
]; ];
console.log(tableCessText) console.log(tableCessText)

18
src/views/monitoring/screen/components/showTree.vue

@ -21,11 +21,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { getCurrentInstance } from 'vue'; import { getCurrentInstance,ComponentInternalInstance } from 'vue';
import mitt from '@/plugins/bus'; import mitt from '@/plugins/bus';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance() as ComponentInternalInstance
const defaultCheckedKeys = ref([]); // const defaultCheckedKeys = ref([]); //
const checkList = ref([]); // const checkList = ref<TreeVo[]>([]); //
interface TreeVo { interface TreeVo {
id?: number; id?: number;
@ -33,7 +33,7 @@ interface TreeVo {
colType: string; colType: string;
field: string; field: string;
fixed?: string; fixed?: string;
show: boolean; visible: boolean;
title: string; title: string;
width: number; width: number;
controlValue?: number; controlValue?: number;
@ -51,9 +51,9 @@ const props: any = defineProps({
onMounted(() => { onMounted(() => {
treeData.value = props.headerData; treeData.value = props.headerData;
const checkData = []; const checkData:any = [];
props.headerData.map((item: TreeVo) => { props.headerData.map((item: TreeVo) => {
if (item.show) { if (item.visible) {
checkData.push(item.id); checkData.push(item.id);
checkList.value.push(item); checkList.value.push(item);
if (item.children && item.children.length) { if (item.children && item.children.length) {
@ -255,7 +255,7 @@ const defaultProps = {
// }, // },
// ]; // ];
function allowDrop(draggingNode, dropNode, type) { function allowDrop(draggingNode:any, dropNode:any, type:any) {
// //
if (type !== 'inner') { if (type !== 'inner') {
let control = draggingNode.level === dropNode.level ? true : false; let control = draggingNode.level === dropNode.level ? true : false;
@ -266,14 +266,14 @@ function allowDrop(draggingNode, dropNode, type) {
const treeCheckChange = (data: TreeVo, checked: boolean, indeterminate: boolean) => { const treeCheckChange = (data: TreeVo, checked: boolean, indeterminate: boolean) => {
// //
console.log(data, checked, indeterminate); console.log(data, checked, indeterminate);
data.show = checked; data.visible = checked;
console.log(treeData.value); console.log(treeData.value);
}; };
const nodeDrop = () => { const nodeDrop = () => {
// //
nextTick(() => { nextTick(() => {
proxy.$refs.tree.setCheckedKeys(defaultCheckedKeys.value); proxy?.$refs.tree.setCheckedKeys(defaultCheckedKeys.value);
}); });
}; };

4
vite.config.ts

@ -45,9 +45,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
hmr: true,//配置HMR hmr: true,//配置HMR
proxy: { proxy: {
[env.VITE_APP_BASE_API]: { [env.VITE_APP_BASE_API]: {
// target: 'http://172.1.2.106:9000/',//本地接口地址 target: 'http://172.1.2.106:9000/',//本地接口地址
// target: 'http://172.1.2.48:9000/',//本地接口地址 // target: 'http://172.1.2.48:9000/',//本地接口地址
target: 'http://board.heatiot.cn:8001/prod-api/',//线上接口地址 // target: 'http://board.heatiot.cn:8001/prod-api/',//线上接口地址
changeOrigin: true, changeOrigin: true,
rewrite: path => rewrite: path =>
path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '') path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')

Loading…
Cancel
Save