Browse Source

Merge remote-tracking branch 'origin/master'

master
yuliang 6 months ago
parent
commit
7a29f6c835
  1. 42
      src/editor/widgets/task/TaskView2.vue
  2. 2
      src/router/index.ts
  3. 27
      src/views/Home.less
  4. 16
      src/views/device/vehicles.vue
  5. 8
      src/views/inventory/account.vue
  6. 13
      src/views/inventory/query.vue
  7. 14
      src/views/user/roles.vue
  8. 14
      src/views/user/users.vue

42
src/editor/widgets/task/TaskView2.vue

@ -5,6 +5,8 @@ import { localeText as localeTextCn } from "@/components/yvTable/yv-aggrid-cn.lo
import { Request } from "@ease-forge/shared"; import { Request } from "@ease-forge/shared";
import type { GridOptions } from "ag-grid-enterprise"; import type { GridOptions } from "ag-grid-enterprise";
import type { GridApi, GridReadyEvent } from "ag-grid-community"; import type { GridApi, GridReadyEvent } from "ag-grid-community";
import { Refresh } from "@element-plus/icons-vue";
import { ElButton, ElInput, ElSwitch } from "element-plus";
defineOptions({ defineOptions({
name: 'TaskView', name: 'TaskView',
@ -20,12 +22,14 @@ const props = withDefaults(defineProps<TaskViewProps>(), {});
// State // State
interface TaskViewState { interface TaskViewState {
loading: boolean; loading: boolean;
automaticTracking: boolean;
grid1Data: Array<any>; grid1Data: Array<any>;
} }
// state // state
const state = reactive<TaskViewState>({ const state = reactive<TaskViewState>({
loading: false, loading: false,
automaticTracking: false,
grid1Data: [], grid1Data: [],
}); });
@ -50,6 +54,7 @@ const data: TaskViewData = {
{ field: 'type', headerName: '类型', width: 120 }, { field: 'type', headerName: '类型', width: 120 },
{ field: 'status', headerName: '状态', width: 120 }, { field: 'status', headerName: '状态', width: 120 },
{ field: 'err', headerName: '异常' }, { field: 'err', headerName: '异常' },
{ field: 'progress', headerName: '进度' },
{ field: 'payload', headerName: '任务负载', width: 600 }, { field: 'payload', headerName: '任务负载', width: 600 },
{ field: 'priority', headerName: '优先级', width: 120 }, { field: 'priority', headerName: '优先级', width: 120 },
{ field: 'info', headerName: '任务明细', width: 800 }, { field: 'info', headerName: '任务明细', width: 800 },
@ -65,7 +70,7 @@ const data: TaskViewData = {
field: 'title', field: 'title',
width: 300, width: 300,
}, },
groupDefaultExpanded: -1, // groupDefaultExpanded: -1,
onGridReady(event: GridReadyEvent) { onGridReady(event: GridReadyEvent) {
data.api = event.api; data.api = event.api;
}, },
@ -160,12 +165,13 @@ function toTreeData(data: Array<any>) {
info: `报文类型: ${device.packetType}, 报文目标点: ${device.packetEndPoint}, 报文内容: ${device.packetPayload}, 执行器ID: ${device.deviceItemId}`, info: `报文类型: ${device.packetType}, 报文目标点: ${device.packetEndPoint}, 报文内容: ${device.packetPayload}, 执行器ID: ${device.deviceItemId}`,
children: [], children: [],
}; };
// planNode.children.push(deviceNode); planNode.children.push(deviceNode);
tree.push(deviceNode); tree.push(deviceNode);
} }
// bizNode.children.push(planNode); bizNode.children.push(planNode);
tree.push(planNode); tree.push(planNode);
} }
bizNode.progress = `${bizNode.children.filter(item => item.status === PlanTaskStatus.FINISHED).length}/${bizNode.children.length}`;
tree.push(bizNode); tree.push(bizNode);
} }
return tree; return tree;
@ -190,10 +196,27 @@ export type {
</script> </script>
<template> <template>
<div class="task-view"> <div class="task-view flex-column-container">
<div class="tools flex-item-fixed flex-row-container">
<ElButton :icon="Refresh" :loading="state.loading" @click="reload">刷新</ElButton>
<div class="flex-row-container flex-align-items-center">
<div class="flex-item-fixed" style="padding-right: 4px;">自动追踪:</div>
<ElSwitch
class="flex-item-fixed"
v-model="state.automaticTracking"
inline-prompt
active-text="开启"
inactive-text="关闭"
/>
</div>
<div class="flex-row-container flex-align-items-center">
<div class="flex-item-fixed" style="padding-right: 4px;">筛选过滤:</div>
<ElInput class="flex-item-fixed" placeholder="关键字"/>
</div>
</div>
<AgGridVue <AgGridVue
ref="gridRef" ref="gridRef"
:class="['ag-theme-alpine', 'yv-table', 'hi-light-selected-row','allow-vertical-line', 'grid1']" :class="['ag-theme-alpine', 'yv-table', 'hi-light-selected-row','allow-vertical-line', 'flex-item-fill','grid1']"
v-bind="{...data.gridSetting}" v-bind="{...data.gridSetting}"
:modelValue="state.grid1Data" :modelValue="state.grid1Data"
> >
@ -206,7 +229,12 @@ export type {
height: 100%; height: 100%;
} }
.task-view > .grid1 { .tools {
height: 100%; padding: 8px;
column-gap: 8px;
}
.task-view .grid1 {
} }
</style> </style>

