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

修改sql审核

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