修复已知bug

This commit is contained in:
2024-07-23 16:41:29 +08:00
parent e0b85aae8f
commit 717c89a58e
12 changed files with 92 additions and 36 deletions

View File

@@ -24,6 +24,8 @@ export interface MpMenu {
icon?: string; icon?: string;
// 图标颜色 // 图标颜色
color?: string; color?: string;
// 上传图标
avatar?: string;
// 所在行 // 所在行
rows?: number; rows?: number;
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单) // 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)

View File

@@ -1,11 +1,11 @@
<!-- 搜索表单 --> <!-- 搜索表单 -->
<template> <template>
<a-space :size="10" style="flex-wrap: wrap"> <a-space :size="10" style="flex-wrap: wrap" v-if="count === 0">
<a-button type="primary" class="ele-btn-icon" @click="add"> <a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
<span>添加</span> <span>创建</span>
</a-button> </a-button>
</a-space> </a-space>
</template> </template>
@@ -19,6 +19,7 @@
defineProps<{ defineProps<{
// 选中的角色 // 选中的角色
selection?: []; selection?: [];
count?: 0;
}>(), }>(),
{} {}
); );

View File

@@ -15,6 +15,7 @@
<search <search
@search="reload" @search="reload"
:selection="selection" :selection="selection"
:count="count"
@add="openEdit" @add="openEdit"
@remove="removeBatch" @remove="removeBatch"
@batchMove="openMove" @batchMove="openMove"
@@ -66,6 +67,7 @@
// 表格选中数据 // 表格选中数据
const selection = ref<Mp[]>([]); const selection = ref<Mp[]>([]);
const count = ref<number>(0);
// 当前编辑数据 // 当前编辑数据
const current = ref<Mp | null>(null); const current = ref<Mp | null>(null);
// 是否显示编辑弹窗 // 是否显示编辑弹窗
@@ -213,6 +215,10 @@
/* 查询 */ /* 查询 */
const query = () => { const query = () => {
loading.value = true; loading.value = true;
pageMp({}).then((res) => {
console.log(res?.count);
count.value = res?.count;
});
}; };
/* 自定义行属性 */ /* 自定义行属性 */

View File

@@ -33,7 +33,26 @@
v-model:value="form.path" v-model:value="form.path"
/> />
</a-form-item> </a-form-item>
<a-form-item label="菜单图标" name="icon"> <!-- <a-form-item label="选择图标" name="icon">-->
<!-- <ele-icon-picker-->
<!-- :data="iconData"-->
<!-- :allow-search="false"-->
<!-- v-model:value="form.icon"-->
<!-- placeholder="请选择菜单图标"-->
<!-- >-->
<!-- <template #icon="{ icon }">-->
<!-- <component :is="icon" />-->
<!-- </template>-->
<!-- </ele-icon-picker>-->
<!-- </a-form-item>-->
<a-form-item label="文字颜色" name="color">
<ele-color-picker
:show-alpha="true"
v-model:value="form.color"
:predefine="predefineColors"
/>
</a-form-item>
<a-form-item label="上传图标" name="avatar" extra="优先级高于图标">
<SelectFile <SelectFile
:placeholder="`请选择图片`" :placeholder="`请选择图片`"
:limit="1" :limit="1"
@@ -42,13 +61,6 @@
@del="onDeleteItem" @del="onDeleteItem"
/> />
</a-form-item> </a-form-item>
<a-form-item label="图标颜色" name="color">
<ele-color-picker
:show-alpha="true"
v-model:value="form.color"
:predefine="predefineColors"
/>
</a-form-item>
<a-form-item label="分组" name="parentId"> <a-form-item label="分组" name="parentId">
<SelectDict <SelectDict
dict-code="mpGroup" dict-code="mpGroup"
@@ -98,7 +110,7 @@
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types'; import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form'; import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model'; import { FileRecord } from '@/api/system/file/model';
import { DictData } from "@/api/system/dict-data/model"; import { DictData } from '@/api/system/dict-data/model';
// 是否是修改 // 是否是修改
const isUpdate = ref(false); const isUpdate = ref(false);
@@ -145,10 +157,12 @@
target: 'uni.navigateTo', target: 'uni.navigateTo',
icon: '', icon: '',
color: undefined, color: undefined,
avatar: undefined,
hide: undefined, hide: undefined,
position: undefined, position: undefined,
active: undefined, active: undefined,
userId: 0, userId: 0,
groupName: undefined,
home: undefined, home: undefined,
sortNumber: 100, sortNumber: 100,
comments: '', comments: '',
@@ -194,12 +208,12 @@
url: data.thumbnail, url: data.thumbnail,
status: 'done' status: 'done'
}); });
form.icon = data.thumbnail; form.avatar = data.thumbnail;
}; };
const onDeleteItem = (index: number) => { const onDeleteItem = (index: number) => {
images.value.splice(index, 1); images.value.splice(index, 1);
form.icon = ''; form.avatar = '';
}; };
const chooseGroupId = (item: DictData) => { const chooseGroupId = (item: DictData) => {
@@ -273,10 +287,10 @@
} }
if (props.data) { if (props.data) {
assignObject(form, props.data); assignObject(form, props.data);
if (props.data.icon) { if (props.data.avatar) {
images.value.push({ images.value.push({
uid: uuid(), uid: uuid(),
url: props.data.icon, url: props.data.avatar,
status: 'done' status: 'done'
}); });
} }
@@ -291,3 +305,21 @@
{ immediate: true } { immediate: true }
); );
</script> </script>
<script lang="ts">
import * as icons from '@/layout/menu-icons';
export default {
components: icons,
data() {
return {
iconData: [
{
title: '已引入的图标',
icons: Object.keys(icons)
}
]
};
}
};
</script>

