diff --git a/py/build/build.bat b/py/build/build.bat new file mode 100644 index 0000000000000000000000000000000000000000..af93c97b6134920b47c047df6f429a22125f29da --- /dev/null +++ b/py/build/build.bat @@ -0,0 +1,3 @@ +call activate py36 +python build.py +pause \ No newline at end of file diff --git a/py/build.py b/py/build/build.py similarity index 49% rename from py/build.py rename to py/build/build.py index bca58f25938ecaae83591895b9b6163300900e88..f1d865b0e24d657812159be858a6320635087cc1 100644 --- a/py/build.py +++ b/py/build/build.py @@ -1,27 +1,28 @@ +import sys import compileall import pathlib as plib import shutil import os -m_dist_app_path = plib.Path('dist/app') +os.chdir(plib.Path(__file__).parent) + +vinfo = sys.version_info + + +m_dist_app_path = plib.Path(f'../dist/app{vinfo.major}{vinfo.minor}') 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_dir(r'../src') +compileall.compile_file('../main.py') print('编译完毕') -if os.path.exists(m_dist_src_path): - shutil.rmtree(m_dist_src_path) - -if os.path.exists(m_dist_web_path): - shutil.rmtree(m_dist_web_path) +if os.path.exists(m_dist_app_path): + shutil.rmtree(m_dist_app_path) -if os.path.exists(m_dist_main_path): - os.remove(m_dist_main_path) - -os.makedirs(m_dist_src_path) +os.makedirs(m_dist_app_path) print('清除旧文件完毕') @@ -36,11 +37,14 @@ def to_folder(file: plib.Path): del parts[-2] parts[-1] = to_fileName(file) # parts = [plib.Path(p) for p in parts] + + parts = [p for p in parts if not all(s in ['.', '/'] for s in p)] + parts = plib.Path.joinpath(m_dist_app_path, *parts) return parts -fs = plib.Path('src').rglob('*.cpython-37.pyc') +fs = plib.Path('../src').rglob('*.cpython-37.pyc') fs = [(p, to_folder(p)) for p in fs] for f in fs: @@ -50,10 +54,13 @@ 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) -shutil.copytree('web', m_dist_web_path) -shutil.copyfile('startup.bat', m_dist_startup_path) +for f in plib.Path('others').glob('*'): + shutil.copyfile(f, m_dist_app_path / f.name) +# shutil.copyfile('../startup.bat', m_dist_startup_path) -print('创建完成') +print(f'创建完成-({vinfo})') diff --git a/py/build/others/startup_linux.sh b/py/build/others/startup_linux.sh new file mode 100644 index 0000000000000000000000000000000000000000..268f2c6b0af6474cd8777605f86a76026c909c1a --- /dev/null +++ b/py/build/others/startup_linux.sh @@ -0,0 +1 @@ +python main.pyc \ No newline at end of file diff --git a/py/build/others/startup_win.bat b/py/build/others/startup_win.bat new file mode 100644 index 0000000000000000000000000000000000000000..48f32107dabb1e0da7ebdbcbe3c54a8b4bdc3572 --- /dev/null +++ b/py/build/others/startup_win.bat @@ -0,0 +1,2 @@ +python main.pyc +pause \ No newline at end of file diff --git "a/py/build/others/\347\263\273\347\273\237\350\246\201\346\261\202.txt" "b/py/build/others/\347\263\273\347\273\237\350\246\201\346\261\202.txt" new file mode 100644 index 0000000000000000000000000000000000000000..586120c366549340d5776741cb003a35a9297429 --- /dev/null +++ "b/py/build/others/\347\263\273\347\273\237\350\246\201\346\261\202.txt" @@ -0,0 +1,13 @@ +python 3.6 或以上 + +python 必需的库: +- flask +- pandas +- webbrowser(应该是py内置的库) + +执行如下语句安装(使用了国内镜像): +pip install pandas flask -i https://mirrors.aliyun.com/pypi/simple/ + + +浏览器要求: +基本上市面上的主流浏览器都支持,IE就不考虑了 \ No newline at end of file diff --git a/py/startup.bat b/py/startup.bat deleted file mode 100644 index 7b674598abca097f8d376fcea9f69c8e91f59900..0000000000000000000000000000000000000000 --- a/py/startup.bat +++ /dev/null @@ -1 +0,0 @@ -python main.py \ No newline at end of file diff --git a/ui/src/App.vue b/ui/src/App.vue index fce4be0115b21a427a90b93e51f8f399d9e09ccb..4e14739b4e74ae99b9eb0893aa58fc922b591bd8 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 33376753fee883ace8ee173b57be302234906b6f..b0839905b87aa4d895a399952c364db993454cf3 100644 --- a/ui/src/components/Commander/index.vue +++ b/ui/src/components/Commander/index.vue @@ -1,51 +1,57 @@