Skip to content

Commit e349148

Browse files
committed
fix: 更新分享管理路由,修复开发报错,优化PC端订阅预览样式
1 parent 435117a commit e349148

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store-front-end",
3-
"version": "2.15.56",
3+
"version": "2.15.57",
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",

src/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const router = createRouter({
118118
},
119119
},
120120
{
121-
path: '/share/manage',
121+
path: '/shares',
122122
component: ShareManage,
123123
meta: {
124124
title: 'shareManage',

src/views/CompareTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@
562562
}
563563
564564
.compare-page-wrapper {
565-
width: 100vw;
565+
width: 100%;
566566
height: 100vh;
567567
z-index: 1000;
568568
overflow-x: hidden;

src/views/FilePreview.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ const copyUrl = async () => {
348348
// top: 0;
349349
// left: 0;
350350
// position: absolute;
351-
width: 100vw;
351+
width: 100%;
352+
352353
height: 100vh;
353354
z-index: 1000;
354355
overflow-x: hidden;

src/views/My.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ const onClickAPISetting = () => {
316316
};
317317
318318
const onClickShareManage = () => {
319-
router.push(`/share/manage`);
319+
router.push(`/shares`);
320320
};
321321
const onClickMore = () => {
322322
router.push(`/settings/more`);

src/views/SubEditor.vue

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,9 @@ const padding = bottomSafeArea.value + "px";
613613
}
614614
};
615615
const selectedSubs = computed(() => {
616-
if(!Array.isArray(form.subscriptions) || form.subscriptions.length === 0) return `: ${t(`editorPage.subConfig.basic.subscriptions.empty`)}`
617-
return `: ${form.subscriptions.map((name) => {
616+
const subscriptions = form.subscriptions || [];
617+
if(!Array.isArray(subscriptions) || subscriptions.length === 0) return `: ${t(`editorPage.subConfig.basic.subscriptions.empty`)}`
618+
return `: ${subscriptions.map((name) => {
618619
const sub = subsStore.getOneSub(name);
619620
return sub?.displayName || sub?.["display-name"] || sub.name;
620621
}).join(', ')}`
@@ -640,7 +641,6 @@ const form = reactive<any>({
640641
passThroughUA: false,
641642
icon: "",
642643
isIconColor: true,
643-
subscriptions: [],
644644
process: [
645645
{
646646
type: "Quick Setting Operator",
@@ -1147,6 +1147,10 @@ const urlValidator = (val: string): Promise<boolean> => {
11471147
// console.log(`${!v} -> ${v}`)
11481148
// };
11491149
const subCheckboxClick = () => {
1150+
// 确保 form.subscriptions 存在
1151+
if (!form.subscriptions) {
1152+
form.subscriptions = [];
1153+
}
11501154
// const selected = toRaw(form.subscriptions) || []
11511155
const group = subsSelectList.value.filter(item => shouldShowElement(item[3])).map(item => item[0]) || []
11521156
if (subCheckboxIndeterminate.value) {
@@ -1189,6 +1193,11 @@ const urlValidator = (val: string): Promise<boolean> => {
11891193
const selectedItems = [];
11901194
const unselectedItems = [];
11911195
1196+
// 确保 form.subscriptions 存在
1197+
if (!form.subscriptions) {
1198+
form.subscriptions = [];
1199+
}
1200+
11921201
// 优先添加已勾选的订阅
11931202
form.subscriptions.forEach(selectedName => {
11941203
const item = filtered.find(item => item[0] === selectedName);
@@ -1228,6 +1237,11 @@ const urlValidator = (val: string): Promise<boolean> => {
12281237
12291238
const newSubscriptions = [];
12301239
1240+
// 确保 form.subscriptions 存在
1241+
if (!form.subscriptions) {
1242+
form.subscriptions = [];
1243+
}
1244+
12311245
// 先按新顺序添加当前过滤列表中已选中的订阅
12321246
newFilteredOrder.forEach(name => {
12331247
if (form.subscriptions.includes(name)) {
@@ -1245,7 +1259,7 @@ const urlValidator = (val: string): Promise<boolean> => {
12451259
console.log("更新后的 form.subscriptions:", form.subscriptions);
12461260
};
12471261
watch([tag, form.subscriptions, subsSelectList], () => {
1248-
const selected = toRaw(form.subscriptions) || []
1262+
const selected = toRaw(form.subscriptions || []) || []
12491263
const group = subsSelectList.value.filter(item => shouldShowElement(item[3])).map(item => item[0]) || []
12501264
// 1. group 中不包含 selected 中的任何元素, subCheckbox 为 false, subCheckboxIndeterminate 为 false
12511265
// 2. group 中包含 selected 中的任意元素, subCheckbox 为 true, subCheckboxIndeterminate 为 true

0 commit comments

Comments
 (0)