Skip to content

Commit d68fdf0

Browse files
committed
fix: 更新导入文件弹窗样式,修复交互细节问题
1 parent 6db759c commit d68fdf0

File tree

6 files changed

+39
-22
lines changed

6 files changed

+39
-22
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.14.318",
3+
"version": "2.14.319",
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",

src/assets/icons/file.svg

Lines changed: 1 addition & 0 deletions
Loading

src/components/FileListItem.vue

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,18 @@
134134
</nut-button>
135135
</div>
136136
<div class="sub-item-swipe-btn-wrapper">
137-
<a
137+
<!-- <a
138138
:href="`${host}/api/wholeFile/${encodeURIComponent(name)}?raw=1`"
139139
target="_blank"
140+
> -->
141+
<nut-button
142+
shape="square"
143+
type="success"
144+
class="sub-item-swipe-btn"
145+
@click="onClickExportFile(name)"
140146
>
141-
<nut-button shape="square" type="success" class="sub-item-swipe-btn">
142-
<font-awesome-icon icon="fa-solid fa-file-export" />
143-
</nut-button>
144-
</a>
147+
<font-awesome-icon icon="fa-solid fa-file-export" />
148+
</nut-button>
145149
</div>
146150
<!-- preview -->
147151
<!-- <div class="sub-item-swipe-btn-wrapper">
@@ -174,14 +178,14 @@
174178
</nut-button>
175179
</div>
176180
<div class="sub-item-swipe-btn-wrapper">
177-
<a
178-
:href="`${host}/api/wholeFile/${encodeURIComponent(name)}?raw=1`"
179-
target="_blank"
181+
<nut-button
182+
shape="square"
183+
type="success"
184+
class="sub-item-swipe-btn"
185+
@click="onClickExportFile(name)"
180186
>
181-
<nut-button shape="square" type="success" class="sub-item-swipe-btn">
182-
<font-awesome-icon icon="fa-solid fa-file-export" />
183-
</nut-button>
184-
</a>
187+
<font-awesome-icon icon="fa-solid fa-file-export" />
188+
</nut-button>
185189
</div>
186190
<!-- <div class="sub-item-swipe-btn-wrapper">
187191
<nut-button shape="square" type="success" class="sub-item-swipe-btn" @click="onClickPreview">
@@ -422,6 +426,14 @@
422426
const shareBtnVisible = computed(() => {
423427
return env.value?.feature?.share;
424428
});
429+
430+
const onClickExportFile = (name) => {
431+
swipeClose();
432+
const url = `${host.value}/api/wholeFile/${encodeURIComponent(name)}?raw=1`;
433+
console.log('url', url);
434+
window.open(url, '_blank'); // 在新窗口中打开链接
435+
};
436+
425437
const onClickShareLink = async () => {
426438
console.log('props', props)
427439
const type = props.type;

src/locales/en.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export default {
7272
"If you are seeing this, it is probably due to a routing interception issue on the front end of your browser. You can force a refresh to see it or use the link directly without affecting the use of this link.",
7373
},
7474
filePage: {
75+
addFileTitle: "Add File",
76+
importFileTitle: "Import Sub-Store file data",
77+
importFileTips: "On the File Management page, click the Export icon button in the More items section of a file.",
7578
deleteFile: {
7679
succeedNotify: "Successfully deleted!",
7780
},

src/locales/zh.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ export default {
9999
backendDesc: '如果你看到这个 可能是因为浏览器前端路由拦截的问题 可以强制刷新查看或直接使用该链接 不影响此链接的使用',
100100
},
101101
filePage: {
102+
addFileTitle: '创建文件',
103+
importFileTitle: '导入 Sub-Store 文件数据',
104+
importFileTips: '文件管理页面, 在某个文件左滑/右滑的更多项中, 点击导出图标按钮',
102105
deleteFile: {
103106
succeedNotify: '删除文件成功',
104107
},

src/views/File.vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@touchmove="onTouchMove"
66
@touchend="onTouchEnd"
77
>
8-
<!-- 添加订阅弹窗 -->
8+
<!-- 添加订阅弹窗 -->
99
<!-- lock-scroll -->
1010
<div>
1111
<nut-popup
@@ -22,8 +22,7 @@
2222
round
2323
>
2424
<div class="title-btn">
25-
<!-- <p class="add-sub-panel-title">{{ $t(`subPage.addSubTitle`) }}</p> -->
26-
<p class="add-sub-panel-title">创建文件</p>
25+
<p class="add-sub-panel-title">{{ $t(`filePage.addFileTitle`) }}</p>
2726
<p class="add-sub-panel-title or">{{ $t(`specificWord.or`) }}</p>
2827
<input type="file" ref="fileInput" accept="application/json,text/json,.json" @change="fileChange" style="display: none">
2928
<nut-button
@@ -46,9 +45,8 @@
4645
<ul class="add-sub-panel-list">
4746
<li>
4847
<router-link to="/edit/files/UNTITLED" class="router-link">
49-
<svg-icon name="singleSubs" />
50-
<!-- <span>{{ $t(`specificWord.singleSub`) }}</span> -->
51-
<span>文件</span>
48+
<svg-icon name="file" />
49+
<span>{{ $t(`specificWord.file`) }}</span>
5250
</router-link>
5351
</li>
5452
<!-- <li>
@@ -394,8 +392,8 @@ const fileChange = async (event) => {
394392
const importTips = () => {
395393
addSubBtnIsVisible.value = false
396394
Dialog({
397-
title: '导入 Sub-Store 文件数据',
398-
content: '文件管理页面, 在某个文件左滑/右滑的更多项中, 点击导出图标按钮',
395+
title: t(`filePage.importFileTitle`),
396+
content: t(`filePage.importFileTips`),
399397
popClass: 'auto-dialog',
400398
okText: 'OK',
401399
noCancelBtn: true,
@@ -486,7 +484,7 @@ const importTips = () => {
486484
color: var(--second-text-color);
487485
488486
> li {
489-
width: 50%;
487+
flex: 1;
490488
display: flex;
491489
justify-content: center;
492490

0 commit comments

Comments
 (0)