2
src/router/index.ts

@ -32,7 +32,7 @@ const router = createRouter({
meta: { meta: {
title: '任务查询' title: '任务查询'
}, },
component: () => import('@/views/taskManagement/taskQuery.vue') component: () => import('@/editor/widgets/task/TaskView2.vue')
}, },
{ {
path: '/automatedPresentation', path: '/automatedPresentation',

27
src/views/Home.less

@ -41,5 +41,32 @@
font-weight: 300; font-weight: 300;
} }
} }
.ag-ltr .ag-row .ag-cell{
border-right:1px solid #ebeef5;
&:last-child{
border-right:none;
}
&[tabindex="-1"]{
border-right:1px solid #ebeef5;
}
}
.ag-header-cell{
border-right:1px solid #dfe6ec;
&:last-child{
border-right:none;
}
&[tabindex="-1"]{
border-right:1px solid #dfe6ec;
}
}
}
}
.el-breadcrumb{
font-size: 16px;
}
@media (max-width: 768px) {
.data-form-row{
flex-wrap: wrap!important;
} }
} }

16
src/views/device/vehicles.vue

@ -102,19 +102,17 @@ function reload() {
</script> </script>
<template> <template>
<div class="dashboard flex-column-container"> <div class="common-layout dashboard flex-column-container">
<div class="tools flex-item-fixed"> <div class="flex-item-fixed toolbar">
<ElButton :icon="Search" :loading="state.loading" @click="reload">查询</ElButton> <ElButton :icon="Search" :loading="state.loading" @click="reload" type="warning" plain>查询</ElButton>
</div> </div>
<DataForm <DataForm
class="query-form flex-item-fixed" class="query-form flex-item-fixed"
style="width: 500px;"
:data="state.queryData" :data="state.queryData"
:formFields="data.formFields" :formFields="data.formFields"
:columnCount="2" :columnCount="4"
layout="bothFixed" layout="bothFixed"
labelWidth="120px" :inline="true"
inputWidth="200px"
/> />
<AgGridVue <AgGridVue
ref="gridRef" ref="gridRef"
@ -131,10 +129,6 @@ function reload() {
height: 100%; height: 100%;
} }
.tools {
margin-bottom: 8px;
}
.query-form { .query-form {
height: unset; height: unset;
} }

8
src/views/inventory/account.vue

