Commit 7b697b1a authored by 罗林杰's avatar 罗林杰

修改sql审核

parent d4558328
<template>
<div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree
ref="treeRef2"
ref="treeRef"
toolbar
search
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
......@@ -10,52 +10,47 @@
:treeData="treeDataTwo"
:fieldNames="{ key: 'selectedDeptId', title: 'label' }"
@select="handleSelect"
/>
</div>
</template>
<script lang="ts" setup>
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { Nullable } from '@vben/types';
import { treeDataList, treeDataListTwo } from './mock';
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { Nullable } from '@vben/types';
import { treeDataList, treeDataListTwo } from './mock';
defineOptions({ name: 'DeptTree' });
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select']);
const emit = defineEmits(['select']);
const treeData = ref<TreeItem[]>([]);
const treeDataTwo = ref<TreeItem[]>([]);
const treeRef1 = ref<Nullable<TreeActionType>>(null);
const treeRef2 = ref<Nullable<TreeActionType>>(null);
const treeData = ref<TreeItem[]>([]);
const treeDataTwo = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
async function fetch() {
async function fetch() {
treeData.value = treeDataList;
treeDataTwo.value = treeDataListTwo;
await nextTick(() => {
getTree(treeRef1).expandAll(true);
getTree(treeRef2).expandAll(true);
getTree(treeRef).expandAll(true);
});
}
}
function getTree(treeRef) {
function getTree(treeRef) {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
}
function handleSelect(selectedDeptId) {
function handleSelect(selectedDeptId) {
emit('select', selectedDeptId[0]);
console.log('selectedDeptId:', selectedDeptId);
}
}
onMounted(() => {
onMounted(() => {
fetch();
});
});
</script>
<template>
<div class=" m-4 mr-0 overflow-hidden bg-white">
<a-input placeholder="" style="margin: 10px 0;">
<div class="m-4 mr-0 overflow-hidden bg-white">
<a-input placeholder="" style="margin: 10px 0">
<template #prefix>
<Icon icon="ant-design:search-outlined" :size="20" />
</template>
</a-input>
<BasicTree
ref="treeRef2"
ref="treeRef"
toolbar
search
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
......@@ -15,42 +15,38 @@
:treeData="treeDataTwo"
:fieldNames="{ key: 'selectedDeptId', title: 'name' }"
@select="handleSelect"
/>
</div>
</template>
<script lang="ts" setup>
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { nextTick, onMounted, ref, unref } from 'vue';
import { BasicTree, TreeActionType, TreeItem } from '@/components/Tree';
import { Nullable } from '@vben/types';
import { treeDataList, treeDataListTwo } from './mock';
import { tableList } from './mock'
import Icon from "@/components/Icon/Icon.vue";
import { Nullable } from '@vben/types';
import { treeDataList, treeDataListTwo, tableList } from './mock';
import Icon from '@/components/Icon/Icon.vue';
defineOptions({ name: 'DeptTree' });
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select']);
const emit = defineEmits(['select']);
const treeData = ref<TreeItem[]>([]);
const treeDataTwo = ref<TreeItem[]>([]);
const treeRef1 = ref<Nullable<TreeActionType>>(null);
const treeRef2 = ref<Nullable<TreeActionType>>(null);
const treeData = ref<TreeItem[]>([]);
const treeDataTwo = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
async function fetch() {
async function fetch() {
// 合并树形数据和表格数据
treeData.value = mergeTreeDataWithTableList(treeDataListTwo, tableList);
treeData.value = treeDataList;
treeDataTwo.value = treeDataListTwo;
await nextTick(() => {
getTree(treeRef1).expandAll(true);
getTree(treeRef2).expandAll(true);
getTree(treeRef).expandAll(true);
});
}
}
// 合并数据的函数
function mergeTreeDataWithTableList(treeDataListTwo, tableList) {
// 合并数据的函数
function mergeTreeDataWithTableList(treeDataListTwo, tableList) {
return treeDataListTwo.map((treeNode) => {
// 找到对应的tableList项,合并name属性
const tableItem = tableList.find((item) => item.selectedDeptId === treeNode.selectedDeptId);
......@@ -65,23 +61,22 @@ function mergeTreeDataWithTableList(treeDataListTwo, tableList) {
return treeNode;
});
}
}
function getTree(treeRef) {
function getTree(treeRef) {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
}
function handleSelect(selectedDeptId) {
function handleSelect(selectedDeptId) {
emit('select', selectedDeptId[0]);
console.log('selectedDeptId:', selectedDeptId);
}
}
onMounted(() => {
onMounted(() => {
fetch();
});
});
</script>
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex flex-col" class="mt-4 ml-3">
<div class="toolbar" style="background: white">
<div style="display: flex; align-items: center">
<div class="flex overflow-auto">
<div style="background: white">
<div style="display: flex; align-items: center; padding-left: 20px">
<Icon icon="majesticons:table-plus-line" :size="40" :color="'#e9a064'" />
<div style="margin-left: 10px">
<span class="title">test</span>
......@@ -9,26 +9,28 @@
<span class="path">自助建表文件/test</span>
</div>
</div>
</div>
<a-button type="primary" style="float: right; margin: 10px 15px 10px 0" @click="handleSave"
<a-button
type="primary"
style="float: right; margin: 10px 15px 10px 900px"
@click="handleSave"
>保存</a-button
>
<a-button type="primary" style="float: right; margin: 10px 15px 10px 0" @click="sqlStatement"
<a-button
type="primary"
style="float: right; margin: 10px 15px 10px 0"
@click="sqlStatement"
>生成建表语句</a-button
>
</div>
<BasicForm
style="background: white; margin-top: 20px"
size="middle"
:bordered="false"
:column="2"
style="background: white; margin-top: 20px; margin-left: 20px"
@register="registerGuideModeForm"
>
<template #tableConfiguration>
<h1 class="title-text">表配置</h1>
</template>
</BasicForm>
</div>
<div class="mt-2">
<div style="margin-left: 20px">
<BasicTable @register="registerTable">
<template #sort>
<Icon icon="icon-park-outline:drag" />
......@@ -53,41 +55,54 @@
<div style="background: white">
<a-button type="primary" style="margin-left: 5px" @click="addFields">添加字段</a-button>
</div>
<BasicForm style="background: white" @register="partitionConfigurationTemplate">
<template #tableConfiguration>
<h1
class="title-text"
style="width: 525px; margin-bottom: -30px; margin-top: 3px; margin-left: 20px"
>分区配置</h1
>
</template>
<template #delete>
<Icon icon="ant-design:delete-outlined" :size="25" />
</template>
<template #addBtn>
<a-button type="primary" style="margin-left: 100px; margin-top: -10px"
>添加分区键</a-button
>
</template>
</BasicForm>
</div>
<BasicForm
style="background: white"
size="middle"
:bordered="false"
:column="2"
class="mt-2"
@register="partitionConfigurationTemplate"
@register="bucketingForm"
>
<template #tableConfiguration>
<h1 class="title-text" style="width: 525px; margin-bottom: -30px; margin-top: 3px"
>分区配置</h1
>
<h1 class="title-text" style="margin-bottom: -30px; margin-top: 10px; margin-left: 520px"
<h1
class="title-text"
style="width: 525px; margin-bottom: -30px; margin-top: 3px; margin-left: 20px"
>分桶配置</h1
>
</template>
<template #delete>
<Icon icon="ant-design:delete-outlined" :size="25" />
</template>
</BasicForm>
<div style="background: white">
<a-button type="primary" style="margin-left: 5px; margin-top: -10px">添加分区键</a-button>
</div>
</div>
<generateTableBuildingStatementsMode @register="registerModal" />
<addFieldsModal @register="FieldsModal" />
</PageWrapper>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { PageWrapper } from '@/components/Page';
import { fieldConfigurationList } from './mock';
import { fieldConfiguration, personSchema, personSchemaTwo } from './mainBody.data';
import {
bucketingSchema,
fieldConfiguration,
personSchema,
personSchemaTwo,
} from './mainBody.data';
import { BasicForm, useForm } from '@/components/Form';
import { BasicTable, TableAction, useTable } from '@/components/Table';
import Icon from '@/components/Icon/Icon.vue';
......@@ -217,7 +232,7 @@
}
const [registerGuideModeForm] = useForm({
labelWidth: 100,
labelWidth: 80,
schemas: personSchema,
showActionButtonGroup: false,
actionColOptions: {
......@@ -226,22 +241,29 @@
});
const [partitionConfigurationTemplate] = useForm({
labelWidth: 100,
labelWidth: 80,
schemas: personSchemaTwo,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [bucketingForm] = useForm({
labelWidth: 80,
schemas: bucketingSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
</script>
<style scoped>
.title-text {
font-weight: bold;
margin-top: 0;
font-size: 20px;
color: #1a1a1a;
width: 313px;
margin-left: 38px;
}
.title {
font-size: 16px;
......
......@@ -13,6 +13,9 @@
style="width: 70%; height: 250px; margin-left: 30px; border: black 1px solid"
></textarea>
</div>
<template #footer>
<a-button type="primary" @click="handleSubmit">关闭</a-button>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
......@@ -40,7 +43,6 @@
try {
setModalProps({ confirmLoading: true });
closeModal();
createMessage.success('生成成功');
emit('success', { isUpdate: unref(isUpdate) });
} finally {
setModalProps({ confirmLoading: false });
......
......@@ -2,7 +2,6 @@
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<editAuditRulesModal
style="background: #cc0000"
class="m-4 mr-0 w-3/4 xl:w-4/5"
v-if="isSpecificDeptSelected"
:deptId="selectedDeptId"
......
......@@ -111,9 +111,8 @@ export const personSchemaTwo: FormSchema[] = [
component: 'RadioGroup',
label: '分区类型',
colProps: {
span: 12,
span: 24,
},
componentProps: {
options: [
{
......@@ -127,19 +126,10 @@ export const personSchemaTwo: FormSchema[] = [
],
},
},
{
field: 'bucketButton',
label: '分桶键',
colProps: { lg: 11, md: 11 },
component: 'Input',
itemProps: {
extra: '分桶 键尽量选值域均匀、重复率不高的字段',
},
},
{
field: 'giveAnExample',
label: '分区健',
colProps: { lg: 9, md: 9 },
colProps: { lg: 12, md: 12 },
component: 'Input',
itemProps: {
extra: '建议分区键选择日期字段或地区字段',
......@@ -168,12 +158,6 @@ export const personSchemaTwo: FormSchema[] = [
field: 'partitionKeyDeletion',
slot: 'delete',
},
{
field: 'numberOfBucketsDivided',
label: '分桶个数',
colProps: { lg: 11, md: 11 },
component: 'Input',
},
{
field: 'partitionHealth',
label: '分区键',
......@@ -211,6 +195,33 @@ export const personSchemaTwo: FormSchema[] = [
field: 'partitionKeyDeletion',
slot: 'delete',
},
{
field: 'addBtn',
slot: 'addBtn',
colProps: { lg: 24, md: 24 },
},
];
export const bucketingSchema: FormSchema[] = [
{
field: 'tableConfiguration',
slot: 'tableConfiguration',
colProps: { lg: 13, md: 13 },
},
{
field: 'bucketButton',
label: '分桶键',
colProps: { lg: 13, md: 13 },
component: 'Input',
itemProps: {
extra: '分桶 键尽量选值域均匀、重复率不高的字段',
},
},
{
field: 'numberOfBucketsDivided',
label: '分桶个数',
colProps: { lg: 13, md: 13 },
component: 'Input',
},
];
export const personSchema: FormSchema[] = [
......@@ -224,9 +235,6 @@ export const personSchema: FormSchema[] = [
component: 'RadioGroup',
label: '表所有权',
colProps: { lg: 24, md: 24 },
// itemProps: {
// extra: '客户、邀评人默认被分享',
// },
componentProps: {
options: [
{
......
......@@ -6,7 +6,7 @@
</template>
</a-input>
<BasicTree
ref="treeRef2"
ref="treeRef"
toolbar
search
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
......@@ -33,16 +33,14 @@
const treeData = ref<TreeItem[]>([]);
const treeDataTwo = ref<TreeItem[]>([]);
const treeRef1 = ref<Nullable<TreeActionType>>(null);
const treeRef2 = ref<Nullable<TreeActionType>>(null);
const treeRef = ref<Nullable<TreeActionType>>(null);
async function fetch() {
// 合并树形数据和表格数据
treeData.value = mergeTreeDataWithTableList(treeDataListTwo, tableList);
treeDataTwo.value = treeDataListTwo;
await nextTick(() => {
getTree(treeRef1).expandAll(true);
getTree(treeRef2).expandAll(true);
getTree(treeRef).expandAll(true);
});
}
......
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<PageWrapper
dense
contentFullHeight
......@@ -9,15 +8,24 @@
style="width: 910px"
>
<div class="toolbar" style="background: white">
<div style="display: flex; align-items: center">
<Icon icon="majesticons:table-plus-line" :size="40" :color="'#e9a064'" />
<div style="margin-left: 10px">
<span class="title">{{ info.name }}</span>
<div>
<span class="path">审核规则</span>
</div>
</div>
<div class="tools">
<a-button
@click="handleSave"
type="primary"
style="float: right; margin: 10px 15px 10px 0"
style="float: right; margin: 10px 15px 10px 1000px"
>保存</a-button
>
</div>
</div>
</div>
<BasicForm
style="background: white"
size="middle"
......@@ -43,7 +51,6 @@
</template>
</BasicForm>
</PageWrapper>
</PageWrapper>
</template>
<script lang="ts" setup>
......@@ -55,6 +62,7 @@
import CodeEditor from '@/components/CodeEditor/src/CodeEditor.vue';
import { Alert } from 'ant-design-vue';
import { useMessage } from '@/hooks/web/useMessage';
import Icon from '@/components/Icon/Icon.vue';
const { createMessage } = useMessage();
const isCheck = ref('false');
......@@ -112,4 +120,12 @@
height: 162px;
display: flex;
}
.title {
font-size: 16px;
font-weight: 500;
}
.path {
font-size: 14px;
color: gray;
}
</style>
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<div class="m-4 mr-0 w-3/4 xl:w-4/5">
<editAuditRulesModal
style="background: #cc0000"
class="m-4 mr-0 w-3/4 xl:w-4/5"
v-if="isSpecificDeptSelected"
:deptId="selectedDeptId"
/>
<BasicTable @register="registerTable" :searchInfo="searchInfo" v-else>
<div class="w-3/4 xl:w-4/5 m-4 mr-0" v-else>
<div style="display: flex; align-items: center; background-color: white">
<Icon icon="majesticons:table-plus-line" :size="40" :color="'#e9a064'" />
<div style="margin-left: 10px">
<span class="title">错误问题规则</span>
<div>
<span class="path">审核规则</span>
</div>
</div>
<a-button
style="margin-left: 800px"
type="primary"
:disabled="isDisabled === true"
@click="handleDeleteIds"
>删除</a-button
>
<a-button
style="margin-left: 10px"
type="primary"
:disabled="isDisabled === true"
@click="handleMove(1)"
>移动</a-button
>
<a-button style="margin-left: 10px" type="primary" @click="handleNewFolder"
>新建文件夹</a-button
>
<a-button style="margin-left: 10px" type="primary" @click="handleNewFile"
>新建文件</a-button
>
</div>
<BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
......@@ -35,22 +65,12 @@
/>
</template>
</template>
<template #headerTop>
<div style="display: flex; justify-content: space-between">
<span class="text-lg font-semibold">审核规则</span>
<div>
<a-button style="margin-right: 10px" @click="handleDeleteIds">删除</a-button>
<a-button style="margin-right: 10px" type="primary" @click="handleMove(1)"
>移动</a-button
>
<a-button style="margin-right: 10px" type="primary" @click="handleNewFolder(1)"
>新建文件夹</a-button
>
<a-button style="margin-right: 10px" type="primary" @click="handleNewFile(0)"
>新建文件</a-button
>
</div>
</div>
<template #toolbar>
<a-input
style="width: 200px; margin-right: auto"
placeholder="输入关键字搜索"
allowClear
/>
</template>
</BasicTable>
</div>
......@@ -60,7 +80,7 @@
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive, computed, ref } from 'vue';
import { reactive, computed, ref, onMounted } from 'vue';
import { BasicTable, TableAction, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import DeptTree from './DeptTree.vue';
......@@ -72,6 +92,7 @@
import MoveFile from './moveFile.vue';
import AddFile from './addFile.vue';
import Rename from './renameModal.vue';
import Icon from '@/components/Icon/Icon.vue';
defineOptions({ name: 'AccountManagement' });
......@@ -81,12 +102,13 @@
});
const selectedDeptId = ref<string | null>(null);
const searchInfo = reactive<Recordable>({});
const isDisabled = ref();
const [registerMoveFile, { openModal: openMoveFileModal }] = useModal();
const [registerAddFile, { openModal: openAddFileModal }] = useModal();
const [registerRename, { openModal: openRenameModal }] = useModal();
const [registerTable] = useTable({
const [registerTable, { getRowSelection }] = useTable({
title: ' ',
api: async () => {
const response = {
......@@ -101,17 +123,13 @@
return { ...response };
},
rowKey: 'businessId',
rowKey: 'selectedDeptId',
columns,
formConfig: {
labelWidth: 10,
schemas: searchFormSchema,
showActionButtonGroup: false,
autoSubmitOnEnter: true,
rowSelection: {
type: 'checkbox',
onChange: onSelectionChange,
},
rowSelection: true,
useSearchForm: true,
useSearchForm: false,
showIndexColumn: false,
showTableSetting: false,
bordered: true,
......@@ -161,8 +179,26 @@
},
});
}
function onSelectionChange() {
isDisabled.value = getRowSelection().selectedRowKeys <= 0;
}
onMounted(() => {
isDisabled.value = true;
});
// 处理选择节点事件
const handleSelect = (deptId) => {
selectedDeptId.value = deptId;
};
</script>
<style scoped>
.title {
font-size: 16px;
font-weight: 500;
}
.path {
font-size: 14px;
color: gray;
}
</style>
......@@ -59,5 +59,6 @@ export const importFormSchema: any[] = [
{ label: '自动重命名', value: '3' },
],
},
defaultValue: '1',
},
];
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