Commit 7a1778e6 authored by LiXuyang's avatar LiXuyang

任务流设置

parent eb7c71e5
...@@ -9,213 +9,111 @@ type CheckedType = boolean | string | number; ...@@ -9,213 +9,111 @@ type CheckedType = boolean | string | number;
export const TreeData: any[] = [ export const TreeData: any[] = [
{ {
delFlag: '0', key: '0',
flag: '1', title: '馈线反馈',
businessId: 100,
institutionName: '机构管理',
anotherName: '机构管理',
parentId: 0,
code: 'DataGovernanceDep_product1',
ancestors: '0',
orderNum: 0,
children: [], children: [],
selectType: null, icon: 'ant-design:folder-outlined',
icon: 'ion:settings-outline',
}, },
{ {
delFlag: '0', key: '1',
flag: '1', title: '市场营销',
businessId: 101, icon: 'ant-design:folder-outlined',
institutionName: '数据平台治理部', children: [
anotherName: '数据平台治理部',
parentId: 100,
code: 'DataGovernanceDep_product2',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
icon: 'ion:settings-outline',
},
{ {
delFlag: '0', key: '1-0',
flag: '1', title: '供电单位用电量',
businessId: 107, icon: 'ant-design:api-outlined',
institutionName: '数据资源管理部',
anotherName: '数据资源管理部',
parentId: 100,
code: 'DataGovernanceDep_product3',
ancestors: '0,100',
orderNum: 2,
children: [],
selectType: null,
icon: 'ion:settings-outline',
}, },
{ {
delFlag: '0', key: '1-1',
flag: '1', title: '电费回收率',
businessId: 102, icon: 'ant-design:api-outlined',
institutionName: '研发部门',
anotherName: '研发部门',
parentId: 101,
code: 'DataGovernanceDep_product4',
ancestors: '0,100,101',
orderNum: 1,
children: [],
selectType: null,
icon: 'ion:settings-outline',
}, },
{ {
delFlag: '0', key: '1-2',
flag: '1', title: '中压馈线电流',
businessId: 103, icon: 'ant-design:api-outlined',
institutionName: '市场部门',
anotherName: '市场部门',
parentId: 101,
code: 'DataGovernanceDep_product5',
ancestors: '0,100,101',
orderNum: 2,
children: [],
selectType: null,
icon: 'ion:settings-outline',
}, },
{ {
delFlag: '0', key: '1-3',
flag: '1', title: '中压馈线指标',
businessId: 104, icon: 'ant-design:api-outlined',
institutionName: '测试部门',
anotherName: '测试部门',
parentId: 101,
code: 'DataGovernanceDep_product6',
ancestors: '0,100,101',
orderNum: 3,
children: [],
selectType: null,
icon: 'ion:settings-outline',
}, },
{ {
delFlag: '0', key: '1-4',
flag: '1', title: '馈线最大电流',
businessId: 105, icon: 'ant-design:api-outlined',
institutionName: '财务部门',
anotherName: '财务部门',
parentId: 101,
code: 'DataGovernanceDep_product7',
ancestors: '0,100,101',
orderNum: 4,
children: [],
selectType: null,
icon: 'ion:settings-outline',
}, },
{ ],
delFlag: '0',
flag: '1',
businessId: 106,
institutionName: '运维部门',
anotherName: '运维部门',
parentId: 101,
code: 'DataGovernanceDep_product8',
ancestors: '0,100,101',
orderNum: 5,
children: [],
selectType: null,
icon: 'ion:settings-outline',
},
{
delFlag: '0',
flag: '1',
businessId: 202,
institutionName: '数据部门',
anotherName: '数据部门',
parentId: 107,
code: 'DataGovernanceDep_product9',
ancestors: '0,100,107',
orderNum: 1,
children: [],
selectType: null,
icon: 'ion:settings-outline',
},
{
delFlag: '0',
flag: '0',
businessId: 203,
institutionName: '检查部门',
anotherName: '检查部门',
parentId: 107,
code: 'DataGovernanceDep_product10',
ancestors: '0,100,107',
orderNum: 2,
children: [],
selectType: null,
icon: 'ion:settings-outline',
}, },
]; ];
export const TableData: any[] = [ export const TableData: any[] = [
{ {
gateway: 'gw-001', gateway: '35.84.167.92',
executor: 'exec-001', executor: '218.99.112.56',
caller: 'user-001', caller: 'user-001',
startTime: '2024-11-30 13:05:05', startTime: '2024-11-30 13:05:05',
consume: '1s', consume: '1s',
}, },
{ {
gateway: 'gw-002', gateway: '120.88.200.123',
executor: 'exec-002', executor: '51.198.72.14',
caller: 'user-002', caller: 'user-002',
startTime: '2024-11-30 13:10:08', startTime: '2024-11-30 13:10:08',
consume: '2s', consume: '2s',
}, },
{ {
gateway: 'gw-003', gateway: '19.75.138.255',
executor: 'exec-003', executor: '102.47.16.39',
caller: 'user-003', caller: 'user-003',
startTime: '2024-11-30 13:20:09', startTime: '2024-11-30 13:20:09',
consume: '3s', consume: '3s',
}, },
{ {
gateway: 'gw-004', gateway: '234.156.17.98',
executor: 'exec-004', executor: '212.71.48.99',
caller: 'user-004', caller: 'user-004',
startTime: '2024-11-30 13:25:10', startTime: '2024-11-30 13:25:10',
consume: '4s', consume: '4s',
}, },
{ {
gateway: 'gw-005', gateway: '102.194.123.75',
executor: 'exec-005', executor: '13.62.47.129',
caller: 'user-005', caller: 'user-005',
startTime: '2024-11-30 13:30:11', startTime: '2024-11-30 13:30:11',
consume: '5s', consume: '5s',
}, },
{ {
gateway: 'gw-006', gateway: '34.86.51.231',
executor: 'exec-006', executor: '176.35.22.176',
caller: 'user-006', caller: 'user-006',
startTime: '2024-11-30 13:35:12', startTime: '2024-11-30 13:35:12',
consume: '6s', consume: '6s',
}, },
{ {
gateway: 'gw-007', gateway: '84.29.59.110',
executor: 'exec-007', executor: '89.203.125.13',
caller: 'user-007', caller: 'user-007',
startTime: '2024-11-30 13:40:13', startTime: '2024-11-30 13:40:13',
consume: '7s', consume: '7s',
}, },
{ {
gateway: 'gw-008', gateway: '46.174.192.222',
executor: 'exec-008', executor: '12.195.44.58',
caller: 'user-008', caller: 'user-008',
startTime: '2024-11-30 13:45:14', startTime: '2024-11-30 13:45:14',
consume: '8s', consume: '8s',
}, },
{ {
gateway: 'gw-009', gateway: '219.31.51.27',
executor: 'exec-009', executor: '128.114.242.53',
caller: 'user-009', caller: 'user-009',
startTime: '2024-11-30 13:50:15', startTime: '2024-11-30 13:50:15',
consume: '9s', consume: '9s',
}, },
{ {
gateway: 'gw-010', gateway: '233.164.81.62',
executor: 'exec-010', executor: '19.78.211.9',
caller: 'user-010', caller: 'user-010',
startTime: '2024-11-30 13:55:16', startTime: '2024-11-30 13:55:16',
consume: '10s', consume: '10s',
......
...@@ -8,78 +8,20 @@ ...@@ -8,78 +8,20 @@
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto" treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
:clickRowToExpand="false" :clickRowToExpand="false"
:defaultExpandAll="true" :defaultExpandAll="true"
:treeData="treeData" :treeData="TreeData"
:fieldNames="{ key: 'businessId', title: 'institutionName' }"
@select="handleSelect" @select="handleSelect"
/> />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {h, nextTick, onMounted, ref, unref} from 'vue'; import { ref } from 'vue';
import {BasicTree, TreeActionItem, TreeActionType, TreeItem} from '@/components/Tree'; import { BasicTree, TreeActionType } from '@/components/Tree';
import { getDeptList } from '@/api/system/dept/dept'; import { Nullable } from '@vben/types';
import {Nullable} from "@vben/types"; import { TreeData } from './ApiMonitorData';
import { TreeData } from "@/views/system/institution/institutionData";
import {Modal} from "ant-design-vue"; const emit = defineEmits(['select']);
import { useMessage } from '@/hooks/web/useMessage'; const treeRef = ref<Nullable<TreeActionType>>(null);
import {useModal} from "@/components/Modal"; function handleSelect(keys) {
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select']);
const { createMessage } = useMessage();
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
const [registerModal, { openModal }] = useModal();
const [registerMoveTreeModel, { openModal:openMoveTreeModel }] = useModal();
function getTree() {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
async function fetch() {
const data = TreeData
treeData.value = handleTree(data, 'businessId',undefined,undefined,undefined)
await nextTick(() => {
getTree().expandAll(true)
})
}
function handleTree(data, id, parentId, children, rootId) {
id = id || 'id'
parentId = parentId || 'parentId'
children = children || 'children'
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
// 对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
// 循环所有项
const treeData = cloneData.filter(father => {
const branchArr = cloneData.filter(child => {
// 返回每一项的子级数组
return father[id] === child[parentId]
})
branchArr.length > 0 ? father.children = branchArr : ''
// 返回第一层
return father[parentId] === rootId
})
return treeData !== '' ? treeData : data
}
function handleSelect(keys) {
emit('select', keys[0]); emit('select', keys[0]);
} }
onMounted(() => {
fetch();
});
/** 成功回调函数*/
function handleSuccess() {
}
</script> </script>
<template> <template>
<div class="center"> <div class="center">
<div style="display: flex;justify-content: space-between;margin-left: 10px;padding-top: 10px"> <div
style="display: flex; justify-content: space-between; margin-left: 10px; padding-top: 10px"
>
<div style="display: flex"> <div style="display: flex">
<Icon icon="dashicons:admin-plugins" style="color: rgb(22, 179, 197);font-size: 30px"></Icon> <Icon icon="dashicons:admin-plugins" style="color: rgb(22, 179, 197); font-size: 30px" />
<div> <div>
<span style="font-weight: bold">供电单位用电量</span><br> <span style="font-weight: bold">供电单位用电量</span><br />
<span>API监控/市场营销/供电单位用电量</span> <span>API监控/市场营销/供电单位用电量</span>
</div> </div>
</div> </div>
...@@ -14,7 +16,7 @@ ...@@ -14,7 +16,7 @@
</div> </div>
</div> </div>
<Alert <Alert
style="margin-top: 10px;margin-bottom: 10px" style="margin-top: 10px; margin-bottom: 10px"
show-icon show-icon
type="info" type="info"
message="此处仅展示拉取数据模式的API调用情况。" message="此处仅展示拉取数据模式的API调用情况。"
...@@ -46,13 +48,14 @@ ...@@ -46,13 +48,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { CountTo } from '@/components/CountTo'; import { CountTo } from '@/components/CountTo';
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import { Tag, Card,Select,Alert } from 'ant-design-vue'; import { Tag, Card, Select, Alert } from 'ant-design-vue';
import { reactive,unref,onDeactivated,onMounted,ref,watch,Ref } from 'vue'; import { reactive, unref, onDeactivated, onMounted, ref, watch, Ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import {columns1,searchFormSchema} from "./ApiMonitor.data"; import { columns1, searchFormSchema } from './ApiMonitor.data';
import {TableData} from "./ApiMonitorData"; import { TableData } from './ApiMonitorData';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage(); const { createMessage } = useMessage();
defineProps({ defineProps({
loading: { loading: {
...@@ -75,21 +78,21 @@ ...@@ -75,21 +78,21 @@
title: '执行中请求', title: '执行中请求',
api: async (params) => { api: async (params) => {
const response = { const response = {
pageNu: "1", pageNu: '1',
pageSize: "10", pageSize: '10',
pages: "1", pages: '1',
total: TableData.length, total: TableData.length,
code:'', code: '',
message:'', message: '',
data: [], data: [],
}; };
return { ...response,data: TableData }; return { ...response, data: TableData };
}, },
columns:columns1, columns: columns1,
pagination:true, pagination: true,
useSearchForm: false, useSearchForm: false,
showTableSetting: false, showTableSetting: false,
showIndexColumn:false, showIndexColumn: false,
bordered: true, bordered: true,
scroll: { y: 500 }, scroll: { y: 500 },
actionColumn: { actionColumn: {
...@@ -99,23 +102,20 @@ ...@@ -99,23 +102,20 @@
}, },
}); });
function deleteButton() {
createMessage.success('删除成功!');
function deleteButton(){
createMessage.success('删除成功!')
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.card{ .card {
::v-deep(.ant-card-body){ ::v-deep(.ant-card-body) {
width: 100%; width: 100%;
display: flex; display: flex;
} }
} }
.center{ .center {
width: 100%; width: 100%;
background-color: white; background-color: white;
} }
</style> </style>
...@@ -39,7 +39,7 @@ function getEchartsData1() { ...@@ -39,7 +39,7 @@ function getEchartsData1() {
}, },
legend: { legend: {
orient: 'vertical', // 垂直方向 orient: 'vertical', // 垂直方向
right: '2%', // 图例放置在右侧 left: '70%', // 图例放置在右侧
top: 'center', // 图例垂直居中 top: 'center', // 图例垂直居中
itemWidth: 15, // 图例标记宽度 itemWidth: 15, // 图例标记宽度
itemHeight: 15, // 图例标记高度 itemHeight: 15, // 图例标记高度
......
...@@ -39,7 +39,7 @@ function getEchartsData1() { ...@@ -39,7 +39,7 @@ function getEchartsData1() {
}, },
legend: { legend: {
orient: 'vertical', // 垂直方向 orient: 'vertical', // 垂直方向
right: '2%', // 图例放置在右侧 left: '70%', // 图例放置在右侧
top: 'center', // 图例垂直居中 top: 'center', // 图例垂直居中
itemWidth: 15, // 图例标记宽度 itemWidth: 15, // 图例标记宽度
itemHeight: 15, // 图例标记高度 itemHeight: 15, // 图例标记高度
......
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive,unref,onDeactivated,onMounted,ref } from 'vue'; import { reactive, unref, onDeactivated, onMounted, ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import ApiMonitorTree from './ApiMonitorTree.vue'; import ApiMonitorTree from './ApiMonitorTree.vue';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { useGo } from '@/hooks/web/usePage'; import { useGo } from '@/hooks/web/usePage';
import { useRoute,onBeforeRouteLeave } from 'vue-router'; import { useRoute, onBeforeRouteLeave } from 'vue-router';
import {forEach} from "lodash-es"; import { forEach } from 'lodash-es';
import RightContent1 from './RightContent1.vue'; import RightContent1 from './RightContent1.vue';
import RightContent3 from './RightContent3.vue'; import RightContent3 from './RightContent3.vue';
import RightContent2 from './RightContent2.vue'; import RightContent2 from './RightContent2.vue';
...@@ -29,16 +29,11 @@ ...@@ -29,16 +29,11 @@
import RightContent5 from './RightContent5.vue'; import RightContent5 from './RightContent5.vue';
import RightContent6 from './RightContent6.vue'; import RightContent6 from './RightContent6.vue';
import RightContent7 from './RightContent7.vue'; import RightContent7 from './RightContent7.vue';
defineOptions({ name: 'AccountManagement' }); defineOptions({ name: 'AccountManagement' });
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
const route = useRoute(); const route = useRoute();
const go = useGo(); const go = useGo();
onMounted(() => {});
onMounted(() => {
});
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment