fix: bug#10618、10608、10671、10532、10530、10649
This commit is contained in:
parent
0b9b78ca40
commit
c71a38d424
|
|
@ -36,6 +36,7 @@ import DefaultSetting from '../../../config/config';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { clearMenuItem } from 'jetlinks-ui-components/es/ProLayout/util';
|
import { clearMenuItem } from 'jetlinks-ui-components/es/ProLayout/util';
|
||||||
import { AccountMenu } from '@/router/menu'
|
import { AccountMenu } from '@/router/menu'
|
||||||
|
import { useSystem } from '@/store/system';
|
||||||
|
|
||||||
type StateType = {
|
type StateType = {
|
||||||
collapsed: boolean;
|
collapsed: boolean;
|
||||||
|
|
@ -49,11 +50,14 @@ const route = useRoute();
|
||||||
|
|
||||||
const menu = useMenuStore();
|
const menu = useMenuStore();
|
||||||
|
|
||||||
|
const system = useSystem();
|
||||||
|
const configInfo = system.configInfo;
|
||||||
|
|
||||||
const layoutConf = reactive({
|
const layoutConf = reactive({
|
||||||
theme: DefaultSetting.layout.theme,
|
theme: configInfo.front?.headerTheme || DefaultSetting.layout.theme,
|
||||||
siderWidth: DefaultSetting.layout.siderWidth,
|
siderWidth: DefaultSetting.layout.siderWidth,
|
||||||
logo: DefaultSetting.layout.logo,
|
logo: configInfo.front?.logo || DefaultSetting.layout.logo,
|
||||||
title: DefaultSetting.layout.title,
|
title: configInfo.front?.title || DefaultSetting.layout.title,
|
||||||
menuData: [...clearMenuItem(menu.siderMenus), AccountMenu],
|
menuData: [...clearMenuItem(menu.siderMenus), AccountMenu],
|
||||||
// menuData: menu.siderMenus,
|
// menuData: menu.siderMenus,
|
||||||
splitMenus: true,
|
splitMenus: true,
|
||||||
|
|
|
||||||
|
|
@ -362,6 +362,7 @@ const saveProductVis = ref(false);
|
||||||
* 获取详情
|
* 获取详情
|
||||||
*/
|
*/
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
|
if (!route.query.id) return;
|
||||||
const res = await DeviceApi.detail(route.query.id as string);
|
const res = await DeviceApi.detail(route.query.id as string);
|
||||||
Object.assign(formData.value, res.result);
|
Object.assign(formData.value, res.result);
|
||||||
formData.value.channel = res.result.provider;
|
formData.value.channel = res.result.provider;
|
||||||
|
|
|
||||||
|
|
@ -348,9 +348,10 @@ const form = reactive<formType>({
|
||||||
headerTheme: configInfo.front?.headerTheme,
|
headerTheme: configInfo.front?.headerTheme,
|
||||||
logo: configInfo.front?.logo || '/public/logo.png',
|
logo: configInfo.front?.logo || '/public/logo.png',
|
||||||
ico: configInfo.front?.ico || '/public/favicon.ico',
|
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,
|
apiKey: configInfo.amap?.apiKey,
|
||||||
"base-path": configInfo.paths?.['base-path']
|
'base-path': configInfo.paths?.['base-path'],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
clickSave: () => {
|
clickSave: () => {
|
||||||
|
|
@ -398,23 +399,24 @@ const form = reactive<formType>({
|
||||||
const { formValue, rulesFrom } = toRefs(form);
|
const { formValue, rulesFrom } = toRefs(form);
|
||||||
|
|
||||||
const uploader: uploaderType = {
|
const uploader: uploaderType = {
|
||||||
imageTypes: [
|
// imageTypes: [
|
||||||
'image/jpg',
|
// 'image/jpg',
|
||||||
'image/jpeg',
|
// 'image/jpeg',
|
||||||
'image/png',
|
// 'image/png',
|
||||||
'image/jfif',
|
// 'image/jfif',
|
||||||
'image/pjp',
|
// 'image/pjp',
|
||||||
'image/pjpeg',
|
// 'image/pjpeg',
|
||||||
],
|
// ],
|
||||||
// imageTypes: ['.jpg','.png','.jfif','.pjp','.pjpeg','.jpeg'],
|
imageTypes: ['.jpg', '.png', '.jfif', '.pjp', '.pjpeg', '.jpeg'],
|
||||||
iconTypes: ['image/x-icon'],
|
iconTypes: ['image/x-icon'],
|
||||||
// logo格式校验
|
// logo格式校验
|
||||||
// beforeLogoUpload: ({ size, type }: File) => {
|
// beforeLogoUpload: ({ size, type }: File) => {
|
||||||
beforeLogoUpload: (file: File) => {
|
beforeLogoUpload: (file: File) => {
|
||||||
console.log('file: ', file);
|
console.log('file: ', file);
|
||||||
const typeBool =
|
const typeBool =
|
||||||
uploader.imageTypes.filter((typeStr) => file.type.includes(typeStr))
|
uploader.imageTypes
|
||||||
.length > 0;
|
.map((m: string) => m.split('.')[1])
|
||||||
|
.filter((typeStr) => file.type.includes(typeStr)).length > 0;
|
||||||
const sizeBool = file.size / 1024 / 1024 < 4;
|
const sizeBool = file.size / 1024 / 1024 < 4;
|
||||||
if (!typeBool) {
|
if (!typeBool) {
|
||||||
message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`);
|
message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`);
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
<div class="permission-container">
|
<div class="permission-container">
|
||||||
<pro-search
|
<pro-search
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
target="category"
|
target="system-permission"
|
||||||
@search="(params:any)=>queryParams = {...params}"
|
@search="handleSearch"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<j-pro-table
|
<j-pro-table
|
||||||
|
|
@ -172,27 +172,24 @@ const columns = [
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
search: {
|
search: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
first: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
ellipsis: true,
|
scopedSlots: true,
|
||||||
search: {
|
search: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [
|
options: [
|
||||||
{
|
{ label: '启用', value: 1 },
|
||||||
label: '启用',
|
{ label: '禁用', value: 0 },
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '禁用',
|
|
||||||
value: 0,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
|
handleValue: (v: any) => {
|
||||||
|
return v;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
scopedSlots: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
|
@ -204,6 +201,9 @@ const columns = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const queryParams = ref({});
|
const queryParams = ref({});
|
||||||
|
const handleSearch = (e: any) => {
|
||||||
|
queryParams.value = e;
|
||||||
|
};
|
||||||
// 表格
|
// 表格
|
||||||
const tableRef = ref<Record<string, any>>({}); // 表格实例
|
const tableRef = ref<Record<string, any>>({}); // 表格实例
|
||||||
const table = {
|
const table = {
|
||||||
|
|
@ -237,7 +237,7 @@ const table = {
|
||||||
clickExport: () => {
|
clickExport: () => {
|
||||||
const params = {
|
const params = {
|
||||||
paging: false,
|
paging: false,
|
||||||
...queryParams,
|
...queryParams.value,
|
||||||
};
|
};
|
||||||
exportPermission_api(params).then((resp) => {
|
exportPermission_api(params).then((resp) => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue