liyu-pc-base 1.0.1041 → 1.0.1047

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.
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "../components-4H6t466w.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "../components-B5GfTz6i.js";
2
2
  import { f as m, t as h } from "../tablePro-CU0BLve0.js";
3
3
  import { c as g, d as _, f as v, i as y } from "../TinymceEditor-AWBqjRPa.js";
4
4
  import { i as b, r as x } from "../RemoteSelect-CrqKuqLy.js";
@@ -10,5 +10,5 @@ import { t as E } from "../FieldRender-Z6cUFInL.js";
10
10
  import { t as D } from "../FieldRender2-M1x_fNwN.js";
11
11
  import { t as O } from "../SearchRender-jP5CUTmS.js";
12
12
  import { t as k } from "../FormRender3-CJJmwlzu.js";
13
- import { E as A, T as j } from "../tablePageHost-D09Gcsog.js";
13
+ import { E as A, T as j } from "../tablePageHost-DWVbM6gH.js";
14
14
  export { l as AddConditionGroupModal, x as BoldMatcher, v as CodeEditor, o as ExtraFieldSettings, E as FieldRender, D as FieldRender2, n as FormRender, p as FormRender2, k as FormRender3, r as GeneralFilter, y as IconSelect, T as JsonObj, w as JsonStr, S as RemoteModal, C as RemoteSelectPro, g as RemoteTreeSelectPro, O as SearchRender, t as SideSearchRender, m as SmallTableSerarchField, a as ViewManage, u as ai_agent_files, s as ai_agent_web, _ as debugCode, d as fullLayout, b as getFormConfig, c as gridPage, f as inner_page, j as pivotCharts, A as pivotTable, e as remotePagesV2, i as sql_db_view, h as tablePro };
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "../../remotePages-DYfamBt5.js";
1
+ import { a as e, i as t, n, r, t as i } from "../../remotePages-HVlRpMMo.js";
2
2
  export { i as getConditionsHistory, n as getDefaultAndServerConfig, r as getPageConfig, t as getViewSettingsAndPageConfig, e as setConditionsHistory };
@@ -19,9 +19,9 @@ import { t as A } from "./FieldRender2-M1x_fNwN.js";
19
19
  import "./SearchRender-jP5CUTmS.js";
20
20
  import "./FormRender3-CJJmwlzu.js";
21
21
  import { a as j, c as M, n as ae, o as oe, r as N, s as se, t as ce } from "./view-model-DKGqNoLB.js";
22
- import { o as le, r as P } from "./remotePages-DYfamBt5.js";
22
+ import { o as le, r as P } from "./remotePages-HVlRpMMo.js";
23
23
  import { a as ue, s as de } from "./utils-B0ufucPb.js";
24
- import { C as fe, E as pe, S as me, T as he, _ as ge, a as _e, b as ve, c as ye, d as be, f as xe, g as Se, h as Ce, i as we, l as Te, m as Ee, n as De, o as Oe, p as ke, r as Ae, s as je, t as Me, u as Ne, v as Pe, w as Fe, x as Ie, y as Le } from "./tablePageHost-D09Gcsog.js";
24
+ import { C as fe, E as pe, S as me, T as he, _ as ge, a as _e, b as ve, c as ye, d as be, f as xe, g as Se, h as Ce, i as we, l as Te, m as Ee, n as De, o as Oe, p as ke, r as Ae, s as je, t as Me, u as Ne, v as Pe, w as Fe, x as Ie, y as Le } from "./tablePageHost-DWVbM6gH.js";
25
25
  import { gridPageStateSymbol as Re } from "./components/gridPage/utils.js";
26
26
  import { Fragment as F, KeepAlive as ze, Transition as Be, computed as I, createBlock as L, createCommentVNode as R, createElementBlock as z, createElementVNode as B, createTextVNode as V, createVNode as H, defineComponent as U, getCurrentInstance as Ve, h as He, inject as Ue, markRaw as We, mergeModels as Ge, mergeProps as Ke, nextTick as qe, normalizeClass as Je, normalizeStyle as Ye, onActivated as Xe, onBeforeMount as Ze, onBeforeUnmount as Qe, onDeactivated as $e, onMounted as et, onUnmounted as tt, openBlock as W, provide as nt, reactive as rt, ref as G, renderList as K, renderSlot as it, resolveComponent as q, resolveDynamicComponent as at, shallowRef as ot, toDisplayString as J, unref as Y, useModel as st, vShow as ct, watch as X, withCtx as Z, withDirectives as lt, withKeys as ut, withModifiers as dt } from "vue";
