Commit c5bcaa12 authored by baiyinhao's avatar baiyinhao

修改通知中心 修改shell脚本开发页面 修改指标页面

parent a7b57077
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
PlusOutlined, PlusOutlined,
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
import { labelTreeData, tabTableData } from '../benchmarkMainbody/labelData'; import { labelTreeData, tabTableData } from '../benchmarkMainbody/labelData';
import { h, ref, unref } from 'vue'; import { h, nextTick, onMounted, ref, unref } from 'vue';
import { Divider } from 'ant-design-vue'; import { Divider } from 'ant-design-vue';
import type { BasicTableProps, TableActionType, TableRowSelection } from '@/components/Table'; import type { BasicTableProps, TableActionType, TableRowSelection } from '@/components/Table';
import PageWrapper from '@/components/Page/src/PageWrapper.vue'; import PageWrapper from '@/components/Page/src/PageWrapper.vue';
...@@ -135,6 +135,7 @@ ...@@ -135,6 +135,7 @@
const [addLabelModal, { openModal: openAddLabelModel }] = useModal(); const [addLabelModal, { openModal: openAddLabelModel }] = useModal();
const tabName = ref(''); const tabName = ref('');
const treeData = ref(); const treeData = ref();
//树的选择事件
function handleSelect() { function handleSelect() {
const keys = unref(treeData).getSelectedKeys(); const keys = unref(treeData).getSelectedKeys();
const node = unref(treeData).getSelectedNode(keys[0]); const node = unref(treeData).getSelectedNode(keys[0]);
...@@ -246,6 +247,28 @@ ...@@ -246,6 +247,28 @@
fixed: undefined, fixed: undefined,
}, },
} as BasicTableProps); } as BasicTableProps);
onMounted(() => {
nextTick(() => {
// 设置默认选中的节点 Key(假设为 'defaultKey')
const Key = '1';
const treeInstance = unref(treeData);
// 确保树实例已经挂载并设置选中节点
if (treeInstance) {
treeInstance.setSelectedKeys([1]); // 设置默认选中
const defaultNode = treeInstance.getSelectedNode(1); // 获取默认节点信息
if (defaultNode) {
// 调用 handleSelect 或其他逻辑
tabName.value = defaultNode.title; // 设置标题
if (defaultNode.children) {
tabSetTableData(defaultNode.children);
} else {
tabSetTableData([defaultNode]);
}
}
}
});
});
</script> </script>
<style scoped> <style scoped>
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
autoSubmitOnEnter: true, autoSubmitOnEnter: true,
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: false,
bordered: true, bordered: true,
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
......
...@@ -189,55 +189,183 @@ export const treeDataListTwo = [ ...@@ -189,55 +189,183 @@ export const treeDataListTwo = [
export const TreeData: any[] = [ export const TreeData: any[] = [
{ {
delFlag: '0',
flag: '1',
businessId: 100, businessId: 100,
QualityName: '质量模版', workSpaceName: 'SHELL文件',
anotherName: '质量模版',
parentId: 0, parentId: 0,
location: '/质量模版', code: '001',
ancestors: '0',
orderNum: 0,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: 'SHELL文件',
anotherName: 'SHELL文件',
location: '/SHELL文件',
icon: 'ant-design:folder-open-outlined', icon: 'ant-design:folder-open-outlined',
}, },
{ {
delFlag: '0',
flag: '1',
businessId: 101, businessId: 101,
QualityName: 'CEA_POC_模版', workSpaceName: 'admin-个人工作区',
anotherName: 'CEA_POC_模版',
parentId: 100, parentId: 100,
code: '002',
ancestors: '0,100', ancestors: '0,100',
orderNum: 1,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: 'admin-个人工作区',
anotherName: 'admin-个人工作区',
location: '/SHELL文件/admin-个人工作区',
icon: 'ant-design:folder-open-outlined', icon: 'ant-design:folder-open-outlined',
}, },
{ {
delFlag: '0',
flag: '1',
businessId: 102, businessId: 102,
QualityName: '数据中台工作区01', workSpaceName: '共享工作区',
anotherName: '数据中台工作区01',
parentId: 100, parentId: 100,
code: '003',
ancestors: '0,100', ancestors: '0,100',
location: '/质量模版/数据中台工作区01', orderNum: 2,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: '共享工作区',
anotherName: '共享工作区',
location: '/SHELL文件/共享工作区',
icon: 'ant-design:folder-open-outlined', icon: 'ant-design:folder-open-outlined',
}, },
{ {
delFlag: '0',
flag: '0',
businessId: 103,
workSpaceName: '高级工作区',
parentId: 100,
code: '010',
ancestors: '0,100,107',
orderNum: 2,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: '高级工作区',
anotherName: '高级工作区',
location: '/SHELL文件/高级工作区',
icon: 'ant-design:folder-open-outlined',
},
{
delFlag: '0',
flag: '1',
businessId: 201, businessId: 201,
QualityName: '值域检查(倍数)', workSpaceName: '文件夹1',
anotherName: '值域检查(倍数)', parentId: 101,
parentId: 102, code: '002',
ancestors: '0,100,102', ancestors: '0,100',
location: '/质量模版/数据中台工作区01/值域检查(倍数)', orderNum: 1,
icon: 'ant-design:partition-outlined', selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: '文件夹1',
anotherName: '文件夹1',
location: '/SHELL文件/admin-个人工作区/文件夹1',
icon: 'ant-design:folder-open-outlined',
}, },
{ {
delFlag: '0',
flag: '1',
businessId: 202, businessId: 202,
QualityName: '值域检查(数值大于零)', workSpaceName: '文件夹2',
anotherName: '值域检查(数值大于零)',
parentId: 102, parentId: 102,
ancestors: '0,100,102', code: '003',
location: '/质量模版/数据中台工作区01/值域检查(数值大于零)', ancestors: '0,100',
orderNum: 2,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: '文件夹2',
anotherName: '文件夹2',
location: '/SHELL文件/共享工作区/文件夹2',
icon: 'ant-design:folder-open-outlined',
},
{
delFlag: '0',
flag: '0',
businessId: 203,
workSpaceName: '文件夹3',
parentId: 103,
code: '010',
ancestors: '0,100,107',
orderNum: 2,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: '文件夹3',
anotherName: '文件夹3',
location: '/SHELL文件/高级工作区/文件夹3',
icon: 'ant-design:folder-open-outlined',
},
{
delFlag: '0',
flag: '1',
businessId: 301,
workSpaceName: 'SQL1',
parentId: 201,
code: '002',
ancestors: '0,100',
orderNum: 1,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: 'SQL1',
anotherName: 'SQL1',
location: '/SHELL文件/admin-个人工作区/文件夹1/SQL1',
icon: 'ant-design:partition-outlined', icon: 'ant-design:partition-outlined',
}, },
{ {
businessId: 204, delFlag: '0',
QualityName: '准取检查-数值大于等于n', flag: '1',
anotherName: '准取检查-数值大于等于n', businessId: 302,
parentId: 101, workSpaceName: 'SQL1',
ancestors: '0,100,101', parentId: 202,
location: '/质量模版/CEA_POC_模版/准取检查-数值大于等于n', code: '003',
ancestors: '0,100',
orderNum: 2,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: 'SQL1',
anotherName: 'SQL1',
location: '/SHELL文件/共享工作区/文件夹2/SQL1',
icon: 'ant-design:partition-outlined',
},
{
delFlag: '0',
flag: '0',
businessId: 303,
workSpaceName: 'SQL1',
parentId: 203,
code: '010',
ancestors: '0,100,107',
orderNum: 2,
selectType: null,
createTime: '2024-10-24 10:04:04',
updateTime: '2024-10-24 10:04:04',
createBy: 'admin',
QualityName: 'SQL1',
anotherName: 'SQL1',
location: '/SHELL文件/高级工作区/文件夹3/SQL1',
icon: 'ant-design:partition-outlined', icon: 'ant-design:partition-outlined',
}, },
]; ];
...@@ -135,7 +135,7 @@ export const formSchemaTemplate: any = [ ...@@ -135,7 +135,7 @@ export const formSchemaTemplate: any = [
component: 'TreeSelect', component: 'TreeSelect',
rules: [ rules: [
{ {
required: true, required: false,
message: '请选择上级菜单', message: '请选择上级菜单',
}, },
], ],
...@@ -162,7 +162,7 @@ export const formSchemaTemplate: any = [ ...@@ -162,7 +162,7 @@ export const formSchemaTemplate: any = [
field: 'fileType', field: 'fileType',
label: '文件类型', label: '文件类型',
component: 'Input', component: 'Input',
defaultValue: '质量模板', defaultValue: '.sh格式文件',
colProps: { span: 8 }, colProps: { span: 8 },
componentProps: { componentProps: {
readonly: true, readonly: true,
...@@ -172,21 +172,21 @@ export const formSchemaTemplate: any = [ ...@@ -172,21 +172,21 @@ export const formSchemaTemplate: any = [
}, },
}, },
}, },
{ // {
field: 'dataSource', // field: 'dataSource',
label: '支持数据源', // label: '支持数据源',
component: 'Select', // component: 'Select',
colProps: { span: 8 }, // colProps: { span: 8 },
componentProps: { // componentProps: {
mode: 'multiple', // mode: 'multiple',
options: [ // options: [
{ label: 'INCEPTOR', value: 'INCEPTOR' }, // { label: 'INCEPTOR', value: 'INCEPTOR' },
{ label: 'IMPALA', value: 'IMPALA' }, // { label: 'IMPALA', value: 'IMPALA' },
{ label: 'MYSQL', value: 'MYSQL' }, // { label: 'MYSQL', value: 'MYSQL' },
], // ],
}, // },
required: true, // required: true,
}, // },
{ {
field: 'model', field: 'model',
label: '目录权属模式', label: '目录权属模式',
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
return treeData !== '' ? treeData : data; return treeData !== '' ? treeData : data;
} }
const getTitle = computed(() => (!unref(isUpdate) ? '新建主体' : '编辑主体')); const getTitle = computed(() => (!unref(isUpdate) ? '新建shell文件' : '编辑shell文件'));
async function handleSubmit() { async function handleSubmit() {
try { try {
......
...@@ -79,7 +79,7 @@ export const formSchemaNewFolder: any = [ ...@@ -79,7 +79,7 @@ export const formSchemaNewFolder: any = [
component: 'TreeSelect', component: 'TreeSelect',
rules: [ rules: [
{ {
required: true, required: false,
message: '请选择上级菜单', message: '请选择上级菜单',
}, },
], ],
...@@ -96,6 +96,12 @@ export const formSchemaNewFolder: any = [ ...@@ -96,6 +96,12 @@ export const formSchemaNewFolder: any = [
field: 'name', field: 'name',
label: '文件夹名称', label: '文件夹名称',
component: 'Input', component: 'Input',
rules: [
{
required: true,
message: '请输入文件夹名称',
},
],
colProps: { span: 8 }, colProps: { span: 8 },
componentProps: { componentProps: {
placeholder: '输入文件夹名称', placeholder: '输入文件夹名称',
......
<template> <template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<div class="w-1/4 xl:w-1/5"> <div class="w-1/4 xl:w-1/5">
<DataTree @select="handleSelect" style="height: 50%" /> <DataTree @select="handleSelect" style="height: 100%" />
<GroupTree @select="handleGroupSelect" style="height: 50%" /> <!-- <GroupTree @select="handleGroupSelect" style="height: 50%" /> -->
</div> </div>
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo"> <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleImport">导入</a-button> <Tooltip title="复制" placement="top">
<a-button <a-button type="primary" @click="handleMove.bind(null, 0, record)">
:disabled="getRowSelection().selectedRowKeys <= 0" <Icon icon="majesticons:duplicate-line" :size="20" />
type="primary" </a-button>
@click="handleExport" </Tooltip>
>导出</a-button
> <Tooltip title="移动" placement="top">
<!-- 新建文件夹--> <a-button type="primary" @click="handleMove.bind(null, 1, record)">
<a-button type="primary" style="margin-right: 10px" @click="handleAddFolder" <Icon icon="majesticons:arrow-right" :size="20" />
><Icon icon="majesticons:folder-add-line" :size="20" </a-button>
/></a-button> </Tooltip>
<a-button type="primary" @click="handleAddTemplate"
><Icon icon="majesticons:file-add-line" :size="20" <Tooltip title="删除" placement="top">
/></a-button> <a-button type="primary" @click="deleteButton.bind(null, record, 1)">
<Icon icon="majesticons:trash-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="导入" placement="top">
<a-button type="primary" @click="handleImport">
<Icon icon="majesticons:cloud-upload-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="导出" placement="top">
<a-button
:disabled="getRowSelection().selectedRowKeys <= 0"
type="primary"
@click="handleExport"
>
<Icon icon="majesticons:cloud-download-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="新建文件夹" placement="top">
<a-button type="primary" style="margin-right: 10px" @click="handleAddFolder">
<Icon icon="majesticons:folder-add-line" :size="20" />
</a-button>
</Tooltip>
<Tooltip title="新建文件" placement="top">
<a-button type="primary" @click="handleAddTemplate">
<Icon icon="majesticons:file-add-line" :size="20" />
</a-button>
</Tooltip>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction
:actions="[ :actions="[
// { {
// label: '编辑', label: '编辑',
// onClick: handleEdit.bind(null, record, 0), onClick: handleGroupSelect.bind(null, record, 0),
// }, },
{ {
label: '复制', label: '复制',
onClick: handleMove.bind(null, 0, record), onClick: handleMove.bind(null, 0, record),
...@@ -54,13 +80,14 @@ ...@@ -54,13 +80,14 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Tooltip } from 'ant-design-vue';
import { reactive, onMounted } from 'vue'; import { reactive, onMounted } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { getRoleListByPage, deleteById, exportRoleList } from '@/api/system/role/role'; import { getRoleListByPage, deleteById, exportRoleList } from '@/api/system/role/role';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import DataTree from './DataTree.vue'; import DataTree from './DataTree.vue';
import GroupTree from './GroupTree.vue'; // import GroupTree from './GroupTree.vue';
import { DataTreeData } from './sqlDevelopmentData'; import { DataTreeData } from './sqlDevelopmentData';
import { columns, searchFormSchema } from './data'; import { columns, searchFormSchema } from './data';
import { router } from '@/router'; import { router } from '@/router';
...@@ -72,6 +99,8 @@ ...@@ -72,6 +99,8 @@
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { downloadByData } from '@/utils/file/download'; import { downloadByData } from '@/utils/file/download';
import { tooltipProps } from 'ant-design-vue/es/tooltip';
defineOptions({ name: 'AccountManagement' }); defineOptions({ name: 'AccountManagement' });
const searchInfo = reactive<Recordable>({}); const searchInfo = reactive<Recordable>({});
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
contentClass="flex" contentClass="flex"
@back="goBack" @back="goBack"
> >
<GroupTree @select="handleSelect" class="w-1/4 xl:w-1/5" /> <!-- <GroupTree @select="handleSelect" class="w-1/4 xl:w-1/5" /> -->
<div class="w-3/4 xl:w-4/5" style="padding-top: 20px"> <div class="w-full xl:w-full" style="padding-top: 20px">
<BasicForm @register="registerForm"> <BasicForm @register="registerForm">
<template #formFooter> <template #formFooter>
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between; margin-left: 500px">
<!-- 新窗口运行--> <!-- 新窗口运行-->
<Tooltip placement="top" title="新窗口运行"> <!-- <Tooltip placement="top" title="新窗口运行">
<a-button <a-button
type="primary" type="primary"
style="margin-right: 10px; margin-left: 500px" style="margin-right: 10px; margin-left: 500px"
...@@ -21,21 +21,21 @@ ...@@ -21,21 +21,21 @@
> >
<Icon icon="si:play-forward-duotone" :size="20" /> <Icon icon="si:play-forward-duotone" :size="20" />
</a-button> </a-button>
</Tooltip> </Tooltip> -->
<!-- 运行--> <!-- 运行-->
<Tooltip placement="top" title="运行"> <!-- <Tooltip placement="top" title="运行">
<a-button type="primary" style="margin-right: 10px" @click="handleExecute"> <a-button type="primary" style="margin-right: 10px" @click="handleExecute">
<Icon icon="si:play-line" :size="20" /> <Icon icon="si:play-line" :size="20" />
</a-button> </a-button>
</Tooltip> </Tooltip> -->
<!-- 执行记录--> <!-- 执行记录-->
<Tooltip placement="top" title="执行记录"> <!-- <Tooltip placement="top" title="执行记录">
<a-button type="primary" style="margin-right: 10px" @click="handleRecord"> <a-button type="primary" style="margin-right: 10px" @click="handleRecord">
<Icon icon="si:clock-alt-line" :size="20" /> <Icon icon="si:clock-alt-line" :size="20" />
</a-button> </a-button>
</Tooltip> </Tooltip> -->
<!-- 提交版本--> <!-- 提交版本-->
<Tooltip placement="top" title="提交版本"> <Tooltip placement="top" title="提交版本">
......
...@@ -3,7 +3,7 @@ export const DataTreeData: any[] = [ ...@@ -3,7 +3,7 @@ export const DataTreeData: any[] = [
delFlag: '0', delFlag: '0',
flag: '1', flag: '1',
businessId: 100, businessId: 100,
workSpaceName: 'SQL文件', workSpaceName: 'SHELL文件',
parentId: 0, parentId: 0,
code: '001', code: '001',
ancestors: '0', ancestors: '0',
......
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