diff --git a/src/api/cms/mpPages/model/index.ts b/src/api/cms/mpPages/model/index.ts
index 0a0393c..ac06f00 100644
--- a/src/api/cms/mpPages/model/index.ts
+++ b/src/api/cms/mpPages/model/index.ts
@@ -18,6 +18,10 @@ export interface MpPages {
subpackage?: string;
// 图标
icon?: string;
+ // (优先级高于图标)
+ iconPath?: string;
+ // (优先级高于图标)
+ selectedIconPath?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
diff --git a/src/views/cms/mpField/components/mp-field-edit.vue b/src/views/cms/mpField/components/mp-field-edit.vue
index 792c7f0..8622929 100644
--- a/src/views/cms/mpField/components/mp-field-edit.vue
+++ b/src/views/cms/mpField/components/mp-field-edit.vue
@@ -27,11 +27,24 @@
-
-
+
+
+
+
@@ -42,13 +55,11 @@
v-model:value="form.sortNumber"
/>
-
-
+
diff --git a/src/views/cms/mpField/index.vue b/src/views/cms/mpField/index.vue
index fbdd64a..a95cd58 100644
--- a/src/views/cms/mpField/index.vue
+++ b/src/views/cms/mpField/index.vue
@@ -52,6 +52,18 @@
+
+ 温馨提示:跟随程序自动加载,通过
{{ config.mpLogo }}可以方便调用,文本内容不加密。查看帮助文档
+
@@ -38,21 +39,46 @@
dict-code="mpPackage"
:placeholder="`选择分包`"
style="width: 200px"
+ :disabled="form.subpackage === 'MainPackage'"
v-model:value="form.subpackage"
/>
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
- import { assignObject } from 'ele-admin-pro';
+ import { assignObject, uuid } from 'ele-admin-pro';
import { addMpPages, updateMpPages } from '@/api/cms/mpPages';
import { MpPages } from '@/api/cms/mpPages/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
+ import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
@@ -110,7 +137,8 @@
const maxable = ref(true);
// 表格选中数据
const formRef = ref(null);
- const images = ref([]);
+ const iconPath = ref([]);
+ const selectedIconPath = ref([]);
// 用户信息
const form = reactive({
@@ -120,6 +148,9 @@
path: undefined,
home: undefined,
subpackage: undefined,
+ icon: undefined,
+ iconPath: '',
+ selectedIconPath: '',
sortNumber: 100,
comments: undefined,
status: undefined
@@ -150,6 +181,34 @@
]
});
+ const chooseFile = (data: FileRecord) => {
+ iconPath.value.push({
+ uid: data.id,
+ url: data.downloadUrl,
+ status: 'done'
+ });
+ form.iconPath = data.url;
+ };
+
+ const onDeleteItem = (index: number) => {
+ iconPath.value.splice(index, 1);
+ form.iconPath = '';
+ };
+
+ const chooseFile2 = (data: FileRecord) => {
+ selectedIconPath.value.push({
+ uid: data.id,
+ url: data.downloadUrl,
+ status: 'done'
+ });
+ form.selectedIconPath = data.url;
+ };
+
+ const onDeleteItem2 = (index: number) => {
+ selectedIconPath.value.splice(index, 1);
+ form.selectedIconPath = '';
+ };
+
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
@@ -184,9 +243,24 @@
() => props.visible,
(visible) => {
if (visible) {
- images.value = [];
+ iconPath.value = [];
+ selectedIconPath.value = [];
if (props.data) {
assignObject(form, props.data);
+ if (props.data.iconPath) {
+ iconPath.value.push({
+ uid: uuid(),
+ url: props.data.iconPath,
+ status: 'done'
+ });
+ }
+ if (props.data.selectedIconPath) {
+ selectedIconPath.value.push({
+ uid: uuid(),
+ url: props.data.selectedIconPath,
+ status: 'done'
+ });
+ }
isUpdate.value = true;
} else {
isUpdate.value = false;
diff --git a/src/views/cms/mpPages/index.vue b/src/views/cms/mpPages/index.vue
index 93498fb..4ee73ea 100644
--- a/src/views/cms/mpPages/index.vue
+++ b/src/views/cms/mpPages/index.vue
@@ -22,7 +22,8 @@
-
+
+
{{ record.title }}