Skip to content

Commit 15c012d

Browse files
committed
补码反码原码 #94
crontab 修改时间格式 #99 ARM to HEX #83 垂直高度自动 #95
1 parent 90ead0b commit 15c012d

25 files changed

+725
-112
lines changed

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "c-tool",
3-
"version": "1.9.1",
3+
"version": "1.9.2",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve --port 8081",
@@ -62,6 +62,7 @@
6262
"vue": "^2.6.14",
6363
"vue-i18n": "^8.26.7",
6464
"vue-router": "^3.5.3",
65+
"vuedraggable": "^2.24.3",
6566
"x2js": "github:abdolence/x2js",
6667
"xml-formatter": "^2.5.1"
6768
},

src/config.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const category = [
1717
{'name': 'common'},
1818
{'name': 'encryption'},
1919
{'name': 'conversion'},
20-
{'name': 'serialize'},
20+
{'name': 'encoder_decoder'},
2121
{'name': 'check'},
2222
{'name': 'generate'},
2323
{'name': 'other'},
@@ -32,34 +32,36 @@ const tool = [
3232
'name': 'encrypt',
3333
'cat': ['encryption']
3434
},
35-
{'name': 'sign', 'cat': ['encryption','check']},
36-
{'name': 'base64', 'cat': ['encryption']},
37-
{'name': 'json', 'cat': ['conversion', 'serialize']},
38-
{'name': 'url', 'cat': ['conversion']},
35+
{'name': 'sign', 'cat': ['encryption', 'check']},
36+
{'name': 'base64', 'cat': ['encryption','encoder_decoder']},
37+
{'name': 'json', 'cat': ['conversion']},
38+
{'name': 'url', 'cat': ['encoder_decoder']},
3939
{'name': 'timestamp', 'cat': ['conversion']},
4040
{'name': 'qrCode', 'cat': ['generate']},
4141
{'name': 'barcode', 'cat': ['generate']},
4242
{'name': 'pinyin', 'cat': ['conversion']},
4343
{'name': 'ip', 'cat': ['other']},
4444
{'name': 'code', 'cat': ['other']},
45-
{'name': 'unicode', 'cat': ['conversion']},
45+
{'name': 'unicode', 'cat': ['encoder_decoder']},
4646
{'name': 'decimalConvert', 'cat': ['conversion']},
4747
{'name': 'regex', 'cat': ['check']},
4848
{'name': 'randomString', 'cat': ['generate']},
49-
{'name': 'serializeConversion', 'cat': ['conversion', 'serialize']},
49+
{'name': 'serializeConversion', 'cat': ['conversion']},
5050
{'name': 'diffs', 'cat': ['check']},
5151
{'name': 'crontab', 'cat': ['check']},
5252
{'name': 'websocket', 'cat': ['other']},
5353
{'name': 'unit', 'cat': ['other']},
5454
{'name': 'time', 'cat': ['other']},
5555
{'name': 'uuid', 'cat': ['generate']},
56-
{'name': 'jsonToObject', 'cat': ['conversion', 'serialize']},
56+
{'name': 'jsonToObject', 'cat': ['conversion','generate']},
5757
{'name': 'ascii', 'cat': ['conversion']},
5858
{'name': 'variableConversion', 'cat': ['conversion']},
59-
{'name': 'jwt', 'cat': ['conversion']},
59+
{'name': 'jwt', 'cat': ['encoder_decoder']},
6060
{'name': 'hexString', 'cat': ['conversion']},
6161
{'name': 'text', 'cat': ['other']},
62-
{'name': 'html', 'cat': ['conversion']},
62+
{'name': 'html', 'cat': ['encoder_decoder']},
63+
{'name': 'binary', 'cat': ['generate']},
64+
{'name': 'armConverter', 'cat': ['conversion']},
6365
]
6466

6567
// 工具类功能配置
@@ -78,6 +80,8 @@ const utools = {
7880
hexString: ['hex to string', 'string to hex', '十六进制转字符串', '字符串转十六机制'],
7981
text: ['文本处理', '大小写转换', '中英文标点转换', '简繁转换', '字符替换', '字符统计', '行去重', '添加行号', '行排序', '过滤行首尾不可见字符', '过滤空行'],
8082
sign: ['签名', '验签', 'rsa'],
83+
binary: ['原码', '补码', '反码'],
84+
armConverter: ['ARM', 'HEX'],
8185
},
8286
cmds: {
8387
timestamp: [
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info_source": "Information Source: ",
3+
"convert": "Convert",
4+
"output": "Output",
5+
"error": "error: {0}"
6+
}

src/i18n/locales/en/binary.i18n.json5

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"input": "Input",
3+
"length": "{0} bit",
4+
"true_form": "trueForm",
5+
"inverse": "Inverse",
6+
"complement": "Complement",
7+
"error": "error: {0}"
8+
}

