fix(view模块): 消灭大部分黄色警告
移除国际化相关代码并优化公告功能 - 移除了多语言相关代码,统一使用中文 - 重构了公告编辑和详情页面,优化了附件展示和编辑器配置 - 更新了用户管理和菜单管理相关页面的中文文案 - 调整了登录和用户设置页面的验证码输入框属性
This commit is contained in:
parent
8fa3b8f0c3
commit
9604bca0ea
@ -8,13 +8,26 @@ export interface BulletinCreateRecord {
|
||||
attachmentIds?: string[];
|
||||
}
|
||||
|
||||
export interface AttachmentRecord {
|
||||
id: string;
|
||||
fileName: string;
|
||||
url: string;
|
||||
uploadTime?: string;
|
||||
mimeType?: string;
|
||||
}
|
||||
|
||||
export interface BulletinRecord extends BulletinCreateRecord {
|
||||
id: number;
|
||||
state: string;
|
||||
publishTime: string;
|
||||
createTime: string;
|
||||
|
||||
createBy: string;
|
||||
updateTime: string;
|
||||
state: string;
|
||||
editUserId: number;
|
||||
publishUserId: number;
|
||||
publishTime: string;
|
||||
closeUserId: number;
|
||||
closeTime: string;
|
||||
attachments?: AttachmentRecord[];
|
||||
}
|
||||
|
||||
export interface BulletinsRecord {
|
||||
@ -27,14 +40,9 @@ export interface BulletinsRecord {
|
||||
size: number;
|
||||
}
|
||||
|
||||
export interface AttachmentRecord {
|
||||
type: string;
|
||||
file: any;
|
||||
}
|
||||
|
||||
|
||||
// 查看详情
|
||||
export function queryBulletinListAll(id: number) {
|
||||
export function queryBulletinDetail(id: number) {
|
||||
return axios.get(`/api/rest/bulletin/${id}`);
|
||||
}
|
||||
|
||||
|
@ -4,17 +4,17 @@ export interface MenuRecord {
|
||||
id?: number;
|
||||
pid?: number;
|
||||
name: string;
|
||||
path: string;
|
||||
path?: string;
|
||||
meta: {
|
||||
locale: string;
|
||||
title?: string;
|
||||
icon: string;
|
||||
icon?: string;
|
||||
requiresAuth: boolean;
|
||||
hideInMenu: boolean;
|
||||
order: number;
|
||||
permissions: string[];
|
||||
showInMenu: boolean;
|
||||
menuOrder: number;
|
||||
showInMenu?: boolean;
|
||||
menuOrder?: string;
|
||||
};
|
||||
children?: MenuRecord[] ;
|
||||
};
|
||||
@ -38,7 +38,7 @@ export const createMenu = (data: MenuCreateRecord) => {
|
||||
};
|
||||
|
||||
export const updateMenu = (data: MenuCreateRecord) => {
|
||||
return axios.put(`/api/rest/menu/${data.id}`, data);
|
||||
return axios.patch(`/api/rest/menu/${data.id}`, data);
|
||||
};
|
||||
|
||||
export const removeMenu = (id: string | number) => {
|
||||
|
@ -9,11 +9,11 @@ import {
|
||||
publish,
|
||||
close,
|
||||
remove,
|
||||
queryBulletinListAll,
|
||||
queryBulletinDetail,
|
||||
queryBulletinList,
|
||||
addAttachments,
|
||||
queryDeptTreeList,
|
||||
addAttachment,
|
||||
// queryDeptTreeList,
|
||||
// addAttachment,
|
||||
deleteAttachment
|
||||
} from '@/api/bulletin-mgmt';
|
||||
import { bulletinsStore } from '@/store/modules/bulle-mgmt/type';
|
||||
@ -33,8 +33,8 @@ const useBulletinStore = defineStore('bulletin-mgmt', {
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async queryBulletinListAll(id: number) {
|
||||
return queryBulletinListAll(id);
|
||||
async queryBulletinDetail(id: number) {
|
||||
return queryBulletinDetail(id);
|
||||
},
|
||||
|
||||
async queryBulletinList(params: BulletinsRecord) {
|
||||
@ -69,15 +69,15 @@ const useBulletinStore = defineStore('bulletin-mgmt', {
|
||||
return addAttachments(data);
|
||||
},
|
||||
|
||||
// 获取部门树
|
||||
async queryDeptTreeList() {
|
||||
return queryDeptTreeList();
|
||||
},
|
||||
// // 获取部门树
|
||||
// async queryDeptTreeList() {
|
||||
// return queryDeptTreeList();
|
||||
// },
|
||||
|
||||
// 获取附件信息
|
||||
async queryAttachmentInfo(id: string) {
|
||||
return addAttachment(id);
|
||||
},
|
||||
// // 获取附件信息
|
||||
// async queryAttachmentInfo(id: string) {
|
||||
// return addAttachment(id);
|
||||
// },
|
||||
|
||||
// 删除附件
|
||||
async deleteAttachment(id: string) {
|
||||
|
@ -158,7 +158,7 @@
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: t('user.info.code.required'),
|
||||
message: '请输入验证码',
|
||||
},
|
||||
]"
|
||||
:validate-trigger="['change', 'input']"
|
||||
|
@ -63,35 +63,29 @@
|
||||
>
|
||||
<!-- v-if="isCreate"-->
|
||||
<a-upload
|
||||
v-model="formData.attachmentIds"
|
||||
v-model="formData.attachments"
|
||||
show-file-list
|
||||
:file-list="fileList"
|
||||
:custom-request="customRequest"
|
||||
@before-remove="beforeRemove"
|
||||
>
|
||||
<template #upload-item="{ file }">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<img :src="file.url" alt="上传文件" style="width: 50px; height: 50px; margin-right: 10px;" />
|
||||
<span>{{ file.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</a-upload>
|
||||
</a-form-item>
|
||||
<a-form-item field="content" label='内容' :rules="[{ required: true}]">
|
||||
<div style="border: 1px solid #ccc;min-width: 700px">
|
||||
<div style="border: 1px solid #ccc;min-width: 700px;">
|
||||
<Toolbar
|
||||
style="border-bottom: 1px solid #ccc"
|
||||
style="border-bottom: 1px solid #ccc;"
|
||||
:editor="editorRef"
|
||||
:default-config="toolbarConfig"
|
||||
:mode="mode"
|
||||
:class="{'fullscreen-toolbar': isFullScreen}"
|
||||
/>
|
||||
<Editor
|
||||
style="height: 200px;overflow-y: hidden;"
|
||||
v-model="formData.content"
|
||||
style="overflow-y: hidden;height: 200px;"
|
||||
:default-config="editorConfig"
|
||||
:mode="mode"
|
||||
@on-created="handleCreated"
|
||||
:class="{'fullscreen-editor': isFullScreen}"
|
||||
|
||||
/>
|
||||
</div>
|
||||
<!-- <a-textarea v-model="formData.content" placeholder="请输入公告内容" style="height: 100px" />-->
|
||||
@ -107,8 +101,8 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useVisible from '@/hooks/visible';
|
||||
import { computed, defineEmits, PropType, ref, shallowRef,onBeforeUnmount } from 'vue';
|
||||
import { BulletinCreateRecord } from '@/api/bulletin-mgmt';
|
||||
import { computed, defineEmits, ref, shallowRef,onBeforeUnmount } from 'vue';
|
||||
import { BulletinRecord } from '@/api/bulletin-mgmt';
|
||||
import { FormInstance } from '@arco-design/web-vue/es/form';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { useBulletinStore } from '@/store';
|
||||
@ -117,8 +111,9 @@ import { IEditorConfig } from '@wangeditor/editor'
|
||||
import '@wangeditor/editor/dist/css/style.css'
|
||||
|
||||
const props = defineProps({
|
||||
prem: {
|
||||
type: Object as PropType<BulletinCreateRecord>,
|
||||
id: {
|
||||
type: Number,
|
||||
default: -1,
|
||||
},
|
||||
isCreate: Boolean,
|
||||
});
|
||||
@ -130,27 +125,70 @@ const { visible, setVisible } = useVisible(false);
|
||||
const checkKeys = ref<number[]>([]);
|
||||
|
||||
const CreateRef = ref<FormInstance>();
|
||||
const formData = ref<any>({
|
||||
...props.prem,
|
||||
attachmentIds: [],
|
||||
const formData = ref<BulletinRecord>({
|
||||
id: -1,
|
||||
title: '',
|
||||
top: false,
|
||||
content: '',
|
||||
remark: '',
|
||||
createTime: '',
|
||||
createBy: '',
|
||||
updateTime: '',
|
||||
state: '',
|
||||
editUserId: 0,
|
||||
publishUserId: 0,
|
||||
publishTime: '',
|
||||
closeUserId: 0,
|
||||
closeTime: '',
|
||||
attachments: [],
|
||||
|
||||
});
|
||||
const bulletinStore = useBulletinStore();
|
||||
const editorRef = shallowRef()
|
||||
const isFullScreen = ref(false);
|
||||
const mode = 'default';
|
||||
const toolbarConfig = { excludeKeys: ['uploadVideo', 'insertImage','insertVideo']}
|
||||
const handleCreated = (editor: any) => {
|
||||
editorRef.value = editor; // 记录 editor 实例,重要!
|
||||
// 监听全屏事件
|
||||
editor.on('fullScreen', () => {
|
||||
})
|
||||
}
|
||||
|
||||
const fileList = computed(() => {
|
||||
return formData.value.attachments?.map((item: any) => {
|
||||
return {
|
||||
name: item.fileName,
|
||||
url: item.url,
|
||||
uid: item.id,
|
||||
};
|
||||
});
|
||||
});
|
||||
// const fileList = [
|
||||
// {
|
||||
// uid: '-1',
|
||||
// name: 'ice.png',
|
||||
// url: '//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp',
|
||||
// },
|
||||
// {
|
||||
// status: 'error',
|
||||
// uid: '-2',
|
||||
// percent: 0,
|
||||
// response: '上传错误提示',
|
||||
// name: 'cat.png',
|
||||
// url: '//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/e278888093bef8910e829486fb45dd69.png~tplv-uwbnlip3yd-webp.webp',
|
||||
// },
|
||||
// {
|
||||
// uid: '-3',
|
||||
// name: 'light.png',
|
||||
// url: '//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp',
|
||||
// },
|
||||
// ];
|
||||
|
||||
|
||||
// 组件被点击
|
||||
const handleClick = () => {
|
||||
setVisible(true);
|
||||
if(!props.isCreate){
|
||||
bulletinStore.queryBulletinDetail(props.id).then((res: any) => {
|
||||
formData.value = res.data;
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
const editorConfig: Partial<IEditorConfig> = { placeholder: '请输入内容...',MENU_CONF:{
|
||||
@ -161,13 +199,12 @@ const editorConfig: Partial<IEditorConfig> = { placeholder: '请输入内容...'
|
||||
base64LimitSize: 1024 * 1024,
|
||||
// server: '/api/rest/bulletin/1/add',
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
// 提交
|
||||
const handleSubmit = async () => {
|
||||
const valid = await CreateRef.value?.validate();
|
||||
if (!valid) {
|
||||
formData.value.permissionIds = checkKeys.value;
|
||||
// 新增
|
||||
if (props.isCreate) {
|
||||
// formData.value.username = formData.value.email;
|
||||
@ -205,9 +242,7 @@ const customRequest = async (option: any) => {
|
||||
const res = await bulletinStore.addAttachments(formDataFile);
|
||||
if (res.status === 200) {
|
||||
onSuccess(res.data);
|
||||
console.log(formData.value);
|
||||
formData.value.attachmentIds.push(res.data.id);
|
||||
console.log(formData.value);
|
||||
formData.value.attachments?.push(res.data);
|
||||
} else {
|
||||
onError(res.data);
|
||||
}
|
||||
@ -233,23 +268,3 @@ const handleCancel = async () => {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fullscreen-toolbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 50px; /* 根据需要调整高度 */
|
||||
z-index: 999;
|
||||
background-color: white;
|
||||
}
|
||||
.fullscreen-editor {
|
||||
position: fixed;
|
||||
top: 50px; /* 根据 toolbar 的高度调整 */
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: calc(100% - 50px); /* 减去 toolbar 的高度 */
|
||||
z-index: 999;
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
|
@ -45,7 +45,7 @@
|
||||
const renderData = ref<any>([]);
|
||||
// const attachmentList = ref<any>([]);
|
||||
const fetchData = async (Id: number) => {
|
||||
const res = await bulletinStore.queryBulletinListAll(Id);
|
||||
const res = await bulletinStore.queryBulletinDetail(Id);
|
||||
// attachmentList.value = await bulletinStore.queryAttachmentInfo(
|
||||
// '28452d83420650425d45110c6417bf693b966b29'
|
||||
// );
|
||||
|
@ -197,7 +197,7 @@
|
||||
</a-button>
|
||||
<BulletinEdit
|
||||
ref="editUserRef"
|
||||
:prem="record"
|
||||
:id="record.id"
|
||||
:is-create="false"
|
||||
@refresh="fetchData"
|
||||
/>
|
||||
|
@ -108,7 +108,7 @@
|
||||
/>
|
||||
<Editor
|
||||
v-model="formData.content"
|
||||
style="overflow-y: hidden;height: 200px;"
|
||||
style="overflow-y: hidden;min-height: 200px;"
|
||||
:default-config="editorConfig"
|
||||
:mode="mode"
|
||||
:class="{'fullscreen-editor': isFullScreen}"
|
||||
@ -167,7 +167,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useVisible from '@/hooks/visible';
|
||||
import { computed, defineEmits, PropType, ref, shallowRef, onBeforeUnmount, reactive, onMounted } from 'vue';
|
||||
import { computed, defineEmits, PropType, ref, shallowRef, onBeforeUnmount, onMounted } from 'vue';
|
||||
import { CreateRecord } from '@/api/user';
|
||||
import { FormInstance } from '@arco-design/web-vue/es/form';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
|
@ -132,7 +132,7 @@
|
||||
:rules="[{ required: true, message: '请输入权限' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.meta.permissions"
|
||||
v-model="formData.meta.permissions[0]"
|
||||
placeholder='请输入权限'
|
||||
/>
|
||||
</a-form-item>
|
||||
@ -171,7 +171,7 @@
|
||||
locale: '',
|
||||
requiresAuth: false,
|
||||
hideInMenu: false,
|
||||
menuOrder: 0,
|
||||
menuOrder: '0',
|
||||
permissions: [],
|
||||
order: 0,
|
||||
showInMenu: false
|
||||
@ -182,11 +182,11 @@
|
||||
const typeOptions = computed(() => [
|
||||
{
|
||||
label: '菜单',
|
||||
value: '1',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '权限',
|
||||
value: '2',
|
||||
value: 2,
|
||||
},
|
||||
]);
|
||||
|
||||
@ -195,8 +195,6 @@
|
||||
// 组件被点击
|
||||
const handleClick = () => {
|
||||
setVisible(true);
|
||||
console.log(props.menuData);
|
||||
console.log(props.menu);
|
||||
};
|
||||
|
||||
// 提交
|
||||
|
@ -223,6 +223,7 @@
|
||||
try {
|
||||
const res = await queryMenuList(formModel.value.name || 'all');
|
||||
renderData.value = res.data;
|
||||
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
|
@ -25,84 +25,84 @@
|
||||
<a-form ref="CreateRef" :model="formData" :style="{ width: '650px' }">
|
||||
<a-form-item
|
||||
field="username"
|
||||
:label="$t('user.info.username')"
|
||||
label="用户名"
|
||||
:validate-trigger="['change', 'input']"
|
||||
:rules="[
|
||||
{ required: true, message: t('user.info.username.required') },
|
||||
{ required: true, message: '用户名不能为空' },
|
||||
{
|
||||
match: /^[a-zA-Z0-9\u4e00-\u9fa5]{1,20}$/,
|
||||
message: t('user.info.username.format'),
|
||||
message: '请输入正确格式的用户名',
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-input
|
||||
v-if="props.isCreate"
|
||||
v-model="formData.username"
|
||||
:placeholder="$t('user.info.username.placeholder')"
|
||||
placeholder="请输入用户名"
|
||||
/>
|
||||
|
||||
<div v-else>{{ formData.username }}</div>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="email"
|
||||
:label="$t('user.info.email')"
|
||||
label="Email"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
type: 'email',
|
||||
message: t('user.info.email.required'),
|
||||
message: 'Email不能为空',
|
||||
},
|
||||
]"
|
||||
:validate-trigger="['change', 'input']"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.email"
|
||||
:placeholder="$t('user.info.email.placeholder')"
|
||||
placeholder="请输入Email"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="phone"
|
||||
:label="$t('user.info.phone')"
|
||||
label="电话"
|
||||
:rules="[
|
||||
{ required: true, message: t('user.info.phone.required') },
|
||||
{ match: /^1[3-9]\d{9}$/, message: t('user.info.phone.format') },
|
||||
{ required: true, message: '电话不能为空' },
|
||||
{ match: /^1[3-9]\d{9}$/, message: '请输入正确格式的电话' },
|
||||
]"
|
||||
:validate-trigger="['change', 'input']"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.phone"
|
||||
:placeholder="$t('user.info.phone.placeholder')"
|
||||
placeholder="请输入电话"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="password"
|
||||
:label="$t('user.info.password')"
|
||||
label="密码"
|
||||
v-if="isCreate"
|
||||
:validate-trigger="['change', 'input']"
|
||||
:rules="[{ required: true, message: t('user.info.password.required') }]"
|
||||
:rules="[{ required: true, message: '密码不能为空' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.password"
|
||||
:placeholder="$t('user.info.password.placeholder')"
|
||||
placeholder="请输入密码"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item field="nickName" :label="$t('user.info.nickName')">
|
||||
<a-form-item field="nickName" label="昵称">
|
||||
<a-input
|
||||
v-model="formData.nickName"
|
||||
:placeholder="$t('user.info.nickName.placeholder')"
|
||||
placeholder="请输入昵称"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="address" :label="$t('user.info.address')">
|
||||
<a-form-item field="address" label="地址">
|
||||
<a-input
|
||||
v-model="formData.address"
|
||||
:placeholder="$t('user.info.address.placeholder')"
|
||||
placeholder="请输入地址"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="deptId"
|
||||
:label="$t('user.info.dept')"
|
||||
:rules="[{ required: true, message: t('user.info.dept.required') }]"
|
||||
label="部门"
|
||||
:rules="[{ required: true, message: '部门不能为空' }]"
|
||||
:validate-trigger="['change']"
|
||||
>
|
||||
<a-tree-select
|
||||
@ -114,14 +114,14 @@
|
||||
}"
|
||||
:data="deptOptions"
|
||||
allow-clear
|
||||
:placeholder="$t('user.info.dept.placeholder')"
|
||||
placeholder="请选择所属部门"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
field="roleId"
|
||||
:label="$t('user.info.role')"
|
||||
:rules="[{ required: true, message: t('user.info.dept.required') }]"
|
||||
label="角色"
|
||||
:rules="[{ required: true, message: '角色不能为空' }]"
|
||||
:validate-trigger="['change']"
|
||||
>
|
||||
<a-select
|
||||
@ -131,7 +131,7 @@
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
}"
|
||||
:placeholder="$t('user.info.role.placeholder')"
|
||||
placeholder="请选择角色"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@ -139,13 +139,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import useVisible from '@/hooks/visible';
|
||||
import { computed, PropType, ref } from 'vue';
|
||||
import { CreateRecord } from '@/api/user';
|
||||
import { FormInstance } from '@arco-design/web-vue/es/form';
|
||||
import { queryRoleList } from '@/api/role';
|
||||
import { deptList, getAllDeptTree } from '@/api/dept';
|
||||
import { getAllDeptTree } from '@/api/dept';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
@ -155,9 +154,9 @@ const props = defineProps({
|
||||
},
|
||||
isCreate: Boolean,
|
||||
});
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits(['refresh']);
|
||||
const modalTitle = computed(() => {
|
||||
return props.isCreate ? t('createUser') : t('editUser');
|
||||
return props.isCreate ? '新建用户' : '编辑用户';
|
||||
});
|
||||
const { visible, setVisible } = useVisible(false);
|
||||
const checkKeys = ref<number[]>([]);
|
||||
@ -165,6 +164,8 @@ const checkKeys = ref<number[]>([]);
|
||||
const CreateRef = ref<FormInstance>();
|
||||
|
||||
const formData = ref<CreateRecord>({
|
||||
value: undefined,
|
||||
code: undefined,
|
||||
username: '',
|
||||
nickName: '',
|
||||
password: '',
|
||||
@ -231,7 +232,7 @@ const handleSubmit = async () => {
|
||||
const res = await userStore.createUser(formData.value);
|
||||
if (res.status === 200) {
|
||||
Message.success({
|
||||
content: t('create.sucess'),
|
||||
content: '新建成功',
|
||||
duration: 5 * 1000,
|
||||
});
|
||||
}
|
||||
@ -241,7 +242,7 @@ const handleSubmit = async () => {
|
||||
formDifer = diffDataForm(formData.value, formDifer);
|
||||
if (Object.keys(formDifer).length === 0) {
|
||||
Message.success({
|
||||
content: t('unmodified'),
|
||||
content: '未编辑',
|
||||
duration: 3 * 1000,
|
||||
});
|
||||
} else {
|
||||
@ -249,13 +250,14 @@ const handleSubmit = async () => {
|
||||
const res = await userStore.updateUser(formDifer);
|
||||
if (res.status === 200) {
|
||||
Message.success({
|
||||
content: t('modify.sucess'),
|
||||
content: '修改成功',
|
||||
duration: 5 * 1000,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
checkKeys.value = [];
|
||||
emit('refresh');
|
||||
setVisible(false);
|
||||
}
|
||||
};
|
||||
|
@ -32,11 +32,11 @@
|
||||
<a-col :span="9">
|
||||
<a-form-item
|
||||
field="username"
|
||||
:label="$t('searchTable.form.username')"
|
||||
label="用户名"
|
||||
>
|
||||
<a-input
|
||||
v-model="formModel.username"
|
||||
:placeholder="$t('searchTable.form.username.placeholder')"
|
||||
placeholder="请输入用户名"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -44,34 +44,34 @@
|
||||
<a-col :span="9">
|
||||
<a-form-item
|
||||
field="phone"
|
||||
:label="$t('searchTable.form.phone')"
|
||||
label="电话号码"
|
||||
>
|
||||
<a-input
|
||||
v-model="formModel.phone"
|
||||
:placeholder="$t('searchTable.form.phone.placeholder')"
|
||||
placeholder="请输入电话号码"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="9">
|
||||
<a-form-item
|
||||
field="email"
|
||||
:label="$t('searchTable.form.email')"
|
||||
label="Email"
|
||||
>
|
||||
<a-input
|
||||
v-model="formModel.email"
|
||||
:placeholder="$t('searchTable.form.email.placeholder')"
|
||||
placeholder="请输入Email"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="9">
|
||||
<a-form-item
|
||||
field="enableState"
|
||||
:label="$t('searchTable.form.status')"
|
||||
label="请选择状态"
|
||||
>
|
||||
<a-select
|
||||
v-model="formModel.enableState"
|
||||
:options="statusOptions"
|
||||
:placeholder="$t('searchTable.form.status.placeholder')"
|
||||
placeholder="请选择状态"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -85,13 +85,13 @@
|
||||
<template #icon>
|
||||
<icon-search />
|
||||
</template>
|
||||
{{ $t('searchTable.form.search') }}
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="reset">
|
||||
<template #icon>
|
||||
<icon-refresh />
|
||||
</template>
|
||||
{{ $t('searchTable.form.reset') }}
|
||||
重置
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
@ -107,7 +107,7 @@
|
||||
<template #icon>
|
||||
<icon-download size="18" />
|
||||
</template>
|
||||
{{ $t('searchTable.operation.download') }}
|
||||
导出
|
||||
</a-button>
|
||||
</a-col>
|
||||
<a-col
|
||||
@ -119,14 +119,14 @@
|
||||
padding-bottom: 20px;
|
||||
"
|
||||
>
|
||||
<a-tooltip :content="$t('searchTable.actions.refresh')">
|
||||
<a-tooltip content="刷新">
|
||||
<div class="action-icon" @click="search">
|
||||
<icon-refresh size="18" />
|
||||
</div>
|
||||
</a-tooltip>
|
||||
|
||||
<a-dropdown @select="handleSelectDensity">
|
||||
<a-tooltip :content="$t('searchTable.actions.density')">
|
||||
<a-tooltip content="密度">
|
||||
<div class="action-icon"><icon-line-height size="18" /></div>
|
||||
</a-tooltip>
|
||||
<template #content>
|
||||
@ -141,7 +141,7 @@
|
||||
</template>
|
||||
</a-dropdown>
|
||||
|
||||
<a-tooltip :content="$t('searchTable.actions.columnSetting')">
|
||||
<a-tooltip content="列设置">
|
||||
<a-popover
|
||||
trigger="click"
|
||||
position="bl"
|
||||
@ -245,10 +245,9 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { UserRecord, UserParams } from '@/api/user';
|
||||
import { getAllDeptTree } from '@/api/dept';
|
||||
// import { getAllDeptTree } from '@/api/dept';
|
||||
import { Pagination } from '@/types/global';
|
||||
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
||||
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
||||
@ -272,7 +271,6 @@ const generateFormModel = () => {
|
||||
};
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const { t } = useI18n();
|
||||
const renderData = ref<UserRecord[]>([]);
|
||||
const formModel = ref(generateFormModel());
|
||||
|
||||
@ -298,66 +296,66 @@ const pagination: Pagination = {
|
||||
|
||||
const columns = computed<TableColumnData[]>(() => [
|
||||
{
|
||||
title: t('userTable.columns.index'),
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
slotName: 'index',
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
title: t('userTable.columns.username'),
|
||||
title: '用户名',
|
||||
dataIndex: 'username',
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('userTable.columns.phone'),
|
||||
title: '电话',
|
||||
dataIndex: 'phone',
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('userTable.columns.email'),
|
||||
title: '邮箱',
|
||||
dataIndex: 'email',
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('userTable.columns.nickName'),
|
||||
title: '昵称',
|
||||
dataIndex: 'nickName',
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('userTable.columns.address'),
|
||||
title: '地址',
|
||||
dataIndex: 'address',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: t('userTable.columns.enabled'),
|
||||
title: '是否启用',
|
||||
dataIndex: 'enableState',
|
||||
slotName: 'enableState',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.operations'),
|
||||
title: '操作',
|
||||
dataIndex: 'operations',
|
||||
slotName: 'operations',
|
||||
},
|
||||
]);
|
||||
const statusOptions = computed<SelectOptionData[]>(() => [
|
||||
{
|
||||
label: t('searchTable.form.status.enable'),
|
||||
label: '启用',
|
||||
value: 'true',
|
||||
},
|
||||
{
|
||||
label: t('searchTable.form.status.disable'),
|
||||
label: '停用',
|
||||
value: 'false',
|
||||
},
|
||||
]);
|
||||
const deptTreeData = ref<any[]>([]);
|
||||
// const deptTreeData = ref<any[]>([]);
|
||||
|
||||
// 获取用户列表
|
||||
const fetchData = async (
|
||||
@ -379,12 +377,12 @@ const fetchData = async (
|
||||
};
|
||||
|
||||
// 获取部门树
|
||||
const getDeptTree = async () => {
|
||||
const res = await getAllDeptTree(0);
|
||||
if (res.status === 200) {
|
||||
deptTreeData.value = res.data;
|
||||
}
|
||||
}
|
||||
// const getDeptTree = async () => {
|
||||
// const res = await getAllDeptTree(0);
|
||||
// if (res.status === 200) {
|
||||
// deptTreeData.value = res.data;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 下载表格
|
||||
const generateExcel = () => {
|
||||
@ -420,14 +418,13 @@ const onPageChange = (current: number) => {
|
||||
};
|
||||
|
||||
// 数据条数改变
|
||||
const onSizeChange = (size: number) => {
|
||||
pagination.size = size;
|
||||
search();
|
||||
};
|
||||
// const onSizeChange = (size: number) => {
|
||||
// pagination.size = size;
|
||||
// search();
|
||||
// };
|
||||
|
||||
onMounted(() => {
|
||||
search();
|
||||
// getDeptTree()
|
||||
})
|
||||
|
||||
// 重置
|
||||
@ -446,27 +443,27 @@ const enabledStatus = async (record: any) => {
|
||||
const res = await userStore.enabledUser(record.id);
|
||||
if (res.status === 200) {
|
||||
Message.success({
|
||||
content: t('modify.status.sucess'),
|
||||
content: '修改状态成功',
|
||||
duration: 3 * 1000,
|
||||
});
|
||||
} else {
|
||||
Message.error({
|
||||
content: t('modify.status.fail'),
|
||||
content: '修改状态失败',
|
||||
duration: 3 * 1000,
|
||||
});
|
||||
}
|
||||
};
|
||||
const generateQueryParams = () => {
|
||||
return {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: undefined,
|
||||
phonenumber: undefined,
|
||||
status: undefined,
|
||||
deptId: undefined,
|
||||
params: undefined,
|
||||
};
|
||||
};
|
||||
// const generateQueryParams = () => {
|
||||
// return {
|
||||
// pageNum: 1,
|
||||
// pageSize: 10,
|
||||
// userName: undefined,
|
||||
// phonenumber: undefined,
|
||||
// status: undefined,
|
||||
// deptId: undefined,
|
||||
// params: undefined,
|
||||
// };
|
||||
// };
|
||||
const handleSelectDept = (id: any[]) => {
|
||||
const [deptId] = id;
|
||||
formModel.value.deptId = deptId;
|
||||
|
@ -45,7 +45,7 @@
|
||||
const renderData = ref<any>([]);
|
||||
// const attachmentList = ref<any>([]);
|
||||
const fetchData = async (Id: number) => {
|
||||
const res = await bulletinStore.queryBulletinListAll(Id);
|
||||
const res = await bulletinStore.queryBulletinDetail(Id);
|
||||
// attachmentList.value = await bulletinStore.queryAttachmentInfo(
|
||||
// '28452d83420650425d45110c6417bf693b966b29'
|
||||
// );
|
||||
|
@ -45,7 +45,7 @@
|
||||
const renderData = ref<any>([]);
|
||||
// const attachmentList = ref<any>([]);
|
||||
const fetchData = async (Id: number) => {
|
||||
const res = await bulletinStore.queryBulletinListAll(Id);
|
||||
const res = await bulletinStore.queryBulletinDetail(Id);
|
||||
// attachmentList.value = await bulletinStore.queryAttachmentInfo(
|
||||
// '28452d83420650425d45110c6417bf693b966b29'
|
||||
// );
|
||||
|
@ -75,7 +75,6 @@
|
||||
:columns="(cloneColumns as TableColumnData[])"
|
||||
:data="renderData"
|
||||
:bordered="false"
|
||||
:size="sizeof"
|
||||
:style="highlightRow"
|
||||
style="margin-bottom: 40px"
|
||||
:filter-icon-align-left="alignLeft"
|
||||
@ -105,7 +104,6 @@
|
||||
<a-pagination
|
||||
style="float: right; position: relative; right: 1px; bottom: 25px"
|
||||
:total="pagination.total"
|
||||
:size="sizeof"
|
||||
show-total
|
||||
show-jumper
|
||||
show-page-size
|
||||
@ -122,7 +120,7 @@
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import dayjs from 'dayjs';
|
||||
import { Pagination } from '@/types/global';
|
||||
import usePagination from '@/hooks/pagination';
|
||||
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
||||
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
||||
import { useBulletinsStore } from '@/store';
|
||||
@ -138,6 +136,7 @@
|
||||
publishTimeEnd: '',
|
||||
};
|
||||
};
|
||||
const { pagination,setPagination } = usePagination(true);
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const renderData = ref<BulletinsRecord[]>([]);
|
||||
@ -145,21 +144,11 @@
|
||||
|
||||
const {
|
||||
cloneColumns,
|
||||
showColumns,
|
||||
densityList,
|
||||
handleSelectDensity,
|
||||
handleChange,
|
||||
popupVisibleChange,
|
||||
deepClone,
|
||||
} = useTableOption();
|
||||
const sizeof=useTableOption().size;
|
||||
|
||||
const bulletinsStore = useBulletinsStore();
|
||||
|
||||
const pagination: any = {
|
||||
size: 10,
|
||||
current: 1
|
||||
};
|
||||
|
||||
const columns = computed<TableColumnData[]>(() => [
|
||||
{
|
||||
@ -204,9 +193,7 @@
|
||||
try {
|
||||
const res = await bulletinsStore.getBulletinsList(params);
|
||||
renderData.value = res.data.records;
|
||||
pagination.page = res.data.page;
|
||||
pagination.current = res.data.current;
|
||||
pagination.total = res.data.total;
|
||||
setPagination(res.data);
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
|
@ -39,17 +39,17 @@
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="nickName"
|
||||
:label="$t('user.info.nickName')"
|
||||
label="昵称"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: $t('userSetting.form.error.nickname.required'),
|
||||
message: '请输入昵称',
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.nickName"
|
||||
:placeholder="$t('userSetting.basicInfo.placeholder.nickname')"
|
||||
placeholder="请输入昵称"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
|
@ -18,6 +18,7 @@
|
||||
$t('userSetting.passwordReset.form.label.newPassword.placeholder')
|
||||
"
|
||||
allow-clear
|
||||
autocomplete="new-password"
|
||||
>
|
||||
</a-input-password>
|
||||
</a-form-item>
|
||||
@ -33,6 +34,7 @@
|
||||
$t('userSetting.passwordReset.form.label.confirmPassword.placeholder')
|
||||
"
|
||||
allow-clear
|
||||
autocomplete="new-password"
|
||||
>
|
||||
</a-input-password>
|
||||
</a-form-item>
|
||||
|
Loading…
Reference in New Issue
Block a user