asai-vue-host 0.2.60 → 0.2.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -151
- package/dist/AsPageBusy-B_7qKMBg.mjs +49 -0
- package/dist/{AsPageBusyGif-Bz4I7tCT.mjs → AsPageBusyGif-BeO4ftmK.mjs} +11 -11
- package/dist/AsaiInitPage-DsfL7ANH.mjs +103 -0
- package/dist/PageErr-D-sxK1Ej.mjs +38 -0
- package/dist/PageLoadClient-p3m-9ZT6.mjs +44 -0
- package/dist/PageLoadErr-B9gRqsS7.mjs +35 -0
- package/dist/PageLoadServer-_f8otQMk.mjs +33 -0
- package/dist/PageLoadUserToken-COisXxiM.mjs +33 -0
- package/dist/PageLoadUserTokenOnline-C4poWeJs.mjs +33 -0
- package/dist/PageLoadWs-lrg51L6x.mjs +35 -0
- package/dist/asai-vue-host.css +1 -1
- package/dist/asai-vue-host.es.js +452 -391
- package/dist/asai-vue-host.umd.js +4 -3
- package/dist/components/asengine/common/As.d.ts +0 -5
- package/dist/components/asengine/common/AsRouter.d.ts +0 -7
- package/dist/components/asengine/provide/useProvide.d.ts +0 -15
- package/dist/components/asengine/shared/webLogGuard.d.ts +9 -0
- package/package.json +1 -1
- package/dist/AsPageBusy-CxJAwG3n.mjs +0 -51
- package/dist/AsPageLoading-B9gYJ9mc.mjs +0 -4
- package/dist/AsPageLoading.vue_vue_type_script_setup_true_lang-D6ucjG6K.mjs +0 -49
- package/dist/AsaiInitPage-CyZi4FaH.mjs +0 -102
- package/dist/PageErr-B_UHmHgG.mjs +0 -21
- package/dist/PageLoadClient-CNOJ8Yha.mjs +0 -14
- package/dist/PageLoadErr-D-nR7OhR.mjs +0 -28
- package/dist/PageLoadServer-Y-ZcktpI.mjs +0 -14
- package/dist/PageLoadUserToken-DE2zZ5w0.mjs +0 -26
- package/dist/PageLoadUserTokenOnline-D3X9RycI.mjs +0 -26
- package/dist/PageLoadWs-C5Cbzmu3.mjs +0 -28
- package/dist/components/asui/common/AsPageLoading.vue.d.ts +0 -17
package/README.md
CHANGED
|
@@ -2,189 +2,109 @@
|
|
|
2
2
|
|
|
3
3
|
## 包信息
|
|
4
4
|
|
|
5
|
-
| 建议 npm 名 | 入口文件 | 注入键 | 类型 |
|
|
5
|
+
| 建议 npm 名 | 入口文件 | $fn / 注入键 | 类型 |
|
|
6
6
|
|------------|---------|-------------|------|
|
|
7
|
-
| `@estun/asai-vue-host` | `src/components/index.ts` | `$engineasai`(
|
|
7
|
+
| `@estun/asai-vue-host` | `src/components/index.ts` | `$engineasai`(provide/inject) | Host |
|
|
8
8
|
|
|
9
9
|
## 概述
|
|
10
10
|
|
|
11
|
-
`asai-vue-host` 是 AsaiWeb CMS
|
|
12
|
-
|
|
13
|
-
- 装配并 `provide('$ujtasai')` 全局运行时上下文(`$db / $dbwork / $ws / $global / $model / $fn`)
|
|
14
|
-
- 应用启动流程(`initweb`):加载 webmodel、解析路由配置、建立连接、初始化国际化
|
|
15
|
-
- 无框架 **Hash / History 路由**分发(`AsRouter` + `RouterView.vue`),不依赖 vue-router
|
|
16
|
-
- 通用工具集(`As`):URL、Cookie、本地缓存、时间、序列化、节流防抖、深拷贝等
|
|
17
|
-
- 全局组件懒加载注册(`asui/*/*.vue`:模块容器、加载/错误页、404 等)
|
|
18
|
-
|
|
19
|
-
> 配套宿主插件:`asai-vue-host-base`(`$engineasai1`:API/WS/心跳/AES)、`asai-vue-host-channel`(`$engineasai2`:频道)、`-form` / `-popbox` / `-directives`(全局组件与指令)。它们在 `$fn.initweb()` 时被合并进 `$fn`。
|
|
11
|
+
`asai-vue-host` 是 AsaiWeb CMS 的**核心应用宿主框架**,提供应用加载、模块管理、Hash 路由分发、WebSocket 通信和数据库响应式 Provide。是整个前端架构的运行容器。
|
|
20
12
|
|
|
21
13
|
## 集成方式
|
|
22
14
|
|
|
23
15
|
```typescript
|
|
24
16
|
// monorepo — webclient/src/utils/index.ts
|
|
25
17
|
import AsaiVueHost from '../plugs/asai-vue-host/src/components/index';
|
|
26
|
-
//
|
|
18
|
+
// import '/node_modules/asai-vue-host/dist/asai-vue-host.css';
|
|
19
|
+
// npm
|
|
20
|
+
// import AsaiVueHost from '@estun/asai-vue-host';
|
|
27
21
|
|
|
28
|
-
installModules.forEach((module) => module.install(app, lib));
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
```typescript
|
|
32
|
-
// App.vue —— 仅执行一次,注入全局上下文
|
|
33
|
-
import useProvide from '../plugs/asai-vue-host/.../asengine/provide/useProvide';
|
|
34
|
-
const { $ujtasai } = useProvide({ plugs: { /* 同步功能插件 */ } });
|
|
22
|
+
installModules.forEach((module) => module.install(app, lib));
|
|
35
23
|
```
|
|
36
24
|
|
|
37
25
|
## 独立性约束
|
|
38
26
|
|
|
39
|
-
- **禁止** cross-import 其它 `plugs
|
|
40
|
-
- 通过 `LibInit` 传入的 `loadts` / `loadvue` / `loadfn` 与宿主 app
|
|
41
|
-
- ⚠️ `loadts` 按**文件名**注册键(`path.split('/').pop().slice(0,-3)`)。`asengine/common/*.ts` 会被 eager glob 注册为 `$engineasai.<文件名>`,故**不要**在该目录放置临时/重命名副本文件(如 `AsAES copy.ts`),否则会污染 `$fn` 键空间。
|
|
42
|
-
|
|
43
|
-
## 文件结构
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
asai-vue-host/src/components/
|
|
47
|
-
├── index.ts # install 入口(loadts $engineasai + loadvue asui)
|
|
48
|
-
├── asengine/
|
|
49
|
-
│ ├── common/
|
|
50
|
-
│ │ ├── As.ts # → $fn.As 通用工具集(无状态)
|
|
51
|
-
│ │ └── AsRouter.ts # → $fn.AsRouter Hash/History 路由器
|
|
52
|
-
│ ├── init/useInitApp.ts # → $fn.useInitApp 业务模块按需安装
|
|
53
|
-
│ └── provide/
|
|
54
|
-
│ ├── useProvide.ts # 装配 $ujtasai 并 provide(核心启动)
|
|
55
|
-
│ ├── providedb / providedbwork / providews / provideglobal / providefn
|
|
56
|
-
│ └── (响应式数据域默认值)
|
|
57
|
-
└── asui/ # 全局组件(loadvue 懒加载,按文件名注册)
|
|
58
|
-
├── app/ AsaiWebServer / AsaiWebModule / AsaiWebItemIndex …
|
|
59
|
-
├── common/ RouterView / RouterMap / AsPageBusy / AsSvg / VirtualList …
|
|
60
|
-
└── page/ PageLoadWs / PageLoadErr / PageLoadServer …
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## 安装入口(install)
|
|
27
|
+
- **禁止** cross-import 其它 `plugs/*`。
|
|
28
|
+
- 通过 `LibInit` 传入的 `loadts` / `loadvue` / `loadfn` 与宿主 app 耦合,不反向依赖 Feature 插件。
|
|
64
29
|
|
|
65
|
-
|
|
66
|
-
install(app, opt) {
|
|
67
|
-
opt.loadts({ app, key: '$engineasai', eager: true,
|
|
68
|
-
files: import.meta.glob(['./asengine/common/*.ts', './asengine/*/use*.ts'], { eager: true }) });
|
|
69
|
-
opt.loadvue({ loadfn: opt.loadfn, app, eager: false,
|
|
70
|
-
files: import.meta.glob(['./asui/*/*.vue']) }); // 首次渲染才拉 chunk
|
|
71
|
-
}
|
|
72
|
-
```
|
|
30
|
+
## 主要 API / 导出
|
|
73
31
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
| 域 | 来源 | 说明 |
|
|
77
|
-
|----|------|------|
|
|
78
|
-
| `$db` | providedb | IndexedDB / 业务响应式数据 |
|
|
79
|
-
| `$dbwork` | providedbwork | 数据库工作态 |
|
|
80
|
-
| `$ws` | providews | WebSocket 响应式数据 |
|
|
81
|
-
| `$global` | provideglobal | `sys / config / user / code / location / pop / link / theme / keyboard …` |
|
|
82
|
-
| `$model` | `window.$GYS.$webmodel` | webmodel 模型与组件表(`comps`) |
|
|
83
|
-
| `$fn` | providefn + 各插件合并 | 全部平台功能函数(见下) |
|
|
84
|
-
|
|
85
|
-
## 核心 API:`$fn`(useProvide 挂载)
|
|
86
|
-
|
|
87
|
-
| 函数 | 签名 | 说明 |
|
|
88
|
-
|------|------|------|
|
|
89
|
-
| `initweb(insProxy)` | `async (insProxy) => void` | **应用启动**:合并引擎、加载 `sys/dirglobal.json`、版本校验、`dirmodel.json`、路由配置合并、`initLink`、初始化 hash 路由 |
|
|
90
|
-
| `offweb()` | `() => void` | 卸载路由监听 |
|
|
91
|
-
| `initLink(type?)` | `(0\|1) => Promise<link>` | 解析 `sys/server.json` 为 `$global.link`(含缓存 `as-link`) |
|
|
92
|
-
| `startLink()` / `saveLink(data)` | — | 强制重新解析 / 直接写入连接表 |
|
|
93
|
-
| `lg(path, params?)` | `(string, string\|string[]) => string` | 取国际化文案,`$1/$2` 占位符替换(路径解析带 Map 缓存) |
|
|
94
|
-
| `initlang(langty?)` / `changelang(langty?)` | `=> Promise` | 初始化 / 切换语言包(`auto` 在两语言间切换) |
|
|
95
|
-
| `initver()` | `() => boolean` | `$global.sys.webver` 变化时清缓存刷新 |
|
|
96
|
-
| `lo(...args)` / `$log(data)` / `logSave(data)` | — | 带样式 console / 写入后端日志(`/api/asailog/manage/addclient/`) |
|
|
97
|
-
| `inittoken()` / `gettoken(type?)` | — | 由 `code.pri/pub` + 用户信息生成 `us##lv##pub` token |
|
|
98
|
-
| `login()` / `exit(type?)` | — | 清空 `as-user-info` 与会话,跳登录 / 退出 |
|
|
99
|
-
| `checkOnline()` | `=> Promise` | WS `ping/pong` 在线探测 |
|
|
100
|
-
| `setquery(value, type?)` / `sethash(value)` | — | 改写地址栏 query / hash(History 模式用 pushState) |
|
|
101
|
-
| `getWebPath(path)` | `(string) => string` | 拼接 `$cfg.webpath` 前缀 |
|
|
102
|
-
| `initmodel(url, prefix?)` | — | 由 `AsaiModel` 拉取 `webmodel/` 模型 |
|
|
103
|
-
|
|
104
|
-
## 核心 API:`$fn.As`(通用工具集)
|
|
105
|
-
|
|
106
|
-
| 分组 | 方法 |
|
|
32
|
+
| 导出 | 说明 |
|
|
107
33
|
|------|------|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
| DOM/全屏 | `fullScreen/fullScreenExit/fullScreenDo`、`eStop(e)` |
|
|
113
|
-
| 数据结构 | `treeToMap(tree, opt)`(迭代平铺为 `{nodeMap, depthMap}`,支持过滤)、`arrLenMax`、`toArr` |
|
|
114
|
-
| 路径/校验 | `getPath` / `getName`(白名单过滤)、`isValidFileName`、`setObjValByPath`(**已防原型链污染**) |
|
|
115
|
-
| 时间 | `getTime(type, timenow)`、`toFormTime` / `fromFormTime` |
|
|
116
|
-
| 序列化 | `toObj` / `toStr`(防循环引用)、`toNum` / `toNums` |
|
|
117
|
-
| 唯一 ID | `Uuid(prefix, index, hex)`(`crypto.getRandomValues` 随机位,16 位) |
|
|
118
|
-
| 性能 | `debounce(fn, opt)`、`throttle(fn, opt)`(`opt` 持有 `timeout/wait/immediate`) |
|
|
119
|
-
| 剪贴板 | `copyToClipboard` / `readFromClipboard`(localStorage 兼容方案) |
|
|
120
|
-
| 深拷贝 | `DeepClone(obj)`(WeakMap 防环,支持 Date/RegExp/Map/Set) |
|
|
121
|
-
| 远程 | `apiJsonp(url, callback)`(script 标签 JSONP,回调名随机,完成后清理) |
|
|
122
|
-
|
|
123
|
-
## 核心 API:`$fn.AsRouter`(无框架路由)
|
|
124
|
-
|
|
125
|
-
| 方法 | 说明 |
|
|
126
|
-
|------|------|
|
|
127
|
-
| `initHash(routerdata)` / `offHash()` | 绑定 / 移除 `popstate`(History)或 `hashchange`(Hash)监听 |
|
|
128
|
-
| `setHash(routerdata, value)` | 改写地址(History `pushState` 或 `location.hash`) |
|
|
129
|
-
| `setHref / getHref` | 整页跳转 / 读取 URL |
|
|
130
|
-
| `getQuery(routerdata, str?)` | 解析 query(**已修正含 `=` 的值截断与非法编码**) |
|
|
131
|
-
| `getHasharr(routerdata)` | hash → 路径数组(去尾空段、分离 query) |
|
|
132
|
-
| `setRouter(routerdata)` | hash → comps:`#/a/b/c` → [`a/index`, `a/b/index`, `a/b/c/default`] |
|
|
133
|
-
| `setTitle(title, ujt)` | 设置文档标题(拼接站点大标题) |
|
|
34
|
+
| `install(app, opt)` | Vue 插件安装入口 |
|
|
35
|
+
| Provide `$engineasai` | 主引擎 composable 与工具 |
|
|
36
|
+
| `providedb` / `providews` / `providefn` / `providedbwork` | 全局 Provide 键 |
|
|
37
|
+
| 全局组件 | `asui/*/*.vue` 懒加载注册(AsaiWebModule、PageLoad* 等) |
|
|
134
38
|
|
|
135
|
-
|
|
39
|
+
## 性能说明
|
|
136
40
|
|
|
137
|
-
|
|
41
|
+
- TS 模块(`asengine`)**eager** 加载;Vue 组件 **lazy**(`eager: false`),首次渲染拉 chunk。
|
|
42
|
+
- 核心首屏组件若出现白屏闪烁,可在业务侧对关键组件单独 eager。
|
|
138
43
|
|
|
139
|
-
|
|
140
|
-
|------|------|
|
|
141
|
-
| `RouterView` / `RouterMap` | Hash 路由视图 / 路由映射 |
|
|
142
|
-
| `AsaiWebServer` / `AsaiWebModule` / `AsaiWebItemIndex` | 服务器连接 / 模块容器 / 应用主入口 |
|
|
143
|
-
| `PageLoadWs` / `PageLoadServer` / `PageLoadErr` / `PageErr` | 连接与错误页 |
|
|
144
|
-
| `AsPageBusy` / `AsLoadingCircle` / `AsLoadingA3d` / `AsPageBusyGif` | 加载动画 |
|
|
145
|
-
| `Asai404` | 404 页面 |
|
|
146
|
-
| `AsSvg` / `VirtualList` / `MenuShowFix` / `AsReset` | SVG / 虚拟列表 / 菜单 / 样式重置 |
|
|
44
|
+
## peerDependencies 建议
|
|
147
45
|
|
|
148
|
-
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"vue": "^3.4.0",
|
|
50
|
+
"vue-router": "^4.0.0"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
149
54
|
|
|
150
|
-
|
|
151
|
-
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 功能
|
|
152
58
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
59
|
+
- 应用启动、模块管理、Hash 路由分发
|
|
60
|
+
- WebSocket 连接管理与事件系统
|
|
61
|
+
- IndexedDB / 本地数据响应式 Provide
|
|
62
|
+
- 加载状态与错误页面(404、PageLoadErr 等)
|
|
156
63
|
|
|
157
|
-
|
|
158
|
-
$fn.lg('sys.webtit'); // 取词
|
|
159
|
-
$fn.lg('user.hello', [name]); // 占位符 $1 → name
|
|
160
|
-
await $fn.changelang('auto');
|
|
64
|
+
## 文件结构
|
|
161
65
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
66
|
+
```
|
|
67
|
+
asai-vue-host/
|
|
68
|
+
├── src/components/
|
|
69
|
+
│ ├── index.ts # install 入口
|
|
70
|
+
│ ├── asengine/provide/ # providedb / providews / providefn
|
|
71
|
+
│ └── asui/ # app / common / page 组件
|
|
72
|
+
└── README.md
|
|
166
73
|
```
|
|
167
74
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
75
|
+
## 安装方式
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
app.use(AsaiVueHost, {
|
|
79
|
+
loadts: (options) => { /* 加载 TypeScript 模块 */ },
|
|
80
|
+
loadvue: (options) => { /* 加载 Vue 组件 */ },
|
|
81
|
+
loadfn: (path) => { /* 加载函数 */ },
|
|
82
|
+
});
|
|
171
83
|
```
|
|
172
84
|
|
|
173
|
-
##
|
|
85
|
+
## Provide 系统
|
|
174
86
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
87
|
+
| Provide Key | 说明 |
|
|
88
|
+
|-------------|------|
|
|
89
|
+
| `$engineasai` | 主引擎上下文 |
|
|
90
|
+
| `providedb` | 数据库响应式数据 |
|
|
91
|
+
| `providews` | WebSocket 数据 |
|
|
92
|
+
| `providefn` | 功能函数 |
|
|
93
|
+
| `providedbwork` | 数据库工作线程 |
|
|
179
94
|
|
|
180
|
-
##
|
|
95
|
+
## 核心组件
|
|
181
96
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
97
|
+
| 组件 | 说明 |
|
|
98
|
+
|------|------|
|
|
99
|
+
| `AsaiWebServer` | 服务器连接管理 |
|
|
100
|
+
| `AsaiWebModule` | 模块容器 |
|
|
101
|
+
| `AsaiWebItemIndex` | 应用主入口 |
|
|
102
|
+
| `AsPageBusy` / `AsLoadingCircle` | 加载动画 |
|
|
103
|
+
| `PageLoadWs` / `PageLoadErr` | 连接/错误页 |
|
|
104
|
+
| `Asai404` | 404 页面 |
|
|
185
105
|
|
|
186
|
-
##
|
|
106
|
+
## 技术细节
|
|
187
107
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
108
|
+
- Vue 插件 `install(app, opt)` 模式
|
|
109
|
+
- `import.meta.glob` 自动发现并注册组件
|
|
110
|
+
- 异步组件按需加载减少首屏体积
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineComponent as g, useCssVars as m, computed as v, resolveComponent as f, resolveDirective as b, withDirectives as x, createCommentVNode as i, unref as s, createElementBlock as u, openBlock as r, createElementVNode as p, withModifiers as B, createVNode as k, toDisplayString as C } from "vue";
|
|
2
|
+
import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
3
|
+
const j = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "as-pagebusy-area touch-none"
|
|
6
|
+
}, A = { class: "as-pagebusy" }, w = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "as-pagebusy-v"
|
|
9
|
+
}, P = /* @__PURE__ */ g({
|
|
10
|
+
__name: "AsPageBusy",
|
|
11
|
+
props: {
|
|
12
|
+
ujt: {}
|
|
13
|
+
},
|
|
14
|
+
setup(t) {
|
|
15
|
+
m((d) => ({
|
|
16
|
+
v2189716e: n.value
|
|
17
|
+
}));
|
|
18
|
+
const l = t, { $global: e, $fn: o } = l.ujt, n = v(() => e.pagebusy?.zindex || 9999);
|
|
19
|
+
function a() {
|
|
20
|
+
o.popConfirm({
|
|
21
|
+
con: e.lang.asai.resetconfirm,
|
|
22
|
+
zindex: n.value + 1,
|
|
23
|
+
fn: () => {
|
|
24
|
+
e.pagebusy = null, o.As.localInit();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return (d, c) => {
|
|
29
|
+
const y = f("AsPageBusyGif"), _ = b("dbpointerdown");
|
|
30
|
+
return s(e).pagebusy ? x((r(), u("div", j, [
|
|
31
|
+
p("div", {
|
|
32
|
+
class: "as-pagebusy-close",
|
|
33
|
+
onClick: c[0] || (c[0] = B((V) => a(), ["stop"]))
|
|
34
|
+
}),
|
|
35
|
+
p("div", A, [
|
|
36
|
+
k(y, { ujt: t.ujt }, null, 8, ["ujt"]),
|
|
37
|
+
s(e).pagebusy?.v ? (r(), u("div", w, C(s(e).pagebusy?.v), 1)) : i("", !0)
|
|
38
|
+
])
|
|
39
|
+
])), [
|
|
40
|
+
[_, () => {
|
|
41
|
+
s(e).pagebusy?.keep || a();
|
|
42
|
+
}]
|
|
43
|
+
]) : i("", !0);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}), $ = /* @__PURE__ */ h(P, [["__scopeId", "data-v-3b86e9a1"]]);
|
|
47
|
+
export {
|
|
48
|
+
$ as default
|
|
49
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
const f = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as c, createElementBlock as l, openBlock as t, normalizeStyle as o, createStaticVNode as n, createBlock as i, unref as s } from "vue";
|
|
2
|
+
import { _ as u } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
3
|
+
const f = /* @__PURE__ */ c({
|
|
4
4
|
__name: "AsLoadingCircle",
|
|
5
5
|
props: {
|
|
6
6
|
ujt: {
|
|
@@ -16,10 +16,10 @@ const f = /* @__PURE__ */ i({
|
|
|
16
16
|
setup(e) {
|
|
17
17
|
return (d, a) => (t(), l("div", {
|
|
18
18
|
class: "as-load-gif",
|
|
19
|
-
style:
|
|
19
|
+
style: o({ width: e.size + "px", height: e.size + "px" })
|
|
20
20
|
}, null, 4));
|
|
21
21
|
}
|
|
22
|
-
}), r = /* @__PURE__ */
|
|
22
|
+
}), r = /* @__PURE__ */ u(f, [["__scopeId", "data-v-c5bf2081"]]), v = /* @__PURE__ */ c({
|
|
23
23
|
__name: "AsLoadingA3d",
|
|
24
24
|
props: {
|
|
25
25
|
ujt: {
|
|
@@ -35,12 +35,12 @@ const f = /* @__PURE__ */ i({
|
|
|
35
35
|
setup(e) {
|
|
36
36
|
return (d, a) => (t(), l("div", {
|
|
37
37
|
class: "a3d-wrapper",
|
|
38
|
-
style:
|
|
38
|
+
style: o({ "--cube-size": `${e.size}px`, "--half-size": `${e.size / 2}px` })
|
|
39
39
|
}, [...a[0] || (a[0] = [
|
|
40
|
-
|
|
40
|
+
n('<div class="a3d" data-v-4d1d2b0e><div class="a3d-face a3d-face-front" data-v-4d1d2b0e></div><div class="a3d-face a3d-face-back" data-v-4d1d2b0e></div><div class="a3d-face a3d-face-left" data-v-4d1d2b0e></div><div class="a3d-face a3d-face-right" data-v-4d1d2b0e></div><div class="a3d-face a3d-face-top" data-v-4d1d2b0e></div><div class="a3d-face a3d-face-bottom" data-v-4d1d2b0e></div></div>', 1)
|
|
41
41
|
])], 4));
|
|
42
42
|
}
|
|
43
|
-
}),
|
|
43
|
+
}), p = /* @__PURE__ */ u(v, [["__scopeId", "data-v-4d1d2b0e"]]), g = /* @__PURE__ */ c({
|
|
44
44
|
__name: "AsPageBusyGif",
|
|
45
45
|
props: {
|
|
46
46
|
ujt: {},
|
|
@@ -48,11 +48,11 @@ const f = /* @__PURE__ */ i({
|
|
|
48
48
|
},
|
|
49
49
|
setup(e) {
|
|
50
50
|
const d = e, { $global: a } = d.ujt;
|
|
51
|
-
return (
|
|
51
|
+
return (b, z) => e.opt?.ty || s(a).pagebusy?.ty ? (t(), i(p, {
|
|
52
52
|
key: 0,
|
|
53
53
|
size: e.opt?.size || s(a).pagebusy?.size,
|
|
54
54
|
ujt: e.ujt
|
|
55
|
-
}, null, 8, ["size", "ujt"])) : (t(),
|
|
55
|
+
}, null, 8, ["size", "ujt"])) : (t(), i(r, {
|
|
56
56
|
key: 1,
|
|
57
57
|
size: e.opt?.size || s(a).pagebusy?.size,
|
|
58
58
|
ujt: e.ujt
|
|
@@ -60,5 +60,5 @@ const f = /* @__PURE__ */ i({
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
g as default
|
|
64
64
|
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineComponent as W, inject as k, computed as S, reactive as C, onMounted as U, onBeforeUnmount as v, resolveComponent as f, createElementBlock as L, createBlock as u, unref as d, openBlock as l, Fragment as O, resolveDynamicComponent as $ } from "vue";
|
|
2
|
+
const P = /* @__PURE__ */ W({
|
|
3
|
+
__name: "AsaiInitPage",
|
|
4
|
+
props: {
|
|
5
|
+
appmodules: {},
|
|
6
|
+
ujt: {}
|
|
7
|
+
},
|
|
8
|
+
setup(a) {
|
|
9
|
+
const i = a, g = k("$vueProxy"), { $global: r, $fn: s, $model: b, $ws: y } = i.ujt;
|
|
10
|
+
b.appmodules = i.appmodules;
|
|
11
|
+
function w() {
|
|
12
|
+
let e = s.As?.localGet("as-user-code");
|
|
13
|
+
e && (e = s.As.toObj(e), r.code.pri = e[0], r.code.pub = e[1]), r.code.pri && s.As.localGet("as-user-info") && (r.user.info = s.As.toObj(s.AsAES.dec(s.As.localGet("as-user-info")))), s.inittoken();
|
|
14
|
+
}
|
|
15
|
+
function m() {
|
|
16
|
+
r?.sys?.onwebws && s.ws.web.wsListen({ ty: "publish/web" }, (e) => {
|
|
17
|
+
const t = e?.db?.lang, n = !!r.user?.info?.us;
|
|
18
|
+
t === "nousername" && !n || (e?.db?.lang && (e.db.langpm ? e.db.con = s.lg("asai.hostmsg." + e.db.lang, e.db.langpm) || e.db.con : e.db.con = s.lg("asai.hostmsg." + e.db.lang) || e.db.con), e?.db === "pong" ? s.ws.web.wsApi("ping").then((c) => {
|
|
19
|
+
}) : e?.db?.bs ? p(e.db.bs) : e?.db?.con && r?.msg?.fn?.(e.db), e?.db?.exit && n && s.exit());
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function j() {
|
|
23
|
+
const e = r.link?.ws?.web;
|
|
24
|
+
return !(!e || e.sec && !s.gettoken(0));
|
|
25
|
+
}
|
|
26
|
+
function p(e) {
|
|
27
|
+
if (Array.isArray(e) && e[0]?.[0])
|
|
28
|
+
try {
|
|
29
|
+
e.forEach((t) => {
|
|
30
|
+
s.As.setObjValByPath(y.wssys, t[0], t[1]);
|
|
31
|
+
});
|
|
32
|
+
} catch {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
r.rlv = S(() => !r.location.hash || r.location.hash == "/" || r.sys?.router?.rights?.lv0?.find((e) => r.location.hash.includes(e)) ? 0 : r.sys?.router?.rights?.lv1?.find((e) => r.location.hash.includes(e)) ? 1 : r.sys?.router?.rights?.lv2?.find((e) => r.location.hash.includes(e)) ? 2 : r.sys?.router?.rights?.lv3?.find((e) => r.location.hash.includes(e)) ? 3 : r.sys?.router?.config?.lv || 0);
|
|
36
|
+
function h(e, t) {
|
|
37
|
+
try {
|
|
38
|
+
console.error(t + " Error:", e);
|
|
39
|
+
let n = "";
|
|
40
|
+
e?.error?.stack && typeof e?.error?.stack == "string" ? n = e.error.stack : e?.error?.message && typeof e?.error?.message == "string" ? n = e.error.message : e?.message && typeof e?.message == "string" ? n = e.message : e?.reason?.message && typeof e?.reason?.message == "string" ? n = e.reason.message : e?.reason && typeof e?.reason == "string" ? n = e.reason : e && typeof e == "string" && (n = e), n && (n = "Web " + t + ` Error:
|
|
41
|
+
` + n, console.error(n), s.$log(n), r?.msg?.fn?.({
|
|
42
|
+
type: "err",
|
|
43
|
+
con: n
|
|
44
|
+
})), e.preventDefault();
|
|
45
|
+
} catch (n) {
|
|
46
|
+
console.error("Try Error:", n);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const o = C({
|
|
50
|
+
catchErrorUnhandledrejection: null,
|
|
51
|
+
catchErrorCatch: null
|
|
52
|
+
});
|
|
53
|
+
return U(() => {
|
|
54
|
+
s.initweb(g).then(() => {
|
|
55
|
+
let e = [];
|
|
56
|
+
if (s?.useApi?.(i.ujt, "web"), r?.sys?.tyrobot && (s.useApi?.(i.ujt, r.sys.tyrobot), s.useWs?.(i.ujt, r.sys.tyrobot)), w(), r?.sys?.onwebws && (s.useWs?.(i.ujt, "web"), m(), j() && e.push(s.ws.web?.init?.())), r?.sys?.local?.lang || e.push(
|
|
57
|
+
s.initmodel("/sys/setting/settinglang.json").then((t) => {
|
|
58
|
+
typeof t?.data == "string" ? r.config.langcur = JSON.parse(t?.data || "{}")?.lang : r.config.langcur = (t?.data || {})?.lang;
|
|
59
|
+
})
|
|
60
|
+
), r?.sys?.aes?.lv && !r.sys.aesfns && s.AsaiVueAES?.useAES) {
|
|
61
|
+
const { toAES: t, fromAES: n } = s.AsaiVueAES.useAES(i.ujt);
|
|
62
|
+
r.sys.aesfns = { allaes: r.sys.aes.lv > 1, toAES: t, fromAES: n };
|
|
63
|
+
}
|
|
64
|
+
Promise.all(e).then(() => {
|
|
65
|
+
s.changelang(r.config.langcur).then((t) => {
|
|
66
|
+
!window?.$CFG?.title && r.lang.configweb?.webtit && (document.title = r.lang.configweb?.webtit), r.stat.webclient = 1, r.sys.catcherror && (o.catchErrorUnhandledrejection = (c) => {
|
|
67
|
+
h(c, "Unhandledrejection");
|
|
68
|
+
}, window?.addEventListener?.("unhandledrejection", o.catchErrorUnhandledrejection), o.catchErrorCatch = (c) => {
|
|
69
|
+
h(c, "Catch");
|
|
70
|
+
}, window?.addEventListener?.("error", o.catchErrorCatch));
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}), v(() => {
|
|
75
|
+
s.offweb(), r.sys.catcherror && (o.catchErrorUnhandledrejection && (window.removeEventListener("unhandledrejection", o.catchErrorUnhandledrejection), o.catchErrorUnhandledrejection = null), o.catchErrorCatch && (window.removeEventListener("error", o.catchErrorCatch), o.catchErrorCatch = null)), r?.sys?.onwebws || s.ws.web.wsListenOff({
|
|
76
|
+
ty: "publish/web"
|
|
77
|
+
});
|
|
78
|
+
}), (e, t) => {
|
|
79
|
+
const n = f("AsaiWebServer"), c = f("AsaiWebServerNode"), A = f("AsaiWebServerUser"), E = f("AsaiWebServerUserOnline");
|
|
80
|
+
return d(r).stat.webclient ? (l(), L(O, { key: 0 }, [
|
|
81
|
+
d(r).rlv === 0 ? (l(), u(n, {
|
|
82
|
+
key: 0,
|
|
83
|
+
ujt: a.ujt
|
|
84
|
+
}, null, 8, ["ujt"])) : d(r).rlv === 1 ? (l(), u(c, {
|
|
85
|
+
key: 1,
|
|
86
|
+
ujt: a.ujt
|
|
87
|
+
}, null, 8, ["ujt"])) : d(r).rlv === 2 ? (l(), u(A, {
|
|
88
|
+
key: 2,
|
|
89
|
+
ujt: a.ujt
|
|
90
|
+
}, null, 8, ["ujt"])) : (l(), u(E, {
|
|
91
|
+
key: 3,
|
|
92
|
+
ujt: a.ujt
|
|
93
|
+
}, null, 8, ["ujt"]))
|
|
94
|
+
], 64)) : (l(), u($("PageLoadClient"), {
|
|
95
|
+
key: 1,
|
|
96
|
+
ujt: a.ujt
|
|
97
|
+
}, null, 8, ["ujt"]));
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export {
|
|
102
|
+
P as default
|
|
103
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as n, createElementBlock as r, openBlock as i, createElementVNode as t, unref as l, toDisplayString as d } from "vue";
|
|
2
|
+
const c = { class: "as-load-area" }, p = ["src"], g = {
|
|
3
|
+
class: "tit",
|
|
4
|
+
style: { color: "var(--cz8)" }
|
|
5
|
+
}, _ = /* @__PURE__ */ n({
|
|
6
|
+
__name: "PageErr",
|
|
7
|
+
props: {
|
|
8
|
+
ujt: {}
|
|
9
|
+
},
|
|
10
|
+
setup(m) {
|
|
11
|
+
const o = window;
|
|
12
|
+
function s() {
|
|
13
|
+
o?.localStorage?.clear(), o?.location?.reload();
|
|
14
|
+
}
|
|
15
|
+
return (u, e) => (i(), r("div", c, [
|
|
16
|
+
t("img", {
|
|
17
|
+
onDblclick: e[0] || (e[0] = (a) => s()),
|
|
18
|
+
src: l(o).$CFG?.logo,
|
|
19
|
+
width: "200"
|
|
20
|
+
}, null, 40, p),
|
|
21
|
+
e[2] || (e[2] = t("div", { class: "as-load-icon" }, [
|
|
22
|
+
t("div", {
|
|
23
|
+
class: "as-load-gif",
|
|
24
|
+
style: { width: "68px", height: "68px" }
|
|
25
|
+
})
|
|
26
|
+
], -1)),
|
|
27
|
+
t("div", {
|
|
28
|
+
class: "as-load-msg",
|
|
29
|
+
onClick: e[1] || (e[1] = (a) => l(o)?.location?.reload())
|
|
30
|
+
}, [
|
|
31
|
+
t("div", g, d(l(o).$GYS?.$webmodel?.lang?.[l(o).$GYS?.$webmodel.lang.langty]?.pageerr), 1)
|
|
32
|
+
])
|
|
33
|
+
]));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
_ as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineComponent as r, ref as i, onMounted as c, createElementBlock as n, openBlock as s, createCommentVNode as u, createElementVNode as l } from "vue";
|
|
2
|
+
const m = { class: "as-load-area" }, p = ["src"], w = /* @__PURE__ */ r({
|
|
3
|
+
__name: "PageLoadClient",
|
|
4
|
+
props: {
|
|
5
|
+
ujt: {}
|
|
6
|
+
},
|
|
7
|
+
setup(g) {
|
|
8
|
+
const t = i("");
|
|
9
|
+
c(() => {
|
|
10
|
+
const e = window;
|
|
11
|
+
t.value = e?.$CFG?.logo || "";
|
|
12
|
+
});
|
|
13
|
+
function a() {
|
|
14
|
+
const e = window;
|
|
15
|
+
try {
|
|
16
|
+
e?.localStorage?.clear();
|
|
17
|
+
} catch {
|
|
18
|
+
console.warn("Failed to clear localStorage");
|
|
19
|
+
}
|
|
20
|
+
e?.location?.reload();
|
|
21
|
+
}
|
|
22
|
+
return (e, o) => (s(), n("div", m, [
|
|
23
|
+
t.value ? (s(), n("img", {
|
|
24
|
+
key: 0,
|
|
25
|
+
onDblclick: o[0] || (o[0] = (d) => a()),
|
|
26
|
+
src: t.value,
|
|
27
|
+
width: "200"
|
|
28
|
+
}, null, 40, p)) : u("", !0),
|
|
29
|
+
o[2] || (o[2] = l("div", { class: "as-load-icon" }, [
|
|
30
|
+
l("div", {
|
|
31
|
+
class: "as-load-gif",
|
|
32
|
+
style: { width: "68px", height: "68px" }
|
|
33
|
+
})
|
|
34
|
+
], -1)),
|
|
35
|
+
l("div", {
|
|
36
|
+
class: "as-load-msg",
|
|
37
|
+
onClick: o[1] || (o[1] = (d) => a())
|
|
38
|
+
}, "Loading...")
|
|
39
|
+
]));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
w as default
|
|
44
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as _, resolveComponent as a, createElementBlock as m, openBlock as p, createElementVNode as t, unref as o, createVNode as c, toDisplayString as i } from "vue";
|
|
2
|
+
const g = { class: "as-load-area" }, f = ["src"], j = { class: "as-load-icon" }, v = { class: "as-load-msg" }, h = {
|
|
3
|
+
class: "tit",
|
|
4
|
+
style: { color: "var(--cz8)" }
|
|
5
|
+
}, $ = /* @__PURE__ */ _({
|
|
6
|
+
__name: "PageLoadErr",
|
|
7
|
+
props: {
|
|
8
|
+
ujt: {},
|
|
9
|
+
type: {}
|
|
10
|
+
},
|
|
11
|
+
setup(e) {
|
|
12
|
+
const s = e, { $fn: r, $global: n } = s.ujt;
|
|
13
|
+
return (y, l) => {
|
|
14
|
+
const d = a("AsPageBusyGif"), u = a("AsReset");
|
|
15
|
+
return p(), m("div", g, [
|
|
16
|
+
t("img", {
|
|
17
|
+
onDblclick: l[0] || (l[0] = (A) => o(r).As.localInit()),
|
|
18
|
+
src: o(n).$cfg.logo,
|
|
19
|
+
width: "200"
|
|
20
|
+
}, null, 40, f),
|
|
21
|
+
t("div", j, [
|
|
22
|
+
c(d, { ujt: e.ujt }, null, 8, ["ujt"])
|
|
23
|
+
]),
|
|
24
|
+
t("div", v, [
|
|
25
|
+
t("div", h, i(o(n).lang?.asai?.page?.loadws), 1),
|
|
26
|
+
t("h3", null, i(s.type), 1),
|
|
27
|
+
c(u, { ujt: e.ujt }, null, 8, ["ujt"])
|
|
28
|
+
])
|
|
29
|
+
]);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
$ as default
|
|
35
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as u, resolveComponent as a, createElementBlock as _, openBlock as g, createElementVNode as e, unref as o, createVNode as l, toDisplayString as m } from "vue";
|
|
2
|
+
const p = { class: "as-load-area" }, v = ["src"], f = { class: "as-load-icon" }, j = { class: "as-load-msg" }, h = {
|
|
3
|
+
class: "tit",
|
|
4
|
+
style: { color: "var(--cy8)" }
|
|
5
|
+
}, $ = /* @__PURE__ */ u({
|
|
6
|
+
__name: "PageLoadServer",
|
|
7
|
+
props: {
|
|
8
|
+
ujt: {}
|
|
9
|
+
},
|
|
10
|
+
setup(t) {
|
|
11
|
+
const c = t, { $fn: i, $global: s } = c.ujt;
|
|
12
|
+
return (y, n) => {
|
|
13
|
+
const r = a("AsPageBusyGif"), d = a("AsReset");
|
|
14
|
+
return g(), _("div", p, [
|
|
15
|
+
e("img", {
|
|
16
|
+
onDblclick: n[0] || (n[0] = (A) => o(i).As.localInit()),
|
|
17
|
+
src: o(s).$cfg.logo,
|
|
18
|
+
width: "200"
|
|
19
|
+
}, null, 40, v),
|
|
20
|
+
e("div", f, [
|
|
21
|
+
l(r, { ujt: t.ujt }, null, 8, ["ujt"])
|
|
22
|
+
]),
|
|
23
|
+
e("div", j, [
|
|
24
|
+
e("div", h, m(o(s).lang.asai?.page?.loadserver || "Loading server..."), 1),
|
|
25
|
+
l(d, { ujt: t.ujt }, null, 8, ["ujt"])
|
|
26
|
+
])
|
|
27
|
+
]);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
$ as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as u, resolveComponent as a, createElementBlock as _, openBlock as g, createElementVNode as t, unref as o, createVNode as l, toDisplayString as m } from "vue";
|
|
2
|
+
const p = { class: "as-load-area" }, f = ["src"], j = { class: "as-load-icon" }, v = { class: "as-load-msg" }, k = {
|
|
3
|
+
class: "tit",
|
|
4
|
+
style: { color: "var(--cz8)" }
|
|
5
|
+
}, B = /* @__PURE__ */ u({
|
|
6
|
+
__name: "PageLoadUserToken",
|
|
7
|
+
props: {
|
|
8
|
+
ujt: {}
|
|
9
|
+
},
|
|
10
|
+
setup(e) {
|
|
11
|
+
const c = e, { $fn: i, $global: s } = c.ujt;
|
|
12
|
+
return (h, n) => {
|
|
13
|
+
const r = a("AsPageBusyGif"), d = a("AsReset");
|
|
14
|
+
return g(), _("div", p, [
|
|
15
|
+
t("img", {
|
|
16
|
+
onDblclick: n[0] || (n[0] = (A) => o(i).As.localInit()),
|
|
17
|
+
src: o(s).$cfg.logo,
|
|
18
|
+
width: "200"
|
|
19
|
+
}, null, 40, f),
|
|
20
|
+
t("div", j, [
|
|
21
|
+
l(r, { ujt: e.ujt }, null, 8, ["ujt"])
|
|
22
|
+
]),
|
|
23
|
+
t("div", v, [
|
|
24
|
+
t("div", k, m(o(s).lang.asai?.page?.loadusertoken || "Loading user token..."), 1),
|
|
25
|
+
l(d, { ujt: e.ujt }, null, 8, ["ujt"])
|
|
26
|
+
])
|
|
27
|
+
]);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
B as default
|
|
33
|
+
};
|