27
27
  import { Modal as ft, message as Q } from "ant-design-vue";
@@ -2916,7 +2916,7 @@ var zt = {
2916
2916
  {
2917
2917
  title: "数据类型",
2918
2918
  dataIndex: "field_type",
2919
- width: 120
2919
+ width: 200
2920
2920
  },
2921
2921
  {
2922
2922
  title: "顺序",
@@ -2961,12 +2961,12 @@ var zt = {
2961
2961
  {
2962
2962
  title: "可排序",
2963
2963
  dataIndex: "is_sortable",
2964
- width: 70
2964
+ width: 80
2965
2965
  },
2966
2966
  {
2967
2967
  title: "分组查询",
2968
2968
  dataIndex: "is_group_query",
2969
- width: 80
2969
+ width: 90
2970
2970
  },
2971
2971
  {
2972
2972
  title: "转换/颜色",
@@ -3372,7 +3372,7 @@ var zt = {
3372
3372
  ]);
3373
3373
  };
3374
3374
  }
3375
- }), [["__scopeId", "data-v-48aa5d05"]]), Ur = U({
3375
+ }), [["__scopeId", "data-v-8fa89c2b"]]), Ur = U({
3376
3376
  name: "AddConditionModal",
3377
3377
  props: {
3378
3378
  open: {
@@ -0,0 +1,380 @@
1
+ import { c as e, z as t } from "./init-plugin-CERVEi6b.js";
2
+ import { getApiData as n } from "./api/api-model.js";
3
+ import { t as r } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, onMounted as p, onUnmounted as m, openBlock as h, reactive as g, ref as _, renderList as v, resolveComponent as y, toDisplayString as b, withCtx as x } from "vue";
5
+ import { message as S } from "ant-design-vue";
6
+ //#region src/components/org/create_org.vue?vue&type=script&setup=true&lang.ts
7
+ var C = { class: "service-shard-row" }, w = { class: "db-server-option" }, T = {
8
+ key: 2,
9
+ class: "task-progress"
10
+ }, E = { class: "task-progress-item" }, D = { class: "task-progress-label" }, O = { key: 0 }, k = /*#__PURE__*/ r(/* @__PURE__ */ f({
11
+ __name: "create_org",
12
+ props: {
13
+ title: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ record: {
18
+ type: Object,
19
+ default: () => ({})
20
+ }
21
+ },
22
+ emits: ["ok", "cancel"],
23
+ setup(r, { emit: f }) {
24
+ let k = r, A = f, j = t().currentOrg, M = _(), N = _(!1), P = _(!1), F = _(!1), I = _(""), L = _(""), R = _([]), z = _(null), B = g({
25
+ name: "",
26
+ role_org_id: void 0,
27
+ shardForm: void 0
28
+ }), V = _([]), H = _([]), U = g({});
29
+ B.shardForm = U;
30
+ let W = a(() => R.value.length), G = a(() => k.title || k.record?.title || "创建帐套"), ee = a(() => {
31
+ if (F.value && W.value > 0) {
32
+ let e = R.value[0];
33
+ return `正在创建帐套:${e ? Z(e.task?.stage) : "执行中"}`;
34
+ }
35
+ return N.value ? "正在加载配置..." : "正在处理...";
36
+ });
37
+ function K(e) {
38
+ return Array.isArray(e) ? e : Array.isArray(e?.list) ? e.list : Array.isArray(e?.data) ? e.data : Array.isArray(e?.result_data) ? e.result_data : Array.isArray(e?.data?.data) ? e.data.data : [];
39
+ }
40
+ function q() {
41
+ z.value &&= (window.clearTimeout(z.value), null);
42
+ }
43
+ function J() {
44
+ q(), z.value = window.setTimeout(() => {
45
+ re();
46
+ }, 1500);
47
+ }
48
+ function Y(e) {
49
+ let t = H.value.find((t) => t.server_name === e)?.serverOptions.find((t) => t.value === U[e]?.db_server_id);
50
+ return !!t && (t.is_super_account || t.use_aliyun_api_create);
51
+ }
52
+ function X(e, t) {
53
+ U[e].db_name = void 0;
54
+ }
55
+ function Z(e) {
56
+ return e ? {
57
+ init: "初始化",
58
+ create_master_org: "创建主库账套",
59
+ create_database: "创建数据库",
60
+ migrate_database: "初始化表结构",
61
+ sync_shared_data: "同步公共数据",
62
+ activate_master_org: "激活主库账套",
63
+ finished: "完成"
64
+ }[e] || e : "-";
65
+ }
66
+ function Q(e) {
67
+ return e ? {
68
+ pending: "待执行",
69
+ running: "执行中",
70
+ success: "成功",
71
+ failed: "失败"
72
+ }[e] || e : "-";
73
+ }
74
+ async function te() {
75
+ V.value = K(await n({
76
+ org_id: j?.id,
77
+ is_active: !0,
78
+ page_size: 1e3,
79
+ is_pagination: !1
80
+ }, "/org/query_organization_list")).map((e) => ({
81
+ label: `${e.name}${e.id ? `(${e.id})` : ""}`,
82
+ value: e.id
83
+ }));
84
+ }
85
+ async function ne() {
86
+ let e = K(await n({ org_id: j?.id }, "/org/query_database_server_with_org_count_sharding")), t = /* @__PURE__ */ new Map();
87
+ for (let n of e) {
88
+ let e = n.server_name || "unknown";
89
+ t.has(e) || t.set(e, {
90
+ server_name: e,
91
+ serverOptions: []
92
+ }), t.get(e).serverOptions.push({
93
+ label: n.name,
94
+ value: n.id,
95
+ org_count: n.org_count ?? 0,
96
+ is_super_account: !!n.is_super_account,
97
+ use_aliyun_api_create: !!n.use_aliyun_api_create,
98
+ can_create_db: !!n.is_super_account || !!n.use_aliyun_api_create,
99
+ db_name_list: n.db_name_list || []
100
+ });
101
+ }
102
+ H.value = [...t.values()];
103
+ for (let e of H.value) U[e.server_name] = {
104
+ is_sharded: !0,
105
+ db_server_id: e.serverOptions[0]?.value,
106
+ db_name: void 0
107
+ };
108
+ }
109
+ async function $() {
110
+ return K(await n({ org_id: j?.id }, "/org/query_current_create_task_sharding")).map((e, t) => ({
111
+ key: `${e.server_name}_${t}`,
112
+ server_name: e.server_name,
113
+ task: e.task || null
114
+ }));
115
+ }
116
+ async function re() {
117
+ if (j?.id) try {
118
+ let t = await $(), n = t.filter((e) => e.task?.status === "failed");
119
+ if (n.length) {
120
+ F.value = !1, I.value = n.map((e) => `${e.server_name}: ${e.task?.error_message || "账套创建失败"}`).join(";") || "账套创建失败", R.value = t.filter((e) => e.task?.status !== "failed");
121
+ return;
122
+ }
123
+ if (R.value = t, !t.length) {
124
+ F.value = !1, L.value = "", e().emit("refresh"), S.success("账套创建已完成"), A("ok");
125
+ return;
126
+ }
127
+ F.value = !0, I.value = "", J();
128
+ } catch (e) {
129
+ F.value = !1, I.value = e?.message || "查询账套创建进度失败";
130
+ }
131
+ }
132
+ async function ie() {
133
+ if (!j?.id) {
134
+ I.value = "当前账套不存在,无法创建账套";
135
+ return;
136
+ }
137
+ N.value = !0, I.value = "";
138
+ try {
139
+ let e = await $();
140
+ await Promise.all([te(), ne()]), e.length && (R.value = e, F.value = !0, L.value = "当前有账套创建任务正在执行", J());
141
+ } catch (e) {
142
+ I.value = e?.message || "初始化创建账套弹窗失败";
143
+ } finally {
144
+ N.value = !1;
145
+ }
146
+ }
147
+ async function ae() {
148
+ if (F.value) return;
149
+ try {
150
+ await M.value?.validate();
151
+ } catch {
152
+ return;
153
+ }
154
+ let e;
155
+ try {
156
+ e = H.value.filter((e) => U[e.server_name]?.is_sharded).map((e) => {
157
+ let t = U[e.server_name].db_server_id;
158
+ if (!t) throw Error(`服务 ${e.server_name} 开启分库后必须选择数据库服务器`);
159
+ let n = !Y(e.server_name), r = (U[e.server_name].db_name || "").trim();
160
+ if (n) {
161
+ let n = e.serverOptions.find((e) => e.value === t);
162
+ if (n?.db_name_list?.includes(r)) throw Error(`服务 ${e.server_name} 的数据库服务器[${n.label}]下已存在同名数据库配置:${r},请更换数据库名`);
163
+ }
164
+ return {
165
+ server_name: e.server_name,
166
+ is_sharded: !0,
167
+ db_server_id: t,
168
+ db_name: n ? r : void 0
169
+ };
170
+ });
171
+ } catch (e) {
172
+ I.value = e?.message || "分库配置校验失败";
173
+ return;
174
+ }
175
+ P.value = !0, I.value = "";
176
+ try {
177
+ await n({
178
+ org_id: j?.id,
179
+ name: B.name,
180
+ role_org_id: B.role_org_id,
181
+ shard_configs: e
182
+ }, "/org/create_organization_by_role_template"), F.value = !0, L.value = e.length ? `创建任务已提交(分库服务:${e.map((e) => e.server_name).join("、")})` : "创建任务已提交", S.success("创建任务已提交,正在执行"), J();
183
+ } catch (e) {
184
+ I.value = e?.message || "提交创建任务失败";
185
+ } finally {
186
+ P.value = !1;
187
+ }
188
+ }
189
+ function oe() {
190
+ A("cancel");
191
+ }
192
+ return p(() => {
193
+ ie();
194
+ }), m(() => {
195
+ q();
196
+ }), (e, t) => {
197
+ let n = y("a-alert"), r = y("a-input"), a = y("a-form-item"), f = y("a-select"), p = y("a-switch"), m = y("a-tag"), g = y("a-form"), _ = y("a-spin"), S = y("a-modal");
198
+ return h(), o(S, {
199
+ open: !0,
200
+ title: G.value,
201
+ width: "720px",
202
+ centered: "",
203
+ maskClosable: !1,
204
+ keyboard: !F.value,
205
+ okText: "提交创建",
206
+ cancelText: "关闭",
207
+ confirmLoading: P.value,
208
+ okButtonProps: { disabled: F.value },
209
+ onOk: ae,
210
+ onCancel: oe
211
+ }, {
212
+ default: x(() => [d(_, {
213
+ spinning: F.value || N.value,
214
+ tip: ee.value
215
+ }, {
216
+ default: x(() => [
217
+ L.value ? (h(), o(n, {
218
+ key: 0,
219
+ message: L.value,
220
+ type: "info",
221
+ "show-icon": "",
222
+ style: { "margin-bottom": "16px" }
223
+ }, null, 8, ["message"])) : s("", !0),
224
+ I.value ? (h(), o(n, {
225
+ key: 1,
226
+ message: I.value,
227
+ type: "error",
228
+ "show-icon": "",
229
+ style: { "margin-bottom": "16px" }
230
+ }, null, 8, ["message"])) : s("", !0),
231
+ d(g, {
232
+ ref_key: "formRef",
233
+ ref: M,
234
+ model: B,
235
+ labelCol: { style: { width: "110px" } }
236
+ }, {
237
+ default: x(() => [
238
+ d(a, {
239
+ label: "账套名称",
240
+ name: "name",
241
+ rules: [{
242
+ required: !0,
243
+ message: "请输入账套名称"
244
+ }]
245
+ }, {
246
+ default: x(() => [d(r, {
247
+ value: B.name,
248
+ "onUpdate:value": t[0] ||= (e) => B.name = e,
249
+ disabled: F.value,
250
+ placeholder: "请输入待创建账套名称",
251
+ "allow-clear": ""
252
+ }, null, 8, ["value", "disabled"])]),
253
+ _: 1
254
+ }),
255
+ d(a, {
256
+ label: "权限模板账套",
257
+ name: "role_org_id",
258
+ rules: [{
259
+ required: !0,
260
+ message: "请选择权限模板账套"
261
+ }]
262
+ }, {
263
+ default: x(() => [d(f, {
264
+ value: B.role_org_id,
265
+ "onUpdate:value": t[1] ||= (e) => B.role_org_id = e,
266
+ disabled: F.value,
267
+ options: V.value,
268
+ showSearch: !0,
269
+ optionFilterProp: "label",
270
+ placeholder: "请选择权限模板账套"
271
+ }, null, 8, [
272
+ "value",
273
+ "disabled",
274
+ "options"
275
+ ])]),
276
+ _: 1
277
+ }),
278
+ (h(!0), c(i, null, v(H.value, (e) => (h(), o(a, {
279
+ key: e.server_name,
280
+ label: `分库[${e.server_name}]`
281
+ }, {
282
+ default: x(() => [l("div", C, [d(p, {
283
+ checked: U[e.server_name].is_sharded,
284
+ "onUpdate:checked": (t) => U[e.server_name].is_sharded = t,
285
+ disabled: F.value,
286
+ "checked-children": "分库",
287
+ "un-checked-children": "不分"
288
+ }, null, 8, [
289
+ "checked",
290
+ "onUpdate:checked",
291
+ "disabled"
292
+ ]), U[e.server_name].is_sharded ? (h(), o(f, {
293
+ key: 0,
294
+ value: U[e.server_name].db_server_id,
295
+ "onUpdate:value": (t) => U[e.server_name].db_server_id = t,
296
+ disabled: F.value,
297
+ options: e.serverOptions,
298
+ showSearch: !0,
299
+ optionFilterProp: "label",
300
+ placeholder: "请选择数据库服务器",
301
+ class: "service-shard-select",
302
+ onChange: (t) => X(e.server_name, t)
303
+ }, {
304
+ option: x(({ label: e, org_count: n, can_create_db: r }) => [l("div", w, [
305
+ l("span", null, b(e), 1),
306
+ d(m, { color: n > 0 ? "blue" : "default" }, {
307
+ default: x(() => [u(b(n) + " 个账套", 1)]),
308
+ _: 2
309
+ }, 1032, ["color"]),
310
+ r ? s("", !0) : (h(), o(m, {
311
+ key: 0,
312
+ color: "orange"
313
+ }, {
314
+ default: x(() => t[2] ||= [u(" 需填库名 ")]),
315
+ _: 1
316
+ }))
317
+ ])]),
318
+ _: 2
319
+ }, 1032, [
320
+ "value",
321
+ "onUpdate:value",
322
+ "disabled",
323
+ "options",
324
+ "onChange"
325
+ ])) : s("", !0)]), U[e.server_name].is_sharded && !Y(e.server_name) ? (h(), o(a, {
326
+ key: 0,
327
+ name: [
328
+ "shardForm",
329
+ e.server_name,
330
+ "db_name"
331
+ ],
332
+ rules: [{
333
+ required: !0,
334
+ whitespace: !0,
335
+ message: "该服务器账号无自动建库权限,请填写已在服务器上创建好的数据库名"
336
+ }],
337
+ class: "db-name-form-item"
338
+ }, {
339
+ label: x(() => t[3] ||= [u("数据库名:")]),
340
+ default: x(() => [d(r, {
341
+ value: U[e.server_name].db_name,
342
+ "onUpdate:value": (t) => U[e.server_name].db_name = t,
343
+ disabled: F.value,
344
+ placeholder: "该服务器账号无自动建库权限,请填写已在服务器上创建好的数据库名",
345
+ maxlength: 64
346
+ }, null, 8, [
347
+ "value",
348
+ "onUpdate:value",
349
+ "disabled"
350
+ ])]),
351
+ _: 2
352
+ }, 1032, ["name"])) : s("", !0)]),
353
+ _: 2
354
+ }, 1032, ["label"]))), 128))
355
+ ]),
356
+ _: 1
357
+ }, 8, ["model"]),
358
+ F.value && W.value > 0 ? (h(), c("div", T, [l("div", E, [t[4] ||= l("span", { class: "task-progress-label" }, "执行中任务:", -1), l("span", null, b(W.value) + " 个服务正在创建账套", 1)]), (h(!0), c(i, null, v(R.value, (e) => (h(), c("div", {
359
+ key: e.key,
360
+ class: "task-progress-item"
361
+ }, [
362
+ l("span", D, b(e.server_name) + ":", 1),
363
+ l("span", null, b(Q(e.task?.status)) + " / " + b(Z(e.task?.stage)), 1),
364
+ e.task?.current_sync_model ? (h(), c("span", O, " ,同步:" + b(e.task.current_sync_model), 1)) : s("", !0)
365
+ ]))), 128))])) : s("", !0)
366
+ ]),
367
+ _: 1
368
+ }, 8, ["spinning", "tip"])]),
369
+ _: 1
370
+ }, 8, [
371
+ "title",
372
+ "keyboard",
373
+ "confirmLoading",
374
+ "okButtonProps"
375
+ ]);
376
+ };
377
+ }
378
+ }), [["__scopeId", "data-v-5a99a556"]]);
379
+ //#endregion
380
+ export { k as default };