fix: bug#10618、10608、10671、10532、10530、10649

This commit is contained in:
JiangQiming 2023-03-21 16:07:38 +08:00
parent 0b9b78ca40
commit c71a38d424
4 changed files with 36 additions and 29 deletions

View File

@ -36,6 +36,7 @@ import DefaultSetting from '../../../config/config';
import { useMenuStore } from '@/store/menu';
import { clearMenuItem } from 'jetlinks-ui-components/es/ProLayout/util';
import { AccountMenu } from '@/router/menu'
import { useSystem } from '@/store/system';
type StateType = {
collapsed: boolean;
@ -49,11 +50,14 @@ const route = useRoute();
const menu = useMenuStore();
const system = useSystem();
const configInfo = system.configInfo;
const layoutConf = reactive({
theme: DefaultSetting.layout.theme,
theme: configInfo.front?.headerTheme || DefaultSetting.layout.theme,
siderWidth: DefaultSetting.layout.siderWidth,
logo: DefaultSetting.layout.logo,
title: DefaultSetting.layout.title,
logo: configInfo.front?.logo || DefaultSetting.layout.logo,
title: configInfo.front?.title || DefaultSetting.layout.title,
menuData: [...clearMenuItem(menu.siderMenus), AccountMenu],
// menuData: menu.siderMenus,
splitMenus: true,

View File

@ -362,6 +362,7 @@ const saveProductVis = ref(false);
* 获取详情
*/
const getDetail = async () => {
if (!route.query.id) return;
const res = await DeviceApi.detail(route.query.id as string);
Object.assign(formData.value, res.result);
formData.value.channel = res.result.provider;

View File

@ -348,9 +348,10 @@ const form = reactive<formType>({
headerTheme: configInfo.front?.headerTheme,
logo: configInfo.front?.logo || '/public/logo.png',
ico: configInfo.front?.ico || '/public/favicon.ico',
backgroud: configInfo.front?.backgroud || '/public/images/login.png',
backgroud:
configInfo.front?.backgroud || '/public/images/login.png',
apiKey: configInfo.amap?.apiKey,
"base-path": configInfo.paths?.['base-path']
'base-path': configInfo.paths?.['base-path'],
};
},
clickSave: () => {
@ -398,23 +399,24 @@ const form = reactive<formType>({
const { formValue, rulesFrom } = toRefs(form);
const uploader: uploaderType = {
imageTypes: [
'image/jpg',
'image/jpeg',
'image/png',
'image/jfif',
'image/pjp',
'image/pjpeg',
],
// imageTypes: ['.jpg','.png','.jfif','.pjp','.pjpeg','.jpeg'],
// imageTypes: [
// 'image/jpg',
// 'image/jpeg',
// 'image/png',
// 'image/jfif',
// 'image/pjp',
// 'image/pjpeg',
// ],
imageTypes: ['.jpg', '.png', '.jfif', '.pjp', '.pjpeg', '.jpeg'],
iconTypes: ['image/x-icon'],
// logo
// beforeLogoUpload: ({ size, type }: File) => {
beforeLogoUpload: (file: File) => {
console.log('file: ', file);
const typeBool =
uploader.imageTypes.filter((typeStr) => file.type.includes(typeStr))
.length > 0;
uploader.imageTypes
.map((m: string) => m.split('.')[1])
.filter((typeStr) => file.type.includes(typeStr)).length > 0;
const sizeBool = file.size / 1024 / 1024 < 4;
if (!typeBool) {
message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`);

View File

@ -3,8 +3,8 @@
<div class="permission-container">
<pro-search
:columns="columns"
target="category"
@search="(params:any)=>queryParams = {...params}"
target="system-permission"
@search="handleSearch"
/>
<j-pro-table
@ -172,27 +172,24 @@ const columns = [
ellipsis: true,
search: {
type: 'string',
first: true,
},
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
ellipsis: true,
scopedSlots: true,
search: {
type: 'select',
options: [
{
label: '启用',
value: 1,
},
{
label: '禁用',
value: 0,
},
{ label: '启用', value: 1 },
{ label: '禁用', value: 0 },
],
handleValue: (v: any) => {
return v;
},
},
scopedSlots: true,
},
{
title: '操作',
@ -204,6 +201,9 @@ const columns = [
},
];
const queryParams = ref({});
const handleSearch = (e: any) => {
queryParams.value = e;
};
//
const tableRef = ref<Record<string, any>>({}); //
const table = {
@ -237,7 +237,7 @@ const table = {
clickExport: () => {
const params = {
paging: false,
...queryParams,
...queryParams.value,
};
exportPermission_api(params).then((resp) => {
if (resp.status === 200) {