style: lint格式化文件
This commit is contained in:
@ -1,93 +1,93 @@
|
||||
<template>
|
||||
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
|
||||
<DeptTree class="w-1/3 xl:w-1/4" @select="handleSelect" />
|
||||
<BasicTable @register="registerTable" class="w-2/3 xl:w-3/4">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" v-auth="'member:sync'" @click="handleSync">同步</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</PageWrapper>
|
||||
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
|
||||
<DeptTree class="w-1/3 xl:w-1/4" @select="handleSelect" />
|
||||
<BasicTable @register="registerTable" class="w-2/3 xl:w-3/4">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" v-auth="'member:sync'" @click="handleSync">同步</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, useTable, FormSchema, BasicColumn } from '/@/components/Table';
|
||||
import { getMemberList, updateSyncUser } from '/@/api/system/wechat';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import DeptTree from '/@/views/system/user/components/DeptTree.vue';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, useTable, FormSchema, BasicColumn } from '/@/components/Table';
|
||||
import { getMemberList, updateSyncUser } from '/@/api/system/wechat';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import DeptTree from '/@/views/system/user/components/DeptTree.vue';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { t } = useI18n();
|
||||
const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'keyword',
|
||||
label: '关键字',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入姓名/账号/电话',
|
||||
},
|
||||
},
|
||||
];
|
||||
const { t } = useI18n();
|
||||
const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'keyword',
|
||||
label: '关键字',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入姓名/账号/电话'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
const columns: BasicColumn[] = [
|
||||
{
|
||||
title: t('姓名'),
|
||||
dataIndex: 'name',
|
||||
sorter: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('账号'),
|
||||
dataIndex: 'userName',
|
||||
sorter: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: '组织',
|
||||
dataIndex: 'departmentName',
|
||||
sorter: true,
|
||||
align: 'left',
|
||||
},
|
||||
];
|
||||
const { notification } = useMessage();
|
||||
const columns: BasicColumn[] = [
|
||||
{
|
||||
title: t('姓名'),
|
||||
dataIndex: 'name',
|
||||
sorter: true,
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
title: t('账号'),
|
||||
dataIndex: 'userName',
|
||||
sorter: true,
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
title: '组织',
|
||||
dataIndex: 'departmentName',
|
||||
sorter: true,
|
||||
align: 'left'
|
||||
}
|
||||
];
|
||||
const { notification } = useMessage();
|
||||
|
||||
const selectDeptId = ref('');
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '企业成员列表',
|
||||
api: getMemberList,
|
||||
rowKey: 'id',
|
||||
columns,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: searchFormSchema,
|
||||
showResetButton: false,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
//发送请求默认新增 左边树结构所选机构id
|
||||
return { ...params, departmentId: selectDeptId.value };
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
striped: false,
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
});
|
||||
|
||||
async function handleSync() {
|
||||
await updateSyncUser(selectDeptId.value);
|
||||
notification.success({
|
||||
message: '提示',
|
||||
description: '同步成功',
|
||||
const selectDeptId = ref('');
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '企业成员列表',
|
||||
api: getMemberList,
|
||||
rowKey: 'id',
|
||||
columns,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16
|
||||
},
|
||||
schemas: searchFormSchema,
|
||||
showResetButton: false
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
//发送请求默认新增 左边树结构所选机构id
|
||||
return { ...params, departmentId: selectDeptId.value };
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
striped: false,
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false
|
||||
}
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleSelect(deptId = '') {
|
||||
selectDeptId.value = deptId;
|
||||
reload();
|
||||
}
|
||||
async function handleSync() {
|
||||
await updateSyncUser(selectDeptId.value);
|
||||
notification.success({
|
||||
message: '提示',
|
||||
description: '同步成功'
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleSelect(deptId = '') {
|
||||
selectDeptId.value = deptId;
|
||||
reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1,90 +1,90 @@
|
||||
<template>
|
||||
<PageWrapper dense contentFullHeight fixedHeight>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" v-auth="'organization:sync'" @click="handleSync"> 同步 </a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex == 'name'">
|
||||
<a-tag color="processing" v-if="record.departmentType === 1">公司</a-tag>
|
||||
<a-tag color="warning" v-else-if="record.departmentType === 0">部门</a-tag>
|
||||
{{ record.name }}
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex == 'wechatDeptId'">
|
||||
<a-tag color="success" v-if="!!record.wechatDeptId">同步成功</a-tag>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</PageWrapper>
|
||||
<PageWrapper dense contentFullHeight fixedHeight>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" v-auth="'organization:sync'" @click="handleSync"> 同步 </a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex == 'name'">
|
||||
<a-tag color="processing" v-if="record.departmentType === 1">公司</a-tag>
|
||||
<a-tag color="warning" v-else-if="record.departmentType === 0">部门</a-tag>
|
||||
{{ record.name }}
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex == 'wechatDeptId'">
|
||||
<a-tag color="success" v-if="!!record.wechatDeptId">同步成功</a-tag>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { BasicTable, useTable, BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDepartmentsList, updateSyncDept } from '/@/api/system/wechat';
|
||||
const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
width: 800,
|
||||
align: 'left',
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: '编码',
|
||||
dataIndex: 'code',
|
||||
align: 'left',
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: '同步状态',
|
||||
dataIndex: 'wechatDeptId',
|
||||
align: 'left',
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
import { BasicTable, useTable, BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDepartmentsList, updateSyncDept } from '/@/api/system/wechat';
|
||||
const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
width: 800,
|
||||
align: 'left',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '编码',
|
||||
dataIndex: 'code',
|
||||
align: 'left',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '同步状态',
|
||||
dataIndex: 'wechatDeptId',
|
||||
align: 'left',
|
||||
sorter: true
|
||||
}
|
||||
];
|
||||
|
||||
const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'keyword',
|
||||
label: '关键字',
|
||||
component: 'Input',
|
||||
colProps: { lg: 8, md: 12, sm: 12 },
|
||||
componentProps: {
|
||||
placeholder: '请输入要查询的关键字',
|
||||
},
|
||||
},
|
||||
];
|
||||
const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'keyword',
|
||||
label: '关键字',
|
||||
component: 'Input',
|
||||
colProps: { lg: 8, md: 12, sm: 12 },
|
||||
componentProps: {
|
||||
placeholder: '请输入要查询的关键字'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
const { notification } = useMessage();
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '企业号组织列表',
|
||||
api: getDepartmentsList,
|
||||
columns,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: searchFormSchema,
|
||||
actionColOptions: { span: 16 },
|
||||
showResetButton: false,
|
||||
},
|
||||
striped: false,
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
showIndexColumn: false,
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
});
|
||||
|
||||
async function handleSync() {
|
||||
await updateSyncDept();
|
||||
notification.success({
|
||||
message: '提示',
|
||||
description: '同步成功',
|
||||
const { notification } = useMessage();
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '企业号组织列表',
|
||||
api: getDepartmentsList,
|
||||
columns,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16
|
||||
},
|
||||
schemas: searchFormSchema,
|
||||
actionColOptions: { span: 16 },
|
||||
showResetButton: false
|
||||
},
|
||||
striped: false,
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
showIndexColumn: false,
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false
|
||||
}
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
async function handleSync() {
|
||||
await updateSyncDept();
|
||||
notification.success({
|
||||
message: '提示',
|
||||
description: '同步成功'
|
||||
});
|
||||
reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user