fix: bug#10532、10531、10530、10527

This commit is contained in:
easy 2023-03-17 11:51:02 +08:00
parent 86b4cc2ba4
commit f45cc4da61
3 changed files with 35 additions and 47 deletions

View File

@ -91,8 +91,6 @@ const getLevelLabel = (id: number) => {
.label { .label {
background-color: #fafafa; background-color: #fafafa;
} }
.value {
}
} }
} }
</style> </style>

View File

@ -3,7 +3,7 @@
<div class="basis-container"> <div class="basis-container">
<j-form <j-form
layout="vertical" layout="vertical"
ref="formBasicRef" ref="formRef"
:rules="rulesFrom" :rules="rulesFrom"
:model="formValue" :model="formValue"
> >
@ -73,9 +73,7 @@
@change=" @change="
uploader.handleChangeLogo uploader.handleChangeLogo
" "
:accept=" :accept="uploader.imageTypes"
uploader.imageTypes.toString()
"
> >
<div <div
class="upload-image-content-logo" class="upload-image-content-logo"
@ -130,7 +128,9 @@
<div class="upload-tips"> <div class="upload-tips">
推荐尺寸200*200 推荐尺寸200*200
</div> </div>
<div class="upload-tips">支持jpg,png</div> <div class="upload-tips">
支持jpg,png,jfif,pjp,pjpeg,jpeg
</div>
</j-form-item> </j-form-item>
</j-col> </j-col>
<j-col> <j-col>
@ -163,9 +163,7 @@
@change=" @change="
uploader.changeIconUpload uploader.changeIconUpload
" "
:accept=" :accept="uploader.iconTypes"
uploader.imageTypes.toString()
"
> >
<div <div
class="upload-image-content-logo" class="upload-image-content-logo"
@ -224,7 +222,7 @@
" "
:showUploadList="false" :showUploadList="false"
@change="uploader.changeBackUpload" @change="uploader.changeBackUpload"
:accept="uploader.imageTypes.toString()" :accept="uploader.imageTypes"
> >
<div class="upload-image-content-back"> <div class="upload-image-content-back">
<div <div
@ -260,7 +258,8 @@
</div> </div>
</div> </div>
<div class="upload-tips"> <div class="upload-tips">
支持4M以内的图片:支持jpgpng 支持4M以内的图片:
支持jpg,png,jfif,pjp,pjpeg,jpeg
</div> </div>
<div class="upload-tips">建议尺寸1400x1080</div> <div class="upload-tips">建议尺寸1400x1080</div>
</j-form-item> </j-form-item>
@ -294,9 +293,9 @@ import { LocalStore } from '@/utils/comm';
import { save_api, getDetails_api } from '@/api/system/basis'; import { save_api, getDetails_api } from '@/api/system/basis';
import { usePermissionStore } from '@/store/permission'; import { usePermissionStore } from '@/store/permission';
const action = ref<string>(`${BASE_API_PATH}/file/static`); const action = `${BASE_API_PATH}/file/static`;
const headers = ref({ [TOKEN_KEY]: LocalStore.get(TOKEN_KEY) }); const headers = { [TOKEN_KEY]: LocalStore.get(TOKEN_KEY) };
const formBasicRef = ref(); const formRef = ref();
const form = reactive<formType>({ const form = reactive<formType>({
formValue: { formValue: {
title: '', title: '',
@ -312,17 +311,11 @@ const form = reactive<formType>({
{ {
required: true, required: true,
message: '名称必填', message: '名称必填',
trigger: 'blur',
}, },
{ {
max: 64, max: 64,
message: '最多可输入64个字符', message: '最多可输入64个字符',
}, },
{
max: 64,
message: '最多可输入64个字符',
trigger: 'blur',
},
], ],
headerTheme: [ headerTheme: [
{ {
@ -346,8 +339,6 @@ const form = reactive<formType>({
getDetails: () => { getDetails: () => {
const params = ['front', 'amap', 'paths']; const params = ['front', 'amap', 'paths'];
getDetails_api(params).then((resp: any) => { getDetails_api(params).then((resp: any) => {
console.log(resp);
const basis = resp.result?.filter( const basis = resp.result?.filter(
(item: any) => item.scope === 'front', (item: any) => item.scope === 'front',
); );
@ -357,8 +348,6 @@ const form = reactive<formType>({
const basePath = resp.result?.filter( const basePath = resp.result?.filter(
(item: any) => item.scope === 'paths', (item: any) => item.scope === 'paths',
); );
console.log();
form.formValue = { form.formValue = {
...basis[0].properties, ...basis[0].properties,
apiKey: api[0].properties.apiKey, apiKey: api[0].properties.apiKey,
@ -377,7 +366,7 @@ const form = reactive<formType>({
clickSave: () => { clickSave: () => {
const hasPermission = usePermissionStore().hasPermission; const hasPermission = usePermissionStore().hasPermission;
if (hasPermission(`system/Basis:update`)) { if (hasPermission(`system/Basis:update`)) {
formBasicRef.value.validate().then(() => { formRef.value.validate().then(() => {
form.saveLoading = true; form.saveLoading = true;
const params = [ const params = [
{ {
@ -419,7 +408,14 @@ const form = reactive<formType>({
const { formValue, rulesFrom } = toRefs(form); const { formValue, rulesFrom } = toRefs(form);
const uploader: uploaderType = { 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'], iconTypes: ['image/x-icon'],
// logo // logo
beforeLogoUpload: ({ size, type }: File) => { beforeLogoUpload: ({ size, type }: File) => {
@ -427,7 +423,6 @@ const uploader: uploaderType = {
uploader.imageTypes.filter((typeStr) => type.includes(typeStr)) uploader.imageTypes.filter((typeStr) => type.includes(typeStr))
.length > 0; .length > 0;
const sizeBool = size / 1024 / 1024 < 4; const sizeBool = size / 1024 / 1024 < 4;
if (!typeBool) { if (!typeBool) {
message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`); message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`);
} else if (!sizeBool) { } else if (!sizeBool) {

View File

@ -38,7 +38,11 @@
:tooltip="{ :tooltip="{
title: '编辑', title: '编辑',
}" }"
@click="table.clickEdit(slotProps)" @click="
jumpPage(`system/Role/Detail`, {
id: slotProps.id,
})
"
> >
<AIcon type="EditOutlined" /> <AIcon type="EditOutlined" />
</PermissionButton> </PermissionButton>
@ -48,7 +52,7 @@
:tooltip="{ title: '删除' }" :tooltip="{ title: '删除' }"
:popConfirm="{ :popConfirm="{
title: `确定要删除吗`, title: `确定要删除吗`,
onConfirm: () => table.clickDel(slotProps), onConfirm: () => clickDel(slotProps),
}" }"
> >
<AIcon type="DeleteOutlined" /> <AIcon type="DeleteOutlined" />
@ -72,7 +76,6 @@ import { useMenuStore } from '@/store/menu';
const permission = 'system/Role'; const permission = 'system/Role';
const { jumpPage } = useMenuStore(); const { jumpPage } = useMenuStore();
const addDialogRef = ref(); //
const isSave = !!useRoute().query.save; const isSave = !!useRoute().query.save;
const columns = [ const columns = [
@ -115,22 +118,14 @@ const columns = [
]; ];
const queryParams = ref({}); const queryParams = ref({});
// //
const tableRef = ref<Record<string, any>>({}); const tableRef = ref<Record<string, any>>();
const table = { const clickDel = (row: any) => {
clickAdd: () => { delRole_api(row.id).then((resp: any) => {
addDialogRef.value.openDialog(true, {}); if (resp.status === 200) {
}, tableRef.value?.reload();
clickDel: (row: any) => { message.success('操作成功!');
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 dialogVisible = ref(isSave); const dialogVisible = ref(isSave);
</script> </script>