Commit 2872f9ba authored by LiXuyang's avatar LiXuyang

Merge remote-tracking branch 'origin/master'

parents 2516c0c6 9937e0c5
...@@ -529,7 +529,8 @@ ...@@ -529,7 +529,8 @@
tabularPresentationColumns, tabularPresentationColumns,
compareColumns, compareColumns,
tabularPresentationSearchFormSchema, tabularPresentationSearchFormSchema,
compareSearchFormSchema, noConfigurationColumns, compareSearchFormSchema,
noConfigurationColumns,
} from './offlineLoading.data'; } from './offlineLoading.data';
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
...@@ -1065,10 +1066,10 @@ ...@@ -1065,10 +1066,10 @@
componentProps: ({ formModel, formActionType }) => ({ componentProps: ({ formModel, formActionType }) => ({
onChange: () => { onChange: () => {
isAutomaticTableConstructionFlag.value = formModel.isAutomaticTableConstruction === '是'; isAutomaticTableConstructionFlag.value = formModel.isAutomaticTableConstruction === '是';
if(isAutomaticTableConstructionFlag.value){ if (isAutomaticTableConstructionFlag.value) {
setColumns(configurationColumns); setColumns(configurationColumns);
reload(); reload();
}else { } else {
setColumns(noConfigurationColumns); setColumns(noConfigurationColumns);
reload(); reload();
} }
......
<template>
<div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree
ref="treeRef"
toolbar
search
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
:clickRowToExpand="false"
:defaultExpandAll="true"
:treeData="treeData"
: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 { Nullable } from '@vben/types';
import { tableList, treeDataList } from './mock';
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select']);
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
// 合并数据的函数
function mergeTreeDataWithTableList(treeDataList, tableList) {
return treeDataList.map((treeNode) => {
// 找到对应的tableList项,合并name属性
const tableItem = tableList.find((item) => item.selectedDeptId === treeNode.selectedDeptId);
if (tableItem) {
treeNode.name = tableItem.name; // 将tableList中的name添加到treeNode
}
// 如果有子节点,递归处理
if (treeNode.children && treeNode.children.length > 0) {
treeNode.children = mergeTreeDataWithTableList(treeNode.children, tableList);
}
return treeNode;
});
}
async function fetch() {
// 合并树形数据和表格数据
treeData.value = mergeTreeDataWithTableList(treeDataList, tableList);
await nextTick(() => {
getTree(treeRef).expandAll(true);
});
}
function getTree(treeRef) {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
function handleSelect(selectedDeptId) {
emit('select', selectedDeptId[0]);
console.log('selectedDeptId:', selectedDeptId);
}
onMounted(() => {
fetch();
});
</script>
...@@ -9,18 +9,28 @@ ...@@ -9,18 +9,28 @@
:title="title" :title="title"
> >
<template #closeIcon> <template #closeIcon>
<span></span> <span @click="submitForm"></span>
</template> </template>
<template #title> <template #title>
<div class="toolbar"> <div class="toolbar">
<div <div
style="display: flex; align-items: center; justify-content: space-between; width: 100%" style="display: flex; align-items: center; justify-content: space-between; width: 100%"
> >
<h3 style="margin-top: 15px">{{ title }}</h3> <div style="display: flex; gap: 3px; align-items: center">
<Icon
icon="ep:arrow-left-bold"
:size="20"
style="margin-right: 5px; cursor: pointer"
:color="'#a3a7b1'"
@click="closeModal"
/>
<Icon icon="fa:table" :size="20" style="margin-right: 5px" :color="'#2fb1c2'" />
<span>{{ title }}</span>
</div>
<div style="display: flex; gap: 15px"> <div style="display: flex; gap: 15px">
<a-button type="primary" @click="closeModal">取消</a-button> <a-button type="primary" @click="testForm">申请检测</a-button>
<a-button type="primary">申请检测</a-button>
<a-button type="primary" @click="submitForm"> 提交申请 </a-button> <a-button type="primary" @click="submitForm"> 提交申请 </a-button>
<a-button type="primary" @click="closeModal">取消</a-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -51,26 +61,33 @@ ...@@ -51,26 +61,33 @@
import { ref } from 'vue'; import { ref } from 'vue';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
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 [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
if (data.length >= 1) {
title.value = '申请批量推送<' + data[0].title + '>等' + data.length + '资源';
} else {
title.value = '申请推送<' + data.title + '>资源';
}
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
}); });
const title = ref('申请推送<wyx_contact>等1个资源'); const title = ref('申请推送等1个资源');
const [registerGuideModeForm, { validate, getFieldsValue: getFieldsValueValiate }] = useForm({ const [registerGuideModeForm, { validate, getFieldsValue: getFieldsValueValiate, submit }] =
labelWidth: 100, useForm({
labelAlign: 'right', labelWidth: 100,
schemas: personSchema, labelAlign: 'right',
showActionButtonGroup: false, schemas: personSchema,
actionColOptions: { showActionButtonGroup: false,
span: 23, actionColOptions: {
}, span: 23,
}); },
});
const [ const [
pushConfigurationModeForm, pushConfigurationModeForm,
{ validate: validatePushConfig, getFieldsValue: getFieldsValueValiateL }, { validate: validatePushConfig, getFieldsValue: getFieldsValueValiateL, submit: submit2 },
] = useForm({ ] = useForm({
labelWidth: 100, labelWidth: 100,
labelAlign: 'right', labelAlign: 'right',
...@@ -82,17 +99,33 @@ ...@@ -82,17 +99,33 @@
}); });
// 提交表单的方法 // 提交表单的方法
const submitForm = () => { async function submitForm() {
validate(); try {
validatePushConfig() // 并行执行两个验证函数
.then(() => { await Promise.all([validate(), validatePushConfig()]);
console.log(getFieldsValueValiate(), getFieldsValueValiateL()); await submit();
createMessage.success(`表单已提交`); await submit2();
}) createMessage.success('检测通过');
.catch(() => { } catch (error) {
createMessage.error(`请输入必填项`); // 显示错误消息并记录错误详情(仅限开发环境)
}); const errorMessage = error?.message || '请输入必填项';
}; createMessage.error(errorMessage);
}
}
// 检测表单的方法
async function testForm() {
try {
// 并行执行两个验证函数
await Promise.all([validate(), validatePushConfig()]);
// 如果所有验证都通过,则显示成功消息
createMessage.success('检测通过');
} catch (error) {
// 显示错误消息并记录错误详情(仅限开发环境)
const errorMessage = error?.message || '请输入必填项';
createMessage.error(errorMessage);
}
}
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped></style>
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex" >
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<editAuditRulesModal
style="background: #cc0000;"
class="w-3/4 xl:w-4/5"
v-if="isSpecificDeptSelected"
/>
<BasicTable
@register="registerTable"
class="w-3/4 xl:w-4/5"
:searchInfo="searchInfo"
v-else
>
<template #toolbar>
<a-input style="width: 200px; margin-right: auto" placeholder="输入关键字搜索" allowClear />
<a-button type="primary" @click="pushNotifications">推送</a-button>
<a-button type="primary">下载</a-button>
</template>
</BasicTable>
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive, computed } from 'vue';
import {BasicTable, useTable} from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import DeptTree from './DeptTree.vue';
import { ref } from 'vue';
import {columnInformationList} from './mock';
import { columns } from './commonDataSet.data';
import EditAuditRulesModal from "./editAuditRulesModal.vue";
import {router} from "@/router";
defineOptions({ name: 'AccountManagement' });
const isSpecificDeptSelected = computed(() => {
return [23, 24, 25].includes(selectedDeptId.value);
});
// 选中的部门ID
const selectedDeptId = ref<string | null>(null);
const searchInfo = reactive<Recordable>({});
const [
registerTable,
{ },
] = useTable({
api: async (params) => {
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: columnInformationList.length,
code: '',
message: '',
data: columnInformationList,
};
return { ...response };
},
rowKey: 'businessId',
columns,
formConfig: {
labelWidth: 10,
autoSubmitOnEnter: true,
},
rowSelection: false,
useSearchForm: false,
showIndexColumn: false,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
console.log('handleSearchInfoFn', info);
return info;
},
});
/**推送*/
function pushNotifications() {
router.push({
path: '/mallResourceDevelopment/dataSet/commonDataSet/applyForPushNotificationsModal',
query: {},
});
}
// 处理选择节点事件
const handleSelect = (deptId) => {
selectedDeptId.value = deptId;
console.log('选择节点selectedDeptId:', deptId);
}
</script>
<template>
<Tabs v-model:activeKey="key">
<TabPane key="1" tab="源端配置">
<editAuditRulesModal style="background: #cc0000" class="w-3/4 xl:w-4/5"
/></TabPane>
<TabPane key="2" tab="源端配置"
><BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar>
<a-input
style="width: 200px; margin-right: auto"
placeholder="输入关键字搜索"
allowClear
/>
<a-button type="primary" @click="pushNotifications">推送</a-button>
<a-button type="primary">下载</a-button>
</template>
</BasicTable>
</TabPane>
</Tabs>
</template>
<script lang="ts" setup>
import { Tabs, TabPane, Alert, Modal } from 'ant-design-vue';
import { reactive, computed, ref } from 'vue';
import { BasicTable, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { columnInformationList } from './mock';
import { columns } from './commonDataSet.data';
import EditAuditRulesModal from './editAuditRulesModal.vue';
import { router } from '@/router';
defineOptions({ name: 'AccountManagement' });
const key = ref('1');
const searchInfo = reactive<Recordable>({});
const [registerTable, {}] = useTable({
api: async (params) => {
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: columnInformationList.length,
code: '',
message: '',
data: columnInformationList,
};
return { ...response };
},
rowKey: 'businessId',
columns,
formConfig: {
labelWidth: 10,
autoSubmitOnEnter: true,
},
rowSelection: false,
useSearchForm: false,
showIndexColumn: false,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
console.log('handleSearchInfoFn', info);
return info;
},
});
/**推送*/
function pushNotifications() {
router.push({
path: '/mallResourceDevelopment/dataSet/commonDataSet/applyForPushNotificationsModal',
query: {},
});
}
</script>
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
</div> </div>
</template> </template>
<template #headerCell="{ column, title }"> <template #headerCell="{ column, title }">
<span>{{ title }}</span <span>{{ title }}</span
><br /> ><br />
<Tag color="orange" v-if="column.key != 'origin_city'" >{{ '敏感' }}</Tag> <Tag color="orange" v-if="column.key != 'origin_city'">{{ '敏感' }}</Tag>
<span style="font-size: 12px" >{{ column.type }}</span> <span style="font-size: 12px">{{ column.type }}</span>
</template> </template>
<template #toolbar> <template #toolbar>
<a-input style="width: 200px; margin-right: auto" placeholder="输入关键字搜索" allowClear /> <a-input style="width: 200px; margin-right: auto" placeholder="输入关键字搜索" allowClear />
<a-button type="primary" @click="pushNotifications">推送</a-button> <a-button type="primary" @click="pushNotifications">推送</a-button>
<a-button type="primary">下载</a-button> <a-button type="primary">下载</a-button>
</template> </template>
</BasicTable> </BasicTable>
...@@ -32,10 +32,8 @@ ...@@ -32,10 +32,8 @@
import { BasicTable, useTable } from '@/components/Table'; import { BasicTable, useTable } from '@/components/Table';
import { Switch, Tag } from 'ant-design-vue'; import { Switch, Tag } from 'ant-design-vue';
import { import { samplingInfoData } from './commonDataSet.data';
samplingInfoData, import { router } from '@/router';
} from './commonDataSet.data';
import {router} from "@/router";
const infoDataColumns: { dataIndex: string; width: number; title: string }[] = [ const infoDataColumns: { dataIndex: string; width: number; title: string }[] = [
{ {
...@@ -119,10 +117,9 @@ ...@@ -119,10 +117,9 @@
data: [], data: [],
}; };
//过滤data中的数据,取出等于params.deptId的数据 //过滤data中的数据,取出等于params.deptId的数据
let data = samplingInfoData.filter((item) => item.parentId !== 0); // 根据需求过滤数据 let data = samplingInfoData.filter((item) => item.parentId !== 0); // 根据需求过滤数据
data = data.map((item) =>{ data = data.map((item) => {
const transformedItem = { ...item }; const transformedItem = { ...item };
// 遍历每个字段,将除了 origin_city 外的字段替换成 '*' // 遍历每个字段,将除了 origin_city 外的字段替换成 '*'
...@@ -140,7 +137,6 @@ ...@@ -140,7 +137,6 @@
pagination: false, pagination: false,
showIndexColumn: false, showIndexColumn: false,
scroll: { y: 400 }, scroll: { y: 400 },
}); });
</script> </script>
......
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex" >
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<editAuditRulesModal
style="background: #cc0000;"
class="w-3/4 xl:w-4/5"
v-if="isSpecificDeptSelected"
/>
<BasicTable
@register="registerTable"
class="w-3/4 xl:w-4/5"
:searchInfo="searchInfo"
v-else
>
<template #toolbar>
<a-input style="width: 200px; margin-right: auto" placeholder="输入关键字搜索" allowClear />
<a-button type="primary">新建文件夹</a-button>
<a-button type="primary">新建文件</a-button>
</template>
</BasicTable>
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive, computed } from 'vue';
import {BasicTable, useTable} from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import DeptTree from './DeptTree.vue';
import { ref } from 'vue';
import {columnInformationList} from './mock';
import { columns } from './commonDataSet.data';
import EditAuditRulesModal from "@/views/scriptDevelopment/sqlAudit/editAuditRulesModal.vue";
defineOptions({ name: 'AccountManagement' });
const isSpecificDeptSelected = computed(() => {
return [23, 24, 25].includes(selectedDeptId.value);
});
// 选中的部门ID
const selectedDeptId = ref<string | null>(null);
const searchInfo = reactive<Recordable>({});
const [
registerTable,
{ },
] = useTable({
api: async (params) => {
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: columnInformationList.length,
code: '',
message: '',
data: columnInformationList,
};
return { ...response };
},
rowKey: 'businessId',
columns,
formConfig: {
labelWidth: 10,
autoSubmitOnEnter: true,
},
rowSelection: false,
useSearchForm: false,
showIndexColumn: false,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
console.log('handleSearchInfoFn', info);
return info;
},
});
// 处理选择节点事件
const handleSelect = (deptId) => {
selectedDeptId.value = deptId;
console.log('选择节点selectedDeptId:', deptId);
}
</script>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<a-button :disabled="isDisabled" type="primary" @click="handleBulkDownload" <a-button :disabled="isDisabled" type="primary" @click="handleBulkDownload"
>批量下载</a-button >批量下载</a-button
> >
<a-button :disabled="isDisabled" type="primary" @click="pushNotifications" <a-button :disabled="isDisabled" type="primary" @click="pushNotifications(selectedCard)"
>批量推送</a-button >批量推送</a-button
> >
</div> </div>
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<Divider type="vertical" /> <Divider type="vertical" />
<a-button <a-button
style="padding: 0; border: none; box-shadow: none" style="padding: 0; border: none; box-shadow: none"
@click="pushNotifications" @click="pushNotifications(item)"
> >
<Icon icon="icon-park-outline:hand-up" />{{ item.edit }}</a-button <Icon icon="icon-park-outline:hand-up" />{{ item.edit }}</a-button
> >
...@@ -298,44 +298,17 @@ ...@@ -298,44 +298,17 @@
} }
function information(item) { function information(item) {
const title = item.title; router.push({
if (title === '党建工作总结') { path: '/mallResourceDevelopment/dataSet/commonDataSet/columnInformation',
router.push({ query: {},
path: '/mallResourceDevelopment/dataSet/commonDataSet/columnInformation', });
query: {},
});
}
if (title === '党史知识竞赛') {
router.push({
path: '/mallResourceDevelopment/dataSet/commonDataSet/partyHistoryKnowledgeCompetition',
query: {},
});
}
if (title === '主题教育活动') {
router.push({
path: '/mallResourceDevelopment/dataSet/commonDataSet/themeEducationActivities',
query: {},
});
}
if (title === '党员发展计划') {
router.push({
path: '/mallResourceDevelopment/dataSet/commonDataSet/partyMemberDevelopmentPlan',
query: {},
});
}
if (title === '基本信息') {
router.push({
path: '/mallResourceDevelopment/dataSet/commonDataSet/essentialInformation',
query: {},
});
}
} }
function handleBulkDownload() {} function handleBulkDownload() {}
/**批量推送推送*/ /**批量推送推送*/
function pushNotifications() { function pushNotifications(record) {
openApplyForPushNotificationsModal(true); openApplyForPushNotificationsModal(true, record);
// router.push({ // router.push({
// path: '/mallResourceDevelopment/dataSet/commonDataSet/applyForPushNotificationsModal', // path: '/mallResourceDevelopment/dataSet/commonDataSet/applyForPushNotificationsModal',
// query: {}, // query: {},
......
...@@ -582,14 +582,11 @@ export const pushConfiguration: FormSchema[] = [ ...@@ -582,14 +582,11 @@ export const pushConfiguration: FormSchema[] = [
componentProps: { componentProps: {
options: [ options: [
{ label: '无周期', value: '1' }, { label: '无周期', value: '1' },
{ label: '一周期', value: '2' }, { label: '每天', value: '2' },
{ label: '两周期', value: '3' }, { label: '每周', value: '3' },
{ label: '三周期', value: '4' }, { label: '每月', value: '4' },
{ label: '四周期', value: '5' }, { label: '每季度', value: '5' },
{ label: '五周期', value: '6' }, { label: '每年', value: '6' },
{ label: '六周期', value: '7' },
{ label: '十二周期', value: '8' },
{ label: '二十四周期', value: '9' },
], ],
placeholder: '请选择周期', placeholder: '请选择周期',
}, },
...@@ -617,6 +614,7 @@ export const pushConfiguration: FormSchema[] = [ ...@@ -617,6 +614,7 @@ export const pushConfiguration: FormSchema[] = [
colProps: { colProps: {
span: 16, span: 16,
}, },
defaultValue: '1',
componentProps: { componentProps: {
options: [ options: [
{ {
......
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex" >
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<editAuditRulesModal
style="background: #cc0000;"
class="w-3/4 xl:w-4/5"
v-if="isSpecificDeptSelected"
/>
<BasicTable
@register="registerTable"
class="w-3/4 xl:w-4/5"
:searchInfo="searchInfo"
v-else
>
<template #toolbar>
<a-input style="width: 200px; margin-right: auto" placeholder="输入关键字搜索" allowClear />
<a-button type="primary">新建文件夹</a-button>
<a-button type="primary">新建文件</a-button>
</template>
</BasicTable>
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive, computed } from 'vue';
import {BasicTable, useTable} from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import DeptTree from './DeptTree.vue';
import { ref } from 'vue';
import {columnInformationList} from './mock';
import { columns } from './commonDataSet.data';
import EditAuditRulesModal from "@/views/scriptDevelopment/sqlAudit/editAuditRulesModal.vue";
defineOptions({ name: 'AccountManagement' });
const isSpecificDeptSelected = computed(() => {
return [23, 24, 25].includes(selectedDeptId.value);
});
// 选中的部门ID
const selectedDeptId = ref<string | null>(null);
const searchInfo = reactive<Recordable>({});
const [
registerTable,
{ },
] = useTable({
api: async (params) => {
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: columnInformationList.length,
code: '',
message: '',
data: columnInformationList,
};
return { ...response };
},
rowKey: 'businessId',
columns,
formConfig: {
labelWidth: 10,
autoSubmitOnEnter: true,
},
rowSelection: false,
useSearchForm: false,
showIndexColumn: false,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
console.log('handleSearchInfoFn', info);
return info;
},
});
// 处理选择节点事件
const handleSelect = (deptId) => {
selectedDeptId.value = deptId;
console.log('选择节点selectedDeptId:', deptId);
}
</script>
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex" >
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<editAuditRulesModal
style="background: #cc0000;"
class="w-3/4 xl:w-4/5"
v-if="isSpecificDeptSelected"
/>
<BasicTable
@register="registerTable"
class="w-3/4 xl:w-4/5"
:searchInfo="searchInfo"
v-else
>
<template #toolbar>
<a-input style="width: 200px; margin-right: auto" placeholder="输入关键字搜索" allowClear />
<a-button type="primary">新建文件夹</a-button>
<a-button type="primary">新建文件</a-button>
</template>
</BasicTable>
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive, computed } from 'vue';
import {BasicTable, useTable} from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import DeptTree from './DeptTree.vue';
import { ref } from 'vue';
import {columnInformationList} from './mock';
import { columns } from './commonDataSet.data';
import EditAuditRulesModal from "@/views/scriptDevelopment/sqlAudit/editAuditRulesModal.vue";
defineOptions({ name: 'AccountManagement' });
const isSpecificDeptSelected = computed(() => {
return [23, 24, 25].includes(selectedDeptId.value);
});
// 选中的部门ID
const selectedDeptId = ref<string | null>(null);
const searchInfo = reactive<Recordable>({});
const [
registerTable,
{ },
] = useTable({
api: async (params) => {
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: columnInformationList.length,
code: '',
message: '',
data: columnInformationList,
};
return { ...response };
},
rowKey: 'businessId',
columns,
formConfig: {
labelWidth: 10,
autoSubmitOnEnter: true,
},
rowSelection: false,
useSearchForm: false,
showIndexColumn: false,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
console.log('handleSearchInfoFn', info);
return info;
},
});
// 处理选择节点事件
const handleSelect = (deptId) => {
selectedDeptId.value = deptId;
console.log('选择节点selectedDeptId:', deptId);
}
</script>
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex" >
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<editAuditRulesModal
style="background: #cc0000;"
class="w-3/4 xl:w-4/5"
v-if="isSpecificDeptSelected"
/>
<BasicTable
@register="registerTable"
class="w-3/4 xl:w-4/5"
:searchInfo="searchInfo"
v-else
>
<template #toolbar>
<a-input style="width: 200px; margin-right: auto" placeholder="输入关键字搜索" allowClear />
<a-button type="primary">新建文件夹</a-button>
<a-button type="primary">新建文件</a-button>
</template>
</BasicTable>
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive, computed } from 'vue';
import {BasicTable, useTable} from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import DeptTree from './DeptTree.vue';
import { ref } from 'vue';
import {columnInformationList} from './mock';
import { columns } from './commonDataSet.data';
import EditAuditRulesModal from "@/views/scriptDevelopment/sqlAudit/editAuditRulesModal.vue";
defineOptions({ name: 'AccountManagement' });
const isSpecificDeptSelected = computed(() => {
return [23, 24, 25].includes(selectedDeptId.value);
});
// 选中的部门ID
const selectedDeptId = ref<string | null>(null);
const searchInfo = reactive<Recordable>({});
const [
registerTable,
{ },
] = useTable({
api: async (params) => {
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: columnInformationList.length,
code: '',
message: '',
data: columnInformationList,
};
return { ...response };
},
rowKey: 'businessId',
columns,
formConfig: {
labelWidth: 10,
autoSubmitOnEnter: true,
},
rowSelection: false,
useSearchForm: false,
showIndexColumn: false,
showTableSetting: false,
bordered: true,
handleSearchInfoFn(info) {
console.log('handleSearchInfoFn', info);
return info;
},
});
// 处理选择节点事件
const handleSelect = (deptId) => {
selectedDeptId.value = deptId;
console.log('选择节点selectedDeptId:', deptId);
}
</script>
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