Compare commits
2 Commits
a47ff8d3e1
...
5333df4619
Author | SHA1 | Date |
---|---|---|
|
5333df4619 | |
|
0b2ad00cfe |
98
ReadMe.md
98
ReadMe.md
|
@ -2,13 +2,11 @@
|
|||
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> 前端项目整体都由此模板开发
|
||||
>
|
||||
> 项目由[小铭](https://github.com/xiaoxian521)开源权限模板[Pure-admin](https://pure-admin.github.io/vue-pure-admin/)
|
||||
> 开源权限模板[Pure-admin](https://pure-admin.github.io/vue-pure-admin/)
|
||||
>
|
||||
> **Pure-admin文档**:https://pure-admin.github.io/pure-admin-doc
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> **默认凭证**
|
||||
>
|
||||
> 项目中有一个默认管理员,数据库中用户`id`是`1`:
|
||||
>
|
||||
|
@ -24,7 +22,9 @@
|
|||
>
|
||||
> `$2a$10$h5BUwmMaVcEuu7Bz0TPPy.PQV8JP6CFJlbHTgT78G1s0YPIu2kfXe`
|
||||
|
||||
## 视频说明地址
|
||||
可粗可细的权限控制,多平台文件上传。
|
||||
|
||||
## 📽️视频说明地址
|
||||
|
||||
**介绍视频视频**
|
||||
|
||||
|
@ -51,10 +51,24 @@
|
|||
|
||||
一个基于 Spring Security 6 的现代化动态权限控制系统,提供完整的 RBAC 权限管理解决方案。支持前后端分离架构,可灵活配置细粒度权限控制。
|
||||
|
||||
## ✨ v4.0.0 重大更新
|
||||
## 😋控制器上注解说明
|
||||
|
||||
整个项目是基于URL,方便定义权限接口,即使项目中接口不存在,通过URL的方式增删权限。
|
||||
|
||||
比如项目需要为`dept`分配了角色,这个角色可以访问`dept`下所有的接口,那么就可以写成`api/dept/**`,如果需要`dept`下某个接口,`/api/dept/aaa/bbb`,这种形式。
|
||||
|
||||
如果针对分页查询,分页参数写在URL上的,可以这样做,`/api/dept/*/*`这样就可以做到灵活的权限控制。
|
||||
|
||||
但是在部分场景下,接口就是我们的权限,这时如果手动一个一个添加URL很麻烦,所以使用的swagger自带的注解和`PermissionTag`,自定义的注解的方式,如果这时的项目需求是,为整个接口添加权限,就可以用反射的方式添加。
|
||||
|
||||
使用放射的方式已经放在controller的目录下,看`ReadMe`文档即可。
|
||||
|
||||
## ✨重大更新
|
||||
|
||||
### 核心改进
|
||||
|
||||
**v4.0.0**
|
||||
|
||||
- **全面重构**:后端接口、实体类等重构,前端重构部分j+优化操作体验
|
||||
- **批量操作支持**:
|
||||
- ✅菜单管理:完善属性内容
|
||||
|
@ -62,27 +76,13 @@
|
|||
- ✅ 角色管理:支持 Excel 批量更新
|
||||
- ✅ 多语言配置:支持 JSON/Excel 更新(全量替换模式)
|
||||
|
||||
### 技术亮点
|
||||
**v4.0.1**
|
||||
|
||||
- **注解扫描**:通过 `AnnotationScanner.java` 自动扫描想要的注解
|
||||
- 文件系统支持多平台,只需要手动配置即可。
|
||||
- 有需要参考文档:https://x-file-storage.xuyanwu.cn/#/
|
||||
- 文件删除和下载等需要实现对应接口`FileRecorder `,目前以实现,对应代码和控制器都在文件夹`file`下,如有需要修改可以参考【x-file-storage】文档修改。
|
||||
|
||||
```java
|
||||
// 示例:扫描特定注解的类
|
||||
public static Set<Class<?>> getClassesWithAnnotation(Class<?> annotation) {
|
||||
// 实现细节...
|
||||
}
|
||||
```
|
||||
|
||||
- **应用场景**:
|
||||
- 定时任务配置
|
||||
- 权限接口发现
|
||||
|
||||
### 界面优化
|
||||
|
||||

|
||||

|
||||
|
||||
## :tipping_hand_man:用法提示
|
||||
## 🧠用法提示
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
|
@ -124,17 +124,15 @@ http.authorizeHttpRequests(auth -> auth
|
|||
|
||||
### Maven工程结构
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
|
||||
父工程 -->|主项目| auth-api
|
||||
父工程 -->|代码生成器| generator-code
|
||||
auth-api -->|启动项、控制器| service
|
||||
service -->|mapper| dao
|
||||
service -->|包含domain、配置等| auth-core
|
||||
dao -->|包含domain、配置等| auth-core
|
||||
|
||||
|
||||
```
|
||||
bunny-auth/
|
||||
├── auth-api # 接口定义层
|
||||
├── auth-core # 核心模块
|
||||
│ ├── config # 安全配置
|
||||
│ └── domain # domain
|
||||
│ └── ...... # 还要很多...
|
||||
├── service # 业务实现
|
||||
└── dao # 数据持久层
|
||||
```
|
||||
|
||||
## 🛠️ 应用场景
|
||||
|
@ -164,10 +162,12 @@ dao -->|包含domain、配置等| auth-core
|
|||
|
||||
```java
|
||||
@Tag(name = "系统权限")
|
||||
@PermissionTag(permission = "permission::*")
|
||||
@RestController
|
||||
@RequestMapping("api/permission")
|
||||
public class PermissionController {
|
||||
@Operation(summary = "分页查询", tags = {"permission::page"})
|
||||
@Operation(summary = "分页查询")
|
||||
@PermissionTag(permission = "permission::query")
|
||||
@GetMapping("{page}/{limit}")
|
||||
public Result<PageResult<PermissionVo>> getPermissionPage(
|
||||
@PathVariable Integer page,
|
||||
|
@ -196,20 +196,20 @@ AntPath详情:https://juejin.cn/spost/7498247273660743732
|
|||
|
||||
## 🧰 技术栈
|
||||
|
||||
### 前端
|
||||
### 😄前端
|
||||
|
||||
- Vue 3 + PureAdmin 模板
|
||||
- 自定义权限组件
|
||||
- 国际化支持
|
||||
|
||||
### 后端
|
||||
### 😃后端
|
||||
|
||||
- Spring Boot 3 + Spring Security 6
|
||||
- JDK 17
|
||||
- MySQL + Redis + MinIO
|
||||
- Swagger + Knife4j 文档
|
||||
|
||||
### 开发环境
|
||||
### 😀开发环境
|
||||
|
||||
根据不同docker 启动方式不一样
|
||||
|
||||
|
@ -254,19 +254,11 @@ docker compose up -d
|
|||
|
||||
## 📈 后续规划
|
||||
|
||||
- [x] 权限级别拖拽
|
||||
- [x] 权限树型结构动态添加、更新、删除
|
||||
- [ ] 用户设置持久化存储到数据库
|
||||
- [x] 权限弹窗页面优化
|
||||
- [x] 后端文档注释完善
|
||||
- [x] 系统监控后端返回403停止请求
|
||||
- [x] 优化用户配置权限逻辑,配置后热更新逻辑等
|
||||
- [x] 完善后端注释,有需要添加ReadMe文档
|
||||
- [x] 获取Redis中活跃用户
|
||||
暂无
|
||||
|
||||
## 前后端接口规范
|
||||
## 📏前后端接口规范
|
||||
|
||||
### 前端示例规范
|
||||
### 🌐前端示例规范
|
||||
|
||||
| **操作** | **API 层** | **Pinia 层** |
|
||||
| :------- | :------------ | :-------------- |
|
||||
|
@ -277,7 +269,7 @@ docker compose up -d
|
|||
| 更新数据 | `updateUser` | `editUser` |
|
||||
| 删除数据 | `deleteUser` | `removeUser` |
|
||||
|
||||
### 后端接口示例规范
|
||||
### 🛟后端接口示例规范
|
||||
|
||||
遵循Restful
|
||||
|
||||
|
|
|
@ -23,6 +23,14 @@ server {
|
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
# 后端跨域请求
|
||||
location ~/peiqi/ {
|
||||
proxy_pass http://172.17.0.1:8000;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
error_page 404 404.html;
|
||||
|
||||
|
|
|
@ -29,11 +29,6 @@ export const downloadFilesByFileId = (data: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
/** 系统文件管理---获取所有文件类型 */
|
||||
export const getMediaTypeList = () => {
|
||||
return http.request<BaseResult<any>>('get', `files/private/getMediaTypeList`);
|
||||
};
|
||||
|
||||
/** 系统文件管理---获取所有文件存储基础路径 */
|
||||
export const getFilesStoragePath = () => {
|
||||
return http.request<BaseResult<any>>('get', `files/private/getAllFilesStoragePath`);
|
||||
|
|
|
@ -10,3 +10,8 @@ export const fetchRouterAsync = () => {
|
|||
export const uploadFile = (data: any) => {
|
||||
return http.request<BaseResult<any>>('post', '/files/private/upload', { data }, { headers: { 'Content-Type': 'multipart/form-data' } });
|
||||
};
|
||||
|
||||
/** 上传文件 */
|
||||
export const uploadImage = (data: any) => {
|
||||
return http.request<BaseResult<any>>('post', '/files/private/uploadImage', { data }, { headers: { 'Content-Type': 'multipart/form-data' } });
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ import { Plus } from '@element-plus/icons-vue';
|
|||
import { ElMessage, UploadRawFile, UploadRequestOptions } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { SystemEnum } from '@/enums/upload';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { uploadImage } from '@/api/v1/system/system';
|
||||
import ImageLoading from '@/components/Upload/ImageLoading.vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -28,10 +28,7 @@ const emits = defineEmits(['uploadCallback']);
|
|||
|
||||
const imageSrc = ref('');
|
||||
|
||||
/**
|
||||
* * 上传时
|
||||
* @param options
|
||||
*/
|
||||
/* 上传图片 */
|
||||
const onUpload = async (options: UploadRequestOptions) => {
|
||||
// 整理参数
|
||||
const file = options.file;
|
||||
|
@ -39,14 +36,12 @@ const onUpload = async (options: UploadRequestOptions) => {
|
|||
const data = { file, type };
|
||||
|
||||
// 上传文件并返回文件地址
|
||||
const result: any = await uploadFile(data);
|
||||
imageSrc.value = result.data.url;
|
||||
const result: any = await uploadImage(data);
|
||||
imageSrc.value = result.data.thUrl;
|
||||
emits('uploadCallback', result);
|
||||
};
|
||||
|
||||
/**
|
||||
* * 删除图片
|
||||
*/
|
||||
/* 删除图片 */
|
||||
const onRemoveImage = () => {
|
||||
// 清除图片地址和文件信息
|
||||
imageSrc.value = '';
|
||||
|
@ -63,9 +58,7 @@ const onRemoveImage = () => {
|
|||
emits('uploadCallback', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* * 上传之前
|
||||
*/
|
||||
/* 上传之前 */
|
||||
const beforeUpload = (file: UploadRawFile) => {
|
||||
if (file.size > SystemEnum.IMAGE_SIZE) {
|
||||
ElMessage.error(SystemEnum.IMAGE_MESSAGE);
|
||||
|
@ -73,9 +66,7 @@ const beforeUpload = (file: UploadRawFile) => {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* * 初始化图片地址
|
||||
*/
|
||||
/* 初始化图片地址 */
|
||||
const handleInitiateImageSrc = () => {
|
||||
const value = props.imageUrl;
|
||||
if (value) imageSrc.value = value;
|
||||
|
@ -85,17 +76,3 @@ onMounted(() => {
|
|||
handleInitiateImageSrc();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
//.el-upload {
|
||||
// width: 128px;
|
||||
// height: 128px;
|
||||
//}
|
||||
//
|
||||
//.el-upload-dragger {
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
// height: 100%;
|
||||
//}
|
||||
</style>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { deleteFiles, fetchAddFiles, getFilesPage, getFilesStoragePath, getMediaTypeList, updateFiles } from '@/api/v1/files';
|
||||
import { deleteFiles, fetchAddFiles, getFilesPage, getFilesStoragePath, updateFiles } from '@/api/v1/files';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
|
@ -12,8 +12,6 @@ export const useFilesStore = defineStore('filesStore', {
|
|||
return {
|
||||
// 系统文件表列表
|
||||
datalist: [],
|
||||
// 所有文件类型
|
||||
allMediaTypes: [],
|
||||
// 所有文件存储路径
|
||||
allFilesStoragePath: [],
|
||||
// 查询表单
|
||||
|
@ -23,7 +21,11 @@ export const useFilesStore = defineStore('filesStore', {
|
|||
// 文件在服务器上的存储路径
|
||||
filepath: undefined,
|
||||
// 文件的MIME类型
|
||||
fileType: undefined,
|
||||
contentType: undefined,
|
||||
// 扩展名
|
||||
ext: undefined,
|
||||
// 存储平台
|
||||
platform: undefined,
|
||||
// 下载数量
|
||||
downloadCount: undefined,
|
||||
},
|
||||
|
@ -46,7 +48,6 @@ export const useFilesStore = defineStore('filesStore', {
|
|||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
delete data.total;
|
||||
delete data.background;
|
||||
|
||||
// 获取系统文件表列表
|
||||
const result = await getFilesPage(data);
|
||||
|
@ -74,14 +75,6 @@ export const useFilesStore = defineStore('filesStore', {
|
|||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 获取所有文件类型 */
|
||||
async loadMediaTypeList() {
|
||||
const result = await getMediaTypeList();
|
||||
if (result.code === 200) {
|
||||
this.allMediaTypes = result.data;
|
||||
}
|
||||
},
|
||||
|
||||
/** 获取所有文件类型 */
|
||||
async loadFilesStoragePath() {
|
||||
const result = await getFilesStoragePath();
|
||||
|
|
|
@ -22,6 +22,17 @@ export const useUserStore = defineStore('system-user', {
|
|||
isRemembered: true,
|
||||
// 登录页的免登录存储几天,默认7天
|
||||
readMeDay: 7,
|
||||
// 用户修改信息列表
|
||||
userinfoForm: {
|
||||
avatar: '',
|
||||
username: '',
|
||||
nickname: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
summary: '',
|
||||
password: '',
|
||||
sex: '',
|
||||
},
|
||||
}),
|
||||
actions: {
|
||||
/** 登入 */
|
||||
|
|
|
@ -44,4 +44,14 @@ export type userType = {
|
|||
permissions?: Array<string>;
|
||||
isRemembered?: boolean;
|
||||
readMeDay?: number;
|
||||
userinfoForm?: {
|
||||
avatar: string;
|
||||
username: string;
|
||||
nickname: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
summary: string;
|
||||
password: string;
|
||||
sex: string;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,14 +4,19 @@ import { sexConstant } from '@/enums/baseConstant';
|
|||
import { $t } from '@/plugins/i18n';
|
||||
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||
import { message } from '@/utils/message';
|
||||
import { cropperBlob, handleSubmitImage, isShow, onSearchByUserinfo, rules, uploadAvatarSrc, userInfos } from '@/views/account-settings/utils';
|
||||
import { rules } from '@/views/account-settings/utils/columns';
|
||||
import uploadLine from '~icons/ri/upload-line';
|
||||
import { deviceDetection } from '@pureadmin/utils';
|
||||
import { createFormData, deviceDetection } from '@pureadmin/utils';
|
||||
import type { FormInstance } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useUserStore } from '@/store/system/user';
|
||||
import { uploadImage } from '@/api/v1/system/system';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
const adminUserStore = useAdminUserStore();
|
||||
|
||||
const userStore = useUserStore();
|
||||
const { userinfoForm } = storeToRefs(userStore);
|
||||
// 用户表单Ref
|
||||
const userInfoFormRef = ref<FormInstance>();
|
||||
// 上传图片Ref
|
||||
|
@ -20,6 +25,12 @@ const uploadRef = ref();
|
|||
const cropRef = ref();
|
||||
// 剪裁完成后头像地址,base64内容
|
||||
const imgBase64Src = ref('');
|
||||
// 剪裁头像是否显示
|
||||
const isShow = ref(false);
|
||||
// 剪裁完成后头像数据
|
||||
const cropperBlob = ref();
|
||||
// 上传地址路径
|
||||
const uploadAvatarSrc = ref();
|
||||
|
||||
/** 关闭弹窗 */
|
||||
const handleClose = () => {
|
||||
|
@ -41,16 +52,50 @@ const onChange = (uploadFile: any) => {
|
|||
reader.readAsDataURL(uploadFile.raw);
|
||||
};
|
||||
|
||||
/** 获取用户信息内容 */
|
||||
const onSearchByUserinfo = async () => {
|
||||
const data = await userStore.loadUserinfo();
|
||||
userinfoForm.value.summary = data.personDescription;
|
||||
userinfoForm.value.avatar = data.avatar;
|
||||
userinfoForm.value.username = data.username;
|
||||
userinfoForm.value.nickname = data.nickname;
|
||||
userinfoForm.value.email = data.email;
|
||||
userinfoForm.value.phone = data.phone;
|
||||
userinfoForm.value.nickname = data.nickname;
|
||||
userinfoForm.value.password = data.password;
|
||||
userinfoForm.value.sex = data.sex;
|
||||
};
|
||||
|
||||
/** 修改头像 */
|
||||
const handleSubmitImage = async () => {
|
||||
// 上传头像表单
|
||||
const formData = createFormData({
|
||||
files: new File([cropperBlob.value], 'avatar'),
|
||||
type: 'avatar',
|
||||
});
|
||||
|
||||
// 上传头像
|
||||
const result = await uploadImage(formData);
|
||||
|
||||
// 上传成功后关闭弹窗
|
||||
if (result.code === 200) {
|
||||
uploadAvatarSrc.value = result.data.url;
|
||||
userinfoForm.value.avatar = result.data.thUrl;
|
||||
message($t('upload_success'), { type: 'success' });
|
||||
isShow.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交表单 */
|
||||
const onSubmit = async (formEl: FormInstance) => {
|
||||
await formEl.validate(async (valid) => {
|
||||
if (valid) {
|
||||
// 如果用户修改了头像,将上传的路径赋值进去
|
||||
const avatar = uploadAvatarSrc.value;
|
||||
if (avatar) userInfos.avatar = avatar;
|
||||
if (avatar) userinfoForm.value.avatar = avatar;
|
||||
|
||||
// 更新用户信息
|
||||
const result = await adminUserStore.editUserinfo(userInfos);
|
||||
const result = await adminUserStore.editUserinfo(userinfoForm.value);
|
||||
if (!result) return;
|
||||
|
||||
// 重新加载用户信息
|
||||
|
@ -71,9 +116,9 @@ onMounted(() => {
|
|||
<h3 class="my-8">个人信息</h3>
|
||||
|
||||
<!-- 头像 -->
|
||||
<el-form ref="userInfoFormRef" :model="userInfos" :rules="rules" label-position="top">
|
||||
<el-form ref="userInfoFormRef" :model="userinfoForm" :rules="rules" label-position="top">
|
||||
<el-form-item :label="$t('avatar')">
|
||||
<el-avatar :size="80" :src="userInfos.avatar" />
|
||||
<el-avatar :size="80" :src="userinfoForm.avatar" />
|
||||
<el-upload ref="uploadRef" :auto-upload="false" :limit="1" :on-change="onChange" :show-file-list="false" accept="image/*">
|
||||
<el-button class="ml-4" plain>
|
||||
<IconifyIconOffline :icon="uploadLine" />
|
||||
|
@ -89,27 +134,27 @@ onMounted(() => {
|
|||
|
||||
<!-- 用户名 -->
|
||||
<el-form-item :label="$t('adminUser_username')" prop="username">
|
||||
<el-input v-model="userInfos.username" :placeholder="$t('adminUser_username')" autocomplete="off" disabled type="text" />
|
||||
<el-input v-model="userinfoForm.username" :placeholder="$t('adminUser_username')" autocomplete="off" disabled type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 昵称 -->
|
||||
<el-form-item :label="$t('adminUser_nickname')" prop="nickname">
|
||||
<el-input v-model="userInfos.nickname" :placeholder="$t('adminUser_nickname')" autocomplete="off" type="text" />
|
||||
<el-input v-model="userinfoForm.nickname" :placeholder="$t('adminUser_nickname')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 邮箱 -->
|
||||
<el-form-item :label="$t('adminUser_email')" prop="email">
|
||||
<el-input v-model="userInfos.email" :placeholder="$t('adminUser_email')" autocomplete="off" type="text" />
|
||||
<el-input v-model="userinfoForm.email" :placeholder="$t('adminUser_email')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 手机号 -->
|
||||
<el-form-item :label="$t('adminUser_phone')" prop="phone">
|
||||
<el-input v-model="userInfos.phone" :placeholder="$t('adminUser_phone')" autocomplete="off" type="text" />
|
||||
<el-input v-model="userinfoForm.phone" :placeholder="$t('adminUser_phone')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 性别 -->
|
||||
<el-form-item :label="$t('adminUser_sex')" prop="sex">
|
||||
<el-select v-model="userInfos.sex" :placeholder="$t('adminUser_sex')" clearable filterable>
|
||||
<el-select v-model="userinfoForm.sex" :placeholder="$t('adminUser_sex')" clearable filterable>
|
||||
<el-option v-for="(item, index) in sexConstant" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -117,7 +162,7 @@ onMounted(() => {
|
|||
<!-- 用户简介 -->
|
||||
<el-form-item :label="$t('adminUser_summary')" prop="summary">
|
||||
<el-input
|
||||
v-model="userInfos.summary"
|
||||
v-model="userinfoForm.summary"
|
||||
:autosize="{ minRows: 3, maxRows: 6 }"
|
||||
:placeholder="$t('adminUser_summary')"
|
||||
autocomplete="off"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { useUserLoginLogStore } from '@/store/monitor/userLoginLog';
|
||||
import { columns } from '@/views/account-settings/utils';
|
||||
import { columns } from '@/views/account-settings/utils/columns';
|
||||
import { PureTable } from '@pureadmin/table';
|
||||
import { deviceDetection } from '@pureadmin/utils';
|
||||
import { onMounted, reactive } from 'vue';
|
||||
|
|
|
@ -3,14 +3,18 @@ import Text from '@/components/ReText';
|
|||
import LaySidebarTopCollapse from '@/layout/components/lay-sidebar/components/SidebarTopCollapse.vue';
|
||||
import { useDataThemeChange } from '@/layout/hooks/useDataThemeChange';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { panes, userInfos } from '@/views/account-settings/utils';
|
||||
import { panes } from '@/views/account-settings/utils/columns';
|
||||
import leftLine from '~icons/ri/arrow-left-s-line';
|
||||
import { deviceDetection, useGlobal } from '@pureadmin/utils';
|
||||
import { onBeforeMount, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useUserStore } from '@/store/system/user';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
const router = useRouter();
|
||||
const isOpen = ref(!deviceDetection());
|
||||
const userStore = useUserStore();
|
||||
const { userinfoForm } = storeToRefs(userStore);
|
||||
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||
const witchPane = ref('profile');
|
||||
|
||||
|
@ -36,13 +40,13 @@ onBeforeMount(() => {
|
|||
</el-menu-item>
|
||||
|
||||
<div class="flex items-center ml-8 mt-4 mb-4">
|
||||
<el-avatar :size="48" :src="userInfos.avatar" />
|
||||
<el-avatar :size="48" :src="userinfoForm.avatar" />
|
||||
<div class="ml-4 flex flex-col max-w-[130px]">
|
||||
<Text class="font-bold !self-baseline">
|
||||
{{ userInfos.nickname }}
|
||||
{{ userinfoForm.nickname }}
|
||||
</Text>
|
||||
<Text class="!self-baseline" type="info">
|
||||
{{ userInfos.username }}
|
||||
{{ userinfoForm.username }}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
import { useUserStore } from '@/store/system/user';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { createFormData } from '@pureadmin/utils';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { message } from '@/utils/message';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
// 剪裁完成后头像数据
|
||||
export const cropperBlob = ref();
|
||||
// 上传地址路径
|
||||
export const uploadAvatarSrc = ref();
|
||||
|
||||
// 剪裁头像是否显示
|
||||
export const isShow = ref(false);
|
||||
|
||||
// 用户信息内容
|
||||
export const userInfos = reactive({
|
||||
avatar: '',
|
||||
username: '',
|
||||
nickname: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
summary: '',
|
||||
password: '',
|
||||
sex: '',
|
||||
});
|
||||
|
||||
/** 获取用户信息内容 */
|
||||
export const onSearchByUserinfo = async () => {
|
||||
const data = await userStore.loadUserinfo();
|
||||
userInfos.summary = data.personDescription;
|
||||
userInfos.avatar = data.avatar;
|
||||
userInfos.username = data.username;
|
||||
userInfos.nickname = data.nickname;
|
||||
userInfos.email = data.email;
|
||||
userInfos.phone = data.phone;
|
||||
userInfos.nickname = data.nickname;
|
||||
userInfos.password = data.password;
|
||||
userInfos.sex = data.sex;
|
||||
};
|
||||
|
||||
/** 修改头像 */
|
||||
export const handleSubmitImage = async () => {
|
||||
// 上传头像表单
|
||||
const formData = createFormData({
|
||||
files: new File([cropperBlob.value], 'avatar'),
|
||||
type: 'avatar',
|
||||
});
|
||||
|
||||
// 上传头像
|
||||
const result = await uploadFile(formData);
|
||||
|
||||
// 上传成功后关闭弹窗
|
||||
if (result.code === 200) {
|
||||
uploadAvatarSrc.value = result.data.filepath;
|
||||
userInfos.avatar = result.data.url;
|
||||
message($t('upload_success'), { type: 'success' });
|
||||
isShow.value = false;
|
||||
}
|
||||
};
|
|
@ -1,2 +0,0 @@
|
|||
export * from './hooks';
|
||||
export * from './columns';
|
|
@ -1,14 +1,12 @@
|
|||
<script lang="tsx" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { addDialog } from '@/components/ReDialog/index';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useEmailTemplateStore } from '@/store/configuration/emailTemplate';
|
||||
import { useEmailUsersStore } from '@/store/configuration/emailUsers';
|
||||
import { auth, columns, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, selectRows } from '@/views/configuration/email-template/utils';
|
||||
import { columns, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, selectRows } from '@/views/configuration/email-template/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import Delete from '~icons/ep/delete';
|
||||
|
@ -68,43 +66,41 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="emailTemplateStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('emailTemplate_templateName')" prop="templateName">
|
||||
<el-input
|
||||
v-model="emailTemplateStore.form.templateName"
|
||||
:placeholder="`${$t('input')}${$t('emailTemplate_templateName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('emailTemplate_subject')" prop="subject">
|
||||
<el-input v-model="emailTemplateStore.form.subject" :placeholder="`${$t('input')}${$t('emailTemplate_subject')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('emailTemplate_body')" prop="body">
|
||||
<el-input v-model="emailTemplateStore.form.body" :placeholder="`${$t('input')}${$t('emailTemplate_body')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('emailTemplate_type')" prop="type">
|
||||
<el-input v-model="emailTemplateStore.form.type" :placeholder="`${$t('input')}${$t('emailTemplate_type')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="emailTemplateStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="emailTemplateStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('emailTemplate_templateName')" prop="templateName">
|
||||
<el-input
|
||||
v-model="emailTemplateStore.form.templateName"
|
||||
:placeholder="`${$t('input')}${$t('emailTemplate_templateName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('emailTemplate_subject')" prop="subject">
|
||||
<el-input v-model="emailTemplateStore.form.subject" :placeholder="`${$t('input')}${$t('emailTemplate_subject')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('emailTemplate_body')" prop="body">
|
||||
<el-input v-model="emailTemplateStore.form.body" :placeholder="`${$t('input')}${$t('emailTemplate_body')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('emailTemplate_type')" prop="type">
|
||||
<el-input v-model="emailTemplateStore.form.type" :placeholder="`${$t('input')}${$t('emailTemplate_type')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="emailTemplateStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" :title="$t('emailTemplate')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<!-- 新增 -->
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button : :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(selectRows.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button : :disabled="!(selectRows.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -158,12 +154,12 @@ onMounted(() => {
|
|||
</el-button>
|
||||
|
||||
<!-- 修改 -->
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button : :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 删除 -->
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')} ${row.templateName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm : :title="`${$t('delete')} ${row.templateName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'emailTemplate::query',
|
||||
// 添加操作
|
||||
add: ['emailTemplate::add'],
|
||||
// 更新操作
|
||||
update: ['emailTemplate::update'],
|
||||
// 删除操作
|
||||
delete: ['emailTemplate::delete'],
|
||||
};
|
|
@ -21,34 +21,22 @@ export async function onSearch() {
|
|||
/** 添加邮件模板表 */
|
||||
export function onAdd() {
|
||||
const formRef = ref();
|
||||
const formInline = {
|
||||
templateName: undefined,
|
||||
emailUser: undefined,
|
||||
subject: undefined,
|
||||
isDefault: false,
|
||||
body: undefined,
|
||||
type: undefined,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('emailTemplate')}`,
|
||||
props: {
|
||||
formInline: {
|
||||
templateName: undefined,
|
||||
emailUser: undefined,
|
||||
subject: undefined,
|
||||
isDefault: false,
|
||||
body: undefined,
|
||||
type: undefined,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(EmailTemplateDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
templateName: undefined,
|
||||
emailUser: undefined,
|
||||
subject: undefined,
|
||||
isDefault: false,
|
||||
body: undefined,
|
||||
type: undefined,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(EmailTemplateDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -66,34 +54,22 @@ export function onAdd() {
|
|||
/* 更新邮件模板表 */
|
||||
export function onUpdate(row: any) {
|
||||
const formRef = ref();
|
||||
|
||||
const formInline = {
|
||||
templateName: row.templateName,
|
||||
emailUser: row.emailUser,
|
||||
subject: row.subject,
|
||||
isDefault: row.isDefault,
|
||||
body: row.body,
|
||||
type: row.type,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('emailTemplate')}`,
|
||||
props: {
|
||||
formInline: {
|
||||
templateName: row.templateName,
|
||||
emailUser: row.emailUser,
|
||||
subject: row.subject,
|
||||
isDefault: row.isDefault,
|
||||
body: row.body,
|
||||
type: row.type,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(EmailTemplateDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
templateName: row.templateName,
|
||||
emailUser: row.emailUser,
|
||||
subject: row.subject,
|
||||
isDefault: row.isDefault,
|
||||
body: row.body,
|
||||
type: row.type,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(EmailTemplateDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,24 +1,11 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { enabledOrNotStatus } from '@/enums/baseConstant';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useEmailUsersStore } from '@/store/configuration/emailUsers';
|
||||
import {
|
||||
auth,
|
||||
columns,
|
||||
deleteIds,
|
||||
onAdd,
|
||||
onChangeDefault,
|
||||
onDelete,
|
||||
onDeleteBatch,
|
||||
onSearch,
|
||||
onUpdate,
|
||||
switchLoadMap,
|
||||
} from '@/views/configuration/email-user/utils';
|
||||
import { columns, deleteIds, onAdd, onChangeDefault, onDelete, onDeleteBatch, onSearch, onUpdate, switchLoadMap } from '@/views/configuration/email-user/utils';
|
||||
import { usePublicHooks } from '@/views/hooks';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
|
@ -67,65 +54,58 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="emailUsersStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 邮箱-->
|
||||
<el-form-item :label="$t('emailUsers_email')" prop="email">
|
||||
<el-input v-model="emailUsersStore.form.email" :placeholder="`${$t('input')}${$t('emailUsers_email')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form ref="formRef" :inline="true" :model="emailUsersStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 邮箱-->
|
||||
<el-form-item :label="$t('emailUsers_email')" prop="email">
|
||||
<el-input v-model="emailUsersStore.form.email" :placeholder="`${$t('input')}${$t('emailUsers_email')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- host地址-->
|
||||
<el-form-item :label="$t('emailUsers_host')" prop="host">
|
||||
<el-input v-model="emailUsersStore.form.host" :placeholder="`${$t('input')}${$t('emailUsers_host')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- host地址-->
|
||||
<el-form-item :label="$t('emailUsers_host')" prop="host">
|
||||
<el-input v-model="emailUsersStore.form.host" :placeholder="`${$t('input')}${$t('emailUsers_host')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 端口号-->
|
||||
<el-form-item :label="$t('emailUsers_port')" prop="port">
|
||||
<el-input
|
||||
v-model="emailUsersStore.form.port"
|
||||
:placeholder="`${$t('input')}${$t('emailUsers_port')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
max="99999"
|
||||
min="0"
|
||||
type="number"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 端口号-->
|
||||
<el-form-item :label="$t('emailUsers_port')" prop="port">
|
||||
<el-input
|
||||
v-model="emailUsersStore.form.port"
|
||||
:placeholder="`${$t('input')}${$t('emailUsers_port')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
max="99999"
|
||||
min="0"
|
||||
type="number"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 协议 -->
|
||||
<el-form-item :label="$t('emailUsers_smtpAgreement')" prop="smtpAgreement">
|
||||
<el-input
|
||||
v-model="emailUsersStore.form.smtpAgreement"
|
||||
:placeholder="`${$t('input')}${$t('emailUsers_smtpAgreement')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 协议 -->
|
||||
<el-form-item :label="$t('emailUsers_smtpAgreement')" prop="smtpAgreement">
|
||||
<el-input v-model="emailUsersStore.form.smtpAgreement" :placeholder="`${$t('input')}${$t('emailUsers_smtpAgreement')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 是否启用SSL -->
|
||||
<el-form-item label="SSL" prop="openSSL">
|
||||
<el-select v-model="emailUsersStore.form.openSSL" class="!w-[180px]" clearable filterable placeholder="SSL">
|
||||
<el-option v-for="(item, index) in enabledOrNotStatus" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 是否启用SSL -->
|
||||
<el-form-item label="SSL" prop="openSSL">
|
||||
<el-select v-model="emailUsersStore.form.openSSL" class="!w-[180px]" clearable filterable placeholder="SSL">
|
||||
<el-option v-for="(item, index) in enabledOrNotStatus" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="emailUsersStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="emailUsersStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" :title="$t('email_user_send_config')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button : :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button : :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -182,16 +162,16 @@ onMounted(() => {
|
|||
|
||||
<!-- 插槽-更新用户 -->
|
||||
<template #updateUser="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" v-show="row.updateUser" link type="primary" @click="selectUserinfo(row.updateUser)">
|
||||
<el-button v-show="row.updateUser" : link type="primary" @click="selectUserinfo(row.updateUser)">
|
||||
{{ row.updateUsername }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button : :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.email}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm : :title="`${$t('delete')}${row.email}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'emailUsers::query',
|
||||
// 添加操作
|
||||
add: ['emailUsers::add'],
|
||||
// 更新操作
|
||||
update: ['emailUsers::update'],
|
||||
// 删除操作
|
||||
delete: ['emailUsers::delete'],
|
||||
};
|
|
@ -22,24 +22,23 @@ export async function onSearch() {
|
|||
|
||||
/** 添加邮箱用户发送配置 */
|
||||
export function onAdd() {
|
||||
const formInline = {
|
||||
email: undefined,
|
||||
password: undefined,
|
||||
host: undefined,
|
||||
port: undefined,
|
||||
smtpAgreement: undefined,
|
||||
openSSL: true,
|
||||
isDefault: false,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('emailUsers')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
email: undefined,
|
||||
password: undefined,
|
||||
host: undefined,
|
||||
port: undefined,
|
||||
smtpAgreement: undefined,
|
||||
openSSL: true,
|
||||
isDefault: false,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(EmailUsersDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(EmailUsersDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -56,24 +55,23 @@ export function onAdd() {
|
|||
|
||||
/* 更新邮箱用户发送配置 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = {
|
||||
email: row.email,
|
||||
password: row.password,
|
||||
host: row.host,
|
||||
port: row.port,
|
||||
smtpAgreement: row.smtpAgreement,
|
||||
openSSL: row.openSSL,
|
||||
isDefault: row.isDefault,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('emailUsers')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
email: row.email,
|
||||
password: row.password,
|
||||
host: row.host,
|
||||
port: row.port,
|
||||
smtpAgreement: row.smtpAgreement,
|
||||
openSSL: row.openSSL,
|
||||
isDefault: row.isDefault,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(EmailUsersDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(EmailUsersDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useMenuIconStore } from '@/store/configuration/menuIcon';
|
||||
import MenuIconSelectIconName from '@/views/configuration/menu-icon/components/menu-icon-select-icon-name.vue';
|
||||
import { auth, columns, deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/configuration/menu-icon/utils';
|
||||
import { columns, deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/configuration/menu-icon/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import Delete from '~icons/ep/delete';
|
||||
|
@ -51,31 +49,29 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="menuIconStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('menuIcon_iconCode')" prop="iconCode">
|
||||
<el-input v-model="menuIconStore.form.iconCode" :placeholder="`${$t('input')} ${$t('iconCode')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menuIcon_iconName')" prop="iconName">
|
||||
<MenuIconSelectIconName :form-inline="menuIconStore.form" class="!w-[180px]" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="menuIconStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="menuIconStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('menuIcon_iconCode')" prop="iconCode">
|
||||
<el-input v-model="menuIconStore.form.iconCode" :placeholder="`${$t('input')} ${$t('iconCode')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menuIcon_iconName')" prop="iconName">
|
||||
<MenuIconSelectIconName :form-inline="menuIconStore.form" class="!w-[180px]" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="menuIconStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" :title="$t('menuIcon')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button : :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button : :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -123,10 +119,10 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button : :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.iconName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm : :title="`${$t('delete')}${row.iconName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -19,14 +19,15 @@ export async function onSearch() {
|
|||
|
||||
/** 添加系统菜单图标 */
|
||||
export function onAdd() {
|
||||
const formInline = { iconCode: undefined, iconName: undefined };
|
||||
|
||||
addDialog({
|
||||
title: `${$t('addNew')} ${$t('menuIcon')}`,
|
||||
|
||||
props: { formInline: { confirmText: '' } },
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(MenuIconDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(MenuIconDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -43,19 +44,15 @@ export function onAdd() {
|
|||
|
||||
/* 更新系统菜单图标 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = { iconCode: row.iconCode, iconName: row.iconName };
|
||||
|
||||
addDialog({
|
||||
title: `${$t('modify')} ${$t('menuIcon')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
iconCode: row.iconCode,
|
||||
iconName: row.iconName,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(MenuIconDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(MenuIconDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'i18n::query',
|
||||
// 添加操作
|
||||
add: ['i18n::add'],
|
||||
// 更新操作
|
||||
update: ['i18n::update'],
|
||||
// 删除操作
|
||||
deleted: ['i18n::delete'],
|
||||
// 下载多语言配置
|
||||
download: ['i18n::update', 'i18n::download'],
|
||||
};
|
|
@ -26,14 +26,15 @@ export const downloadI18nSetting = (type: string) => {
|
|||
/* 上传多语言配置 */
|
||||
export const updateI18nSetting = (fileType: string) => {
|
||||
const uploadFormRef = ref();
|
||||
const form = { type: '', file: undefined, fileType, isAppend: true };
|
||||
|
||||
addDialog({
|
||||
title: $t('update_multilingual'),
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
props: { form: { type: undefined, file: undefined, fileType, isAppend: true } },
|
||||
contentRenderer: () => h(I18NUploadDialog, { ref: uploadFormRef, form: { type: '', file: undefined, fileType, isAppend: true } }),
|
||||
props: { form },
|
||||
contentRenderer: () => h(I18NUploadDialog, { ref: uploadFormRef, form }),
|
||||
beforeSure: async (done, { options }) => {
|
||||
uploadFormRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
@ -48,13 +49,15 @@ export const updateI18nSetting = (fileType: string) => {
|
|||
|
||||
/* 行内容添加 打开添加弹窗 */
|
||||
export const onAdd = () => {
|
||||
const formInline = { keyName: '', translation: '', typeName: '' };
|
||||
|
||||
addDialog({
|
||||
title: $t('addMultilingual'),
|
||||
props: { formInline: { keyName: '', translation: '', typeName: '' } },
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(I18nDialog, { ref: formRef, formInline: { keyName: '', translation: '', typeName: '' } }),
|
||||
contentRenderer: () => h(I18nDialog, { ref: formRef, formInline }),
|
||||
footerButtons: [
|
||||
{
|
||||
label: $t('cancel'),
|
||||
|
@ -102,21 +105,14 @@ export const onAdd = () => {
|
|||
/* 当表格修改时 */
|
||||
export const onUpdate = (row: any) => {
|
||||
const id = row.id;
|
||||
|
||||
const formInline = { keyName: row.keyName, translation: row.translation, typeName: row.typeName };
|
||||
addDialog({
|
||||
title: $t('update_multilingual'),
|
||||
|
||||
props: {
|
||||
formInline: { keyName: row.keyName, translation: row.translation, typeName: row.typeName },
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(I18nDialog, {
|
||||
ref: formRef,
|
||||
formInline: { keyName: row.keyName, translation: row.translation, typeName: row.typeName },
|
||||
}),
|
||||
contentRenderer: () => h(I18nDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormProps;
|
||||
formRef.value.ruleFormRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -4,9 +4,8 @@ import { PureTableBar } from '@/components/RePureTableBar';
|
|||
import TableIsDefaultTag from '@/components/Table/TableIsDefaultTag.vue';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { userI18nTypeStore } from '@/store/i18n/i18nType';
|
||||
import { auth, columns, onAdd, onDelete, onSearch, onUpdate } from '@/views/i18n/i18n-type-setting/utils';
|
||||
import { columns, onAdd, onDelete, onSearch, onUpdate } from '@/views/i18n/i18n-type-setting/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import Delete from '~icons/ep/delete';
|
||||
|
@ -50,7 +49,7 @@ onMounted(() => {
|
|||
|
||||
<PureTableBar :columns="columns" :title="$t('i18n_type')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button : :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -92,10 +91,10 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button : :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')} ${row.typeName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm : :title="`${$t('delete')} ${row.typeName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
export const auth = {
|
||||
// 添加操作
|
||||
add: ['i18nType::add'],
|
||||
// 更新操作
|
||||
update: ['i18nType::update'],
|
||||
// 删除操作
|
||||
delete: ['i18nType::delete'],
|
||||
};
|
|
@ -17,16 +17,15 @@ export async function onSearch() {
|
|||
|
||||
/* 添加多语言 */
|
||||
export function onAdd() {
|
||||
const formInline = { typeName: '', summary: '', isDefault: false };
|
||||
|
||||
addDialog({
|
||||
title: `添加多语言类型`,
|
||||
|
||||
props: {
|
||||
formInline: { typeName: '', summary: '', isDefault: false },
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(AddI18nType, { ref: formRef }),
|
||||
contentRenderer: () => h(AddI18nType, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -43,20 +42,15 @@ export function onAdd() {
|
|||
|
||||
/* 更新内容 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = { typeName: row.typeName, summary: row.summary, isDefault: row.isDefault };
|
||||
|
||||
addDialog({
|
||||
title: `修改多语言类型`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
typeName: row.typeName,
|
||||
summary: row.summary,
|
||||
isDefault: row.isDefault,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(AddI18nType, { ref: formRef }),
|
||||
contentRenderer: () => h(AddI18nType, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -4,11 +4,7 @@ import 'md-editor-v3/lib/style.css';
|
|||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { formState } from '@/views/message-manger/message-editing/utils';
|
||||
|
||||
/**
|
||||
* * 上传图片
|
||||
* @param files
|
||||
* @param callback
|
||||
*/
|
||||
/* 上传图片 */
|
||||
const onUploadImg = async (files: any, callback: any) => {
|
||||
// 上传图片等待结果
|
||||
const res = await Promise.all(
|
||||
|
@ -17,6 +13,9 @@ const onUploadImg = async (files: any, callback: any) => {
|
|||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
form.append('type', 'message');
|
||||
|
||||
// markdown上传使用普通上传文件的方式
|
||||
// md图片和富文本编辑器不能是缩略图,因为看不清楚
|
||||
resolve(await uploadFile(form));
|
||||
});
|
||||
})
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<script lang="ts" setup>
|
||||
import {
|
||||
auth,
|
||||
beforeUpload,
|
||||
coverUrl,
|
||||
formState,
|
||||
|
@ -23,7 +22,6 @@ import { useMessageSendStore } from '@/store/message/messageSend';
|
|||
import { usePublicHooks } from '@/views/hooks';
|
||||
import { Plus } from '@element-plus/icons-vue';
|
||||
import ImageLoading from '@/components/Upload/ImageLoading.vue';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
|
||||
const formRef = ref();
|
||||
// 用户是否停用样式
|
||||
|
@ -163,12 +161,12 @@ onMounted(() => {
|
|||
|
||||
<!-- 消息等级简介 -->
|
||||
<el-form-item :label="$t('extra')" prop="extra">
|
||||
<el-input v-model="formState.extra" maxlength="5" show-word-limit type="text" />
|
||||
<el-input v-model="formState.extra" maxlength="4" show-word-limit type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 提交 -->
|
||||
<el-form-item>
|
||||
<div v-if="hasAuth(auth.add)" class="grid grid-cols-2 w-[100%]">
|
||||
<div class="grid grid-cols-2 w-[100%]">
|
||||
<el-button bg class="w-[100%]" text type="primary" @click="submitForm(formRef)">{{ $t('submit') }}</el-button>
|
||||
<el-button bg class="w-[100%]" text @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</div>
|
||||
|
|
|
@ -27,10 +27,8 @@ editorConfig.MENU_CONF['uploadImage'] = {
|
|||
customInsert(res: any, insertFn) {
|
||||
// res.data.url是后端返回的图片地址,根据实际业务改写
|
||||
if (res.data.url) {
|
||||
setTimeout(() => {
|
||||
// insertFn插入图片进编辑器
|
||||
insertFn(res.data.url);
|
||||
}, 2000);
|
||||
// insertFn插入图片进编辑器
|
||||
insertFn(res.data.url);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
export const auth = {
|
||||
// 添加操作
|
||||
add: ['message::add'],
|
||||
};
|
|
@ -2,7 +2,7 @@ import { reactive, ref } from 'vue';
|
|||
import type { UploadRawFile, UploadRequestOptions } from 'element-plus';
|
||||
import { SystemEnum } from '@/enums/upload';
|
||||
import { message } from '@/utils/message';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { uploadImage } from '@/api/v1/system/system';
|
||||
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||
|
||||
// 用户信息列表
|
||||
|
@ -36,9 +36,9 @@ export const onSearchUserinfo = async (keyword: string) => {
|
|||
/** 上传时 */
|
||||
export const onUpload = async (options: UploadRequestOptions) => {
|
||||
const data = { file: options.file, type: 'message' };
|
||||
const result: any = await uploadFile(data);
|
||||
coverUrl.value = result.data.url;
|
||||
formState.cover = result.data.filepath;
|
||||
const result: any = await uploadImage(data);
|
||||
coverUrl.value = result.data.thUrl;
|
||||
formState.cover = result.data.thUrl;
|
||||
};
|
||||
|
||||
/** 上传之前 */
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { isReadStatus } from '@/enums/baseConstant';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useMessageReceivedStore } from '@/store/message/messageReceived';
|
||||
import { useMessageTypeStore } from '@/store/message/messageType';
|
||||
import { messageLevel } from '@/views/message-manger/message-editing/utils';
|
||||
import { auth, columns, onDeleteBatch, onSearch, selectIds, updateMarkMessageReceived } from '@/views/message-manger/message-received/utils';
|
||||
import { columns, onDeleteBatch, onSearch, selectIds, updateMarkMessageReceived } from '@/views/message-manger/message-received/utils';
|
||||
import { Message } from '@element-plus/icons-vue';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
|
@ -55,100 +53,78 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="messageReceivedStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 消息标题 -->
|
||||
<el-form-item :label="$t('title')" prop="title">
|
||||
<el-input v-model="messageReceivedStore.form.title" :placeholder="`${$t('input')}${$t('title')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form ref="formRef" :inline="true" :model="messageReceivedStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 消息标题 -->
|
||||
<el-form-item :label="$t('title')" prop="title">
|
||||
<el-input v-model="messageReceivedStore.form.title" :placeholder="`${$t('input')}${$t('title')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 发送人昵称 -->
|
||||
<el-form-item :label="$t('sendNickname')" prop="sendNickname">
|
||||
<el-input v-model="messageReceivedStore.form.sendNickname" :placeholder="`${$t('input')}${$t('sendNickname')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- 发送人昵称 -->
|
||||
<el-form-item :label="$t('sendNickname')" prop="sendNickname">
|
||||
<el-input v-model="messageReceivedStore.form.sendNickname" :placeholder="`${$t('input')}${$t('sendNickname')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 消息类型 -->
|
||||
<el-form-item :label="$t('messageType')" prop="messageType">
|
||||
<el-select
|
||||
v-model="messageReceivedStore.form.messageType"
|
||||
:placeholder="`${$t('select')}${$t('messageType')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in messageTypeStore.allMessageTypeList"
|
||||
:key="index"
|
||||
:label="item.messageName"
|
||||
:navigationBar="false"
|
||||
:value="item.messageType"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 消息类型 -->
|
||||
<el-form-item :label="$t('messageType')" prop="messageType">
|
||||
<el-select v-model="messageReceivedStore.form.messageType" :placeholder="`${$t('select')}${$t('messageType')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option
|
||||
v-for="(item, index) in messageTypeStore.allMessageTypeList"
|
||||
:key="index"
|
||||
:label="item.messageName"
|
||||
:navigationBar="false"
|
||||
:value="item.messageType"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 编辑器类型 -->
|
||||
<el-form-item :label="$t('editorType')" prop="editorType">
|
||||
<el-select v-model="messageReceivedStore.form.editorType" :placeholder="`${$t('select')}${$t('editorType')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in ['rich', 'markdown']" :key="index" :label="item" :navigationBar="false" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 编辑器类型 -->
|
||||
<el-form-item :label="$t('editorType')" prop="editorType">
|
||||
<el-select v-model="messageReceivedStore.form.editorType" :placeholder="`${$t('select')}${$t('editorType')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in ['rich', 'markdown']" :key="index" :label="item" :navigationBar="false" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 消息等级 -->
|
||||
<el-form-item :label="$t('level')" prop="level">
|
||||
<el-select v-model="messageReceivedStore.form.level" :placeholder="$t('level')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||
<el-option v-for="item in messageLevel" :key="item" :label="$t(item)" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 消息等级 -->
|
||||
<el-form-item :label="$t('level')" prop="level">
|
||||
<el-select v-model="messageReceivedStore.form.level" :placeholder="$t('level')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||
<el-option v-for="item in messageLevel" :key="item" :label="$t(item)" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 消息等级简介 -->
|
||||
<el-form-item :label="$t('extra')" prop="extra">
|
||||
<el-input v-model="messageReceivedStore.form.extra" class="!w-[180px]" maxlength="20" minlength="10" show-word-limit type="text" />
|
||||
</el-form-item>
|
||||
<!-- 消息等级简介 -->
|
||||
<el-form-item :label="$t('extra')" prop="extra">
|
||||
<el-input v-model="messageReceivedStore.form.extra" class="!w-[180px]" maxlength="20" minlength="10" show-word-limit type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 0:未读 1:已读 -->
|
||||
<el-form-item :label="$t('status')" prop="status">
|
||||
<el-select v-model="messageReceivedStore.form.status" :placeholder="$t('status')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||
<el-option v-for="(item, index) in isReadStatus" :key="index" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 0:未读 1:已读 -->
|
||||
<el-form-item :label="$t('status')" prop="status">
|
||||
<el-select v-model="messageReceivedStore.form.status" :placeholder="$t('status')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||
<el-option v-for="(item, index) in isReadStatus" :key="index" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="messageReceivedStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="messageReceivedStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" title="系统消息" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- 标为已读 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.update)"
|
||||
:disabled="!(selectIds.length > 0)"
|
||||
:icon="useRenderIcon('octicon:read-24')"
|
||||
plain
|
||||
type="primary"
|
||||
@click="updateMarkMessageReceived(true)"
|
||||
>
|
||||
<el-button :disabled="!(selectIds.length > 0)" :icon="useRenderIcon('octicon:read-24')" plain type="primary" @click="updateMarkMessageReceived(true)">
|
||||
{{ $t('markAsRead') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 标为未读 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.update)"
|
||||
:disabled="!(selectIds.length > 0)"
|
||||
:icon="Message"
|
||||
plain
|
||||
type="primary"
|
||||
@click="updateMarkMessageReceived(false)"
|
||||
>
|
||||
<el-button :disabled="!(selectIds.length > 0)" :icon="Message" plain type="primary" @click="updateMarkMessageReceived(false)">
|
||||
{{ $t('markAsUnread') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(selectIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(selectIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('delete_batches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'messageReceived::query',
|
||||
// 更新操作
|
||||
update: ['messageReceived::update'],
|
||||
// 删除操作
|
||||
delete: ['messageReceived::delete'],
|
||||
};
|
|
@ -1,3 +1,2 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { MdEditor } from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { uploadImage } from '@/api/v1/system/system';
|
||||
import { updateMessage } from '@/views/message-manger/message-send/utils';
|
||||
|
||||
/* 上传图片 */
|
||||
|
@ -13,7 +13,7 @@ const onUploadImg = async (files: any, callback: any) => {
|
|||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
form.append('type', 'message');
|
||||
resolve(await uploadFile(form));
|
||||
resolve(await uploadImage(form));
|
||||
});
|
||||
})
|
||||
);
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { isReadStatus } from '@/enums/baseConstant';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useMessageSendStore } from '@/store/message/messageSend';
|
||||
import { useMessageTypeStore } from '@/store/message/messageType';
|
||||
import { messageLevel } from '@/views/message-manger/message-editing/utils';
|
||||
import { auth, columns, deleteIds, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/message-manger/message-send/utils';
|
||||
import { columns, deleteIds, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/message-manger/message-send/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
@ -55,70 +53,68 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.search">
|
||||
<el-form ref="formRef" :inline="true" :model="messageSendStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 消息标题 -->
|
||||
<el-form-item :label="$t('title')" prop="title">
|
||||
<el-input v-model="messageSendStore.form.title" :placeholder="`${$t('input')}${$t('title')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form ref="formRef" :inline="true" :model="messageSendStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 消息标题 -->
|
||||
<el-form-item :label="$t('title')" prop="title">
|
||||
<el-input v-model="messageSendStore.form.title" :placeholder="`${$t('input')}${$t('title')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 发送人昵称 -->
|
||||
<el-form-item :label="$t('sendNickname')" prop="sendNickname">
|
||||
<el-input v-model="messageSendStore.form.sendNickname" :placeholder="`${$t('input')}${$t('sendNickname')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- 发送人昵称 -->
|
||||
<el-form-item :label="$t('sendNickname')" prop="sendNickname">
|
||||
<el-input v-model="messageSendStore.form.sendNickname" :placeholder="`${$t('input')}${$t('sendNickname')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 消息类型 -->
|
||||
<el-form-item :label="$t('messageType')" prop="messageType">
|
||||
<el-select v-model="messageSendStore.form.messageType" :placeholder="`${$t('select')}${$t('messageType')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option
|
||||
v-for="(item, index) in messageTypeStore.allMessageTypeList"
|
||||
:key="index"
|
||||
:label="item.messageName"
|
||||
:navigationBar="false"
|
||||
:value="item.messageType"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 消息类型 -->
|
||||
<el-form-item :label="$t('messageType')" prop="messageType">
|
||||
<el-select v-model="messageSendStore.form.messageType" :placeholder="`${$t('select')}${$t('messageType')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option
|
||||
v-for="(item, index) in messageTypeStore.allMessageTypeList"
|
||||
:key="index"
|
||||
:label="item.messageName"
|
||||
:navigationBar="false"
|
||||
:value="item.messageType"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 编辑器类型 -->
|
||||
<el-form-item :label="$t('editorType')" prop="editorType">
|
||||
<el-select v-model="messageSendStore.form.editorType" :placeholder="`${$t('select')}${$t('editorType')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in ['rich', 'markdown']" :key="index" :label="item" :navigationBar="false" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 编辑器类型 -->
|
||||
<el-form-item :label="$t('editorType')" prop="editorType">
|
||||
<el-select v-model="messageSendStore.form.editorType" :placeholder="`${$t('select')}${$t('editorType')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in ['rich', 'markdown']" :key="index" :label="item" :navigationBar="false" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 消息等级 -->
|
||||
<el-form-item :label="$t('level')" prop="level">
|
||||
<el-select v-model="messageSendStore.form.level" :placeholder="$t('level')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||
<el-option v-for="item in messageLevel" :key="item" :label="$t(item)" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 消息等级 -->
|
||||
<el-form-item :label="$t('level')" prop="level">
|
||||
<el-select v-model="messageSendStore.form.level" :placeholder="$t('level')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||
<el-option v-for="item in messageLevel" :key="item" :label="$t(item)" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 消息等级简介 -->
|
||||
<el-form-item :label="$t('extra')" prop="extra">
|
||||
<el-input v-model="messageSendStore.form.extra" class="!w-[180px]" maxlength="20" minlength="10" show-word-limit type="text" />
|
||||
</el-form-item>
|
||||
<!-- 消息等级简介 -->
|
||||
<el-form-item :label="$t('extra')" prop="extra">
|
||||
<el-input v-model="messageSendStore.form.extra" class="!w-[180px]" maxlength="20" minlength="10" show-word-limit type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 0:未读 1:已读 -->
|
||||
<el-form-item :label="$t('status')" prop="status">
|
||||
<el-select v-model="messageSendStore.form.status" :placeholder="$t('status')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||
<el-option v-for="(item, index) in isReadStatus" :key="index" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 0:未读 1:已读 -->
|
||||
<el-form-item :label="$t('status')" prop="status">
|
||||
<el-select v-model="messageSendStore.form.status" :placeholder="$t('status')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||
<el-option v-for="(item, index) in isReadStatus" :key="index" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="messageSendStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="messageSendStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" title="系统消息" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.deleted)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('delete_batches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -186,10 +182,10 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.deleted)" :title="`${$t('delete')}${row.title}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')}${row.title}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
search: 'message::getMessageList',
|
||||
// 添加操作
|
||||
add: ['message::addMessage'],
|
||||
// 更新操作
|
||||
update: ['message::updateMessage'],
|
||||
// 删除操作
|
||||
deleted: ['message::deleteMessage'],
|
||||
};
|
|
@ -6,7 +6,7 @@ import { $t } from '@/plugins/i18n';
|
|||
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||
import { decode, encode } from 'js-base64';
|
||||
import type { UploadRequestOptions } from 'element-plus';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { uploadImage } from '@/api/v1/system/system';
|
||||
import { useMessageSendStore } from '@/store/message/messageSend';
|
||||
|
||||
export const formRef = ref();
|
||||
|
@ -150,7 +150,7 @@ export const onDeleteBatch = async () => {
|
|||
/** 上传时 */
|
||||
export const onUpload = async (options: UploadRequestOptions) => {
|
||||
const data = { file: options.file, type: 'message' };
|
||||
const result: any = await uploadFile(data);
|
||||
coverUrl.value = result.data.url;
|
||||
updateMessage.cover = result.data.filepath;
|
||||
const result: any = await uploadImage(data);
|
||||
coverUrl.value = result.data.thUrl;
|
||||
updateMessage.cover = result.data.thUrl;
|
||||
};
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { enabledOrNotStatus } from '@/enums/baseConstant';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useMessageTypeStore } from '@/store/message/messageType';
|
||||
import { usePublicHooks } from '@/views/hooks';
|
||||
import { auth, columns, deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/message-manger/message-type/utils';
|
||||
import { columns, deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/message-manger/message-type/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
@ -56,47 +54,45 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="messageTypeStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 消息名称 -->
|
||||
<el-form-item :label="$t('messageName')" prop="messageName">
|
||||
<el-input v-model="messageTypeStore.form.messageName" :placeholder="`${$t('input')}${$t('messageName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form ref="formRef" :inline="true" :model="messageTypeStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 消息名称 -->
|
||||
<el-form-item :label="$t('messageName')" prop="messageName">
|
||||
<el-input v-model="messageTypeStore.form.messageName" :placeholder="`${$t('input')}${$t('messageName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 消息类型 -->
|
||||
<el-form-item :label="$t('messageType')" prop="messageType">
|
||||
<el-input v-model="messageTypeStore.form.messageType" :placeholder="`${$t('input')}${$t('messageType')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- 消息类型 -->
|
||||
<el-form-item :label="$t('messageType')" prop="messageType">
|
||||
<el-input v-model="messageTypeStore.form.messageType" :placeholder="`${$t('input')}${$t('messageType')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 消息备注 -->
|
||||
<el-form-item :label="$t('summary')" prop="summary">
|
||||
<el-input v-model="messageTypeStore.form.summary" :placeholder="`${$t('input')}${$t('summary')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- 消息备注 -->
|
||||
<el-form-item :label="$t('summary')" prop="summary">
|
||||
<el-input v-model="messageTypeStore.form.summary" :placeholder="`${$t('input')}${$t('summary')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 是否启用 -->
|
||||
<el-form-item :label="$t('status')" prop="status">
|
||||
<el-select v-model="messageTypeStore.form.status" :placeholder="`${$t('select')}${$t('status')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in enabledOrNotStatus" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 是否启用 -->
|
||||
<el-form-item :label="$t('status')" prop="status">
|
||||
<el-select v-model="messageTypeStore.form.status" :placeholder="`${$t('select')}${$t('status')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in enabledOrNotStatus" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="messageTypeStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="messageTypeStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" title="系统消息类型" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('delete_batches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -151,10 +147,10 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.messageName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')}${row.messageName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'messageType::query',
|
||||
// 添加操作
|
||||
add: ['messageType::add'],
|
||||
// 更新操作
|
||||
update: ['messageType::update'],
|
||||
// 删除操作
|
||||
delete: ['messageType::delete'],
|
||||
};
|
|
@ -20,21 +20,14 @@ export async function onSearch() {
|
|||
|
||||
/** 添加系统消息类型 */
|
||||
export function onAdd() {
|
||||
const formInline = { status: true, messageName: undefined, messageType: undefined, summary: undefined };
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('messageType')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
status: true,
|
||||
messageName: undefined,
|
||||
messageType: undefined,
|
||||
summary: undefined,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(MessageTypeDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(MessageTypeDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -51,21 +44,15 @@ export function onAdd() {
|
|||
|
||||
/* 更新系统消息类型 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = { status: row.status, messageName: row.messageName, messageType: row.messageType, summary: row.summary };
|
||||
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('messageType')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
status: row.status,
|
||||
messageName: row.messageName,
|
||||
messageType: row.messageType,
|
||||
summary: row.summary,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(MessageTypeDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(MessageTypeDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useQuartzExecuteLogStore } from '@/store/monitor/quartzExecuteLog';
|
||||
import { auth, columns, deleteIds, onDelete, onDeleteBatch, onSearch, onView, state } from '@/views/monitor/scheduler-execute-log/utils';
|
||||
import { columns, deleteIds, onDelete, onDeleteBatch, onSearch, onView, state } from '@/views/monitor/scheduler-execute-log/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
@ -53,61 +51,54 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.search">
|
||||
<el-form ref="formRef" :inline="true" :model="quartzExecuteLogStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobName')" prop="jobName">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.jobName"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_jobName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobGroup')" prop="jobGroup">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.jobGroup"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_jobGroup')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobClassName')" prop="jobClassName">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.jobClassName"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_jobClassName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('quartzExecuteLog_cronExpression')" prop="cronExpression">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.cronExpression"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_cronExpression')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('quartzExecuteLog_triggerName')" prop="triggerName">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.triggerName"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_triggerName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="quartzExecuteLogStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="quartzExecuteLogStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobName')" prop="jobName">
|
||||
<el-input v-model="quartzExecuteLogStore.form.jobName" :placeholder="`${$t('input')}${$t('quartzExecuteLog_jobName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobGroup')" prop="jobGroup">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.jobGroup"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_jobGroup')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobClassName')" prop="jobClassName">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.jobClassName"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_jobClassName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('quartzExecuteLog_cronExpression')" prop="cronExpression">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.cronExpression"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_cronExpression')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('quartzExecuteLog_triggerName')" prop="triggerName">
|
||||
<el-input
|
||||
v-model="quartzExecuteLogStore.form.triggerName"
|
||||
:placeholder="`${$t('input')}${$t('quartzExecuteLog_triggerName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="quartzExecuteLogStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" :title="$t('quartzExecuteLog')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -163,10 +154,10 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.search)" :icon="useRenderIcon(View)" :size="size" class="reset-margin" link type="primary" @click="onView(row)">
|
||||
<el-button :icon="useRenderIcon(View)" :size="size" class="reset-margin" link type="primary" @click="onView(row)">
|
||||
{{ $t('view') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.jobName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')}${row.jobName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
search: ['scheduleExecuteLog::query', "'scheduleExecuteLog::queryPage'"],
|
||||
// 删除操作
|
||||
delete: ['scheduleExecuteLog::delete'],
|
||||
};
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useUserLoginLogStore } from '@/store/monitor/userLoginLog';
|
||||
import { auth, columns, deleteIds, onDelete, onDeleteBatch, onSearch, onView } from '@/views/monitor/user-login-log/utils';
|
||||
import { columns, deleteIds, onDelete, onDeleteBatch, onSearch, onView } from '@/views/monitor/user-login-log/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
@ -89,12 +87,11 @@ onMounted(() => {
|
|||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<ReAuth :value="auth.search" />
|
||||
|
||||
<PureTableBar :columns="columns" :title="$t('userLoginLog')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -136,10 +133,10 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.search)" :icon="useRenderIcon(View)" :size="size" class="reset-margin" link type="primary" @click="onView(row)">
|
||||
<el-button :icon="useRenderIcon(View)" :size="size" class="reset-margin" link type="primary" @click="onView(row)">
|
||||
{{ $t('view') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.username}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')}${row.username}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useSchedulersGroupStore } from '@/store/scheduler/schedulersGroup';
|
||||
import { auth, columns, deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/scheduler/schedulers-group/utils';
|
||||
import { columns, deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/scheduler/schedulers-group/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
@ -52,41 +50,39 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="schedulersGroupStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('schedulersGroup_groupName')" prop="groupName">
|
||||
<el-input
|
||||
v-model="schedulersGroupStore.form.groupName"
|
||||
:placeholder="`${$t('input')}${$t('schedulersGroup_groupName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulersGroup_description')" prop="description">
|
||||
<el-input
|
||||
v-model="schedulersGroupStore.form.description"
|
||||
:placeholder="`${$t('input')}${$t('schedulersGroup_description')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="schedulersGroupStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="schedulersGroupStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('schedulersGroup_groupName')" prop="groupName">
|
||||
<el-input
|
||||
v-model="schedulersGroupStore.form.groupName"
|
||||
:placeholder="`${$t('input')}${$t('schedulersGroup_groupName')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulersGroup_description')" prop="description">
|
||||
<el-input
|
||||
v-model="schedulersGroupStore.form.description"
|
||||
:placeholder="`${$t('input')}${$t('schedulersGroup_description')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="schedulersGroupStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" :title="$t('schedulersGroup')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -128,10 +124,10 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.groupName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')}${row.groupName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'schedulersGroup::query',
|
||||
// 添加操作
|
||||
add: ['schedulersGroup::add'],
|
||||
// 更新操作
|
||||
update: ['schedulersGroup::update'],
|
||||
// 删除操作
|
||||
delete: ['schedulersGroup::delete'],
|
||||
};
|
|
@ -20,19 +20,15 @@ export async function onSearch() {
|
|||
|
||||
/** 添加任务调度分组 */
|
||||
export function onAdd() {
|
||||
const formInline = { groupName: undefined, description: undefined };
|
||||
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('schedulersGroup')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
groupName: undefined,
|
||||
description: undefined,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(SchedulersGroupDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(SchedulersGroupDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -49,19 +45,14 @@ export function onAdd() {
|
|||
|
||||
/* 更新任务调度分组 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = { groupName: row.groupName, description: row.description };
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('schedulersGroup')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
groupName: row.groupName,
|
||||
description: row.description,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(SchedulersGroupDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(SchedulersGroupDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -4,7 +4,6 @@ import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
|||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useSchedulersStore } from '@/store/scheduler/schedulers';
|
||||
import { auth, columns, onAdd, onDelete, onPause, onResume, onSearch, onUpdate } from '@/views/scheduler/schedulers/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
|
@ -47,38 +46,36 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="schedulersStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('schedulers_jobName')" prop="jobName">
|
||||
<el-input v-model="schedulersStore.form.jobName" :placeholder="`${$t('input')}${$t('schedulers_jobName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_jobGroup')" prop="jobGroup">
|
||||
<el-input v-model="schedulersStore.form.jobGroup" :placeholder="`${$t('input')}${$t('schedulers_jobGroup')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_description')" prop="description">
|
||||
<el-input v-model="schedulersStore.form.description" :placeholder="`${$t('input')}${$t('schedulers_description')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_jobClassName')" prop="jobClassName">
|
||||
<el-input v-model="schedulersStore.form.jobClassName" :placeholder="`${$t('input')}${$t('schedulers_jobClassName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_triggerName')" prop="triggerName">
|
||||
<el-input v-model="schedulersStore.form.triggerName" :placeholder="`${$t('input')}${$t('schedulers_triggerName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_triggerState')" prop="triggerState">
|
||||
<el-input v-model="schedulersStore.form.triggerState" :placeholder="`${$t('input')}${$t('schedulers_triggerState')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="schedulersStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="schedulersStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('schedulers_jobName')" prop="jobName">
|
||||
<el-input v-model="schedulersStore.form.jobName" :placeholder="`${$t('input')}${$t('schedulers_jobName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_jobGroup')" prop="jobGroup">
|
||||
<el-input v-model="schedulersStore.form.jobGroup" :placeholder="`${$t('input')}${$t('schedulers_jobGroup')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_description')" prop="description">
|
||||
<el-input v-model="schedulersStore.form.description" :placeholder="`${$t('input')}${$t('schedulers_description')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_jobClassName')" prop="jobClassName">
|
||||
<el-input v-model="schedulersStore.form.jobClassName" :placeholder="`${$t('input')}${$t('schedulers_jobClassName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_triggerName')" prop="triggerName">
|
||||
<el-input v-model="schedulersStore.form.triggerName" :placeholder="`${$t('input')}${$t('schedulers_triggerName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('schedulers_triggerState')" prop="triggerState">
|
||||
<el-input v-model="schedulersStore.form.triggerState" :placeholder="`${$t('input')}${$t('schedulers_triggerState')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="schedulersStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" title="Schedulers视图" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -120,7 +117,7 @@ onMounted(() => {
|
|||
|
||||
<template #operation="{ row }">
|
||||
<!-- 修改 -->
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
|
||||
|
@ -155,7 +152,7 @@ onMounted(() => {
|
|||
</ReAuth>
|
||||
|
||||
<!-- 删除 -->
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.jobName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')}${row.jobName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'schedulers::query',
|
||||
// 添加操作
|
||||
add: ['schedulers::add'],
|
||||
// 暂停
|
||||
update: ['schedulers::update'],
|
||||
pause: ['schedulers::update'],
|
||||
// 恢复
|
||||
resume: ['schedulers::update'],
|
||||
// 删除操作
|
||||
delete: ['schedulers::delete'],
|
||||
};
|
|
@ -18,22 +18,22 @@ export async function onSearch() {
|
|||
|
||||
/** 添加Schedulers视图 */
|
||||
export function onAdd() {
|
||||
const formInline = {
|
||||
jobName: undefined,
|
||||
jobGroup: undefined,
|
||||
description: undefined,
|
||||
jobClassName: undefined,
|
||||
cronExpression: undefined,
|
||||
isUpdate: false,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('schedulers')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
jobName: undefined,
|
||||
jobGroup: undefined,
|
||||
description: undefined,
|
||||
jobClassName: undefined,
|
||||
cronExpression: undefined,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(SchedulersDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(SchedulersDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -50,23 +50,22 @@ export function onAdd() {
|
|||
|
||||
/* 更新Schedulers视图 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = {
|
||||
jobName: row.jobName,
|
||||
jobGroup: row.jobGroup,
|
||||
description: row.description,
|
||||
jobClassName: row.jobClassName,
|
||||
cronExpression: row.cronExpression,
|
||||
isUpdate: true,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('schedulers')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
jobName: row.jobName,
|
||||
jobGroup: row.jobGroup,
|
||||
description: row.description,
|
||||
jobClassName: row.jobClassName,
|
||||
cronExpression: row.cronExpression,
|
||||
isUpdate: true,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(SchedulersDialog, { ref: formRef }),
|
||||
contentRenderer: () => h(SchedulersDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
<script lang="ts" setup>
|
||||
import Airplane from '@/assets/svg/airplane.svg';
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { sexConstant, tableSelectButtonClass, UserAvatar, userStatus } from '@/enums/baseConstant';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||
import { useDeptStore } from '@/store/system/dept';
|
||||
import { usePublicHooks } from '@/views/hooks';
|
||||
import Tree from '@/views/system/admin-user/components/tree.vue';
|
||||
import {
|
||||
auth,
|
||||
columns,
|
||||
deleteIds,
|
||||
deptList,
|
||||
|
@ -99,64 +96,62 @@ onMounted(() => {
|
|||
@tree-select="onTreeSelect"
|
||||
/>
|
||||
<div :class="[deviceDetection() ? ['w-full', 'mt-2'] : 'w-[calc(100%-200px)]']">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="adminUserStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 查询用户名 -->
|
||||
<el-form-item :label="$t('adminUser_username')" prop="username">
|
||||
<el-input v-model="adminUserStore.form.username" :placeholder="`${$t('input')}${$t('adminUser_username')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form ref="formRef" :inline="true" :model="adminUserStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 查询用户名 -->
|
||||
<el-form-item :label="$t('adminUser_username')" prop="username">
|
||||
<el-input v-model="adminUserStore.form.username" :placeholder="`${$t('input')}${$t('adminUser_username')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 查询昵称 -->
|
||||
<el-form-item :label="$t('adminUser_nickname')" prop="nickname">
|
||||
<el-input v-model="adminUserStore.form.nickname" :placeholder="`${$t('input')}${$t('adminUser_nickname')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- 查询昵称 -->
|
||||
<el-form-item :label="$t('adminUser_nickname')" prop="nickname">
|
||||
<el-input v-model="adminUserStore.form.nickname" :placeholder="`${$t('input')}${$t('adminUser_nickname')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 查询邮箱 -->
|
||||
<el-form-item :label="$t('adminUser_email')" prop="email">
|
||||
<el-input v-model="adminUserStore.form.email" :placeholder="`${$t('input')}${$t('adminUser_email')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- 查询邮箱 -->
|
||||
<el-form-item :label="$t('adminUser_email')" prop="email">
|
||||
<el-input v-model="adminUserStore.form.email" :placeholder="`${$t('input')}${$t('adminUser_email')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 查询手机号 -->
|
||||
<el-form-item :label="$t('adminUser_phone')" prop="phone">
|
||||
<el-input v-model="adminUserStore.form.phone" :placeholder="`${$t('input')}${$t('adminUser_phone')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- 查询手机号 -->
|
||||
<el-form-item :label="$t('adminUser_phone')" prop="phone">
|
||||
<el-input v-model="adminUserStore.form.phone" :placeholder="`${$t('input')}${$t('adminUser_phone')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 查询性别 -->
|
||||
<el-form-item :label="$t('adminUser_sex')" prop="sex">
|
||||
<el-select v-model="adminUserStore.form.sex" :placeholder="`${$t('input')}${$t('adminUser_sex')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in sexConstant" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 查询性别 -->
|
||||
<el-form-item :label="$t('adminUser_sex')" prop="sex">
|
||||
<el-select v-model="adminUserStore.form.sex" :placeholder="`${$t('input')}${$t('adminUser_sex')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in sexConstant" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 查询简介 -->
|
||||
<el-form-item :label="$t('adminUser_summary')" prop="summary">
|
||||
<el-input v-model="adminUserStore.form.summary" :placeholder="`${$t('input')}${$t('adminUser_summary')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!-- 查询简介 -->
|
||||
<el-form-item :label="$t('adminUser_summary')" prop="summary">
|
||||
<el-input v-model="adminUserStore.form.summary" :placeholder="`${$t('input')}${$t('adminUser_summary')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 查询状态 -->
|
||||
<el-form-item :label="$t('adminUser_status')" prop="status">
|
||||
<el-select v-model="adminUserStore.form.status" :placeholder="`${$t('input')}${$t('adminUser_status')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in userStatus" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 查询状态 -->
|
||||
<el-form-item :label="$t('adminUser_status')" prop="status">
|
||||
<el-select v-model="adminUserStore.form.status" :placeholder="`${$t('input')}${$t('adminUser_status')}`" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="(item, index) in userStatus" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="adminUserStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="adminUserStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" :title="$t('userinfo')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -235,20 +230,12 @@ onMounted(() => {
|
|||
|
||||
<template #operation="{ row }">
|
||||
<!-- 修改 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.update)"
|
||||
:icon="useRenderIcon(EditPen)"
|
||||
:size="size"
|
||||
class="reset-margin"
|
||||
link
|
||||
type="primary"
|
||||
@click="onUpdate(row)"
|
||||
>
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 删除 -->
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')} ${row.username}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')} ${row.username}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
@ -262,25 +249,25 @@ onMounted(() => {
|
|||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<!-- 上传头像 -->
|
||||
<el-dropdown-item v-if="hasAuth(auth.update)">
|
||||
<el-dropdown-item>
|
||||
<el-button :class="tableSelectButtonClass" :icon="useRenderIcon(Upload)" :size="size" link type="primary" @click="onUploadAvatar(row)">
|
||||
{{ $t('upload_avatar') }}
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
<!-- 重置密码 -->
|
||||
<el-dropdown-item v-if="hasAuth(auth.update)">
|
||||
<el-dropdown-item>
|
||||
<el-button :class="tableSelectButtonClass" :icon="useRenderIcon(Password)" :size="size" link type="primary" @click="onResetPassword(row)">
|
||||
{{ $t('reset_passwords') }}
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
<!-- 分配角色 -->
|
||||
<el-dropdown-item v-if="hasAuth(auth.update)">
|
||||
<el-dropdown-item>
|
||||
<el-button :class="tableSelectButtonClass" :icon="useRenderIcon(Role)" :size="size" link type="primary" @click="onAssignRolesToUser(row)">
|
||||
{{ $t('assign_roles') }}
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
<!-- 强制下线 -->
|
||||
<el-dropdown-item v-if="hasAuth(auth.update)">
|
||||
<el-dropdown-item>
|
||||
<el-button :class="tableSelectButtonClass" :icon="useRenderIcon(Airplane)" :size="size" link type="primary" @click="onForcedOffline(row)">
|
||||
{{ $t('forced_offline') }}
|
||||
</el-button>
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'user::query',
|
||||
// 添加操作
|
||||
add: ['user::add'],
|
||||
// 更新操作
|
||||
update: ['user::update'],
|
||||
// 删除操作
|
||||
delete: ['user::delete'],
|
||||
};
|
|
@ -50,41 +50,27 @@ export async function onSearch() {
|
|||
/** 添加用户信息 */
|
||||
export function onAdd() {
|
||||
isAddUserinfo.value = true;
|
||||
|
||||
const formInline = {
|
||||
username: undefined,
|
||||
nickname: undefined,
|
||||
email: undefined,
|
||||
phone: undefined,
|
||||
password: undefined,
|
||||
avatar: undefined,
|
||||
sex: undefined,
|
||||
summary: undefined,
|
||||
status: false,
|
||||
deptId: undefined,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('adminUser')}`,
|
||||
props: {
|
||||
formInline: {
|
||||
username: undefined,
|
||||
nickname: undefined,
|
||||
email: undefined,
|
||||
phone: undefined,
|
||||
password: undefined,
|
||||
avatar: undefined,
|
||||
sex: undefined,
|
||||
summary: undefined,
|
||||
status: false,
|
||||
deptId: undefined,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(AdminUserDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
username: undefined,
|
||||
nickname: undefined,
|
||||
email: undefined,
|
||||
phone: undefined,
|
||||
password: undefined,
|
||||
avatar: undefined,
|
||||
sex: undefined,
|
||||
summary: undefined,
|
||||
status: false,
|
||||
deptId: undefined,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(AdminUserDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -102,41 +88,26 @@ export function onAdd() {
|
|||
/* 更新用户信息 */
|
||||
export function onUpdate(row: any) {
|
||||
isAddUserinfo.value = false;
|
||||
|
||||
const formInline = {
|
||||
username: row.username,
|
||||
nickname: row.nickname,
|
||||
email: row.email,
|
||||
phone: row.phone,
|
||||
password: row.password,
|
||||
avatar: row.avatar,
|
||||
sex: row.sex,
|
||||
summary: row.summary,
|
||||
status: row.status,
|
||||
deptId: row.deptId,
|
||||
};
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('adminUser')}`,
|
||||
props: {
|
||||
formInline: {
|
||||
username: row.username,
|
||||
nickname: row.nickname,
|
||||
email: row.email,
|
||||
phone: row.phone,
|
||||
password: row.password,
|
||||
avatar: row.avatar,
|
||||
sex: row.sex,
|
||||
summary: row.summary,
|
||||
status: row.status,
|
||||
deptId: row.deptId,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(AdminUserDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
username: row.username,
|
||||
nickname: row.nickname,
|
||||
email: row.email,
|
||||
phone: row.phone,
|
||||
password: row.password,
|
||||
avatar: row.avatar,
|
||||
sex: row.sex,
|
||||
summary: row.summary,
|
||||
status: row.status,
|
||||
deptId: row.deptId,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(AdminUserDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -177,7 +148,6 @@ export const onDeleteBatch = async () => {
|
|||
|
||||
addDialog({
|
||||
title: $t('deleteBatchTip'),
|
||||
|
||||
props: { formInline: { confirmText: '' } },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useDeptStore } from '@/store/system/dept';
|
||||
import { handleTree } from '@/utils/tree';
|
||||
import { auth, columns, deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/system/dept/utils';
|
||||
import { columns, deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/system/dept/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
|
@ -53,22 +51,20 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="deptStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('dept_deptName')" prop="deptName">
|
||||
<el-input v-model="deptStore.form.deptName" :placeholder="`${$t('input')}${$t('dept_deptName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('dept_summary')" prop="summary">
|
||||
<el-input v-model="deptStore.form.summary" :placeholder="`${$t('input')}${$t('dept_summary')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="deptStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="deptStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('dept_deptName')" prop="deptName">
|
||||
<el-input v-model="deptStore.form.deptName" :placeholder="`${$t('input')}${$t('dept_deptName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('dept_summary')" prop="summary">
|
||||
<el-input v-model="deptStore.form.summary" :placeholder="`${$t('input')}${$t('dept_summary')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="deptStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar
|
||||
:columns="columns"
|
||||
|
@ -79,12 +75,12 @@ onMounted(() => {
|
|||
@refresh="onSearch"
|
||||
>
|
||||
<template #buttons>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd()">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd()">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -127,13 +123,13 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" :size="size" class="reset-margin" link type="primary" @click="onAdd(row.id)">
|
||||
<el-button :icon="useRenderIcon(AddFill)" :size="size" class="reset-margin" link type="primary" @click="onAdd(row.id)">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')} ${row.deptName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')} ${row.deptName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'dept::query',
|
||||
// 添加操作
|
||||
add: ['dept::add'],
|
||||
// 更新操作
|
||||
update: ['dept::update'],
|
||||
// 删除操作
|
||||
delete: ['dept::delete'],
|
||||
};
|
|
@ -19,29 +19,20 @@ export async function onSearch() {
|
|||
|
||||
/** 添加部门 */
|
||||
export function onAdd(parentId: string = '0') {
|
||||
const formInline = {
|
||||
parentId,
|
||||
manager: undefined,
|
||||
deptName: undefined,
|
||||
summary: undefined,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('dept')}`,
|
||||
props: {
|
||||
formInline: {
|
||||
parentId,
|
||||
manager: undefined,
|
||||
deptName: undefined,
|
||||
summary: undefined,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(DeptDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
parentId,
|
||||
manager: undefined,
|
||||
deptName: undefined,
|
||||
summary: undefined,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(DeptDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -58,30 +49,19 @@ export function onAdd(parentId: string = '0') {
|
|||
|
||||
/* 更新部门 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = {
|
||||
parentId: row.parentId,
|
||||
manager: row.manager ? row.manager.split(',') : row.manager,
|
||||
deptName: row.deptName,
|
||||
summary: row.summary,
|
||||
};
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('dept')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
parentId: row.parentId,
|
||||
manager: row.manager ? row.manager.split(',') : row.manager,
|
||||
deptName: row.deptName,
|
||||
summary: row.summary,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(DeptDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
parentId: row.parentId,
|
||||
manager: row.manager ? row.manager.split(',') : row.manager,
|
||||
deptName: row.deptName,
|
||||
summary: row.summary,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(DeptDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -8,12 +8,8 @@ import { UploadFilled } from '@element-plus/icons-vue';
|
|||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
||||
formInline: () => ({
|
||||
// 文件的名称
|
||||
filename: undefined,
|
||||
// 文件在服务器上的存储路径
|
||||
filepath: undefined,
|
||||
// 文件的MIME类型
|
||||
fileType: undefined,
|
||||
// 下载数量
|
||||
downloadCount: undefined,
|
||||
// 文件列表
|
||||
|
@ -37,7 +33,6 @@ const handleExceed: UploadProps['onExceed'] = (files) => {
|
|||
};
|
||||
|
||||
onMounted(() => {
|
||||
filesStore.loadMediaTypeList();
|
||||
filesStore.loadFilesStoragePath();
|
||||
});
|
||||
|
||||
|
@ -46,11 +41,6 @@ defineExpose({ formRef });
|
|||
|
||||
<template>
|
||||
<el-form ref="formRef" :model="form" :rules="form.isUpload ? uploadRules : addRules" label-width="auto">
|
||||
<!-- 文件名称---上传显示 -->
|
||||
<el-form-item v-show="form.isUpload" :label="$t('files_filename')" prop="filename">
|
||||
<el-input v-model="form.filename" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 文件路径---上传显示文本框 -->
|
||||
<el-form-item :label="$t('files_filepath')" prop="filepath">
|
||||
<el-input v-if="form.isUpload" v-model="form.filepath" autocomplete="off" disabled type="text" />
|
||||
|
@ -61,12 +51,6 @@ defineExpose({ formRef });
|
|||
</el-form-item>
|
||||
|
||||
<!-- 文件类型---上传显示 -->
|
||||
<el-form-item v-show="form.isUpload" :label="$t('files_fileType')" prop="fileType">
|
||||
<el-select v-model="form.fileType" :placeholder="$t('select') + $t('files_fileType')" clearable filterable>
|
||||
<el-option v-for="(item, index) in filesStore.allMediaTypes" :key="index" :label="item" :navigationBar="false" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('files_downloadCount')" prop="downloadCount">
|
||||
<el-input v-model="form.downloadCount" :min="0" autocomplete="off" type="number" />
|
||||
</el-form-item>
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useFilesStore } from '@/store/system/files';
|
||||
import { auth, columns, onAdd, onDelete, onDeleteBatch, onDownload, onDownloadBatch, onSearch, onUpdate, selectRows } from '@/views/system/files/utils';
|
||||
import { columns, onAdd, onDelete, onDeleteBatch, onDownload, onDownloadBatch, onSearch, onUpdate, selectRows } from '@/views/system/files/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
@ -53,57 +51,61 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="filesStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('files_filename')" prop="filename">
|
||||
<el-input v-model="filesStore.form.filename" :placeholder="`${$t('input')}${$t('files_filename')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('files_filepath')" prop="filepath">
|
||||
<el-input v-model="filesStore.form.filepath" :placeholder="`${$t('input')}${$t('files_filepath')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('files_fileType')" prop="fileType">
|
||||
<el-input v-model="filesStore.form.fileType" :placeholder="`${$t('input')}${$t('files_fileType')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('files_downloadCount')" prop="downloadCount">
|
||||
<el-input
|
||||
v-model="filesStore.form.downloadCount"
|
||||
:placeholder="`${$t('input')}${$t('files_downloadCount')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
min="0"
|
||||
type="number"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="filesStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="filesStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!--文件的名称-->
|
||||
<el-form-item :label="$t('files_filename')" prop="filename">
|
||||
<el-input v-model="filesStore.form.filename" :placeholder="`${$t('input')}${$t('files_filename')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!--文件在服务器上的存储路径-->
|
||||
<el-form-item :label="$t('files_filepath')" prop="filepath">
|
||||
<el-input v-model="filesStore.form.filepath" :placeholder="`${$t('input')}${$t('files_filepath')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!--文件的MIME类型-->
|
||||
<el-form-item :label="$t('files_fileType')" prop="contentType">
|
||||
<el-input v-model="filesStore.form.contentType" :placeholder="`${$t('input')}${$t('files_fileType')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!--扩展名-->
|
||||
<el-form-item :label="$t('ext')" prop="ext">
|
||||
<el-input v-model="filesStore.form.ext" :placeholder="`${$t('input')}${$t('ext')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!--平台-->
|
||||
<el-form-item :label="$t('platform')" prop="platform">
|
||||
<el-input v-model="filesStore.form.platform" :placeholder="`${$t('input')}${$t('platform')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<!--下载量-->
|
||||
<el-form-item :label="$t('files_downloadCount')" prop="downloadCount">
|
||||
<el-input
|
||||
v-model="filesStore.form.downloadCount"
|
||||
:placeholder="`${$t('input')}${$t('files_downloadCount')}`"
|
||||
class="!w-[180px]"
|
||||
clearable
|
||||
min="0"
|
||||
type="number"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="filesStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" :title="$t('system_file')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- 批量下载 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.download)"
|
||||
:disabled="!(selectRows.length > 0)"
|
||||
:icon="useRenderIcon(Download)"
|
||||
plain
|
||||
type="primary"
|
||||
@click="onDownloadBatch"
|
||||
>
|
||||
<el-button :disabled="!(selectRows.length > 0)" :icon="useRenderIcon(Download)" plain type="primary" @click="onDownloadBatch">
|
||||
{{ $t('download_batch') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 新增 -->
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(selectRows.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(selectRows.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -142,21 +144,13 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="hasAuth(auth.download)"
|
||||
:icon="useRenderIcon(EditPen)"
|
||||
:size="size"
|
||||
class="reset-margin"
|
||||
link
|
||||
type="primary"
|
||||
@click="onDownload(row)"
|
||||
>
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onDownload(row)">
|
||||
{{ $t('download') }}
|
||||
</el-button>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')} ${row.filename}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')} ${row.filename}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'files:query',
|
||||
// 更新操作
|
||||
update: ['files::update'],
|
||||
// 添加操作
|
||||
add: ['files::add'],
|
||||
// 删除操作
|
||||
delete: ['files::delete'],
|
||||
// 下载文件
|
||||
download: ['files::download'],
|
||||
};
|
|
@ -25,13 +25,11 @@ export async function onSearch() {
|
|||
export function onAdd() {
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('files')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
filename: undefined,
|
||||
fileType: undefined,
|
||||
filepath: undefined,
|
||||
downloadCount: 0,
|
||||
// 上传为 files,更新时为 file
|
||||
files: [],
|
||||
isUpload: false,
|
||||
},
|
||||
|
@ -43,10 +41,9 @@ export function onAdd() {
|
|||
const dialog = h(FilesDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
filename: undefined,
|
||||
fileType: undefined,
|
||||
filepath: undefined,
|
||||
downloadCount: 0,
|
||||
// 上传为 files,更新时为 file
|
||||
files: [],
|
||||
isUpload: false,
|
||||
},
|
||||
|
@ -58,14 +55,17 @@ export function onAdd() {
|
|||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
// 添加文件
|
||||
form.files = (form.files as UploadFiles).map((file) => file.raw);
|
||||
const data = {
|
||||
filepath: form.filepath,
|
||||
downloadCount: form.downloadCount,
|
||||
files: form.files,
|
||||
files: [],
|
||||
};
|
||||
|
||||
// 判断是否更新了文件
|
||||
if (form.files) {
|
||||
data.files = (form.files as UploadFiles).map((file) => file.raw);
|
||||
}
|
||||
|
||||
const result = await filesStore.addFiles(data);
|
||||
|
||||
// 成功后关闭窗口
|
||||
|
@ -79,33 +79,22 @@ export function onAdd() {
|
|||
|
||||
/* 更新系统文件表 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = {
|
||||
filepath: row.filepath,
|
||||
downloadCount: row.downloadCount,
|
||||
// 上传为 files,更新时为 file
|
||||
files: undefined,
|
||||
isUpload: true,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('files')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
filename: row.filename,
|
||||
fileType: row.fileType,
|
||||
filepath: row.filepath,
|
||||
downloadCount: row.downloadCount,
|
||||
isUpload: true,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => {
|
||||
const dialog = h(FilesDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
filename: row.filename,
|
||||
fileType: row.fileType,
|
||||
filepath: row.filepath,
|
||||
downloadCount: row.downloadCount,
|
||||
isUpload: true,
|
||||
files: undefined,
|
||||
},
|
||||
});
|
||||
const dialog = h(FilesDialog, { ref: formRef, formInline });
|
||||
formRef.value = dialog;
|
||||
return dialog;
|
||||
},
|
||||
|
@ -114,13 +103,21 @@ export function onUpdate(row: any) {
|
|||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const data = {
|
||||
id: row.id,
|
||||
filepath: form.filepath,
|
||||
downloadCount: form.downloadCount,
|
||||
file: undefined,
|
||||
isUpload: true,
|
||||
};
|
||||
|
||||
// 判断是否更新了文件
|
||||
if (form.files) {
|
||||
form.files = (form.files as UploadFiles).map((file) => file.raw);
|
||||
data.file = (form.files as UploadFiles).map((file) => file.raw)[0];
|
||||
}
|
||||
|
||||
// 更新文件
|
||||
const result = await filesStore.editFiles({ ...form, id: row.id });
|
||||
const result = await filesStore.editFiles(data);
|
||||
|
||||
// 更新完成
|
||||
if (!result) return;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
// 添加或者修改表单元素
|
||||
export interface FormItemProps {
|
||||
// 文件的名称
|
||||
filename: string;
|
||||
// 文件在服务器上的存储路径
|
||||
filepath: string;
|
||||
// 文件的MIME类型
|
||||
fileType: string;
|
||||
// 下载数量
|
||||
downloadCount: number;
|
||||
// 文件内容
|
||||
// 文件内容,添加是 files,上传是file
|
||||
files: any;
|
||||
// 是否是上传
|
||||
isUpload: boolean;
|
||||
|
|
|
@ -4,7 +4,6 @@ import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
|||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { userMenuStore } from '@/store/system/menu';
|
||||
import { auth, clearAllRolesSelect, columns, mergeArgs, onAdd, onDelete, onSearch, onUpdate, selectIds, tableRef } from '@/views/system/menu/utils';
|
||||
import PureTable from '@pureadmin/table';
|
||||
|
@ -72,19 +71,12 @@ onMounted(() => {
|
|||
>
|
||||
<template #buttons>
|
||||
<!-- 添加菜单 -->
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd()">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd()">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 清除选中所以角色 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.clearAllRolesSelect)"
|
||||
:disabled="!(selectIds.length > 0)"
|
||||
:icon="useRenderIcon('ic:baseline-clear')"
|
||||
plain
|
||||
type="danger"
|
||||
@click="clearAllRolesSelect()"
|
||||
>
|
||||
<el-button :disabled="!(selectIds.length > 0)" :icon="useRenderIcon('ic:baseline-clear')" plain type="danger" @click="clearAllRolesSelect()">
|
||||
{{ $t('clearAllRolesSelect') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -105,6 +97,7 @@ onMounted(() => {
|
|||
row-key="id"
|
||||
showOverflowTooltip
|
||||
table-layout="auto"
|
||||
@row-dblclick="(row) => onUpdate(row)"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<template #rank="{ row }">
|
||||
|
@ -125,7 +118,7 @@ onMounted(() => {
|
|||
|
||||
<template #operation="{ row }">
|
||||
<!-- 修改 -->
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
|
||||
|
@ -145,7 +138,7 @@ onMounted(() => {
|
|||
</ReAuth>
|
||||
|
||||
<!-- 删除操作 -->
|
||||
<el-popconfirm v-if="hasAuth(auth.deleted)" :title="`${$t('delete')} ${$t(row.title)}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')} ${$t(row.title)}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './modules/columns';
|
||||
export * from './modules/auth';
|
||||
export * from './modules/hooks';
|
||||
export * from './modules/types';
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
export const auth = {
|
||||
// 更新操作
|
||||
update: ['router::updateMenu'],
|
||||
// 添加操作
|
||||
add: ['router::addMenu'],
|
||||
// 分页查询
|
||||
search: 'router::menuList',
|
||||
// 删除操作
|
||||
deleted: ['router::deletedMenuByIds'],
|
||||
// 为菜单分配角色
|
||||
assignRolesToRouter: ['routerRole::assignRolesToRouter'],
|
||||
// 批量为菜单添加角色
|
||||
assignAddBatchRolesToRouter: ['routerRole::assignAddBatchRolesToRouter'],
|
||||
// 清除选中菜单所有角色
|
||||
clearAllRolesSelect: ['routerRole::clearAllRolesSelect'],
|
||||
};
|
|
@ -25,68 +25,39 @@ async function onSearch() {
|
|||
|
||||
/** 添加菜单 */
|
||||
function onAdd(parentId: any = 0) {
|
||||
const formInline = {
|
||||
menuType: 0,
|
||||
higherMenuOptions: formatHigherMenuOptions(cloneDeep(menuStore.datalist)),
|
||||
parentId,
|
||||
title: '',
|
||||
name: '',
|
||||
path: '',
|
||||
component: '',
|
||||
rank: 99,
|
||||
icon: '',
|
||||
id: '',
|
||||
extraIcon: '',
|
||||
enterTransition: '',
|
||||
leaveTransition: '',
|
||||
activePath: '',
|
||||
redirect: '',
|
||||
roles: [],
|
||||
frameSrc: '',
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
fixedTag: false,
|
||||
showLink: true,
|
||||
showParent: true,
|
||||
};
|
||||
addDialog({
|
||||
title: $t('addNew') + $t('menu'),
|
||||
props: {
|
||||
formInline: {
|
||||
menuType: 0,
|
||||
higherMenuOptions: formatHigherMenuOptions(cloneDeep(menuStore.datalist)),
|
||||
parentId,
|
||||
title: '',
|
||||
name: '',
|
||||
path: '',
|
||||
component: '',
|
||||
rank: 99,
|
||||
icon: '',
|
||||
id: '',
|
||||
extraIcon: '',
|
||||
enterTransition: '',
|
||||
leaveTransition: '',
|
||||
activePath: '',
|
||||
redirect: '',
|
||||
roles: [],
|
||||
frameSrc: '',
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
fixedTag: false,
|
||||
showLink: true,
|
||||
showParent: true,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
width: '45%',
|
||||
draggable: true,
|
||||
closeOnClickModal: false,
|
||||
fullscreenIcon: true,
|
||||
contentRenderer: () =>
|
||||
h(EditForm, {
|
||||
ref: dialogFormRef,
|
||||
formInline: {
|
||||
menuType: 0,
|
||||
higherMenuOptions: formatHigherMenuOptions(cloneDeep(menuStore.datalist)),
|
||||
parentId,
|
||||
title: '',
|
||||
name: '',
|
||||
path: '',
|
||||
component: '',
|
||||
rank: 99,
|
||||
icon: '',
|
||||
id: '',
|
||||
extraIcon: '',
|
||||
enterTransition: '',
|
||||
leaveTransition: '',
|
||||
activePath: '',
|
||||
redirect: '',
|
||||
roles: [],
|
||||
frameSrc: '',
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
fixedTag: false,
|
||||
showLink: true,
|
||||
showParent: true,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(EditForm, { ref: dialogFormRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const menuFormRef = dialogFormRef.value.menuFormRef;
|
||||
const curData = options.props.formInline as FormItemProps;
|
||||
|
@ -108,71 +79,42 @@ function onAdd(parentId: any = 0) {
|
|||
|
||||
/* 更新菜单 */
|
||||
function onUpdate(row?: FormItemProps) {
|
||||
const formInline = {
|
||||
id: row?.id,
|
||||
menuType: row?.menuType,
|
||||
higherMenuOptions: formatHigherMenuOptions(cloneDeep(menuStore.datalist)),
|
||||
parentId: row?.parentId,
|
||||
title: row?.title,
|
||||
name: row?.name,
|
||||
path: row?.path,
|
||||
component: row?.component,
|
||||
rank: row?.rank,
|
||||
icon: row?.icon,
|
||||
frameSrc: row?.frameSrc,
|
||||
extraIcon: row?.extraIcon,
|
||||
// 因为要使用动画需要在前面加上 animate__ 修改时需要手动去除
|
||||
enterTransition: row?.enterTransition?.replace('animate__', ''),
|
||||
// 因为要使用动画需要在前面加上 animate__ 修改时需要手动去除
|
||||
leaveTransition: row?.leaveTransition?.replace('animate__', ''),
|
||||
roles: row.roles,
|
||||
activePath: row?.activePath,
|
||||
frameLoading: row?.frameLoading,
|
||||
keepAlive: row?.keepAlive,
|
||||
hiddenTag: row?.hiddenTag,
|
||||
fixedTag: row?.fixedTag,
|
||||
showLink: row?.showLink,
|
||||
showParent: row?.showParent,
|
||||
redirect: row?.redirect,
|
||||
};
|
||||
addDialog({
|
||||
title: $t('update') + $t('menu'),
|
||||
props: {
|
||||
formInline: {
|
||||
id: row?.id,
|
||||
menuType: row?.menuType,
|
||||
higherMenuOptions: formatHigherMenuOptions(cloneDeep(menuStore.datalist)),
|
||||
parentId: row?.parentId,
|
||||
title: row?.title,
|
||||
name: row?.name,
|
||||
path: row?.path,
|
||||
component: row?.component,
|
||||
rank: row?.rank,
|
||||
icon: row?.icon,
|
||||
frameSrc: row?.frameSrc,
|
||||
extraIcon: row?.extraIcon,
|
||||
// 因为要使用动画需要在前面加上 animate__ 修改时需要手动去除
|
||||
enterTransition: row?.enterTransition?.replace('animate__', ''),
|
||||
// 因为要使用动画需要在前面加上 animate__ 修改时需要手动去除
|
||||
leaveTransition: row?.leaveTransition?.replace('animate__', ''),
|
||||
activePath: row?.activePath,
|
||||
frameLoading: row?.frameLoading,
|
||||
keepAlive: row?.keepAlive,
|
||||
hiddenTag: row?.hiddenTag,
|
||||
fixedTag: row?.fixedTag,
|
||||
showLink: row?.showLink,
|
||||
showParent: row?.showParent,
|
||||
redirect: row?.redirect,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
width: '45%',
|
||||
draggable: true,
|
||||
fullscreen: deviceDetection(),
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(EditForm, {
|
||||
ref: dialogFormRef,
|
||||
formInline: {
|
||||
id: row?.id,
|
||||
menuType: row?.menuType,
|
||||
higherMenuOptions: formatHigherMenuOptions(cloneDeep(menuStore.datalist)),
|
||||
parentId: row?.parentId,
|
||||
title: row?.title,
|
||||
name: row?.name,
|
||||
path: row?.path,
|
||||
component: row?.component,
|
||||
rank: row?.rank,
|
||||
icon: row?.icon,
|
||||
frameSrc: row?.frameSrc,
|
||||
extraIcon: row?.extraIcon,
|
||||
// 因为要使用动画需要在前面加上 animate__ 修改时需要手动去除
|
||||
enterTransition: row?.enterTransition?.replace('animate__', ''),
|
||||
// 因为要使用动画需要在前面加上 animate__ 修改时需要手动去除
|
||||
leaveTransition: row?.leaveTransition?.replace('animate__', ''),
|
||||
activePath: row?.activePath,
|
||||
frameLoading: row?.frameLoading,
|
||||
keepAlive: row?.keepAlive,
|
||||
hiddenTag: row?.hiddenTag,
|
||||
fixedTag: row?.fixedTag,
|
||||
showLink: row?.showLink,
|
||||
showParent: row?.showParent,
|
||||
redirect: row?.redirect,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(EditForm, { ref: dialogFormRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const menuFormRef = dialogFormRef.value.menuFormRef;
|
||||
const curData = options.props.formInline as FormItemProps;
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { addDialog } from '@/components/ReDialog/index';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { RequestMethod } from '@/enums/baseConstant';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { usePermissionStore } from '@/store/system/power';
|
||||
import { auth, columns, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, onUpdateBatchParent, powerIds } from '@/views/system/permission/utils';
|
||||
import { columns, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, onUpdateBatchParent, powerIds } from '@/views/system/permission/utils';
|
||||
import FileUploadDialog from '@/views/system/role/components/file-upload-dialog.vue';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { handleTree } from '@pureadmin/utils';
|
||||
|
@ -111,30 +109,28 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="powerStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('power_powerCode')" prop="powerCode">
|
||||
<el-input v-model="powerStore.form.powerCode" :placeholder="`${$t('input')}${$t('power_powerCode')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('power_powerName')" prop="powerName">
|
||||
<el-input v-model="powerStore.form.powerName" :placeholder="`${$t('input')}${$t('power_powerName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('power_requestUrl')" prop="requestUrl">
|
||||
<el-input v-model="powerStore.form.requestUrl" :placeholder="`${$t('input')}${$t('power_requestUrl')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('requestMethod')" prop="requestMethod">
|
||||
<el-select v-model="powerStore.form.requestMethod" :placeholder="$t('requestMethod')" autocomplete="off" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="item in RequestMethod" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="powerStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="powerStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('power_powerCode')" prop="powerCode">
|
||||
<el-input v-model="powerStore.form.powerCode" :placeholder="`${$t('input')}${$t('power_powerCode')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('power_powerName')" prop="powerName">
|
||||
<el-input v-model="powerStore.form.powerName" :placeholder="`${$t('input')}${$t('power_powerName')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('power_requestUrl')" prop="requestUrl">
|
||||
<el-input v-model="powerStore.form.requestUrl" :placeholder="`${$t('input')}${$t('power_requestUrl')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('requestMethod')" prop="requestMethod">
|
||||
<el-select v-model="powerStore.form.requestMethod" :placeholder="$t('requestMethod')" autocomplete="off" class="!w-[180px]" clearable filterable>
|
||||
<el-option v-for="item in RequestMethod" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="powerStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar
|
||||
:columns="columns"
|
||||
|
@ -146,7 +142,7 @@ onMounted(() => {
|
|||
>
|
||||
<template #buttons>
|
||||
<!-- 下载配置 -->
|
||||
<el-dropdown v-if="hasAuth(auth.update)" class="mr-1" type="primary">
|
||||
<el-dropdown class="mr-1" type="primary">
|
||||
<el-button :icon="useRenderIcon(Download)" plain type="primary">
|
||||
{{ $t('download_configuration') }}
|
||||
</el-button>
|
||||
|
@ -159,7 +155,7 @@ onMounted(() => {
|
|||
</el-dropdown>
|
||||
|
||||
<!-- 更新配置 -->
|
||||
<el-dropdown v-if="hasAuth(auth.update)" class="mr-1" type="primary">
|
||||
<el-dropdown class="mr-1" type="primary">
|
||||
<el-button :icon="useRenderIcon(Upload)" plain type="primary">{{ $t('file_import') }}</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
|
@ -170,23 +166,23 @@ onMounted(() => {
|
|||
</el-dropdown>
|
||||
|
||||
<!-- 添加权限按钮 -->
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd()">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd()">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<el-dropdown v-if="hasAuth(auth.update)" class="ml-1" type="primary">
|
||||
<el-dropdown class="ml-1" type="primary">
|
||||
<el-button :icon="useRenderIcon(More)" plain type="primary">{{ $t('more_actions') }}</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<!-- 批量更新父级id -->
|
||||
<el-dropdown-item v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" @click="onUpdateSort">拖拽排序</el-dropdown-item>
|
||||
<el-dropdown-item :icon="useRenderIcon(EditPen)" @click="onUpdateSort">拖拽排序</el-dropdown-item>
|
||||
<!-- 批量更新父级id -->
|
||||
<el-dropdown-item v-if="hasAuth(auth.update)" :disabled="!(powerIds.length > 0)" :icon="useRenderIcon(EditPen)" @click="onUpdateBatchParent">
|
||||
<el-dropdown-item :disabled="!(powerIds.length > 0)" :icon="useRenderIcon(EditPen)" @click="onUpdateBatchParent">
|
||||
{{ $t('update_batches_parent') }}
|
||||
</el-dropdown-item>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-dropdown-item v-if="hasAuth(auth.delete)" :disabled="!(powerIds.length > 0)" :icon="useRenderIcon(Delete)" @click="onDeleteBatch">
|
||||
<el-dropdown-item :disabled="!(powerIds.length > 0)" :icon="useRenderIcon(Delete)" @click="onDeleteBatch">
|
||||
{{ $t('deleteBatches') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
|
@ -230,15 +226,15 @@ onMounted(() => {
|
|||
|
||||
<template #operation="{ row }">
|
||||
<!-- 修改 -->
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<!-- 添加 -->
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" :size="size" class="reset-margin" link type="primary" @click="onAdd(row.id)">
|
||||
<el-button :icon="useRenderIcon(AddFill)" :size="size" class="reset-margin" link type="primary" @click="onAdd(row.id)">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
<!-- 删除 -->
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.powerName}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')}${row.powerName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'permission::page',
|
||||
// // 添加操作
|
||||
add: ['permission::add'],
|
||||
// 更新操作
|
||||
update: ['permission::update'],
|
||||
// 删除操作
|
||||
delete: ['permission::delete'],
|
||||
};
|
|
@ -23,31 +23,24 @@ export async function onSearch() {
|
|||
|
||||
/** 添加权限 */
|
||||
export function onAdd(parentId = 0) {
|
||||
const formInline = {
|
||||
parentId,
|
||||
powerCode: undefined,
|
||||
powerName: undefined,
|
||||
requestUrl: undefined,
|
||||
requestMethod: undefined,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('power')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
parentId,
|
||||
powerCode: undefined,
|
||||
powerName: undefined,
|
||||
requestUrl: undefined,
|
||||
requestMethod: undefined,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(PermissionFromDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
parentId,
|
||||
powerCode: undefined,
|
||||
powerName: undefined,
|
||||
requestUrl: undefined,
|
||||
requestMethod: undefined,
|
||||
},
|
||||
formInline,
|
||||
}),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
|
@ -65,32 +58,21 @@ export function onAdd(parentId = 0) {
|
|||
|
||||
/* 更新权限 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = {
|
||||
parentId: row.parentId,
|
||||
powerCode: row.powerCode,
|
||||
powerName: row.powerName,
|
||||
requestUrl: row.requestUrl,
|
||||
requestMethod: row.requestMethod,
|
||||
};
|
||||
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('power')}`,
|
||||
|
||||
props: {
|
||||
formInline: {
|
||||
parentId: row.parentId,
|
||||
powerCode: row.powerCode,
|
||||
powerName: row.powerName,
|
||||
requestUrl: row.requestUrl,
|
||||
requestMethod: row.requestMethod,
|
||||
},
|
||||
},
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () =>
|
||||
h(PermissionFromDialog, {
|
||||
ref: formRef,
|
||||
formInline: {
|
||||
parentId: row.parentId,
|
||||
powerCode: row.powerCode,
|
||||
powerName: row.powerName,
|
||||
requestUrl: row.requestUrl,
|
||||
requestMethod: row.requestMethod,
|
||||
},
|
||||
}),
|
||||
contentRenderer: () => h(PermissionFromDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
<script lang="ts" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { addDialog } from '@/components/ReDialog/index';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { PureTableBar } from '@/components/RePureTableBar';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { hasAuth } from '@/router/utils';
|
||||
import { useRoleStore } from '@/store/system/role';
|
||||
import FileUploadDialog from '@/views/system/role/components/file-upload-dialog.vue';
|
||||
import {
|
||||
auth,
|
||||
columns,
|
||||
contentRef,
|
||||
deleteIds,
|
||||
|
@ -103,22 +100,20 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form ref="formRef" :inline="true" :model="roleStore.form" class="search-form bg-bg_color w-full pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('role_roleCode')" prop="roleCode">
|
||||
<el-input v-model="roleStore.form.roleCode" :placeholder="`${$t('input')}${$t('role_roleCode')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('role_description')" prop="description">
|
||||
<el-input v-model="roleStore.form.description" :placeholder="`${$t('input')}${$t('role_description')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="roleStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ReAuth>
|
||||
<el-form ref="formRef" :inline="true" :model="roleStore.form" class="search-form bg-bg_color w-full pl-8 pt-[12px] overflow-auto">
|
||||
<el-form-item :label="$t('role_roleCode')" prop="roleCode">
|
||||
<el-input v-model="roleStore.form.roleCode" :placeholder="`${$t('input')}${$t('role_roleCode')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('role_description')" prop="description">
|
||||
<el-input v-model="roleStore.form.description" :placeholder="`${$t('input')}${$t('role_description')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri/search-line')" :loading="roleStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">{{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<PureTableBar
|
||||
|
@ -131,20 +126,20 @@ onMounted(() => {
|
|||
>
|
||||
<template #buttons>
|
||||
<!-- 下载Excel配置 -->
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(Download)" plain type="primary" @click="downloadRoleExcel">
|
||||
<el-button :icon="useRenderIcon(Download)" plain type="primary" @click="downloadRoleExcel">
|
||||
{{ $t('download_configuration') }}
|
||||
</el-button>
|
||||
<!-- 文件更新 -->
|
||||
<el-button v-if="hasAuth(auth.update)" :icon="useRenderIcon(Upload)" plain type="primary" @click="onUpdateByFile">
|
||||
<el-button :icon="useRenderIcon(Upload)" plain type="primary" @click="onUpdateByFile">
|
||||
{{ $t('file_import') }}
|
||||
</el-button>
|
||||
|
||||
<el-button v-if="hasAuth(auth.add)" :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
<el-button :icon="useRenderIcon(AddFill)" plain type="success" @click="onAdd">
|
||||
{{ $t('addNew') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-if="hasAuth(auth.delete)" :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
<el-button :disabled="!(deleteIds.length > 0)" :icon="useRenderIcon(Delete)" plain type="danger" @click="onDeleteBatch">
|
||||
{{ $t('delete_batches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -172,20 +167,12 @@ onMounted(() => {
|
|||
>
|
||||
<template #operation="{ row }">
|
||||
<!-- 修改 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.update)"
|
||||
:icon="useRenderIcon(EditPen)"
|
||||
:size="size"
|
||||
class="reset-margin"
|
||||
link
|
||||
type="primary"
|
||||
@click="onUpdate(row)"
|
||||
>
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)">
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 删除 -->
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.roleCode}?`" @confirm="onDelete(row)">
|
||||
<el-popconfirm :title="`${$t('delete')}${row.roleCode}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
@ -193,15 +180,7 @@ onMounted(() => {
|
|||
</template>
|
||||
</el-popconfirm>
|
||||
|
||||
<el-button
|
||||
v-if="hasAuth(auth.rolePowerAdd)"
|
||||
:icon="useRenderIcon(Menu)"
|
||||
:size="size"
|
||||
class="reset-margin"
|
||||
link
|
||||
type="primary"
|
||||
@click="onMenuPowerClick(row)"
|
||||
>
|
||||
<el-button :icon="useRenderIcon(Menu)" :size="size" class="reset-margin" link type="primary" @click="onMenuPowerClick(row)">
|
||||
{{ $t('power_setting') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
query: 'role::query',
|
||||
// 添加操作
|
||||
add: ['role::add'],
|
||||
// 更新操作
|
||||
update: ['role::update'],
|
||||
// 删除操作
|
||||
delete: ['role::delete'],
|
||||
// 为角色分配权限
|
||||
rolePowerAdd: ['rolePower::add'],
|
||||
};
|
|
@ -32,14 +32,14 @@ export async function onSearch() {
|
|||
|
||||
/** 添加角色 */
|
||||
export function onAdd() {
|
||||
const formInline = { roleCode: undefined, description: undefined };
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('role')}`,
|
||||
|
||||
props: { formInline: { roleCode: undefined, description: undefined } },
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(RoleDialog, { ref: formRef, formInline: { roleCode: undefined, description: undefined } }),
|
||||
contentRenderer: () => h(RoleDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
@ -56,14 +56,15 @@ export function onAdd() {
|
|||
|
||||
/* 更新角色 */
|
||||
export function onUpdate(row: any) {
|
||||
const formInline = { roleCode: row.roleCode, description: row.description };
|
||||
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('role')}`,
|
||||
|
||||
props: { formInline: { roleCode: row.roleCode, description: row.description } },
|
||||
props: { formInline },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(RoleDialog, { ref: formRef, formInline: { roleCode: row.roleCode, description: row.description } }),
|
||||
contentRenderer: () => h(RoleDialog, { ref: formRef, formInline }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './columns';
|
||||
export * from './auth';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
|
|
@ -1,134 +1,134 @@
|
|||
declare module "vue" {
|
||||
declare module 'vue' {
|
||||
/**
|
||||
* 自定义全局组件获得 Volar 提示(自定义的全局组件需要在这里声明下才能获得 Volar 类型提示哦)
|
||||
*/
|
||||
export interface GlobalComponents {
|
||||
IconifyIconOffline: (typeof import("../src/components/ReIcon"))["IconifyIconOffline"];
|
||||
IconifyIconOnline: (typeof import("../src/components/ReIcon"))["IconifyIconOnline"];
|
||||
FontIcon: (typeof import("../src/components/ReIcon"))["FontIcon"];
|
||||
Auth: (typeof import("../src/components/ReAuth"))["Auth"];
|
||||
Perms: (typeof import("../src/components/RePerms"))["Perms"];
|
||||
IconifyIconOffline: (typeof import('../src/components/ReIcon'))['IconifyIconOffline'];
|
||||
IconifyIconOnline: (typeof import('../src/components/ReIcon'))['IconifyIconOnline'];
|
||||
FontIcon: (typeof import('../src/components/ReIcon'))['FontIcon'];
|
||||
Auth: (typeof import('../src/components/ReAuth'))['Auth'];
|
||||
Perms: (typeof import('../src/components/RePerms'))['Perms'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO https://github.com/element-plus/element-plus/blob/dev/global.d.ts#L2
|
||||
* https://github.com/element-plus/element-plus/blob/dev/global.d.ts#L2
|
||||
* No need to install @vue/runtime-core
|
||||
*/
|
||||
declare module "vue" {
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
ElAffix: (typeof import("element-plus"))["ElAffix"];
|
||||
ElAlert: (typeof import("element-plus"))["ElAlert"];
|
||||
ElAside: (typeof import("element-plus"))["ElAside"];
|
||||
ElAutocomplete: (typeof import("element-plus"))["ElAutocomplete"];
|
||||
ElAvatar: (typeof import("element-plus"))["ElAvatar"];
|
||||
ElAnchor: (typeof import("element-plus"))["ElAnchor"];
|
||||
ElAnchorLink: (typeof import("element-plus"))["ElAnchorLink"];
|
||||
ElBacktop: (typeof import("element-plus"))["ElBacktop"];
|
||||
ElBadge: (typeof import("element-plus"))["ElBadge"];
|
||||
ElBreadcrumb: (typeof import("element-plus"))["ElBreadcrumb"];
|
||||
ElBreadcrumbItem: (typeof import("element-plus"))["ElBreadcrumbItem"];
|
||||
ElButton: (typeof import("element-plus"))["ElButton"];
|
||||
ElButtonGroup: (typeof import("element-plus"))["ElButtonGroup"];
|
||||
ElCalendar: (typeof import("element-plus"))["ElCalendar"];
|
||||
ElCard: (typeof import("element-plus"))["ElCard"];
|
||||
ElCarousel: (typeof import("element-plus"))["ElCarousel"];
|
||||
ElCarouselItem: (typeof import("element-plus"))["ElCarouselItem"];
|
||||
ElCascader: (typeof import("element-plus"))["ElCascader"];
|
||||
ElCascaderPanel: (typeof import("element-plus"))["ElCascaderPanel"];
|
||||
ElCheckbox: (typeof import("element-plus"))["ElCheckbox"];
|
||||
ElCheckboxButton: (typeof import("element-plus"))["ElCheckboxButton"];
|
||||
ElCheckboxGroup: (typeof import("element-plus"))["ElCheckboxGroup"];
|
||||
ElCol: (typeof import("element-plus"))["ElCol"];
|
||||
ElCollapse: (typeof import("element-plus"))["ElCollapse"];
|
||||
ElCollapseItem: (typeof import("element-plus"))["ElCollapseItem"];
|
||||
ElCollapseTransition: (typeof import("element-plus"))["ElCollapseTransition"];
|
||||
ElColorPicker: (typeof import("element-plus"))["ElColorPicker"];
|
||||
ElContainer: (typeof import("element-plus"))["ElContainer"];
|
||||
ElConfigProvider: (typeof import("element-plus"))["ElConfigProvider"];
|
||||
ElDatePicker: (typeof import("element-plus"))["ElDatePicker"];
|
||||
ElDialog: (typeof import("element-plus"))["ElDialog"];
|
||||
ElDivider: (typeof import("element-plus"))["ElDivider"];
|
||||
ElDrawer: (typeof import("element-plus"))["ElDrawer"];
|
||||
ElDropdown: (typeof import("element-plus"))["ElDropdown"];
|
||||
ElDropdownItem: (typeof import("element-plus"))["ElDropdownItem"];
|
||||
ElDropdownMenu: (typeof import("element-plus"))["ElDropdownMenu"];
|
||||
ElEmpty: (typeof import("element-plus"))["ElEmpty"];
|
||||
ElFooter: (typeof import("element-plus"))["ElFooter"];
|
||||
ElForm: (typeof import("element-plus"))["ElForm"];
|
||||
ElFormItem: (typeof import("element-plus"))["ElFormItem"];
|
||||
ElHeader: (typeof import("element-plus"))["ElHeader"];
|
||||
ElIcon: (typeof import("element-plus"))["ElIcon"];
|
||||
ElImage: (typeof import("element-plus"))["ElImage"];
|
||||
ElImageViewer: (typeof import("element-plus"))["ElImageViewer"];
|
||||
ElInput: (typeof import("element-plus"))["ElInput"];
|
||||
ElInputNumber: (typeof import("element-plus"))["ElInputNumber"];
|
||||
ElLink: (typeof import("element-plus"))["ElLink"];
|
||||
ElMain: (typeof import("element-plus"))["ElMain"];
|
||||
ElMenu: (typeof import("element-plus"))["ElMenu"];
|
||||
ElMenuItem: (typeof import("element-plus"))["ElMenuItem"];
|
||||
ElMenuItemGroup: (typeof import("element-plus"))["ElMenuItemGroup"];
|
||||
ElOption: (typeof import("element-plus"))["ElOption"];
|
||||
ElOptionGroup: (typeof import("element-plus"))["ElOptionGroup"];
|
||||
ElPageHeader: (typeof import("element-plus"))["ElPageHeader"];
|
||||
ElPagination: (typeof import("element-plus"))["ElPagination"];
|
||||
ElPopconfirm: (typeof import("element-plus"))["ElPopconfirm"];
|
||||
ElPopper: (typeof import("element-plus"))["ElPopper"];
|
||||
ElPopover: (typeof import("element-plus"))["ElPopover"];
|
||||
ElProgress: (typeof import("element-plus"))["ElProgress"];
|
||||
ElRadio: (typeof import("element-plus"))["ElRadio"];
|
||||
ElRadioButton: (typeof import("element-plus"))["ElRadioButton"];
|
||||
ElRadioGroup: (typeof import("element-plus"))["ElRadioGroup"];
|
||||
ElRate: (typeof import("element-plus"))["ElRate"];
|
||||
ElRow: (typeof import("element-plus"))["ElRow"];
|
||||
ElScrollbar: (typeof import("element-plus"))["ElScrollbar"];
|
||||
ElSelect: (typeof import("element-plus"))["ElSelect"];
|
||||
ElSlider: (typeof import("element-plus"))["ElSlider"];
|
||||
ElStep: (typeof import("element-plus"))["ElStep"];
|
||||
ElSteps: (typeof import("element-plus"))["ElSteps"];
|
||||
ElSubMenu: (typeof import("element-plus"))["ElSubMenu"];
|
||||
ElSwitch: (typeof import("element-plus"))["ElSwitch"];
|
||||
ElTabPane: (typeof import("element-plus"))["ElTabPane"];
|
||||
ElTable: (typeof import("element-plus"))["ElTable"];
|
||||
ElTableColumn: (typeof import("element-plus"))["ElTableColumn"];
|
||||
ElTabs: (typeof import("element-plus"))["ElTabs"];
|
||||
ElTag: (typeof import("element-plus"))["ElTag"];
|
||||
ElText: (typeof import("element-plus"))["ElText"];
|
||||
ElTimePicker: (typeof import("element-plus"))["ElTimePicker"];
|
||||
ElTimeSelect: (typeof import("element-plus"))["ElTimeSelect"];
|
||||
ElTimeline: (typeof import("element-plus"))["ElTimeline"];
|
||||
ElTimelineItem: (typeof import("element-plus"))["ElTimelineItem"];
|
||||
ElTooltip: (typeof import("element-plus"))["ElTooltip"];
|
||||
ElTransfer: (typeof import("element-plus"))["ElTransfer"];
|
||||
ElTree: (typeof import("element-plus"))["ElTree"];
|
||||
ElTreeV2: (typeof import("element-plus"))["ElTreeV2"];
|
||||
ElTreeSelect: (typeof import("element-plus"))["ElTreeSelect"];
|
||||
ElUpload: (typeof import("element-plus"))["ElUpload"];
|
||||
ElSpace: (typeof import("element-plus"))["ElSpace"];
|
||||
ElSkeleton: (typeof import("element-plus"))["ElSkeleton"];
|
||||
ElSkeletonItem: (typeof import("element-plus"))["ElSkeletonItem"];
|
||||
ElStatistic: (typeof import("element-plus"))["ElStatistic"];
|
||||
ElCheckTag: (typeof import("element-plus"))["ElCheckTag"];
|
||||
ElDescriptions: (typeof import("element-plus"))["ElDescriptions"];
|
||||
ElDescriptionsItem: (typeof import("element-plus"))["ElDescriptionsItem"];
|
||||
ElResult: (typeof import("element-plus"))["ElResult"];
|
||||
ElSelectV2: (typeof import("element-plus"))["ElSelectV2"];
|
||||
ElWatermark: (typeof import("element-plus"))["ElWatermark"];
|
||||
ElTour: (typeof import("element-plus"))["ElTour"];
|
||||
ElTourStep: (typeof import("element-plus"))["ElTourStep"];
|
||||
ElSegmented: (typeof import("element-plus"))["ElSegmented"];
|
||||
ElAffix: (typeof import('element-plus'))['ElAffix'];
|
||||
ElAlert: (typeof import('element-plus'))['ElAlert'];
|
||||
ElAside: (typeof import('element-plus'))['ElAside'];
|
||||
ElAutocomplete: (typeof import('element-plus'))['ElAutocomplete'];
|
||||
ElAvatar: (typeof import('element-plus'))['ElAvatar'];
|
||||
ElAnchor: (typeof import('element-plus'))['ElAnchor'];
|
||||
ElAnchorLink: (typeof import('element-plus'))['ElAnchorLink'];
|
||||
ElBacktop: (typeof import('element-plus'))['ElBacktop'];
|
||||
ElBadge: (typeof import('element-plus'))['ElBadge'];
|
||||
ElBreadcrumb: (typeof import('element-plus'))['ElBreadcrumb'];
|
||||
ElBreadcrumbItem: (typeof import('element-plus'))['ElBreadcrumbItem'];
|
||||
ElButton: (typeof import('element-plus'))['ElButton'];
|
||||
ElButtonGroup: (typeof import('element-plus'))['ElButtonGroup'];
|
||||
ElCalendar: (typeof import('element-plus'))['ElCalendar'];
|
||||
ElCard: (typeof import('element-plus'))['ElCard'];
|
||||
ElCarousel: (typeof import('element-plus'))['ElCarousel'];
|
||||
ElCarouselItem: (typeof import('element-plus'))['ElCarouselItem'];
|
||||
ElCascader: (typeof import('element-plus'))['ElCascader'];
|
||||
ElCascaderPanel: (typeof import('element-plus'))['ElCascaderPanel'];
|
||||
ElCheckbox: (typeof import('element-plus'))['ElCheckbox'];
|
||||
ElCheckboxButton: (typeof import('element-plus'))['ElCheckboxButton'];
|
||||
ElCheckboxGroup: (typeof import('element-plus'))['ElCheckboxGroup'];
|
||||
ElCol: (typeof import('element-plus'))['ElCol'];
|
||||
ElCollapse: (typeof import('element-plus'))['ElCollapse'];
|
||||
ElCollapseItem: (typeof import('element-plus'))['ElCollapseItem'];
|
||||
ElCollapseTransition: (typeof import('element-plus'))['ElCollapseTransition'];
|
||||
ElColorPicker: (typeof import('element-plus'))['ElColorPicker'];
|
||||
ElContainer: (typeof import('element-plus'))['ElContainer'];
|
||||
ElConfigProvider: (typeof import('element-plus'))['ElConfigProvider'];
|
||||
ElDatePicker: (typeof import('element-plus'))['ElDatePicker'];
|
||||
ElDialog: (typeof import('element-plus'))['ElDialog'];
|
||||
ElDivider: (typeof import('element-plus'))['ElDivider'];
|
||||
ElDrawer: (typeof import('element-plus'))['ElDrawer'];
|
||||
ElDropdown: (typeof import('element-plus'))['ElDropdown'];
|
||||
ElDropdownItem: (typeof import('element-plus'))['ElDropdownItem'];
|
||||
ElDropdownMenu: (typeof import('element-plus'))['ElDropdownMenu'];
|
||||
ElEmpty: (typeof import('element-plus'))['ElEmpty'];
|
||||
ElFooter: (typeof import('element-plus'))['ElFooter'];
|
||||
ElForm: (typeof import('element-plus'))['ElForm'];
|
||||
ElFormItem: (typeof import('element-plus'))['ElFormItem'];
|
||||
ElHeader: (typeof import('element-plus'))['ElHeader'];
|
||||
ElIcon: (typeof import('element-plus'))['ElIcon'];
|
||||
ElImage: (typeof import('element-plus'))['ElImage'];
|
||||
ElImageViewer: (typeof import('element-plus'))['ElImageViewer'];
|
||||
ElInput: (typeof import('element-plus'))['ElInput'];
|
||||
ElInputNumber: (typeof import('element-plus'))['ElInputNumber'];
|
||||
ElLink: (typeof import('element-plus'))['ElLink'];
|
||||
ElMain: (typeof import('element-plus'))['ElMain'];
|
||||
ElMenu: (typeof import('element-plus'))['ElMenu'];
|
||||
ElMenuItem: (typeof import('element-plus'))['ElMenuItem'];
|
||||
ElMenuItemGroup: (typeof import('element-plus'))['ElMenuItemGroup'];
|
||||
ElOption: (typeof import('element-plus'))['ElOption'];
|
||||
ElOptionGroup: (typeof import('element-plus'))['ElOptionGroup'];
|
||||
ElPageHeader: (typeof import('element-plus'))['ElPageHeader'];
|
||||
ElPagination: (typeof import('element-plus'))['ElPagination'];
|
||||
ElPopconfirm: (typeof import('element-plus'))['ElPopconfirm'];
|
||||
ElPopper: (typeof import('element-plus'))['ElPopper'];
|
||||
ElPopover: (typeof import('element-plus'))['ElPopover'];
|
||||
ElProgress: (typeof import('element-plus'))['ElProgress'];
|
||||
ElRadio: (typeof import('element-plus'))['ElRadio'];
|
||||
ElRadioButton: (typeof import('element-plus'))['ElRadioButton'];
|
||||
ElRadioGroup: (typeof import('element-plus'))['ElRadioGroup'];
|
||||
ElRate: (typeof import('element-plus'))['ElRate'];
|
||||
ElRow: (typeof import('element-plus'))['ElRow'];
|
||||
ElScrollbar: (typeof import('element-plus'))['ElScrollbar'];
|
||||
ElSelect: (typeof import('element-plus'))['ElSelect'];
|
||||
ElSlider: (typeof import('element-plus'))['ElSlider'];
|
||||
ElStep: (typeof import('element-plus'))['ElStep'];
|
||||
ElSteps: (typeof import('element-plus'))['ElSteps'];
|
||||
ElSubMenu: (typeof import('element-plus'))['ElSubMenu'];
|
||||
ElSwitch: (typeof import('element-plus'))['ElSwitch'];
|
||||
ElTabPane: (typeof import('element-plus'))['ElTabPane'];
|
||||
ElTable: (typeof import('element-plus'))['ElTable'];
|
||||
ElTableColumn: (typeof import('element-plus'))['ElTableColumn'];
|
||||
ElTabs: (typeof import('element-plus'))['ElTabs'];
|
||||
ElTag: (typeof import('element-plus'))['ElTag'];
|
||||
ElText: (typeof import('element-plus'))['ElText'];
|
||||
ElTimePicker: (typeof import('element-plus'))['ElTimePicker'];
|
||||
ElTimeSelect: (typeof import('element-plus'))['ElTimeSelect'];
|
||||
ElTimeline: (typeof import('element-plus'))['ElTimeline'];
|
||||
ElTimelineItem: (typeof import('element-plus'))['ElTimelineItem'];
|
||||
ElTooltip: (typeof import('element-plus'))['ElTooltip'];
|
||||
ElTransfer: (typeof import('element-plus'))['ElTransfer'];
|
||||
ElTree: (typeof import('element-plus'))['ElTree'];
|
||||
ElTreeV2: (typeof import('element-plus'))['ElTreeV2'];
|
||||
ElTreeSelect: (typeof import('element-plus'))['ElTreeSelect'];
|
||||
ElUpload: (typeof import('element-plus'))['ElUpload'];
|
||||
ElSpace: (typeof import('element-plus'))['ElSpace'];
|
||||
ElSkeleton: (typeof import('element-plus'))['ElSkeleton'];
|
||||
ElSkeletonItem: (typeof import('element-plus'))['ElSkeletonItem'];
|
||||
ElStatistic: (typeof import('element-plus'))['ElStatistic'];
|
||||
ElCheckTag: (typeof import('element-plus'))['ElCheckTag'];
|
||||
ElDescriptions: (typeof import('element-plus'))['ElDescriptions'];
|
||||
ElDescriptionsItem: (typeof import('element-plus'))['ElDescriptionsItem'];
|
||||
ElResult: (typeof import('element-plus'))['ElResult'];
|
||||
ElSelectV2: (typeof import('element-plus'))['ElSelectV2'];
|
||||
ElWatermark: (typeof import('element-plus'))['ElWatermark'];
|
||||
ElTour: (typeof import('element-plus'))['ElTour'];
|
||||
ElTourStep: (typeof import('element-plus'))['ElTourStep'];
|
||||
ElSegmented: (typeof import('element-plus'))['ElSegmented'];
|
||||
}
|
||||
|
||||
interface ComponentCustomProperties {
|
||||
$storage: ResponsiveStorage;
|
||||
$message: (typeof import("element-plus"))["ElMessage"];
|
||||
$notify: (typeof import("element-plus"))["ElNotification"];
|
||||
$msgbox: (typeof import("element-plus"))["ElMessageBox"];
|
||||
$messageBox: (typeof import("element-plus"))["ElMessageBox"];
|
||||
$alert: (typeof import("element-plus"))["ElMessageBox"]["alert"];
|
||||
$confirm: (typeof import("element-plus"))["ElMessageBox"]["confirm"];
|
||||
$prompt: (typeof import("element-plus"))["ElMessageBox"]["prompt"];
|
||||
$loading: (typeof import("element-plus"))["ElLoadingService"];
|
||||
$message: (typeof import('element-plus'))['ElMessage'];
|
||||
$notify: (typeof import('element-plus'))['ElNotification'];
|
||||
$msgbox: (typeof import('element-plus'))['ElMessageBox'];
|
||||
$messageBox: (typeof import('element-plus'))['ElMessageBox'];
|
||||
$alert: (typeof import('element-plus'))['ElMessageBox']['alert'];
|
||||
$confirm: (typeof import('element-plus'))['ElMessageBox']['confirm'];
|
||||
$prompt: (typeof import('element-plus'))['ElMessageBox']['prompt'];
|
||||
$loading: (typeof import('element-plus'))['ElLoadingService'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue