提交 359da568 编写于 作者: P pc-ls 提交者: ninecents

GenJson 增强

上级 93a4577f
......@@ -79,4 +79,10 @@ npm run build -adapter=[chrome|edge|utools|firefox|web]
## 功能列表-yeahmao
| 功能 | 说明 |离线使用|
|--------------|-------------------------------------------------------------------------------------------------------------------------------|---|
| 字节转码 | `16进制字节流`, `美化后`, `字符串格式`, `字节数组格式`,`` |√|
\ No newline at end of file
| 字节转码 | `x64dbg拷贝的汇编代码`, `美化后`, `字符串格式`, `字节数组格式`,`` |√|
## 功能列表-代码生成器
| 功能 | 说明 |离线使用|
|--------------|-------------------------------------------------------------------------------------------------------------------------------|---|
| GenJson | `k-v字符串列表转换为json`, `excel表中数据转json` |√|
| GenJava | `超长字符串报错`,`StringBuilder ==> str` |√|
......@@ -4,6 +4,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve --port 8081",
"dev": "vue-cli-service serve --port 8081",
"build": "vue-cli-service build --no-module",
"lint": "vue-cli-service lint",
"report": "vue-cli-service build --report"
......
......@@ -25,6 +25,25 @@ import heightResize from "../../tool/components/heightResize";
import autoHeightTextarea from "../../tool/components/autoHeightTextarea";
export default {
data() {
return {
current: {
input: `
123033 31
123034 31
123035 32
`,
isUppercase: false,
output_beautiful: "", // 一行,全字节内容,美化的内容
output_str: "", // 字符串格式
output_bytes: "", // 字节数组格式
output: "",
operation: ""
},
inputHeight: 100,
outputHeight: 100
}
},
components: {
heightResize,
autoHeightTextarea
......@@ -33,7 +52,7 @@ export default {
this.$initToolData('input')
},
methods: {
codeGenJson() {
codeGenJsonOld() {
console.log('enter...')
var objJson = {}
if (this.current.input) {
......@@ -56,27 +75,32 @@ export default {
console.log('leave...', objJson)
this.current.output = JSON.stringify(objJson)
},
codeGenJson() {
console.log('enter...')
var objJson = {}
if (this.current.input) {
var lines = this.current.input.split('\n');
lines.forEach(line => {
console.log(line)
line = line.trim().replace(/\s+/g, ' ')
var items = line.split(' ')
if (items.length != 2) {
console.log(items)
return
}
objJson[items[0]] = items[1]
})
}
console.log('leave...', objJson)
this.current.output = JSON.stringify(objJson)
},
resize(height) {
this.inputHeight = Math.min(320, Math.ceil(height / 2))
this.outputHeight = height - this.inputHeight
// this.outputHeight = 180
}
},
data() {
return {
current: {
input: "",
isUppercase: false,
output_beautiful: "", // 一行,全字节内容,美化的内容
output_str: "", // 字符串格式
output_bytes: "", // 字节数组格式
output: "",
operation: ""
},
inputHeight: 100,
outputHeight: 100
}
},
}
</script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册