@ -0,0 +1,3 @@ |
|||||||
|
VITE_BASE_API_SYSTEM = '/remote/admin-api/system' |
||||||
|
VITE_BASE_API_EAM = '/remote/admin-api/eam' |
||||||
|
VITE_DEVICE_INFO_INTERVAL = 35000 |
@ -0,0 +1,2 @@ |
|||||||
|
VITE_BASE_URL = 'http://192.168.1.3:48080' |
||||||
|
VITE_SOCKET_SERVER = 'http://192.168.1.3:7080' |
@ -0,0 +1,2 @@ |
|||||||
|
VITE_BASE_URL = 'http://62.234.18.176:7080' |
||||||
|
VITE_SOCKET_SERVER = 'http://62.234.18.176:7080' |
@ -0,0 +1,30 @@ |
|||||||
|
.DS_Store |
||||||
|
|
||||||
|
.vscode |
||||||
|
|
||||||
|
# package manager log files |
||||||
|
npm-debug.log* |
||||||
|
yarn-debug.log* |
||||||
|
yarn-error.log* |
||||||
|
.npm |
||||||
|
|
||||||
|
|
||||||
|
yarn.lock |
||||||
|
package-lock.json |
||||||
|
pnpm-lock.yaml |
||||||
|
|
||||||
|
# eslint cache |
||||||
|
.eslintcache |
||||||
|
# stylelint cache |
||||||
|
.stylelintcache |
||||||
|
|
||||||
|
|
||||||
|
# Log files |
||||||
|
npm-debug.log* |
||||||
|
yarn-debug.log* |
||||||
|
yarn-error.log* |
||||||
|
|
||||||
|
/dist |
||||||
|
/docker_output/ |
||||||
|
/node_modules/ |
||||||
|
/*.tar |
@ -0,0 +1,5 @@ |
|||||||
|
FROM nginx:latest |
||||||
|
COPY ./dist/ /etc/nginx/html |
||||||
|
COPY nginx.conf /etc/nginx/nginx.conf |
||||||
|
# Expose port 80 |
||||||
|
EXPOSE 80 |
@ -0,0 +1,46 @@ |
|||||||
|
# ChuNeng |
||||||
|
|
||||||
|
This template should help get you started developing with Vue 3 in Vite. |
||||||
|
|
||||||
|
## Recommended IDE Setup |
||||||
|
|
||||||
|
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). |
||||||
|
|
||||||
|
## Type Support for `.vue` Imports in TS |
||||||
|
|
||||||
|
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types. |
||||||
|
|
||||||
|
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: |
||||||
|
|
||||||
|
1. Disable the built-in TypeScript Extension |
||||||
|
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette |
||||||
|
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)` |
||||||
|
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. |
||||||
|
|
||||||
|
## Customize configuration |
||||||
|
|
||||||
|
See [Vite Configuration Reference](https://vitejs.dev/config/). |
||||||
|
|
||||||
|
## Project Setup |
||||||
|
|
||||||
|
```sh |
||||||
|
npm install |
||||||
|
``` |
||||||
|
|
||||||
|
### Compile and Hot-Reload for Development |
||||||
|
|
||||||
|
```sh |
||||||
|
npm run dev |
||||||
|
``` |
||||||
|
|
||||||
|
### Type-Check, Compile and Minify for Production |
||||||
|
|
||||||
|
```sh |
||||||
|
npm run build |
||||||
|
``` |
||||||
|
|
||||||
|
### Lint with [ESLint](https://eslint.org/) |
||||||
|
|
||||||
|
```sh |
||||||
|
npm run lint |
||||||
|
``` |
@ -0,0 +1,73 @@ |
|||||||
|
/* eslint-disable */ |
||||||
|
/* prettier-ignore */ |
||||||
|
// @ts-nocheck
|
||||||
|
// noinspection JSUnusedGlobalSymbols
|
||||||
|
// Generated by unplugin-auto-import
|
||||||
|
export {} |
||||||
|
declare global { |
||||||
|
const EffectScope: typeof import('vue')['EffectScope'] |
||||||
|
const ElLoading: typeof import('element-plus/es')['ElLoading'] |
||||||
|
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] |
||||||
|
const ElNotification: typeof import('element-plus/es')['ElNotification'] |
||||||
|
const computed: typeof import('vue')['computed'] |
||||||
|
const createApp: typeof import('vue')['createApp'] |
||||||
|
const customRef: typeof import('vue')['customRef'] |
||||||
|
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] |
||||||
|
const defineComponent: typeof import('vue')['defineComponent'] |
||||||
|
const effectScope: typeof import('vue')['effectScope'] |
||||||
|
const getCurrentInstance: typeof import('vue')['getCurrentInstance'] |
||||||
|
const getCurrentScope: typeof import('vue')['getCurrentScope'] |
||||||
|
const h: typeof import('vue')['h'] |
||||||
|
const inject: typeof import('vue')['inject'] |
||||||
|
const isProxy: typeof import('vue')['isProxy'] |
||||||
|
const isReactive: typeof import('vue')['isReactive'] |
||||||
|
const isReadonly: typeof import('vue')['isReadonly'] |
||||||
|
const isRef: typeof import('vue')['isRef'] |
||||||
|
const markRaw: typeof import('vue')['markRaw'] |
||||||
|
const nextTick: typeof import('vue')['nextTick'] |
||||||
|
const onActivated: typeof import('vue')['onActivated'] |
||||||
|
const onBeforeMount: typeof import('vue')['onBeforeMount'] |
||||||
|
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] |
||||||
|
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] |
||||||
|
const onDeactivated: typeof import('vue')['onDeactivated'] |
||||||
|
const onErrorCaptured: typeof import('vue')['onErrorCaptured'] |
||||||
|
const onMounted: typeof import('vue')['onMounted'] |
||||||
|
const onRenderTracked: typeof import('vue')['onRenderTracked'] |
||||||
|
const onRenderTriggered: typeof import('vue')['onRenderTriggered'] |
||||||
|
const onScopeDispose: typeof import('vue')['onScopeDispose'] |
||||||
|
const onServerPrefetch: typeof import('vue')['onServerPrefetch'] |
||||||
|
const onUnmounted: typeof import('vue')['onUnmounted'] |
||||||
|
const onUpdated: typeof import('vue')['onUpdated'] |
||||||
|
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] |
||||||
|
const provide: typeof import('vue')['provide'] |
||||||
|
const reactive: typeof import('vue')['reactive'] |
||||||
|
const readonly: typeof import('vue')['readonly'] |
||||||
|
const ref: typeof import('vue')['ref'] |
||||||
|
const resolveComponent: typeof import('vue')['resolveComponent'] |
||||||
|
const shallowReactive: typeof import('vue')['shallowReactive'] |
||||||
|
const shallowReadonly: typeof import('vue')['shallowReadonly'] |
||||||
|
const shallowRef: typeof import('vue')['shallowRef'] |
||||||
|
const toRaw: typeof import('vue')['toRaw'] |
||||||
|
const toRef: typeof import('vue')['toRef'] |
||||||
|
const toRefs: typeof import('vue')['toRefs'] |
||||||
|
const toValue: typeof import('vue')['toValue'] |
||||||
|
const triggerRef: typeof import('vue')['triggerRef'] |
||||||
|
const unref: typeof import('vue')['unref'] |
||||||
|
const useAttrs: typeof import('vue')['useAttrs'] |
||||||
|
const useCssModule: typeof import('vue')['useCssModule'] |
||||||
|
const useCssVars: typeof import('vue')['useCssVars'] |
||||||
|
const useId: typeof import('vue')['useId'] |
||||||
|
const useModel: typeof import('vue')['useModel'] |
||||||
|
const useSlots: typeof import('vue')['useSlots'] |
||||||
|
const useTemplateRef: typeof import('vue')['useTemplateRef'] |
||||||
|
const watch: typeof import('vue')['watch'] |
||||||
|
const watchEffect: typeof import('vue')['watchEffect'] |
||||||
|
const watchPostEffect: typeof import('vue')['watchPostEffect'] |
||||||
|
const watchSyncEffect: typeof import('vue')['watchSyncEffect'] |
||||||
|
} |
||||||
|
// for type re-export
|
||||||
|
declare global { |
||||||
|
// @ts-ignore
|
||||||
|
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' |
||||||
|
import('vue') |
||||||
|
} |
@ -0,0 +1,98 @@ |
|||||||
|
/* eslint-disable */ |
||||||
|
/* prettier-ignore */ |
||||||
|
// @ts-nocheck
|
||||||
|
// Generated by unplugin-vue-components
|
||||||
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
|
export {} |
||||||
|
|
||||||
|
declare module 'vue' { |
||||||
|
export interface GlobalComponents { |
||||||
|
BdMap: typeof import('./src/components/map_baidu/BdMap.vue')['default'] |
||||||
|
ColorTitle: typeof import('./src/components/dashboard/ColorTitle.vue')['default'] |
||||||
|
CopperModal: typeof import('./src/components/dashboard/Cropper/src/CopperModal.vue')['default'] |
||||||
|
Cropper: typeof import('./src/components/dashboard/Cropper/src/Cropper.vue')['default'] |
||||||
|
CropperAvatar: typeof import('./src/components/dashboard/Cropper/src/CropperAvatar.vue')['default'] |
||||||
|
DictTag: typeof import('./src/components/dashboard/DictTag/src/DictTag.vue')['default'] |
||||||
|
EdfsButton: typeof import('./src/components/dashboard/Edfs-button/index.vue')['default'] |
||||||
|
EdfsContextMenu: typeof import('./src/components/dashboard/Edfs-context-menu/index.vue')['default'] |
||||||
|
EdfsDialog: typeof import('./src/components/dashboard/Edfs-dialog.vue')['default'] |
||||||
|
EdfsException: typeof import('./src/components/dashboard/Edfs-exception.vue')['default'] |
||||||
|
EdfsNumberItemInput: typeof import('./src/components/dashboard/Edfs-number-item-input.vue')['default'] |
||||||
|
EdfsTable: typeof import('./src/components/dashboard/Edfs-table/index.vue')['default'] |
||||||
|
EdfsWrap: typeof import('./src/components/dashboard/Edfs-wrap.vue')['default'] |
||||||
|
Editor: typeof import('./src/components/dashboard/Editor/src/Editor.vue')['default'] |
||||||
|
ElAvatar: typeof import('element-plus/es')['ElAvatar'] |
||||||
|
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] |
||||||
|
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] |
||||||
|
ElButton: typeof import('element-plus/es')['ElButton'] |
||||||
|
ElCard: typeof import('element-plus/es')['ElCard'] |
||||||
|
ElCascader: typeof import('element-plus/es')['ElCascader'] |
||||||
|
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] |
||||||
|
ElCol: typeof import('element-plus/es')['ElCol'] |
||||||
|
ElCollapse: typeof import('element-plus/es')['ElCollapse'] |
||||||
|
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] |
||||||
|
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] |
||||||
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] |
||||||
|
ElDialog: typeof import('element-plus/es')['ElDialog'] |
||||||
|
ElDivider: typeof import('element-plus/es')['ElDivider'] |
||||||
|
ElDropdown: typeof import('element-plus/es')['ElDropdown'] |
||||||
|
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] |
||||||
|
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] |
||||||
|
ElForm: typeof import('element-plus/es')['ElForm'] |
||||||
|
ElFormItem: typeof import('element-plus/es')['ElFormItem'] |
||||||
|
ElHeader: typeof import('element-plus/es')['ElHeader'] |
||||||
|
ElIcon: typeof import('element-plus/es')['ElIcon'] |
||||||
|
ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] |
||||||
|
ElInput: typeof import('element-plus/es')['ElInput'] |
||||||
|
ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] |
||||||
|
ElLink: typeof import('element-plus/es')['ElLink'] |
||||||
|
ElMenu: typeof import('element-plus/es')['ElMenu'] |
||||||
|
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] |
||||||
|
ElOption: typeof import('element-plus/es')['ElOption'] |
||||||
|
ElPagination: typeof import('element-plus/es')['ElPagination'] |
||||||
|
ElPopover: typeof import('element-plus/es')['ElPopover'] |
||||||
|
ElRadio: typeof import('element-plus/es')['ElRadio'] |
||||||
|
ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] |
||||||
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |
||||||
|
ElRow: typeof import('element-plus/es')['ElRow'] |
||||||
|
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] |
||||||
|
ElSelect: typeof import('element-plus/es')['ElSelect'] |
||||||
|
ElSpace: typeof import('element-plus/es')['ElSpace'] |
||||||
|
ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] |
||||||
|
ElSwitch: typeof import('element-plus/es')['ElSwitch'] |
||||||
|
ElTable: typeof import('element-plus/es')['ElTable'] |
||||||
|
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] |
||||||
|
ElTabPane: typeof import('element-plus/es')['ElTabPane'] |
||||||
|
ElTabs: typeof import('element-plus/es')['ElTabs'] |
||||||
|
ElTag: typeof import('element-plus/es')['ElTag'] |
||||||
|
ElTextarea: typeof import('element-plus/es')['ElTextarea'] |
||||||
|
ElTooltip: typeof import('element-plus/es')['ElTooltip'] |
||||||
|
ElTree: typeof import('element-plus/es')['ElTree'] |
||||||
|
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] |
||||||
|
ElUpload: typeof import('element-plus/es')['ElUpload'] |
||||||
|
Form: typeof import('./src/components/dashboard/Form/src/Form.vue')['default'] |
||||||
|
FormItemInput: typeof import('./src/components/dashboard/FormItemInput.vue')['default'] |
||||||
|
FormItemSelect: typeof import('./src/components/dashboard/FormItemSelect.vue')['default'] |
||||||
|
Icon: typeof import('./src/components/dashboard/Icon/src/Icon.vue')['default'] |
||||||
|
IconSelect: typeof import('./src/components/dashboard/Icon/src/IconSelect.vue')['default'] |
||||||
|
ImageViewer: typeof import('./src/components/dashboard/ImageViewer/src/ImageViewer.vue')['default'] |
||||||
|
InputPassword: typeof import('./src/components/dashboard/InputPassword/src/InputPassword.vue')['default'] |
||||||
|
LegendItem: typeof import('./src/components/map_tool/legend/LegendItem.vue')['default'] |
||||||
|
Option: typeof import('./src/components/map_tool/menu/Option.vue')['default'] |
||||||
|
RouterLink: typeof import('vue-router')['RouterLink'] |
||||||
|
RouterView: typeof import('vue-router')['RouterView'] |
||||||
|
Search: typeof import('./src/components/map_tool/control/Search.vue')['default'] |
||||||
|
SizeAndType: typeof import('./src/components/map_tool/control/SizeAndType.vue')['default'] |
||||||
|
Summary: typeof import('./src/components/dashboard/Summary.vue')['default'] |
||||||
|
Tool: typeof import('./src/components/map_tool/menu/Tool.vue')['default'] |
||||||
|
Tooltip: typeof import('./src/components/dashboard/Tooltip/src/Tooltip.vue')['default'] |
||||||
|
UploadFile: typeof import('./src/components/dashboard/UploadFile/src/UploadFile.vue')['default'] |
||||||
|
UploadImg: typeof import('./src/components/dashboard/UploadFile/src/UploadImg.vue')['default'] |
||||||
|
UploadImgs: typeof import('./src/components/dashboard/UploadFile/src/UploadImgs.vue')['default'] |
||||||
|
XButton: typeof import('./src/components/dashboard/XButton/src/XButton.vue')['default'] |
||||||
|
XTextButton: typeof import('./src/components/dashboard/XButton/src/XTextButton.vue')['default'] |
||||||
|
} |
||||||
|
export interface ComponentCustomProperties { |
||||||
|
vLoading: typeof import('element-plus/es')['ElLoadingDirective'] |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<link rel="icon" href="/favicon.ico" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<title>平高储能平台</title> |
||||||
|
<style> |
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
background: #262626; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<script type="module" src="src/main.ts"></script> |
||||||
|
<!-- <a href="login/" class="href">login</a> |
||||||
|
<a href="dashboard/" class="href">dashboard</a> --> |
||||||
|
<div id="app"></div> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,135 @@ |
|||||||
|
#user nobody; |
||||||
|
worker_processes 4; |
||||||
|
|
||||||
|
#error_log logs/error.log; |
||||||
|
#error_log logs/error.log notice; |
||||||
|
#error_log logs/error.log info; |
||||||
|
|
||||||
|
#pid logs/nginx.pid; |
||||||
|
|
||||||
|
|
||||||
|
events { |
||||||
|
worker_connections 1024; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
http { |
||||||
|
include mime.types; |
||||||
|
default_type application/octet-stream; |
||||||
|
|
||||||
|
#log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
||||||
|
# '$status $body_bytes_sent "$http_referer" ' |
||||||
|
# '"$http_user_agent" "$http_x_forwarded_for"'; |
||||||
|
|
||||||
|
#access_log logs/access.log main; |
||||||
|
|
||||||
|
sendfile on; |
||||||
|
#tcp_nopush on; |
||||||
|
|
||||||
|
#keepalive_timeout 0; |
||||||
|
keepalive_timeout 65; |
||||||
|
|
||||||
|
#gzip on; |
||||||
|
|
||||||
|
map $http_origin $corsHost { |
||||||
|
default 0; |
||||||
|
"~http://146.56.233.47:8760" http://146.56.233.47:8760; |
||||||
|
} |
||||||
|
|
||||||
|
server { |
||||||
|
listen 80; |
||||||
|
server_name localhost; |
||||||
|
|
||||||
|
#charset koi8-r; |
||||||
|
|
||||||
|
#access_log logs/host.access.log main; |
||||||
|
|
||||||
|
location / { |
||||||
|
root html; |
||||||
|
index index.html index.htm; |
||||||
|
} |
||||||
|
|
||||||
|
# 代理配置,解决跨域问题 |
||||||
|
location /remote/ { |
||||||
|
add_header 'Access-Control-Allow-origin' $corsHost; |
||||||
|
add_header 'Access-Control-Allow-Credentials' 'true'; |
||||||
|
add_header 'Access-Control-Max-Age' 86400; |
||||||
|
add_header 'Access-Control-Allow-Headers' '*'; |
||||||
|
add_header 'Access-Control-Allow-Methods' '*'; |
||||||
|
|
||||||
|
if ($request_method = 'OPTIONS'){ |
||||||
|
return 204; |
||||||
|
} |
||||||
|
proxy_pass http://146.56.233.47:8760/; |
||||||
|
} |
||||||
|
|
||||||
|
#error_page 404 /404.html; |
||||||
|
|
||||||
|
# redirect server error pages to the static page /50x.html |
||||||
|
# |
||||||
|
error_page 500 502 503 504 /50x.html; |
||||||
|
location = /50x.html { |
||||||
|
root html; |
||||||
|
} |
||||||
|
|
||||||
|
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 |
||||||
|
# |
||||||
|
#location ~ \.php$ { |
||||||
|
# proxy_pass http://127.0.0.1; |
||||||
|
#} |
||||||
|
|
||||||
|
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 |
||||||
|
# |
||||||
|
#location ~ \.php$ { |
||||||
|
# root html; |
||||||
|
# fastcgi_pass 127.0.0.1:9000; |
||||||
|
# fastcgi_index index.php; |
||||||
|
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; |
||||||
|
# include fastcgi_params; |
||||||
|
#} |
||||||
|
|
||||||
|
# deny access to .htaccess files, if Apache's document root |
||||||
|
# concurs with nginx's one |
||||||
|
# |
||||||
|
#location ~ /\.ht { |
||||||
|
# deny all; |
||||||
|
#} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
# another virtual host using mix of IP-, name-, and port-based configuration |
||||||
|
# |
||||||
|
#server { |
||||||
|
# listen 8000; |
||||||
|
# listen somename:8080; |
||||||
|
# server_name somename alias another.alias; |
||||||
|
|
||||||
|
# location / { |
||||||
|
# root html; |
||||||
|
# index index.html index.htm; |
||||||
|
# } |
||||||
|
#} |
||||||
|
|
||||||
|
|
||||||
|
# HTTPS server |
||||||
|
# |
||||||
|
#server { |
||||||
|
# listen 443 ssl; |
||||||
|
# server_name localhost; |
||||||
|
|
||||||
|
# ssl_certificate cert.pem; |
||||||
|
# ssl_certificate_key cert.key; |
||||||
|
|
||||||
|
# ssl_session_cache shared:SSL:1m; |
||||||
|
# ssl_session_timeout 5m; |
||||||
|
|
||||||
|
# ssl_ciphers HIGH:!aNULL:!MD5; |
||||||
|
# ssl_prefer_server_ciphers on; |
||||||
|
|
||||||
|
# location / { |
||||||
|
# root html; |
||||||
|
# index index.html index.htm; |
||||||
|
# } |
||||||
|
#} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,87 @@ |
|||||||
|
{ |
||||||
|
"name": "chuneng", |
||||||
|
"version": "0.0.0", |
||||||
|
"private": true, |
||||||
|
"scripts": { |
||||||
|
"dev": "vite", |
||||||
|
"build": "run-p build-only", |
||||||
|
"preview": "vite preview", |
||||||
|
"build-only": "vite build", |
||||||
|
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false", |
||||||
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", |
||||||
|
"format": "prettier --write src/", |
||||||
|
"docker-build": "docker build -t chuneng-web:v0.6 .", |
||||||
|
"docker-save": "docker save -o ./docker_output/chuneng-web.tar chuneng-web" |
||||||
|
}, |
||||||
|
"dependencies": { |
||||||
|
"@antv/x6": "^2.16.1", |
||||||
|
"@antv/x6-plugin-clipboard": "^2.1.6", |
||||||
|
"@antv/x6-plugin-dnd": "^2.1.1", |
||||||
|
"@antv/x6-vue-shape": "^2.1.1", |
||||||
|
"@element-plus/icons-vue": "^2.3.1", |
||||||
|
"@iconify-json/ep": "^1.1.12", |
||||||
|
"@iconify/json": "^2.2.217", |
||||||
|
"@logicflow/core": "^1.2.17", |
||||||
|
"@logicflow/extension": "^1.2.18", |
||||||
|
"@purge-icons/generated": "^0.10.0", |
||||||
|
"@tanstack/vue-table": "^8.17.3", |
||||||
|
"@tanstack/vue-virtual": "^3.5.0", |
||||||
|
"@types/cropperjs": "^1.3.0", |
||||||
|
"@vueuse/core": "^11.0.1", |
||||||
|
"@wangeditor/editor": "^5.1.23", |
||||||
|
"@wangeditor/editor-for-vue": "^5.1.10", |
||||||
|
"@zxcvbn-ts/core": "^3.0.4", |
||||||
|
"big.js": "^6.2.1", |
||||||
|
"cropperjs": "^1.6.2", |
||||||
|
"crypto-js": "^4.2.0", |
||||||
|
"dayjs": "^1.11.11", |
||||||
|
"jszmq": "^0.1.2", |
||||||
|
"lodash": "^4.17.21", |
||||||
|
"mitt": "^3.0.1", |
||||||
|
"pinia": "^2.0.36", |
||||||
|
"qs": "^6.12.1", |
||||||
|
"vue": "^3.3.2", |
||||||
|
"vue-echarts": "^6.6.9", |
||||||
|
"vue-i18n": "^9.13.1", |
||||||
|
"vue-router": "^4.2.0", |
||||||
|
"vue-types": "^5.1.2", |
||||||
|
"web-storage-cache": "^1.1.1", |
||||||
|
"xlsx": "^0.18.5" |
||||||
|
}, |
||||||
|
"devDependencies": { |
||||||
|
"@iconify-json/ep": "^1.1.10", |
||||||
|
"@rushstack/eslint-patch": "^1.2.0", |
||||||
|
"@tsconfig/node18": "^18.2.2", |
||||||
|
"@types/big.js": "^6.2.2", |
||||||
|
"@types/crypto-js": "^4.2.2", |
||||||
|
"@types/lodash": "^4.17.4", |
||||||
|
"@types/node": "^18.19.3", |
||||||
|
"@types/qs": "^6.9.15", |
||||||
|
"@types/three": "^0.152.1", |
||||||
|
"@vitejs/plugin-vue": "^5.0.5", |
||||||
|
"@vitejs/plugin-vue-jsx": "^3.1.0", |
||||||
|
"@vue/eslint-config-prettier": "^7.1.0", |
||||||
|
"@vue/eslint-config-typescript": "^11.0.3", |
||||||
|
"@vue/tsconfig": "^0.4.0", |
||||||
|
"axios": "^1.7.2", |
||||||
|
"dexie": "^3.2.7", |
||||||
|
"dotenv": "^16.4.5", |
||||||
|
"echarts": "^5.4.2", |
||||||
|
"element-plus": "^2.7.6", |
||||||
|
"eslint": "^8.39.0", |
||||||
|
"eslint-plugin-vue": "^9.11.0", |
||||||
|
"mapvgl": "^1.0.0-beta.179", |
||||||
|
"npm-run-all": "^4.1.5", |
||||||
|
"prettier": "^2.8.8", |
||||||
|
"sass": "^1.62.1", |
||||||
|
"three": "^0.152.2", |
||||||
|
"typescript": "~5.0.4", |
||||||
|
"unplugin-auto-import": "^0.16.7", |
||||||
|
"unplugin-icons": "^0.16.6", |
||||||
|
"unplugin-vue-components": "^0.25.2", |
||||||
|
"uuid": "^9.0.0", |
||||||
|
"vite": "^5.2.12", |
||||||
|
"vite-plugin-purge-icons": "^0.10.0", |
||||||
|
"vue-tsc": "^2.0.19" |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,251 @@ |
|||||||
|
-- local cjson = require("cjson") |
||||||
|
function parseRecord(t) |
||||||
|
local result = {} |
||||||
|
local start = 1 |
||||||
|
local type = hex_to_bytes(t, start, 1) |
||||||
|
--print("type:", type) |
||||||
|
start = start + 2 |
||||||
|
local version = hex_to_bytes(t, start, 1) |
||||||
|
--print("version:", version) |
||||||
|
start = start + 2 |
||||||
|
local time = hex_to_bytes(t, start, 8) |
||||||
|
--print("time:", time) |
||||||
|
start = start + 16 |
||||||
|
local pair = hex_to_bytes(t, start, 1) |
||||||
|
--print("pair:", pair) |
||||||
|
start = start + 2 |
||||||
|
local values = {} |
||||||
|
for i = 1, tonumber(pair, 16) do |
||||||
|
local address = hex_to_bytes(t, start, 2) |
||||||
|
|
||||||
|
|
||||||
|
-- print("startAdd:", address) |
||||||
|
start = start + 4 |
||||||
|
local size = hex_to_bytes(t, start, 2) |
||||||
|
--print("size:", size) |
||||||
|
start = start + 4 |
||||||
|
for j = 1, tonumber(size, 16) / 2 do |
||||||
|
--print(address, hex_to_bytes(t, start, 2)) |
||||||
|
values[address] = hex_to_bytes(t, start, 2) |
||||||
|
address = string.gsub(string.format("%#x", tonumber(address, 16) + 1), "0x", "") |
||||||
|
if string.len(address) < 4 |
||||||
|
then |
||||||
|
address = string.rep("0", 4 - string.len(address)) .. address |
||||||
|
end |
||||||
|
start = start + 4 |
||||||
|
end |
||||||
|
end |
||||||
|
result["type"] = type |
||||||
|
result["version"] = version |
||||||
|
result["time"] = tonumber(time, 16) |
||||||
|
result["pair"] = pair |
||||||
|
result["values"] = values |
||||||
|
-- print(result["type"], result["version"], result["time"], result["pair"]) |
||||||
|
for k,v in pairsByKeys(result["values"]) do |
||||||
|
-- print(k,v) |
||||||
|
end |
||||||
|
-- print(table2string(result)) |
||||||
|
return table2string(result) |
||||||
|
end |
||||||
|
|
||||||
|
function table2string(tablevalue) |
||||||
|
local stringtable = serialize(tablevalue) |
||||||
|
-- print(stringtable) |
||||||
|
return stringtable |
||||||
|
end |
||||||
|
|
||||||
|
function serialize(obj) |
||||||
|
local lua = "" |
||||||
|
local t = type(obj) |
||||||
|
if t == "number" then |
||||||
|
lua = lua .. obj |
||||||
|
elseif t == "boolean" then |
||||||
|
lua = lua .. tostring(obj) |
||||||
|
elseif t == "string" then |
||||||
|
lua = lua .. string.format("%q", obj) |
||||||
|
elseif t == "table" then |
||||||
|
lua = lua .. "{" |
||||||
|
for k, v in pairs(obj) do |
||||||
|
lua = lua .. serialize(k) .. ":" .. serialize(v) .. "," |
||||||
|
end |
||||||
|
local metatable = getmetatable(obj) |
||||||
|
if metatable ~= nil and type(metatable.__index) == "table" then |
||||||
|
for k, v in pairs(metatable.__index) do |
||||||
|
lua = lua .. "[" .. serialize(k) .. "]=" .. serialize(v) .. "," |
||||||
|
end |
||||||
|
end |
||||||
|
lua = string.sub(lua, 1, -2) |
||||||
|
lua = lua .. "}" |
||||||
|
elseif t == "nil" then |
||||||
|
return nil |
||||||
|
else |
||||||
|
error("can not serialize a " .. t .. " type.") |
||||||
|
end |
||||||
|
return lua |
||||||
|
end |
||||||
|
|
||||||
|
|
||||||
|
function pairsByKeys(t) |
||||||
|
local a = {} |
||||||
|
for n in pairs(t) do |
||||||
|
a[#a + 1] = n |
||||||
|
end |
||||||
|
table.sort(a) |
||||||
|
local i = 0 |
||||||
|
local iter = function() |
||||||
|
i = i + 1 |
||||||
|
if a[i] == nil |
||||||
|
then |
||||||
|
return nil |
||||||
|
else |
||||||
|
return a[i], t[a[i]] |
||||||
|
end |
||||||
|
end |
||||||
|
return iter |
||||||
|
end |
||||||
|
|
||||||
|
function length(t) |
||||||
|
local res=0 |
||||||
|
for k,v in pairs(t) do |
||||||
|
res=res+1 |
||||||
|
end |
||||||
|
return res |
||||||
|
end |
||||||
|
|
||||||
|
function hex_to_bytes(hex, start, len) |
||||||
|
-- print(hex) |
||||||
|
local value = hex:sub(start, start + len * 2 - 1) |
||||||
|
if len > 1 |
||||||
|
then |
||||||
|
value = toBigEndian(value) |
||||||
|
end |
||||||
|
return value |
||||||
|
end |
||||||
|
|
||||||
|
function toBigEndian(value) |
||||||
|
--print(string.len(value)) |
||||||
|
local hexResult = "" |
||||||
|
for i = string.len(value), 1, -2 do |
||||||
|
local hex = value:sub(i - 1, i) |
||||||
|
hexResult = hexResult .. hex |
||||||
|
end |
||||||
|
|
||||||
|
return hexResult |
||||||
|
|
||||||
|
end |
||||||
|
|
||||||
|
-- 将16进制字符串转换为小端格式 |
||||||
|
local function hexToLittleEndian(hexString) |
||||||
|
local littleEndian = "" |
||||||
|
for i = #hexString, 1, -2 do |
||||||
|
local byte = hexString:sub(i - 1, i) |
||||||
|
littleEndian = littleEndian .. byte |
||||||
|
end |
||||||
|
return littleEndian |
||||||
|
end |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function issueOrder(luaTable) |
||||||
|
-- print("start") |
||||||
|
-- print("luaTable",luaTable) |
||||||
|
local result = "" |
||||||
|
local timestamp = os.time() |
||||||
|
-- print("timestamp",timestamp) |
||||||
|
-- print("time",hexToLittleEndian(string.format("%016X",timestamp))) |
||||||
|
-- print("version",luaTable["version"]) |
||||||
|
-- print("type",luaTable["type"]) |
||||||
|
|
||||||
|
result = result .. luaTable["type"] .. luaTable["version"] .. hexToLittleEndian(string.format("%016X",timestamp)) |
||||||
|
-- print(type(luaTable["values"])) |
||||||
|
local values = luaTable["values"] |
||||||
|
|
||||||
|
local keys = {} |
||||||
|
for key in pairs(values) do |
||||||
|
table.insert(keys, key) |
||||||
|
end |
||||||
|
table.sort(keys) |
||||||
|
local lastDecimalism = -2 |
||||||
|
local totalPairs = 0 |
||||||
|
-- 打印排序后的键值对 |
||||||
|
|
||||||
|
local valueResult = {} |
||||||
|
local valueSize = {} |
||||||
|
local startPoint = -2 |
||||||
|
for _, key in ipairs(keys) do |
||||||
|
-- print(key, values[key]) |
||||||
|
-- print(key) |
||||||
|
local decimalism = key |
||||||
|
-- print(tonumber(decimalism) ~= lastDecimalism + 1) |
||||||
|
if tonumber(decimalism) ~= lastDecimalism + 1 then |
||||||
|
-- print("last + 1",lastDecimalism + 1) |
||||||
|
-- print("current",decimalism) |
||||||
|
-- print(decimalism) |
||||||
|
startPoint = decimalism |
||||||
|
totalPairs = totalPairs + 1 |
||||||
|
-- print(hexToLittleEndian(string.format("%04X",values[key]))) |
||||||
|
valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
valueSize[startPoint] = 2 |
||||||
|
-- print(valueSize[startPoint]) |
||||||
|
else |
||||||
|
-- print(decimalism) |
||||||
|
-- print(valueResult[startPoint]) |
||||||
|
valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- print(valueSize[startPoint]) |
||||||
|
valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
end |
||||||
|
lastDecimalism = decimalism |
||||||
|
end |
||||||
|
-- print(valueSize) |
||||||
|
result = result .. string.format("%02X",totalPairs) |
||||||
|
|
||||||
|
for ke,_ in pairsByKeys(valueSize) do |
||||||
|
-- print("jade") |
||||||
|
-- print(ke,vl) |
||||||
|
result = result .. hexToLittleEndian(string.format("%04X",ke)) .. hexToLittleEndian(string.format("%04X",valueSize[ke])) .. valueResult[ke] |
||||||
|
end |
||||||
|
local byteArray = {} |
||||||
|
-- for i = 1, #result, 2 do |
||||||
|
-- local hexByte = string.sub(result, i, i + 1) |
||||||
|
-- local decimalValue = tonumber(hexByte, 16) |
||||||
|
-- table.insert(byteArray, decimalValue) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- for _, byte in ipairs(byteArray) do |
||||||
|
-- print(byte) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- print("result",byteArray) |
||||||
|
return result |
||||||
|
end |
||||||
|
|
||||||
|
-- parseRecord("0001A90AE4650000000001020002000100") |
||||||
|
|
||||||
|
-- local valuess = {} |
||||||
|
-- valuess["0002"] = "0001" |
||||||
|
-- print (valuess["0002"]) |
||||||
|
|
||||||
|
|
||||||
|
-- valuess = {[0002]="0001"} |
||||||
|
-- myTable = {type = "00", version = "01",time = 1709294663000,values = valuess} |
||||||
|
-- issueOrder(myTable) |
||||||
|
|
||||||
|
-- 示例 |
||||||
|
-- local json_str = '{"name": "John", "age": 30, "city": "New York"}' |
||||||
|
-- local result_table = parse_json(json_str) |
||||||
|
|
||||||
|
-- -- 输出解析结果 |
||||||
|
-- for key, value in pairs(result_table) do |
||||||
|
-- print(key, value) |
||||||
|
-- end |
||||||
|
|
||||||
|
|
||||||
|
-- function |
||||||
|
-- issueOrder('{"version":"01","type":"00","time":"1709284976000","values":{"2":"1","31000":"31000","32003":"32003","31002":"31002","32002":"32002","30002":"30002","1":"1","30003":"30003","32000":"32000","32004":"32004","32001":"32001","0":"1","30004":"30004","31001":"31001"}}') |
||||||
|
|
||||||
|
-- print("result","0001801a860f0000000004000006000100010001003275060032753375347518790600187919791a79007d0a00007d017d027d037d047d") |
||||||
|
|
||||||
|
-- 0001801a860f00000000043000010001000133000275327533753433100079187919791a5320007d007d017d027d037d04 |
||||||
|
-- 0001801a860f0000000004000006000100010001003275060032753375347518790600187919791a79007d0a00007d017d027d037d047d |
||||||
|
-- local result = parseRecord("000177EEE3650000000001020002000100") |
||||||
|
-- print(result) |
@ -0,0 +1,485 @@ |
|||||||
|
-- local cjson = require("cjson") |
||||||
|
function parseRecord(t) |
||||||
|
local result = {} |
||||||
|
local start = 1 |
||||||
|
local type = hex_to_bytes(t, start, 1) |
||||||
|
--print("type:", type) |
||||||
|
start = start + 2 |
||||||
|
local version = hex_to_bytes(t, start, 1) |
||||||
|
--print("version:", version) |
||||||
|
start = start + 2 |
||||||
|
local time = hex_to_bytes(t, start, 8) |
||||||
|
--print("time:", time) |
||||||
|
start = start + 16 |
||||||
|
local pair = hex_to_bytes(t, start, 1) |
||||||
|
--print("pair:", pair) |
||||||
|
start = start + 2 |
||||||
|
local values = {} |
||||||
|
for i = 1, tonumber(pair, 16) do |
||||||
|
local address = hex_to_bytes(t, start, 2) |
||||||
|
|
||||||
|
|
||||||
|
-- print("startAdd:", address) |
||||||
|
start = start + 4 |
||||||
|
local size = hex_to_bytes(t, start, 2) |
||||||
|
--print("size:", size) |
||||||
|
start = start + 4 |
||||||
|
if tonumber(size, 16) / 2 == 0 |
||||||
|
then |
||||||
|
values[address] = "" |
||||||
|
end |
||||||
|
for j = 1, tonumber(size, 16) / 2 do |
||||||
|
--print(address, hex_to_bytes(t, start, 2)) |
||||||
|
values[address] = hex_to_bytes(t, start, 2) |
||||||
|
address = string.gsub(string.format("%#x", tonumber(address, 16) + 1), "0x", "") |
||||||
|
if string.len(address) < 4 |
||||||
|
then |
||||||
|
address = string.rep("0", 4 - string.len(address)) .. address |
||||||
|
end |
||||||
|
start = start + 4 |
||||||
|
end |
||||||
|
end |
||||||
|
result["type"] = type |
||||||
|
result["version"] = version |
||||||
|
result["time"] = tonumber(time, 16) |
||||||
|
result["pair"] = pair |
||||||
|
result["values"] = values |
||||||
|
-- print(result["type"], result["version"], result["time"], result["pair"]) |
||||||
|
for k,v in pairsByKeys(result["values"]) do |
||||||
|
-- print(k,v) |
||||||
|
end |
||||||
|
-- print(table2string(result)) |
||||||
|
return table2string(result) |
||||||
|
end |
||||||
|
|
||||||
|
function table2string(tablevalue) |
||||||
|
local stringtable = serialize(tablevalue) |
||||||
|
-- print(stringtable) |
||||||
|
return stringtable |
||||||
|
end |
||||||
|
|
||||||
|
function serialize(obj) |
||||||
|
local lua = "" |
||||||
|
local t = type(obj) |
||||||
|
if t == "number" then |
||||||
|
lua = lua .. obj |
||||||
|
elseif t == "boolean" then |
||||||
|
lua = lua .. tostring(obj) |
||||||
|
elseif t == "string" then |
||||||
|
lua = lua .. string.format("%q", obj) |
||||||
|
elseif t == "table" then |
||||||
|
lua = lua .. "{" |
||||||
|
for k, v in pairs(obj) do |
||||||
|
lua = lua .. serialize(k) .. ":" .. serialize(v) .. "," |
||||||
|
end |
||||||
|
local metatable = getmetatable(obj) |
||||||
|
if metatable ~= nil and type(metatable.__index) == "table" then |
||||||
|
for k, v in pairs(metatable.__index) do |
||||||
|
lua = lua .. "[" .. serialize(k) .. "]=" .. serialize(v) .. "," |
||||||
|
end |
||||||
|
end |
||||||
|
lua = string.sub(lua, 1, -2) |
||||||
|
lua = lua .. "}" |
||||||
|
elseif t == "nil" then |
||||||
|
return nil |
||||||
|
else |
||||||
|
error("can not serialize a " .. t .. " type.") |
||||||
|
end |
||||||
|
return lua |
||||||
|
end |
||||||
|
|
||||||
|
|
||||||
|
function pairsByKeys(t) |
||||||
|
local a = {} |
||||||
|
for n in pairs(t) do |
||||||
|
a[#a + 1] = n |
||||||
|
end |
||||||
|
table.sort(a) |
||||||
|
local i = 0 |
||||||
|
local iter = function() |
||||||
|
i = i + 1 |
||||||
|
if a[i] == nil |
||||||
|
then |
||||||
|
return nil |
||||||
|
else |
||||||
|
return a[i], t[a[i]] |
||||||
|
end |
||||||
|
end |
||||||
|
return iter |
||||||
|
end |
||||||
|
|
||||||
|
function length(t) |
||||||
|
local res=0 |
||||||
|
for k,v in pairs(t) do |
||||||
|
res=res+1 |
||||||
|
end |
||||||
|
return res |
||||||
|
end |
||||||
|
|
||||||
|
function hex_to_bytes(hex, start, len) |
||||||
|
-- print(hex) |
||||||
|
local value = hex:sub(start, start + len * 2 - 1) |
||||||
|
if len > 1 |
||||||
|
then |
||||||
|
value = toBigEndian(value) |
||||||
|
end |
||||||
|
return value |
||||||
|
end |
||||||
|
|
||||||
|
function toBigEndian(value) |
||||||
|
--print(string.len(value)) |
||||||
|
local hexResult = "" |
||||||
|
for i = string.len(value), 1, -2 do |
||||||
|
local hex = value:sub(i - 1, i) |
||||||
|
hexResult = hexResult .. hex |
||||||
|
end |
||||||
|
|
||||||
|
return hexResult |
||||||
|
|
||||||
|
end |
||||||
|
|
||||||
|
-- 将16进制字符串转换为小端格式 |
||||||
|
local function hexToLittleEndian(hexString) |
||||||
|
local littleEndian = "" |
||||||
|
for i = #hexString, 1, -2 do |
||||||
|
local byte = hexString:sub(i - 1, i) |
||||||
|
littleEndian = littleEndian .. byte |
||||||
|
end |
||||||
|
return littleEndian |
||||||
|
end |
||||||
|
|
||||||
|
-- 判断字符串是否表示一个负数 |
||||||
|
function isNegative(str) |
||||||
|
-- 将字符串转换为数字 |
||||||
|
local num = tonumber(str) |
||||||
|
-- 如果转换成功,并且数字小于0,则返回true;否则返回false |
||||||
|
return num and num < 0 |
||||||
|
end |
||||||
|
|
||||||
|
function negativeToHex(n) |
||||||
|
-- 将负数转换为其补码形式 |
||||||
|
local complement = 0xFFFFFFFF + n + 1 |
||||||
|
-- 使用string.format将补码形式转换为十六进制字符串 |
||||||
|
local hexStr = string.format("%X", complement) |
||||||
|
hexStr = hexToLittleEndian(hexStr) |
||||||
|
-- 如果字符串长度大于4,则截取头4位(即高4位) |
||||||
|
if #hexStr > 4 then |
||||||
|
return string.sub(hexStr, 1, 4) |
||||||
|
else |
||||||
|
return hexStr |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
function issueOrder(luaTable) |
||||||
|
-- print("start") |
||||||
|
-- print("luaTable",luaTable) |
||||||
|
local result = "" |
||||||
|
local timestamp = os.time() |
||||||
|
-- print("timestamp",timestamp) |
||||||
|
-- print("time",hexToLittleEndian(string.format("%016X",timestamp))) |
||||||
|
-- print("version",luaTable["version"]) |
||||||
|
-- print("type",luaTable["type"]) |
||||||
|
|
||||||
|
result = result .. luaTable["type"] .. luaTable["version"] .. hexToLittleEndian(string.format("%016X",timestamp)) |
||||||
|
-- print(type(luaTable["values"])) |
||||||
|
local values = luaTable["values"] |
||||||
|
-- print("values",values) |
||||||
|
|
||||||
|
local keys = {} |
||||||
|
-- print("keys",keys) |
||||||
|
for key in pairs(values) do |
||||||
|
-- print("key",key) |
||||||
|
table.insert(keys, key) |
||||||
|
end |
||||||
|
table.sort(keys) |
||||||
|
local lastDecimalism = -2 |
||||||
|
local totalPairs = 0 |
||||||
|
-- 打印排序后的键值对 |
||||||
|
|
||||||
|
local valueResult = {} |
||||||
|
local valueSize = {} |
||||||
|
local startPoint = -2 |
||||||
|
for _, key in ipairs(keys) do |
||||||
|
-- print(key, values[key]) |
||||||
|
-- print(key) |
||||||
|
local decimalism = key |
||||||
|
-- print(tonumber(decimalism) ~= lastDecimalism + 1) |
||||||
|
if tonumber(decimalism) ~= lastDecimalism + 1 then |
||||||
|
-- print("last + 1",lastDecimalism + 1) |
||||||
|
-- print("current",decimalism) |
||||||
|
-- print(decimalism) |
||||||
|
startPoint = decimalism |
||||||
|
totalPairs = totalPairs + 1 |
||||||
|
-- print(hexToLittleEndian(string.format("%04X",values[key]))) |
||||||
|
-- print("value",values[key]) |
||||||
|
if isEmptyString(values[key]) then |
||||||
|
valueResult[startPoint] = values[key] |
||||||
|
valueSize[startPoint] = 2 |
||||||
|
else |
||||||
|
valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
valueSize[startPoint] = 2 |
||||||
|
-- print(valueSize[startPoint]) |
||||||
|
end |
||||||
|
else |
||||||
|
-- print(decimalism) |
||||||
|
-- print(valueResult[startPoint]) |
||||||
|
if isEmptyString(values[key]) then |
||||||
|
-- print("result",valueResult[startPoint]) |
||||||
|
valueResult[startPoint] = valueResult[startPoint] |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] .. values[key] |
||||||
|
valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
else |
||||||
|
valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- print(valueSize[startPoint]) |
||||||
|
valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
end |
||||||
|
end |
||||||
|
lastDecimalism = decimalism |
||||||
|
end |
||||||
|
-- print(valueSize) |
||||||
|
result = result .. string.format("%02X",totalPairs) |
||||||
|
|
||||||
|
for ke,_ in pairsByKeys(valueSize) do |
||||||
|
-- print("jade") |
||||||
|
-- print(ke,vl) |
||||||
|
result = result .. hexToLittleEndian(string.format("%04X",ke)) .. hexToLittleEndian(string.format("%04X",valueSize[ke])) .. valueResult[ke] |
||||||
|
end |
||||||
|
local byteArray = {} |
||||||
|
for i = 1, #result, 2 do |
||||||
|
local hexByte = string.sub(result, i, i + 1) |
||||||
|
local decimalValue = tonumber(hexByte, 16) |
||||||
|
table.insert(byteArray, decimalValue) |
||||||
|
end |
||||||
|
|
||||||
|
for _, byte in ipairs(byteArray) do |
||||||
|
-- print(byte) |
||||||
|
end |
||||||
|
|
||||||
|
-- print("result",byteArray) |
||||||
|
return byteArray |
||||||
|
end |
||||||
|
|
||||||
|
function issueReadOrder(luaTable) |
||||||
|
-- print("start") |
||||||
|
-- print("luaTable",luaTable) |
||||||
|
local result = "" |
||||||
|
local timestamp = os.time() |
||||||
|
-- print("timestamp",timestamp) |
||||||
|
-- print("time",hexToLittleEndian(string.format("%016X",timestamp))) |
||||||
|
-- print("version",luaTable["version"]) |
||||||
|
-- print("type",luaTable["type"]) |
||||||
|
|
||||||
|
result = result .. luaTable["type"] .. luaTable["version"] .. hexToLittleEndian(string.format("%016X",timestamp)) |
||||||
|
-- print(type(luaTable["values"])) |
||||||
|
|
||||||
|
result = result .. string.format("%02X",luaTable["totalPairs"]) |
||||||
|
local values = luaTable["values"] |
||||||
|
-- print("values",values) |
||||||
|
|
||||||
|
local keys = {} |
||||||
|
-- print("keys",keys) |
||||||
|
for key in pairs(values) do |
||||||
|
result = result .. hexToLittleEndian(string.format("%04X",key)) .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- print("key",key) |
||||||
|
-- table.insert(keys, key) |
||||||
|
end |
||||||
|
-- table.sort(keys) |
||||||
|
-- local lastDecimalism = -2 |
||||||
|
-- local totalPairs = 0 |
||||||
|
-- -- 打印排序后的键值对 |
||||||
|
|
||||||
|
-- local valueResult = {} |
||||||
|
-- local valueSize = {} |
||||||
|
-- local startPoint = -2 |
||||||
|
-- for _, key in ipairs(keys) do |
||||||
|
-- -- print(key, values[key]) |
||||||
|
-- -- print(key) |
||||||
|
-- local decimalism = key |
||||||
|
-- -- print(tonumber(decimalism) ~= lastDecimalism + 1) |
||||||
|
-- if tonumber(decimalism) ~= lastDecimalism + 1 then |
||||||
|
-- -- print("last + 1",lastDecimalism + 1) |
||||||
|
-- -- print("current",decimalism) |
||||||
|
-- -- print(decimalism) |
||||||
|
-- startPoint = decimalism |
||||||
|
-- totalPairs = totalPairs + 1 |
||||||
|
-- -- print(hexToLittleEndian(string.format("%04X",values[key]))) |
||||||
|
-- print("value",values[key]) |
||||||
|
-- if isEmptyString(values[key]) then |
||||||
|
-- valueResult[startPoint] = values[key] |
||||||
|
-- valueSize[startPoint] = 2 |
||||||
|
-- else |
||||||
|
-- valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- valueSize[startPoint] = 2 |
||||||
|
-- -- print(valueSize[startPoint]) |
||||||
|
-- end |
||||||
|
-- else |
||||||
|
-- -- print(decimalism) |
||||||
|
-- -- print(valueResult[startPoint]) |
||||||
|
-- if isEmptyString(values[key]) then |
||||||
|
-- print("result",valueResult[startPoint]) |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] |
||||||
|
-- -- valueResult[startPoint] = valueResult[startPoint] .. values[key] |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- else |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- -- print(valueSize[startPoint]) |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- end |
||||||
|
-- end |
||||||
|
-- lastDecimalism = decimalism |
||||||
|
-- end |
||||||
|
-- -- print(valueSize) |
||||||
|
-- result = result .. string.format("%02X",totalPairs) |
||||||
|
|
||||||
|
-- for ke,_ in pairsByKeys(valueSize) do |
||||||
|
-- -- print("jade") |
||||||
|
-- -- print(ke,vl) |
||||||
|
-- result = result .. hexToLittleEndian(string.format("%04X",ke)) .. hexToLittleEndian(string.format("%04X",valueSize[ke])) .. valueResult[ke] |
||||||
|
-- end |
||||||
|
local byteArray = {} |
||||||
|
for i = 1, #result, 2 do |
||||||
|
local hexByte = string.sub(result, i, i + 1) |
||||||
|
local decimalValue = tonumber(hexByte, 16) |
||||||
|
table.insert(byteArray, decimalValue) |
||||||
|
end |
||||||
|
|
||||||
|
for _, byte in ipairs(byteArray) do |
||||||
|
-- print(byte) |
||||||
|
end |
||||||
|
|
||||||
|
-- print("result",byteArray) |
||||||
|
return byteArray |
||||||
|
end |
||||||
|
|
||||||
|
-- function issueOrder(luaTable) |
||||||
|
-- -- print("start") |
||||||
|
-- print("luaTable",luaTable) |
||||||
|
-- local result = "" |
||||||
|
-- local timestamp = os.time() |
||||||
|
-- print("timestamp",timestamp) |
||||||
|
-- print("time",hexToLittleEndian(string.format("%016X",timestamp))) |
||||||
|
-- -- print("version",luaTable["version"]) |
||||||
|
-- -- print("type",luaTable["type"]) |
||||||
|
|
||||||
|
-- result = result .. luaTable["type"] .. luaTable["version"] .. hexToLittleEndian(string.format("%016X",timestamp)) |
||||||
|
-- -- print(type(luaTable["values"])) |
||||||
|
-- local values = luaTable["values"] |
||||||
|
|
||||||
|
-- local keys = {} |
||||||
|
-- for key in pairs(values) do |
||||||
|
-- table.insert(keys, key) |
||||||
|
-- end |
||||||
|
-- table.sort(keys) |
||||||
|
-- local lastDecimalism = -2 |
||||||
|
-- local totalPairs = 0 |
||||||
|
-- -- 打印排序后的键值对 |
||||||
|
|
||||||
|
-- local valueResult = {} |
||||||
|
-- local valueSize = {} |
||||||
|
-- local startPoint = -2 |
||||||
|
-- for _, key in ipairs(keys) do |
||||||
|
-- -- print(key, values[key]) |
||||||
|
-- -- print(key) |
||||||
|
-- local decimalism = key |
||||||
|
-- -- print(tonumber(decimalism) ~= lastDecimalism + 1) |
||||||
|
-- if tonumber(decimalism) ~= lastDecimalism + 1 then |
||||||
|
-- -- print("last + 1",lastDecimalism + 1) |
||||||
|
-- -- print("current",decimalism) |
||||||
|
-- -- print(decimalism) |
||||||
|
-- startPoint = decimalism |
||||||
|
-- totalPairs = totalPairs + 1 |
||||||
|
-- print(values[key]) |
||||||
|
-- if isNegative(values[key]) then |
||||||
|
-- -- print("jade") |
||||||
|
-- -- print(string.format("%04X",values[key])) |
||||||
|
-- -- print(negativeToHex(values[key])) |
||||||
|
-- -- print(string.len((string.format("%04X",values[key])))) |
||||||
|
-- -- print(valueResult[startPoint]) |
||||||
|
-- -- string.sub(hexToLittleEndian(string.format("%04X",values[key])),1,4) |
||||||
|
-- valueResult[startPoint] = negativeToHex(values[key]) |
||||||
|
-- valueSize[startPoint]=2 |
||||||
|
-- else |
||||||
|
-- -- string.format("%04X",values[key]) |
||||||
|
-- valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- valueSize[startPoint]=2 |
||||||
|
-- end |
||||||
|
-- -- valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- -- valueSize[startPoint] = 2 |
||||||
|
-- -- print(valueSize[startPoint]) |
||||||
|
-- else |
||||||
|
-- -- print(decimalism) |
||||||
|
-- -- print(valueResult[startPoint]) |
||||||
|
-- if isNegative(values[key]) then |
||||||
|
-- -- print("jade") |
||||||
|
-- -- print(negativeToHex(values[key])) |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] .. negativeToHex(values[key]) |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- else |
||||||
|
-- -- string.format("%04X",values[key]) |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- end |
||||||
|
-- -- valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- -- print(valueSize[startPoint]) |
||||||
|
-- -- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- end |
||||||
|
-- lastDecimalism = decimalism |
||||||
|
-- end |
||||||
|
-- -- print(valueSize) |
||||||
|
-- result = result .. string.format("%02X",totalPairs) |
||||||
|
|
||||||
|
-- for ke,_ in pairsByKeys(valueSize) do |
||||||
|
-- -- print("jade") |
||||||
|
-- -- print(ke,vl) |
||||||
|
-- result = result .. hexToLittleEndian(string.format("%04X",ke)) .. hexToLittleEndian(string.format("%04X",valueSize[ke])) .. valueResult[ke] |
||||||
|
-- end |
||||||
|
-- return result |
||||||
|
-- -- local byteArray = {} |
||||||
|
-- -- for i = 1, #result, 2 do |
||||||
|
-- -- local hexByte = string.sub(result, i, i + 1) |
||||||
|
-- -- local decimalValue = tonumber(hexByte, 16) |
||||||
|
-- -- table.insert(byteArray, decimalValue) |
||||||
|
-- -- end |
||||||
|
|
||||||
|
-- -- for _, byte in ipairs(byteArray) do |
||||||
|
-- -- print(byte) |
||||||
|
-- -- end |
||||||
|
|
||||||
|
-- -- -- print("result",byteArray) |
||||||
|
-- -- return byteArray |
||||||
|
-- end |
||||||
|
|
||||||
|
-- parseRecord("0001A90AE4650000000001020002000100") |
||||||
|
|
||||||
|
-- local valuess = {} |
||||||
|
-- valuess["0002"] = "0001" |
||||||
|
-- print (valuess["0002"]) |
||||||
|
|
||||||
|
|
||||||
|
-- valuess = {[0002]="-10"} |
||||||
|
-- myTable = {type = "00", version = "01",time = 1709294663000,values = valuess} |
||||||
|
-- print(issueOrder(myTable)) |
||||||
|
-- print(hexToLittleEndian(string.format("%04X",-100))) |
||||||
|
-- print(string.sub(hexToLittleEndian(string.format("%04X",-100)),1,4)) |
||||||
|
-- 示例 |
||||||
|
-- local json_str = '{"name": "John", "age": 30, "city": "New York"}' |
||||||
|
-- local result_table = parse_json(json_str) |
||||||
|
|
||||||
|
-- -- 输出解析结果 |
||||||
|
-- for key, value in pairs(result_table) do |
||||||
|
-- print(key, value) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- values = {} |
||||||
|
-- values[1] = "1" |
||||||
|
-- myTable = {type = "00", version = "01",values = values} |
||||||
|
-- print(issueOrder(myTable)) |
||||||
|
-- function |
||||||
|
-- issueOrder('{"version":"01","type":"00","time":"1709284976000","values":{"1":"1"}}') |
||||||
|
|
||||||
|
-- print("result","0001801a860f0000000004000006000100010001003275060032753375347518790600187919791a79007d0a00007d017d027d037d047d") |
||||||
|
|
||||||
|
-- 0001801a860f00000000043000010001000133000275327533753433100079187919791a5320007d007d017d027d037d04 |
||||||
|
-- 0001801a860f0000000004000006000100010001003275060032753375347518790600187919791a79007d0a00007d017d027d037d047d |
||||||
|
-- local result = parseRecord("000177EEE3650000000001020002000100") |
||||||
|
-- print(result) |
@ -0,0 +1,482 @@ |
|||||||
|
-- local cjson = require("cjson") |
||||||
|
function parseRecord(t) |
||||||
|
local result = {} |
||||||
|
local start = 1 |
||||||
|
local type = hex_to_bytes(t, start, 1) |
||||||
|
--print("type:", type) |
||||||
|
start = start + 2 |
||||||
|
local version = hex_to_bytes(t, start, 1) |
||||||
|
--print("version:", version) |
||||||
|
start = start + 2 |
||||||
|
local time = hex_to_bytes(t, start, 8) |
||||||
|
--print("time:", time) |
||||||
|
start = start + 16 |
||||||
|
local pair = hex_to_bytes(t, start, 1) |
||||||
|
--print("pair:", pair) |
||||||
|
start = start + 2 |
||||||
|
local values = {} |
||||||
|
for i = 1, tonumber(pair, 16) do |
||||||
|
local address = hex_to_bytes(t, start, 2) |
||||||
|
|
||||||
|
|
||||||
|
-- print("startAdd:", address) |
||||||
|
start = start + 4 |
||||||
|
local size = hex_to_bytes(t, start, 2) |
||||||
|
--print("size:", size) |
||||||
|
start = start + 4 |
||||||
|
for j = 1, tonumber(size, 16) / 2 do |
||||||
|
--print(address, hex_to_bytes(t, start, 2)) |
||||||
|
values[address] = hex_to_bytes(t, start, 2) |
||||||
|
address = string.gsub(string.format("%#x", tonumber(address, 16) + 1), "0x", "") |
||||||
|
if string.len(address) < 4 |
||||||
|
then |
||||||
|
address = string.rep("0", 4 - string.len(address)) .. address |
||||||
|
end |
||||||
|
start = start + 4 |
||||||
|
end |
||||||
|
end |
||||||
|
result["type"] = type |
||||||
|
result["version"] = version |
||||||
|
result["time"] = tonumber(time, 16) |
||||||
|
result["pair"] = pair |
||||||
|
result["values"] = values |
||||||
|
-- print(result["type"], result["version"], result["time"], result["pair"]) |
||||||
|
for k,v in pairsByKeys(result["values"]) do |
||||||
|
-- print(k,v) |
||||||
|
end |
||||||
|
-- print(table2string(result)) |
||||||
|
return table2string(result) |
||||||
|
end |
||||||
|
|
||||||
|
function table2string(tablevalue) |
||||||
|
local stringtable = serialize(tablevalue) |
||||||
|
-- print(stringtable) |
||||||
|
return stringtable |
||||||
|
end |
||||||
|
|
||||||
|
function serialize(obj) |
||||||
|
local lua = "" |
||||||
|
local t = type(obj) |
||||||
|
if t == "number" then |
||||||
|
lua = lua .. obj |
||||||
|
elseif t == "boolean" then |
||||||
|
lua = lua .. tostring(obj) |
||||||
|
elseif t == "string" then |
||||||
|
lua = lua .. string.format("%q", obj) |
||||||
|
elseif t == "table" then |
||||||
|
lua = lua .. "{" |
||||||
|
for k, v in pairs(obj) do |
||||||
|
lua = lua .. serialize(k) .. ":" .. serialize(v) .. "," |
||||||
|
end |
||||||
|
local metatable = getmetatable(obj) |
||||||
|
if metatable ~= nil and type(metatable.__index) == "table" then |
||||||
|
for k, v in pairs(metatable.__index) do |
||||||
|
lua = lua .. "[" .. serialize(k) .. "]=" .. serialize(v) .. "," |
||||||
|
end |
||||||
|
end |
||||||
|
lua = string.sub(lua, 1, -2) |
||||||
|
lua = lua .. "}" |
||||||
|
elseif t == "nil" then |
||||||
|
return nil |
||||||
|
else |
||||||
|
error("can not serialize a " .. t .. " type.") |
||||||
|
end |
||||||
|
return lua |
||||||
|
end |
||||||
|
|
||||||
|
|
||||||
|
function pairsByKeys(t) |
||||||
|
local a = {} |
||||||
|
for n in pairs(t) do |
||||||
|
a[#a + 1] = n |
||||||
|
end |
||||||
|
table.sort(a) |
||||||
|
local i = 0 |
||||||
|
local iter = function() |
||||||
|
i = i + 1 |
||||||
|
if a[i] == nil |
||||||
|
then |
||||||
|
return nil |
||||||
|
else |
||||||
|
return a[i], t[a[i]] |
||||||
|
end |
||||||
|
end |
||||||
|
return iter |
||||||
|
end |
||||||
|
|
||||||
|
function length(t) |
||||||
|
local res=0 |
||||||
|
for k,v in pairs(t) do |
||||||
|
res=res+1 |
||||||
|
end |
||||||
|
return res |
||||||
|
end |
||||||
|
|
||||||
|
function hex_to_bytes(hex, start, len) |
||||||
|
-- print(hex) |
||||||
|
local value = hex:sub(start, start + len * 2 - 1) |
||||||
|
if len > 1 |
||||||
|
then |
||||||
|
value = toBigEndian(value) |
||||||
|
end |
||||||
|
return value |
||||||
|
end |
||||||
|
|
||||||
|
function toBigEndian(value) |
||||||
|
--print(string.len(value)) |
||||||
|
local hexResult = "" |
||||||
|
for i = string.len(value), 1, -2 do |
||||||
|
local hex = value:sub(i - 1, i) |
||||||
|
hexResult = hexResult .. hex |
||||||
|
end |
||||||
|
|
||||||
|
return hexResult |
||||||
|
|
||||||
|
end |
||||||
|
|
||||||
|
-- 将16进制字符串转换为小端格式 |
||||||
|
local function hexToLittleEndian(hexString) |
||||||
|
local littleEndian = "" |
||||||
|
for i = #hexString, 1, -2 do |
||||||
|
local byte = hexString:sub(i - 1, i) |
||||||
|
littleEndian = littleEndian .. byte |
||||||
|
end |
||||||
|
return littleEndian |
||||||
|
end |
||||||
|
|
||||||
|
-- 判断字符串是否表示一个负数 |
||||||
|
function isNegative(str) |
||||||
|
-- 将字符串转换为数字 |
||||||
|
local num = tonumber(str) |
||||||
|
-- 如果转换成功,并且数字小于0,则返回true;否则返回false |
||||||
|
return num and num < 0 |
||||||
|
end |
||||||
|
|
||||||
|
function negativeToHex(n) |
||||||
|
-- 将负数转换为其补码形式 |
||||||
|
local complement = 0xFFFFFFFF + n + 1 |
||||||
|
-- 使用string.format将补码形式转换为十六进制字符串 |
||||||
|
local hexStr = string.format("%X", complement) |
||||||
|
hexStr = hexToLittleEndian(hexStr) |
||||||
|
-- 如果字符串长度大于4,则截取头4位(即高4位) |
||||||
|
if #hexStr > 4 then |
||||||
|
return string.sub(hexStr, 1, 4) |
||||||
|
else |
||||||
|
return hexStr |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
-- function issueOrder(luaTable) |
||||||
|
-- -- print("start") |
||||||
|
-- print("luaTable",luaTable) |
||||||
|
-- local result = "" |
||||||
|
-- local timestamp = os.time() |
||||||
|
-- print("timestamp",timestamp) |
||||||
|
-- print("time",hexToLittleEndian(string.format("%016X",timestamp))) |
||||||
|
-- print("version",luaTable["version"]) |
||||||
|
-- print("type",luaTable["type"]) |
||||||
|
|
||||||
|
-- result = result .. luaTable["type"] .. luaTable["version"] .. hexToLittleEndian(string.format("%016X",timestamp)) |
||||||
|
-- -- print(type(luaTable["values"])) |
||||||
|
-- local values = luaTable["values"] |
||||||
|
-- -- print("values",values) |
||||||
|
|
||||||
|
-- local keys = {} |
||||||
|
-- -- print("keys",keys) |
||||||
|
-- for key in pairs(values) do |
||||||
|
-- -- print("key",key) |
||||||
|
-- table.insert(keys, key) |
||||||
|
-- end |
||||||
|
-- table.sort(keys) |
||||||
|
-- local lastDecimalism = -2 |
||||||
|
-- local totalPairs = 0 |
||||||
|
-- -- 打印排序后的键值对 |
||||||
|
|
||||||
|
-- local valueResult = {} |
||||||
|
-- local valueSize = {} |
||||||
|
-- local startPoint = -2 |
||||||
|
-- for _, key in ipairs(keys) do |
||||||
|
-- -- print(key, values[key]) |
||||||
|
-- -- print(key) |
||||||
|
-- local decimalism = key |
||||||
|
-- -- print(tonumber(decimalism) ~= lastDecimalism + 1) |
||||||
|
-- if tonumber(decimalism) ~= lastDecimalism + 1 then |
||||||
|
-- -- print("last + 1",lastDecimalism + 1) |
||||||
|
-- -- print("current",decimalism) |
||||||
|
-- -- print(decimalism) |
||||||
|
-- startPoint = decimalism |
||||||
|
-- totalPairs = totalPairs + 1 |
||||||
|
-- -- print(hexToLittleEndian(string.format("%04X",values[key]))) |
||||||
|
-- print("value",values[key]) |
||||||
|
-- if isEmptyString(values[key]) then |
||||||
|
-- valueResult[startPoint] = values[key] |
||||||
|
-- valueSize[startPoint] = 2 |
||||||
|
-- else |
||||||
|
-- valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- valueSize[startPoint] = 2 |
||||||
|
-- -- print(valueSize[startPoint]) |
||||||
|
-- end |
||||||
|
-- else |
||||||
|
-- -- print(decimalism) |
||||||
|
-- -- print(valueResult[startPoint]) |
||||||
|
-- if isEmptyString(values[key]) then |
||||||
|
-- print("result",valueResult[startPoint]) |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] |
||||||
|
-- -- valueResult[startPoint] = valueResult[startPoint] .. values[key] |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- else |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- -- print(valueSize[startPoint]) |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- end |
||||||
|
-- end |
||||||
|
-- lastDecimalism = decimalism |
||||||
|
-- end |
||||||
|
-- -- print(valueSize) |
||||||
|
-- result = result .. string.format("%02X",totalPairs) |
||||||
|
|
||||||
|
-- for ke,_ in pairsByKeys(valueSize) do |
||||||
|
-- -- print("jade") |
||||||
|
-- -- print(ke,vl) |
||||||
|
-- result = result .. hexToLittleEndian(string.format("%04X",ke)) .. hexToLittleEndian(string.format("%04X",valueSize[ke])) .. valueResult[ke] |
||||||
|
-- end |
||||||
|
-- local byteArray = {} |
||||||
|
-- for i = 1, #result, 2 do |
||||||
|
-- local hexByte = string.sub(result, i, i + 1) |
||||||
|
-- local decimalValue = tonumber(hexByte, 16) |
||||||
|
-- table.insert(byteArray, decimalValue) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- for _, byte in ipairs(byteArray) do |
||||||
|
-- print(byte) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- -- print("result",byteArray) |
||||||
|
-- return byteArray |
||||||
|
-- end |
||||||
|
|
||||||
|
function issueReadOrder(luaTable) |
||||||
|
-- print("start") |
||||||
|
-- print("luaTable",luaTable) |
||||||
|
local result = "" |
||||||
|
local timestamp = os.time() |
||||||
|
-- print("timestamp",timestamp) |
||||||
|
-- print("time",hexToLittleEndian(string.format("%016X",timestamp))) |
||||||
|
-- print("version",luaTable["version"]) |
||||||
|
-- print("type",luaTable["type"]) |
||||||
|
|
||||||
|
result = result .. luaTable["type"] .. luaTable["version"] .. hexToLittleEndian(string.format("%016X",timestamp)) |
||||||
|
-- print(type(luaTable["values"])) |
||||||
|
|
||||||
|
result = result .. string.format("%02X",luaTable["totalPairs"]) |
||||||
|
local values = luaTable["values"] |
||||||
|
-- print("values",values) |
||||||
|
|
||||||
|
local keys = {} |
||||||
|
-- print("keys",keys) |
||||||
|
for key in pairs(values) do |
||||||
|
result = result .. hexToLittleEndian(string.format("%04X",key)) .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- print("key",key) |
||||||
|
-- table.insert(keys, key) |
||||||
|
end |
||||||
|
-- table.sort(keys) |
||||||
|
-- local lastDecimalism = -2 |
||||||
|
-- local totalPairs = 0 |
||||||
|
-- -- 打印排序后的键值对 |
||||||
|
|
||||||
|
-- local valueResult = {} |
||||||
|
-- local valueSize = {} |
||||||
|
-- local startPoint = -2 |
||||||
|
-- for _, key in ipairs(keys) do |
||||||
|
-- -- print(key, values[key]) |
||||||
|
-- -- print(key) |
||||||
|
-- local decimalism = key |
||||||
|
-- -- print(tonumber(decimalism) ~= lastDecimalism + 1) |
||||||
|
-- if tonumber(decimalism) ~= lastDecimalism + 1 then |
||||||
|
-- -- print("last + 1",lastDecimalism + 1) |
||||||
|
-- -- print("current",decimalism) |
||||||
|
-- -- print(decimalism) |
||||||
|
-- startPoint = decimalism |
||||||
|
-- totalPairs = totalPairs + 1 |
||||||
|
-- -- print(hexToLittleEndian(string.format("%04X",values[key]))) |
||||||
|
-- print("value",values[key]) |
||||||
|
-- if isEmptyString(values[key]) then |
||||||
|
-- valueResult[startPoint] = values[key] |
||||||
|
-- valueSize[startPoint] = 2 |
||||||
|
-- else |
||||||
|
-- valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- valueSize[startPoint] = 2 |
||||||
|
-- -- print(valueSize[startPoint]) |
||||||
|
-- end |
||||||
|
-- else |
||||||
|
-- -- print(decimalism) |
||||||
|
-- -- print(valueResult[startPoint]) |
||||||
|
-- if isEmptyString(values[key]) then |
||||||
|
-- print("result",valueResult[startPoint]) |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] |
||||||
|
-- -- valueResult[startPoint] = valueResult[startPoint] .. values[key] |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- else |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- -- print(valueSize[startPoint]) |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
-- end |
||||||
|
-- end |
||||||
|
-- lastDecimalism = decimalism |
||||||
|
-- end |
||||||
|
-- -- print(valueSize) |
||||||
|
-- result = result .. string.format("%02X",totalPairs) |
||||||
|
|
||||||
|
-- for ke,_ in pairsByKeys(valueSize) do |
||||||
|
-- -- print("jade") |
||||||
|
-- -- print(ke,vl) |
||||||
|
-- result = result .. hexToLittleEndian(string.format("%04X",ke)) .. hexToLittleEndian(string.format("%04X",valueSize[ke])) .. valueResult[ke] |
||||||
|
-- end |
||||||
|
local byteArray = {} |
||||||
|
-- table.insert(123,123333) |
||||||
|
-- for i = 1, #result, 2 do |
||||||
|
-- local hexByte = string.sub(result, i, i + 1) |
||||||
|
-- local decimalValue = tonumber(hexByte, 16) |
||||||
|
-- table.insert(byteArray, decimalValue) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- for _, byte in ipairs(byteArray) do |
||||||
|
-- print(byte) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- print("result",byteArray) |
||||||
|
return result |
||||||
|
end |
||||||
|
|
||||||
|
function issueOrder(luaTable) |
||||||
|
-- print("start") |
||||||
|
-- print("luaTable",luaTable) |
||||||
|
local result = "" |
||||||
|
local timestamp = os.time() |
||||||
|
-- print("timestamp",timestamp) |
||||||
|
-- print("time",hexToLittleEndian(string.format("%016X",timestamp))) |
||||||
|
-- print("version",luaTable["version"]) |
||||||
|
-- print("type",luaTable["type"]) |
||||||
|
|
||||||
|
result = result .. luaTable["type"] .. luaTable["version"] .. hexToLittleEndian(string.format("%016X",timestamp)) |
||||||
|
-- print(type(luaTable["values"])) |
||||||
|
local values = luaTable["values"] |
||||||
|
|
||||||
|
local keys = {} |
||||||
|
for key in pairs(values) do |
||||||
|
table.insert(keys, key) |
||||||
|
end |
||||||
|
table.sort(keys) |
||||||
|
local lastDecimalism = -2 |
||||||
|
local totalPairs = 0 |
||||||
|
-- 打印排序后的键值对 |
||||||
|
|
||||||
|
local valueResult = {} |
||||||
|
local valueSize = {} |
||||||
|
local startPoint = -2 |
||||||
|
for _, key in ipairs(keys) do |
||||||
|
-- print(key, values[key]) |
||||||
|
-- print(key) |
||||||
|
local decimalism = key |
||||||
|
-- print(tonumber(decimalism) ~= lastDecimalism + 1) |
||||||
|
if tonumber(decimalism) ~= lastDecimalism + 1 then |
||||||
|
-- print("last + 1",lastDecimalism + 1) |
||||||
|
-- print("current",decimalism) |
||||||
|
-- print(decimalism) |
||||||
|
startPoint = decimalism |
||||||
|
totalPairs = totalPairs + 1 |
||||||
|
-- print(values[key]) |
||||||
|
if isNegative(values[key]) then |
||||||
|
-- print("jade") |
||||||
|
-- print(string.format("%04X",values[key])) |
||||||
|
-- print(negativeToHex(values[key])) |
||||||
|
-- print(string.len((string.format("%04X",values[key])))) |
||||||
|
-- print(valueResult[startPoint]) |
||||||
|
-- string.sub(hexToLittleEndian(string.format("%04X",values[key])),1,4) |
||||||
|
valueResult[startPoint] = negativeToHex(values[key]) |
||||||
|
valueSize[startPoint]=2 |
||||||
|
else |
||||||
|
-- string.format("%04X",values[key]) |
||||||
|
valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
valueSize[startPoint]=2 |
||||||
|
end |
||||||
|
-- valueResult[startPoint] = hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- valueSize[startPoint] = 2 |
||||||
|
-- print(valueSize[startPoint]) |
||||||
|
else |
||||||
|
-- print(decimalism) |
||||||
|
-- print(valueResult[startPoint]) |
||||||
|
if isNegative(values[key]) then |
||||||
|
-- print("jade") |
||||||
|
-- print(negativeToHex(values[key])) |
||||||
|
valueResult[startPoint] = valueResult[startPoint] .. negativeToHex(values[key]) |
||||||
|
valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
else |
||||||
|
-- string.format("%04X",values[key]) |
||||||
|
valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
end |
||||||
|
-- valueResult[startPoint] = valueResult[startPoint] .. hexToLittleEndian(string.format("%04X",values[key])) |
||||||
|
-- print(valueSize[startPoint]) |
||||||
|
-- valueSize[startPoint] = valueSize[startPoint] + 2 |
||||||
|
end |
||||||
|
lastDecimalism = decimalism |
||||||
|
end |
||||||
|
-- print(valueSize) |
||||||
|
result = result .. string.format("%02X",totalPairs) |
||||||
|
|
||||||
|
for ke,_ in pairsByKeys(valueSize) do |
||||||
|
-- print("jade") |
||||||
|
-- print(ke,vl) |
||||||
|
result = result .. hexToLittleEndian(string.format("%04X",ke)) .. hexToLittleEndian(string.format("%04X",valueSize[ke])) .. valueResult[ke] |
||||||
|
end |
||||||
|
return result |
||||||
|
-- local byteArray = {} |
||||||
|
-- for i = 1, #result, 2 do |
||||||
|
-- local hexByte = string.sub(result, i, i + 1) |
||||||
|
-- local decimalValue = tonumber(hexByte, 16) |
||||||
|
-- table.insert(byteArray, decimalValue) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- for _, byte in ipairs(byteArray) do |
||||||
|
-- print(byte) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- -- print("result",byteArray) |
||||||
|
-- return byteArray |
||||||
|
end |
||||||
|
|
||||||
|
-- parseRecord("0001A90AE4650000000001020002000100") |
||||||
|
|
||||||
|
-- local valuess = {} |
||||||
|
-- valuess["0002"] = "0001" |
||||||
|
-- print (valuess["0002"]) |
||||||
|
|
||||||
|
|
||||||
|
-- valuess = {[0002]="-10"} |
||||||
|
-- myTable = {type = "00", version = "01",time = 1709294663000,values = valuess} |
||||||
|
-- print(issueOrder(myTable)) |
||||||
|
-- print(hexToLittleEndian(string.format("%04X",-100))) |
||||||
|
-- print(string.sub(hexToLittleEndian(string.format("%04X",-100)),1,4)) |
||||||
|
-- 示例 |
||||||
|
-- local json_str = '{"name": "John", "age": 30, "city": "New York"}' |
||||||
|
-- local result_table = parse_json(json_str) |
||||||
|
|
||||||
|
-- -- 输出解析结果 |
||||||
|
-- for key, value in pairs(result_table) do |
||||||
|
-- print(key, value) |
||||||
|
-- end |
||||||
|
|
||||||
|
-- values = {} |
||||||
|
-- values[1] = "1" |
||||||
|
-- myTable = {type = "00", version = "01",values = values} |
||||||
|
-- print(issueOrder(myTable)) |
||||||
|
-- function |
||||||
|
-- issueOrder('{"version":"01","type":"00","time":"1709284976000","values":{"1":"1"}}') |
||||||
|
|
||||||
|
-- print("result","0001801a860f0000000004000006000100010001003275060032753375347518790600187919791a79007d0a00007d017d027d037d047d") |
||||||
|
|
||||||
|
-- 0001801a860f00000000043000010001000133000275327533753433100079187919791a5320007d007d017d027d037d04 |
||||||
|
-- 0001801a860f0000000004000006000100010001003275060032753375347518790600187919791a79007d0a00007d017d027d037d047d |
||||||
|
-- local result = parseRecord("000177EEE3650000000001020002000100") |
||||||
|
-- print(result) |
@ -0,0 +1,150 @@ |
|||||||
|
function parseRecord(t) |
||||||
|
local result = {} |
||||||
|
local start = 1 |
||||||
|
local type = hex_to_bytes(t, start, 1) |
||||||
|
--print("type:", type) |
||||||
|
start = start + 2 |
||||||
|
local version = hex_to_bytes(t, start, 1) |
||||||
|
--print("version:", version) |
||||||
|
start = start + 2 |
||||||
|
local time = hex_to_bytes(t, start, 8) |
||||||
|
--print("time:", time) |
||||||
|
start = start + 16 |
||||||
|
local pair = hex_to_bytes(t, start, 1) |
||||||
|
--print("pair:", pair) |
||||||
|
start = start + 2 |
||||||
|
local values = {} |
||||||
|
for i = 1, tonumber(pair, 16) do |
||||||
|
local address = hex_to_bytes(t, start, 2) |
||||||
|
-- print("startAdd:", address) |
||||||
|
start = start + 4 |
||||||
|
local size = hex_to_bytes(t, start, 2) |
||||||
|
--print("size:", size) |
||||||
|
start = start + 4 |
||||||
|
if tonumber(size, 16) / 2 == 0 |
||||||
|
then |
||||||
|
values[address] = "" |
||||||
|
end |
||||||
|
for j = 1, tonumber(size, 16) / 2 do |
||||||
|
--print(address, hex_to_bytes(t, start, 2)) |
||||||
|
values[address] = hex_to_bytes(t, start, 2) |
||||||
|
address = string.gsub(string.format("%04x", tonumber(address, 16) + 1), "0x", "") |
||||||
|
start = start + 4 |
||||||
|
end |
||||||
|
end |
||||||
|
result["type"] = type |
||||||
|
result["version"] = version |
||||||
|
result["time"] = time |
||||||
|
result["pair"] = pair |
||||||
|
result["values"] = values |
||||||
|
-- print(result["type"], result["version"], result["time"], result["pair"]) |
||||||
|
for k,v in pairsByKeys(result["values"]) do |
||||||
|
-- print(k,v) |
||||||
|
end |
||||||
|
-- print(tableToJson(result)) |
||||||
|
return tableToJson(result) |
||||||
|
end |
||||||
|
|
||||||
|
function pairsByKeys(t) |
||||||
|
local a = {} |
||||||
|
for n in pairs(t) do |
||||||
|
a[#a + 1] = n |
||||||
|
end |
||||||
|
table.sort(a) |
||||||
|
local i = 0 |
||||||
|
local iter = function() |
||||||
|
i = i + 1 |
||||||
|
if a[i] == nil |
||||||
|
then |
||||||
|
return nil |
||||||
|
else |
||||||
|
return a[i], t[a[i]] |
||||||
|
end |
||||||
|
end |
||||||
|
return iter |
||||||
|
end |
||||||
|
|
||||||
|
function length(t) |
||||||
|
local res=0 |
||||||
|
for k,v in pairs(t) do |
||||||
|
res=res+1 |
||||||
|
end |
||||||
|
return res |
||||||
|
end |
||||||
|
|
||||||
|
function hex_to_bytes(hex, start, len) |
||||||
|
local value = hex:sub(start, start + len * 2 - 1) |
||||||
|
if len > 1 |
||||||
|
then |
||||||
|
value = toBigEndian(value) |
||||||
|
end |
||||||
|
return value |
||||||
|
end |
||||||
|
|
||||||
|
function toBigEndian(value) |
||||||
|
--print(string.len(value)) |
||||||
|
local hexResult = "" |
||||||
|
for i = string.len(value), 1, -2 do |
||||||
|
local hex = value:sub(i - 1, i) |
||||||
|
hexResult = hexResult .. hex |
||||||
|
end |
||||||
|
return hexResult |
||||||
|
|
||||||
|
|
||||||
|
--local s2 = tonumber(value, 16) |
||||||
|
----print(s2) |
||||||
|
--s2 = string.pack("<i2", s2) |
||||||
|
--local hexResult = "" |
||||||
|
--for i = 1, #s2 do |
||||||
|
-- --local var = string.unpack("B", s2, i) |
||||||
|
-- hexResult = hexResult .. string.format("%x", string.unpack("B", s2, i)) |
||||||
|
-- --print(hexResult) |
||||||
|
--end |
||||||
|
--return hexResult |
||||||
|
end |
||||||
|
|
||||||
|
function tableToJson(tbl) |
||||||
|
local function serializeTable(val, name, indent, depth) |
||||||
|
local tblType = type(val) |
||||||
|
if tblType == "table" then |
||||||
|
local result = {} |
||||||
|
if depth > 0 then |
||||||
|
table.insert(result, "{\n") |
||||||
|
end |
||||||
|
local keys = {} |
||||||
|
for k in pairs(val) do |
||||||
|
table.insert(keys, k) |
||||||
|
end |
||||||
|
table.sort(keys) |
||||||
|
for i, k in ipairs(keys) do |
||||||
|
local v = val[k] |
||||||
|
local key = type(k) == "number" and "" .. k .. "" or '"' .. k .. '"' |
||||||
|
if type(v) == "table" then |
||||||
|
table.insert(result, string.rep(indent, depth + 1) .. key .. " : " .. serializeTable(v, name, indent, depth + 1) .. ",\n") |
||||||
|
else |
||||||
|
if(i == length(keys)) then |
||||||
|
table.insert(result, string.rep(indent, depth + 1) .. key .. " : \"" .. tostring(v) .. "\"\n") |
||||||
|
else |
||||||
|
table.insert(result, string.rep(indent, depth + 1) .. key .. " : \"" .. tostring(v) .. "\",\n") |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
|
if depth > 0 then |
||||||
|
table.insert(result, string.rep(indent, depth) .. "}\n") |
||||||
|
end |
||||||
|
return table.concat(result) |
||||||
|
elseif tblType == "number" then |
||||||
|
return tostring(val) |
||||||
|
elseif tblType == "string" then |
||||||
|
return '"' .. val .. '"' |
||||||
|
else |
||||||
|
return tostring(val) |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
return "{" .. serializeTable(tbl, "root", "", 0) .. "}" |
||||||
|
end |
||||||
|
|
||||||
|
--parse("1Bfjx615uzpncE5GQsHydLQ631y2DmcWRQdnK4XqErRxyo2QSP88cmbhuKbUSnqFixv39kyBXpEewZJ8Uxb8yWVemoCQjQFFta9sxbm64NXYt8yNFB9QgyCLxnHdqcXF5hshzuY9VkGYpWxykgdr8c2TZ1XsjX7bDS35f6YfCfoU4qmQkTCgcZXNMLt7G7dL4aD8szZUHLwVn") |
||||||
|
-- parse("0001801a860f000000000451c30a0051c352c353c354c355c3419c0600419c429c439ca49c4400a49ca59ca69ca79ca89ca99caa9cab9cac9cad9cae9caf9cb09cb19cb29cb39cb49cb59cb69cb79cb89cb99cba9cbb9cbc9cbd9cbe9cbf9cc09cc19cc29cc39cc49cc59c317528003175327533753475357536753775387539753a753b753c753d753e753f7540754175427543754475") |
||||||
|
--toBigEndian("801a860f00000000") |
@ -0,0 +1,38 @@ |
|||||||
|
[ |
||||||
|
{ |
||||||
|
"geometry": { "type": "Point", "coordinates": [102.714601, 25.049153] }, |
||||||
|
"properties": { |
||||||
|
"text": "10001站点" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"geometry": { "type": "Point", "coordinates": [104.067923, 30.679943] }, |
||||||
|
"properties": { |
||||||
|
"text": "10003站点" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"geometry": { "type": "Point", "coordinates": [114.3162, 30.581084] }, |
||||||
|
"properties": { |
||||||
|
"text": "10004站点" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"geometry": { "type": "Point", "coordinates": [113.649644, 34.75661] }, |
||||||
|
"properties": { |
||||||
|
"text": "10005站点" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"geometry": { "type": "Point", "coordinates": [119.330221, 26.047125] }, |
||||||
|
"properties": { |
||||||
|
"text": "10006站点" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"geometry": { "type": "Point", "coordinates": [111.660351, 40.828319] }, |
||||||
|
"properties": { |
||||||
|
"text": "10011站点" |
||||||
|
} |
||||||
|
} |
||||||
|
] |
@ -0,0 +1,117 @@ |
|||||||
|
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(k){var n=0;return function(){return n<k.length?{done:!1,value:k[n++]}:{done:!0}}};$jscomp.arrayIterator=function(k){return{next:$jscomp.arrayIteratorImpl(k)}};$jscomp.makeIterator=function(k){var n="undefined"!=typeof Symbol&&Symbol.iterator&&k[Symbol.iterator];return n?n.call(k):$jscomp.arrayIterator(k)};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1; |
||||||
|
$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.getGlobal=function(k){k=["object"==typeof globalThis&&globalThis,k,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var n=0;n<k.length;++n){var l=k[n];if(l&&l.Math==Math)return l}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this); |
||||||
|
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(k,n,l){if(k==Array.prototype||k==Object.prototype)return k;k[n]=l.value;return k};$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$"; |
||||||
|
var $jscomp$lookupPolyfilledValue=function(k,n){var l=$jscomp.propertyToPolyfillSymbol[n];if(null==l)return k[n];l=k[l];return void 0!==l?l:k[n]};$jscomp.polyfill=function(k,n,l,p){n&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(k,n,l,p):$jscomp.polyfillUnisolated(k,n,l,p))}; |
||||||
|
$jscomp.polyfillUnisolated=function(k,n,l,p){l=$jscomp.global;k=k.split(".");for(p=0;p<k.length-1;p++){var h=k[p];if(!(h in l))return;l=l[h]}k=k[k.length-1];p=l[k];n=n(p);n!=p&&null!=n&&$jscomp.defineProperty(l,k,{configurable:!0,writable:!0,value:n})}; |
||||||
|
$jscomp.polyfillIsolated=function(k,n,l,p){var h=k.split(".");k=1===h.length;p=h[0];p=!k&&p in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var A=0;A<h.length-1;A++){var f=h[A];if(!(f in p))return;p=p[f]}h=h[h.length-1];l=$jscomp.IS_SYMBOL_NATIVE&&"es6"===l?p[h]:null;n=n(l);null!=n&&(k?$jscomp.defineProperty($jscomp.polyfills,h,{configurable:!0,writable:!0,value:n}):n!==l&&(void 0===$jscomp.propertyToPolyfillSymbol[h]&&(l=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[h]=$jscomp.IS_SYMBOL_NATIVE? |
||||||
|
$jscomp.global.Symbol(h):$jscomp.POLYFILL_PREFIX+l+"$"+h),$jscomp.defineProperty(p,$jscomp.propertyToPolyfillSymbol[h],{configurable:!0,writable:!0,value:n})))}; |
||||||
|
$jscomp.polyfill("Promise",function(k){function n(){this.batch_=null}function l(f){return f instanceof h?f:new h(function(q,v){q(f)})}if(k&&(!($jscomp.FORCE_POLYFILL_PROMISE||$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&"undefined"===typeof $jscomp.global.PromiseRejectionEvent)||!$jscomp.global.Promise||-1===$jscomp.global.Promise.toString().indexOf("[native code]")))return k;n.prototype.asyncExecute=function(f){if(null==this.batch_){this.batch_=[];var q=this;this.asyncExecuteFunction(function(){q.executeBatch_()})}this.batch_.push(f)}; |
||||||
|
var p=$jscomp.global.setTimeout;n.prototype.asyncExecuteFunction=function(f){p(f,0)};n.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var f=this.batch_;this.batch_=[];for(var q=0;q<f.length;++q){var v=f[q];f[q]=null;try{v()}catch(z){this.asyncThrow_(z)}}}this.batch_=null};n.prototype.asyncThrow_=function(f){this.asyncExecuteFunction(function(){throw f;})};var h=function(f){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];this.isRejectionHandled_=!1;var q=this.createResolveAndReject_(); |
||||||
|
try{f(q.resolve,q.reject)}catch(v){q.reject(v)}};h.prototype.createResolveAndReject_=function(){function f(z){return function(O){v||(v=!0,z.call(q,O))}}var q=this,v=!1;return{resolve:f(this.resolveTo_),reject:f(this.reject_)}};h.prototype.resolveTo_=function(f){if(f===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(f instanceof h)this.settleSameAsPromise_(f);else{a:switch(typeof f){case "object":var q=null!=f;break a;case "function":q=!0;break a;default:q=!1}q?this.resolveToNonPromiseObj_(f): |
||||||
|
this.fulfill_(f)}};h.prototype.resolveToNonPromiseObj_=function(f){var q=void 0;try{q=f.then}catch(v){this.reject_(v);return}"function"==typeof q?this.settleSameAsThenable_(q,f):this.fulfill_(f)};h.prototype.reject_=function(f){this.settle_(2,f)};h.prototype.fulfill_=function(f){this.settle_(1,f)};h.prototype.settle_=function(f,q){if(0!=this.state_)throw Error("Cannot settle("+f+", "+q+"): Promise already settled in state"+this.state_);this.state_=f;this.result_=q;2===this.state_&&this.scheduleUnhandledRejectionCheck_(); |
||||||
|
this.executeOnSettledCallbacks_()};h.prototype.scheduleUnhandledRejectionCheck_=function(){var f=this;p(function(){if(f.notifyUnhandledRejection_()){var q=$jscomp.global.console;"undefined"!==typeof q&&q.error(f.result_)}},1)};h.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var f=$jscomp.global.CustomEvent,q=$jscomp.global.Event,v=$jscomp.global.dispatchEvent;if("undefined"===typeof v)return!0;"function"===typeof f?f=new f("unhandledrejection",{cancelable:!0}): |
||||||
|
"function"===typeof q?f=new q("unhandledrejection",{cancelable:!0}):(f=$jscomp.global.document.createEvent("CustomEvent"),f.initCustomEvent("unhandledrejection",!1,!0,f));f.promise=this;f.reason=this.result_;return v(f)};h.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var f=0;f<this.onSettledCallbacks_.length;++f)A.asyncExecute(this.onSettledCallbacks_[f]);this.onSettledCallbacks_=null}};var A=new n;h.prototype.settleSameAsPromise_=function(f){var q=this.createResolveAndReject_(); |
||||||
|
f.callWhenSettled_(q.resolve,q.reject)};h.prototype.settleSameAsThenable_=function(f,q){var v=this.createResolveAndReject_();try{f.call(q,v.resolve,v.reject)}catch(z){v.reject(z)}};h.prototype.then=function(f,q){function v(t,x){return"function"==typeof t?function(D){try{z(t(D))}catch(R){O(R)}}:x}var z,O,ba=new h(function(t,x){z=t;O=x});this.callWhenSettled_(v(f,z),v(q,O));return ba};h.prototype.catch=function(f){return this.then(void 0,f)};h.prototype.callWhenSettled_=function(f,q){function v(){switch(z.state_){case 1:f(z.result_); |
||||||
|
break;case 2:q(z.result_);break;default:throw Error("Unexpected state: "+z.state_);}}var z=this;null==this.onSettledCallbacks_?A.asyncExecute(v):this.onSettledCallbacks_.push(v);this.isRejectionHandled_=!0};h.resolve=l;h.reject=function(f){return new h(function(q,v){v(f)})};h.race=function(f){return new h(function(q,v){for(var z=$jscomp.makeIterator(f),O=z.next();!O.done;O=z.next())l(O.value).callWhenSettled_(q,v)})};h.all=function(f){var q=$jscomp.makeIterator(f),v=q.next();return v.done?l([]):new h(function(z, |
||||||
|
O){function ba(D){return function(R){t[D]=R;x--;0==x&&z(t)}}var t=[],x=0;do t.push(void 0),x++,l(v.value).callWhenSettled_(ba(t.length-1),O),v=q.next();while(!v.done)})};return h},"es6","es3");$jscomp.owns=function(k,n){return Object.prototype.hasOwnProperty.call(k,n)};$jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(k,n){for(var l=1;l<arguments.length;l++){var p=arguments[l];if(p)for(var h in p)$jscomp.owns(p,h)&&(k[h]=p[h])}return k}; |
||||||
|
$jscomp.polyfill("Object.assign",function(k){return k||$jscomp.assign},"es6","es3");$jscomp.checkStringArgs=function(k,n,l){if(null==k)throw new TypeError("The 'this' value for String.prototype."+l+" must not be null or undefined");if(n instanceof RegExp)throw new TypeError("First argument to String.prototype."+l+" must not be a regular expression");return k+""}; |
||||||
|
$jscomp.polyfill("String.prototype.startsWith",function(k){return k?k:function(n,l){var p=$jscomp.checkStringArgs(this,n,"startsWith");n+="";var h=p.length,A=n.length;l=Math.max(0,Math.min(l|0,p.length));for(var f=0;f<A&&l<h;)if(p[l++]!=n[f++])return!1;return f>=A}},"es6","es3"); |
||||||
|
$jscomp.polyfill("Array.prototype.copyWithin",function(k){function n(l){l=Number(l);return Infinity===l||-Infinity===l?l:l|0}return k?k:function(l,p,h){var A=this.length;l=n(l);p=n(p);h=void 0===h?A:n(h);l=0>l?Math.max(A+l,0):Math.min(l,A);p=0>p?Math.max(A+p,0):Math.min(p,A);h=0>h?Math.max(A+h,0):Math.min(h,A);if(l<p)for(;p<h;)p in this?this[l++]=this[p++]:(delete this[l++],p++);else for(h=Math.min(h,A+p-l),l+=h-p;h>p;)--h in this?this[--l]=this[h]:delete this[--l];return this}},"es6","es3"); |
||||||
|
$jscomp.typedArrayCopyWithin=function(k){return k?k:Array.prototype.copyWithin};$jscomp.polyfill("Int8Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");$jscomp.polyfill("Uint8Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");$jscomp.polyfill("Uint8ClampedArray.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");$jscomp.polyfill("Int16Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"); |
||||||
|
$jscomp.polyfill("Uint16Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");$jscomp.polyfill("Int32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");$jscomp.polyfill("Uint32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");$jscomp.polyfill("Float32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");$jscomp.polyfill("Float64Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"); |
||||||
|
var DracoDecoderModule=function(){var k="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;"undefined"!==typeof __filename&&(k=k||__filename);return function(n){function l(e){return a.locateFile?a.locateFile(e,U):U+e}function p(e,b,c){var d=b+c;for(c=b;e[c]&&!(c>=d);)++c;if(16<c-b&&e.buffer&&va)return va.decode(e.subarray(b,c));for(d="";b<c;){var g=e[b++];if(g&128){var u=e[b++]&63;if(192==(g&224))d+=String.fromCharCode((g&31)<<6|u);else{var X=e[b++]&63;g=224== |
||||||
|
(g&240)?(g&15)<<12|u<<6|X:(g&7)<<18|u<<12|X<<6|e[b++]&63;65536>g?d+=String.fromCharCode(g):(g-=65536,d+=String.fromCharCode(55296|g>>10,56320|g&1023))}}else d+=String.fromCharCode(g)}return d}function h(e,b){return e?p(ea,e,b):""}function A(){var e=ja.buffer;a.HEAP8=Y=new Int8Array(e);a.HEAP16=new Int16Array(e);a.HEAP32=ca=new Int32Array(e);a.HEAPU8=ea=new Uint8Array(e);a.HEAPU16=new Uint16Array(e);a.HEAPU32=V=new Uint32Array(e);a.HEAPF32=new Float32Array(e);a.HEAPF64=new Float64Array(e)}function f(e){if(a.onAbort)a.onAbort(e); |
||||||
|
e="Aborted("+e+")";da(e);wa=!0;e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info.");ka(e);throw e;}function q(e){try{if(e==P&&fa)return new Uint8Array(fa);if(ma)return ma(e);throw"both async and sync fetching of the wasm failed";}catch(b){f(b)}}function v(){if(!fa&&(xa||ha)){if("function"==typeof fetch&&!P.startsWith("file://"))return fetch(P,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+P+"'";return e.arrayBuffer()}).catch(function(){return q(P)}); |
||||||
|
if(na)return new Promise(function(e,b){na(P,function(c){e(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return q(P)})}function z(e){for(;0<e.length;)e.shift()(a)}function O(e){this.excPtr=e;this.ptr=e-24;this.set_type=function(b){V[this.ptr+4>>2]=b};this.get_type=function(){return V[this.ptr+4>>2]};this.set_destructor=function(b){V[this.ptr+8>>2]=b};this.get_destructor=function(){return V[this.ptr+8>>2]};this.set_refcount=function(b){ca[this.ptr>>2]=b};this.set_caught=function(b){Y[this.ptr+ |
||||||
|
12>>0]=b?1:0};this.get_caught=function(){return 0!=Y[this.ptr+12>>0]};this.set_rethrown=function(b){Y[this.ptr+13>>0]=b?1:0};this.get_rethrown=function(){return 0!=Y[this.ptr+13>>0]};this.init=function(b,c){this.set_adjusted_ptr(0);this.set_type(b);this.set_destructor(c);this.set_refcount(0);this.set_caught(!1);this.set_rethrown(!1)};this.add_ref=function(){ca[this.ptr>>2]+=1};this.release_ref=function(){var b=ca[this.ptr>>2];ca[this.ptr>>2]=b-1;return 1===b};this.set_adjusted_ptr=function(b){V[this.ptr+ |
||||||
|
16>>2]=b};this.get_adjusted_ptr=function(){return V[this.ptr+16>>2]};this.get_exception_ptr=function(){if(ya(this.get_type()))return V[this.excPtr>>2];var b=this.get_adjusted_ptr();return 0!==b?b:this.excPtr}}function ba(){function e(){if(!la&&(la=!0,a.calledRun=!0,!wa)){za=!0;z(oa);Aa(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ba.unshift(a.postRun.shift());z(Ba)}}if(!(0<aa)){if(a.preRun)for("function"== |
||||||
|
typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Ca.unshift(a.preRun.shift());z(Ca);0<aa||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);e()},1)):e())}}function t(){}function x(e){return(e||t).__cache__}function D(e,b){var c=x(b),d=c[e];if(d)return d;d=Object.create((b||t).prototype);d.ptr=e;return c[e]=d}function R(e){if("string"===typeof e){for(var b=0,c=0;c<e.length;++c){var d=e.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>= |
||||||
|
d?(b+=4,++c):b+=3}b=Array(b+1);c=0;d=b.length;if(0<d){d=c+d-1;for(var g=0;g<e.length;++g){var u=e.charCodeAt(g);if(55296<=u&&57343>=u){var X=e.charCodeAt(++g);u=65536+((u&1023)<<10)|X&1023}if(127>=u){if(c>=d)break;b[c++]=u}else{if(2047>=u){if(c+1>=d)break;b[c++]=192|u>>6}else{if(65535>=u){if(c+2>=d)break;b[c++]=224|u>>12}else{if(c+3>=d)break;b[c++]=240|u>>18;b[c++]=128|u>>12&63}b[c++]=128|u>>6&63}b[c++]=128|u&63}}b[c]=0}e=r.alloc(b,Y);r.copy(b,Y,e);return e}return e}function pa(e){if("object"===typeof e){var b= |
||||||
|
r.alloc(e,Y);r.copy(e,Y,b);return b}return e}function Z(){throw"cannot construct a VoidPtr, no constructor in IDL";}function S(){this.ptr=Da();x(S)[this.ptr]=this}function Q(){this.ptr=Ea();x(Q)[this.ptr]=this}function W(){this.ptr=Fa();x(W)[this.ptr]=this}function w(){this.ptr=Ga();x(w)[this.ptr]=this}function C(){this.ptr=Ha();x(C)[this.ptr]=this}function F(){this.ptr=Ia();x(F)[this.ptr]=this}function G(){this.ptr=Ja();x(G)[this.ptr]=this}function E(){this.ptr=Ka();x(E)[this.ptr]=this}function T(){this.ptr= |
||||||
|
La();x(T)[this.ptr]=this}function B(){throw"cannot construct a Status, no constructor in IDL";}function H(){this.ptr=Ma();x(H)[this.ptr]=this}function I(){this.ptr=Na();x(I)[this.ptr]=this}function J(){this.ptr=Oa();x(J)[this.ptr]=this}function K(){this.ptr=Pa();x(K)[this.ptr]=this}function L(){this.ptr=Qa();x(L)[this.ptr]=this}function M(){this.ptr=Ra();x(M)[this.ptr]=this}function N(){this.ptr=Sa();x(N)[this.ptr]=this}function y(){this.ptr=Ta();x(y)[this.ptr]=this}function m(){this.ptr=Ua();x(m)[this.ptr]= |
||||||
|
this}n=void 0===n?{}:n;var a="undefined"!=typeof n?n:{},Aa,ka;a.ready=new Promise(function(e,b){Aa=e;ka=b});var Va=!1,Wa=!1;a.onRuntimeInitialized=function(){Va=!0;if(Wa&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Wa=!0;if(Va&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(e){if("string"!==typeof e)return!1;e=e.split(".");return 2>e.length||3<e.length?!1:1==e[0]&&0<=e[1]&&5>=e[1]?!0:0!=e[0]||10<e[1]?!1:!0};var Xa= |
||||||
|
Object.assign({},a),xa="object"==typeof window,ha="function"==typeof importScripts,Ya="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,U="";if(Ya){var Za=require("fs"),qa=require("path");U=ha?qa.dirname(U)+"/":__dirname+"/";var $a=function(e,b){e=e.startsWith("file://")?new URL(e):qa.normalize(e);return Za.readFileSync(e,b?void 0:"utf8")};var ma=function(e){e=$a(e,!0);e.buffer||(e=new Uint8Array(e));return e};var na=function(e,b,c){e=e.startsWith("file://")? |
||||||
|
new URL(e):qa.normalize(e);Za.readFile(e,function(d,g){d?c(d):b(g.buffer)})};1<process.argv.length&&process.argv[1].replace(/\\/g,"/");process.argv.slice(2);a.inspect=function(){return"[Emscripten Module object]"}}else if(xa||ha)ha?U=self.location.href:"undefined"!=typeof document&&document.currentScript&&(U=document.currentScript.src),k&&(U=k),U=0!==U.indexOf("blob:")?U.substr(0,U.replace(/[?#].*/,"").lastIndexOf("/")+1):"",$a=function(e){var b=new XMLHttpRequest;b.open("GET",e,!1);b.send(null); |
||||||
|
return b.responseText},ha&&(ma=function(e){var b=new XMLHttpRequest;b.open("GET",e,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),na=function(e,b,c){var d=new XMLHttpRequest;d.open("GET",e,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?b(d.response):c()};d.onerror=c;d.send(null)};var ud=a.print||console.log.bind(console),da=a.printErr||console.warn.bind(console);Object.assign(a,Xa);Xa=null;var fa;a.wasmBinary&&(fa=a.wasmBinary); |
||||||
|
"object"!=typeof WebAssembly&&f("no native wasm support detected");var ja,wa=!1,va="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,Y,ea,ca,V,Ca=[],oa=[],Ba=[],za=!1,aa=0,ra=null,ia=null;var P="draco_decoder.wasm";P.startsWith("data:application/octet-stream;base64,")||(P=l(P));var vd=0,wd=[null,[],[]],xd={b:function(e,b,c){(new O(e)).init(b,c);vd++;throw e;},a:function(){f("")},g:function(e,b,c){ea.copyWithin(e,b,b+c)},e:function(e){var b=ea.length;e>>>=0;if(2147483648<e)return!1;for(var c= |
||||||
|
1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,e+100663296);var g=Math;d=Math.max(e,d);g=g.min.call(g,2147483648,d+(65536-d%65536)%65536);a:{d=ja.buffer;try{ja.grow(g-d.byteLength+65535>>>16);A();var u=1;break a}catch(X){}u=void 0}if(u)return!0}return!1},f:function(e){return 52},d:function(e,b,c,d,g){return 70},c:function(e,b,c,d){for(var g=0,u=0;u<c;u++){var X=V[b>>2],ab=V[b+4>>2];b+=8;for(var sa=0;sa<ab;sa++){var ta=ea[X+sa],ua=wd[e];0===ta||10===ta?((1===e?ud:da)(p(ua,0)),ua.length=0):ua.push(ta)}g+= |
||||||
|
ab}V[d>>2]=g;return 0}};(function(){function e(g,u){a.asm=g.exports;ja=a.asm.h;A();oa.unshift(a.asm.i);aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==ra&&(clearInterval(ra),ra=null),ia&&(g=ia,ia=null,g()))}function b(g){e(g.instance)}function c(g){return v().then(function(u){return WebAssembly.instantiate(u,d)}).then(function(u){return u}).then(g,function(u){da("failed to asynchronously prepare wasm: "+u);f(u)})}var d={a:xd};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa); |
||||||
|
if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(g){da("Module.instantiateWasm callback failed with error: "+g),ka(g)}(function(){return fa||"function"!=typeof WebAssembly.instantiateStreaming||P.startsWith("data:application/octet-stream;base64,")||P.startsWith("file://")||Ya||"function"!=typeof fetch?c(b):fetch(P,{credentials:"same-origin"}).then(function(g){return WebAssembly.instantiateStreaming(g,d).then(b,function(u){da("wasm streaming compile failed: "+u);da("falling back to ArrayBuffer instantiation"); |
||||||
|
return c(b)})})})().catch(ka);return{}})();var bb=a._emscripten_bind_VoidPtr___destroy___0=function(){return(bb=a._emscripten_bind_VoidPtr___destroy___0=a.asm.k).apply(null,arguments)},Da=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return(Da=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=a.asm.l).apply(null,arguments)},cb=a._emscripten_bind_DecoderBuffer_Init_2=function(){return(cb=a._emscripten_bind_DecoderBuffer_Init_2=a.asm.m).apply(null,arguments)},db=a._emscripten_bind_DecoderBuffer___destroy___0= |
||||||
|
function(){return(db=a._emscripten_bind_DecoderBuffer___destroy___0=a.asm.n).apply(null,arguments)},Ea=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return(Ea=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0=a.asm.o).apply(null,arguments)},eb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return(eb=a._emscripten_bind_AttributeTransformData_transform_type_0=a.asm.p).apply(null,arguments)},fb=a._emscripten_bind_AttributeTransformData___destroy___0= |
||||||
|
function(){return(fb=a._emscripten_bind_AttributeTransformData___destroy___0=a.asm.q).apply(null,arguments)},Fa=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return(Fa=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=a.asm.r).apply(null,arguments)},gb=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return(gb=a._emscripten_bind_GeometryAttribute___destroy___0=a.asm.s).apply(null,arguments)},Ga=a._emscripten_bind_PointAttribute_PointAttribute_0=function(){return(Ga= |
||||||
|
a._emscripten_bind_PointAttribute_PointAttribute_0=a.asm.t).apply(null,arguments)},hb=a._emscripten_bind_PointAttribute_size_0=function(){return(hb=a._emscripten_bind_PointAttribute_size_0=a.asm.u).apply(null,arguments)},ib=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return(ib=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=a.asm.v).apply(null,arguments)},jb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return(jb=a._emscripten_bind_PointAttribute_attribute_type_0= |
||||||
|
a.asm.w).apply(null,arguments)},kb=a._emscripten_bind_PointAttribute_data_type_0=function(){return(kb=a._emscripten_bind_PointAttribute_data_type_0=a.asm.x).apply(null,arguments)},lb=a._emscripten_bind_PointAttribute_num_components_0=function(){return(lb=a._emscripten_bind_PointAttribute_num_components_0=a.asm.y).apply(null,arguments)},mb=a._emscripten_bind_PointAttribute_normalized_0=function(){return(mb=a._emscripten_bind_PointAttribute_normalized_0=a.asm.z).apply(null,arguments)},nb=a._emscripten_bind_PointAttribute_byte_stride_0= |
||||||
|
function(){return(nb=a._emscripten_bind_PointAttribute_byte_stride_0=a.asm.A).apply(null,arguments)},ob=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return(ob=a._emscripten_bind_PointAttribute_byte_offset_0=a.asm.B).apply(null,arguments)},pb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return(pb=a._emscripten_bind_PointAttribute_unique_id_0=a.asm.C).apply(null,arguments)},qb=a._emscripten_bind_PointAttribute___destroy___0=function(){return(qb=a._emscripten_bind_PointAttribute___destroy___0= |
||||||
|
a.asm.D).apply(null,arguments)},Ha=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return(Ha=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=a.asm.E).apply(null,arguments)},rb=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return(rb=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=a.asm.F).apply(null,arguments)},sb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0= |
||||||
|
function(){return(sb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=a.asm.G).apply(null,arguments)},tb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return(tb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=a.asm.H).apply(null,arguments)},ub=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return(ub=a._emscripten_bind_AttributeQuantizationTransform_range_0=a.asm.I).apply(null,arguments)},vb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0= |
||||||
|
function(){return(vb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=a.asm.J).apply(null,arguments)},Ia=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return(Ia=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=a.asm.K).apply(null,arguments)},wb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return(wb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=a.asm.L).apply(null, |
||||||
|
arguments)},xb=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return(xb=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=a.asm.M).apply(null,arguments)},yb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return(yb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=a.asm.N).apply(null,arguments)},Ja=a._emscripten_bind_PointCloud_PointCloud_0=function(){return(Ja=a._emscripten_bind_PointCloud_PointCloud_0=a.asm.O).apply(null, |
||||||
|
arguments)},zb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return(zb=a._emscripten_bind_PointCloud_num_attributes_0=a.asm.P).apply(null,arguments)},Ab=a._emscripten_bind_PointCloud_num_points_0=function(){return(Ab=a._emscripten_bind_PointCloud_num_points_0=a.asm.Q).apply(null,arguments)},Bb=a._emscripten_bind_PointCloud___destroy___0=function(){return(Bb=a._emscripten_bind_PointCloud___destroy___0=a.asm.R).apply(null,arguments)},Ka=a._emscripten_bind_Mesh_Mesh_0=function(){return(Ka= |
||||||
|
a._emscripten_bind_Mesh_Mesh_0=a.asm.S).apply(null,arguments)},Cb=a._emscripten_bind_Mesh_num_faces_0=function(){return(Cb=a._emscripten_bind_Mesh_num_faces_0=a.asm.T).apply(null,arguments)},Db=a._emscripten_bind_Mesh_num_attributes_0=function(){return(Db=a._emscripten_bind_Mesh_num_attributes_0=a.asm.U).apply(null,arguments)},Eb=a._emscripten_bind_Mesh_num_points_0=function(){return(Eb=a._emscripten_bind_Mesh_num_points_0=a.asm.V).apply(null,arguments)},Fb=a._emscripten_bind_Mesh___destroy___0=function(){return(Fb= |
||||||
|
a._emscripten_bind_Mesh___destroy___0=a.asm.W).apply(null,arguments)},La=a._emscripten_bind_Metadata_Metadata_0=function(){return(La=a._emscripten_bind_Metadata_Metadata_0=a.asm.X).apply(null,arguments)},Gb=a._emscripten_bind_Metadata___destroy___0=function(){return(Gb=a._emscripten_bind_Metadata___destroy___0=a.asm.Y).apply(null,arguments)},Hb=a._emscripten_bind_Status_code_0=function(){return(Hb=a._emscripten_bind_Status_code_0=a.asm.Z).apply(null,arguments)},Ib=a._emscripten_bind_Status_ok_0=function(){return(Ib= |
||||||
|
a._emscripten_bind_Status_ok_0=a.asm._).apply(null,arguments)},Jb=a._emscripten_bind_Status_error_msg_0=function(){return(Jb=a._emscripten_bind_Status_error_msg_0=a.asm.$).apply(null,arguments)},Kb=a._emscripten_bind_Status___destroy___0=function(){return(Kb=a._emscripten_bind_Status___destroy___0=a.asm.aa).apply(null,arguments)},Ma=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return(Ma=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=a.asm.ba).apply(null,arguments)}, |
||||||
|
Lb=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return(Lb=a._emscripten_bind_DracoFloat32Array_GetValue_1=a.asm.ca).apply(null,arguments)},Mb=a._emscripten_bind_DracoFloat32Array_size_0=function(){return(Mb=a._emscripten_bind_DracoFloat32Array_size_0=a.asm.da).apply(null,arguments)},Nb=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return(Nb=a._emscripten_bind_DracoFloat32Array___destroy___0=a.asm.ea).apply(null,arguments)},Na=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0= |
||||||
|
function(){return(Na=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=a.asm.fa).apply(null,arguments)},Ob=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return(Ob=a._emscripten_bind_DracoInt8Array_GetValue_1=a.asm.ga).apply(null,arguments)},Pb=a._emscripten_bind_DracoInt8Array_size_0=function(){return(Pb=a._emscripten_bind_DracoInt8Array_size_0=a.asm.ha).apply(null,arguments)},Qb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return(Qb=a._emscripten_bind_DracoInt8Array___destroy___0= |
||||||
|
a.asm.ia).apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return(Oa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=a.asm.ja).apply(null,arguments)},Rb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return(Rb=a._emscripten_bind_DracoUInt8Array_GetValue_1=a.asm.ka).apply(null,arguments)},Sb=a._emscripten_bind_DracoUInt8Array_size_0=function(){return(Sb=a._emscripten_bind_DracoUInt8Array_size_0=a.asm.la).apply(null,arguments)},Tb=a._emscripten_bind_DracoUInt8Array___destroy___0= |
||||||
|
function(){return(Tb=a._emscripten_bind_DracoUInt8Array___destroy___0=a.asm.ma).apply(null,arguments)},Pa=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return(Pa=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=a.asm.na).apply(null,arguments)},Ub=a._emscripten_bind_DracoInt16Array_GetValue_1=function(){return(Ub=a._emscripten_bind_DracoInt16Array_GetValue_1=a.asm.oa).apply(null,arguments)},Vb=a._emscripten_bind_DracoInt16Array_size_0=function(){return(Vb=a._emscripten_bind_DracoInt16Array_size_0= |
||||||
|
a.asm.pa).apply(null,arguments)},Wb=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return(Wb=a._emscripten_bind_DracoInt16Array___destroy___0=a.asm.qa).apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return(Qa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=a.asm.ra).apply(null,arguments)},Xb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return(Xb=a._emscripten_bind_DracoUInt16Array_GetValue_1=a.asm.sa).apply(null,arguments)}, |
||||||
|
Yb=a._emscripten_bind_DracoUInt16Array_size_0=function(){return(Yb=a._emscripten_bind_DracoUInt16Array_size_0=a.asm.ta).apply(null,arguments)},Zb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return(Zb=a._emscripten_bind_DracoUInt16Array___destroy___0=a.asm.ua).apply(null,arguments)},Ra=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return(Ra=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=a.asm.va).apply(null,arguments)},$b=a._emscripten_bind_DracoInt32Array_GetValue_1= |
||||||
|
function(){return($b=a._emscripten_bind_DracoInt32Array_GetValue_1=a.asm.wa).apply(null,arguments)},ac=a._emscripten_bind_DracoInt32Array_size_0=function(){return(ac=a._emscripten_bind_DracoInt32Array_size_0=a.asm.xa).apply(null,arguments)},bc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return(bc=a._emscripten_bind_DracoInt32Array___destroy___0=a.asm.ya).apply(null,arguments)},Sa=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return(Sa=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0= |
||||||
|
a.asm.za).apply(null,arguments)},cc=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return(cc=a._emscripten_bind_DracoUInt32Array_GetValue_1=a.asm.Aa).apply(null,arguments)},dc=a._emscripten_bind_DracoUInt32Array_size_0=function(){return(dc=a._emscripten_bind_DracoUInt32Array_size_0=a.asm.Ba).apply(null,arguments)},ec=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return(ec=a._emscripten_bind_DracoUInt32Array___destroy___0=a.asm.Ca).apply(null,arguments)},Ta=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0= |
||||||
|
function(){return(Ta=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=a.asm.Da).apply(null,arguments)},fc=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return(fc=a._emscripten_bind_MetadataQuerier_HasEntry_2=a.asm.Ea).apply(null,arguments)},gc=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return(gc=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=a.asm.Fa).apply(null,arguments)},hc=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return(hc=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3= |
||||||
|
a.asm.Ga).apply(null,arguments)},ic=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return(ic=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=a.asm.Ha).apply(null,arguments)},jc=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return(jc=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=a.asm.Ia).apply(null,arguments)},kc=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return(kc=a._emscripten_bind_MetadataQuerier_NumEntries_1=a.asm.Ja).apply(null,arguments)}, |
||||||
|
lc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return(lc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=a.asm.Ka).apply(null,arguments)},mc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return(mc=a._emscripten_bind_MetadataQuerier___destroy___0=a.asm.La).apply(null,arguments)},Ua=a._emscripten_bind_Decoder_Decoder_0=function(){return(Ua=a._emscripten_bind_Decoder_Decoder_0=a.asm.Ma).apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=function(){return(nc= |
||||||
|
a._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=a.asm.Na).apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeArrayToMesh_3=function(){return(oc=a._emscripten_bind_Decoder_DecodeArrayToMesh_3=a.asm.Oa).apply(null,arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return(pc=a._emscripten_bind_Decoder_GetAttributeId_2=a.asm.Pa).apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return(qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2= |
||||||
|
a.asm.Qa).apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return(rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=a.asm.Ra).apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2=function(){return(sc=a._emscripten_bind_Decoder_GetAttribute_2=a.asm.Sa).apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return(tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=a.asm.Ta).apply(null,arguments)}, |
||||||
|
uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return(uc=a._emscripten_bind_Decoder_GetMetadata_1=a.asm.Ua).apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return(vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=a.asm.Va).apply(null,arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return(wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=a.asm.Wa).apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2= |
||||||
|
function(){return(xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=a.asm.Xa).apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return(yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=a.asm.Ya).apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return(zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=a.asm.Za).apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return(Ac= |
||||||
|
a._emscripten_bind_Decoder_GetAttributeFloat_3=a.asm._a).apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return(Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=a.asm.$a).apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return(Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=a.asm.ab).apply(null,arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return(Dc= |
||||||
|
a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=a.asm.bb).apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return(Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=a.asm.cb).apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return(Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=a.asm.db).apply(null,arguments)},Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3= |
||||||
|
function(){return(Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=a.asm.eb).apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return(Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=a.asm.fb).apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return(Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=a.asm.gb).apply(null,arguments)},Jc=a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5= |
||||||
|
function(){return(Jc=a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=a.asm.hb).apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return(Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=a.asm.ib).apply(null,arguments)},Lc=a._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=function(){return(Lc=a._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=a.asm.jb).apply(null,arguments)},Mc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2= |
||||||
|
function(){return(Mc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=a.asm.kb).apply(null,arguments)},Nc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return(Nc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=a.asm.lb).apply(null,arguments)},Oc=a._emscripten_bind_Decoder___destroy___0=function(){return(Oc=a._emscripten_bind_Decoder___destroy___0=a.asm.mb).apply(null,arguments)},Pc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return(Pc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM= |
||||||
|
a.asm.nb).apply(null,arguments)},Qc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return(Qc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=a.asm.ob).apply(null,arguments)},Rc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return(Rc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=a.asm.pb).apply(null,arguments)},Sc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM= |
||||||
|
function(){return(Sc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=a.asm.qb).apply(null,arguments)},Tc=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return(Tc=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=a.asm.rb).apply(null,arguments)},Uc=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return(Uc=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=a.asm.sb).apply(null,arguments)},Vc=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL= |
||||||
|
function(){return(Vc=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=a.asm.tb).apply(null,arguments)},Wc=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return(Wc=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=a.asm.ub).apply(null,arguments)},Xc=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return(Xc=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=a.asm.vb).apply(null,arguments)},Yc=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC= |
||||||
|
function(){return(Yc=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=a.asm.wb).apply(null,arguments)},Zc=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return(Zc=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=a.asm.xb).apply(null,arguments)},$c=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return($c=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=a.asm.yb).apply(null,arguments)},ad=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH= |
||||||
|
function(){return(ad=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=a.asm.zb).apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return(bd=a._emscripten_enum_draco_DataType_DT_INVALID=a.asm.Ab).apply(null,arguments)},cd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return(cd=a._emscripten_enum_draco_DataType_DT_INT8=a.asm.Bb).apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return(dd=a._emscripten_enum_draco_DataType_DT_UINT8= |
||||||
|
a.asm.Cb).apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_INT16=function(){return(ed=a._emscripten_enum_draco_DataType_DT_INT16=a.asm.Db).apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return(fd=a._emscripten_enum_draco_DataType_DT_UINT16=a.asm.Eb).apply(null,arguments)},gd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return(gd=a._emscripten_enum_draco_DataType_DT_INT32=a.asm.Fb).apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_UINT32= |
||||||
|
function(){return(hd=a._emscripten_enum_draco_DataType_DT_UINT32=a.asm.Gb).apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_INT64=function(){return(id=a._emscripten_enum_draco_DataType_DT_INT64=a.asm.Hb).apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return(jd=a._emscripten_enum_draco_DataType_DT_UINT64=a.asm.Ib).apply(null,arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return(kd=a._emscripten_enum_draco_DataType_DT_FLOAT32=a.asm.Jb).apply(null, |
||||||
|
arguments)},ld=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return(ld=a._emscripten_enum_draco_DataType_DT_FLOAT64=a.asm.Kb).apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return(md=a._emscripten_enum_draco_DataType_DT_BOOL=a.asm.Lb).apply(null,arguments)},nd=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return(nd=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=a.asm.Mb).apply(null,arguments)},od=a._emscripten_enum_draco_StatusCode_OK=function(){return(od= |
||||||
|
a._emscripten_enum_draco_StatusCode_OK=a.asm.Nb).apply(null,arguments)},pd=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return(pd=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=a.asm.Ob).apply(null,arguments)},qd=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return(qd=a._emscripten_enum_draco_StatusCode_IO_ERROR=a.asm.Pb).apply(null,arguments)},rd=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return(rd=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER= |
||||||
|
a.asm.Qb).apply(null,arguments)},sd=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return(sd=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=a.asm.Rb).apply(null,arguments)},td=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return(td=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=a.asm.Sb).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.Tb).apply(null,arguments)};a._free=function(){return(a._free=a.asm.Ub).apply(null,arguments)}; |
||||||
|
var ya=function(){return(ya=a.asm.Vb).apply(null,arguments)};a.___start_em_js=15856;a.___stop_em_js=15954;var la;ia=function b(){la||ba();la||(ia=b)};if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ba();t.prototype=Object.create(t.prototype);t.prototype.constructor=t;t.prototype.__class__=t;t.__cache__={};a.WrapperObject=t;a.getCache=x;a.wrapPointer=D;a.castObject=function(b,c){return D(b.ptr,c)};a.NULL=D(0);a.destroy=function(b){if(!b.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)"; |
||||||
|
b.__destroy__();delete x(b.__class__)[b.ptr]};a.compare=function(b,c){return b.ptr===c.ptr};a.getPointer=function(b){return b.ptr};a.getClass=function(b){return b.__class__};var r={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(r.needed){for(var b=0;b<r.temps.length;b++)a._free(r.temps[b]);r.temps.length=0;a._free(r.buffer);r.buffer=0;r.size+=r.needed;r.needed=0}r.buffer||(r.size+=128,r.buffer=a._malloc(r.size),r.buffer||f(void 0));r.pos=0},alloc:function(b,c){r.buffer||f(void 0);b= |
||||||
|
b.length*c.BYTES_PER_ELEMENT;b=b+7&-8;r.pos+b>=r.size?(0<b||f(void 0),r.needed+=b,c=a._malloc(b),r.temps.push(c)):(c=r.buffer+r.pos,r.pos+=b);return c},copy:function(b,c,d){d>>>=0;switch(c.BYTES_PER_ELEMENT){case 2:d>>>=1;break;case 4:d>>>=2;break;case 8:d>>>=3}for(var g=0;g<b.length;g++)c[d+g]=b[g]}};Z.prototype=Object.create(t.prototype);Z.prototype.constructor=Z;Z.prototype.__class__=Z;Z.__cache__={};a.VoidPtr=Z;Z.prototype.__destroy__=Z.prototype.__destroy__=function(){bb(this.ptr)};S.prototype= |
||||||
|
Object.create(t.prototype);S.prototype.constructor=S;S.prototype.__class__=S;S.__cache__={};a.DecoderBuffer=S;S.prototype.Init=S.prototype.Init=function(b,c){var d=this.ptr;r.prepare();"object"==typeof b&&(b=pa(b));c&&"object"===typeof c&&(c=c.ptr);cb(d,b,c)};S.prototype.__destroy__=S.prototype.__destroy__=function(){db(this.ptr)};Q.prototype=Object.create(t.prototype);Q.prototype.constructor=Q;Q.prototype.__class__=Q;Q.__cache__={};a.AttributeTransformData=Q;Q.prototype.transform_type=Q.prototype.transform_type= |
||||||
|
function(){return eb(this.ptr)};Q.prototype.__destroy__=Q.prototype.__destroy__=function(){fb(this.ptr)};W.prototype=Object.create(t.prototype);W.prototype.constructor=W;W.prototype.__class__=W;W.__cache__={};a.GeometryAttribute=W;W.prototype.__destroy__=W.prototype.__destroy__=function(){gb(this.ptr)};w.prototype=Object.create(t.prototype);w.prototype.constructor=w;w.prototype.__class__=w;w.__cache__={};a.PointAttribute=w;w.prototype.size=w.prototype.size=function(){return hb(this.ptr)};w.prototype.GetAttributeTransformData= |
||||||
|
w.prototype.GetAttributeTransformData=function(){return D(ib(this.ptr),Q)};w.prototype.attribute_type=w.prototype.attribute_type=function(){return jb(this.ptr)};w.prototype.data_type=w.prototype.data_type=function(){return kb(this.ptr)};w.prototype.num_components=w.prototype.num_components=function(){return lb(this.ptr)};w.prototype.normalized=w.prototype.normalized=function(){return!!mb(this.ptr)};w.prototype.byte_stride=w.prototype.byte_stride=function(){return nb(this.ptr)};w.prototype.byte_offset= |
||||||
|
w.prototype.byte_offset=function(){return ob(this.ptr)};w.prototype.unique_id=w.prototype.unique_id=function(){return pb(this.ptr)};w.prototype.__destroy__=w.prototype.__destroy__=function(){qb(this.ptr)};C.prototype=Object.create(t.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.AttributeQuantizationTransform=C;C.prototype.InitFromAttribute=C.prototype.InitFromAttribute=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return!!rb(c,b)};C.prototype.quantization_bits= |
||||||
|
C.prototype.quantization_bits=function(){return sb(this.ptr)};C.prototype.min_value=C.prototype.min_value=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return tb(c,b)};C.prototype.range=C.prototype.range=function(){return ub(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){vb(this.ptr)};F.prototype=Object.create(t.prototype);F.prototype.constructor=F;F.prototype.__class__=F;F.__cache__={};a.AttributeOctahedronTransform=F;F.prototype.InitFromAttribute=F.prototype.InitFromAttribute= |
||||||
|
function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return!!wb(c,b)};F.prototype.quantization_bits=F.prototype.quantization_bits=function(){return xb(this.ptr)};F.prototype.__destroy__=F.prototype.__destroy__=function(){yb(this.ptr)};G.prototype=Object.create(t.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.PointCloud=G;G.prototype.num_attributes=G.prototype.num_attributes=function(){return zb(this.ptr)};G.prototype.num_points=G.prototype.num_points=function(){return Ab(this.ptr)}; |
||||||
|
G.prototype.__destroy__=G.prototype.__destroy__=function(){Bb(this.ptr)};E.prototype=Object.create(t.prototype);E.prototype.constructor=E;E.prototype.__class__=E;E.__cache__={};a.Mesh=E;E.prototype.num_faces=E.prototype.num_faces=function(){return Cb(this.ptr)};E.prototype.num_attributes=E.prototype.num_attributes=function(){return Db(this.ptr)};E.prototype.num_points=E.prototype.num_points=function(){return Eb(this.ptr)};E.prototype.__destroy__=E.prototype.__destroy__=function(){Fb(this.ptr)};T.prototype= |
||||||
|
Object.create(t.prototype);T.prototype.constructor=T;T.prototype.__class__=T;T.__cache__={};a.Metadata=T;T.prototype.__destroy__=T.prototype.__destroy__=function(){Gb(this.ptr)};B.prototype=Object.create(t.prototype);B.prototype.constructor=B;B.prototype.__class__=B;B.__cache__={};a.Status=B;B.prototype.code=B.prototype.code=function(){return Hb(this.ptr)};B.prototype.ok=B.prototype.ok=function(){return!!Ib(this.ptr)};B.prototype.error_msg=B.prototype.error_msg=function(){return h(Jb(this.ptr))}; |
||||||
|
B.prototype.__destroy__=B.prototype.__destroy__=function(){Kb(this.ptr)};H.prototype=Object.create(t.prototype);H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.DracoFloat32Array=H;H.prototype.GetValue=H.prototype.GetValue=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return Lb(c,b)};H.prototype.size=H.prototype.size=function(){return Mb(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=function(){Nb(this.ptr)};I.prototype=Object.create(t.prototype);I.prototype.constructor= |
||||||
|
I;I.prototype.__class__=I;I.__cache__={};a.DracoInt8Array=I;I.prototype.GetValue=I.prototype.GetValue=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return Ob(c,b)};I.prototype.size=I.prototype.size=function(){return Pb(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){Qb(this.ptr)};J.prototype=Object.create(t.prototype);J.prototype.constructor=J;J.prototype.__class__=J;J.__cache__={};a.DracoUInt8Array=J;J.prototype.GetValue=J.prototype.GetValue=function(b){var c= |
||||||
|
this.ptr;b&&"object"===typeof b&&(b=b.ptr);return Rb(c,b)};J.prototype.size=J.prototype.size=function(){return Sb(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){Tb(this.ptr)};K.prototype=Object.create(t.prototype);K.prototype.constructor=K;K.prototype.__class__=K;K.__cache__={};a.DracoInt16Array=K;K.prototype.GetValue=K.prototype.GetValue=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return Ub(c,b)};K.prototype.size=K.prototype.size=function(){return Vb(this.ptr)}; |
||||||
|
K.prototype.__destroy__=K.prototype.__destroy__=function(){Wb(this.ptr)};L.prototype=Object.create(t.prototype);L.prototype.constructor=L;L.prototype.__class__=L;L.__cache__={};a.DracoUInt16Array=L;L.prototype.GetValue=L.prototype.GetValue=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return Xb(c,b)};L.prototype.size=L.prototype.size=function(){return Yb(this.ptr)};L.prototype.__destroy__=L.prototype.__destroy__=function(){Zb(this.ptr)};M.prototype=Object.create(t.prototype);M.prototype.constructor= |
||||||
|
M;M.prototype.__class__=M;M.__cache__={};a.DracoInt32Array=M;M.prototype.GetValue=M.prototype.GetValue=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return $b(c,b)};M.prototype.size=M.prototype.size=function(){return ac(this.ptr)};M.prototype.__destroy__=M.prototype.__destroy__=function(){bc(this.ptr)};N.prototype=Object.create(t.prototype);N.prototype.constructor=N;N.prototype.__class__=N;N.__cache__={};a.DracoUInt32Array=N;N.prototype.GetValue=N.prototype.GetValue=function(b){var c= |
||||||
|
this.ptr;b&&"object"===typeof b&&(b=b.ptr);return cc(c,b)};N.prototype.size=N.prototype.size=function(){return dc(this.ptr)};N.prototype.__destroy__=N.prototype.__destroy__=function(){ec(this.ptr)};y.prototype=Object.create(t.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.MetadataQuerier=y;y.prototype.HasEntry=y.prototype.HasEntry=function(b,c){var d=this.ptr;r.prepare();b&&"object"===typeof b&&(b=b.ptr);c=c&&"object"===typeof c?c.ptr:R(c);return!!fc(d,b,c)};y.prototype.GetIntEntry= |
||||||
|
y.prototype.GetIntEntry=function(b,c){var d=this.ptr;r.prepare();b&&"object"===typeof b&&(b=b.ptr);c=c&&"object"===typeof c?c.ptr:R(c);return gc(d,b,c)};y.prototype.GetIntEntryArray=y.prototype.GetIntEntryArray=function(b,c,d){var g=this.ptr;r.prepare();b&&"object"===typeof b&&(b=b.ptr);c=c&&"object"===typeof c?c.ptr:R(c);d&&"object"===typeof d&&(d=d.ptr);hc(g,b,c,d)};y.prototype.GetDoubleEntry=y.prototype.GetDoubleEntry=function(b,c){var d=this.ptr;r.prepare();b&&"object"===typeof b&&(b=b.ptr);c= |
||||||
|
c&&"object"===typeof c?c.ptr:R(c);return ic(d,b,c)};y.prototype.GetStringEntry=y.prototype.GetStringEntry=function(b,c){var d=this.ptr;r.prepare();b&&"object"===typeof b&&(b=b.ptr);c=c&&"object"===typeof c?c.ptr:R(c);return h(jc(d,b,c))};y.prototype.NumEntries=y.prototype.NumEntries=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return kc(c,b)};y.prototype.GetEntryName=y.prototype.GetEntryName=function(b,c){var d=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c= |
||||||
|
c.ptr);return h(lc(d,b,c))};y.prototype.__destroy__=y.prototype.__destroy__=function(){mc(this.ptr)};m.prototype=Object.create(t.prototype);m.prototype.constructor=m;m.prototype.__class__=m;m.__cache__={};a.Decoder=m;m.prototype.DecodeArrayToPointCloud=m.prototype.DecodeArrayToPointCloud=function(b,c,d){var g=this.ptr;r.prepare();"object"==typeof b&&(b=pa(b));c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return D(nc(g,b,c,d),B)};m.prototype.DecodeArrayToMesh=m.prototype.DecodeArrayToMesh= |
||||||
|
function(b,c,d){var g=this.ptr;r.prepare();"object"==typeof b&&(b=pa(b));c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return D(oc(g,b,c,d),B)};m.prototype.GetAttributeId=m.prototype.GetAttributeId=function(b,c){var d=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);return pc(d,b,c)};m.prototype.GetAttributeIdByName=m.prototype.GetAttributeIdByName=function(b,c){var d=this.ptr;r.prepare();b&&"object"===typeof b&&(b=b.ptr);c=c&&"object"===typeof c? |
||||||
|
c.ptr:R(c);return qc(d,b,c)};m.prototype.GetAttributeIdByMetadataEntry=m.prototype.GetAttributeIdByMetadataEntry=function(b,c,d){var g=this.ptr;r.prepare();b&&"object"===typeof b&&(b=b.ptr);c=c&&"object"===typeof c?c.ptr:R(c);d=d&&"object"===typeof d?d.ptr:R(d);return rc(g,b,c,d)};m.prototype.GetAttribute=m.prototype.GetAttribute=function(b,c){var d=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);return D(sc(d,b,c),w)};m.prototype.GetAttributeByUniqueId=m.prototype.GetAttributeByUniqueId= |
||||||
|
function(b,c){var d=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);return D(tc(d,b,c),w)};m.prototype.GetMetadata=m.prototype.GetMetadata=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return D(uc(c,b),T)};m.prototype.GetAttributeMetadata=m.prototype.GetAttributeMetadata=function(b,c){var d=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);return D(vc(d,b,c),T)};m.prototype.GetFaceFromMesh=m.prototype.GetFaceFromMesh=function(b, |
||||||
|
c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!wc(g,b,c,d)};m.prototype.GetTriangleStripsFromMesh=m.prototype.GetTriangleStripsFromMesh=function(b,c){var d=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);return xc(d,b,c)};m.prototype.GetTrianglesUInt16Array=m.prototype.GetTrianglesUInt16Array=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr); |
||||||
|
d&&"object"===typeof d&&(d=d.ptr);return!!yc(g,b,c,d)};m.prototype.GetTrianglesUInt32Array=m.prototype.GetTrianglesUInt32Array=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!zc(g,b,c,d)};m.prototype.GetAttributeFloat=m.prototype.GetAttributeFloat=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ac(g,b,c,d)};m.prototype.GetAttributeFloatForAllPoints= |
||||||
|
m.prototype.GetAttributeFloatForAllPoints=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Bc(g,b,c,d)};m.prototype.GetAttributeIntForAllPoints=m.prototype.GetAttributeIntForAllPoints=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Cc(g,b,c,d)};m.prototype.GetAttributeInt8ForAllPoints=m.prototype.GetAttributeInt8ForAllPoints= |
||||||
|
function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Dc(g,b,c,d)};m.prototype.GetAttributeUInt8ForAllPoints=m.prototype.GetAttributeUInt8ForAllPoints=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ec(g,b,c,d)};m.prototype.GetAttributeInt16ForAllPoints=m.prototype.GetAttributeInt16ForAllPoints=function(b,c,d){var g=this.ptr; |
||||||
|
b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Fc(g,b,c,d)};m.prototype.GetAttributeUInt16ForAllPoints=m.prototype.GetAttributeUInt16ForAllPoints=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Gc(g,b,c,d)};m.prototype.GetAttributeInt32ForAllPoints=m.prototype.GetAttributeInt32ForAllPoints=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&& |
||||||
|
(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Hc(g,b,c,d)};m.prototype.GetAttributeUInt32ForAllPoints=m.prototype.GetAttributeUInt32ForAllPoints=function(b,c,d){var g=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ic(g,b,c,d)};m.prototype.GetAttributeDataArrayForAllPoints=m.prototype.GetAttributeDataArrayForAllPoints=function(b,c,d,g,u){var X=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&& |
||||||
|
"object"===typeof c&&(c=c.ptr);d&&"object"===typeof d&&(d=d.ptr);g&&"object"===typeof g&&(g=g.ptr);u&&"object"===typeof u&&(u=u.ptr);return!!Jc(X,b,c,d,g,u)};m.prototype.SkipAttributeTransform=m.prototype.SkipAttributeTransform=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);Kc(c,b)};m.prototype.GetEncodedGeometryType_Deprecated=m.prototype.GetEncodedGeometryType_Deprecated=function(b){var c=this.ptr;b&&"object"===typeof b&&(b=b.ptr);return Lc(c,b)};m.prototype.DecodeBufferToPointCloud= |
||||||
|
m.prototype.DecodeBufferToPointCloud=function(b,c){var d=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);return D(Mc(d,b,c),B)};m.prototype.DecodeBufferToMesh=m.prototype.DecodeBufferToMesh=function(b,c){var d=this.ptr;b&&"object"===typeof b&&(b=b.ptr);c&&"object"===typeof c&&(c=c.ptr);return D(Nc(d,b,c),B)};m.prototype.__destroy__=m.prototype.__destroy__=function(){Oc(this.ptr)};(function(){function b(){a.ATTRIBUTE_INVALID_TRANSFORM=Pc();a.ATTRIBUTE_NO_TRANSFORM=Qc(); |
||||||
|
a.ATTRIBUTE_QUANTIZATION_TRANSFORM=Rc();a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Sc();a.INVALID=Tc();a.POSITION=Uc();a.NORMAL=Vc();a.COLOR=Wc();a.TEX_COORD=Xc();a.GENERIC=Yc();a.INVALID_GEOMETRY_TYPE=Zc();a.POINT_CLOUD=$c();a.TRIANGULAR_MESH=ad();a.DT_INVALID=bd();a.DT_INT8=cd();a.DT_UINT8=dd();a.DT_INT16=ed();a.DT_UINT16=fd();a.DT_INT32=gd();a.DT_UINT32=hd();a.DT_INT64=id();a.DT_UINT64=jd();a.DT_FLOAT32=kd();a.DT_FLOAT64=ld();a.DT_BOOL=md();a.DT_TYPES_COUNT=nd();a.OK=od();a.DRACO_ERROR=pd();a.IO_ERROR=qd(); |
||||||
|
a.INVALID_PARAMETER=rd();a.UNSUPPORTED_VERSION=sd();a.UNKNOWN_VERSION=td()}za?b():oa.unshift(b)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();a.Decoder.prototype.GetEncodedGeometryType=function(b){if(b.__class__&&b.__class__===a.DecoderBuffer)return a.Decoder.prototype.GetEncodedGeometryType_Deprecated(b);if(8>b.byteLength)return a.INVALID_GEOMETRY_TYPE;switch(b[7]){case 0:return a.POINT_CLOUD;case 1:return a.TRIANGULAR_MESH;default:return a.INVALID_GEOMETRY_TYPE}};return n.ready}}(); |
||||||
|
"object"===typeof exports&&"object"===typeof module?module.exports=DracoDecoderModule:"function"===typeof define&&define.amd?define([],function(){return DracoDecoderModule}):"object"===typeof exports&&(exports.DracoDecoderModule=DracoDecoderModule); |
@ -0,0 +1 @@ |
|||||||
|
{"cells":[{"attachments":{},"cell_type":"markdown","metadata":{},"source":["### 0701:v0.2\n","1. ~~集装箱标注ID~~\n","2. ~~护栏上的标识去掉~~\n","3. ~~logo加上~~\n","4. ~~左上角返回~~\n","5. ~~标识文字有点变形,处理掉~~\n","6. ~~详细信息点击切换~~"]},{"attachments":{},"cell_type":"markdown","metadata":{},"source":["### 0710:v0.3\n","1. ~~模型体积压缩~~"]},{"cell_type":"markdown","metadata":{},"source":["# 0726 v0.4\n","页面端0.4版本已发布,http://146.56.233.47:9400/,\n","登录账号\n"," test/123456 \n"," test01/123456 \n"," jade/123456\n","\n","更新内容\n","1、对接后台基本数据接口\n","2、添加两个全屏界面\n","3、优化更改站点及设备配置界面\n","\n","现存问题:\n","1、图表、表格数据暂时为模拟数据\n","2、全屏地图暂时未普通地图,效果图的3D地图样式后续补充\n","3、全屏下的3D模型数据标签会发生偏移,后续待优化处理\n","\n","需要安排对接事项:\n"," 后台设备相关数据暂时缺失,需要安排硬件与后台对接上传部分模拟或真实数据,或者通过其他方式填充后台相关数据\n","\n"]},{"attachments":{},"cell_type":"markdown","metadata":{},"source":["待优化\n","1. 数字逗号优化(正则)\n","2. window resize防抖优化\n"]},{"cell_type":"markdown","metadata":{},"source":["登录接口验证码没有验证"]},{"cell_type":"markdown","metadata":{},"source":["***\n","<ul>\n"," <input type=\"checkbox\"> 站点数默认6位 <br>\n"," <input type=\"checkbox\"> 站点可点击 <br>\n"," <input type=\"checkbox\"> 首页左侧分三块 <br>\n"," <input type=\"checkbox\"> 3d模型优化 <br>\n"," <input type=\"checkbox\"> 按钮样式统一<br>\n"," <input type=\"checkbox\"> 站点单独添加页面 <br>\n"," <input type=\"checkbox\"> 全屏按钮没有功能的页面隐藏掉 <br>\n"," <input type=\"checkbox\"> 网页tag 图片和名字 <br>\n","</ul>\n","\n","***"]}],"metadata":{"language_info":{"name":"python"},"orig_nbformat":4},"nbformat":4,"nbformat_minor":2} |
@ -0,0 +1,14 @@ |
|||||||
|
export default class Keys { |
||||||
|
public static STORAGE_UUID = 'uuid' |
||||||
|
public static STORAGE_TENANT_ID = 'tenant' |
||||||
|
public static STORAGE_TOKEN = 'token' |
||||||
|
public static STORAGE_REFRESH_TOKEN = 'refreshToken' |
||||||
|
public static STORAGE_USER_INFO = 'userInfo' |
||||||
|
public static STORAGE_ROLE_ROUTERS = 'roleRouters' |
||||||
|
public static STORAGE_DICT_CACHE = 'dict' |
||||||
|
public static STORAGE_LANG = 'lang' |
||||||
|
public static STORAGE_STATIONID = 'stationId' |
||||||
|
public static STORAGE_THEME = 'EDFS-THEME' |
||||||
|
|
||||||
|
public static CODE_SUCCEED = 0 |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
export const errorCode: any = { |
||||||
|
401: '认证失败,无法访问系统资源', |
||||||
|
403: '当前操作没有权限', |
||||||
|
404: '访问资源不存在', |
||||||
|
} |
@ -0,0 +1,6 @@ |
|||||||
|
export interface Result<T> { |
||||||
|
code: number |
||||||
|
msg: string |
||||||
|
status?: number |
||||||
|
data: T |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
const authErrMap: any = { |
||||||
|
'401': '认证失败,无法访问系统资源', |
||||||
|
'403': '当前操作没有权限', |
||||||
|
'404': '访问资源不存在', |
||||||
|
default: '系统未知错误,请反馈给管理员', |
||||||
|
} |
||||||
|
|
||||||
|
const networkErrMap: { [key: number]: string } = { |
||||||
|
400: '请求错误(400)', |
||||||
|
401: '未授权,请重新登录(401)', |
||||||
|
403: '拒绝访问(403)', |
||||||
|
404: '请求出错(404)', |
||||||
|
408: '请求超时(408)', |
||||||
|
500: '服务器错误(500)', |
||||||
|
501: '服务未实现(501)', |
||||||
|
502: '网络错误(502)', |
||||||
|
503: '服务不可用(503)', |
||||||
|
504: '网络超时(504)', |
||||||
|
505: 'HTTP版本不受支持(505)', |
||||||
|
} |
||||||
|
|
||||||
|
const ignoreMsgs = [ |
||||||
|
'无效的刷新令牌', // 刷新令牌被删除时,不用提示
|
||||||
|
'刷新令牌已过期', // 使用刷新令牌,刷新获取新的访问令牌时,结果因为过期失败,此时需要忽略。否则,会导致继续 401,无法跳转到登出界面
|
||||||
|
] |
||||||
|
|
||||||
|
export { authErrMap, networkErrMap, ignoreMsgs } |
@ -0,0 +1,59 @@ |
|||||||
|
import { eamServer } from '../../index' |
||||||
|
|
||||||
|
export interface CustomerVO { |
||||||
|
id?: string |
||||||
|
name: string |
||||||
|
contact: string |
||||||
|
phone: string |
||||||
|
email: string |
||||||
|
address: string |
||||||
|
description: string |
||||||
|
status: number |
||||||
|
} |
||||||
|
export const getCustomerList = (params: PageParam) => |
||||||
|
eamServer<{ |
||||||
|
list: CustomerVO[] |
||||||
|
total: number |
||||||
|
}>({ |
||||||
|
url: '/customer/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
export const getSimpleCustomerList = () => |
||||||
|
eamServer<Pick<CustomerVO, 'id' | 'name'>>({ |
||||||
|
url: '/customer/list-all-simple', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
export const getCustomer = (id: Pick<CustomerVO, 'id'>) => |
||||||
|
eamServer({ |
||||||
|
url: '/customer/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
export const deleteCustomer = (id: Pick<CustomerVO, 'id'>) => |
||||||
|
eamServer({ |
||||||
|
url: '/customer/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
||||||
|
|
||||||
|
export const updateCustomerStatus = (params: Pick<CustomerVO, 'id' | 'status'>) => |
||||||
|
eamServer({ |
||||||
|
url: `/customer/update-status?id=${params.id}&status=${params.status}`, |
||||||
|
method: 'put', |
||||||
|
}) |
||||||
|
|
||||||
|
export const updateCustomer = (data: CustomerVO) => |
||||||
|
eamServer({ |
||||||
|
url: '/customer/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const createCustomer = (data: CustomerVO) => |
||||||
|
eamServer({ |
||||||
|
url: '/customer/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
@ -0,0 +1,36 @@ |
|||||||
|
import { eamServer } from '../../index' |
||||||
|
|
||||||
|
export interface IAttributeTree { |
||||||
|
name: string |
||||||
|
description: string |
||||||
|
pid: string |
||||||
|
id: string |
||||||
|
creator: string |
||||||
|
createTime: string |
||||||
|
children: IAttributeTree[] |
||||||
|
} |
||||||
|
|
||||||
|
export type CategoryOV = Pick<IAttributeTree, 'name' | 'pid'> & { |
||||||
|
id?: string |
||||||
|
} |
||||||
|
|
||||||
|
export const createdAttribute = (data: CategoryOV) => |
||||||
|
eamServer<IAttributeTree>({ |
||||||
|
url: '/attribute/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const updateAttribute = (data: CategoryOV) => |
||||||
|
eamServer<IAttributeTree>({ |
||||||
|
url: '/attribute/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const deleteAttribute = (id: string) => |
||||||
|
eamServer({ |
||||||
|
url: `/attribute/delete`, |
||||||
|
method: 'delete', |
||||||
|
params: { id }, |
||||||
|
}) |
@ -0,0 +1,42 @@ |
|||||||
|
import { eamServer } from '../../index' |
||||||
|
|
||||||
|
export interface ICategoryTree { |
||||||
|
name: string |
||||||
|
description: string |
||||||
|
pid: string |
||||||
|
id: string |
||||||
|
creator: string |
||||||
|
createTime: string |
||||||
|
children: ICategoryTree[] |
||||||
|
} |
||||||
|
|
||||||
|
export type CategoryOV = Pick<ICategoryTree, 'name' | 'pid'> & { |
||||||
|
id?: string |
||||||
|
} |
||||||
|
|
||||||
|
export const getCategoryTree = () => |
||||||
|
eamServer<ICategoryTree[]>({ |
||||||
|
url: '/device-category/tree', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
export const createdCategory = (data: CategoryOV) => |
||||||
|
eamServer<ICategoryTree>({ |
||||||
|
url: '/device-category/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const updateCategory = (data: CategoryOV) => |
||||||
|
eamServer<ICategoryTree>({ |
||||||
|
url: '/device-category/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const deleteCategory = (id: string) => |
||||||
|
eamServer({ |
||||||
|
url: `/device-category/delete`, |
||||||
|
method: 'delete', |
||||||
|
params: { id }, |
||||||
|
}) |
@ -0,0 +1,86 @@ |
|||||||
|
import { eamServer } from '../../index' |
||||||
|
|
||||||
|
export interface IDevice { |
||||||
|
id: string |
||||||
|
name: string |
||||||
|
categoryId: string |
||||||
|
serialNo: string |
||||||
|
sn: string |
||||||
|
status: string |
||||||
|
description: string |
||||||
|
cost: string |
||||||
|
createTime: string |
||||||
|
updateTime: string |
||||||
|
creator: string |
||||||
|
updater: string |
||||||
|
testSheetId: string |
||||||
|
testSheetStatus: string |
||||||
|
testSheetDetail: string |
||||||
|
} |
||||||
|
|
||||||
|
export interface IDeviceOV { |
||||||
|
id?: string |
||||||
|
name: string |
||||||
|
categoryId: string |
||||||
|
templateId: string |
||||||
|
serialNo: string |
||||||
|
sn: string |
||||||
|
description: string |
||||||
|
cost: string |
||||||
|
} |
||||||
|
|
||||||
|
export const operantDevice = (type: OperantAction, data: IDeviceOV) => { |
||||||
|
if (type === 'create') { |
||||||
|
return eamServer({ |
||||||
|
url: '/device/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
} |
||||||
|
if (type === 'update') { |
||||||
|
return eamServer({ |
||||||
|
url: '/device/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
export const deleteDevice = (id: string) => |
||||||
|
eamServer({ |
||||||
|
url: `/device/delete`, |
||||||
|
method: 'delete', |
||||||
|
params: { id }, |
||||||
|
}) |
||||||
|
|
||||||
|
export const getDeviceInfo = (id: string) => |
||||||
|
eamServer({ |
||||||
|
url: `/device/get`, |
||||||
|
method: 'get', |
||||||
|
params: { id }, |
||||||
|
}) |
||||||
|
|
||||||
|
export const getDevicePage = (params: PageParam) => |
||||||
|
eamServer<{ |
||||||
|
list: IDevice[] |
||||||
|
total: number |
||||||
|
}>({ url: '/device/page', method: 'get', params }) |
||||||
|
|
||||||
|
// ============== 测试工单相关 ==============
|
||||||
|
|
||||||
|
export const operantDeviceTestSheet = (type: OperantAction, params: any) => { |
||||||
|
if (type === 'create') { |
||||||
|
return eamServer({ |
||||||
|
url: '/test-sheet/create', |
||||||
|
method: 'post', |
||||||
|
params, |
||||||
|
}) |
||||||
|
} |
||||||
|
if (type === 'update') { |
||||||
|
return eamServer({ |
||||||
|
url: '/test-sheet/update', |
||||||
|
method: 'put', |
||||||
|
params, |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,75 @@ |
|||||||
|
import { eamServer } from '../../index' |
||||||
|
|
||||||
|
export interface IDeviceTemp { |
||||||
|
id?: string |
||||||
|
name: string |
||||||
|
description: string |
||||||
|
categoryId: string |
||||||
|
enabled: number |
||||||
|
} |
||||||
|
|
||||||
|
export type IDeviceTempOV = Omit<IDeviceTemp, 'enabled'> |
||||||
|
|
||||||
|
export const createdDeviceTemp = (data: IDeviceTempOV) => |
||||||
|
eamServer({ |
||||||
|
url: '/template/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const updateDeviceTemp = (data: IDeviceTempOV) => |
||||||
|
eamServer({ |
||||||
|
url: '/template/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const deleteDeviceTemp = (id: string) => |
||||||
|
eamServer({ |
||||||
|
url: `/template/delete`, |
||||||
|
method: 'delete', |
||||||
|
params: { id }, |
||||||
|
}) |
||||||
|
|
||||||
|
export const getDeviceTempPage = (params: PageParam) => |
||||||
|
eamServer<{ |
||||||
|
list: IDeviceTemp[] |
||||||
|
total: number |
||||||
|
}>({ url: '/template/page', method: 'get', params }) |
||||||
|
|
||||||
|
// ============== 用例相关 ==============
|
||||||
|
|
||||||
|
export interface IDeviceCase { |
||||||
|
id?: string |
||||||
|
templateId: string |
||||||
|
content: string |
||||||
|
expectResult: string |
||||||
|
} |
||||||
|
|
||||||
|
export const createdDeviceCase = (data: IDeviceCase) => |
||||||
|
eamServer({ |
||||||
|
url: '/section/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const updateDeviceCase = (data: IDeviceCase) => |
||||||
|
eamServer({ |
||||||
|
url: '/section/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
export const deleteDeviceCase = (id: string) => |
||||||
|
eamServer({ |
||||||
|
url: `/section/delete`, |
||||||
|
method: 'delete', |
||||||
|
params: { id }, |
||||||
|
}) |
||||||
|
|
||||||
|
export const getDeviceCaseList = (templateId: string) => |
||||||
|
eamServer<IDeviceCase[]>({ |
||||||
|
url: '/section/list-by-template', |
||||||
|
method: 'get', |
||||||
|
params: { templateId }, |
||||||
|
}) |
@ -0,0 +1,7 @@ |
|||||||
|
import axiosInstance from '@/api/server/axiosInstance' |
||||||
|
import { API_Config } from '@/api/server/config' |
||||||
|
|
||||||
|
const systemServer = axiosInstance('system', API_Config.system) |
||||||
|
const eamServer = axiosInstance('eam', API_Config.eam) |
||||||
|
|
||||||
|
export { systemServer, eamServer } |
@ -0,0 +1,57 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
export interface DeptVO { |
||||||
|
id?: number |
||||||
|
name: string |
||||||
|
parentId: number |
||||||
|
status: number |
||||||
|
sort: number |
||||||
|
leaderUserId: number |
||||||
|
phone: string |
||||||
|
email: string |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
// 查询部门(精简)列表
|
||||||
|
export const getSimpleDeptList = async () => |
||||||
|
systemServer<DeptVO[]>({ |
||||||
|
url: '/dept/simple-list', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询部门列表
|
||||||
|
export const getDeptPage = async (params: PageParam) => |
||||||
|
systemServer({ |
||||||
|
url: '/dept/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询部门详情
|
||||||
|
export const getDept = async (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/dept/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增部门
|
||||||
|
export const createDept = async (data: DeptVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/dept/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改部门
|
||||||
|
export const updateDept = async (params: DeptVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/dept/update', |
||||||
|
method: 'put', |
||||||
|
data: params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除部门
|
||||||
|
export const deleteDept = async (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/dept/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
@ -0,0 +1,68 @@ |
|||||||
|
|
||||||
|
import { systemServer } from '../../index' |
||||||
|
|
||||||
|
export type DictDataVO = { |
||||||
|
id: number | undefined |
||||||
|
sort: number | undefined |
||||||
|
label: string |
||||||
|
value: string |
||||||
|
dictType: string |
||||||
|
status: number |
||||||
|
colorType: string |
||||||
|
cssClass: string |
||||||
|
remark: string |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
// 查询字典数据(精简)列表
|
||||||
|
export const getSimpleDictDataList = () => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-data/simple-list', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询字典数据列表
|
||||||
|
export const getDictDataPage = (params: PageParam) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-data/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
// 查询字典数据详情
|
||||||
|
export const getDictData = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-data/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增字典数据
|
||||||
|
export const createDictData = (data: DictDataVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-data/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改字典数据
|
||||||
|
export const updateDictData = (data: DictDataVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-data/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除字典数据
|
||||||
|
export const deleteDictData = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-data/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
||||||
|
|
||||||
|
// 导出字典类型数据
|
||||||
|
export const exportDictData = (params:any) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-data/export', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
responseType: 'blob', |
||||||
|
}) |
@ -0,0 +1,65 @@ |
|||||||
|
|
||||||
|
import { systemServer } from '../../index' |
||||||
|
|
||||||
|
export type DictTypeVO = { |
||||||
|
id: number | undefined |
||||||
|
name: string |
||||||
|
type: string |
||||||
|
status: number |
||||||
|
remark: string |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
// 查询字典(精简)列表
|
||||||
|
export const getSimpleDictTypeList = () => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-type/list-all-simple', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询字典列表
|
||||||
|
export const getDictTypePage = (params: PageParam) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-type/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询字典详情
|
||||||
|
export const getDictType = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-type/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增字典
|
||||||
|
export const createDictType = (data: DictTypeVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-type/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改字典
|
||||||
|
export const updateDictType = (data: DictTypeVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-type/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除字典
|
||||||
|
export const deleteDictType = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-type/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
||||||
|
|
||||||
|
// 导出字典类型
|
||||||
|
export const exportDictType = (params: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/dict-type/export', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
responseType: 'blob', |
||||||
|
}) |
@ -0,0 +1,50 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
export interface FilePageReqVO extends PageParam { |
||||||
|
path?: string |
||||||
|
type?: string |
||||||
|
createTime?: Date[] |
||||||
|
} |
||||||
|
|
||||||
|
// 文件预签名地址 Response VO
|
||||||
|
export interface FilePresignedUrlRespVO { |
||||||
|
// 文件配置编号
|
||||||
|
configId: number |
||||||
|
// 文件上传 URL
|
||||||
|
uploadUrl: string |
||||||
|
// 文件 URL
|
||||||
|
url: string |
||||||
|
} |
||||||
|
|
||||||
|
// 查询文件列表
|
||||||
|
export const getFilePage = (params: FilePageReqVO) => { |
||||||
|
return systemServer({ url: '/infra/file/page', params, method: 'get' }) |
||||||
|
} |
||||||
|
|
||||||
|
// 删除文件
|
||||||
|
export const deleteFile = (id: number) => { |
||||||
|
return systemServer({ url: '/infra/file/delete?id=' + id, method: 'delete' }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获取文件预签名地址
|
||||||
|
export const getFilePresignedUrl = (path: string) => { |
||||||
|
return systemServer<FilePresignedUrlRespVO>({ |
||||||
|
url: '/infra/file/presigned-url', |
||||||
|
params: { path }, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
// 创建文件
|
||||||
|
export const createFile = (data: any) => { |
||||||
|
return systemServer({ url: '/infra/file/create', data, method: 'post' }) |
||||||
|
} |
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
export const updateFile = (data: any) => { |
||||||
|
return systemServer({ |
||||||
|
url: '/infra/file/upload', |
||||||
|
data, |
||||||
|
method: 'post', |
||||||
|
headers: { 'Content-Type': 'multipart/form-data' }, |
||||||
|
}) |
||||||
|
} |
@ -0,0 +1,106 @@ |
|||||||
|
import { getRefreshToken } from '@/utils/auth' |
||||||
|
import { systemServer } from '../../index' |
||||||
|
|
||||||
|
type UserLoginVO = { |
||||||
|
username: string |
||||||
|
password: string |
||||||
|
captchaVerification: string |
||||||
|
socialType?: string |
||||||
|
socialCode?: string |
||||||
|
socialState?: string |
||||||
|
} |
||||||
|
|
||||||
|
export interface LoginRequestData { |
||||||
|
username: string |
||||||
|
password: string |
||||||
|
// tenantName: string
|
||||||
|
// captchaVerification: string
|
||||||
|
// rememberMe: boolean
|
||||||
|
} |
||||||
|
export interface SmsCodeVO { |
||||||
|
mobile: string |
||||||
|
scene: number |
||||||
|
} |
||||||
|
|
||||||
|
export interface SmsLoginVO { |
||||||
|
mobile: string |
||||||
|
code: string |
||||||
|
} |
||||||
|
interface LoginResponse { |
||||||
|
accessToken: string |
||||||
|
expiresTime: number |
||||||
|
refreshToken: string |
||||||
|
userId: number |
||||||
|
} |
||||||
|
|
||||||
|
export const getTenantId = (name: string) => |
||||||
|
systemServer<number>({ |
||||||
|
url: '/tenant/get-id-by-name', |
||||||
|
method: 'get', |
||||||
|
params: { |
||||||
|
name, |
||||||
|
}, |
||||||
|
}) |
||||||
|
|
||||||
|
export const login = (data: any) => |
||||||
|
systemServer<LoginResponse>({ |
||||||
|
method: 'post', |
||||||
|
url: '/auth/login', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 刷新访问令牌
|
||||||
|
export const refreshToken = () => |
||||||
|
systemServer({ |
||||||
|
url: '/auth/refresh-token?refreshToken=' + getRefreshToken(), |
||||||
|
method: 'post', |
||||||
|
}) |
||||||
|
|
||||||
|
// // 使用租户域名,获得租户信息
|
||||||
|
// export const getTenantByWebsite = (website: string) => {
|
||||||
|
// return request.get({ url: '/tenant/get-by-website?website=' + website })
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 登出
|
||||||
|
export const loginOut = () => systemServer({ url: '/auth/logout', method: 'post' }) |
||||||
|
|
||||||
|
export const getInfo = () => |
||||||
|
systemServer({ url: '/auth/get-permission-info', method: 'get' }) |
||||||
|
|
||||||
|
// //获取登录验证码
|
||||||
|
export const sendSmsCode = (data: SmsCodeVO) => { |
||||||
|
return systemServer({ url: '/auth/send-sms-code', method: 'post', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// // 短信验证码登录
|
||||||
|
export const smsLogin = (data: SmsLoginVO) => { |
||||||
|
return systemServer({ url: '/auth/sms-login', method: 'post', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// // 社交快捷登录,使用 code 授权码
|
||||||
|
// export function socialLogin(type: string, code: string, state: string) {
|
||||||
|
// return request.post({
|
||||||
|
// url: '/auth/social-login',
|
||||||
|
// data: {
|
||||||
|
// type,
|
||||||
|
// code,
|
||||||
|
// state
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 社交授权的跳转
|
||||||
|
// export const socialAuthRedirect = (type: number, redirectUri: string) => {
|
||||||
|
// return request.get({
|
||||||
|
// url: '/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// // 获取验证图片以及 token
|
||||||
|
// export const getCode = (data) => {
|
||||||
|
// return request.postOriginal({ url: 'system/captcha/get', data })
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 滑动或者点选验证
|
||||||
|
// export const reqCheck = (data) => {
|
||||||
|
// return request.postOriginal({ url: 'system/captcha/check', data })
|
||||||
|
// }
|
@ -0,0 +1,33 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
export interface LoginLogVO { |
||||||
|
id: number |
||||||
|
logType: number |
||||||
|
traceId: number |
||||||
|
userId: number |
||||||
|
userType: number |
||||||
|
username: string |
||||||
|
result: number |
||||||
|
status: number |
||||||
|
userIp: string |
||||||
|
userAgent: string |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
// 查询登录日志列表
|
||||||
|
export const getLoginLogPage = (params: PageParam) => { |
||||||
|
return systemServer({ |
||||||
|
url: '/login-log/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
// 导出登录日志
|
||||||
|
export const exportLoginLog = (params: any) => { |
||||||
|
return systemServer({ |
||||||
|
url: '/login-log/export', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
responseType: 'blob', |
||||||
|
}) |
||||||
|
} |
@ -0,0 +1,63 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
export interface MenuVO { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
permission: string |
||||||
|
type: number |
||||||
|
sort: number |
||||||
|
parentId: number |
||||||
|
path: string |
||||||
|
icon: string |
||||||
|
component: string |
||||||
|
componentName?: string |
||||||
|
status: number |
||||||
|
visible: boolean |
||||||
|
keepAlive: boolean |
||||||
|
alwaysShow?: boolean |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
// 查询菜单(精简)列表
|
||||||
|
export const getSimpleMenusList = () => |
||||||
|
systemServer({ |
||||||
|
url: '/menu/simple-list', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询菜单列表
|
||||||
|
export const getMenuList = (params: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/menu/list', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 获取菜单详情
|
||||||
|
export const getMenu = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/menu/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增菜单
|
||||||
|
export const createMenu = (data: MenuVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/menu/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改菜单
|
||||||
|
export const updateMenu = (data: MenuVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/menu/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除菜单
|
||||||
|
export const deleteMenu = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/menu/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
@ -0,0 +1,51 @@ |
|||||||
|
|
||||||
|
import { systemServer } from '../../index' |
||||||
|
|
||||||
|
export enum Action { |
||||||
|
//用户个人操作
|
||||||
|
USER_LOGIN = '登录', |
||||||
|
USER_LOGOUT = '登出', |
||||||
|
//用户管理
|
||||||
|
USERMGR_ADD = '添加用户', |
||||||
|
USERMGR_DEL = '删除用户', |
||||||
|
USERMGR_MODIFY = '更改用户', |
||||||
|
//zmq命令
|
||||||
|
ZMQ_CMD_PUBLISH = '设备命令下发', |
||||||
|
//ssh
|
||||||
|
SSH_LOGIN = 'SSH连接', |
||||||
|
SSH_LOGOUT = 'SSH中断连接' |
||||||
|
} |
||||||
|
|
||||||
|
export type OperateLogVO = { |
||||||
|
id: number |
||||||
|
traceId: string |
||||||
|
userType: number |
||||||
|
userId: number |
||||||
|
userName: string |
||||||
|
type: string |
||||||
|
subType: string |
||||||
|
bizId: number |
||||||
|
action: string |
||||||
|
extra: string |
||||||
|
requestMethod: string |
||||||
|
requestUrl: string |
||||||
|
userIp: string |
||||||
|
userAgent: string |
||||||
|
creator: string |
||||||
|
creatorName: string |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
// 查询操作日志列表
|
||||||
|
export const getOperateLogPage = (params: PageParam) => { |
||||||
|
return systemServer({ url: '/operate-log/page', method: 'get', params }) |
||||||
|
} |
||||||
|
// 导出操作日志
|
||||||
|
export const exportOperateLog = (params: any) => { |
||||||
|
return systemServer({ |
||||||
|
url: '/operate-log/export', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
responseType: 'blob', |
||||||
|
}) |
||||||
|
} |
@ -0,0 +1,54 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
export interface PermissionAssignUserRoleReqVO { |
||||||
|
userId: number |
||||||
|
roleIds: number[] |
||||||
|
} |
||||||
|
|
||||||
|
export interface PermissionAssignRoleMenuReqVO { |
||||||
|
roleId: number |
||||||
|
menuIds: number[] |
||||||
|
} |
||||||
|
|
||||||
|
export interface PermissionAssignRoleDataScopeReqVO { |
||||||
|
roleId: number |
||||||
|
dataScope: number |
||||||
|
dataScopeDeptIds: number[] |
||||||
|
} |
||||||
|
|
||||||
|
// 查询角色拥有的菜单权限
|
||||||
|
export const getRoleMenuList = async (roleId: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/permission/list-role-menus?roleId=' + roleId, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 赋予角色菜单权限
|
||||||
|
export const assignRoleMenu = async (data: PermissionAssignRoleMenuReqVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/permission/assign-role-menu', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 赋予角色数据权限
|
||||||
|
export const assignRoleDataScope = async (data: PermissionAssignRoleDataScopeReqVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/permission/assign-role-data-scope', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询用户拥有的角色数组
|
||||||
|
export const getUserRoleList = async (userId: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/permission/list-user-roles?userId=' + userId, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 赋予用户角色
|
||||||
|
export const assignUserRole = async (data: PermissionAssignUserRoleReqVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/permission/assign-user-role', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
@ -0,0 +1,64 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
export interface PostVO { |
||||||
|
id?: number |
||||||
|
name: string |
||||||
|
code: string |
||||||
|
sort: number |
||||||
|
status: number |
||||||
|
remark: string |
||||||
|
createTime?: Date |
||||||
|
} |
||||||
|
|
||||||
|
// 查询岗位列表
|
||||||
|
export const getPostPage = async (params: PageParam) => |
||||||
|
systemServer({ |
||||||
|
url: '/post/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 获取岗位精简信息列表
|
||||||
|
export const getSimplePostList = async () => |
||||||
|
systemServer<PostVO[]>({ |
||||||
|
url: '/post/simple-list', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询岗位详情
|
||||||
|
export const getPost = async (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/post/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增岗位
|
||||||
|
export const createPost = async (data: PostVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/post/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改岗位
|
||||||
|
export const updatePost = async (data: PostVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/post/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除岗位
|
||||||
|
export const deletePost = async (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/post/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
||||||
|
|
||||||
|
// 导出岗位
|
||||||
|
export const exportPost = async (params: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/post/export', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
responseType: 'blob', |
||||||
|
}) |
@ -0,0 +1,79 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
export interface RoleVO { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
code: string |
||||||
|
sort: number |
||||||
|
status: number |
||||||
|
type: number |
||||||
|
dataScope: number |
||||||
|
dataScopeDeptIds: number[] |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
export interface UpdateStatusReqVO { |
||||||
|
id: number |
||||||
|
status: number |
||||||
|
} |
||||||
|
|
||||||
|
// 查询角色列表
|
||||||
|
export const getRolePage = async (params: PageParam) => |
||||||
|
systemServer({ |
||||||
|
url: '/role/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询角色(精简)列表
|
||||||
|
export const getSimpleRoleList = async () => |
||||||
|
systemServer<RoleVO[]>({ |
||||||
|
url: '/role/simple-list', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询角色详情
|
||||||
|
export const getRole = async (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/role/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增角色
|
||||||
|
export const createRole = async (data: RoleVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/role/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改角色
|
||||||
|
export const updateRole = async (data: RoleVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/role/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改角色状态
|
||||||
|
export const updateRoleStatus = async (data: UpdateStatusReqVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/role/update-status', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除角色
|
||||||
|
export const deleteRole = async (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/role/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
||||||
|
|
||||||
|
// 导出角色
|
||||||
|
export const exportRole = (params: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/role/export-excel', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
responseType: 'blob', |
||||||
|
}) |
@ -0,0 +1,80 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
|
||||||
|
|
||||||
|
export interface TenantVO { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
contactName: string |
||||||
|
contactMobile: string |
||||||
|
status: number |
||||||
|
domain: string |
||||||
|
packageId: number |
||||||
|
username: string |
||||||
|
password: string |
||||||
|
expireTime: Date |
||||||
|
accountCount: number |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
export interface TenantPageReqVO extends PageParam { |
||||||
|
name?: string |
||||||
|
contactName?: string |
||||||
|
contactMobile?: string |
||||||
|
status?: number |
||||||
|
createTime?: Date[] |
||||||
|
} |
||||||
|
|
||||||
|
export interface TenantExportReqVO { |
||||||
|
name?: string |
||||||
|
contactName?: string |
||||||
|
contactMobile?: string |
||||||
|
status?: number |
||||||
|
createTime?: Date[] |
||||||
|
} |
||||||
|
|
||||||
|
// 查询租户列表
|
||||||
|
export const getTenantPage = (params: TenantPageReqVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询租户详情
|
||||||
|
export const getTenant = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增租户
|
||||||
|
export const createTenant = (data: TenantVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改租户
|
||||||
|
export const updateTenant = (data: TenantVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除租户
|
||||||
|
export const deleteTenant = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
||||||
|
|
||||||
|
// 导出租户
|
||||||
|
export const exportTenant = (params: TenantExportReqVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant/export-excel', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
responseType: 'blob', |
||||||
|
}) |
@ -0,0 +1,58 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
|
||||||
|
export interface TenantPackageVO { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
status: number |
||||||
|
remark: string |
||||||
|
creator: string |
||||||
|
updater: string |
||||||
|
updateTime: string |
||||||
|
menuIds: number[] |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
// 查询租户套餐列表
|
||||||
|
export const getTenantPackagePage = (params: PageParam) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant-package/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 获得租户
|
||||||
|
export const getTenantPackage = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant-package/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增租户套餐
|
||||||
|
export const createTenantPackage = (data: TenantPackageVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant-package/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改租户套餐
|
||||||
|
export const updateTenantPackage = (data: TenantPackageVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant-package/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除租户套餐
|
||||||
|
export const deleteTenantPackage = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant-package/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
||||||
|
|
||||||
|
// 获取租户套餐精简信息列表
|
||||||
|
export const getTenantPackageList = () => |
||||||
|
systemServer({ |
||||||
|
url: '/tenant-package/simple-list', |
||||||
|
method: 'get', |
||||||
|
}) |
@ -0,0 +1,121 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
|
||||||
|
export interface UserVO { |
||||||
|
id: number |
||||||
|
username: string |
||||||
|
nickname: string |
||||||
|
deptId: number |
||||||
|
postIds: string[] |
||||||
|
email: string |
||||||
|
mobile: string |
||||||
|
sex: number |
||||||
|
avatar: string |
||||||
|
loginIp: string |
||||||
|
status: number |
||||||
|
remark: string |
||||||
|
loginDate: Date |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
export interface UserSimple { |
||||||
|
id: number; |
||||||
|
nickname: string; |
||||||
|
deptId: number; |
||||||
|
deptName: string; |
||||||
|
} |
||||||
|
|
||||||
|
// 查询用户管理列表
|
||||||
|
export const getUserPage = (params: PageParam) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/page', |
||||||
|
method: 'get', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询所有用户列表
|
||||||
|
export const getAllUser = () => |
||||||
|
systemServer({ |
||||||
|
url: '/user/all', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 查询用户详情
|
||||||
|
export const getUser = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/get?id=' + id, |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 新增用户
|
||||||
|
export const createUser = (data: UserVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/create', |
||||||
|
method: 'post', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改用户
|
||||||
|
export const updateUser = (data: UserVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 删除用户
|
||||||
|
export const deleteUser = (id: number) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/delete?id=' + id, |
||||||
|
method: 'delete', |
||||||
|
}) |
||||||
|
|
||||||
|
// 导出用户
|
||||||
|
export const exportUser = (params: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/export', |
||||||
|
method: 'get', |
||||||
|
responseType: 'blob', |
||||||
|
params, |
||||||
|
}) |
||||||
|
|
||||||
|
// 下载用户导入模板
|
||||||
|
export const importUserTemplate = () => |
||||||
|
systemServer({ |
||||||
|
url: '/user/get-import-template', |
||||||
|
method: 'get', |
||||||
|
responseType: 'blob', |
||||||
|
}) |
||||||
|
|
||||||
|
// 用户密码重置
|
||||||
|
export const resetUserPwd = (id: number, password: string) => { |
||||||
|
const data = { |
||||||
|
id, |
||||||
|
password, |
||||||
|
} |
||||||
|
return systemServer({ |
||||||
|
url: '/user/reset-password', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
// 用户状态修改
|
||||||
|
export const updateUserStatus = (id: number, status: number) => { |
||||||
|
const data = { |
||||||
|
id, |
||||||
|
status, |
||||||
|
} |
||||||
|
return systemServer({ |
||||||
|
url: '/user/update-status', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
// 获取用户精简信息列表
|
||||||
|
export const getSimpleUserList = () => { |
||||||
|
return systemServer<UserSimple[]>({ |
||||||
|
url: '/user/simple-list', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
} |
@ -0,0 +1,75 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
export interface ProfileVO { |
||||||
|
id: number |
||||||
|
username: string |
||||||
|
nickname: string |
||||||
|
dept: { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
} |
||||||
|
roles: { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
}[] |
||||||
|
posts: { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
}[] |
||||||
|
socialUsers: { |
||||||
|
type: number |
||||||
|
openid: string |
||||||
|
}[] |
||||||
|
email: string |
||||||
|
mobile: string |
||||||
|
sex: number |
||||||
|
avatar: string |
||||||
|
status: number |
||||||
|
remark: string |
||||||
|
loginIp: string |
||||||
|
loginDate: Date |
||||||
|
createTime: Date |
||||||
|
} |
||||||
|
|
||||||
|
export interface UserProfileUpdateReqVO { |
||||||
|
nickname: string |
||||||
|
email: string |
||||||
|
mobile: string |
||||||
|
sex: number |
||||||
|
} |
||||||
|
|
||||||
|
// 查询用户个人信息
|
||||||
|
export const getUserProfile = () => |
||||||
|
systemServer({ |
||||||
|
url: '/user/profile/get', |
||||||
|
method: 'get', |
||||||
|
}) |
||||||
|
|
||||||
|
// 修改用户个人信息
|
||||||
|
export const updateUserProfile = (data: UserProfileUpdateReqVO) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/profile/update', |
||||||
|
method: 'put', |
||||||
|
data, |
||||||
|
}) |
||||||
|
|
||||||
|
// 用户密码重置
|
||||||
|
export const updateUserPassword = (oldPassword: string, newPassword: string) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/profile/update-password', |
||||||
|
method: 'put', |
||||||
|
data: { |
||||||
|
oldPassword, |
||||||
|
newPassword, |
||||||
|
}, |
||||||
|
}) |
||||||
|
|
||||||
|
// 用户头像上传
|
||||||
|
export const uploadAvatar = (data: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/user/profile/update-avatar', |
||||||
|
data, |
||||||
|
method: 'post', |
||||||
|
headers: { |
||||||
|
'Content-Type': 'multipart/form-data', |
||||||
|
}, |
||||||
|
}) |
@ -0,0 +1,30 @@ |
|||||||
|
import { systemServer } from '../../index' |
||||||
|
// 社交绑定,使用 code 授权码
|
||||||
|
export const socialBind = (type: any, code: any, state: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/social-user/bind', |
||||||
|
method: 'post', |
||||||
|
data: { |
||||||
|
type, |
||||||
|
code, |
||||||
|
state, |
||||||
|
}, |
||||||
|
}) |
||||||
|
|
||||||
|
// 取消社交绑定
|
||||||
|
export const socialUnbind = (type: any, openid: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/social-user/unbind', |
||||||
|
method: 'delete', |
||||||
|
data: { |
||||||
|
type, |
||||||
|
openid, |
||||||
|
}, |
||||||
|
}) |
||||||
|
|
||||||
|
// 社交授权的跳转
|
||||||
|
export const socialAuthRedirect = (type: any, redirectUri: any) => |
||||||
|
systemServer({ |
||||||
|
url: '/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri, |
||||||
|
method: 'get', |
||||||
|
}) |
@ -0,0 +1,235 @@ |
|||||||
|
import type { |
||||||
|
AxiosInstance, |
||||||
|
AxiosRequestConfig, |
||||||
|
AxiosRequestHeaders, |
||||||
|
AxiosResponse, |
||||||
|
InternalAxiosRequestConfig, |
||||||
|
} from 'axios' |
||||||
|
|
||||||
|
import qs from 'qs' |
||||||
|
import Keys from '../Keys' |
||||||
|
import { useMessage } from '@/hooks/useMessage' |
||||||
|
import axios, { AxiosError, isCancel } from 'axios' |
||||||
|
import { |
||||||
|
getRefreshToken, |
||||||
|
getTenantId, |
||||||
|
getToken, |
||||||
|
removeToken, |
||||||
|
setToken, |
||||||
|
} from '@/utils/auth' |
||||||
|
import { authErrMap, ignoreMsgs, networkErrMap } from '../basic/utils' |
||||||
|
import type { Result } from '../basic/httpTypes' |
||||||
|
import type { APIConfigKeys } from './config' |
||||||
|
import { openSocket, closeSocket } from '@/pages/socket_server/index' |
||||||
|
import { RouterView, useRouter } from 'vue-router' |
||||||
|
import { deleteUserCache } from '@/hooks/useCache' |
||||||
|
const router = useRouter() |
||||||
|
|
||||||
|
const VITE_BASE_API_SYSTEM = import.meta.env.VITE_BASE_API_SYSTEM |
||||||
|
const message = useMessage() |
||||||
|
const basicHeader = { |
||||||
|
tenant() { |
||||||
|
const tenant = getTenantId() |
||||||
|
if (tenant) return tenant |
||||||
|
return '' |
||||||
|
}, |
||||||
|
token() { |
||||||
|
const token = getToken() |
||||||
|
if (token) return 'Bearer ' + token |
||||||
|
return '' |
||||||
|
}, |
||||||
|
testToken: 'Bearer test', |
||||||
|
} |
||||||
|
interface Config { |
||||||
|
baseURL?: string |
||||||
|
baseAPI: string |
||||||
|
} |
||||||
|
const instances: Record<string, AxiosInstance> = {} |
||||||
|
let isRefreshToken = false // 是否正在刷新中
|
||||||
|
let requestList: any[] = [] // 请求队列
|
||||||
|
|
||||||
|
const createAxiosInstance = (module: APIConfigKeys, config: Config) => { |
||||||
|
if (!config || !config.baseAPI) { |
||||||
|
throw new Error(`Invalid configuration for module: ${module}`) |
||||||
|
} |
||||||
|
const { baseAPI } = config |
||||||
|
|
||||||
|
if (!instances[module]) { |
||||||
|
const instance = axios.create({ |
||||||
|
baseURL: `${baseAPI}`, |
||||||
|
timeout: 10000, |
||||||
|
headers: { |
||||||
|
'Content-Type': 'application/json', |
||||||
|
}, |
||||||
|
}) |
||||||
|
|
||||||
|
instances[module] = instance |
||||||
|
} |
||||||
|
|
||||||
|
const service = instances[module] |
||||||
|
|
||||||
|
service.interceptors.request.use( |
||||||
|
(config: InternalAxiosRequestConfig): InternalAxiosRequestConfig => { |
||||||
|
config.headers.Authorization = basicHeader.token() |
||||||
|
// config.headers['tenant-id'] = basicHeader.tenant()
|
||||||
|
const params = config.params || {} |
||||||
|
const data = config.data || false |
||||||
|
if ( |
||||||
|
config.method?.toUpperCase() === 'POST' && |
||||||
|
(config.headers as AxiosRequestHeaders)['Content-Type'] === |
||||||
|
'application/x-www-form-urlencoded' |
||||||
|
) { |
||||||
|
config.data = qs.stringify(data) |
||||||
|
} |
||||||
|
|
||||||
|
if (config.method?.toUpperCase() === 'GET' && params) { |
||||||
|
config.params = {} |
||||||
|
const paramsStr = qs.stringify(params, { allowDots: true }) |
||||||
|
if (paramsStr) { |
||||||
|
config.url = config.url + '?' + paramsStr |
||||||
|
} |
||||||
|
} |
||||||
|
return config |
||||||
|
}, |
||||||
|
(error: AxiosError): Promise<AxiosError> => { |
||||||
|
return Promise.reject(error) |
||||||
|
} |
||||||
|
) |
||||||
|
|
||||||
|
service.interceptors.response.use( |
||||||
|
async (res: AxiosResponse) => { |
||||||
|
const config = res.config |
||||||
|
let { data } = res |
||||||
|
if (!res.data) { |
||||||
|
throw new Error('返回“[HTTP]请求没有返回值”') |
||||||
|
} |
||||||
|
if ( |
||||||
|
res.request.responseType === 'blob' || |
||||||
|
res.request.responseType === 'arraybuffer' |
||||||
|
) { |
||||||
|
// 注意:如果导出的响应为 json,说明可能失败了,不直接返回进行下载
|
||||||
|
if (res.data.type !== 'application/json') { |
||||||
|
return Promise.resolve({ code: res.status, data: res.data }) |
||||||
|
} |
||||||
|
data = await new Response(res.data).json() |
||||||
|
} |
||||||
|
const code = data.code || 200 |
||||||
|
const msg = data.msg || authErrMap[code] || authErrMap['default'] |
||||||
|
|
||||||
|
if (ignoreMsgs.indexOf(msg) !== -1) { |
||||||
|
// 如果是忽略的错误码,直接返回 msg 异常
|
||||||
|
return Promise.reject({ code: null, msg }) |
||||||
|
} else if (code === 401) { |
||||||
|
if (!isRefreshToken) { |
||||||
|
isRefreshToken = true |
||||||
|
if (!getRefreshToken()) logout() |
||||||
|
try { |
||||||
|
const refreshTokenRes = await refreshToken() |
||||||
|
if (refreshTokenRes.data.code !== 0) { |
||||||
|
logout() |
||||||
|
return Promise.reject({ code, msg }) |
||||||
|
} |
||||||
|
setToken(refreshTokenRes.data.data.accessToken) |
||||||
|
config.headers!.Authorization = 'Bearer ' + getToken() |
||||||
|
requestList.forEach((cb: any) => { |
||||||
|
cb() |
||||||
|
}) |
||||||
|
requestList = [] |
||||||
|
// 重连接socket
|
||||||
|
openSocket() |
||||||
|
return service(config) |
||||||
|
} catch (e) { |
||||||
|
logout() |
||||||
|
return Promise.reject({ code, msg }) |
||||||
|
} finally { |
||||||
|
requestList = [] |
||||||
|
isRefreshToken = false |
||||||
|
} |
||||||
|
} else { |
||||||
|
return new Promise(resolve => { |
||||||
|
requestList.push(() => { |
||||||
|
config.headers!.Authorization = 'Bearer ' + getToken() |
||||||
|
resolve(service(config)) |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
} else if (code === 500) { |
||||||
|
return Promise.reject({ code, msg }) |
||||||
|
} else if (code !== 200) { |
||||||
|
// if (msg === '无效的刷新令牌') {
|
||||||
|
// // hard coding:忽略这个提示,直接登出
|
||||||
|
// console.log(msg)
|
||||||
|
// } else {
|
||||||
|
// ElMessage.error(msg)
|
||||||
|
// }
|
||||||
|
return Promise.reject({ code, msg }) |
||||||
|
} |
||||||
|
|
||||||
|
return data |
||||||
|
}, |
||||||
|
(error: any): Promise<any> => { |
||||||
|
if (isCancel(error)) { |
||||||
|
return Promise.resolve() |
||||||
|
} |
||||||
|
const message = '请求错误' |
||||||
|
if (error.code === 'ECONNABORTED') { |
||||||
|
return Promise.reject({ code: null, msg: '服务器响应超时' }) |
||||||
|
} |
||||||
|
if (!error.response) { |
||||||
|
return Promise.reject({ code: null, msg: message }) |
||||||
|
} |
||||||
|
|
||||||
|
const status = error.response?.status |
||||||
|
const unKnowError = `连接出错(${error.response.status})!` |
||||||
|
if (status === 401) { |
||||||
|
localStorage.removeItem(Keys.STORAGE_TOKEN) |
||||||
|
router.push('/login') |
||||||
|
} |
||||||
|
|
||||||
|
const msg = networkErrMap[status] ? networkErrMap[status] : unKnowError |
||||||
|
|
||||||
|
return Promise.reject({ code: status || null, msg: msg }) |
||||||
|
} |
||||||
|
) |
||||||
|
|
||||||
|
if (!service) { |
||||||
|
throw new Error(`Failed to create Axios instance for module: ${module}`) |
||||||
|
} |
||||||
|
|
||||||
|
const refreshToken = async () => { |
||||||
|
// axios.defaults.headers.common['tenant-id'] = getTenantId()
|
||||||
|
return await axios.post( |
||||||
|
`${VITE_BASE_API_SYSTEM}/auth/refresh-token?refreshToken=` + getRefreshToken() |
||||||
|
) |
||||||
|
} |
||||||
|
|
||||||
|
async function request<T = any>(config: AxiosRequestConfig): Promise<Result<T>> { |
||||||
|
try { |
||||||
|
const result = (await service(config)) as Result<T> |
||||||
|
return result |
||||||
|
} catch (err: any) { |
||||||
|
const result: Result<T> = { |
||||||
|
code: err?.code || -1, |
||||||
|
msg: err.msg || err.message, |
||||||
|
data: err.data || null, |
||||||
|
} |
||||||
|
return result |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return request |
||||||
|
} |
||||||
|
|
||||||
|
let isShowLogout = false |
||||||
|
async function logout() { |
||||||
|
if (isShowLogout) return |
||||||
|
isShowLogout = true |
||||||
|
|
||||||
|
await message.forceConfirm('登录状态已失效,请重新登录', '系统提示', '重新登录') |
||||||
|
removeToken() |
||||||
|
isShowLogout = false |
||||||
|
deleteUserCache() |
||||||
|
window.location.href = '/login' |
||||||
|
} |
||||||
|
|
||||||
|
export default createAxiosInstance |
@ -0,0 +1,21 @@ |
|||||||
|
export interface APIConfig { |
||||||
|
system: Config |
||||||
|
eam: Config |
||||||
|
} |
||||||
|
|
||||||
|
interface Config { |
||||||
|
baseURL?: string |
||||||
|
baseAPI: string |
||||||
|
} |
||||||
|
|
||||||
|
const API_Config: APIConfig = { |
||||||
|
system: { |
||||||
|
baseAPI: import.meta.env.VITE_BASE_API_SYSTEM, |
||||||
|
}, |
||||||
|
eam: { |
||||||
|
baseAPI: import.meta.env.VITE_BASE_API_EAM, |
||||||
|
}, |
||||||
|
} |
||||||
|
|
||||||
|
export type APIConfigKeys = keyof typeof API_Config |
||||||
|
export { API_Config } |
@ -0,0 +1,10 @@ |
|||||||
|
* { |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
} |
||||||
|
html, |
||||||
|
body, |
||||||
|
#app { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
} |
After Width: | Height: | Size: 615 B |
After Width: | Height: | Size: 669 B |
After Width: | Height: | Size: 557 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 371 B |
After Width: | Height: | Size: 421 B |
After Width: | Height: | Size: 440 B |
After Width: | Height: | Size: 305 B |
After Width: | Height: | Size: 507 B |
After Width: | Height: | Size: 264 B |
After Width: | Height: | Size: 524 B |
After Width: | Height: | Size: 419 B |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 820 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 707 B |
After Width: | Height: | Size: 847 B |
After Width: | Height: | Size: 737 B |
After Width: | Height: | Size: 684 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 813 B |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 806 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 878 B |