View File

@@ -5,7 +5,7 @@
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
<span>添加图标</span> <span>添加菜单</span>
</a-button> </a-button>
<SelectDict <SelectDict
dict-code="mpGroup" dict-code="mpGroup"

View File

@@ -79,7 +79,7 @@
class="ele-cell-content ele-text-center btn-center" class="ele-cell-content ele-text-center btn-center"
@click="openMpMenuEdit(item)" @click="openMpMenuEdit(item)"
> >
<a-image :src="item.icon" :width="40" :preview="false" /> <a-image :src="item.avatar" :width="40" :preview="false" />
<span style="white-space: nowrap">{{ item.title }}</span> <span style="white-space: nowrap">{{ item.title }}</span>
</div> </div>
</div> </div>

View File

@@ -41,8 +41,9 @@
> >
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'icon'"> <template v-if="column.key === 'avatar'">
<a-avatar :src="record.icon" :width="50" /> <a-avatar v-if="record.avatar" :src="record.avatar" />
<!-- <component v-if="record.icon" :is="record.icon" />-->
</template> </template>
<template v-if="column.key === 'path'"> <template v-if="column.key === 'path'">
<span class="ele-text-placeholder">{{ record.path }}</span> <span class="ele-text-placeholder">{{ record.path }}</span>
@@ -185,8 +186,8 @@
}, },
{ {
title: '菜单图标', title: '菜单图标',
dataIndex: 'icon', dataIndex: 'avatar',
key: 'icon', key: 'avatar',
align: 'center', align: 'center',
width: 90 width: 90
}, },
@@ -341,8 +342,10 @@
</script> </script>
<script lang="ts"> <script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
export default { export default {
name: 'MpMenuHome' name: 'MpMenuHome',
components: MenuIcons
}; };
</script> </script>

View File

@@ -31,7 +31,6 @@
allow-clear allow-clear
placeholder="/package/goods/detail" placeholder="/package/goods/detail"
v-model:value="form.path" v-model:value="form.path"
:disabled="form.subpackage === 'MainPackage'"
/> />
</a-form-item> </a-form-item>
<a-form-item label="分包" name="subpackage"> <a-form-item label="分包" name="subpackage">

View File

@@ -56,9 +56,15 @@
<div class="gutter-box"> <div class="gutter-box">
<div class="plug-item"> <div class="plug-item">
<a-image <a-image
:height="80" :height="72"
:width="80" :width="72"
:preview="false" :preview="false"
class="app-icon"
style="
border: 1px solid #e3e3e3;
box-shadow: 0 0 1px -1px;
border-radius: 12px;
"
:src="item.companyLogo" :src="item.companyLogo"
@click="openUrl('/system/plug/detail?id=' + item.companyId)" @click="openUrl('/system/plug/detail?id=' + item.companyId)"
fallback="https://file.wsdns.cn/20230218/550e610d43334dd2a7f66d5b20bd58eb.svg" fallback="https://file.wsdns.cn/20230218/550e610d43334dd2a7f66d5b20bd58eb.svg"
@@ -216,10 +222,12 @@
.plug-item { .plug-item {
display: flex; display: flex;
.app-icon {
}
.info { .info {
font-size: 14px; font-size: 14px;
margin-left: 6px; margin-left: 12px;
max-width: 234px;
.name { .name {
font-size: 20px; font-size: 20px;

View File

@@ -15,9 +15,14 @@
<div class="goods-info"> <div class="goods-info">
<div class="logo"> <div class="logo">
<a-image <a-image
:width="70" :width="72"
:height="70" :height="72"
:preview="false" :preview="false"
style="
border: 1px solid #e3e3e3;
box-shadow: 0 0 1px -1px;
border-radius: 12px;
"
:src="form.companyLogo" :src="form.companyLogo"
/> />
</div> </div>

View File

@@ -52,8 +52,8 @@
</a-space> </a-space>
</div> </div>
<a-typography-text> <a-typography-text>
<!-- <div class="update-info ele-text-secondary" v-html="item.updateInfo"></div>--> <div class="update-info ele-text-secondary" v-html="item.updateInfo"></div>
<byte-md-viewer :value="item.updateInfo" :plugins="plugins" /> <!-- <byte-md-viewer v-if="item" :value="item.updateInfo" :plugins="plugins" />-->
</a-typography-text> </a-typography-text>
</a-timeline-item> </a-timeline-item>
</a-timeline> </a-timeline>