src/i18n/locales/en/main.i18n.json5

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
{
22
// ui
33
"ui_setting": "Settings",
4+
"ui_reset": "Reset",
45
"ui_views": "View",
5-
"ui_load":"Loading",
6+
"ui_load": "Loading",
67
"ui_close": "Close",
7-
"ui_copy_text_ok":"Result Copied ^o^",
8-
"ui_copy_image_ok":"Image Copied ^o^",
9-
8+
"ui_copy_text_ok": "Result Copied ^o^",
9+
"ui_copy_image_ok": "Image Copied ^o^",
1010
// views
1111
"setting_language": "Language",
1212
"common_tool": "Common Tool",
13-
"keyboard_setting":"Setting Shortcuts",
13+
"unselected_tool": "Unselected Tool",
14+
"keyboard_setting": "Setting Shortcuts",
1415
"display_mode": "Theme",
15-
"display_mode_light":"Light",
16-
"display_mode_dark":"Dark",
17-
"display_mode_auto":"Auto",
18-
"copy_results_to_clipboard":"Copy results to clipboard",
16+
"display_mode_light": "Light",
17+
"display_mode_dark": "Dark",
18+
"display_mode_auto": "Auto",
19+
"copy_results_to_clipboard": "Copy results to clipboard",
1920
"read_content_from_clipboard": "Read content from clipboard",
20-
"read_clipboard_content_trim":"Read clipboard content trim",
21+
"read_clipboard_content_trim": "Read clipboard content trim",
2122
"common_tool_setting": "Common Tool Settings",
22-
"keyboard_firefox_1":"Need to manually set shortcuts",
23+
"keyboard_firefox_1": "Need to manually set shortcuts",
2324
"keyboard_firefox_2": "Open [Add-ons Manager(about:addons)],Click the setting button on the right side of [Manage your extension],Select [Manage Extension Shortcuts] to modify these shortcuts.",
24-
"keyboard_firefox_3":"Operation Method",
25-
25+
"keyboard_firefox_3": "Operation Method",
2626
"history": "History",
2727
"history_clear": "Clear history",
2828
"history_time": "Operation time",
29-
"history_data":"Data",
29+
"history_data": "Data",
3030
"history_op": "Operation",
31-
"history_null":"History not found",
32-
31+
"history_null": "History not found",
3332
// category
3433
"category_common": "Common",
3534
"category_encryption": "En/Decrypt",
3635
"category_conversion": "Convert",
37-
"category_serialize": "Serialize",
36+
"category_encoder_decoder": "En/Decoder",
3837
"category_check": "Validator",
3938
"category_generate": "Generate",
4039
"category_other": "Other",
@@ -69,7 +68,8 @@
6968
"tool_hexString": "Hex/String",
7069
"tool_text": "Text",
7170
"tool_html": "Html En/Decode",
72-
71+
"tool_binary": "trueForm/inverse/complement",
72+
"tool_armConverter": "ARM/HEX",
7373
// other
7474
"css_main_category_item_style": "padding: 0 10px"
7575
}

src/i18n/locales/en/text.i18n.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@
5959
"explain_blank_line_length_name": "Line Length",
6060
"explain_blank_line_length_info": "Blank lines are also included in the number of lines",
6161
"value": "value",
62-
"stat_show": "Word:{1} UTF-8:{1} GBK:{2}"
62+
"stat_show": "Word:{0} UTF-8:{1} GBK:{2}"
6363
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info_source": "数据来源:",
3+
"convert": "转换",
4+
"output": "输出",
5+
"error": "错误: {0}"
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"input": "输入",
3+
"length": "{0} 位",
4+
"true_form": "原码",
5+
"inverse": "反码",
6+
"complement": "补码",
7+
"error": "错误: {0}"
8+
}

