asai-vue-host 0.2.54 → 0.2.56
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 +184 -116
- package/dist/asai-vue-host.es.js +31 -31
- package/dist/asai-vue-host.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,116 +1,184 @@
|
|
|
1
|
-
# asai-vue-host
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
1
|
+
# asai-vue-host — 应用宿主框架(核心)
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
|
|
5
|
+
`asai-vue-host` 是 AsaiWeb CMS 的**核心应用宿主框架**,提供应用加载、模块管理、路由分发、WebSocket 通信和数据库响应的能力。它是整个前端架构的运行容器。
|
|
6
|
+
|
|
7
|
+
## 功能
|
|
8
|
+
|
|
9
|
+
- 🚀 **应用启动**:管理完整应用加载流程
|
|
10
|
+
- 📦 **模块管理**:动态加载和卸载功能模块
|
|
11
|
+
- 🧭 **路由分发**:基于 Hash 路由的页面分发
|
|
12
|
+
- 🔌 **WebSocket 通信**:WebSocket 连接管理与事件系统
|
|
13
|
+
- 💾 **数据库响应**:IndexedDB / 本地数据响应式提供
|
|
14
|
+
- 🎯 **功能注入**:通过 `provide` 提供全局数据和方法
|
|
15
|
+
- ⏳ **加载状态管理**:多种加载动画组件
|
|
16
|
+
- 🚨 **错误处理**:404 页面、加载错误页面
|
|
17
|
+
|
|
18
|
+
## 文件结构
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
asai-vue-host/
|
|
22
|
+
├── src/
|
|
23
|
+
│ └── components/
|
|
24
|
+
│ ├── index.ts # 插件安装入口(install 方法)
|
|
25
|
+
│ ├── asengine/
|
|
26
|
+
│ │ └── provide/
|
|
27
|
+
│ │ ├── providedb.ts # 数据库响应式数据 Provide
|
|
28
|
+
│ │ ├── providedbwork.ts # 数据库工作线程 Provide
|
|
29
|
+
│ │ ├── providefn.ts # 功能函数 Provide
|
|
30
|
+
│ │ └── providews.ts # WebSocket 数据 Provide
|
|
31
|
+
│ └── asui/
|
|
32
|
+
│ ├── app/
|
|
33
|
+
│ │ ├── AsaiWebItemIndex.vue # 应用入口页面
|
|
34
|
+
│ │ ├── AsaiWebItemDefault.vue # 默认页面
|
|
35
|
+
│ │ ├── AsaiWebModule.vue # 模块容器
|
|
36
|
+
│ │ ├── AsaiWebModuleDefault.vue # 默认模块
|
|
37
|
+
│ │ ├── AsaiWebModuleIndex.vue # 模块索引页
|
|
38
|
+
│ │ ├── AsaiWebServer.vue # 服务器页面
|
|
39
|
+
│ │ └── AsaiComponent.vue # 通用组件容器
|
|
40
|
+
│ ├── common/
|
|
41
|
+
│ │ ├── AsPageBusy.vue # 页面繁忙状态
|
|
42
|
+
│ │ ├── AsPageBusyGif.vue # GIF 加载动画
|
|
43
|
+
│ │ ├── AsReset.vue # 重置组件
|
|
44
|
+
│ │ ├── MenuShowFix.vue # 菜单显示修复
|
|
45
|
+
│ │ ├── RouterMap.vue # 路由映射组件
|
|
46
|
+
│ │ ├── AsPageBusy/
|
|
47
|
+
│ │ │ ├── AsLoadingA3d.vue # 3D 加载动画
|
|
48
|
+
│ │ │ └── AsLoadingCircle.vue# 圆形加载动画
|
|
49
|
+
│ │ └── _comps/
|
|
50
|
+
│ │ └── Asai404.vue # 404 页面
|
|
51
|
+
│ └── page/
|
|
52
|
+
│ ├── PageErr.vue # 错误页面
|
|
53
|
+
│ ├── PageLoadErr.vue # 加载错误
|
|
54
|
+
│ ├── PageLoadServer.vue # 服务器加载
|
|
55
|
+
│ ├── PageLoadUserToken.vue # 用户 Token 加载
|
|
56
|
+
│ ├── PageLoadUserTokenOnline.vue # 在线 Token 加载
|
|
57
|
+
│ └── PageLoadWs.vue # WebSocket 加载
|
|
58
|
+
└── README.md
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 安装方式
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import AsaiVueHost from 'asai-vue-host';
|
|
65
|
+
|
|
66
|
+
app.use(AsaiVueHost, {
|
|
67
|
+
loadts: (options) => { /* 加载 TypeScript 模块 */ },
|
|
68
|
+
loadvue: (options) => { /* 加载 Vue 组件 */ },
|
|
69
|
+
loadfn: (path) => { /* 加载函数 */ },
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Provide 系统
|
|
74
|
+
|
|
75
|
+
插件通过 Vue 的 `provide/inject` 机制注入以下全局功能:
|
|
76
|
+
|
|
77
|
+
| Provide Key | 说明 |
|
|
78
|
+
|-------------|------|
|
|
79
|
+
| `$engineasai` | 主引擎上下文 |
|
|
80
|
+
| `providedb` | 数据库响应式数据 |
|
|
81
|
+
| `providews` | WebSocket 数据 |
|
|
82
|
+
| `providefn` | 功能函数 |
|
|
83
|
+
| `providedbwork` | 数据库工作线程 |
|
|
84
|
+
|
|
85
|
+
## 核心组件
|
|
86
|
+
|
|
87
|
+
### 应用组件
|
|
88
|
+
|
|
89
|
+
| 组件 | 说明 |
|
|
90
|
+
|------|------|
|
|
91
|
+
| `AsaiWebServer` | 服务器连接管理 |
|
|
92
|
+
| `AsaiWebModule` | 模块容器,管理子页面 |
|
|
93
|
+
| `AsaiWebModuleIndex` | 模块首页索引 |
|
|
94
|
+
| `AsaiWebModuleDefault` | 默认模块视图 |
|
|
95
|
+
| `AsaiWebItemIndex` | 应用主入口页面 |
|
|
96
|
+
| `AsaiWebItemDefault` | 应用默认页面 |
|
|
97
|
+
| `AsaiComponent` | 动态组件渲染容器 |
|
|
98
|
+
|
|
99
|
+
### 公共组件
|
|
100
|
+
|
|
101
|
+
| 组件 | 说明 |
|
|
102
|
+
|------|------|
|
|
103
|
+
| `AsPageBusy` | 页面繁忙/加载中状态 |
|
|
104
|
+
| `AsPageBusyGif` | GIF 格式加载动画 |
|
|
105
|
+
| `AsLoadingA3d` | 3D 风格加载动画 |
|
|
106
|
+
| `AsLoadingCircle` | 圆形旋转加载动画 |
|
|
107
|
+
| `AsReset` | 数据重置组件 |
|
|
108
|
+
| `MenuShowFix` | 菜单显示修正 |
|
|
109
|
+
| `RouterMap` | Hash 路由映射 |
|
|
110
|
+
| `Asai404` | 404 页面 |
|
|
111
|
+
|
|
112
|
+
### 页面组件
|
|
113
|
+
|
|
114
|
+
| 组件 | 说明 |
|
|
115
|
+
|------|------|
|
|
116
|
+
| `PageErr` | 通用错误页面 |
|
|
117
|
+
| `PageLoadErr` | 加载失败页面 |
|
|
118
|
+
| `PageLoadServer` | 服务器加载页面 |
|
|
119
|
+
| `PageLoadUserToken` | 用户认证 Token 加载 |
|
|
120
|
+
| `PageLoadUserTokenOnline` | 在线用户 Token 加载 |
|
|
121
|
+
| `PageLoadWs` | WebSocket 连接加载 |
|
|
122
|
+
|
|
123
|
+
## 技术细节
|
|
124
|
+
|
|
125
|
+
- **插件安装模式**:通过 Vue 插件系统集成,使用 `install(app, opt)` 模式
|
|
126
|
+
- **自动扫描加载**:使用 `import.meta.glob` 自动发现并注册组件
|
|
127
|
+
- **模块化注入**:通过 `$engineasai` 注入点集中管理
|
|
128
|
+
- **异步加载**:组件使用动态导入,按需加载减少首屏体积
|
|
129
|
+
- **加载动画**:提供 CSS3 动画和 GIF 动画两种方案
|
|
130
|
+
|
|
131
|
+
## 代码优化分析
|
|
132
|
+
|
|
133
|
+
### 已做优化
|
|
134
|
+
- ✅ 插件化架构:使用 Vue 插件 `install(app, opt)` 模式,可组合安装
|
|
135
|
+
- ✅ 自动扫描加载:`import.meta.glob` 自动发现注册组件
|
|
136
|
+
- ✅ 模块化注入:不同功能使用独立 key(`$engineasai`),避免命名冲突
|
|
137
|
+
- ✅ Provide/Inject 模式:全局数据解耦,组件按需注入
|
|
138
|
+
- ✅ 提供多种加载动画(CSS3 动画 + GIF),降级方案
|
|
139
|
+
|
|
140
|
+
### 可优化点
|
|
141
|
+
|
|
142
|
+
#### 1. Provide 数据为简单 reactive 对象
|
|
143
|
+
```typescript
|
|
144
|
+
// providedb.ts
|
|
145
|
+
export default reactive({
|
|
146
|
+
providedb: { data: {} }
|
|
147
|
+
});
|
|
148
|
+
// providews.ts
|
|
149
|
+
export default reactive({
|
|
150
|
+
providews: { data: { rooms: {}, wssys: {} } }
|
|
151
|
+
});
|
|
152
|
+
```
|
|
153
|
+
**问题**:三个 provide 都使用 `reactive` 包裹但在对象中嵌套对象。Vue3 的 `reactive` 是深度的,嵌套对象的属性变更也会触发更新。但数据变更后,如果 inject 方直接替换内部对象(如 `providedb.data = newData`),可能会丢失响应性。
|
|
154
|
+
|
|
155
|
+
**建议**:使用 `readonly` 包装 inject 数据,或明确提供数据修改方法。
|
|
156
|
+
|
|
157
|
+
#### 2. 组件扫描使用 eager: false(lazy 模式)
|
|
158
|
+
```typescript
|
|
159
|
+
files: (import.meta as any).glob(['./asui/*/*.vue'])
|
|
160
|
+
```
|
|
161
|
+
**问题**:lazy 模式(非 eager)意味着组件只在首次渲染时异步加载。对于核心宿主组件(如 `AsaiWebModule`、`AsaiWebItemIndex`),它们是首屏必需组件,懒加载可能导致白屏闪烁。
|
|
162
|
+
|
|
163
|
+
**建议**:对核心组件使用 eager 加载,次要组件使用 lazy。
|
|
164
|
+
|
|
165
|
+
#### 3. PageLoadUserToken 等页面组件未定义Props
|
|
166
|
+
一些页面加载组件(如 `PageLoadWs`、`PageLoadErr`)没有明确的 Props 定义。建议添加 Props 接口,至少支持错误信息、重试函数等。
|
|
167
|
+
|
|
168
|
+
#### 4. 错误页面没有重试机制
|
|
169
|
+
`PageErr` 和 `PageLoadErr` 只显示错误信息,没有"重试"按钮。建议添加 `retry` 属性和 `@retry` 事件。
|
|
170
|
+
|
|
171
|
+
#### 5. "asany" 类型过多
|
|
172
|
+
整个插件的 TypeScript 大量使用 `any` 类型,失去类型检查的意义。建议:
|
|
173
|
+
- 定义核心类型接口(如 `AsaiContext`、`ModuleConfig`、`AppRoute`)
|
|
174
|
+
- 将 `$fn`、`$global`、`$model` 等全局对象的类型定义为接口
|
|
175
|
+
|
|
176
|
+
#### 6. Index.ts 中的 `opt.loadts` 和 `opt.loadvue` 缺少类型定义
|
|
177
|
+
`install(app, opt)` 的 `opt` 参数没有 TypeScript 接口,调用方不知需传入哪些方法。建议:
|
|
178
|
+
```typescript
|
|
179
|
+
interface HostPluginOptions {
|
|
180
|
+
loadts: (opts: { app: any; key: string; eager: boolean; files: Record<string, any> }) => void;
|
|
181
|
+
loadvue: (opts: { loadfn: any; app: any; eager: boolean; files: Record<string, any> }) => void;
|
|
182
|
+
loadfn: (path: string) => any;
|
|
183
|
+
}
|
|
184
|
+
```
|
package/dist/asai-vue-host.es.js
CHANGED
|
@@ -144,11 +144,11 @@ const C = {
|
|
|
144
144
|
treeToMap(t, o = {}) {
|
|
145
145
|
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
146
146
|
if (!t) return { nodeMap: e, depthMap: i };
|
|
147
|
-
const l = o.id || "id", c = o.ch || "ch", d = o.ft, f = o.ftk, h = o.fty === 1,
|
|
147
|
+
const l = o.id || "id", c = o.ch || "ch", d = o.ft, f = o.ftk, h = o.fty === 1, y = typeof d == "string" && d.length > 0 && f, $ = [{ [c]: t }], w = [0];
|
|
148
148
|
let n, s, r;
|
|
149
|
-
for (;
|
|
150
|
-
if (n =
|
|
151
|
-
if (
|
|
149
|
+
for (; $.length; ) {
|
|
150
|
+
if (n = $.pop(), s = w.pop(), r = n[l], s > 0)
|
|
151
|
+
if (y) {
|
|
152
152
|
const u = n[f], p = typeof u == "string" && u.includes(d);
|
|
153
153
|
(h ? !p : p) && (e.set(r, n), i.set(r, s));
|
|
154
154
|
} else
|
|
@@ -157,7 +157,7 @@ const C = {
|
|
|
157
157
|
if (a && a.length > 0) {
|
|
158
158
|
const u = s + 1;
|
|
159
159
|
for (let p = a.length - 1; p >= 0; p--)
|
|
160
|
-
|
|
160
|
+
$.push(a[p]), w.push(u);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
return { nodeMap: e, depthMap: i };
|
|
@@ -283,7 +283,7 @@ const C = {
|
|
|
283
283
|
// 获取当前时间
|
|
284
284
|
getTime(t = 6, o = 0) {
|
|
285
285
|
let e = "", i;
|
|
286
|
-
o ? (o < 9999999999 && (o = o
|
|
286
|
+
o ? (typeof o == "string" && (o = Number(o)), o < 9999999999 ? o = o * 1e3 : o > 9999999999999 && (o = o / 1e3), i = new Date(o)) : i = /* @__PURE__ */ new Date();
|
|
287
287
|
const [l, c] = t > 9 ? t + "" : "0" + t;
|
|
288
288
|
function d(f) {
|
|
289
289
|
return +l <= f && +c >= f;
|
|
@@ -484,21 +484,21 @@ const C = {
|
|
|
484
484
|
const { $fn: o, $model: e, $db: i, $dbwork: l, $global: c } = t;
|
|
485
485
|
function d(f = "testkdd") {
|
|
486
486
|
const h = _("$vueProxy");
|
|
487
|
-
h?.$installplugs?.(f), h?.["$engine" + f] && (Object.assign(o, h["$engine" + f]), h?.["$engineuse" + f] && Object.assign(o, h["$engineuse" + f])), e[f] || (e[f] = {}), l[f] || (l[f] = {}), i[f] || (i[f] = {}), o.setconfig = (
|
|
487
|
+
h?.$installplugs?.(f), h?.["$engine" + f] && (Object.assign(o, h["$engine" + f]), h?.["$engineuse" + f] && Object.assign(o, h["$engineuse" + f])), e[f] || (e[f] = {}), l[f] || (l[f] = {}), i[f] || (i[f] = {}), o.setconfig = ($, w) => o.apisys.apiPost("/api/asaijson/manage/update/?path=./webclient/webmodel/sys/setting/" + $ + ".json", w), o.changelangpro = ($ = "") => o.changelang(c.config.langcur || $).then((w) => {
|
|
488
488
|
c?.sys?.local?.lang ? f && o.ws?.[f] && o.ws[f].wsSend({
|
|
489
489
|
id: "1",
|
|
490
490
|
ty: "common/setlanguage",
|
|
491
|
-
db:
|
|
491
|
+
db: w
|
|
492
492
|
}) : o.setconfig("settinglang", {
|
|
493
|
-
lang:
|
|
493
|
+
lang: $
|
|
494
494
|
});
|
|
495
495
|
});
|
|
496
|
-
const
|
|
497
|
-
return
|
|
498
|
-
o.initmodel(f + "/dirmodel.json").then((
|
|
499
|
-
|
|
496
|
+
const y = [o.initlang(c.config.langcur || "")];
|
|
497
|
+
return y.push(
|
|
498
|
+
o.initmodel(f + "/dirmodel.json").then(($) => {
|
|
499
|
+
$ && Object.assign(e[f], $);
|
|
500
500
|
})
|
|
501
|
-
), Promise.all(
|
|
501
|
+
), Promise.all(y);
|
|
502
502
|
}
|
|
503
503
|
return { initAppModel: d };
|
|
504
504
|
}, M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -632,18 +632,18 @@ const C = {
|
|
|
632
632
|
});
|
|
633
633
|
}
|
|
634
634
|
});
|
|
635
|
-
const
|
|
635
|
+
const y = /* @__PURE__ */ new Map(), $ = /\$(\d+)/g;
|
|
636
636
|
e.$fn.lg = (n, s) => {
|
|
637
637
|
if (typeof n != "string" || !n)
|
|
638
638
|
return;
|
|
639
|
-
let r =
|
|
640
|
-
r || (r = n.split("."),
|
|
639
|
+
let r = y.get(n);
|
|
640
|
+
r || (r = n.split("."), y.set(n, r));
|
|
641
641
|
const a = r.reduce((g, b) => g?.[b], e.$global.lang);
|
|
642
642
|
if (!s || s.length === 0) return a;
|
|
643
643
|
const u = Array.isArray(s) ? s : [s];
|
|
644
|
-
return a?.replace(
|
|
645
|
-
const
|
|
646
|
-
return u[
|
|
644
|
+
return a?.replace($, (g, b) => {
|
|
645
|
+
const m = parseInt(b, 10) - 1;
|
|
646
|
+
return u[m] ?? g;
|
|
647
647
|
});
|
|
648
648
|
}, e.$fn.initlang = (n = "") => {
|
|
649
649
|
let s = "";
|
|
@@ -688,16 +688,16 @@ const C = {
|
|
|
688
688
|
function b() {
|
|
689
689
|
e.$fn.AsRouter.setRouter(e.$global.location);
|
|
690
690
|
}
|
|
691
|
-
e.$fn.setquery = (
|
|
691
|
+
e.$fn.setquery = (m = {}, v = 0) => {
|
|
692
692
|
let S;
|
|
693
693
|
v ? S = new URLSearchParams({
|
|
694
694
|
...e.$global.location.query || {},
|
|
695
|
-
|
|
696
|
-
}).toString() : S = new URLSearchParams(
|
|
697
|
-
}, e.$fn.sethash = (
|
|
698
|
-
e.$fn.AsRouter.setHash(e.$global.location,
|
|
699
|
-
}, e.$fn.exit = (
|
|
700
|
-
e.$fn.As.localSet("as-user-info", ""), e.$global.user.info = null, e.$global.code.token = null,
|
|
695
|
+
...m || {}
|
|
696
|
+
}).toString() : S = new URLSearchParams(m || {}).toString(), S ? S = e.$global.location.hash.split("?")[0] + "?" + S : S = e.$global.location.hash.split("?")[0], e.$fn.AsRouter.setHash(e.$global.location, S), b();
|
|
697
|
+
}, e.$fn.sethash = (m = "") => {
|
|
698
|
+
e.$fn.AsRouter.setHash(e.$global.location, m);
|
|
699
|
+
}, e.$fn.exit = (m = 0) => {
|
|
700
|
+
e.$fn.As.localSet("as-user-info", ""), e.$global.user.info = null, e.$global.code.token = null, m && (e.$fn.sethash(""), e.$fn.As.localReload());
|
|
701
701
|
}, e.$fn.login = () => {
|
|
702
702
|
e.$fn.As.localSet("as-user-info", ""), e.$global.user.info = null, e.$fn.sethash(e.$global.sys?.router?.config?.login || "user/login");
|
|
703
703
|
};
|
|
@@ -715,8 +715,8 @@ const C = {
|
|
|
715
715
|
for (let a = 0; a < e.$model?.webmodels?.length; a++) {
|
|
716
716
|
const u = await e.$fn.initmodel(e.$model?.webmodels?.[a] + "/configrouter.json");
|
|
717
717
|
typeof u == "object" && Object.entries(u).forEach(([p, g]) => {
|
|
718
|
-
p === "rights" ? Object.entries(g).forEach(([b,
|
|
719
|
-
|
|
718
|
+
p === "rights" ? Object.entries(g).forEach(([b, m]) => {
|
|
719
|
+
m && m.length && m.forEach((v) => {
|
|
720
720
|
e.$global.sys.router.rights[b].includes(v) || e.$global.sys.router.rights[b].push(v);
|
|
721
721
|
});
|
|
722
722
|
}) : Object.assign(e.$global.sys.router[p], g);
|
|
@@ -762,13 +762,13 @@ const C = {
|
|
|
762
762
|
Array.isArray(n) && (n = n?.map?.((a) => typeof a == "object" ? JSON.stringify(a) : a)?.join(`
|
|
763
763
|
`) || ""), e?.$fn?.apisys?.apiPost("/api/asailog/manage/addclient/", n).then(s).catch(r);
|
|
764
764
|
});
|
|
765
|
-
function
|
|
765
|
+
function w(n = /* @__PURE__ */ new Date()) {
|
|
766
766
|
const s = (r, a = 2) => String(r).padStart(a, "0");
|
|
767
767
|
return `${s(n.getHours())}:${s(n.getMinutes())}:${s(n.getSeconds())}.${s(n.getMilliseconds(), 3)}`;
|
|
768
768
|
}
|
|
769
769
|
return e.$fn.$log = (n = null) => new Promise((s, r) => {
|
|
770
770
|
if (n) {
|
|
771
|
-
const a = `[${
|
|
771
|
+
const a = `[${w()}] ${e.$global?.user?.info?.us || ""}-${n}`;
|
|
772
772
|
e?.$fn?.lo?.(7, "log", a), e?.$global?.sys?.onweblog && e.$fn.logSave(a).then(s).catch(r), s();
|
|
773
773
|
} else
|
|
774
774
|
s();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(S,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(S=typeof globalThis<"u"?globalThis:S||self,e(S["asai-vue-host"]={},S.Vue))})(this,(function(S,e){"use strict";const E=Object.freeze(Object.defineProperty({__proto__:null,default:{getUrlByCfg(o=null,n=0){return o?.url?o.url:o?.port?(n?window.location.protocol.includes("s")?"wss:":"ws:":window.location.protocol)+"//"+window.location.hostname+":"+o.port:n?window.location.origin.replace("http","ws"):window.location.origin},arrLenMax(o,n,t=0){return o.length>n&&(t?o.splice(n,o.length-n):o.splice(0,o.length-n)),o},cookiesSetByEncodeURI(o,n,t=0,s="/"){let l="";if(t){const i=new Date;i.setTime(i.getTime()+t),l="; expires="+i.toUTCString()}document.cookie=o+"="+encodeURIComponent(n)+l+"; path="+(s||"/")},cookiesSet(o,n,t=0,s="/"){try{let l="";if(t){const i=new Date;i.setTime(i.getTime()+t),l="; expires="+i.toUTCString()}document.cookie=o+"="+n+l+"; path="+(s||"/")}catch{}},cookiesGet(o){try{const n=document.cookie;if(!n)return"";const t=n.match(new RegExp(`(^| )${o}=([^;]*)(;|$)`));return t&&t[2]?decodeURIComponent(t[2]):""}catch(n){return console.error("cookiesGet error:",n),""}},cookiesDel(o){this.cookiesSetByEncodeURI(o,"",-1e3)},cookiesClear(){const o=document.cookie.split("; ");for(let n=0;n<o.length;n++){const t=o[n],s=t.indexOf("="),l=s>-1?t.substring(0,s):t;document.cookie=l+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}},readFile(o=null,n=0){return new Promise((t,s)=>{if(o){const l=new FileReader;n?l.readAsText(o):l.readAsDataURL(o),l.onload=()=>{t(l.result)}}else s()})},apiJsonp(o,n){try{const t=window,s=`asaiJsonp_${Date.now()}_${Math.random().toString(36).slice(2)}`;t[s]=i=>{n&&n(i),delete t[s]};const l=document.createElement("script");l.src=`${o}&callback=${s}`,l.type="text/javascript",l.async=!0,l.onload=()=>{document.body.removeChild(l)},l.onerror=()=>{document.body.removeChild(l),delete t[s],n&&n("ERROR")},document.body.appendChild(l)}catch{n&&n("ERROR")}},localTime(o,n=0){if(n){const t=JSON.parse(this.localGet("astime")||"{}");t[o]=n,localStorage.setItem("astime",JSON.stringify(t))}else{const t=JSON.parse(this.localGet("astime")||"{}");if(t[o])return t[o]}return 0},localSet(o,n,t=localStorage){try{typeof n=="object"?t.setItem(o,JSON.stringify(n)):t.setItem(o,String(n))}catch(s){console.error("localSet error:",s)}},localGet(o,n=localStorage){try{return n.getItem(o)}catch{}return""},localRemove(o,n=localStorage){try{return n.removeItem(o)}catch{}},localClears(o=null,n=localStorage){if(o?.length){let t;for(let s in n)t=o.find(l=>s.startsWith(l)),t&&this.localRemove(s,n)}else this.localClear(n)},localClear(o=localStorage){o.clear()},localInit(o=localStorage){this.localClear(o),location.replace("/#"),this.localReload()},localReload(){location.reload()},getPath(o="-"){return o?.replace(/[^a-zA-Z0-9.\-_\\\/]/g,"")},getName(o="-"){return o?.replace(/[^a-zA-Z0-9.\-_]/g,"")},eStop(o){const n=window.event||o;return n?.preventDefault(),n?.stopPropagation(),!0},treeToMap(o,n={}){const t=new Map,s=new Map;if(!o)return{nodeMap:t,depthMap:s};const l=n.id||"id",i=n.ch||"ch",f=n.ft,u=n.ftk,m=n.fty===1,g=typeof f=="string"&&f.length>0&&u,_=[{[i]:o}],$=[0];let a,r,c;for(;_.length;){if(a=_.pop(),r=$.pop(),c=a[l],r>0)if(g){const p=a[u],h=typeof p=="string"&&p.includes(f);(m?!h:h)&&(t.set(c,a),s.set(c,r))}else t.set(c,a),s.set(c,r);const d=a[i];if(d&&d.length>0){const p=r+1;for(let h=d.length-1;h>=0;h--)_.push(d[h]),$.push(p)}}return{nodeMap:t,depthMap:s}},fullScreen(o=""){const n=o?document.getElementById(o):document.documentElement||document.body,t=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(t)t.call(n);else{const{ActiveXObject:s}=window;if(typeof s<"u"){const l=new s("WScript.Shell");l!==null&&l.SendKeys("{F11}")}}},fullScreenExit(){const o=document?.exitFullscreen;if(o)document.fullscreenElement!==null&&o.call(document);else{const{ActiveXObject:n}=window;if(typeof n<"u"){const t=new n("WScript.Shell");t!==null&&t.SendKeys("{F11}")}}},fullScreenDo(o=null){document.fullscreenElement?this.fullScreenExit():this.fullScreen(),o&&o()},toNums(o,n=0){return o&&Object.keys(o).forEach(t=>{typeof o[t]=="number"&&(o[t]=this.toNum(o[t],n))}),o},toNum(o,n=0){return typeof o!="number"&&typeof o=="string"&&(o=Number(o)),Number.isNaN(o)&&(o=0),o&&n&&(o=Math.round(o*10**n)/10**n),o},toObj(o){try{return o&&typeof o=="string"?JSON.parse(o):o}catch{return{err:"不是JSON格式数据"}}},toStr(o){if(typeof o=="string")return o;try{return JSON.stringify(o)}catch{const t=[];return JSON.stringify(o,(s,l)=>{if(typeof l=="object"&&l!==null){if(t.indexOf(l)!==-1)return;t.push(l)}return l})}},toArr(o,n=0){if(o){if(Array.isArray(o))return o;if(typeof o=="object")return Object.entries(o)}return n?[]:null},setObjValByPath(o,n,t,s=0){try{const l=n.split(".");let i=o;for(let u=0;u<l.length-1;u++){const m=l[u];if(i[m]===void 0||typeof i[m]!="object"||i[m]===null)if(s)i[m]={};else return!1;i=i[m]}const f=l[l.length-1];return i[f]=t,!0}catch{return!1}},isValidFileName(o){if(!o||o.length===0)return!1;const n=o.length;for(let s=0;s<n;s++){const l=o.charCodeAt(s);if(l<=31||l===92||l===47||l===58||l===42||l===63||l===34||l===60||l===62||l===124)return!1}const t=o.charCodeAt(n-1);return!(t===32||t===46)},getTime(o=6,n=0){let t="",s;n?(n<9999999999&&(n=n*1e3),s=new Date(n)):s=new Date;const[l,i]=o>9?o+"":"0"+o;function f(u){return+l<=u&&+i>=u}return f(1)&&(t+=("00"+s.getFullYear()).slice(-4)+"-"),f(2)&&(t+=("00"+(s.getMonth()+1)).slice(-2)+"-"),f(3)&&(t+=("00"+s.getDate()).slice(-2)+" "),f(4)&&(t+=("00"+s.getHours()).slice(-2)+":"),f(5)&&(t+=("00"+s.getMinutes()).slice(-2)+":"),f(6)&&(t+=("00"+s.getSeconds()).slice(-2)+"."),f(7)&&(t+=("000"+s.getMilliseconds()).slice(-3)+" "),f(9)?t.replace(/\D/g,""):t&&t.substring(0,t.length-1)},toFormTime(o=0){return this.getTime(6,o).replace(" ","T")},fromFormTime(o="",n=1){const t=o?new Date(o).getTime():new Date().getTime();return Math.floor(t/n)},Uuid(o="",n=0,t=32){return[o.slice(-3),Date.now().toString(36).slice(-9),n.toString(36),crypto.getRandomValues(new Uint8Array(6)).reduce((l,i)=>l+(i&15).toString(t),"")].join("").slice(0,16)},downloadTxt(o="",n=""){if(o){typeof o=="object"&&(o=JSON.stringify(o));const t=document.createElement("a");t.style.display="none";const s=new Blob([o],{type:"application/octet-stream;charset=utf-8"}),l=URL.createObjectURL(s);t.href=l,t.setAttribute("download",n),document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(l)}},downloadFile(o="",n=""){const t=document.createElement("a");t.href=o,n?t.download=n:t.download=o.slice(o.lastIndexOf("/")+1),document.body.appendChild(t),t.click(),document.body.removeChild(t)},debounce(o,n){n?.timeout&&(clearTimeout(n.timeout),n.timeout=null),n?.immediate?(n.timeout||o(),n.timeout=setTimeout(()=>{n.timeout=null},n.wait)):n.timeout=setTimeout(()=>{o(),clearTimeout(n.timeout),n.timeout=null},n.wait)},throttle(o,n){n?.timeout&&(clearTimeout(n.timeout),n.timeout=null),n?.immediate?(n.endtime=new Date().valueOf(),n.endtime-n.starttime>n.wait&&(o(),n.starttime=n.endtime)):n&&!n?.timeout&&(n.timeout=setTimeout(()=>{o(),clearTimeout(n.timeout),n.timeout=null},n.wait))},async copyToClipboard(o){try{return this.localSet("as-clipboard",o),!0}catch(n){throw n}},async readFromClipboard(){try{return this.localGet("as-clipboard")||""}catch(o){throw o}},DeepClone(o,n=new WeakMap){if(o===null||typeof o!="object")return o;if(n.has(o))return n.get(o);if(o instanceof Date)return new Date(o);if(o instanceof RegExp)return new RegExp(o.source,o.flags);if(o instanceof Map){const s=new Map;return n.set(o,s),o.forEach((l,i)=>{s.set(this.DeepClone(i,n),this.DeepClone(l,n))}),s}if(o instanceof Set){const s=new Set;return n.set(o,s),o.forEach(l=>{s.add(this.DeepClone(l,n))}),s}const t=Array.isArray(o)?[]:{};n.set(o,t);for(let s in o)o.hasOwnProperty(s)&&(t[s]=this.DeepClone(o[s],n));return t}}},Symbol.toStringTag,{value:"Module"})),B=Object.freeze(Object.defineProperty({__proto__:null,default:{base64Encode(o){return btoa(unescape(encodeURIComponent(o)))},base64Decode(o){try{return decodeURIComponent(escape(atob(o)))}catch(n){return console.error("base64Decode error:",n),""}},simpleEncrypt(o,n=3){return o.split("").map(t=>String.fromCharCode(t.charCodeAt(0)+n)).join("")},simpleDecrypt(o,n=3){return o.split("").map(t=>String.fromCharCode(t.charCodeAt(0)-n)).join("")},enc(o){const n=this.simpleEncrypt(o,5);return this.base64Encode(n)},dec(o){const n=this.base64Decode(o);return this.simpleDecrypt(n,5)}}},Symbol.toStringTag,{value:"Module"})),P={webpath:window?.$CFG?.webpath||"./",_hashChangeListener:null,_popstateListener:null,initHash(o={}){this.webpath.startsWith("/")?(this._popstateListener=(n=null)=>{o.hash=window.location.pathname||"",this.setRouter(o)},this._popstateListener(),window.addEventListener("popstate",this._popstateListener)):(this._hashChangeListener=(n=null)=>{o.hash=window.location.hash?.replace("#","")||"",this.setRouter(o)},window.addEventListener("hashchange",this._hashChangeListener))},offHash(){this.webpath.startsWith("/")?this._popstateListener&&(window.removeEventListener("popstate",this._popstateListener),this._popstateListener=null):this._hashChangeListener&&(window.removeEventListener("hashchange",this._hashChangeListener),this._hashChangeListener=null)},setHref(o){window.location.href=o},getHref(){return window?.location?.href},setHash(o={},n=""){n&&!n.startsWith("/")&&(n=`/${n}`),o.hash=n||"",this.webpath.startsWith("/")?(window.history.pushState({},"",o.hash),this.setRouter(o)):window.location.hash=o.hash},getQuery(o={},n=""){return o.query={},n=n||window?.location?.search?.substring(1)||"",n&&n.split("&").forEach(t=>{const[s,l]=t.split("=");s&&l&&(o.query[s]=decodeURIComponent(l))}),o.query},getHasharr(o){let n=o.hash;if(o.hasharr=[],n){n.startsWith("/")&&(n=n.slice(1));const[t,s]=n.split("?");let l=t?.split("/")||[];for(;l.length>0&&l[l.length-1]==="";)l.pop();o.hasharr=l,this.getQuery(o,s)}return o.hasharr},setRouter(o){this.getHasharr(o);const n=o.hasharr||[],t=o.hasharr?.length||0;if(o.comps=[],t>0){let s="";for(let l=0;l<t;l++)s=`${s}${n[l]}/`,l==t-1?o.comps[l]=`${s}default`:o.comps[l]=`${s}index`}return o.comps?.length||(o.comps[0]="default"),o.comps},setTitle(o="",n=null){const s=!window?.$CFG?.title&&n?.$global?.lang?.sys?.webtit?n?.$global?.lang?.sys?.webtit:"";o?document.title=`${o}${s?" - "+s:""}`:document.title=`${s}`}},O=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"})),N=Object.freeze(Object.defineProperty({__proto__:null,default:o=>{const{$fn:n,$model:t,$db:s,$dbwork:l,$global:i}=o;function f(u="testkdd"){const m=e.inject("$vueProxy");m?.$installplugs?.(u),m?.["$engine"+u]&&(Object.assign(n,m["$engine"+u]),m?.["$engineuse"+u]&&Object.assign(n,m["$engineuse"+u])),t[u]||(t[u]={}),l[u]||(l[u]={}),s[u]||(s[u]={}),n.setconfig=(_,$)=>n.apisys.apiPost("/api/asaijson/manage/update/?path=./webclient/webmodel/sys/setting/"+_+".json",$),n.changelangpro=(_="")=>n.changelang(i.config.langcur||_).then($=>{i?.sys?.local?.lang?u&&n.ws?.[u]&&n.ws[u].wsSend({id:"1",ty:"common/setlanguage",db:$}):n.setconfig("settinglang",{lang:_})});const g=[n.initlang(i.config.langcur||"")];return g.push(n.initmodel(u+"/dirmodel.json").then(_=>{_&&Object.assign(t[u],_)})),Promise.all(g)}return{initAppModel:f}}},Symbol.toStringTag,{value:"Module"})),V=e.reactive({providedb:{data:{}}}),M=e.reactive({providedbwork:{data:{}}}),x=e.reactive({provideglobal:{data:{sys:null,wd:{w:0,h:0},config:{theme:"theme-light",lang:"",langcur:""},theme:"",stat:{webclient:0,web:0,cocontrol:0},user:{info:null,online:0},code:{pri:null,pub:null,token:""},location:{},pop:{},url:{},module:{value:"",label:""},keyboard:{comps:{},areastyle:{},opt:{},csskeyboard:"",showkeyboard:!1}}}}),T=e.reactive({providews:{data:{rooms:{},wssys:{}}}}),C={providefn:{data:{api:{},ws:{},wssys:null,workers:{}}}},R=Object.freeze(Object.defineProperty({__proto__:null,default:(o=null)=>{const n=window;Object.assign(C.providefn.data,o?.plugs||{});const t={$db:V.providedb.data,$dbwork:M.providedbwork.data,$ws:T.providews.data,$global:x.provideglobal.data,$model:n.$GYS.$webmodel,$fn:C.providefn.data};t.$global.$cfg=n.$CFG||{},n.$GYS.ujt=t,t.$fn.lo=(...a)=>{if(t.$global.sys?.onconsole){if(!a?.[0])t.$model.gysfn.log();else if(a.length>0){let r="",c="",d="";if(a[1]&&typeof a[1]=="string"){const[p,h,...b]=a;c=h,d=b,Array.isArray(a[0])&&a[0].length===2?r=l(a[0][0],a[0][1],"12px"):typeof a[0]=="number"&&(r=s(p,12))}r?console.log("%c"+c,r,...d):console.log(...a)}}},t.$model.gysfn.log=()=>(console.log("%c$fn",s(6,18),i(t.$fn),t.$fn),console.log("%c$model",s(5,18),i(t.$model),t.$model),console.log("%c$global",s(4,18),i(t.$global),t.$global),console.log("%c$ws",s(3,18),i(t.$ws),t.$ws),console.log("%c$db",s(2,18),i(t.$db),t.$db),console.log("%c$dbwork",s(1,18),i(t.$dbwork),t.$dbwork),"Web Model Log。");function s(a,r=18){let c="";return a===1?c=l("black","pink",r+"px"):a===2?c=l("black","cyan",r+"px"):a===3?c=l("black","yellow",r+"px"):a===4?c=l("white","blue",r+"px"):a===5?c=l("white","red",r+"px"):a===6?c=l("white","green",r+"px"):a===7&&(c=l("white","purple",r+"px")),c}function l(a,r,c="18px"){return"font-size:"+c+";font-weight:bold;border-radius:20px;padding:0 10px;color:"+a+";background-color:"+r+";"}function i(a){try{return"size=>"+((a&&JSON.stringify(a)?.length)/1024).toFixed(3)+"KB"}catch{return""}}function f(a={}){t.$global.pop.popdefaultconfirm&&(t.$global.pop.popdefaultconfirm.stat=1,t.$global.pop.popdefaultconfirm.full=1,t.$global.pop.popdefaultconfirm.notit=1,Object.assign(t.$global.pop.popdefaultconfirm,a))}function u(a={}){t.$global.pop.popdefaultconfirmpass&&(t.$global.pop.popdefaultconfirmpass.stat=1,t.$global.pop.popdefaultconfirmpass.full=1,t.$global.pop.popdefaultconfirmpass.notit=1,Object.assign(t.$global.pop.popdefaultconfirmpass,a))}t.$fn.popConfirm=f,t.$fn.popConfirmPass=u,t.$fn.getWebPath=(a="")=>{const r=t?.$global?.$cfg?.webpath||"./";return a&&!a.startsWith("http")&&!a.startsWith(r)?r+a:a};const{fetchPublic:m}=t.$fn?.AsaiModel(t.$fn.getWebPath("webmodel/"));t.$fn.initmodel=m,t.$fn.startLink=()=>new Promise((a,r)=>{t.$fn.initmodel("sys/server.json").then(c=>{const d={api:{},ws:{}};["api","ws"].forEach(p=>{Object.keys(c?.[p]||{}).forEach(h=>{let b=c[p][h];b&&typeof b=="string"&&(b=d[p][b]),b||(b=c[p].default),d[p][h]={...b,url:t.$fn.As.getUrlByCfg(b,p=="ws"?1:0)}})}),t.$fn.As.localSet("as-link",JSON.stringify(d)),t.$global.link=d,a(t.$global.link)}).catch(c=>{r(c)})}),t.$fn.saveLink=a=>{t.$global.link=a,t.$fn.As.localSet("as-link",JSON.stringify(t.$global.link))},t.$fn.initLink=(a=0)=>new Promise((r,c)=>{if(a)t.$fn.startLink().then(d=>{r(d)}).catch(d=>{c(d)});else{let d=t.$fn.As.localGet("as-link");d?(t.$global.link=JSON.parse(d),t.$global.link?.api&&t.$global.link?.ws&&t.$global.link?.ws?.default?r(t.$global.link):t.$fn.startLink().then(p=>{r(p)}).catch(p=>{c(p)})):t.$fn.startLink().then(p=>{r(p)}).catch(p=>{c(p)})}});const g=new Map,_=/\$(\d+)/g;t.$fn.lg=(a,r)=>{if(typeof a!="string"||!a)return;let c=g.get(a);c||(c=a.split("."),g.set(a,c));const d=c.reduce((b,y)=>b?.[y],t.$global.lang);if(!r||r.length===0)return d;const p=Array.isArray(r)?r:[r];return d?.replace(_,(b,y)=>{const k=parseInt(y,10)-1;return p[k]??b})},t.$fn.initlang=(a="")=>{let r="";return t.$global?.sys?.local?.lang?r=a||t.$fn.As.localGet(t.$global?.sys?.local?.lang)||t.$model.data.sys.settinglang?.lang||t.$model.data.sys.sysconfig?.lang[0]:r=a||t.$model.data.sys.settinglang?.lang||t.$model.data.sys.sysconfig?.lang[0],t.$global?.lang||(t.$global.lang={}),new Promise((c,d)=>{t.$fn.initmodel("lang/dirlang.json",r+"/").then(p=>{Object.assign(t.$global.lang,p),c(t.$global.lang)}).catch(p=>{d(p)})})},t.$fn.changelang=(a="")=>{let r="";return t.$global?.sys?.local?.lang?r=t.$fn.As.localGet(t.$global?.sys?.local?.lang)||t.$model.data.sys.settinglang?.lang||t.$model.data.sys.sysconfig?.lang[0]:r=t.$global.config.langcur||t.$model.data.sys.settinglang?.lang||t.$model.data.sys.sysconfig?.lang[0],new Promise((c,d)=>{a&&r===a&&t.$global?.lang?c(r):(a==="auto"?r=r==t.$model.data.sys.sysconfig?.lang[0]?t.$model.data.sys.sysconfig?.lang[1]:t.$model.data.sys.sysconfig?.lang[0]:a&&(r=a),t.$global?.sys?.local?.lang&&t.$fn.As.localSet(t.$global?.sys?.local?.lang,r),t.$global?.sys?.local?.lang||!t.$global.config.lang?(t.$global.config.lang=r,t.$fn.initlang(r).then(p=>{c(r)}).catch(p=>{d(p)})):c(r))})},t.$fn.initver=()=>{if(t.$global.sys?.webver){const a=t.$fn.As.localGet("as-web-ver");if(a){if(t.$global.sys?.webver!==a)return t.$fn.As.localInit(),!0}else t.$fn.As.localSet("as-web-ver",t.$global.sys?.webver||"")}return!1},t.$fn.initweb=async a=>{try{let r=function(){const{protocol:d,hostname:p,port:h,hash:b}=n.location;t.$global.location={protocol:d,hostname:p,port:h,hash:b.replace("#",""),comps:[],query:{}},t.$fn.AsRouter.initHash(t.$global.location),y();function y(){t.$fn.AsRouter.setRouter(t.$global.location)}t.$fn.setquery=(k={},A=0)=>{let j;A?j=new URLSearchParams({...t.$global.location.query||{},...k||{}}).toString():j=new URLSearchParams(k||{}).toString(),j?j=t.$global.location.hash.split("?")[0]+"?"+j:j=t.$global.location.hash.split("?")[0],t.$fn.AsRouter.setHash(t.$global.location,j),y()},t.$fn.sethash=(k="")=>{t.$fn.AsRouter.setHash(t.$global.location,k)},t.$fn.exit=(k=0)=>{t.$fn.As.localSet("as-user-info",""),t.$global.user.info=null,t.$global.code.token=null,k&&(t.$fn.sethash(""),t.$fn.As.localReload())},t.$fn.login=()=>{t.$fn.As.localSet("as-user-info",""),t.$global.user.info=null,t.$fn.sethash(t.$global.sys?.router?.config?.login||"user/login")}};Object.assign(t.$fn,a.$fns||{}),Object.assign(t.$fn,a.$engineasai||{}),Object.assign(t.$fn,a.$engineasailib||{});for(let d=0;d<3;d++)a["$engineasai"+d]&&Object.assign(t.$fn,a["$engineasai"+d]);const c=await t.$fn.initmodel("sys/dirglobal.json");if(t.$global.sys={},Object.keys(c).forEach(d=>{Object.assign(t.$global.sys,c[d])}),t.$fn.initver())return;if(t.$model.data.sys=await t.$fn.initmodel("sys/dirmodel.json"),t.$model.data.sys.configrouter){t.$global.sys.router=t.$model.data.sys.configrouter;for(let d=0;d<t.$model?.webmodels?.length;d++){const p=await t.$fn.initmodel(t.$model?.webmodels?.[d]+"/configrouter.json");typeof p=="object"&&Object.entries(p).forEach(([h,b])=>{h==="rights"?Object.entries(b).forEach(([y,k])=>{k&&k.length&&k.forEach(A=>{t.$global.sys.router.rights[y].includes(A)||t.$global.sys.router.rights[y].push(A)})}):Object.assign(t.$global.sys.router[h],b)})}}t.$fn.lo(),await t.$fn.initLink(),r()}catch(r){console.error("initUser error:",r)}},t.$fn.offweb=()=>{t.$fn.AsRouter.offHash()},t.$fn.initrouter=()=>{if(t.$global?.sys?.devlevel&&!t.$global.url[t.$global.module.value]){t.$global.url[t.$global.module.value]=[],t.$global.url[t.$global.module.value].push(...Object.keys(t.$model.appmodules.indexRouters).map(r=>({value:r,label:r,type:"module"})));const a=/^\.\/(.*?)\/default\.vue$/;t.$global.url[t.$global.module.value].push(...[...Object.keys(t.$model.comps)?.map(r=>{if(a.test(r)){const c=r.match(a);if(c)return c[1]}return""}).filter(r=>r)].map(r=>({value:r,label:r})))}},t.$fn.inittoken=()=>{t.$global.code.pri&&t.$global.user.info?.us&&(t.$global.code.token=t.$fn.AsCode.asencode(t.$global.user.info?.us,t.$global.code.pri)+"##"+t.$fn.AsCode.asencode(t.$global.user.info?.lv||0,t.$global.code.pri)+"##"+t.$global.code.pub)},t.$fn.gettoken=(a=0)=>t.$global?.code?.token?t.$global.code.token:t.$global?.code?.pub&&a?t.$global?.code?.token||"####"+t.$global.code.pub:"",t.$fn.logSave=(a=null)=>new Promise((r,c)=>{Array.isArray(a)&&(a=a?.map?.(d=>typeof d=="object"?JSON.stringify(d):d)?.join(`
|
|
1
|
+
(function(S,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(S=typeof globalThis<"u"?globalThis:S||self,e(S["asai-vue-host"]={},S.Vue))})(this,(function(S,e){"use strict";const E=Object.freeze(Object.defineProperty({__proto__:null,default:{getUrlByCfg(o=null,n=0){return o?.url?o.url:o?.port?(n?window.location.protocol.includes("s")?"wss:":"ws:":window.location.protocol)+"//"+window.location.hostname+":"+o.port:n?window.location.origin.replace("http","ws"):window.location.origin},arrLenMax(o,n,t=0){return o.length>n&&(t?o.splice(n,o.length-n):o.splice(0,o.length-n)),o},cookiesSetByEncodeURI(o,n,t=0,s="/"){let l="";if(t){const i=new Date;i.setTime(i.getTime()+t),l="; expires="+i.toUTCString()}document.cookie=o+"="+encodeURIComponent(n)+l+"; path="+(s||"/")},cookiesSet(o,n,t=0,s="/"){try{let l="";if(t){const i=new Date;i.setTime(i.getTime()+t),l="; expires="+i.toUTCString()}document.cookie=o+"="+n+l+"; path="+(s||"/")}catch{}},cookiesGet(o){try{const n=document.cookie;if(!n)return"";const t=n.match(new RegExp(`(^| )${o}=([^;]*)(;|$)`));return t&&t[2]?decodeURIComponent(t[2]):""}catch(n){return console.error("cookiesGet error:",n),""}},cookiesDel(o){this.cookiesSetByEncodeURI(o,"",-1e3)},cookiesClear(){const o=document.cookie.split("; ");for(let n=0;n<o.length;n++){const t=o[n],s=t.indexOf("="),l=s>-1?t.substring(0,s):t;document.cookie=l+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}},readFile(o=null,n=0){return new Promise((t,s)=>{if(o){const l=new FileReader;n?l.readAsText(o):l.readAsDataURL(o),l.onload=()=>{t(l.result)}}else s()})},apiJsonp(o,n){try{const t=window,s=`asaiJsonp_${Date.now()}_${Math.random().toString(36).slice(2)}`;t[s]=i=>{n&&n(i),delete t[s]};const l=document.createElement("script");l.src=`${o}&callback=${s}`,l.type="text/javascript",l.async=!0,l.onload=()=>{document.body.removeChild(l)},l.onerror=()=>{document.body.removeChild(l),delete t[s],n&&n("ERROR")},document.body.appendChild(l)}catch{n&&n("ERROR")}},localTime(o,n=0){if(n){const t=JSON.parse(this.localGet("astime")||"{}");t[o]=n,localStorage.setItem("astime",JSON.stringify(t))}else{const t=JSON.parse(this.localGet("astime")||"{}");if(t[o])return t[o]}return 0},localSet(o,n,t=localStorage){try{typeof n=="object"?t.setItem(o,JSON.stringify(n)):t.setItem(o,String(n))}catch(s){console.error("localSet error:",s)}},localGet(o,n=localStorage){try{return n.getItem(o)}catch{}return""},localRemove(o,n=localStorage){try{return n.removeItem(o)}catch{}},localClears(o=null,n=localStorage){if(o?.length){let t;for(let s in n)t=o.find(l=>s.startsWith(l)),t&&this.localRemove(s,n)}else this.localClear(n)},localClear(o=localStorage){o.clear()},localInit(o=localStorage){this.localClear(o),location.replace("/#"),this.localReload()},localReload(){location.reload()},getPath(o="-"){return o?.replace(/[^a-zA-Z0-9.\-_\\\/]/g,"")},getName(o="-"){return o?.replace(/[^a-zA-Z0-9.\-_]/g,"")},eStop(o){const n=window.event||o;return n?.preventDefault(),n?.stopPropagation(),!0},treeToMap(o,n={}){const t=new Map,s=new Map;if(!o)return{nodeMap:t,depthMap:s};const l=n.id||"id",i=n.ch||"ch",f=n.ft,u=n.ftk,m=n.fty===1,g=typeof f=="string"&&f.length>0&&u,_=[{[i]:o}],$=[0];let a,r,c;for(;_.length;){if(a=_.pop(),r=$.pop(),c=a[l],r>0)if(g){const p=a[u],h=typeof p=="string"&&p.includes(f);(m?!h:h)&&(t.set(c,a),s.set(c,r))}else t.set(c,a),s.set(c,r);const d=a[i];if(d&&d.length>0){const p=r+1;for(let h=d.length-1;h>=0;h--)_.push(d[h]),$.push(p)}}return{nodeMap:t,depthMap:s}},fullScreen(o=""){const n=o?document.getElementById(o):document.documentElement||document.body,t=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(t)t.call(n);else{const{ActiveXObject:s}=window;if(typeof s<"u"){const l=new s("WScript.Shell");l!==null&&l.SendKeys("{F11}")}}},fullScreenExit(){const o=document?.exitFullscreen;if(o)document.fullscreenElement!==null&&o.call(document);else{const{ActiveXObject:n}=window;if(typeof n<"u"){const t=new n("WScript.Shell");t!==null&&t.SendKeys("{F11}")}}},fullScreenDo(o=null){document.fullscreenElement?this.fullScreenExit():this.fullScreen(),o&&o()},toNums(o,n=0){return o&&Object.keys(o).forEach(t=>{typeof o[t]=="number"&&(o[t]=this.toNum(o[t],n))}),o},toNum(o,n=0){return typeof o!="number"&&typeof o=="string"&&(o=Number(o)),Number.isNaN(o)&&(o=0),o&&n&&(o=Math.round(o*10**n)/10**n),o},toObj(o){try{return o&&typeof o=="string"?JSON.parse(o):o}catch{return{err:"不是JSON格式数据"}}},toStr(o){if(typeof o=="string")return o;try{return JSON.stringify(o)}catch{const t=[];return JSON.stringify(o,(s,l)=>{if(typeof l=="object"&&l!==null){if(t.indexOf(l)!==-1)return;t.push(l)}return l})}},toArr(o,n=0){if(o){if(Array.isArray(o))return o;if(typeof o=="object")return Object.entries(o)}return n?[]:null},setObjValByPath(o,n,t,s=0){try{const l=n.split(".");let i=o;for(let u=0;u<l.length-1;u++){const m=l[u];if(i[m]===void 0||typeof i[m]!="object"||i[m]===null)if(s)i[m]={};else return!1;i=i[m]}const f=l[l.length-1];return i[f]=t,!0}catch{return!1}},isValidFileName(o){if(!o||o.length===0)return!1;const n=o.length;for(let s=0;s<n;s++){const l=o.charCodeAt(s);if(l<=31||l===92||l===47||l===58||l===42||l===63||l===34||l===60||l===62||l===124)return!1}const t=o.charCodeAt(n-1);return!(t===32||t===46)},getTime(o=6,n=0){let t="",s;n?(typeof n=="string"&&(n=Number(n)),n<9999999999?n=n*1e3:n>9999999999999&&(n=n/1e3),s=new Date(n)):s=new Date;const[l,i]=o>9?o+"":"0"+o;function f(u){return+l<=u&&+i>=u}return f(1)&&(t+=("00"+s.getFullYear()).slice(-4)+"-"),f(2)&&(t+=("00"+(s.getMonth()+1)).slice(-2)+"-"),f(3)&&(t+=("00"+s.getDate()).slice(-2)+" "),f(4)&&(t+=("00"+s.getHours()).slice(-2)+":"),f(5)&&(t+=("00"+s.getMinutes()).slice(-2)+":"),f(6)&&(t+=("00"+s.getSeconds()).slice(-2)+"."),f(7)&&(t+=("000"+s.getMilliseconds()).slice(-3)+" "),f(9)?t.replace(/\D/g,""):t&&t.substring(0,t.length-1)},toFormTime(o=0){return this.getTime(6,o).replace(" ","T")},fromFormTime(o="",n=1){const t=o?new Date(o).getTime():new Date().getTime();return Math.floor(t/n)},Uuid(o="",n=0,t=32){return[o.slice(-3),Date.now().toString(36).slice(-9),n.toString(36),crypto.getRandomValues(new Uint8Array(6)).reduce((l,i)=>l+(i&15).toString(t),"")].join("").slice(0,16)},downloadTxt(o="",n=""){if(o){typeof o=="object"&&(o=JSON.stringify(o));const t=document.createElement("a");t.style.display="none";const s=new Blob([o],{type:"application/octet-stream;charset=utf-8"}),l=URL.createObjectURL(s);t.href=l,t.setAttribute("download",n),document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(l)}},downloadFile(o="",n=""){const t=document.createElement("a");t.href=o,n?t.download=n:t.download=o.slice(o.lastIndexOf("/")+1),document.body.appendChild(t),t.click(),document.body.removeChild(t)},debounce(o,n){n?.timeout&&(clearTimeout(n.timeout),n.timeout=null),n?.immediate?(n.timeout||o(),n.timeout=setTimeout(()=>{n.timeout=null},n.wait)):n.timeout=setTimeout(()=>{o(),clearTimeout(n.timeout),n.timeout=null},n.wait)},throttle(o,n){n?.timeout&&(clearTimeout(n.timeout),n.timeout=null),n?.immediate?(n.endtime=new Date().valueOf(),n.endtime-n.starttime>n.wait&&(o(),n.starttime=n.endtime)):n&&!n?.timeout&&(n.timeout=setTimeout(()=>{o(),clearTimeout(n.timeout),n.timeout=null},n.wait))},async copyToClipboard(o){try{return this.localSet("as-clipboard",o),!0}catch(n){throw n}},async readFromClipboard(){try{return this.localGet("as-clipboard")||""}catch(o){throw o}},DeepClone(o,n=new WeakMap){if(o===null||typeof o!="object")return o;if(n.has(o))return n.get(o);if(o instanceof Date)return new Date(o);if(o instanceof RegExp)return new RegExp(o.source,o.flags);if(o instanceof Map){const s=new Map;return n.set(o,s),o.forEach((l,i)=>{s.set(this.DeepClone(i,n),this.DeepClone(l,n))}),s}if(o instanceof Set){const s=new Set;return n.set(o,s),o.forEach(l=>{s.add(this.DeepClone(l,n))}),s}const t=Array.isArray(o)?[]:{};n.set(o,t);for(let s in o)o.hasOwnProperty(s)&&(t[s]=this.DeepClone(o[s],n));return t}}},Symbol.toStringTag,{value:"Module"})),B=Object.freeze(Object.defineProperty({__proto__:null,default:{base64Encode(o){return btoa(unescape(encodeURIComponent(o)))},base64Decode(o){try{return decodeURIComponent(escape(atob(o)))}catch(n){return console.error("base64Decode error:",n),""}},simpleEncrypt(o,n=3){return o.split("").map(t=>String.fromCharCode(t.charCodeAt(0)+n)).join("")},simpleDecrypt(o,n=3){return o.split("").map(t=>String.fromCharCode(t.charCodeAt(0)-n)).join("")},enc(o){const n=this.simpleEncrypt(o,5);return this.base64Encode(n)},dec(o){const n=this.base64Decode(o);return this.simpleDecrypt(n,5)}}},Symbol.toStringTag,{value:"Module"})),P={webpath:window?.$CFG?.webpath||"./",_hashChangeListener:null,_popstateListener:null,initHash(o={}){this.webpath.startsWith("/")?(this._popstateListener=(n=null)=>{o.hash=window.location.pathname||"",this.setRouter(o)},this._popstateListener(),window.addEventListener("popstate",this._popstateListener)):(this._hashChangeListener=(n=null)=>{o.hash=window.location.hash?.replace("#","")||"",this.setRouter(o)},window.addEventListener("hashchange",this._hashChangeListener))},offHash(){this.webpath.startsWith("/")?this._popstateListener&&(window.removeEventListener("popstate",this._popstateListener),this._popstateListener=null):this._hashChangeListener&&(window.removeEventListener("hashchange",this._hashChangeListener),this._hashChangeListener=null)},setHref(o){window.location.href=o},getHref(){return window?.location?.href},setHash(o={},n=""){n&&!n.startsWith("/")&&(n=`/${n}`),o.hash=n||"",this.webpath.startsWith("/")?(window.history.pushState({},"",o.hash),this.setRouter(o)):window.location.hash=o.hash},getQuery(o={},n=""){return o.query={},n=n||window?.location?.search?.substring(1)||"",n&&n.split("&").forEach(t=>{const[s,l]=t.split("=");s&&l&&(o.query[s]=decodeURIComponent(l))}),o.query},getHasharr(o){let n=o.hash;if(o.hasharr=[],n){n.startsWith("/")&&(n=n.slice(1));const[t,s]=n.split("?");let l=t?.split("/")||[];for(;l.length>0&&l[l.length-1]==="";)l.pop();o.hasharr=l,this.getQuery(o,s)}return o.hasharr},setRouter(o){this.getHasharr(o);const n=o.hasharr||[],t=o.hasharr?.length||0;if(o.comps=[],t>0){let s="";for(let l=0;l<t;l++)s=`${s}${n[l]}/`,l==t-1?o.comps[l]=`${s}default`:o.comps[l]=`${s}index`}return o.comps?.length||(o.comps[0]="default"),o.comps},setTitle(o="",n=null){const s=!window?.$CFG?.title&&n?.$global?.lang?.sys?.webtit?n?.$global?.lang?.sys?.webtit:"";o?document.title=`${o}${s?" - "+s:""}`:document.title=`${s}`}},O=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"})),N=Object.freeze(Object.defineProperty({__proto__:null,default:o=>{const{$fn:n,$model:t,$db:s,$dbwork:l,$global:i}=o;function f(u="testkdd"){const m=e.inject("$vueProxy");m?.$installplugs?.(u),m?.["$engine"+u]&&(Object.assign(n,m["$engine"+u]),m?.["$engineuse"+u]&&Object.assign(n,m["$engineuse"+u])),t[u]||(t[u]={}),l[u]||(l[u]={}),s[u]||(s[u]={}),n.setconfig=(_,$)=>n.apisys.apiPost("/api/asaijson/manage/update/?path=./webclient/webmodel/sys/setting/"+_+".json",$),n.changelangpro=(_="")=>n.changelang(i.config.langcur||_).then($=>{i?.sys?.local?.lang?u&&n.ws?.[u]&&n.ws[u].wsSend({id:"1",ty:"common/setlanguage",db:$}):n.setconfig("settinglang",{lang:_})});const g=[n.initlang(i.config.langcur||"")];return g.push(n.initmodel(u+"/dirmodel.json").then(_=>{_&&Object.assign(t[u],_)})),Promise.all(g)}return{initAppModel:f}}},Symbol.toStringTag,{value:"Module"})),V=e.reactive({providedb:{data:{}}}),M=e.reactive({providedbwork:{data:{}}}),x=e.reactive({provideglobal:{data:{sys:null,wd:{w:0,h:0},config:{theme:"theme-light",lang:"",langcur:""},theme:"",stat:{webclient:0,web:0,cocontrol:0},user:{info:null,online:0},code:{pri:null,pub:null,token:""},location:{},pop:{},url:{},module:{value:"",label:""},keyboard:{comps:{},areastyle:{},opt:{},csskeyboard:"",showkeyboard:!1}}}}),T=e.reactive({providews:{data:{rooms:{},wssys:{}}}}),C={providefn:{data:{api:{},ws:{},wssys:null,workers:{}}}},R=Object.freeze(Object.defineProperty({__proto__:null,default:(o=null)=>{const n=window;Object.assign(C.providefn.data,o?.plugs||{});const t={$db:V.providedb.data,$dbwork:M.providedbwork.data,$ws:T.providews.data,$global:x.provideglobal.data,$model:n.$GYS.$webmodel,$fn:C.providefn.data};t.$global.$cfg=n.$CFG||{},n.$GYS.ujt=t,t.$fn.lo=(...a)=>{if(t.$global.sys?.onconsole){if(!a?.[0])t.$model.gysfn.log();else if(a.length>0){let r="",c="",d="";if(a[1]&&typeof a[1]=="string"){const[p,h,...b]=a;c=h,d=b,Array.isArray(a[0])&&a[0].length===2?r=l(a[0][0],a[0][1],"12px"):typeof a[0]=="number"&&(r=s(p,12))}r?console.log("%c"+c,r,...d):console.log(...a)}}},t.$model.gysfn.log=()=>(console.log("%c$fn",s(6,18),i(t.$fn),t.$fn),console.log("%c$model",s(5,18),i(t.$model),t.$model),console.log("%c$global",s(4,18),i(t.$global),t.$global),console.log("%c$ws",s(3,18),i(t.$ws),t.$ws),console.log("%c$db",s(2,18),i(t.$db),t.$db),console.log("%c$dbwork",s(1,18),i(t.$dbwork),t.$dbwork),"Web Model Log。");function s(a,r=18){let c="";return a===1?c=l("black","pink",r+"px"):a===2?c=l("black","cyan",r+"px"):a===3?c=l("black","yellow",r+"px"):a===4?c=l("white","blue",r+"px"):a===5?c=l("white","red",r+"px"):a===6?c=l("white","green",r+"px"):a===7&&(c=l("white","purple",r+"px")),c}function l(a,r,c="18px"){return"font-size:"+c+";font-weight:bold;border-radius:20px;padding:0 10px;color:"+a+";background-color:"+r+";"}function i(a){try{return"size=>"+((a&&JSON.stringify(a)?.length)/1024).toFixed(3)+"KB"}catch{return""}}function f(a={}){t.$global.pop.popdefaultconfirm&&(t.$global.pop.popdefaultconfirm.stat=1,t.$global.pop.popdefaultconfirm.full=1,t.$global.pop.popdefaultconfirm.notit=1,Object.assign(t.$global.pop.popdefaultconfirm,a))}function u(a={}){t.$global.pop.popdefaultconfirmpass&&(t.$global.pop.popdefaultconfirmpass.stat=1,t.$global.pop.popdefaultconfirmpass.full=1,t.$global.pop.popdefaultconfirmpass.notit=1,Object.assign(t.$global.pop.popdefaultconfirmpass,a))}t.$fn.popConfirm=f,t.$fn.popConfirmPass=u,t.$fn.getWebPath=(a="")=>{const r=t?.$global?.$cfg?.webpath||"./";return a&&!a.startsWith("http")&&!a.startsWith(r)?r+a:a};const{fetchPublic:m}=t.$fn?.AsaiModel(t.$fn.getWebPath("webmodel/"));t.$fn.initmodel=m,t.$fn.startLink=()=>new Promise((a,r)=>{t.$fn.initmodel("sys/server.json").then(c=>{const d={api:{},ws:{}};["api","ws"].forEach(p=>{Object.keys(c?.[p]||{}).forEach(h=>{let b=c[p][h];b&&typeof b=="string"&&(b=d[p][b]),b||(b=c[p].default),d[p][h]={...b,url:t.$fn.As.getUrlByCfg(b,p=="ws"?1:0)}})}),t.$fn.As.localSet("as-link",JSON.stringify(d)),t.$global.link=d,a(t.$global.link)}).catch(c=>{r(c)})}),t.$fn.saveLink=a=>{t.$global.link=a,t.$fn.As.localSet("as-link",JSON.stringify(t.$global.link))},t.$fn.initLink=(a=0)=>new Promise((r,c)=>{if(a)t.$fn.startLink().then(d=>{r(d)}).catch(d=>{c(d)});else{let d=t.$fn.As.localGet("as-link");d?(t.$global.link=JSON.parse(d),t.$global.link?.api&&t.$global.link?.ws&&t.$global.link?.ws?.default?r(t.$global.link):t.$fn.startLink().then(p=>{r(p)}).catch(p=>{c(p)})):t.$fn.startLink().then(p=>{r(p)}).catch(p=>{c(p)})}});const g=new Map,_=/\$(\d+)/g;t.$fn.lg=(a,r)=>{if(typeof a!="string"||!a)return;let c=g.get(a);c||(c=a.split("."),g.set(a,c));const d=c.reduce((b,y)=>b?.[y],t.$global.lang);if(!r||r.length===0)return d;const p=Array.isArray(r)?r:[r];return d?.replace(_,(b,y)=>{const k=parseInt(y,10)-1;return p[k]??b})},t.$fn.initlang=(a="")=>{let r="";return t.$global?.sys?.local?.lang?r=a||t.$fn.As.localGet(t.$global?.sys?.local?.lang)||t.$model.data.sys.settinglang?.lang||t.$model.data.sys.sysconfig?.lang[0]:r=a||t.$model.data.sys.settinglang?.lang||t.$model.data.sys.sysconfig?.lang[0],t.$global?.lang||(t.$global.lang={}),new Promise((c,d)=>{t.$fn.initmodel("lang/dirlang.json",r+"/").then(p=>{Object.assign(t.$global.lang,p),c(t.$global.lang)}).catch(p=>{d(p)})})},t.$fn.changelang=(a="")=>{let r="";return t.$global?.sys?.local?.lang?r=t.$fn.As.localGet(t.$global?.sys?.local?.lang)||t.$model.data.sys.settinglang?.lang||t.$model.data.sys.sysconfig?.lang[0]:r=t.$global.config.langcur||t.$model.data.sys.settinglang?.lang||t.$model.data.sys.sysconfig?.lang[0],new Promise((c,d)=>{a&&r===a&&t.$global?.lang?c(r):(a==="auto"?r=r==t.$model.data.sys.sysconfig?.lang[0]?t.$model.data.sys.sysconfig?.lang[1]:t.$model.data.sys.sysconfig?.lang[0]:a&&(r=a),t.$global?.sys?.local?.lang&&t.$fn.As.localSet(t.$global?.sys?.local?.lang,r),t.$global?.sys?.local?.lang||!t.$global.config.lang?(t.$global.config.lang=r,t.$fn.initlang(r).then(p=>{c(r)}).catch(p=>{d(p)})):c(r))})},t.$fn.initver=()=>{if(t.$global.sys?.webver){const a=t.$fn.As.localGet("as-web-ver");if(a){if(t.$global.sys?.webver!==a)return t.$fn.As.localInit(),!0}else t.$fn.As.localSet("as-web-ver",t.$global.sys?.webver||"")}return!1},t.$fn.initweb=async a=>{try{let r=function(){const{protocol:d,hostname:p,port:h,hash:b}=n.location;t.$global.location={protocol:d,hostname:p,port:h,hash:b.replace("#",""),comps:[],query:{}},t.$fn.AsRouter.initHash(t.$global.location),y();function y(){t.$fn.AsRouter.setRouter(t.$global.location)}t.$fn.setquery=(k={},A=0)=>{let j;A?j=new URLSearchParams({...t.$global.location.query||{},...k||{}}).toString():j=new URLSearchParams(k||{}).toString(),j?j=t.$global.location.hash.split("?")[0]+"?"+j:j=t.$global.location.hash.split("?")[0],t.$fn.AsRouter.setHash(t.$global.location,j),y()},t.$fn.sethash=(k="")=>{t.$fn.AsRouter.setHash(t.$global.location,k)},t.$fn.exit=(k=0)=>{t.$fn.As.localSet("as-user-info",""),t.$global.user.info=null,t.$global.code.token=null,k&&(t.$fn.sethash(""),t.$fn.As.localReload())},t.$fn.login=()=>{t.$fn.As.localSet("as-user-info",""),t.$global.user.info=null,t.$fn.sethash(t.$global.sys?.router?.config?.login||"user/login")}};Object.assign(t.$fn,a.$fns||{}),Object.assign(t.$fn,a.$engineasai||{}),Object.assign(t.$fn,a.$engineasailib||{});for(let d=0;d<3;d++)a["$engineasai"+d]&&Object.assign(t.$fn,a["$engineasai"+d]);const c=await t.$fn.initmodel("sys/dirglobal.json");if(t.$global.sys={},Object.keys(c).forEach(d=>{Object.assign(t.$global.sys,c[d])}),t.$fn.initver())return;if(t.$model.data.sys=await t.$fn.initmodel("sys/dirmodel.json"),t.$model.data.sys.configrouter){t.$global.sys.router=t.$model.data.sys.configrouter;for(let d=0;d<t.$model?.webmodels?.length;d++){const p=await t.$fn.initmodel(t.$model?.webmodels?.[d]+"/configrouter.json");typeof p=="object"&&Object.entries(p).forEach(([h,b])=>{h==="rights"?Object.entries(b).forEach(([y,k])=>{k&&k.length&&k.forEach(A=>{t.$global.sys.router.rights[y].includes(A)||t.$global.sys.router.rights[y].push(A)})}):Object.assign(t.$global.sys.router[h],b)})}}t.$fn.lo(),await t.$fn.initLink(),r()}catch(r){console.error("initUser error:",r)}},t.$fn.offweb=()=>{t.$fn.AsRouter.offHash()},t.$fn.initrouter=()=>{if(t.$global?.sys?.devlevel&&!t.$global.url[t.$global.module.value]){t.$global.url[t.$global.module.value]=[],t.$global.url[t.$global.module.value].push(...Object.keys(t.$model.appmodules.indexRouters).map(r=>({value:r,label:r,type:"module"})));const a=/^\.\/(.*?)\/default\.vue$/;t.$global.url[t.$global.module.value].push(...[...Object.keys(t.$model.comps)?.map(r=>{if(a.test(r)){const c=r.match(a);if(c)return c[1]}return""}).filter(r=>r)].map(r=>({value:r,label:r})))}},t.$fn.inittoken=()=>{t.$global.code.pri&&t.$global.user.info?.us&&(t.$global.code.token=t.$fn.AsCode.asencode(t.$global.user.info?.us,t.$global.code.pri)+"##"+t.$fn.AsCode.asencode(t.$global.user.info?.lv||0,t.$global.code.pri)+"##"+t.$global.code.pub)},t.$fn.gettoken=(a=0)=>t.$global?.code?.token?t.$global.code.token:t.$global?.code?.pub&&a?t.$global?.code?.token||"####"+t.$global.code.pub:"",t.$fn.logSave=(a=null)=>new Promise((r,c)=>{Array.isArray(a)&&(a=a?.map?.(d=>typeof d=="object"?JSON.stringify(d):d)?.join(`
|
|
2
2
|
`)||""),t?.$fn?.apisys?.apiPost("/api/asailog/manage/addclient/",a).then(r).catch(c)});function $(a=new Date){const r=(c,d=2)=>String(c).padStart(d,"0");return`${r(a.getHours())}:${r(a.getMinutes())}:${r(a.getSeconds())}.${r(a.getMilliseconds(),3)}`}return t.$fn.$log=(a=null)=>new Promise((r,c)=>{if(a){const d=`[${$()}] ${t.$global?.user?.info?.us||""}-${a}`;t?.$fn?.lo?.(7,"log",d),t?.$global?.sys?.onweblog&&t.$fn.logSave(d).then(r).catch(c),r()}else r()}),t.$fn.checkOnline=()=>new Promise((a,r)=>{if(t?.$global?.sys?.onwebws&&t?.$global?.sys?.onckuseronline)try{typeof t?.$fn?.ws?.web?.wsApi=="function"?t.$fn.ws.web.wsApi("ping")?.then(c=>{c=="pong"?a(c):r(c)}).catch(r):r()}catch(c){r(c)}else a()}),e.provide("$ujtasai",t),{...t,$ujtasai:t}}},Symbol.toStringTag,{value:"Module"})),W={install(o,n){n.loadts({app:o,key:"$engineasai",eager:!0,files:Object.assign({"./asengine/common/As.ts":E,"./asengine/common/AsAES copy.ts":B,"./asengine/common/AsRouter.ts":O,"./asengine/init/useInitApp.ts":N,"./asengine/provide/useProvide.ts":R})}),n.loadvue({loadfn:n.loadfn,app:o,eager:!1,files:Object.assign({"./asui/app/AsaiComponent.vue":()=>Promise.resolve().then(()=>L),"./asui/app/AsaiInitPage.vue":()=>Promise.resolve().then(()=>D),"./asui/app/AsaiWebItemDefault.vue":()=>Promise.resolve().then(()=>J),"./asui/app/AsaiWebItemIndex.vue":()=>Promise.resolve().then(()=>q),"./asui/app/AsaiWebModule.vue":()=>Promise.resolve().then(()=>K),"./asui/app/AsaiWebModuleDefault.vue":()=>Promise.resolve().then(()=>se),"./asui/app/AsaiWebModuleIndex.vue":()=>Promise.resolve().then(()=>le),"./asui/app/AsaiWebServer.vue":()=>Promise.resolve().then(()=>ae),"./asui/app/AsaiWebServerNode.vue":()=>Promise.resolve().then(()=>re),"./asui/app/AsaiWebServerUser.vue":()=>Promise.resolve().then(()=>ie),"./asui/app/AsaiWebServerUserOnline.vue":()=>Promise.resolve().then(()=>ce),"./asui/common/AsPageBusy.vue":()=>Promise.resolve().then(()=>pe),"./asui/common/AsPageBusyGif.vue":()=>Promise.resolve().then(()=>he),"./asui/common/AsReset.vue":()=>Promise.resolve().then(()=>_e),"./asui/common/AsSvg.vue":()=>Promise.resolve().then(()=>ke),"./asui/common/MenuShowFix.vue":()=>Promise.resolve().then(()=>Ee),"./asui/common/RouterMap.vue":()=>Promise.resolve().then(()=>Pe),"./asui/common/RouterView.vue":()=>Promise.resolve().then(()=>Ve),"./asui/common/VirtualList.vue":()=>Promise.resolve().then(()=>Me),"./asui/page/PageErr.vue":()=>Promise.resolve().then(()=>We),"./asui/page/PageLoadClient.vue":()=>Promise.resolve().then(()=>ze),"./asui/page/PageLoadErr.vue":()=>Promise.resolve().then(()=>ve),"./asui/page/PageLoadServer.vue":()=>Promise.resolve().then(()=>Ze),"./asui/page/PageLoadUserToken.vue":()=>Promise.resolve().then(()=>st),"./asui/page/PageLoadUserTokenOnline.vue":()=>Promise.resolve().then(()=>dt),"./asui/page/PageLoadWs.vue":()=>Promise.resolve().then(()=>ht)})})}},L=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"AsaiComponent",props:{ujt:{}},setup(o){const n=o,{$model:t,$global:s}=n.ujt,l=e.computed(()=>t.appmodules.indexRouters[(t?.webmodels?.includes(s.location?.hasharr?.[0])?s.location?.hasharr?.[0]:"")||t?.webmodels?.[0]]);return(i,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{ujt:o.ujt},null,8,["ujt"]))}})},Symbol.toStringTag,{value:"Module"})),D=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"AsaiInitPage",props:{appmodules:{},ujt:{}},setup(o){const n=o,t=e.inject("$vueProxy"),{$global:s,$fn:l,$model:i,$ws:f}=n.ujt;i.appmodules=n.appmodules;function u(){let a=l.As?.localGet("as-user-code");a&&(a=l.As.toObj(a),s.code.pri=a[0],s.code.pub=a[1]),s.code.pri&&l.As.localGet("as-user-info")&&(s.user.info=l.As.toObj(l.AsAES.dec(l.As.localGet("as-user-info")))),l.inittoken()}function m(){s?.sys?.onwebws&&l.ws.web.wsWatch({ty:"publish/web"},a=>{a?.db?.exit&&l.exit(),a?.db?.lang&&(a.db.langpm?a.db.con=l.lg("asai.hostmsg."+a.db.lang,a.db.langpm)||a.db.con:a.db.con=l.lg("asai.hostmsg."+a.db.lang)||a.db.con),a?.db==="pong"?l.ws.web.wsApi("ping").then(r=>{}):a?.db?.bs?g(a.db.bs):a?.db?.con&&s.msg.fn(a.db)})}function g(a){if(Array.isArray(a)&&a[0]?.[0])try{a.forEach(r=>{l.As.setObjValByPath(f.wssys,r[0],r[1])})}catch{}}s.rlv=e.computed(()=>!s.location.hash||s.location.hash=="/"||s.sys?.router?.rights?.lv0?.find(a=>s.location.hash.includes(a))?0:s.sys?.router?.rights?.lv1?.find(a=>s.location.hash.includes(a))?1:s.sys?.router?.rights?.lv2?.find(a=>s.location.hash.includes(a))?2:s.sys?.router?.rights?.lv3?.find(a=>s.location.hash.includes(a))?3:s.sys?.router?.config?.lv);function _(a,r){try{console.error(r+" Error:",a);let c="";a?.error?.stack&&typeof a?.error?.stack=="string"?c=a.error.stack:a?.error?.message&&typeof a?.error?.message=="string"?c=a.error.message:a?.message&&typeof a?.message=="string"?c=a.message:a?.reason?.message&&typeof a?.reason?.message=="string"?c=a.reason.message:a?.reason&&typeof a?.reason=="string"?c=a.reason:a&&typeof a=="string"&&(c=a),c&&(c="Web "+r+` Error:
|
|
3
3
|
`+c,console.error(c),l.$log(c),s?.msg?.fn?.({type:"err",con:c})),a.preventDefault()}catch(c){console.error("Try Error:",c)}}const $=e.reactive({catchErrorUnhandledrejection:null,catchErrorCatch:null});return e.onMounted(()=>{l.initweb(t).then(()=>{let a=[];if(l?.useApi?.(n.ujt,"web"),s?.sys?.tyrobot&&(l.useApi(n.ujt,s.sys.tyrobot),l.useWs(n.ujt,s.sys.tyrobot)),u(),s?.sys?.onwebws&&(l.useWs(n.ujt,"web"),a.push(l.ws.web.init().then(()=>{m()}))),s?.sys?.local?.lang||a.push(l.initmodel("/sys/setting/settinglang.json").then(r=>{typeof r?.data=="string"?s.config.langcur=JSON.parse(r?.data||"{}")?.lang:s.config.langcur=(r?.data||{})?.lang})),s?.sys?.aes?.lv&&!s.sys.aesfns&&l.AsaiVueAES?.useAES){const{toAES:r,fromAES:c}=l.AsaiVueAES.useAES(n.ujt);s.sys.aesfns={allaes:s.sys.aes.lv>1,toAES:r,fromAES:c}}Promise.all(a).then(()=>{l.changelang(s.config.langcur).then(r=>{!window?.$CFG?.title&&s.lang.configweb?.webtit&&(document.title=s.lang.configweb?.webtit),s.stat.webclient=1,s.sys.catcherror&&($.catchErrorUnhandledrejection=d=>{_(d,"Unhandledrejection")},window?.addEventListener?.("unhandledrejection",$.catchErrorUnhandledrejection),$.catchErrorCatch=d=>{_(d,"Catch")},window?.addEventListener?.("error",$.catchErrorCatch))})})})}),e.onBeforeUnmount(()=>{l.offweb(),s.sys.catcherror&&($.catchErrorUnhandledrejection&&(window.removeEventListener("unhandledrejection",$.catchErrorUnhandledrejection),$.catchErrorUnhandledrejection=null),$.catchErrorCatch&&(window.removeEventListener("error",$.catchErrorCatch),$.catchErrorCatch=null)),s?.sys?.onwebws||l.ws.web.wsWatchOff({ty:"publish/web"})}),(a,r)=>{const c=e.resolveComponent("AsaiWebServer"),d=e.resolveComponent("AsaiWebServerNode"),p=e.resolveComponent("AsaiWebServerUser"),h=e.resolveComponent("AsaiWebServerUserOnline");return e.unref(s).stat.webclient?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(s).rlv===0?(e.openBlock(),e.createBlock(c,{key:0,ujt:o.ujt},null,8,["ujt"])):e.unref(s).rlv===1?(e.openBlock(),e.createBlock(d,{key:1,ujt:o.ujt},null,8,["ujt"])):e.unref(s).rlv===2?(e.openBlock(),e.createBlock(p,{key:2,ujt:o.ujt},null,8,["ujt"])):(e.openBlock(),e.createBlock(h,{key:3,ujt:o.ujt},null,8,["ujt"]))],64)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent("PageLoadClient"),{key:1,ujt:o.ujt},null,8,["ujt"]))}}})},Symbol.toStringTag,{value:"Module"})),z={class:"app-area"},I={class:"app-logo"},U=["src"],F={class:"app-menu-area"},G=["onPointerup"],H={class:"menu-text"},v={class:"app-login"},J=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"AsaiWebItemDefault",props:{ujt:{}},setup(o){const n=o,{$global:t,$fn:s}=n.ujt,l=e.computed(()=>t.url?.[t.module.value]?.filter(i=>i.type==="module"||("/"+i.value+"/").startsWith(t.location.hash))||[]);return(i,f)=>{const u=e.resolveComponent("AsReset");return e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("div",I,[e.createElementVNode("img",{src:e.unref(t).$cfg.logo,width:"200"},null,8,U)]),e.createElementVNode("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,m=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`app-menu${m.type==="module"?" module":""}`),key:m.value,onPointerup:g=>e.unref(s).sethash(m.value==="views"?"":m.value)},[e.createElementVNode("span",H,e.toDisplayString(m.label),1)],42,G))),128))]),e.createElementVNode("div",v,[e.createVNode(u,{ujt:o.ujt},null,8,["ujt"])])])}}})},Symbol.toStringTag,{value:"Module"})),q=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"AsaiWebItemIndex",props:{ujt:{},ty:{}},setup(o){return(n,t)=>{const s=e.resolveComponent("RouterView");return e.openBlock(),e.createBlock(s,{ujt:o.ujt,ty:o.ty||2},null,8,["ujt","ty"])}}})},Symbol.toStringTag,{value:"Module"})),K=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"AsaiWebModule",props:{ujt:{},module:{},ty:{}},setup(o){const n=o,{$global:t,$fn:s}=n.ujt;Object.assign(t.module,n.module),n.module?.ws&&s.useWs(n.ujt,t.module.value);const{initAppModel:l}=s.useInitApp(n.ujt);return t.stat[t.module.value]=0,l(t.module.value).then(i=>{t.stat[t.module.value]=1}),(i,f)=>{const u=e.resolveComponent("RouterView");return n.module?.value&&e.unref(t).stat[n.module.value]?(e.openBlock(),e.createBlock(u,{key:0,ujt:o.ujt,ty:o.ty||0},null,8,["ujt","ty"])):e.unref(t).pagebusy?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent("PageLoadErr"),{key:1,ujt:o.ujt},null,8,["ujt"]))}}})},Symbol.toStringTag,{value:"Module"})),Y={class:"app-area"},X={class:"app-logo"},Z=["src"],Q={class:"app-menu-area"},ee=["onPointerup"],te={class:"menu-text"},oe={class:"app-login"},ne=e.defineComponent({__name:"AsaiWebModuleDefault",props:{ujt:{}},setup(o){const n=o,{$global:t,$fn:s}=n.ujt;return s.initrouter(),(l,i)=>{const f=e.resolveComponent("MenuShowFix"),u=e.resolveComponent("AsReset");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(f,{ujt:o.ujt,menus:e.unref(t).url[e.unref(t).module.value]},null,8,["ujt","menus"]),e.createElementVNode("div",Y,[e.createElementVNode("div",X,[e.createElementVNode("img",{src:e.unref(t).$cfg.logo,width:"200"},null,8,Z)]),e.createElementVNode("div",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).url[e.unref(t).module.value],m=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`app-menu${m.type==="module"?" module":""}`),key:m.value,onPointerup:g=>e.unref(s).sethash(m.value==="views"?"":m.value)},[e.createElementVNode("span",te,e.toDisplayString(m.label),1)],42,ee))),128))]),e.createElementVNode("div",oe,[e.createVNode(u,{ujt:o.ujt},null,8,["ujt"])])])],64)}}}),w=(o,n)=>{const t=o.__vccOpts||o;for(const[s,l]of n)t[s]=l;return t},se=Object.freeze(Object.defineProperty({__proto__:null,default:w(ne,[["__scopeId","data-v-bba548d2"]])},Symbol.toStringTag,{value:"Module"})),le=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"AsaiWebModuleIndex",props:{ujt:{},ty:{}},setup(o){const n=o,{$global:t,$fn:s}=n.ujt;return s.initrouter(),(l,i)=>{const f=e.resolveComponent("MenuShowFix"),u=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(f,{ujt:o.ujt,menus:e.unref(t).url[e.unref(t).module.value]},null,8,["ujt","menus"]),e.unref(t).stat[e.unref(t).module.value]?(e.openBlock(),e.createBlock(u,{key:0,ujt:o.ujt,ty:o.ty||1},null,8,["ujt","ty"])):e.createCommentVNode("",!0)],64)}}})},Symbol.toStringTag,{value:"Module"})),ae=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"AsaiWebServer",props:{ujt:{}},setup(o){const n=o,{$global:t}=n.ujt;return(s,l)=>{const i=e.resolveComponent("AsaiComponent");return e.openBlock(),e.createElementBlock("div",{id:"asaiwebserver",class:e.normalizeClass("asaiweb asaiweb"+(e.unref(t).location?.hasharr?.[0]||"default"))},[e.createVNode(i,{ujt:o.ujt},null,8,["ujt"])],2)}}}),[["__scopeId","data-v-7d8d7f46"]])},Symbol.toStringTag,{value:"Module"})),re=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"AsaiWebServerNode",props:{ujt:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt,{initChannelUserToken:l}=t.useChannelUser({ujt:n.ujt,opt:{channel:s?.sys?.sysdb?.user?.channel||"channeluser"}});return l().catch(()=>{t.login()}),(i,f)=>{const u=e.resolveComponent("AsaiComponent");return e.openBlock(),e.createElementBlock("div",{id:"asaiwebservernode",class:e.normalizeClass("asaiweb asaiweb"+e.unref(s).location?.hasharr?.[0])},[e.unref(s).code.pub?(e.openBlock(),e.createBlock(u,{key:0,ujt:o.ujt},null,8,["ujt"])):e.unref(s).pagebusy?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent("PageLoadServer"),{key:1,ujt:o.ujt},null,8,["ujt"]))],2)}}}),[["__scopeId","data-v-316455f4"]])},Symbol.toStringTag,{value:"Module"})),ie=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"AsaiWebServerUser",props:{ujt:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt,{initChannelUserToken:l}=t.useChannelUser({ujt:n.ujt,opt:{channel:s?.sys?.sysdb?.user?.channel||"channeluser"}});return l().catch(()=>{t.login()}),(i,f)=>{const u=e.resolveComponent("AsaiComponent");return e.openBlock(),e.createElementBlock("div",{id:"asaiwebserveruser",class:e.normalizeClass("asaiweb asaiweb"+e.unref(s).location?.hasharr?.[0])},[e.unref(s).code.token?(e.openBlock(),e.createBlock(u,{key:0,ujt:o.ujt},null,8,["ujt"])):e.unref(s).pagebusy?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent("PageLoadUserToken"),{key:1,ujt:o.ujt},null,8,["ujt"]))],2)}}}),[["__scopeId","data-v-a4bd06af"]])},Symbol.toStringTag,{value:"Module"})),ce=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"AsaiWebServerUserOnline",props:{ujt:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt,{initChannelUserOnline:l}=t.useChannelUser({ujt:n.ujt,opt:{channel:s?.sys?.sysdb?.user?.channel||"channeluser"}});return l().catch(()=>{t.login()}),(i,f)=>{const u=e.resolveComponent("AsaiComponent");return e.openBlock(),e.createElementBlock("div",{id:"asaiwebserveruseronline",class:e.normalizeClass("asaiweb asaiweb"+e.unref(s).location?.hasharr?.[0])},[e.unref(s).code.token&&e.unref(s).user.online?(e.openBlock(),e.createBlock(u,{key:0,ujt:o.ujt},null,8,["ujt"])):e.unref(s).pagebusy?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent("PageLoadUserTokenOnline"),{key:1,ujt:o.ujt},null,8,["ujt"]))],2)}}}),[["__scopeId","data-v-6cc1e64b"]])},Symbol.toStringTag,{value:"Module"})),de={key:0,class:"as-pagebusy-area touch-none"},ue={class:"as-pagebusy"},fe={key:0,class:"as-pagebusy-v"},pe=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"AsPageBusy",props:{ujt:{}},setup(o){e.useCssVars(f=>({v2189716e:l.value}));const n=o,{$global:t,$fn:s}=n.ujt,l=e.computed(()=>t.pagebusy?.zindex||9999);function i(){s.popConfirm({con:t.lang.asai.resetconfirm,zindex:l.value+1,fn:()=>{t.pagebusy=null,s.As.localInit()}})}return(f,u)=>{const m=e.resolveComponent("AsPageBusyGif"),g=e.resolveDirective("dbpointerdown");return e.unref(t).pagebusy?e.withDirectives((e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",{class:"as-pagebusy-close",onClick:u[0]||(u[0]=e.withModifiers(_=>i(),["stop"]))}),e.createElementVNode("div",ue,[e.createVNode(m,{ujt:o.ujt},null,8,["ujt"]),e.unref(t).pagebusy?.v?(e.openBlock(),e.createElementBlock("div",fe,e.toDisplayString(e.unref(t).pagebusy?.v),1)):e.createCommentVNode("",!0)])])),[[g,()=>{e.unref(t).pagebusy?.keep||i()}]]):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-3b86e9a1"]])},Symbol.toStringTag,{value:"Module"})),me=w(e.defineComponent({__name:"AsLoadingCircle",props:{ujt:{type:Object,default:()=>({})},size:{type:Number,default:68,validator:o=>o>0}},setup(o){return(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:"as-load-gif",style:e.normalizeStyle({width:o.size+"px",height:o.size+"px"})},null,4))}}),[["__scopeId","data-v-c5bf2081"]]),ge=w(e.defineComponent({__name:"AsLoadingA3d",props:{ujt:{type:Object,default:()=>({})},size:{type:Number,default:68,validator:o=>o>0}},setup(o){return(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:"a3d-wrapper",style:e.normalizeStyle({"--cube-size":`${o.size}px`,"--half-size":`${o.size/2}px`})},[...t[0]||(t[0]=[e.createStaticVNode('<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)])],4))}}),[["__scopeId","data-v-4d1d2b0e"]]),he=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"AsPageBusyGif",props:{ujt:{},opt:{}},setup(o){const n=o,{$global:t}=n.ujt;return(s,l)=>o.opt?.ty||e.unref(t).pagebusy?.ty?(e.openBlock(),e.createBlock(ge,{key:0,size:o.opt?.size||e.unref(t).pagebusy?.size,ujt:o.ujt},null,8,["size","ujt"])):(e.openBlock(),e.createBlock(me,{key:1,size:o.opt?.size||e.unref(t).pagebusy?.size,ujt:o.ujt},null,8,["size","ujt"]))}})},Symbol.toStringTag,{value:"Module"})),be={key:0,class:"as-usercard"},_e=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"AsReset",props:{ujt:{},type:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt,l={};return(i,f)=>{const u=e.resolveComponent("AsSvg");return e.renderSlot(i.$slots,"default",{item:{},option:l},()=>[e.unref(s).lang?.asai?.usercard?(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",{onClick:f[0]||(f[0]=m=>e.unref(t).login())},[e.createVNode(u,{color:"var(--cu6)",height:"26px",src:"asai/login"}),e.createTextVNode(" "+e.toDisplayString(e.unref(s).lang.asai.usercard?.login),1)]),e.createElementVNode("div",{onClick:f[1]||(f[1]=m=>e.unref(t).As.localInit()),title:"ctrl+shift+r"},[e.createVNode(u,{color:"var(--cu6)",height:"26px",src:"asai/reset"}),e.createTextVNode(" "+e.toDisplayString(e.unref(s).lang.asai.usercard?.reset),1)])])):e.createCommentVNode("",!0)],!0)}}}),[["__scopeId","data-v-a12ce8ac"]])},Symbol.toStringTag,{value:"Module"})),$e={class:"as-icon"},ye={key:0,class:"as-icon-filter"},we=["src"],ke=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"AsSvg",props:{src:{type:String,default:""},height:{type:String,default:"24px"},width:{type:String,default:""},color:{type:String,default:"var(--cv8)"},showtype:{type:String,default:"mask"},webty:{type:String,default:""}},setup(o){const n=o,t=window?.$CFG?.webpath||"./";let s=e.ref("");const l=e.computed(()=>s.value?t+"webmodel/files/"+(n.webty??+n.webty+"/")+"svg/"+s.value+".svg":n.src.startsWith("http")||n.src.endsWith(".svg")||n.src.endsWith(".png")?n.src:t+"webmodel/files/"+(n.webty??+n.webty+"/")+"svg/"+n.src+".svg");function i(){s.value="default"}function f(){return{width:`${n.width?n.width:n.height}`,height:`${n.height?n.height:n.width}`,"background-color":`${n.color}`,"mask-image":`url('${l.value}')`,"-webkit-mask-image":`url('${l.value}')`}}function u(){return n.width?{transform:"translateX(-100%)",filter:`drop-shadow(${n.width} 0 ${n.color})`,width:`${n.width}`}:{transform:"translateY(-100%)",filter:`drop-shadow(0 ${n.height} ${n.color})`,height:`${n.height}`}}return(m,g)=>(e.openBlock(),e.createElementBlock("i",$e,[o.showtype==="filter"?(e.openBlock(),e.createElementBlock("i",ye,[e.createElementVNode("img",{style:e.normalizeStyle(u()),src:l.value,onError:g[0]||(g[0]=_=>i())},null,44,we)])):(e.openBlock(),e.createElementBlock("i",{key:1,class:"as-icon-mask",style:e.normalizeStyle(f())},null,4))]))}}),[["__scopeId","data-v-d9bafe22"]])},Symbol.toStringTag,{value:"Module"})),je={class:"as-floating-menu"},Se={key:0},Ae={key:1},Ce=["onPointerup"],Ee=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"MenuShowFix",props:{ujt:{},menus:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt,l=e.ref(!1);function i(){l.value=!l.value}const f=e.computed(()=>[{value:"/",label:t.lg("asai.home"),type:"module"},{fn:()=>s.theme.c=s.theme.c==="d"?"l":"d",label:t.lg("asai.theme"),type:"module"},{fn:()=>s.theme.s=s.theme.s==="b"?"n":"b",label:t.lg("asai.size"),type:"module"},{fn:()=>t.changelang("auto"),label:t.lg("asai.langs.default"),type:"module"},...n.menus||[]]);return(u,m)=>!e.unref(s).sys||e.unref(s).sys.devlevel>1?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"#teleportpopbox"},[e.createElementVNode("div",je,[e.createElementVNode("button",{class:"as-floating-button",onClick:i},[l.value?(e.openBlock(),e.createElementBlock("span",Se,"×")):(e.openBlock(),e.createElementBlock("span",Ae,"☰"))]),e.createElementVNode("ul",{class:e.normalizeClass(["as-floating-menus",{open:l.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(g,_)=>(e.openBlock(),e.createElementBlock("li",{key:"menu"+_,class:e.normalizeClass(`${g.type==="module"?"module ":""}${g.value&&e.unref(s).location.hash.includes(g.value)?"active":""}`),onPointerup:$=>g.value?e.unref(t).sethash(g.value):g?.fn?.()},e.toDisplayString(_+1)+". "+e.toDisplayString(g.label||g.value),43,Ce))),128))],2)])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-162e1725"]])},Symbol.toStringTag,{value:"Module"})),Be={class:"app-menu-area"},Pe=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"RouterMap",props:{ujt:{},menus:{}},setup(o){const n=o,{$fn:t}=n.ujt;return(s,l)=>(e.openBlock(),e.createElementBlock("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menus,i=>(e.openBlock(),e.createElementBlock("div",{class:"app-menu",onClick:l[0]||(l[0]=f=>e.unref(t).sethash("item.value"))},e.toDisplayString(i.label),1))),256))]))}}),[["__scopeId","data-v-6d15bb32"]])},Symbol.toStringTag,{value:"Module"})),Oe={key:0,class:"loading"},Ne={key:1,class:"error"},Ve=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"RouterView",props:{ujt:{},ty:{}},setup(o){const n=o,{$model:t,$fn:s,$global:l}=n.ujt,i=e.shallowReactive({comp:null}),f=e.ref(!1),u=e.ref(null);s.getcomp=async g=>{f.value=!0,u.value=null;try{try{return e.defineAsyncComponent(t.comps[`./${g}.vue`])}catch(_){if(g&&g.endsWith("/default"))return e.defineAsyncComponent(t.comps[`./${g.slice(0,-8)}.vue`]);throw _}}catch(_){return u.value=_,e.defineAsyncComponent(()=>Promise.resolve().then(()=>kt))}finally{f.value=!1}};const m=e.watch(()=>l.location.comps[n.ty],async(g,_)=>{g&&g!==_&&(i.comp=await s.getcomp(g))},{immediate:!0});return e.onBeforeUnmount(()=>{m&&m.stop()}),(g,_)=>f.value?(e.openBlock(),e.createElementBlock("div",Oe,"Loading...")):u.value?(e.openBlock(),e.createElementBlock("div",Ne,"Component load error")):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i).comp),{key:2,ujt:o.ujt},null,8,["ujt"]))}})},Symbol.toStringTag,{value:"Module"})),Me=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"VirtualList",props:{items:{type:Array,required:!0},itemHeight:{type:Number,default:50},buffer:{type:Number,default:5}},setup(o){const n=o,t=e.ref(null),s=e.ref(0),l=e.ref(0),i=e.ref(0),f=e.ref(new Array(n.items.length).fill(Math.round(n.itemHeight))),u=new Map,m=e.computed(()=>Math.round(n.items.reduce((d,p,h)=>d+g(h),0))),g=d=>d<0||d>=n.items.length?0:Math.round(f.value[d]??n.itemHeight),_=()=>{if(!t.value)return{start:0,end:Math.min(n.items.length,n.buffer*3)};const d=s.value,p=t.value.clientHeight;let h=0,b=n.items.length;for(;h<b;){const j=h+b>>>1;a(j)<=d?h=j+1:b=j}const y=Math.max(0,h-1),k=Math.ceil(p/n.itemHeight)+n.buffer*2,A=Math.min(n.items.length,y+k);return{start:y,end:A}},$=e.computed(()=>{const{start:d,end:p}=_();return n.items.slice(d,p).map((h,b)=>{const y=d+b;return{index:y,id:h.id||y,data:h,offset:a(y)}})}),a=d=>{if(d<=0)return 0;if(u.has(d))return u.get(d);let p=d-1;for(;p>0&&!u.has(p);)p--;let h=p>0?u.get(p):0;for(let y=p;y<d;y++)h+=g(y);const b=Math.round(h);return u.set(d,b),b},r=()=>{l.value&&cancelAnimationFrame(l.value),l.value=requestAnimationFrame(()=>{t.value&&(s.value=Math.round(t.value.scrollTop),i.value&&clearTimeout(i.value),i.value=window.setTimeout(()=>{const{start:d,end:p}=_(),h=n.buffer*2;for(const b of u.keys())(b<d-h||b>p+h)&&u.delete(b)},150))})};let c=null;return e.onMounted(()=>{t.value&&r(),c=e.watch(()=>n.items.length,d=>{d>f.value.length?f.value=[...f.value,...new Array(d-f.value.length).fill(Math.round(n.itemHeight))]:d<f.value.length&&(f.value=f.value.slice(0,d)),u.clear()})}),e.onBeforeUnmount(()=>{c&&c.stop(),l.value&&cancelAnimationFrame(l.value),i.value&&clearTimeout(i.value)}),(d,p)=>(e.openBlock(),e.createElementBlock("div",{class:"virtual-list-container",onScroll:r,ref_key:"container",ref:t,style:{height:"100%"}},[e.createElementVNode("div",{class:"virtual-list-wrapper",style:e.normalizeStyle({height:m.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,h=>(e.openBlock(),e.createElementBlock("div",{class:"virtual-list-item",key:"as"+h.index,style:e.normalizeStyle({transform:`translateY(${h.offset}px)`})},[e.renderSlot(d.$slots,"default",{item:h},void 0,!0)],4))),128))],4)],544))}}),[["__scopeId","data-v-b613b7a8"]])},Symbol.toStringTag,{value:"Module"})),xe={class:"as-load-area"},Te=["src"],Re={class:"tit",style:{color:"var(--cz8)"}},We=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"PageErr",props:{ujt:{}},setup(o){const n=window;function t(){n?.localStorage?.clear(),n?.location?.reload()}return(s,l)=>(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("img",{onDblclick:l[0]||(l[0]=i=>t()),src:e.unref(n).$CFG.logo,width:"200"},null,40,Te),l[2]||(l[2]=e.createElementVNode("div",{class:"as-load-icon"},[e.createElementVNode("div",{class:"as-load-gif",style:{width:"68px",height:"68px"}})],-1)),e.createElementVNode("div",{class:"as-load-msg",onClick:l[1]||(l[1]=i=>e.unref(n)?.location?.reload())},[e.createElementVNode("div",Re,e.toDisplayString(e.unref(n).$GYS.$webmodel.lang[e.unref(n).$GYS.$webmodel.lang.langty].pageerr),1)])]))}})},Symbol.toStringTag,{value:"Module"})),Le={class:"as-load-area"},De=["src"],ze=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"PageLoadClient",props:{ujt:{}},setup(o){const n=e.ref("");e.onMounted(()=>{const s=window;n.value=s?.$CFG?.logo||""});function t(){const s=window;try{s?.localStorage?.clear()}catch{console.warn("Failed to clear localStorage")}s?.location?.reload()}return(s,l)=>(e.openBlock(),e.createElementBlock("div",Le,[n.value?(e.openBlock(),e.createElementBlock("img",{key:0,onDblclick:l[0]||(l[0]=i=>t()),src:n.value,width:"200"},null,40,De)):e.createCommentVNode("",!0),l[2]||(l[2]=e.createElementVNode("div",{class:"as-load-icon"},[e.createElementVNode("div",{class:"as-load-gif",style:{width:"68px",height:"68px"}})],-1)),e.createElementVNode("div",{class:"as-load-msg",onClick:l[1]||(l[1]=i=>t())},"Loading...")]))}})},Symbol.toStringTag,{value:"Module"})),Ie={class:"as-load-area"},Ue=["src"],Fe={class:"as-load-icon"},Ge={class:"as-load-msg"},He={class:"tit",style:{color:"var(--cz8)"}},ve=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"PageLoadErr",props:{ujt:{},type:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt;return(l,i)=>{const f=e.resolveComponent("AsPageBusyGif"),u=e.resolveComponent("AsReset");return e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("img",{onDblclick:i[0]||(i[0]=m=>e.unref(t).As.localInit()),src:e.unref(s).$cfg.logo,width:"200"},null,40,Ue),e.createElementVNode("div",Fe,[e.createVNode(f,{ujt:o.ujt},null,8,["ujt"])]),e.createElementVNode("div",Ge,[e.createElementVNode("div",He,e.toDisplayString(e.unref(s).lang?.asai?.page?.loadws),1),e.createElementVNode("h3",null,e.toDisplayString(n.type),1),e.createVNode(u,{ujt:o.ujt},null,8,["ujt"])])])}}})},Symbol.toStringTag,{value:"Module"})),Je={class:"as-load-area"},qe=["src"],Ke={class:"as-load-icon"},Ye={class:"as-load-msg"},Xe={class:"tit",style:{color:"var(--cy8)"}},Ze=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"PageLoadServer",props:{ujt:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt;return(l,i)=>{const f=e.resolveComponent("AsPageBusyGif"),u=e.resolveComponent("AsReset");return e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("img",{onDblclick:i[0]||(i[0]=m=>e.unref(t).As.localInit()),src:e.unref(s).$cfg.logo,width:"200"},null,40,qe),e.createElementVNode("div",Ke,[e.createVNode(f,{ujt:o.ujt},null,8,["ujt"])]),e.createElementVNode("div",Ye,[e.createElementVNode("div",Xe,e.toDisplayString(e.unref(s).lang.asai.page.loadserver),1),e.createVNode(u,{ujt:o.ujt},null,8,["ujt"])])])}}})},Symbol.toStringTag,{value:"Module"})),Qe={class:"as-load-area"},et=["src"],tt={class:"as-load-icon"},ot={class:"as-load-msg"},nt={class:"tit",style:{color:"var(--cz8)"}},st=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"PageLoadUserToken",props:{ujt:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt;return(l,i)=>{const f=e.resolveComponent("AsPageBusyGif"),u=e.resolveComponent("AsReset");return e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("img",{onDblclick:i[0]||(i[0]=m=>e.unref(t).As.localInit()),src:e.unref(s).$cfg.logo,width:"200"},null,40,et),e.createElementVNode("div",tt,[e.createVNode(f,{ujt:o.ujt},null,8,["ujt"])]),e.createElementVNode("div",ot,[e.createElementVNode("div",nt,e.toDisplayString(e.unref(s).lang.asai.page.loadusertoken),1),e.createVNode(u,{ujt:o.ujt},null,8,["ujt"])])])}}})},Symbol.toStringTag,{value:"Module"})),lt={class:"as-load-area"},at=["src"],rt={class:"as-load-icon"},it={class:"as-load-msg"},ct={class:"tit",style:{color:"var(--cy8)"}},dt=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"PageLoadUserTokenOnline",props:{ujt:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt;return(l,i)=>{const f=e.resolveComponent("AsPageBusyGif"),u=e.resolveComponent("AsReset");return e.openBlock(),e.createElementBlock("div",lt,[e.createElementVNode("img",{onDblclick:i[0]||(i[0]=m=>e.unref(t).As.localInit()),src:e.unref(s).$cfg.logo,width:"200"},null,40,at),e.createElementVNode("div",rt,[e.createVNode(f,{ujt:o.ujt},null,8,["ujt"])]),e.createElementVNode("div",it,[e.createElementVNode("div",ct,e.toDisplayString(e.unref(s).lang.asai.page.loaduseronline),1),e.createVNode(u,{ujt:o.ujt},null,8,["ujt"])])])}}})},Symbol.toStringTag,{value:"Module"})),ut={class:"as-load-area"},ft=["src"],pt={class:"as-load-icon"},mt={class:"as-load-msg"},gt={class:"tit",style:{color:"var(--cz8)"}},ht=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"PageLoadWs",props:{ujt:{},type:{}},setup(o){const n=o,{$fn:t,$global:s}=n.ujt;return(l,i)=>{const f=e.resolveComponent("AsPageBusyGif"),u=e.resolveComponent("AsReset");return e.openBlock(),e.createElementBlock("div",ut,[e.createElementVNode("img",{onDblclick:i[0]||(i[0]=m=>e.unref(t).As.localInit()),src:e.unref(s).$cfg.logo,width:"200"},null,40,ft),e.createElementVNode("div",pt,[e.createVNode(f,{ujt:o.ujt},null,8,["ujt"])]),e.createElementVNode("div",mt,[e.createElementVNode("div",gt,e.toDisplayString(e.unref(s).lang?.asai?.page?.loadws),1),e.createElementVNode("h3",null,e.toDisplayString(n.type),1),e.createVNode(u,{ujt:o.ujt},null,8,["ujt"])])])}}})},Symbol.toStringTag,{value:"Module"})),bt={class:"page-404"},_t={class:"content"},$t={key:0,class:"title"},yt={class:"description"},wt={class:"footer"},kt=Object.freeze(Object.defineProperty({__proto__:null,default:w(e.defineComponent({__name:"Asai404",props:{ujt:{}},setup(o){const n=o,{$global:t}=n.ujt;return(s,l)=>{const i=e.resolveComponent("AsReset");return e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("div",_t,[l[0]||(l[0]=e.createElementVNode("div",{class:"error-code"},"404",-1)),e.unref(t).lang?.asai?.page?.page404?(e.openBlock(),e.createElementBlock("h1",$t,e.toDisplayString(e.unref(t).lang?.asai?.page?.page404||"页面未找到"),1)):e.createCommentVNode("",!0),e.createElementVNode("p",yt,e.toDisplayString(e.unref(t).lang?.asai?.page?.reason404||"Sorry, Page not found!"),1)]),e.createElementVNode("div",wt,[e.createVNode(i,{ujt:o.ujt},null,8,["ujt"])])])}}}),[["__scopeId","data-v-999cd3d9"]])},Symbol.toStringTag,{value:"Module"}));S.default=W,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|