- 支持4M以内的图片:支持jpg、png
+ 支持4M以内的图片:
+ 支持jpg,png,jfif,pjp,pjpeg,jpeg
建议尺寸1400x1080
@@ -294,9 +293,9 @@ import { LocalStore } from '@/utils/comm';
import { save_api, getDetails_api } from '@/api/system/basis';
import { usePermissionStore } from '@/store/permission';
-const action = ref
(`${BASE_API_PATH}/file/static`);
-const headers = ref({ [TOKEN_KEY]: LocalStore.get(TOKEN_KEY) });
-const formBasicRef = ref();
+const action = `${BASE_API_PATH}/file/static`;
+const headers = { [TOKEN_KEY]: LocalStore.get(TOKEN_KEY) };
+const formRef = ref();
const form = reactive({
formValue: {
title: '',
@@ -312,17 +311,11 @@ const form = reactive({
{
required: true,
message: '名称必填',
- trigger: 'blur',
},
{
max: 64,
message: '最多可输入64个字符',
},
- {
- max: 64,
- message: '最多可输入64个字符',
- trigger: 'blur',
- },
],
headerTheme: [
{
@@ -346,8 +339,6 @@ const form = reactive({
getDetails: () => {
const params = ['front', 'amap', 'paths'];
getDetails_api(params).then((resp: any) => {
- console.log(resp);
-
const basis = resp.result?.filter(
(item: any) => item.scope === 'front',
);
@@ -357,8 +348,6 @@ const form = reactive({
const basePath = resp.result?.filter(
(item: any) => item.scope === 'paths',
);
- console.log();
-
form.formValue = {
...basis[0].properties,
apiKey: api[0].properties.apiKey,
@@ -377,7 +366,7 @@ const form = reactive({
clickSave: () => {
const hasPermission = usePermissionStore().hasPermission;
if (hasPermission(`system/Basis:update`)) {
- formBasicRef.value.validate().then(() => {
+ formRef.value.validate().then(() => {
form.saveLoading = true;
const params = [
{
@@ -419,7 +408,14 @@ const form = reactive({
const { formValue, rulesFrom } = toRefs(form);
const uploader: uploaderType = {
- imageTypes: ['jpg', 'jpeg', 'png', 'jfif', 'pjp', 'pjpeg'],
+ imageTypes: [
+ 'image/jpg',
+ 'image/jpeg',
+ 'image/png',
+ 'image/jfif',
+ 'image/pjp',
+ 'image/pjpeg',
+ ],
iconTypes: ['image/x-icon'],
// logo格式校验
beforeLogoUpload: ({ size, type }: File) => {
@@ -427,7 +423,6 @@ const uploader: uploaderType = {
uploader.imageTypes.filter((typeStr) => type.includes(typeStr))
.length > 0;
const sizeBool = size / 1024 / 1024 < 4;
-
if (!typeBool) {
message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`);
} else if (!sizeBool) {
diff --git a/src/views/system/Role/index.vue b/src/views/system/Role/index.vue
index 0003310d..20ded186 100644
--- a/src/views/system/Role/index.vue
+++ b/src/views/system/Role/index.vue
@@ -38,7 +38,11 @@
:tooltip="{
title: '编辑',
}"
- @click="table.clickEdit(slotProps)"
+ @click="
+ jumpPage(`system/Role/Detail`, {
+ id: slotProps.id,
+ })
+ "
>
@@ -48,7 +52,7 @@
:tooltip="{ title: '删除' }"
:popConfirm="{
title: `确定要删除吗`,
- onConfirm: () => table.clickDel(slotProps),
+ onConfirm: () => clickDel(slotProps),
}"
>
@@ -72,7 +76,6 @@ import { useMenuStore } from '@/store/menu';
const permission = 'system/Role';
const { jumpPage } = useMenuStore();
-const addDialogRef = ref(); // 新增弹窗实例
const isSave = !!useRoute().query.save;
const columns = [
@@ -115,22 +118,14 @@ const columns = [
];
const queryParams = ref({});
// 表格
-const tableRef = ref>({});
-const table = {
- clickAdd: () => {
- addDialogRef.value.openDialog(true, {});
- },
- clickDel: (row: any) => {
- delRole_api(row.id).then((resp: any) => {
- if (resp.status === 200) {
- tableRef.value?.reload();
- message.success('操作成功!');
- }
- });
- },
- clickEdit: ({ id }: { id: string }) => {
- jumpPage(`system/Role/Detail`, { id });
- },
+const tableRef = ref>();
+const clickDel = (row: any) => {
+ delRole_api(row.id).then((resp: any) => {
+ if (resp.status === 200) {
+ tableRef.value?.reload();
+ message.success('操作成功!');
+ }
+ });
};
const dialogVisible = ref(isSave);