src/i18n/locales/zh_CN/main.i18n.json5

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
{
22
// ui
33
"ui_setting": "设置",
4+
"ui_reset": "重置",
45
"ui_views": "查看",
5-
"ui_load":"加载",
6+
"ui_load": "加载",
67
"ui_close": "关闭",
7-
"ui_copy_text_ok":"结果已复制 ^o^",
8-
"ui_copy_image_ok":"图片已复制 ^o^",
9-
8+
"ui_copy_text_ok": "结果已复制 ^o^",
9+
"ui_copy_image_ok": "图片已复制 ^o^",
1010
// 界面
1111
"setting_language": "语言",
1212
"common_tool": "常用工具",
13-
"keyboard_setting":"快捷键设置",
13+
"unselected_tool": "未选择工具",
14+
"keyboard_setting": "快捷键设置",
1415
"display_mode": "主题",
15-
"display_mode_light":"浅色",
16-
"display_mode_dark":"深色",
17-
"display_mode_auto":"自动",
18-
"copy_results_to_clipboard":"自动复制结果到剪贴板",
16+
"display_mode_light": "浅色",
17+
"display_mode_dark": "深色",
18+
"display_mode_auto": "自动",
19+
"copy_results_to_clipboard": "自动复制结果到剪贴板",
1920
"read_content_from_clipboard": "自动读取剪贴板内容",
20-
"read_clipboard_content_trim":"读取剪贴板内容过滤首尾不可见字符",
21+
"read_clipboard_content_trim": "读取剪贴板内容过滤首尾不可见字符",
2122
"common_tool_setting": "常用工具设置",
22-
"keyboard_firefox_1":"请手动设置快捷键",
23+
"keyboard_firefox_1": "请手动设置快捷键",
2324
"keyboard_firefox_2": "请打开附加组件管理器(about:addons),点击“管理扩展程序”右侧的设置按钮,选择“管理扩展快捷键”来修改这些快捷键。",
24-
"keyboard_firefox_3":"操作方法",
25-
25+
"keyboard_firefox_3": "操作方法",
2626
"history": "历史记录",
2727
"history_clear": "清空历史记录",
2828
"history_time": "操作时间",
29-
"history_data":"数据",
29+
"history_data": "数据",
3030
"history_op": "操作",
31-
"history_null":"暂无历史记录",
32-
31+
"history_null": "暂无历史记录",
3332
// 分类
3433
"category_common": "常用",
3534
"category_encryption": "加解密",
3635
"category_conversion": "转换",
37-
"category_serialize": "序列化",
36+
"category_encoder_decoder": "编解码",
3837
"category_check": "校验",
3938
"category_generate": "生成",
4039
"category_other": "其他",
@@ -66,10 +65,11 @@
6665
"tool_ascii": "ASCII转换",
6766
"tool_variableConversion": "变量名转换",
6867
"tool_jwt": "JWT解码",
69-
"tool_hexString": "Hex/String转换",
68+
"tool_hexString": "Hex/String",
7069
"tool_text": "文本处理",
71-
"tool_html": "html编码",
72-
70+
"tool_html": "Html编码",
71+
"tool_binary": "原码/反码/补码",
72+
"tool_armConverter": "ARM/HEX",
7373
// 其他
7474
"css_main_category_item_style": "padding: 0 20px"
7575
}

src/tool.router.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ const routes = [
145145
{
146146
path: '/tool/html',
147147
component: r => require(['./views/tool/html.vue'], r)
148+
},
149+
{
150+
path: '/tool/binary',
151+
component: r => require(['./views/tool/binary.vue'], r)
152+
},
153+
{
154+
path: '/tool/armConverter',
155+
component: r => require(['./views/tool/armConverter.vue'], r)
148156
}
149157
]
150158

src/tool.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
<script>
6969
import config from './tool/config'
70+
import {dispatchCategoryClickEvent} from './tool/event'
7071
import instance from './tool/instance'
7172
import BottomBlock from './bottom'
7273
import settingBlock from "./views/setting/block"
@@ -198,6 +199,9 @@ export default {
198199
this.currentCategory = name
199200
model.setCategoryHistory(name)
200201
this.currentTool = model.getToolHistory(this.currentCategory)
202+
this.$nextTick(()=>{
203+
dispatchCategoryClickEvent(name)
204+
})
201205
break
202206
}
203207
},

src/tool/config.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ const getToolDefaultCategory = function (name) {
4242
return ''
4343
}
4444

45+
const getToolByName = (name) => {
46+
for (let item of tool) {
47+
if (name === item.name) {
48+
return item
49+
}
50+
}
51+
return null
52+
}
53+
4554
/**
4655
* @param name
4756
* @param defaultValue
@@ -65,18 +74,21 @@ const saveSetting = function (name, value) {
6574
}
6675

6776
export default {
68-
tool:tool,
77+
tool: tool,
6978
saveSetting,
7079
getSetting,
7180
category,
7281
setUserCommon,
7382
getUserCommon,
7483
getToolByCategory(cat) {
75-
let common = getUserCommon();
84+
if (cat === 'common') {
85+
return getUserCommon().map((name) => {
86+
return getToolByName(name)
87+
}).filter((item) => {
88+
return item !== null
89+
});
90+
}
7691
return tool.filter((t) => {
77-
if (cat === 'common') {
78-
return common.includes(t.name)
79-
}
8092
return t.cat.includes(cat);
8193
})
8294
},

src/tool/event.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// 定义分类点击事件
2+
export const CATEGORY_CLICK_EVENT_NAME = "ctoolCategoryClick"
3+
export const dispatchCategoryClickEvent = (name) => {
4+
const event = new CustomEvent(CATEGORY_CLICK_EVENT_NAME, {detail: {name}})
5+
window.dispatchEvent(event);
6+
}
7+
8+
9+
10+

0 commit comments

Comments
 (0)