diff --git a/README.md b/README.md index a04d0e4d348c95ff6b675ae5d049652ae2e2e1e1..02eea09b19ef6a57d6ab7f61acfe4e6d502d44e2 100644 --- a/README.md +++ b/README.md @@ -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` |√| diff --git a/package.json b/package.json index 6202a7ca6ae824144291853f5b671239fa8bd57a..ba4cac02e033bb5c4b92abef277f86ccd84880cb 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/views/yeahmao/code_gen/codeGenJson.vue b/src/views/yeahmao/code_gen/codeGenJson.vue index a8373055da46a8ccfbd4fe9321ea338639c7eeb9..b2ff7c64869951c6c0903e1a3e4900c348c2706f 100644 --- a/src/views/yeahmao/code_gen/codeGenJson.vue +++ b/src/views/yeahmao/code_gen/codeGenJson.vue @@ -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 - } - }, }