dvr分析
This commit is contained in:
@@ -1,14 +1,16 @@
|
|||||||
import { VxeTableProps } from "vxe-table";
|
import { VxeTableProps } from 'vxe-table'
|
||||||
|
|
||||||
export const defaultAttribute:VxeTableProps = {
|
export const defaultAttribute: VxeTableProps = {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
headerCellClassName: 'table-header-cell',
|
headerCellClassName: 'table-header-cell',
|
||||||
border: true,
|
border: true,
|
||||||
stripe: true,
|
stripe: true,
|
||||||
size: 'small',
|
size: 'small',
|
||||||
columnConfig: { resizable: true },
|
columnConfig: { resizable: true },
|
||||||
rowConfig: { isCurrent: true, isHover: true },
|
rowConfig: { isCurrent: true, isHover: true,keyField: 'id' },
|
||||||
scrollX: { scrollToLeftOnChange: true },
|
scrollX: { scrollToLeftOnChange: true },
|
||||||
scrollY: { scrollToTopOnChange: true,enabled:true },
|
scrollY: { scrollToTopOnChange: true, enabled: true },
|
||||||
treeConfig: {}
|
treeConfig: {
|
||||||
}
|
reserve: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ const getTagType = (value: string, custom: any): TagProps['type'] => {
|
|||||||
}
|
}
|
||||||
.table-operate-text {
|
.table-operate-text {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
.table-operate {
|
.table-operate {
|
||||||
padding: 4px 5px;
|
padding: 4px 5px;
|
||||||
|
|||||||
@@ -161,5 +161,8 @@ defineExpose({
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
background-color: var(--ba-bg-color-overlay);
|
background-color: var(--ba-bg-color-overlay);
|
||||||
padding: 13px 15px;
|
padding: 13px 15px;
|
||||||
|
border-left: 1px solid #e4e7e9;
|
||||||
|
border-right: 1px solid #e4e7e9;
|
||||||
|
border-bottom: 1px solid #e4e7e9;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ const init = async () => {
|
|||||||
icon: 'el-icon-List',
|
icon: 'el-icon-List',
|
||||||
menu_type: 'tab',
|
menu_type: 'tab',
|
||||||
url: '',
|
url: '',
|
||||||
component: '/src/views/govern/device/manage.vue',
|
component: '/src/views/govern/setting/statisticalType/index.vue',
|
||||||
keepalive: 'test',
|
keepalive: 'test',
|
||||||
extend: 'none',
|
extend: 'none',
|
||||||
children: [
|
children: [
|
||||||
@@ -98,7 +98,7 @@ const init = async () => {
|
|||||||
icon: 'el-icon-List',
|
icon: 'el-icon-List',
|
||||||
menu_type: 'tab',
|
menu_type: 'tab',
|
||||||
url: '',
|
url: '',
|
||||||
component: '/src/views/govern/analyze/DVR/index.vue',
|
component: '/src/views/govern/setting/statisticalType/index.vue',
|
||||||
keepalive: 'auth/role',
|
keepalive: 'auth/role',
|
||||||
extend: 'none',
|
extend: 'none',
|
||||||
children: []
|
children: []
|
||||||
|
|||||||
@@ -1,24 +1,58 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main analyze-dvr" :style="{ height: pageHeight.height }" v-loading="loading">
|
<div class="default-main analyze-dvr" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||||
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
||||||
<div class="analyze-dvr-right"></div>
|
<div class="analyze-dvr-right">
|
||||||
|
<Table ref="tableRef" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive, provide, onMounted } from 'vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
|
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'govern/analyze/DVR'
|
name: 'govern/analyze/DVR'
|
||||||
})
|
})
|
||||||
const pageHeight = mainHeight(20)
|
const pageHeight = mainHeight(20)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/cs-harmonic-boot/eventUser/queryEventpage',
|
||||||
|
method: 'POST',
|
||||||
|
column: [
|
||||||
|
{ title: '事件描述', field: 'evtParamPosition' },
|
||||||
|
{ title: '持续时间(s)', field: 'evtParamTm' },
|
||||||
|
{ title: '暂降深度', field: 'evtParamVVaDepth' },
|
||||||
|
{ title: '发生时刻', field: 'startTime' },
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
width: '130',
|
||||||
|
render: 'buttons',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
text: '波形分析',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-DataLine',
|
||||||
|
render: 'tipButton',
|
||||||
|
click: row => {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
tableStore.table.params.type = 0
|
||||||
|
provide('tableStore', tableStore)
|
||||||
const nodeClick = async (e: anyObj) => {
|
const nodeClick = async (e: anyObj) => {
|
||||||
if (e.level == 2) {
|
if (e.level == 2) {
|
||||||
|
loading.value = false
|
||||||
|
tableStore.table.params.deviceId = e.id
|
||||||
|
tableStore.index()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
94
src/views/govern/setting/statisticalType/index.vue
Normal file
94
src/views/govern/setting/statisticalType/index.vue
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<TableHeader>
|
||||||
|
<template v-slot:operation>
|
||||||
|
<el-button :icon="Plus" type="primary" @click="addMenu">添加</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<Table ref="tableRef" :pagination="false" />
|
||||||
|
<popupForm ref="popupRef"></popupForm>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
|
import { ref, onMounted, provide } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import popupForm from './popupForm.vue'
|
||||||
|
import { useNavTabs } from '@/stores/navTabs'
|
||||||
|
import { delMenu } from '@/api/systerm'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'govern/setting/statisticalType'
|
||||||
|
})
|
||||||
|
const tableRef = ref()
|
||||||
|
const popupRef = ref()
|
||||||
|
const navTabs = useNavTabs()
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/user-boot/function/functionTree',
|
||||||
|
column: [
|
||||||
|
{ title: '序号', type: 'seq', width: 60 },
|
||||||
|
{ title: '统计类型', field: 'title' },
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
width: '130',
|
||||||
|
render: 'buttons',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
title: '编辑',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-EditPen',
|
||||||
|
render: 'tipButton',
|
||||||
|
click: row => {
|
||||||
|
popupRef.value.open('编辑菜单', row)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'del',
|
||||||
|
title: '删除',
|
||||||
|
type: 'danger',
|
||||||
|
icon: 'el-icon-Delete',
|
||||||
|
render: 'confirmButton',
|
||||||
|
popconfirm: {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmButtonType: 'danger',
|
||||||
|
title: '确定删除该菜单吗?'
|
||||||
|
},
|
||||||
|
click: row => {
|
||||||
|
delMenu(row.id).then(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
loadCallback: () => {
|
||||||
|
// 过滤数组中type等于1的数据,children下钻
|
||||||
|
const filterData = (arr: any[]) => {
|
||||||
|
return arr.filter((item: any) => {
|
||||||
|
if (item.children.length) {
|
||||||
|
item.children = filterData(item.children)
|
||||||
|
}
|
||||||
|
return item.type != 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
tableStore.table.data = filterData(tableStore.table.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.table.ref = tableRef.value
|
||||||
|
tableStore.index()
|
||||||
|
tableStore.table.loading = false
|
||||||
|
})
|
||||||
|
const addMenu = () => {
|
||||||
|
console.log(popupRef)
|
||||||
|
popupRef.value.open('新增菜单')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
103
src/views/govern/setting/statisticalType/popupForm.vue
Normal file
103
src/views/govern/setting/statisticalType/popupForm.vue
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog class='cn-operate-dialog' v-model='dialogVisible' :title='title'>
|
||||||
|
<el-scrollbar>
|
||||||
|
<el-form :inline='false' :model='form' label-width='120px'>
|
||||||
|
<el-form-item label='上级菜单'>
|
||||||
|
<el-cascader
|
||||||
|
v-model='form.pid'
|
||||||
|
:options='tableStore.table.data'
|
||||||
|
:props='cascaderProps'
|
||||||
|
style='width: 100%'
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='菜单名称'>
|
||||||
|
<el-input v-model='form.name' placeholder='请输入菜单名称' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='图标'>
|
||||||
|
<IconSelector v-model='form.icon' placeholder='请选择图标' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='菜单路由'>
|
||||||
|
<el-input v-model='form.path' placeholder='请输入菜单名称' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='组件路径'>
|
||||||
|
<el-input v-model='form.routeName' placeholder='请输入组件路径,如/src/views/dashboard/index.vue' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='排序'>
|
||||||
|
<el-input-number v-model='form.sort' :min='0' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='菜单描述'>
|
||||||
|
<el-input v-model='form.remark' :rows='2' type='textarea' placeholder='请输入描述' />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-scrollbar>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<span class='dialog-footer'>
|
||||||
|
<el-button @click='dialogVisible = false'>取消</el-button>
|
||||||
|
<el-button type='primary' @click='submit'>确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { reactive } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import IconSelector from '@/components/baInput/components/iconSelector.vue'
|
||||||
|
import { updateMenu, addMenu } from '@/api/systerm'
|
||||||
|
|
||||||
|
const tableStore = inject('tableStore') as TableStore
|
||||||
|
const cascaderProps = {
|
||||||
|
label: 'title',
|
||||||
|
value: 'id'
|
||||||
|
}
|
||||||
|
const form: any = reactive({
|
||||||
|
code: '',
|
||||||
|
icon: '',
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
path: '',
|
||||||
|
pid: '0',
|
||||||
|
remark: '',
|
||||||
|
routeName: '',
|
||||||
|
sort: 0,
|
||||||
|
type: 0
|
||||||
|
})
|
||||||
|
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('新增菜单')
|
||||||
|
const open = (text: string, data?: anyObj) => {
|
||||||
|
console.log(data)
|
||||||
|
title.value = text
|
||||||
|
if (data) {
|
||||||
|
for (let key in form) {
|
||||||
|
form[key] = data[key]
|
||||||
|
}
|
||||||
|
form.path = data.routePath
|
||||||
|
form.name = data.title
|
||||||
|
} else {
|
||||||
|
// 重置表单
|
||||||
|
for (let key in form) {
|
||||||
|
form[key] = ''
|
||||||
|
}
|
||||||
|
form.pid = '0'
|
||||||
|
form.sort = 0
|
||||||
|
form.type = 0
|
||||||
|
}
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
const submit = async () => {
|
||||||
|
if (form.id) {
|
||||||
|
await updateMenu(form)
|
||||||
|
} else {
|
||||||
|
form.code = 'menu'
|
||||||
|
let obj = JSON.parse(JSON.stringify(form))
|
||||||
|
delete obj.id
|
||||||
|
await addMenu(obj)
|
||||||
|
}
|
||||||
|
tableStore.index()
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user