@ -114,19 +114,19 @@ function serverSideDatasource(params: IServerSideGetRowsParams) {
</script> </script>
<template> <template>
<div class="dashboard flex-column-container"> <div class="common-layout dashboard flex-column-container">
<div class="tools flex-item-fixed"> <div class="flex-item-fixed toolbar">
<ElButton :icon="Search" :loading="state.loading" @click="reload">查询</ElButton> <ElButton :icon="Search" :loading="state.loading" @click="reload" type="warning" plain>查询</ElButton>
</div> </div>
<DataForm <DataForm
class="query-form flex-item-fixed" class="query-form flex-item-fixed"
style="width: 500px;"
:data="state.queryData" :data="state.queryData"
:formFields="data.formFields" :formFields="data.formFields"
:columnCount="2" :columnCount="2"
layout="bothFixed" layout="bothFixed"
labelWidth="85px" labelWidth="85px"
inputWidth="200px" inputWidth="200px"
:inline="true"
/> />
<AgGridVue <AgGridVue
ref="gridRef" ref="gridRef"

13
src/views/inventory/query.vue

@ -127,19 +127,19 @@ function serverSideDatasource(params: IServerSideGetRowsParams) {
</script> </script>
<template> <template>
<div class="dashboard flex-column-container"> <div class="common-layout dashboard flex-column-container">
<div class="tools flex-item-fixed"> <div class="flex-item-fixed toolbar">
<ElButton :icon="Search" :loading="state.loading" @click="reload">查询</ElButton> <ElButton :icon="Search" :loading="state.loading" @click="reload" type="warning" plain>查询</ElButton>
</div> </div>
<DataForm <DataForm
class="query-form flex-item-fixed" class="query-form flex-item-fixed"
style="width: 500px;"
:data="state.queryData" :data="state.queryData"
:formFields="data.formFields" :formFields="data.formFields"
:columnCount="2" :columnCount="2"
layout="bothFixed" layout="bothFixed"
labelWidth="85px" labelWidth="85px"
inputWidth="200px" inputWidth="200px"
:inline="true"
/> />
<AgGridVue <AgGridVue
ref="gridRef" ref="gridRef"
@ -154,11 +154,6 @@ function serverSideDatasource(params: IServerSideGetRowsParams) {
.dashboard { .dashboard {
height: 100%; height: 100%;
} }
.tools {
margin-bottom: 8px;
}
.query-form { .query-form {
height: unset; height: unset;
} }

14
src/views/user/roles.vue

@ -197,22 +197,22 @@ function delRole() {
</script> </script>
<template> <template>
<div class="dashboard flex-column-container"> <div class="common-layout dashboard flex-column-container">
<div class="tools flex-item-fixed"> <div class="toolbar flex-item-fixed">
<ElButton :icon="Search" :loading="state.loading" @click="reload">查询</ElButton> <ElButton :icon="Search" :loading="state.loading" @click="reload" type="warning" plain>查询</ElButton>
<ElButton :icon="Plus" @click="addOrUpdate(true)">新增</ElButton> <ElButton :icon="Plus" @click="addOrUpdate(true)">新增</ElButton>
<ElButton :icon="EditPen" @click="addOrUpdate(false)">编辑</ElButton> <ElButton :icon="EditPen" @click="addOrUpdate(false)">编辑</ElButton>
<ElButton :icon="Delete" type="danger" :plain="true" @click="delRole">删除</ElButton> <ElButton :icon="Delete" type="danger" :plain="true" @click="delRole">删除</ElButton>
</div> </div>
<DataForm <DataForm
class="query-form flex-item-fixed" class="query-form flex-item-fixed"
style="width: 500px;"
:data="state.queryData" :data="state.queryData"
:formFields="data.formFields" :formFields="data.formFields"
:columnCount="2" :columnCount="4"
layout="bothFixed" layout="bothFixed"
labelWidth="85px" labelWidth="85px"
inputWidth="200px" inputWidth="200px"
:inline="true"
/> />
<AgGridVue <AgGridVue
ref="gridRef" ref="gridRef"
@ -229,10 +229,6 @@ function delRole() {
height: 100%; height: 100%;
} }
.tools {
margin-bottom: 8px;
}
.query-form { .query-form {
height: unset; height: unset;
} }

14
src/views/user/users.vue

@ -210,22 +210,22 @@ function delUser() {
</script> </script>
<template> <template>
<div class="dashboard flex-column-container"> <div class="common-layout dashboard flex-column-container">
<div class="tools flex-item-fixed"> <div class="toolbar flex-item-fixed">
<ElButton :icon="Search" :loading="state.loading" @click="reload">查询</ElButton> <ElButton :icon="Search" :loading="state.loading" @click="reload" type="warning" plain>查询</ElButton>
<ElButton :icon="Plus" @click="addOrUpdate(true)">新增</ElButton> <ElButton :icon="Plus" @click="addOrUpdate(true)">新增</ElButton>
<ElButton :icon="EditPen" @click="addOrUpdate(false)">编辑</ElButton> <ElButton :icon="EditPen" @click="addOrUpdate(false)">编辑</ElButton>
<ElButton :icon="Delete" type="danger" :plain="true" @click="delUser">删除</ElButton> <ElButton :icon="Delete" type="danger" :plain="true" @click="delUser">删除</ElButton>
</div> </div>
<DataForm <DataForm
class="query-form flex-item-fixed" class="query-form flex-item-fixed"
style="width: 500px;"
:data="state.queryData" :data="state.queryData"
:formFields="data.formFields" :formFields="data.formFields"
:columnCount="2" :columnCount="4"
layout="bothFixed" layout="bothFixed"
labelWidth="85px" labelWidth="85px"
inputWidth="200px" inputWidth="200px"
:inline="true"
/> />
<AgGridVue <AgGridVue
ref="gridRef" ref="gridRef"
@ -241,10 +241,6 @@ function delUser() {
height: 100%; height: 100%;
} }
.tools {
margin-bottom: 8px;
}
.query-form { .query-form {
height: unset; height: unset;
} }

Loading…
Cancel
Save