From 3d0c785efa766ccf814f717fe3e674ebfa60184c Mon Sep 17 00:00:00 2001 From: Codepy <1942171924@qq.com> Date: Sat, 29 Mar 2025 19:08:42 +0800 Subject: [PATCH 1/9] =?UTF-8?q?bugfix=EF=BC=9A=E4=BF=AE=E5=A4=8Dbug=20upd?= =?UTF-8?q?=EF=BC=9A=E5=AE=9E=E7=8E=B0=E6=96=B0=E5=A2=9E=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Front/src/assets/toolbox.json | 51 +++++++++++++++ Front/src/blocks/boxy.js | 33 +++++++++- Front/src/components/Navigator.vue | 2 +- Front/src/components/Pj.vue | 100 ++++++++++++++++++++++++++++- Front/src/components/Toolbox.vue | 5 ++ Front/src/generators/python.js | 27 +++++++- Front/src/theme/codemao.theme.js | 8 +++ dist/index.html | 4 +- dist/sw.js | 2 +- main.py | 21 ++++++ 10 files changed, 243 insertions(+), 10 deletions(-) diff --git a/Front/src/assets/toolbox.json b/Front/src/assets/toolbox.json index 823e0b9..4e7c39b 100644 --- a/Front/src/assets/toolbox.json +++ b/Front/src/assets/toolbox.json @@ -24,6 +24,10 @@ } } }, + { + "kind": "block", + "type": "console_log" + }, { "kind": "block", "type": "controls_for", @@ -433,6 +437,10 @@ "name": "Sqlite", "categorystyle": "sqlite", "contents": [ + { + "kind": "block", + "type": "sqlite_import" + }, { "kind": "block", "type": "sqlite_open" @@ -450,6 +458,49 @@ "type": "sqlite_close" } ] + }, + { + "kind": "category", + "name": "io", + "categorystyle": "io", + "contents": [ + + ] + }, + { + "kind": "category", + "name": "base64", + "categorystyle": "base64", + "contents": [ + ] + }, + { + "kind": "category", + "name": "json", + "categorystyle": "json", + "contents": [ + ] + }, + { + "kind": "category", + "name": "threading", + "categorystyle": "threading", + "contents": [ + ] + }, + { + "kind": "category", + "name": "turtle", + "categorystyle": "turtle", + "contents": [ + ] + }, + { + "kind": "category", + "name": "subprocess", + "categorystyle": "subprocess", + "contents": [ + ] } ] } diff --git a/Front/src/blocks/boxy.js b/Front/src/blocks/boxy.js index 92f5ede..1de406b 100644 --- a/Front/src/blocks/boxy.js +++ b/Front/src/blocks/boxy.js @@ -387,15 +387,20 @@ Blockly.defineBlocksWithJsonArray([ }, { type: 'sqlite_query', - message0: '执行查询 %1', + message0: '执行查询 数据库:%1 SQL:%2', args0: [ { type: 'input_value', - name: 'QUERY', + name: 'DB', + check: 'sqlite3.Connection' + }, + { + type: 'input_value', + name: 'SQL', check: 'String' } ], - output: 'sqlite3.Cursor', + output: 'Array', style: 'sqlite', tooltip: '执行SQL查询。' }, @@ -553,5 +558,27 @@ Blockly.defineBlocksWithJsonArray([ output: 'Array', style: 'dict', tooltip: '创建一个空字典。' + }, + { + type:'console_log', + message0: '打印 %1', + args0: [ + { + type: 'input_value', + name: 'VALUE' + } + ], + previousStatement: null, + nextStatement: null, + style: 'controller', + tooltip: '打印值到控制台。' + }, + { + type: 'sqlite_import', + message0: '引入sqlite3库', + previousStatement: null, + nextStatement: null, + style: 'sqlite', + tooltip: '引入sqlite3库。' } ]) diff --git a/Front/src/components/Navigator.vue b/Front/src/components/Navigator.vue index fab77fb..2ad177d 100644 --- a/Front/src/components/Navigator.vue +++ b/Front/src/components/Navigator.vue @@ -172,7 +172,7 @@ function handlePJClick() { 100% { width: 150px; - height: 360px; + height: 310px; } } \ No newline at end of file diff --git a/Front/src/components/Pj.vue b/Front/src/components/Pj.vue index d5e4dfd..910d7ee 100644 --- a/Front/src/components/Pj.vue +++ b/Front/src/components/Pj.vue @@ -2,6 +2,42 @@