Skip to content

Commit e66e240

Browse files
committed
update
1 parent 78bf0b0 commit e66e240

5 files changed

Lines changed: 851 additions & 337 deletions

File tree

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@
5757
- Unicode 自动解码
5858
- 语法高亮和错误提示
5959
- 转义/去转义功能
60-
- 支持配置自动解码 Unicode
61-
- 支持去转义时删除换行符和制表符
6260
- 支持多标签页编辑
61+
- **对比模式**:并排对比两个 JSON 文件的差异
62+
- 对比模式下支持双向编辑
63+
- 自动高亮显示差异内容
64+
- 对比模式下可格式化/压缩两个编辑器
6365

6466
- **XML 编辑器**
6567

@@ -68,6 +70,9 @@
6870
- 实时编辑预览
6971
- Monaco Editor 支持
7072
- 支持多标签页编辑
73+
- **对比模式**:并排对比两个 XML 文件的差异
74+
- 对比模式下支持双向编辑
75+
- 自动高亮显示差异内容
7176

7277
- **JSON 转 Go**
7378

@@ -145,11 +150,12 @@
145150
- 支持设置容错级别
146151

147152
- **文本对比**
148-
- 支持对比两段文本的差异
149-
- 直观的差异显示
150-
- 支持忽略空白字符
153+
- 基于 Monaco Diff Editor 的专业文本对比工具
154+
- 并排显示,自动高亮差异
155+
- 支持双向编辑
156+
- 支持忽略空白字符选项
151157
- 实时对比结果
152-
- 并排显示,一目了然
158+
- 适用于任何文本格式(不限于 JSON/XML)
153159

154160
## 技术栈
155161

frontend/src/stores/tools.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { defineStore } from 'pinia'
22

33
interface JsonEditorTab {
44
code: string
5-
settings: {
6-
autoDecodeUnicode: boolean
7-
}
5+
compareMode: boolean // 是否处于对比模式
6+
compareCode: string // 对比模式下的第二个编辑器内容
7+
syncScroll: boolean // 是否同步滚动
88
}
99

1010
interface JsonEditorTabs {
@@ -13,6 +13,8 @@ interface JsonEditorTabs {
1313

1414
interface XmlEditorTab {
1515
code: string
16+
compareMode: boolean // 是否处于对比模式
17+
compareCode: string // 对比模式下的第二个编辑器内容
1618
settings: {
1719
autoFormat: boolean
1820
}
@@ -46,18 +48,24 @@ export const useToolsStore = defineStore('tools', {
4648
xmlEditorTabs: <XmlEditorTabs>{
4749
default: {
4850
code: '',
51+
compareMode: false,
52+
compareCode: '',
4953
settings: {
5054
autoFormat: false
5155
}
5256
}
5357
},
5458
currentXmlEditorTab: 'default',
59+
// JSON 编辑器全局设置
60+
jsonEditorSettings: {
61+
autoDecodeUnicode: false
62+
},
5563
jsonEditorTabs: <JsonEditorTabs>{
5664
default: {
5765
code: '',
58-
settings: {
59-
autoDecodeUnicode: false
60-
}
66+
compareMode: false,
67+
compareCode: '',
68+
syncScroll: true
6169
}
6270
},
6371
currentJsonEditorTab: 'default',
@@ -171,9 +179,9 @@ export const useToolsStore = defineStore('tools', {
171179
const id = Date.now().toString()
172180
this.jsonEditorTabs[id] = {
173181
code: '',
174-
settings: {
175-
autoDecodeUnicode: false
176-
}
182+
compareMode: false,
183+
compareCode: '',
184+
syncScroll: true
177185
}
178186
return id
179187
},
@@ -184,6 +192,8 @@ export const useToolsStore = defineStore('tools', {
184192
const id = Date.now().toString()
185193
this.xmlEditorTabs[id] = {
186194
code: '',
195+
compareMode: false,
196+
compareCode: '',
187197
settings: {
188198
autoFormat: false
189199
}

0 commit comments

Comments
 (0)