wip
This commit is contained in:
1
components.d.ts
vendored
1
components.d.ts
vendored
@@ -99,6 +99,7 @@ declare module 'vue' {
|
||||
IconFluentSlideTextTitleEdit20Regular: typeof import('~icons/fluent/slide-text-title-edit20-regular')['default']
|
||||
IconFluentSparkle20Regular: typeof import('~icons/fluent/sparkle20-regular')['default']
|
||||
IconFluentSpeakerEdit20Regular: typeof import('~icons/fluent/speaker-edit20-regular')['default']
|
||||
IconFluentSpeakerSettings20Regular: typeof import('~icons/fluent/speaker-settings20-regular')['default']
|
||||
IconFluentStar16Filled: typeof import('~icons/fluent/star16-filled')['default']
|
||||
IconFluentStar16Regular: typeof import('~icons/fluent/star16-regular')['default']
|
||||
IconFluentStar20Filled: typeof import('~icons/fluent/star20-filled')['default']
|
||||
|
||||
@@ -2,7 +2,7 @@ version: "2"
|
||||
services:
|
||||
typeword:
|
||||
image: "node:latest"
|
||||
#environment: #按需配置,主要为了科学上网解决依赖安装网络问题
|
||||
#environment: #按需配置, 主要为了科学上网解决依赖安装网络问题
|
||||
# - HTTP_PROXY=http://127.0.0.1:80
|
||||
# HTTPS_PROXY=http://127.0.0.1:80
|
||||
working_dir: /home/node/app
|
||||
|
||||
@@ -94,5 +94,7 @@ export const LIB_JS_URL = {
|
||||
SHEPHERD: import.meta.env.MODE === 'development' ?
|
||||
'https://cdn.jsdelivr.net/npm/shepherd.js@14.5.1/dist/esm/shepherd.mjs'
|
||||
: Origin + '/libs/Shepherd.14.5.1.mjs',
|
||||
SNAPDOM: `${Origin}/libs/snapdom.min.js`
|
||||
SNAPDOM: `${Origin}/libs/snapdom.min.js`,
|
||||
JSZIP: `${Origin}/libs/jszip.min.js`,
|
||||
XLSX: `${Origin}/libs/xlsx.full.min.js`,
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import {loadJsLib, shakeCommonDict} from "@/utils";
|
||||
import {
|
||||
APP_NAME,
|
||||
APP_VERSION,
|
||||
EXPORT_DATA_KEY,
|
||||
EXPORT_DATA_KEY, LIB_JS_URL,
|
||||
LOCAL_FILE_KEY,
|
||||
Origin,
|
||||
PracticeSaveArticleKey,
|
||||
@@ -28,7 +28,7 @@ export function useExport() {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
try {
|
||||
const JSZip = await loadJsLib('JSZip', `${Origin}/libs/jszip.min.js`);
|
||||
const JSZip = await loadJsLib('JSZip', LIB_JS_URL.JSZIP);
|
||||
let data = {
|
||||
version: EXPORT_DATA_KEY.version,
|
||||
val: {
|
||||
|
||||
@@ -15,7 +15,7 @@ import {getDefaultArticle} from "@/types/func.ts";
|
||||
import BackIcon from "@/components/BackIcon.vue";
|
||||
import MiniDialog from "@/components/dialog/MiniDialog.vue";
|
||||
import {onMounted} from "vue";
|
||||
import {Origin} from "@/config/env.ts";
|
||||
import { LIB_JS_URL, Origin } from "@/config/env.ts";
|
||||
import {syncBookInMyStudyList} from "@/hooks/article.ts";
|
||||
|
||||
const base = useBaseStore()
|
||||
@@ -132,7 +132,7 @@ function importData(e: any) {
|
||||
let reader = new FileReader();
|
||||
reader.onload = async function (s) {
|
||||
importLoading = true
|
||||
const XLSX = await loadJsLib('XLSX', `${Origin}/libs/xlsx.full.min.js`);
|
||||
const XLSX = await loadJsLib('XLSX', LIB_JS_URL.XLSX);
|
||||
let data = s.target.result;
|
||||
let workbook = XLSX.read(data, {type: 'binary'});
|
||||
let res: any[] = XLSX.utils.sheet_to_json(workbook.Sheets['Sheet1']);
|
||||
@@ -198,7 +198,7 @@ function importData(e: any) {
|
||||
|
||||
async function exportData(val: { type: string, data?: Article }) {
|
||||
exportLoading = true
|
||||
const XLSX = await loadJsLib('XLSX', `${Origin}/libs/xlsx.full.min.js`);
|
||||
const XLSX = await loadJsLib('XLSX', LIB_JS_URL.XLSX);
|
||||
const {type, data} = val
|
||||
let list = []
|
||||
let filename = ''
|
||||
|
||||
@@ -18,7 +18,7 @@ import {useBaseStore} from "@/stores/base.ts";
|
||||
import {saveAs} from "file-saver";
|
||||
import {
|
||||
APP_NAME, APP_VERSION, EMAIL,
|
||||
EXPORT_DATA_KEY, GITHUB, Host,
|
||||
EXPORT_DATA_KEY, GITHUB, Host, LIB_JS_URL,
|
||||
LOCAL_FILE_KEY,
|
||||
Origin,
|
||||
PracticeSaveArticleKey,
|
||||
@@ -253,7 +253,7 @@ async function importData(e) {
|
||||
reader.readAsText(file);
|
||||
} else if (file.name.endsWith(".zip")) {
|
||||
try {
|
||||
const JSZip = await loadJsLib('JSZip', `${Origin}/libs/jszip.min.js`);
|
||||
const JSZip = await loadJsLib('JSZip', LIB_JS_URL.JSZIP);
|
||||
const zip = await JSZip.loadAsync(file);
|
||||
|
||||
const dataFile = zip.file("data.json");
|
||||
|
||||
@@ -278,7 +278,7 @@ function importData(e) {
|
||||
reader.onload = async function (s) {
|
||||
let data = s.target.result;
|
||||
importLoading = true
|
||||
const XLSX = await loadJsLib('XLSX', `${Origin}/libs/xlsx.full.min.js`);
|
||||
const XLSX = await loadJsLib('XLSX', LIB_JS_URL.XLSX);
|
||||
let workbook = XLSX.read(data, {type: 'binary'});
|
||||
let res: any[] = XLSX.utils.sheet_to_json(workbook.Sheets['Sheet1']);
|
||||
if (res.length) {
|
||||
@@ -357,7 +357,7 @@ function importData(e) {
|
||||
|
||||
async function exportData() {
|
||||
exportLoading = true
|
||||
const XLSX = await loadJsLib('XLSX', `${Origin}/libs/xlsx.full.min.js`);
|
||||
const XLSX = await loadJsLib('XLSX', LIB_JS_URL.XLSX);
|
||||
let list = runtimeStore.editDict.words
|
||||
let filename = runtimeStore.editDict.name
|
||||
let wb = XLSX.utils.book_new()
|
||||
|
||||
Reference in New Issue
Block a user