From 1878265254c4dc341279878385e43d27c93b2bfe Mon Sep 17 00:00:00 2001
From: K <704496037@qq.com>
Date: Tue, 19 Mar 2024 00:01:01 +0800
Subject: [PATCH] + cmcodes
---
package.json | 2 +-
src/locales/en.ts | 1 +
src/locales/zh.ts | 1 +
src/router/index.ts | 10 +
src/store/codeStore.ts | 6 +-
src/types/store/codeStore.d.ts | 1 +
src/views/FileEditor.vue | 857 +++++++++++++------------
src/views/FilePreview.vue | 2 +-
src/views/SubEditor.vue | 2 +-
src/views/editCode/cmView.vue | 77 +--
src/views/editCode/editScript.vue | 105 +++
src/views/editor/components/Script.vue | 234 +++----
12 files changed, 704 insertions(+), 594 deletions(-)
create mode 100644 src/views/editCode/editScript.vue
diff --git a/package.json b/package.json
index 5ef76d2f3..80cae136a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
- "version": "2.14.179",
+ "version": "2.14.180",
"private": true,
"scripts": {
"dev": "vite --host",
diff --git a/src/locales/en.ts b/src/locales/en.ts
index 1d5535a6f..7dfe8d7ac 100644
--- a/src/locales/en.ts
+++ b/src/locales/en.ts
@@ -30,6 +30,7 @@ export default {
file: 'File',
sync: 'Sync',
my: 'My Profile',
+ editScript: 'Script Edit',
subEditor: 'Subscription Editor',
fileEditor: 'File Editor',
themeSetting: 'Theme Setting',
diff --git a/src/locales/zh.ts b/src/locales/zh.ts
index 0d578d34f..ad02e2f25 100644
--- a/src/locales/zh.ts
+++ b/src/locales/zh.ts
@@ -30,6 +30,7 @@ export default {
file: '文件管理',
sync: '同步',
my: '我的',
+ editScript: '脚本编辑',
subEditor: '订阅编辑',
fileEditor: '文件编辑',
themeSetting: '主题设置',
diff --git a/src/router/index.ts b/src/router/index.ts
index 16f7e7e0d..9fc095c15 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -11,6 +11,7 @@ import NotFound from '@/views/NotFound.vue';
import File from '@/views/File.vue';
import FileEditor from '@/views/FileEditor.vue';
+import editScript from '@/views/editCode/editScript.vue';
import Sub from '@/views/Sub.vue';
import SubEditor from '@/views/SubEditor.vue';
@@ -111,6 +112,15 @@ const router = createRouter({
needNavBack: false,
},
},
+ {
+ path: '/edit/Script/:id',
+ component: editScript,
+ meta: {
+ title: 'editScript',
+ needTabBar: false,
+ needNavBack: true,
+ },
+ },
{
path: '/edit/:editType(files)/:id',
component: FileEditor,
diff --git a/src/store/codeStore.ts b/src/store/codeStore.ts
index 53d1bc3ca..66cc56bb1 100644
--- a/src/store/codeStore.ts
+++ b/src/store/codeStore.ts
@@ -4,12 +4,16 @@ export const useCodeStore = defineStore("cmCodeStore", {
state: (): cmCodeStore => {
return {
CmCode: "",
+ EditCode: {},
};
},
getters: {},
actions: {
setCmCode(i: { toString: () => any }) {
- this.CmCode = i.toString();
+ this.CmCode = i ? i.toString() : "";
+ },
+ setEditCode( id: string , i: { toString: () => any }) {
+ this.EditCode[id] = i ? i.toString() : "";
},
},
});
diff --git a/src/types/store/codeStore.d.ts b/src/types/store/codeStore.d.ts
index 90d56b61c..60d0e31a2 100644
--- a/src/types/store/codeStore.d.ts
+++ b/src/types/store/codeStore.d.ts
@@ -1,3 +1,4 @@
interface cmCodeStore {
CmCode?: string;
+ EditCode?: { [key: string]: string };
}
diff --git a/src/views/FileEditor.vue b/src/views/FileEditor.vue
index 17b787001..8d1564dd4 100644
--- a/src/views/FileEditor.vue
+++ b/src/views/FileEditor.vue
@@ -54,62 +54,63 @@
/>
{{ $t(`editorPage.subConfig.nodeActions['${type}'].des[0]`) }} - {{ $t('subPage.panel.tips.ok') }} + + {{ $t("subPage.panel.tips.ok") }} +