Commit c5bcaa12 authored by baiyinhao's avatar baiyinhao

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

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