From 2f5c4fb7bb0aef3fbf13a691cf1405f2bad2e3a1 Mon Sep 17 00:00:00 2001 From: carson_git <543983849@qq.com> Date: Wed, 16 Dec 2020 12:44:09 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=AD=9B=E9=80=89=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=8A=A8=E6=8F=90=E7=A4=BA=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/FunctionTabs/Query/index.vue | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/ui/src/components/FunctionTabs/Query/index.vue b/ui/src/components/FunctionTabs/Query/index.vue index c72aa03..7adcd94 100644 --- a/ui/src/components/FunctionTabs/Query/index.vue +++ b/ui/src/components/FunctionTabs/Query/index.vue @@ -2,9 +2,13 @@
import { computed, defineComponent, reactive, ref } from "vue"; import * as apps from "@/applications"; +import DfStore from "@/store/DfStore"; export default defineComponent({ name: "Query", setup() { - let input = ref(""); + let input = ref(" "); let applyBtnDisplay = computed(() => input.value.length > 0); + const opts = ref([] as object); + + const colInfos = DfStore.getStateReadonly().columnInfo; + + const onSelect = (value: any, option: any) => { + input.value = option.text; + }; + + const onSearch = (searchText: any) => { + opts.value = searchText ? searchResult(searchText) : []; + + function searchResult(query: any) { + const arr: string[] = query.split(/\s+/); + const value = arr.slice(-1)[0]; + + return colInfos + .filter((v) => v.field.indexOf(value) >= 0) + .map((v) => { + const value = + arr.slice(0, arr.length - 1).join(" ") + " " + v.field; + + return { + text: value.trim(), + value: `${v.field}(${v.type})`, + }; + }); + } + }; + let onApply = async () => { await apps.filterByPandasQeury(input.value); }; @@ -32,6 +66,9 @@ export default defineComponent({ input, onApply, applyBtnDisplay, + opts, + onSearch, + onSelect, }; }, }); -- Gitee From ab9710d6b49a83e5929b70a2e3c8cbfce8e75c6c Mon Sep 17 00:00:00 2001 From: carson_git <543983849@qq.com> Date: Wed, 16 Dec 2020 16:04:47 +0800 Subject: [PATCH 2/5] --- py/build.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py/build.py b/py/build.py index bca58f2..4263fd7 100644 --- a/py/build.py +++ b/py/build.py @@ -6,10 +6,11 @@ import os m_dist_app_path = plib.Path('dist/app') m_dist_src_path = m_dist_app_path / 'src' m_dist_web_path = m_dist_app_path / 'web' -m_dist_main_path = m_dist_app_path / 'main.py' +m_dist_main_path = m_dist_app_path / 'main.pyc' m_dist_startup_path = m_dist_app_path / 'startup.bat' compileall.compile_dir(r'src') +compileall.compile_file('main.py') print('编译完毕') if os.path.exists(m_dist_src_path): @@ -50,7 +51,7 @@ for f in fs: shutil.copyfile(f[0], f[1]) -shutil.copyfile('main.py', m_dist_main_path) +shutil.copyfile('__pycache__/main.cpython-37.pyc', m_dist_main_path) shutil.copytree('web', m_dist_web_path) -- Gitee From ef4129a4fd28670def86ceecb7b3d6fa5d9e06dd Mon Sep 17 00:00:00 2001 From: carson_git <543983849@qq.com> Date: Wed, 16 Dec 2020 16:05:05 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/App.vue | 50 +++- ui/src/components/Commander/index.vue | 97 +++---- .../FunctionTabs/CodeBuilder/index.vue | 16 +- .../components/FunctionTabs/Groupby/index.vue | 249 ++++++++++-------- .../components/FunctionTabs/Query/index.vue | 7 +- ui/src/components/FunctionTabs/index.vue | 24 +- ui/src/index.css | 20 ++ ui/src/main.ts | 1 + ui/src/plugins/vant.ts | 4 +- 9 files changed, 275 insertions(+), 193 deletions(-) create mode 100644 ui/src/index.css diff --git a/ui/src/App.vue b/ui/src/App.vue index fce4be0..4e14739 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -1,21 +1,27 @@ @@ -43,6 +49,12 @@ export default defineComponent({ diff --git a/ui/src/components/Commander/index.vue b/ui/src/components/Commander/index.vue index 3337675..b083990 100644 --- a/ui/src/components/Commander/index.vue +++ b/ui/src/components/Commander/index.vue @@ -1,51 +1,57 @@