@gis_victory/curd-form 0.0.4 → 0.0.6

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,10 +1,10 @@
1
- import { defineComponent as j, ref as T, watch as H, resolveComponent as k, openBlock as d, createBlock as C, unref as _, withCtx as h, createElementBlock as P, Fragment as R, renderList as K, onMounted as ne, toDisplayString as re, createElementVNode as Y, normalizeClass as te, createCommentVNode as N, reactive as J, onUnmounted as Pe, createVNode as b, renderSlot as q, createTextVNode as B, nextTick as se, normalizeStyle as Le, createSlots as Te } from "vue";
2
- import { dayjs as oe, ElMessage as E, ElMessageBox as ue } from "element-plus";
3
- import { GisMapView as Me, GisMapSwitch as Oe } from "@gis_victory/gismap";
4
- const xe = {
1
+ import { defineComponent as Y, ref as V, computed as ue, watch as q, openBlock as p, createBlock as C, unref as u, withCtx as h, createElementBlock as S, Fragment as B, renderList as J, onMounted as ne, toDisplayString as re, createElementVNode as G, normalizeClass as ee, createCommentVNode as E, reactive as j, onUnmounted as Ee, createVNode as b, renderSlot as K, createTextVNode as U, nextTick as de, normalizeStyle as Ie, createSlots as xe } from "vue";
2
+ import { ElSelect as ce, ElOption as pe, ElDatePicker as me, ElCheckboxGroup as ve, ElCheckbox as se, ElRadioGroup as $e, ElRadio as Ne, ElInput as te, dayjs as ae, ElButton as I, ElIcon as we, Download as Ae, ElDialog as be, ElForm as oe, ElFormItem as Z, ElMessage as z, ElPopover as We, Menu as Ue, ElTable as Be, ElTableColumn as Q, ElPagination as Re, ElRow as le, ElCol as X, ElMessageBox as fe } from "element-plus";
3
+ import { GisMapView as Ge, GisMapSwitch as Ye } from "@gis_victory/gismap";
4
+ const je = {
5
5
  name: "FormItem"
6
- }, ce = /* @__PURE__ */ j({
7
- ...xe,
6
+ }, he = /* @__PURE__ */ Y({
7
+ ...je,
8
8
  props: {
9
9
  modelValue: {
10
10
  type: [String, Number, Array],
@@ -24,12 +24,12 @@ const xe = {
24
24
  }
25
25
  },
26
26
  emits: ["update:modelValue"],
27
- setup(r, { emit: t }) {
28
- const e = r;
29
- let o = e.modelValue;
30
- const l = e.item.type === "multiple-select" || e.item.type === "checkbox" || e.item.searchFormType === "multiple-select" || e.item.searchFormType === "checkbox";
31
- l && typeof o == "string" && o && (o = o.split(","));
32
- const a = T(o), g = t, p = computed(() => {
27
+ setup(l, { emit: t }) {
28
+ const e = l;
29
+ let a = e.modelValue;
30
+ const n = e.item.type === "multiple-select" || e.item.type === "checkbox" || e.item.searchFormType === "multiple-select" || e.item.searchFormType === "checkbox";
31
+ n && typeof a == "string" && a && (a = a.split(","));
32
+ const i = V(a), g = t, m = ue(() => {
33
33
  switch (e.currentOperationType) {
34
34
  case "default":
35
35
  return !1;
@@ -41,7 +41,7 @@ const xe = {
41
41
  return e.item.updateFormStatus == "disabled";
42
42
  }
43
43
  return !1;
44
- }), n = computed(() => {
44
+ }), o = ue(() => {
45
45
  switch (e.currentOperationType) {
46
46
  case "default":
47
47
  return !1;
@@ -54,132 +54,129 @@ const xe = {
54
54
  }
55
55
  return !1;
56
56
  });
57
- return H(a, (u) => {
58
- let i = u;
59
- l && Array.isArray(u) && (i = u.join(",")), g("update:modelValue", i);
60
- }), H(() => e.modelValue, (u) => {
61
- let i = u;
62
- l && typeof u == "string" && u && (i = u.split(",")), a.value = i;
63
- }), (u, i) => {
64
- const s = k("el-option"), c = k("el-select"), V = k("el-date-picker"), F = k("el-checkbox"), M = k("el-checkbox-group"), I = k("el-radio"), S = k("el-radio-group"), O = k("el-input");
65
- return r.item.searchFormType === "select" || r.item.type === "select" ? (d(), C(c, {
66
- key: 0,
67
- modelValue: a.value,
68
- "onUpdate:modelValue": i[0] || (i[0] = (f) => a.value = f),
69
- placeholder: r.item.placeholder || "请选择",
70
- disabled: _(p),
71
- readonly: _(n),
72
- clearable: ""
73
- }, {
74
- default: h(() => [
75
- (d(!0), P(R, null, K(r.dropdownOptions, (f) => (d(), C(s, {
76
- key: f.id,
77
- label: f.name,
78
- value: f.id
79
- }, null, 8, ["label", "value"]))), 128))
80
- ]),
81
- _: 1
82
- }, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : r.item.searchFormType === "multiple-select" || r.item.type === "multiple-select" ? (d(), C(c, {
83
- key: 1,
84
- modelValue: a.value,
85
- "onUpdate:modelValue": i[1] || (i[1] = (f) => a.value = f),
86
- placeholder: r.item.placeholder || "请选择",
87
- multiple: "",
88
- disabled: _(p),
89
- readonly: _(n),
90
- clearable: ""
91
- }, {
92
- default: h(() => [
93
- (d(!0), P(R, null, K(r.dropdownOptions, (f) => (d(), C(s, {
94
- key: f.id,
95
- label: f.name,
96
- value: f.id
97
- }, null, 8, ["label", "value"]))), 128))
98
- ]),
99
- _: 1
100
- }, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : r.item.searchFormType === "date" || r.item.type === "date" ? (d(), C(V, {
101
- key: 2,
102
- modelValue: a.value,
103
- "onUpdate:modelValue": i[2] || (i[2] = (f) => a.value = f),
104
- type: "date",
105
- "value-format": "YYYY-MM-DD",
106
- placeholder: r.item.placeholder || "请选择日期",
107
- disabled: _(p),
108
- readonly: _(n),
109
- clearable: "",
110
- style: { width: "100%" }
111
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : r.item.searchFormType === "daterange" || r.item.type === "daterange" ? (d(), C(V, {
112
- key: 3,
113
- modelValue: a.value,
114
- "onUpdate:modelValue": i[3] || (i[3] = (f) => a.value = f),
115
- type: "daterange",
116
- "value-format": "yyyy-MM-dd",
117
- placeholder: r.item.placeholder || "请选择日期范围",
118
- disabled: _(p),
119
- readonly: _(n),
120
- clearable: ""
121
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : r.item.searchFormType === "checkbox" || r.item.type === "checkbox" ? (d(), C(M, {
122
- key: 4,
123
- modelValue: a.value,
124
- "onUpdate:modelValue": i[4] || (i[4] = (f) => a.value = f),
125
- disabled: _(p),
126
- readonly: _(n)
127
- }, {
128
- default: h(() => [
129
- (d(!0), P(R, null, K(r.dropdownOptions, (f) => (d(), C(F, {
130
- key: f.id,
131
- label: f.name,
132
- value: f.id
133
- }, null, 8, ["label", "value"]))), 128))
134
- ]),
135
- _: 1
136
- }, 8, ["modelValue", "disabled", "readonly"])) : r.item.searchFormType === "radio" || r.item.type === "radio" ? (d(), C(S, {
137
- key: 5,
138
- modelValue: a.value,
139
- "onUpdate:modelValue": i[5] || (i[5] = (f) => a.value = f),
140
- disabled: _(p),
141
- readonly: _(n)
142
- }, {
143
- default: h(() => [
144
- (d(!0), P(R, null, K(r.dropdownOptions, (f) => (d(), C(I, {
145
- key: f.id,
146
- label: f.name,
147
- value: f.id
148
- }, null, 8, ["label", "value"]))), 128))
149
- ]),
150
- _: 1
151
- }, 8, ["modelValue", "disabled", "readonly"])) : r.item.searchFormType === "textarea" || r.item.type === "textarea" ? (d(), C(O, {
152
- key: 6,
153
- modelValue: a.value,
154
- "onUpdate:modelValue": i[6] || (i[6] = (f) => a.value = f),
155
- type: "textarea",
156
- placeholder: r.item.placeholder || "请输入",
157
- disabled: _(p),
158
- readonly: _(n),
159
- clearable: ""
160
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : r.item.searchFormType === "input" || r.item.type === "input" ? (d(), C(O, {
161
- key: 7,
162
- modelValue: a.value,
163
- "onUpdate:modelValue": i[7] || (i[7] = (f) => a.value = f),
164
- placeholder: r.item.placeholder || "请输入",
165
- disabled: _(p),
166
- readonly: _(n),
167
- clearable: ""
168
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : (d(), C(O, {
169
- key: 8,
170
- modelValue: a.value,
171
- "onUpdate:modelValue": i[8] || (i[8] = (f) => a.value = f),
172
- placeholder: r.item.placeholder || "请输入",
173
- disabled: _(p),
174
- readonly: _(n),
175
- clearable: ""
176
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"]));
177
- };
57
+ return q(i, (d) => {
58
+ let c = d;
59
+ n && Array.isArray(d) && (c = d.join(",")), g("update:modelValue", c);
60
+ }), q(() => e.modelValue, (d) => {
61
+ let c = d;
62
+ n && typeof d == "string" && d && (c = d.split(",")), i.value = c;
63
+ }), (d, c) => l.item.searchFormType === "select" || l.item.type === "select" ? (p(), C(u(ce), {
64
+ key: 0,
65
+ modelValue: i.value,
66
+ "onUpdate:modelValue": c[0] || (c[0] = (r) => i.value = r),
67
+ placeholder: l.item.placeholder || "请选择",
68
+ disabled: m.value,
69
+ readonly: o.value,
70
+ clearable: ""
71
+ }, {
72
+ default: h(() => [
73
+ (p(!0), S(B, null, J(l.dropdownOptions, (r) => (p(), C(u(pe), {
74
+ key: r.id,
75
+ label: r.name,
76
+ value: r.id
77
+ }, null, 8, ["label", "value"]))), 128))
78
+ ]),
79
+ _: 1
80
+ }, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : l.item.searchFormType === "multiple-select" || l.item.type === "multiple-select" ? (p(), C(u(ce), {
81
+ key: 1,
82
+ modelValue: i.value,
83
+ "onUpdate:modelValue": c[1] || (c[1] = (r) => i.value = r),
84
+ placeholder: l.item.placeholder || "请选择",
85
+ multiple: "",
86
+ disabled: m.value,
87
+ readonly: o.value,
88
+ clearable: ""
89
+ }, {
90
+ default: h(() => [
91
+ (p(!0), S(B, null, J(l.dropdownOptions, (r) => (p(), C(u(pe), {
92
+ key: r.id,
93
+ label: r.name,
94
+ value: r.id
95
+ }, null, 8, ["label", "value"]))), 128))
96
+ ]),
97
+ _: 1
98
+ }, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : l.item.searchFormType === "date" || l.item.type === "date" ? (p(), C(u(me), {
99
+ key: 2,
100
+ modelValue: i.value,
101
+ "onUpdate:modelValue": c[2] || (c[2] = (r) => i.value = r),
102
+ type: "date",
103
+ "value-format": "YYYY-MM-DD",
104
+ placeholder: l.item.placeholder || "请选择日期",
105
+ disabled: m.value,
106
+ readonly: o.value,
107
+ clearable: "",
108
+ style: { width: "100%" }
109
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : l.item.searchFormType === "daterange" || l.item.type === "daterange" ? (p(), C(u(me), {
110
+ key: 3,
111
+ modelValue: i.value,
112
+ "onUpdate:modelValue": c[3] || (c[3] = (r) => i.value = r),
113
+ type: "daterange",
114
+ "value-format": "yyyy-MM-dd",
115
+ placeholder: l.item.placeholder || "请选择日期范围",
116
+ disabled: m.value,
117
+ readonly: o.value,
118
+ clearable: ""
119
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : l.item.searchFormType === "checkbox" || l.item.type === "checkbox" ? (p(), C(u(ve), {
120
+ key: 4,
121
+ modelValue: i.value,
122
+ "onUpdate:modelValue": c[4] || (c[4] = (r) => i.value = r),
123
+ disabled: m.value,
124
+ readonly: o.value
125
+ }, {
126
+ default: h(() => [
127
+ (p(!0), S(B, null, J(l.dropdownOptions, (r) => (p(), C(u(se), {
128
+ key: r.id,
129
+ label: r.name,
130
+ value: r.id
131
+ }, null, 8, ["label", "value"]))), 128))
132
+ ]),
133
+ _: 1
134
+ }, 8, ["modelValue", "disabled", "readonly"])) : l.item.searchFormType === "radio" || l.item.type === "radio" ? (p(), C(u($e), {
135
+ key: 5,
136
+ modelValue: i.value,
137
+ "onUpdate:modelValue": c[5] || (c[5] = (r) => i.value = r),
138
+ disabled: m.value,
139
+ readonly: o.value
140
+ }, {
141
+ default: h(() => [
142
+ (p(!0), S(B, null, J(l.dropdownOptions, (r) => (p(), C(u(Ne), {
143
+ key: r.id,
144
+ label: r.name,
145
+ value: r.id
146
+ }, null, 8, ["label", "value"]))), 128))
147
+ ]),
148
+ _: 1
149
+ }, 8, ["modelValue", "disabled", "readonly"])) : l.item.searchFormType === "textarea" || l.item.type === "textarea" ? (p(), C(u(te), {
150
+ key: 6,
151
+ modelValue: i.value,
152
+ "onUpdate:modelValue": c[6] || (c[6] = (r) => i.value = r),
153
+ type: "textarea",
154
+ placeholder: l.item.placeholder || "请输入",
155
+ disabled: m.value,
156
+ readonly: o.value,
157
+ clearable: ""
158
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : l.item.searchFormType === "input" || l.item.type === "input" ? (p(), C(u(te), {
159
+ key: 7,
160
+ modelValue: i.value,
161
+ "onUpdate:modelValue": c[7] || (c[7] = (r) => i.value = r),
162
+ placeholder: l.item.placeholder || "请输入",
163
+ disabled: m.value,
164
+ readonly: o.value,
165
+ clearable: ""
166
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : (p(), C(u(te), {
167
+ key: 8,
168
+ modelValue: i.value,
169
+ "onUpdate:modelValue": c[8] || (c[8] = (r) => i.value = r),
170
+ placeholder: l.item.placeholder || "请输入",
171
+ disabled: m.value,
172
+ readonly: o.value,
173
+ clearable: ""
174
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly"]));
178
175
  }
179
- }), ze = {
176
+ }), Je = {
180
177
  name: "FormItemDetail"
181
- }, Ie = /* @__PURE__ */ j({
182
- ...ze,
178
+ }, Ke = /* @__PURE__ */ Y({
179
+ ...Je,
183
180
  props: {
184
181
  modelValue: {
185
182
  type: [String, Number, Array, Object],
@@ -194,311 +191,311 @@ const xe = {
194
191
  default: () => []
195
192
  }
196
193
  },
197
- setup(r) {
198
- const t = r;
194
+ setup(l) {
195
+ const t = l;
199
196
  let e = t.modelValue;
200
- const o = t.item.type === "multiple-select" || t.item.type === "checkbox" || t.item.searchFormType === "multiple-select" || t.item.searchFormType === "checkbox";
201
- typeof e == "object" && e !== null && !Array.isArray(e) && (e = Object.values(e).join(",")), o && typeof e == "string" && e && (e = e.split(","));
202
- const l = T(e);
197
+ const a = t.item.type === "multiple-select" || t.item.type === "checkbox" || t.item.searchFormType === "multiple-select" || t.item.searchFormType === "checkbox";
198
+ typeof e == "object" && e !== null && !Array.isArray(e) && (e = Object.values(e).join(",")), a && typeof e == "string" && e && (e = e.split(","));
199
+ const n = V(e);
203
200
  return ne(() => {
204
201
  switch (t.item.type) {
205
202
  case "select":
206
203
  case "radio":
207
- const a = t.dropdownOptions.find((n) => n.id === t.modelValue);
208
- l.value = a?.name || "";
204
+ const i = t.dropdownOptions.find((o) => o.id === t.modelValue);
205
+ n.value = i?.name || "";
209
206
  break;
210
207
  case "checkbox":
211
208
  case "multiple-select":
212
- const p = (Array.isArray(l.value) ? l.value : l.value?.split(",") || []).map((n) => t.dropdownOptions.find((i) => i.id === n)?.name || n).filter(Boolean);
213
- l.value = p.join(",") || "";
209
+ const m = (Array.isArray(n.value) ? n.value : n.value?.split(",") || []).map((o) => t.dropdownOptions.find((c) => c.id === o)?.name || o).filter(Boolean);
210
+ n.value = m.join(",") || "";
214
211
  break;
215
212
  case "date":
216
- l.value = t.modelValue ? oe(t.modelValue).format(t.item.formatter || "YYYY-MM-DD") : "";
213
+ n.value = t.modelValue ? ae(t.modelValue).format(t.item.formatter || "YYYY-MM-DD") : "";
217
214
  break;
218
215
  case "datetime":
219
- l.value = t.modelValue ? oe(t.modelValue).format(t.item.formatter || "YYYY-MM-DD HH:mm:ss") : "";
216
+ n.value = t.modelValue ? ae(t.modelValue).format(t.item.formatter || "YYYY-MM-DD HH:mm:ss") : "";
220
217
  break;
221
218
  default:
222
- l.value = t.modelValue;
219
+ n.value = t.modelValue;
223
220
  break;
224
221
  }
225
- }), (a, g) => (d(), P("span", null, re(l.value), 1));
222
+ }), (i, g) => (p(), S("span", null, re(n.value), 1));
226
223
  }
227
224
  });
228
- var Z = { exports: {} }, de;
229
- function $e() {
230
- if (de) return Z.exports;
231
- de = 1, Z.exports = e, Z.exports.parse = e, Z.exports.stringify = o;
232
- var r = /[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/, t = new RegExp("^" + r.source + "(\\s" + r.source + "){1,}");
233
- function e(l) {
234
- var a = l.split(";"), g = a.pop(), p = (a.shift() || "").split("=").pop(), n = 0;
235
- function u(v) {
236
- var D = g.substring(n).match(v);
237
- return D ? (n += D[0].length, D[0]) : null;
225
+ var H = { exports: {} }, ye;
226
+ function qe() {
227
+ if (ye) return H.exports;
228
+ ye = 1, H.exports = e, H.exports.parse = e, H.exports.stringify = a;
229
+ var l = /[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/, t = new RegExp("^" + l.source + "(\\s" + l.source + "){1,}");
230
+ function e(n) {
231
+ var i = n.split(";"), g = i.pop(), m = (i.shift() || "").split("=").pop(), o = 0;
232
+ function d(v) {
233
+ var k = g.substring(o).match(v);
234
+ return k ? (o += k[0].length, k[0]) : null;
238
235
  }
239
- function i(v) {
240
- return v && p.match(/\d+/) && (v.crs = {
236
+ function c(v) {
237
+ return v && m.match(/\d+/) && (v.crs = {
241
238
  type: "name",
242
239
  properties: {
243
- name: "urn:ogc:def:crs:EPSG::" + p
240
+ name: "urn:ogc:def:crs:EPSG::" + m
244
241
  }
245
242
  }), v;
246
243
  }
247
- function s() {
248
- u(/^\s*/);
244
+ function r() {
245
+ d(/^\s*/);
249
246
  }
250
- function c() {
251
- s();
252
- for (var v = 0, D = [], x = [D], U = D, A; A = u(/^(\()/) || u(/^(\))/) || u(/^(,)/) || u(t); ) {
253
- if (A === "(")
254
- x.push(U), U = [], x[x.length - 1].push(U), v++;
255
- else if (A === ")") {
256
- if (U.length === 0 || (U = x.pop(), !U)) return null;
247
+ function f() {
248
+ r();
249
+ for (var v = 0, k = [], T = [k], W = k, x; x = d(/^(\()/) || d(/^(\))/) || d(/^(,)/) || d(t); ) {
250
+ if (x === "(")
251
+ T.push(W), W = [], T[T.length - 1].push(W), v++;
252
+ else if (x === ")") {
253
+ if (W.length === 0 || (W = T.pop(), !W)) return null;
257
254
  if (v--, v === 0) break;
258
- } else if (A === ",")
259
- U = [], x[x.length - 1].push(U);
260
- else if (!A.split(/\s/g).some(isNaN))
261
- Array.prototype.push.apply(U, A.split(/\s/g).map(parseFloat));
255
+ } else if (x === ",")
256
+ W = [], T[T.length - 1].push(W);
257
+ else if (!x.split(/\s/g).some(isNaN))
258
+ Array.prototype.push.apply(W, x.split(/\s/g).map(parseFloat));
262
259
  else
263
260
  return null;
264
- s();
261
+ r();
265
262
  }
266
- return v !== 0 ? null : D;
263
+ return v !== 0 ? null : k;
267
264
  }
268
- function V() {
269
- for (var v = [], D, x; x = u(t) || u(/^(,)/); )
270
- x === "," ? (v.push(D), D = []) : x.split(/\s/g).some(isNaN) || (D || (D = []), Array.prototype.push.apply(D, x.split(/\s/g).map(parseFloat))), s();
271
- if (D) v.push(D);
265
+ function D() {
266
+ for (var v = [], k, T; T = d(t) || d(/^(,)/); )
267
+ T === "," ? (v.push(k), k = []) : T.split(/\s/g).some(isNaN) || (k || (k = []), Array.prototype.push.apply(k, T.split(/\s/g).map(parseFloat))), r();
268
+ if (k) v.push(k);
272
269
  else return null;
273
270
  return v.length ? v : null;
274
271
  }
275
- function F() {
276
- if (!u(/^(point(\sz)?)/i) || (s(), !u(/^(\()/))) return null;
277
- var v = V();
278
- return !v || (s(), !u(/^(\))/)) ? null : {
272
+ function L() {
273
+ if (!d(/^(point(\sz)?)/i) || (r(), !d(/^(\()/))) return null;
274
+ var v = D();
275
+ return !v || (r(), !d(/^(\))/)) ? null : {
279
276
  type: "Point",
280
277
  coordinates: v[0]
281
278
  };
282
279
  }
283
- function M() {
284
- if (!u(/^(multipoint)/i)) return null;
285
- s();
280
+ function $() {
281
+ if (!d(/^(multipoint)/i)) return null;
282
+ r();
286
283
  var v = g.substring(g.indexOf("(") + 1, g.length - 1).replace(/\(/g, "").replace(/\)/g, "");
287
284
  g = "MULTIPOINT (" + v + ")";
288
- var D = c();
289
- return D ? (s(), {
285
+ var k = f();
286
+ return k ? (r(), {
290
287
  type: "MultiPoint",
291
- coordinates: D
288
+ coordinates: k
292
289
  }) : null;
293
290
  }
294
- function I() {
295
- if (!u(/^(multilinestring)/i)) return null;
296
- s();
297
- var v = c();
298
- return v ? (s(), {
291
+ function R() {
292
+ if (!d(/^(multilinestring)/i)) return null;
293
+ r();
294
+ var v = f();
295
+ return v ? (r(), {
299
296
  type: "MultiLineString",
300
297
  coordinates: v
301
298
  }) : null;
302
299
  }
303
- function S() {
304
- if (!u(/^(linestring(\sz)?)/i) || (s(), !u(/^(\()/))) return null;
305
- var v = V();
306
- return !v || !u(/^(\))/) ? null : {
300
+ function O() {
301
+ if (!d(/^(linestring(\sz)?)/i) || (r(), !d(/^(\()/))) return null;
302
+ var v = D();
303
+ return !v || !d(/^(\))/) ? null : {
307
304
  type: "LineString",
308
305
  coordinates: v
309
306
  };
310
307
  }
311
- function O() {
312
- if (!u(/^(polygon(\sz)?)/i)) return null;
313
- s();
314
- var v = c();
308
+ function N() {
309
+ if (!d(/^(polygon(\sz)?)/i)) return null;
310
+ r();
311
+ var v = f();
315
312
  return v ? {
316
313
  type: "Polygon",
317
314
  coordinates: v
318
315
  } : null;
319
316
  }
320
- function f() {
321
- if (!u(/^(multipolygon)/i)) return null;
322
- s();
323
- var v = c();
317
+ function P() {
318
+ if (!d(/^(multipolygon)/i)) return null;
319
+ r();
320
+ var v = f();
324
321
  return v ? {
325
322
  type: "MultiPolygon",
326
323
  coordinates: v
327
324
  } : null;
328
325
  }
329
- function L() {
330
- var v = [], D;
331
- if (!u(/^(geometrycollection)/i) || (s(), !u(/^(\()/))) return null;
332
- for (; D = W(); )
333
- v.push(D), s(), u(/^(,)/), s();
334
- return u(/^(\))/) ? {
326
+ function F() {
327
+ var v = [], k;
328
+ if (!d(/^(geometrycollection)/i) || (r(), !d(/^(\()/))) return null;
329
+ for (; k = A(); )
330
+ v.push(k), r(), d(/^(,)/), r();
331
+ return d(/^(\))/) ? {
335
332
  type: "GeometryCollection",
336
333
  geometries: v
337
334
  } : null;
338
335
  }
339
- function W() {
340
- return F() || S() || O() || M() || I() || f() || L();
336
+ function A() {
337
+ return L() || O() || N() || $() || R() || P() || F();
341
338
  }
342
- return i(W());
339
+ return c(A());
343
340
  }
344
- function o(l) {
345
- l.type === "Feature" && (l = l.geometry);
346
- function a(i) {
347
- return i.join(" ");
341
+ function a(n) {
342
+ n.type === "Feature" && (n = n.geometry);
343
+ function i(c) {
344
+ return c.join(" ");
348
345
  }
349
- function g(i) {
350
- return i.map(a).join(", ");
346
+ function g(c) {
347
+ return c.map(i).join(", ");
351
348
  }
352
- function p(i) {
353
- return i.map(g).map(u).join(", ");
349
+ function m(c) {
350
+ return c.map(g).map(d).join(", ");
354
351
  }
355
- function n(i) {
356
- return i.map(p).map(u).join(", ");
352
+ function o(c) {
353
+ return c.map(m).map(d).join(", ");
357
354
  }
358
- function u(i) {
359
- return "(" + i + ")";
355
+ function d(c) {
356
+ return "(" + c + ")";
360
357
  }
361
- switch (l.type) {
358
+ switch (n.type) {
362
359
  case "Point":
363
- return "POINT (" + a(l.coordinates) + ")";
360
+ return "POINT (" + i(n.coordinates) + ")";
364
361
  case "LineString":
365
- return "LINESTRING (" + g(l.coordinates) + ")";
362
+ return "LINESTRING (" + g(n.coordinates) + ")";
366
363
  case "Polygon":
367
- return "POLYGON (" + p(l.coordinates) + ")";
364
+ return "POLYGON (" + m(n.coordinates) + ")";
368
365
  case "MultiPoint":
369
- return "MULTIPOINT (" + g(l.coordinates) + ")";
366
+ return "MULTIPOINT (" + g(n.coordinates) + ")";
370
367
  case "MultiPolygon":
371
- return "MULTIPOLYGON (" + n(l.coordinates) + ")";
368
+ return "MULTIPOLYGON (" + o(n.coordinates) + ")";
372
369
  case "MultiLineString":
373
- return "MULTILINESTRING (" + p(l.coordinates) + ")";
370
+ return "MULTILINESTRING (" + m(n.coordinates) + ")";
374
371
  case "GeometryCollection":
375
- return "GEOMETRYCOLLECTION (" + l.geometries.map(o).join(", ") + ")";
372
+ return "GEOMETRYCOLLECTION (" + n.geometries.map(a).join(", ") + ")";
376
373
  default:
377
374
  throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input");
378
375
  }
379
376
  }
380
- return Z.exports;
377
+ return H.exports;
381
378
  }
382
- var le = $e();
383
- function Ee(r, t, e = {}) {
384
- const o = { type: "Feature" };
385
- return (e.id === 0 || e.id) && (o.id = e.id), e.bbox && (o.bbox = e.bbox), o.properties = t || {}, o.geometry = r, o;
379
+ var ie = qe();
380
+ function He(l, t, e = {}) {
381
+ const a = { type: "Feature" };
382
+ return (e.id === 0 || e.id) && (a.id = e.id), e.bbox && (a.bbox = e.bbox), a.properties = t || {}, a.geometry = l, a;
386
383
  }
387
- function Ne(r, t, e = {}) {
388
- if (!r)
384
+ function Ze(l, t, e = {}) {
385
+ if (!l)
389
386
  throw new Error("coordinates is required");
390
- if (!Array.isArray(r))
387
+ if (!Array.isArray(l))
391
388
  throw new Error("coordinates must be an Array");
392
- if (r.length < 2)
389
+ if (l.length < 2)
393
390
  throw new Error("coordinates must be at least 2 numbers long");
394
- if (!pe(r[0]) || !pe(r[1]))
391
+ if (!ge(l[0]) || !ge(l[1]))
395
392
  throw new Error("coordinates must contain numbers");
396
- return Ee({
393
+ return He({
397
394
  type: "Point",
398
- coordinates: r
395
+ coordinates: l
399
396
  }, t, e);
400
397
  }
401
- function pe(r) {
402
- return !isNaN(r) && r !== null && !Array.isArray(r);
398
+ function ge(l) {
399
+ return !isNaN(l) && l !== null && !Array.isArray(l);
403
400
  }
404
- function me(r, t, e) {
405
- if (r !== null)
406
- for (var o, l, a, g, p, n, u, i = 0, s = 0, c, V = r.type, F = V === "FeatureCollection", M = V === "Feature", I = F ? r.features.length : 1, S = 0; S < I; S++) {
407
- u = F ? (
401
+ function Ce(l, t, e) {
402
+ if (l !== null)
403
+ for (var a, n, i, g, m, o, d, c = 0, r = 0, f, D = l.type, L = D === "FeatureCollection", $ = D === "Feature", R = L ? l.features.length : 1, O = 0; O < R; O++) {
404
+ d = L ? (
408
405
  // @ts-expect-error: Known type conflict
409
- r.features[S].geometry
410
- ) : M ? (
406
+ l.features[O].geometry
407
+ ) : $ ? (
411
408
  // @ts-expect-error: Known type conflict
412
- r.geometry
413
- ) : r, c = u ? u.type === "GeometryCollection" : !1, p = c ? u.geometries.length : 1;
414
- for (var O = 0; O < p; O++) {
415
- var f = 0, L = 0;
416
- if (g = c ? u.geometries[O] : u, g !== null) {
417
- n = g.coordinates;
418
- var W = g.type;
419
- switch (i = W === "Polygon" || W === "MultiPolygon" ? 1 : 0, W) {
409
+ l.geometry
410
+ ) : l, f = d ? d.type === "GeometryCollection" : !1, m = f ? d.geometries.length : 1;
411
+ for (var N = 0; N < m; N++) {
412
+ var P = 0, F = 0;
413
+ if (g = f ? d.geometries[N] : d, g !== null) {
414
+ o = g.coordinates;
415
+ var A = g.type;
416
+ switch (c = A === "Polygon" || A === "MultiPolygon" ? 1 : 0, A) {
420
417
  case null:
421
418
  break;
422
419
  case "Point":
423
420
  if (
424
421
  // @ts-expect-error: Known type conflict
425
422
  t(
426
- n,
427
- s,
428
- S,
429
- f,
430
- L
423
+ o,
424
+ r,
425
+ O,
426
+ P,
427
+ F
431
428
  ) === !1
432
429
  )
433
430
  return !1;
434
- s++, f++;
431
+ r++, P++;
435
432
  break;
436
433
  case "LineString":
437
434
  case "MultiPoint":
438
- for (o = 0; o < n.length; o++) {
435
+ for (a = 0; a < o.length; a++) {
439
436
  if (
440
437
  // @ts-expect-error: Known type conflict
441
438
  t(
442
- n[o],
443
- s,
444
- S,
445
- f,
446
- L
439
+ o[a],
440
+ r,
441
+ O,
442
+ P,
443
+ F
447
444
  ) === !1
448
445
  )
449
446
  return !1;
450
- s++, W === "MultiPoint" && f++;
447
+ r++, A === "MultiPoint" && P++;
451
448
  }
452
- W === "LineString" && f++;
449
+ A === "LineString" && P++;
453
450
  break;
454
451
  case "Polygon":
455
452
  case "MultiLineString":
456
- for (o = 0; o < n.length; o++) {
457
- for (l = 0; l < n[o].length - i; l++) {
453
+ for (a = 0; a < o.length; a++) {
454
+ for (n = 0; n < o[a].length - c; n++) {
458
455
  if (
459
456
  // @ts-expect-error: Known type conflict
460
457
  t(
461
- n[o][l],
462
- s,
463
- S,
464
- f,
465
- L
458
+ o[a][n],
459
+ r,
460
+ O,
461
+ P,
462
+ F
466
463
  ) === !1
467
464
  )
468
465
  return !1;
469
- s++;
466
+ r++;
470
467
  }
471
- W === "MultiLineString" && f++, W === "Polygon" && L++;
468
+ A === "MultiLineString" && P++, A === "Polygon" && F++;
472
469
  }
473
- W === "Polygon" && f++;
470
+ A === "Polygon" && P++;
474
471
  break;
475
472
  case "MultiPolygon":
476
- for (o = 0; o < n.length; o++) {
477
- for (L = 0, l = 0; l < n[o].length; l++) {
478
- for (a = 0; a < n[o][l].length - i; a++) {
473
+ for (a = 0; a < o.length; a++) {
474
+ for (F = 0, n = 0; n < o[a].length; n++) {
475
+ for (i = 0; i < o[a][n].length - c; i++) {
479
476
  if (
480
477
  // @ts-expect-error: Known type conflict
481
478
  t(
482
- n[o][l][a],
483
- s,
484
- S,
485
- f,
486
- L
479
+ o[a][n][i],
480
+ r,
481
+ O,
482
+ P,
483
+ F
487
484
  ) === !1
488
485
  )
489
486
  return !1;
490
- s++;
487
+ r++;
491
488
  }
492
- L++;
489
+ F++;
493
490
  }
494
- f++;
491
+ P++;
495
492
  }
496
493
  break;
497
494
  case "GeometryCollection":
498
- for (o = 0; o < g.geometries.length; o++)
495
+ for (a = 0; a < g.geometries.length; a++)
499
496
  if (
500
497
  // @ts-expect-error: Known type conflict
501
- me(g.geometries[o], t) === !1
498
+ Ce(g.geometries[a], t) === !1
502
499
  )
503
500
  return !1;
504
501
  break;
@@ -509,16 +506,16 @@ function me(r, t, e) {
509
506
  }
510
507
  }
511
508
  }
512
- function Ae(r, t = {}) {
513
- let e = 0, o = 0, l = 0;
514
- return me(
515
- r,
516
- function(a) {
517
- e += a[0], o += a[1], l++;
509
+ function _e(l, t = {}) {
510
+ let e = 0, a = 0, n = 0;
511
+ return Ce(
512
+ l,
513
+ function(i) {
514
+ e += i[0], a += i[1], n++;
518
515
  }
519
- ), Ne([e / l, o / l], t.properties);
516
+ ), Ze([e / n, a / n], t.properties);
520
517
  }
521
- class We {
518
+ class Qe {
522
519
  map;
523
520
  sourceId = "curd-map-source";
524
521
  layerId = "curd-map-layer";
@@ -588,8 +585,8 @@ class We {
588
585
  const e = {
589
586
  type: "Feature",
590
587
  geometry: t
591
- }, o = this.map.getSource(this.sourceId);
592
- o && (this.featureCollection.features = [e], o?.setData(this.featureCollection));
588
+ }, a = this.map.getSource(this.sourceId);
589
+ a && (this.featureCollection.features = [e], a?.setData(this.featureCollection));
593
590
  }
594
591
  flyTo() {
595
592
  if (this.featureCollection.features.length !== 0)
@@ -598,7 +595,7 @@ class We {
598
595
  if (!t)
599
596
  return;
600
597
  let e = null;
601
- if (t.geometry.type.toLowerCase() === "point" ? e = t.geometry.coordinates : e = Ae(this.featureCollection)?.geometry?.coordinates || null, !e)
598
+ if (t.geometry.type.toLowerCase() === "point" ? e = t.geometry.coordinates : e = _e(this.featureCollection)?.geometry?.coordinates || null, !e)
602
599
  return;
603
600
  this.map.flyTo({
604
601
  center: e,
@@ -612,7 +609,7 @@ class We {
612
609
  if (!t)
613
610
  return null;
614
611
  try {
615
- return le.parse(t);
612
+ return ie.parse(t);
616
613
  } catch (e) {
617
614
  return console.error("WKT 转换为 GeoJSON 失败:", e), null;
618
615
  }
@@ -621,7 +618,7 @@ class We {
621
618
  if (!t)
622
619
  return "";
623
620
  try {
624
- return le.stringify(t);
621
+ return ie.stringify(t);
625
622
  } catch (e) {
626
623
  return console.error("GeoJSON 转换为 WKT 失败:", e), "";
627
624
  }
@@ -630,7 +627,7 @@ class We {
630
627
  this.map.removeLayer(this.layerId), this.map.removeSource(this.sourceId);
631
628
  }
632
629
  }
633
- class Ue {
630
+ class Xe {
634
631
  map;
635
632
  drawSourceId = "curd-map-draw-source";
636
633
  drawLayerId = "curd-map-draw-layer";
@@ -743,8 +740,8 @@ class Ue {
743
740
  handleMapMouseMove(t) {
744
741
  if (this.drawType === "none" || this.drawCoordinates.length === 0)
745
742
  return;
746
- const e = t.lngLat.toArray(), o = [...this.drawCoordinates, e];
747
- this.updateDrawFeature(o);
743
+ const e = t.lngLat.toArray(), a = [...this.drawCoordinates, e];
744
+ this.updateDrawFeature(a);
748
745
  }
749
746
  // 处理地图双击事件
750
747
  handleMapDoubleClick() {
@@ -755,34 +752,34 @@ class Ue {
755
752
  const e = t || this.drawCoordinates;
756
753
  if (e.length === 0)
757
754
  return;
758
- let o = null;
755
+ let a = null;
759
756
  switch (this.drawType) {
760
757
  case "point":
761
- o = {
758
+ a = {
762
759
  type: "Point",
763
760
  coordinates: e[0]
764
761
  };
765
762
  break;
766
763
  case "line":
767
- o = {
764
+ a = {
768
765
  type: "LineString",
769
766
  coordinates: e
770
767
  };
771
768
  break;
772
769
  case "polygon":
773
- o = {
770
+ a = {
774
771
  type: "Polygon",
775
772
  coordinates: [e]
776
773
  };
777
774
  break;
778
775
  }
779
- if (o) {
776
+ if (a) {
780
777
  this.drawFeatureCollection.features = [{
781
778
  type: "Feature",
782
- geometry: o
779
+ geometry: a
783
780
  }];
784
- const l = this.map.getSource(this.drawSourceId);
785
- l && l.setData(this.drawFeatureCollection);
781
+ const n = this.map.getSource(this.drawSourceId);
782
+ n && n.setData(this.drawFeatureCollection);
786
783
  }
787
784
  }
788
785
  // 完成绘制
@@ -819,7 +816,7 @@ class Ue {
819
816
  break;
820
817
  }
821
818
  if (t && this.drawCallback) {
822
- const e = le.stringify(t);
819
+ const e = ie.stringify(t);
823
820
  this.drawCallback(this.drawType, t, e), this.map.getCanvas().style.cursor = "", this.drawType = "none", this.map.off("click", this.handleMapClick.bind(this)), this.map.off("mousemove", this.handleMapMouseMove.bind(this)), this.map.off("dblclick", this.handleMapDoubleClick.bind(this)), setTimeout(() => {
824
821
  this.map.doubleClickZoom.enable();
825
822
  }, 0);
@@ -830,57 +827,57 @@ class Ue {
830
827
  this.stopDraw(), this.map.getSource(this.drawSourceId) && this.map.removeSource(this.drawSourceId);
831
828
  }
832
829
  }
833
- var Be = /* @__PURE__ */ j({
830
+ var et = /* @__PURE__ */ Y({
834
831
  name: "CircleClose",
835
832
  __name: "circle-close",
836
- setup(r) {
837
- return (t, e) => (d(), P("svg", {
833
+ setup(l) {
834
+ return (t, e) => (p(), S("svg", {
838
835
  xmlns: "http://www.w3.org/2000/svg",
839
836
  viewBox: "0 0 1024 1024"
840
837
  }, [
841
- Y("path", {
838
+ G("path", {
842
839
  fill: "currentColor",
843
840
  d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"
844
841
  }),
845
- Y("path", {
842
+ G("path", {
846
843
  fill: "currentColor",
847
844
  d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
848
845
  })
849
846
  ]));
850
847
  }
851
- }), Re = Be, Ge = /* @__PURE__ */ j({
848
+ }), tt = et, at = /* @__PURE__ */ Y({
852
849
  name: "EditPen",
853
850
  __name: "edit-pen",
854
- setup(r) {
855
- return (t, e) => (d(), P("svg", {
851
+ setup(l) {
852
+ return (t, e) => (p(), S("svg", {
856
853
  xmlns: "http://www.w3.org/2000/svg",
857
854
  viewBox: "0 0 1024 1024"
858
855
  }, [
859
- Y("path", {
856
+ G("path", {
860
857
  fill: "currentColor",
861
858
  d: "m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"
862
859
  })
863
860
  ]));
864
861
  }
865
- }), Ye = Ge, je = /* @__PURE__ */ j({
862
+ }), rt = at, lt = /* @__PURE__ */ Y({
866
863
  name: "MoreFilled",
867
864
  __name: "more-filled",
868
- setup(r) {
869
- return (t, e) => (d(), P("svg", {
865
+ setup(l) {
866
+ return (t, e) => (p(), S("svg", {
870
867
  xmlns: "http://www.w3.org/2000/svg",
871
868
  viewBox: "0 0 1024 1024"
872
869
  }, [
873
- Y("path", {
870
+ G("path", {
874
871
  fill: "currentColor",
875
872
  d: "M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"
876
873
  })
877
874
  ]));
878
875
  }
879
- }), Je = je;
880
- const Ke = { class: "map-draw-container" }, qe = {
876
+ }), ot = lt;
877
+ const it = { class: "map-draw-container" }, nt = {
881
878
  name: "FormItemMapDraw"
882
- }, He = /* @__PURE__ */ j({
883
- ...qe,
879
+ }, st = /* @__PURE__ */ Y({
880
+ ...nt,
884
881
  props: {
885
882
  geomType: {
886
883
  type: String,
@@ -888,54 +885,51 @@ const Ke = { class: "map-draw-container" }, qe = {
888
885
  }
889
886
  },
890
887
  emits: ["draw-start", "draw-end", "draw-cancel"],
891
- setup(r, { emit: t }) {
892
- const e = t, o = T("none");
893
- T(!1), T(null);
894
- const l = Re, a = Ye, g = Je, p = (n) => {
895
- o.value = n, n === "none" ? e("draw-cancel") : e("draw-start", n);
896
- };
897
- return (n, u) => {
898
- const i = k("el-button");
899
- return d(), P("div", Ke, [
900
- r.geomType === "point" ? (d(), C(i, {
901
- key: 0,
902
- type: "primary",
903
- size: "small",
904
- circle: "",
905
- onClick: u[0] || (u[0] = (s) => p("point")),
906
- icon: _(l),
907
- class: te({ active: o.value === "point" })
908
- }, null, 8, ["icon", "class"])) : N("", !0),
909
- r.geomType === "linestring" ? (d(), C(i, {
910
- key: 1,
911
- type: "primary",
912
- size: "small",
913
- circle: "",
914
- onClick: u[1] || (u[1] = (s) => p("line")),
915
- icon: _(a),
916
- class: te({ active: o.value === "line" })
917
- }, null, 8, ["icon", "class"])) : N("", !0),
918
- r.geomType === "polygon" ? (d(), C(i, {
919
- key: 2,
920
- type: "primary",
921
- size: "small",
922
- circle: "",
923
- onClick: u[2] || (u[2] = (s) => p("polygon")),
924
- icon: _(g),
925
- class: te({ active: o.value === "polygon" })
926
- }, null, 8, ["icon", "class"])) : N("", !0)
927
- ]);
888
+ setup(l, { emit: t }) {
889
+ const e = t, a = V("none");
890
+ V(!1), V(null);
891
+ const n = tt, i = rt, g = ot, m = (o) => {
892
+ a.value = o, o === "none" ? e("draw-cancel") : e("draw-start", o);
928
893
  };
894
+ return (o, d) => (p(), S("div", it, [
895
+ l.geomType === "point" ? (p(), C(u(I), {
896
+ key: 0,
897
+ type: "primary",
898
+ size: "small",
899
+ circle: "",
900
+ onClick: d[0] || (d[0] = (c) => m("point")),
901
+ icon: u(n),
902
+ class: ee({ active: a.value === "point" })
903
+ }, null, 8, ["icon", "class"])) : E("", !0),
904
+ l.geomType === "linestring" ? (p(), C(u(I), {
905
+ key: 1,
906
+ type: "primary",
907
+ size: "small",
908
+ circle: "",
909
+ onClick: d[1] || (d[1] = (c) => m("line")),
910
+ icon: u(i),
911
+ class: ee({ active: a.value === "line" })
912
+ }, null, 8, ["icon", "class"])) : E("", !0),
913
+ l.geomType === "polygon" ? (p(), C(u(I), {
914
+ key: 2,
915
+ type: "primary",
916
+ size: "small",
917
+ circle: "",
918
+ onClick: d[2] || (d[2] = (c) => m("polygon")),
919
+ icon: u(g),
920
+ class: ee({ active: a.value === "polygon" })
921
+ }, null, 8, ["icon", "class"])) : E("", !0)
922
+ ]));
929
923
  }
930
- }), Q = (r, t) => {
931
- const e = r.__vccOpts || r;
932
- for (const [o, l] of t)
933
- e[o] = l;
924
+ }), _ = (l, t) => {
925
+ const e = l.__vccOpts || l;
926
+ for (const [a, n] of t)
927
+ e[a] = n;
934
928
  return e;
935
- }, Ze = /* @__PURE__ */ Q(He, [["__scopeId", "data-v-fa667d3f"]]), Qe = { class: "curd-map" }, Xe = {
929
+ }, ut = /* @__PURE__ */ _(st, [["__scopeId", "data-v-c4ff065e"]]), dt = { class: "curd-map" }, ct = {
936
930
  name: "FormItemMap"
937
- }, et = /* @__PURE__ */ j({
938
- ...Xe,
931
+ }, pt = /* @__PURE__ */ Y({
932
+ ...ct,
939
933
  props: {
940
934
  modelValue: {
941
935
  type: String || void 0,
@@ -955,10 +949,10 @@ const Ke = { class: "map-draw-container" }, qe = {
955
949
  }
956
950
  },
957
951
  emits: ["update:modelValue"],
958
- setup(r, { emit: t }) {
959
- const e = r, o = T(e.modelValue);
960
- let l, a;
961
- const g = J({
952
+ setup(l, { emit: t }) {
953
+ const e = l, a = V(e.modelValue);
954
+ let n, i;
955
+ const g = j({
962
956
  mapViewData: {
963
957
  zoom: e.mapViewData.zoom || 13,
964
958
  center: e.mapViewData.center || [120.656774, 29.8],
@@ -989,53 +983,53 @@ const Ke = { class: "map-draw-container" }, qe = {
989
983
  }
990
984
  ]
991
985
  }
992
- }), p = t;
993
- H(o, (s) => {
994
- p("update:modelValue", s);
995
- }), H(() => e.modelValue, (s) => {
996
- o.value = s;
986
+ }), m = t;
987
+ q(a, (r) => {
988
+ m("update:modelValue", r);
989
+ }), q(() => e.modelValue, (r) => {
990
+ a.value = r;
997
991
  });
998
- const n = (s) => {
999
- l = new We(s), a = new Ue(s);
1000
- const c = l.formatWktToGeoJson(o.value);
1001
- c && (l.setLayer(c.type), l.setData(c), l.flyTo());
1002
- }, u = (s) => {
1003
- a && a.startDraw(s, (c, V, F) => {
1004
- o.value = F;
992
+ const o = (r) => {
993
+ n = new Qe(r), i = new Xe(r);
994
+ const f = n.formatWktToGeoJson(a.value);
995
+ f && (n.setLayer(f.type), n.setData(f), n.flyTo());
996
+ }, d = (r) => {
997
+ i && i.startDraw(r, (f, D, L) => {
998
+ a.value = L;
1005
999
  });
1006
- }, i = () => {
1007
- a && a.stopDraw();
1000
+ }, c = () => {
1001
+ i && i.stopDraw();
1008
1002
  };
1009
- return Pe(() => {
1010
- a && (a.destroy(), a = void 0);
1011
- }), (s, c) => (d(), P("div", Qe, [
1012
- b(_(Me), {
1003
+ return Ee(() => {
1004
+ i && (i.destroy(), i = void 0);
1005
+ }), (r, f) => (p(), S("div", dt, [
1006
+ b(u(Ge), {
1013
1007
  options: g.mapViewData,
1014
- onLoad: n
1008
+ onLoad: o
1015
1009
  }, {
1016
1010
  "top-left": h(() => [
1017
- r.currentOperationType !== "details" ? (d(), C(Ze, {
1011
+ l.currentOperationType !== "details" ? (p(), C(ut, {
1018
1012
  key: 0,
1019
- onDrawStart: u,
1020
- onDrawCancel: i
1021
- })) : N("", !0)
1013
+ onDrawStart: d,
1014
+ onDrawCancel: c
1015
+ })) : E("", !0)
1022
1016
  ]),
1023
1017
  "bottom-right": h(() => [
1024
- b(_(Oe), {
1018
+ b(u(Ye), {
1025
1019
  data: g.switchData
1026
1020
  }, null, 8, ["data"])
1027
1021
  ]),
1028
1022
  default: h(() => [
1029
- q(s.$slots, "default", {}, void 0, !0)
1023
+ K(r.$slots, "default", {}, void 0, !0)
1030
1024
  ]),
1031
1025
  _: 3
1032
1026
  }, 8, ["options"])
1033
1027
  ]));
1034
1028
  }
1035
- }), tt = /* @__PURE__ */ Q(et, [["__scopeId", "data-v-e1f42b56"]]), ot = { class: "field-select-container" }, rt = {
1029
+ }), mt = /* @__PURE__ */ _(pt, [["__scopeId", "data-v-e1f42b56"]]), ft = { class: "field-select-container" }, ht = {
1036
1030
  name: "ExportButton"
1037
- }, at = /* @__PURE__ */ j({
1038
- ...rt,
1031
+ }, yt = /* @__PURE__ */ Y({
1032
+ ...ht,
1039
1033
  props: {
1040
1034
  columns: {
1041
1035
  type: Array,
@@ -1046,144 +1040,141 @@ const Ke = { class: "map-draw-container" }, qe = {
1046
1040
  default: () => []
1047
1041
  }
1048
1042
  },
1049
- setup(r) {
1050
- const t = r, e = T(!1), o = J({
1043
+ setup(l) {
1044
+ const t = l, e = V(!1), a = j({
1051
1045
  filename: "",
1052
1046
  dataType: "current",
1053
1047
  // current: 当前页数据, selected: 选择中数据
1054
1048
  selectedFields: []
1055
1049
  });
1056
1050
  ne(() => {
1057
- o.selectedFields = t.columns.map((g) => g.columnProperty);
1051
+ a.selectedFields = t.columns.map((g) => g.columnProperty);
1058
1052
  });
1059
- const l = () => {
1053
+ const n = () => {
1060
1054
  let g = [...t.data];
1061
1055
  if (g.length === 0) {
1062
- E.warning("没有数据可导出");
1056
+ z.warning("没有数据可导出");
1063
1057
  return;
1064
1058
  }
1065
- const p = g.map((V) => {
1066
- const F = {};
1067
- return o.selectedFields.forEach((M) => {
1068
- F[M] = V[M];
1069
- }), F;
1070
- }), n = o.filename || `导出数据_${(/* @__PURE__ */ new Date()).getTime()}`, u = a(p), i = new Blob([u], { type: "text/csv;charset=utf-8;" }), s = document.createElement("a"), c = URL.createObjectURL(i);
1071
- s.setAttribute("href", c), s.setAttribute("download", `${n}.csv`), s.style.visibility = "hidden", document.body.appendChild(s), s.click(), document.body.removeChild(s), e.value = !1, E.success("导出成功");
1072
- }, a = (g) => {
1059
+ const m = g.map((D) => {
1060
+ const L = {};
1061
+ return a.selectedFields.forEach(($) => {
1062
+ L[$] = D[$];
1063
+ }), L;
1064
+ }), o = a.filename || `导出数据_${(/* @__PURE__ */ new Date()).getTime()}`, d = i(m), c = new Blob([d], { type: "text/csv;charset=utf-8;" }), r = document.createElement("a"), f = URL.createObjectURL(c);
1065
+ r.setAttribute("href", f), r.setAttribute("download", `${o}.csv`), r.style.visibility = "hidden", document.body.appendChild(r), r.click(), document.body.removeChild(r), e.value = !1, z.success("导出成功");
1066
+ }, i = (g) => {
1073
1067
  if (g.length === 0) return "";
1074
- const p = Object.keys(g[0]) || [], n = [];
1075
- n.push(p.join(","));
1076
- for (const u of g) {
1077
- const i = p.map((s) => {
1078
- const c = u[s];
1079
- return typeof c == "string" ? `"${c.replace(/"/g, '""')}"` : c;
1068
+ const m = Object.keys(g[0]) || [], o = [];
1069
+ o.push(m.join(","));
1070
+ for (const d of g) {
1071
+ const c = m.map((r) => {
1072
+ const f = d[r];
1073
+ return typeof f == "string" ? `"${f.replace(/"/g, '""')}"` : f;
1080
1074
  });
1081
- n.push(i.join(","));
1075
+ o.push(c.join(","));
1082
1076
  }
1083
- return n.join(`
1077
+ return o.join(`
1084
1078
  `);
1085
1079
  };
1086
- return (g, p) => {
1087
- const n = k("el-icon-download"), u = k("el-icon"), i = k("el-button"), s = k("el-input"), c = k("el-form-item"), V = k("el-checkbox"), F = k("el-checkbox-group"), M = k("el-form"), I = k("el-dialog");
1088
- return d(), P("div", null, [
1089
- b(i, {
1090
- type: "default",
1091
- round: "",
1092
- onClick: p[0] || (p[0] = (S) => e.value = !0)
1093
- }, {
1094
- default: h(() => [
1095
- b(u, null, {
1096
- default: h(() => [
1097
- b(n)
1098
- ]),
1099
- _: 1
1100
- })
1101
- ]),
1102
- _: 1
1103
- }),
1104
- b(I, {
1105
- modelValue: e.value,
1106
- "onUpdate:modelValue": p[4] || (p[4] = (S) => e.value = S),
1107
- title: "导出数据",
1108
- width: "400px",
1109
- "close-on-click-modal": !1
1110
- }, {
1111
- footer: h(() => [
1112
- b(i, {
1113
- onClick: p[3] || (p[3] = (S) => e.value = !1)
1114
- }, {
1115
- default: h(() => [...p[5] || (p[5] = [
1116
- B("取消", -1)
1117
- ])]),
1118
- _: 1
1119
- }),
1120
- b(i, {
1121
- type: "primary",
1122
- onClick: l
1123
- }, {
1124
- default: h(() => [...p[6] || (p[6] = [
1125
- B("导出", -1)
1126
- ])]),
1127
- _: 1
1128
- })
1129
- ]),
1130
- default: h(() => [
1131
- b(M, {
1132
- model: o,
1133
- "label-width": "100px"
1134
- }, {
1135
- default: h(() => [
1136
- b(c, { label: "文件名称" }, {
1137
- default: h(() => [
1138
- b(s, {
1139
- modelValue: o.filename,
1140
- "onUpdate:modelValue": p[1] || (p[1] = (S) => o.filename = S),
1141
- placeholder: "请输入文件名称"
1142
- }, null, 8, ["modelValue"])
1143
- ]),
1144
- _: 1
1145
- }),
1146
- b(c, { label: "选择字段" }, {
1147
- default: h(() => [
1148
- Y("div", ot, [
1149
- b(F, {
1150
- modelValue: o.selectedFields,
1151
- "onUpdate:modelValue": p[2] || (p[2] = (S) => o.selectedFields = S)
1152
- }, {
1153
- default: h(() => [
1154
- (d(!0), P(R, null, K(r.columns, (S) => (d(), P("div", {
1155
- key: S.columnProperty,
1156
- class: "column-item"
1157
- }, [
1158
- b(V, {
1159
- value: S.columnProperty
1160
- }, {
1161
- default: h(() => [
1162
- B(re(S.columnLabel), 1)
1163
- ]),
1164
- _: 2
1165
- }, 1032, ["value"])
1166
- ]))), 128))
1167
- ]),
1168
- _: 1
1169
- }, 8, ["modelValue"])
1170
- ])
1171
- ]),
1172
- _: 1
1173
- })
1174
- ]),
1175
- _: 1
1176
- }, 8, ["model"])
1177
- ]),
1178
- _: 1
1179
- }, 8, ["modelValue"])
1180
- ]);
1181
- };
1080
+ return (g, m) => (p(), S("div", null, [
1081
+ b(u(I), {
1082
+ type: "default",
1083
+ round: "",
1084
+ onClick: m[0] || (m[0] = (o) => e.value = !0)
1085
+ }, {
1086
+ default: h(() => [
1087
+ b(u(we), null, {
1088
+ default: h(() => [
1089
+ b(u(Ae))
1090
+ ]),
1091
+ _: 1
1092
+ })
1093
+ ]),
1094
+ _: 1
1095
+ }),
1096
+ b(u(be), {
1097
+ modelValue: e.value,
1098
+ "onUpdate:modelValue": m[4] || (m[4] = (o) => e.value = o),
1099
+ title: "导出数据",
1100
+ width: "400px",
1101
+ "close-on-click-modal": !1
1102
+ }, {
1103
+ footer: h(() => [
1104
+ b(u(I), {
1105
+ onClick: m[3] || (m[3] = (o) => e.value = !1)
1106
+ }, {
1107
+ default: h(() => [...m[5] || (m[5] = [
1108
+ U("取消", -1)
1109
+ ])]),
1110
+ _: 1
1111
+ }),
1112
+ b(u(I), {
1113
+ type: "primary",
1114
+ onClick: n
1115
+ }, {
1116
+ default: h(() => [...m[6] || (m[6] = [
1117
+ U("导出", -1)
1118
+ ])]),
1119
+ _: 1
1120
+ })
1121
+ ]),
1122
+ default: h(() => [
1123
+ b(u(oe), {
1124
+ model: a,
1125
+ "label-width": "100px"
1126
+ }, {
1127
+ default: h(() => [
1128
+ b(u(Z), { label: "文件名称" }, {
1129
+ default: h(() => [
1130
+ b(u(te), {
1131
+ modelValue: a.filename,
1132
+ "onUpdate:modelValue": m[1] || (m[1] = (o) => a.filename = o),
1133
+ placeholder: "请输入文件名称"
1134
+ }, null, 8, ["modelValue"])
1135
+ ]),
1136
+ _: 1
1137
+ }),
1138
+ b(u(Z), { label: "选择字段" }, {
1139
+ default: h(() => [
1140
+ G("div", ft, [
1141
+ b(u(ve), {
1142
+ modelValue: a.selectedFields,
1143
+ "onUpdate:modelValue": m[2] || (m[2] = (o) => a.selectedFields = o)
1144
+ }, {
1145
+ default: h(() => [
1146
+ (p(!0), S(B, null, J(l.columns, (o) => (p(), S("div", {
1147
+ key: o.columnProperty,
1148
+ class: "column-item"
1149
+ }, [
1150
+ b(u(se), {
1151
+ value: o.columnProperty
1152
+ }, {
1153
+ default: h(() => [
1154
+ U(re(o.columnLabel), 1)
1155
+ ]),
1156
+ _: 2
1157
+ }, 1032, ["value"])
1158
+ ]))), 128))
1159
+ ]),
1160
+ _: 1
1161
+ }, 8, ["modelValue"])
1162
+ ])
1163
+ ]),
1164
+ _: 1
1165
+ })
1166
+ ]),
1167
+ _: 1
1168
+ }, 8, ["model"])
1169
+ ]),
1170
+ _: 1
1171
+ }, 8, ["modelValue"])
1172
+ ]));
1182
1173
  }
1183
- }), lt = /* @__PURE__ */ Q(at, [["__scopeId", "data-v-a28ea63e"]]), nt = { class: "column-manager" }, it = {
1174
+ }), gt = /* @__PURE__ */ _(yt, [["__scopeId", "data-v-aa567411"]]), vt = { class: "column-manager" }, wt = {
1184
1175
  name: "ColumnManager"
1185
- }, st = /* @__PURE__ */ j({
1186
- ...it,
1176
+ }, bt = /* @__PURE__ */ Y({
1177
+ ...wt,
1187
1178
  props: {
1188
1179
  tableColumns: {
1189
1180
  type: Array,
@@ -1197,68 +1188,65 @@ const Ke = { class: "map-draw-container" }, qe = {
1197
1188
  }
1198
1189
  },
1199
1190
  emits: ["update:visibleColumns", "update:columns"],
1200
- setup(r, { emit: t }) {
1201
- const e = r, o = t, l = T(!1), a = T([...e.visibleColumns]), g = (p, n) => {
1202
- n ? a.value.push(p) : a.value = a.value.filter((u) => u !== p), o("update:visibleColumns", a.value);
1191
+ setup(l, { emit: t }) {
1192
+ const e = l, a = t, n = V(!1), i = V([...e.visibleColumns]), g = (m, o) => {
1193
+ o ? i.value.push(m) : i.value = i.value.filter((d) => d !== m), a("update:visibleColumns", i.value);
1203
1194
  };
1204
- return H(
1195
+ return q(
1205
1196
  () => e.visibleColumns,
1206
- (p) => {
1207
- a.value = [...p];
1197
+ (m) => {
1198
+ i.value = [...m];
1208
1199
  },
1209
1200
  { deep: !0 }
1210
- ), (p, n) => {
1211
- const u = k("el-icon-menu"), i = k("el-icon"), s = k("el-button"), c = k("el-checkbox"), V = k("el-popover");
1212
- return d(), P("div", null, [
1213
- b(V, {
1214
- visible: l.value,
1215
- "onUpdate:visible": n[0] || (n[0] = (F) => l.value = F),
1216
- placement: "bottom-end",
1217
- width: 220,
1218
- trigger: "click",
1219
- "popper-class": "column-manager-popover"
1220
- }, {
1221
- reference: h(() => [
1222
- b(s, {
1223
- type: "default",
1224
- round: ""
1225
- }, {
1226
- default: h(() => [
1227
- b(i, null, {
1228
- default: h(() => [
1229
- b(u)
1230
- ]),
1231
- _: 1
1232
- })
1233
- ]),
1234
- _: 1
1235
- })
1236
- ]),
1237
- default: h(() => [
1238
- Y("div", nt, [
1239
- (d(!0), P(R, null, K(r.tableColumns, (F) => (d(), P("div", {
1240
- class: "column-item",
1241
- key: F.columnProperty
1242
- }, [
1243
- b(c, {
1244
- modelValue: a.value.includes(F.columnProperty),
1245
- onChange: (M) => g(F.columnProperty, M)
1246
- }, {
1247
- default: h(() => [
1248
- B(re(F.columnLabel || F.columnProperty), 1)
1249
- ]),
1250
- _: 2
1251
- }, 1032, ["modelValue", "onChange"])
1252
- ]))), 128))
1253
- ])
1254
- ]),
1255
- _: 1
1256
- }, 8, ["visible"])
1257
- ]);
1258
- };
1201
+ ), (m, o) => (p(), S("div", null, [
1202
+ b(u(We), {
1203
+ visible: n.value,
1204
+ "onUpdate:visible": o[0] || (o[0] = (d) => n.value = d),
1205
+ placement: "bottom-end",
1206
+ width: 220,
1207
+ trigger: "click",
1208
+ "popper-class": "column-manager-popover"
1209
+ }, {
1210
+ reference: h(() => [
1211
+ b(u(I), {
1212
+ type: "default",
1213
+ round: ""
1214
+ }, {
1215
+ default: h(() => [
1216
+ b(u(we), null, {
1217
+ default: h(() => [
1218
+ b(u(Ue))
1219
+ ]),
1220
+ _: 1
1221
+ })
1222
+ ]),
1223
+ _: 1
1224
+ })
1225
+ ]),
1226
+ default: h(() => [
1227
+ G("div", vt, [
1228
+ (p(!0), S(B, null, J(l.tableColumns, (d) => (p(), S("div", {
1229
+ class: "column-item",
1230
+ key: d.columnProperty
1231
+ }, [
1232
+ b(u(se), {
1233
+ modelValue: i.value.includes(d.columnProperty),
1234
+ onChange: (c) => g(d.columnProperty, c)
1235
+ }, {
1236
+ default: h(() => [
1237
+ U(re(d.columnLabel || d.columnProperty), 1)
1238
+ ]),
1239
+ _: 2
1240
+ }, 1032, ["modelValue", "onChange"])
1241
+ ]))), 128))
1242
+ ])
1243
+ ]),
1244
+ _: 1
1245
+ }, 8, ["visible"])
1246
+ ]));
1259
1247
  }
1260
- }), ut = /* @__PURE__ */ Q(st, [["__scopeId", "data-v-ef5ba627"]]);
1261
- class ct {
1248
+ }), Ct = /* @__PURE__ */ _(bt, [["__scopeId", "data-v-bb3ec273"]]);
1249
+ class kt {
1262
1250
  serverConfig;
1263
1251
  curdConfig = {};
1264
1252
  searchConfig = {};
@@ -1271,19 +1259,19 @@ class ct {
1271
1259
  constructor({ serverConfig: t }) {
1272
1260
  this.serverConfig = t;
1273
1261
  }
1274
- setConfig({ curdConfig: t, searchConfig: e, tableConfig: o, editorConfig: l }) {
1275
- this.curdConfig = t || this.curdConfig, this.searchConfig = e || this.searchConfig, this.tableConfig = o || this.tableConfig, this.editorConfig = l || this.editorConfig;
1262
+ setConfig({ curdConfig: t, searchConfig: e, tableConfig: a, editorConfig: n }) {
1263
+ this.curdConfig = t || this.curdConfig, this.searchConfig = e || this.searchConfig, this.tableConfig = a || this.tableConfig, this.editorConfig = n || this.editorConfig;
1276
1264
  }
1277
1265
  //加载字典数据,确保全部加载完成后返回结果
1278
1266
  async loadDictionary() {
1279
1267
  if (!this.tableConfig?.columns)
1280
1268
  return this.dictionaryMap;
1281
1269
  const t = this.tableConfig.columns.filter((e) => ["code", "table"].includes(e.dictType || "") && e.dictService).map((e) => {
1282
- let o = e.fieldType || "String";
1283
- return o === "integer" && (o = "Integer"), (e.dictType === "code" ? this.serverConfig?.dict({ dictCode: e.dictService, itemIdType: o }) : this.serverConfig?.dictServer(e.dictService, {})).then((a) => {
1284
- a && e.dictService && this.dictionaryMap.set(e.dictService, a || []);
1285
- }).catch((a) => {
1286
- console.error(`加载字典 ${e.dictService} 失败:`, a);
1270
+ let a = e.fieldType || "String";
1271
+ return a === "integer" && (a = "Integer"), (e.dictType === "code" ? this.serverConfig?.dict({ dictCode: e.dictService, itemIdType: a }) : this.serverConfig?.dictServer(e.dictService, {})).then((i) => {
1272
+ i && e.dictService && this.dictionaryMap.set(e.dictService, i || []);
1273
+ }).catch((i) => {
1274
+ console.error(`加载字典 ${e.dictService} 失败:`, i);
1287
1275
  });
1288
1276
  });
1289
1277
  return await Promise.all(t), this.dictionaryMap;
@@ -1296,7 +1284,7 @@ class ct {
1296
1284
  getDictOptionsByColumnProperty(t) {
1297
1285
  if (!t)
1298
1286
  return [];
1299
- const e = this.tableConfig?.columns?.find((o) => o.columnProperty === t)?.dictService;
1287
+ const e = this.tableConfig?.columns?.find((a) => a.columnProperty === t)?.dictService;
1300
1288
  return this.getDictOptionsByCode(e || void 0);
1301
1289
  }
1302
1290
  //格式化
@@ -1304,19 +1292,19 @@ class ct {
1304
1292
  if (!e || e === "")
1305
1293
  return e;
1306
1294
  if (t.dictType && t.dictService) {
1307
- const o = this.dictionaryMap.get(t.dictService) || [];
1308
- if (!o || o.length === 0)
1295
+ const a = this.dictionaryMap.get(t.dictService) || [];
1296
+ if (!a || a.length === 0)
1309
1297
  return e;
1310
- const l = o.find((a) => a.id === e);
1311
- return l ? l.name : e;
1298
+ const n = a.find((i) => i.id === e);
1299
+ return n ? n.name : e;
1312
1300
  }
1313
1301
  if (!t.formatter || t.formatter === "")
1314
1302
  return e;
1315
1303
  switch (t.fieldType) {
1316
1304
  case "date":
1317
- return e ? oe(e).format(t.formatter || "YYYY-MM-DD") : "";
1305
+ return e ? ae(e).format(t.formatter || "YYYY-MM-DD") : "";
1318
1306
  case "datetime":
1319
- return e ? oe(e).format(t.formatter || "YYYY-MM-DD HH:mm:ss") : "";
1307
+ return e ? ae(e).format(t.formatter || "YYYY-MM-DD HH:mm:ss") : "";
1320
1308
  default:
1321
1309
  return e;
1322
1310
  }
@@ -1339,29 +1327,29 @@ class ct {
1339
1327
  }
1340
1328
  formatFormConfigData() {
1341
1329
  const t = {};
1342
- return (this.editorConfig?.columns || []).filter((o) => o.columnProperty === this.curdConfig?.priKey ? !0 : o.type !== "hidden").forEach((o) => {
1343
- t[o.columnProperty] = o.defaultValue;
1330
+ return (this.editorConfig?.columns || []).filter((a) => a.columnProperty === this.curdConfig?.priKey ? !0 : a.type !== "hidden").forEach((a) => {
1331
+ t[a.columnProperty] = a.defaultValue;
1344
1332
  }), this.cloneFormData = JSON.stringify(t), t;
1345
1333
  }
1346
1334
  //拼接查询条件
1347
1335
  formatSearchForm(t) {
1348
1336
  const e = {};
1349
- return this.searchFormMap.forEach((o, l) => {
1350
- const a = t[l];
1351
- if (a != null && a !== "") {
1337
+ return this.searchFormMap.forEach((a, n) => {
1338
+ const i = t[n];
1339
+ if (i != null && i !== "") {
1352
1340
  let g = "";
1353
- switch (o.searchable) {
1341
+ switch (a.searchable) {
1354
1342
  case "=":
1355
- g = `= '${a}'`;
1343
+ g = `= '${i}'`;
1356
1344
  break;
1357
1345
  case "like":
1358
- g = `like '%${a}%'`;
1346
+ g = `like '%${i}%'`;
1359
1347
  break;
1360
1348
  case "in":
1361
- g = `in (${a})`;
1349
+ g = `in (${i})`;
1362
1350
  break;
1363
1351
  }
1364
- e[l] = g;
1352
+ e[n] = g;
1365
1353
  }
1366
1354
  }), e;
1367
1355
  }
@@ -1370,8 +1358,8 @@ class ct {
1370
1358
  if (!t || Object.keys(t).length === 0)
1371
1359
  return {};
1372
1360
  let e = {};
1373
- return (this.tableConfig?.columns || []).forEach((o) => {
1374
- o?.fieldType === "integer" ? e[o.columnProperty] = Number(t[o.columnProperty]) : e[o.columnProperty] = t[o.columnProperty];
1361
+ return (this.tableConfig?.columns || []).forEach((a) => {
1362
+ a?.fieldType === "integer" ? e[a.columnProperty] = Number(t[a.columnProperty]) : e[a.columnProperty] = t[a.columnProperty];
1375
1363
  }), t.wktstr && (e.wktstr = t.wktstr), e;
1376
1364
  }
1377
1365
  //可见列
@@ -1383,13 +1371,13 @@ class ct {
1383
1371
  let e = [];
1384
1372
  switch (t) {
1385
1373
  case "details":
1386
- e = (this.editorConfig?.columns || []).filter((o) => o.type !== "hidden" && o.updateFormStatus !== "hidden" && o.type !== "shape");
1374
+ e = (this.editorConfig?.columns || []).filter((a) => a.type !== "hidden" && a.updateFormStatus !== "hidden" && a.type !== "shape");
1387
1375
  break;
1388
1376
  case "add":
1389
- e = (this.editorConfig?.columns || []).filter((o) => o.type !== "hidden" && o.createFormStatus !== "hidden" && o.type !== "shape");
1377
+ e = (this.editorConfig?.columns || []).filter((a) => a.type !== "hidden" && a.createFormStatus !== "hidden" && a.type !== "shape");
1390
1378
  break;
1391
1379
  case "update":
1392
- e = (this.editorConfig?.columns || []).filter((o) => o.type !== "hidden" && o.updateFormStatus !== "hidden" && o.type !== "shape");
1380
+ e = (this.editorConfig?.columns || []).filter((a) => a.type !== "hidden" && a.updateFormStatus !== "hidden" && a.type !== "shape");
1393
1381
  break;
1394
1382
  }
1395
1383
  return e;
@@ -1399,16 +1387,16 @@ class ct {
1399
1387
  return (this.editorConfig?.columns || []).find((e) => e.type === "shape") || void 0;
1400
1388
  }
1401
1389
  }
1402
- const dt = { class: "curd-container" }, pt = { class: "curd-search" }, mt = {
1390
+ const St = { class: "curd-container" }, Ft = { class: "curd-search" }, Vt = {
1403
1391
  key: 0,
1404
1392
  class: "table-actions"
1405
- }, ft = { class: "table-actions-left" }, ht = { class: "table-actions-right" }, yt = { class: "curd-table" }, gt = {
1393
+ }, Dt = { class: "table-actions-left" }, Pt = { class: "table-actions-right" }, Lt = { class: "curd-table" }, Tt = {
1406
1394
  key: 1,
1407
1395
  class: "curd-pagination"
1408
- }, vt = {
1396
+ }, Mt = {
1409
1397
  name: "CurdForm"
1410
- }, wt = /* @__PURE__ */ j({
1411
- ...vt,
1398
+ }, Ot = /* @__PURE__ */ Y({
1399
+ ...Mt,
1412
1400
  props: {
1413
1401
  size: {
1414
1402
  type: String,
@@ -1449,8 +1437,8 @@ const dt = { class: "curd-container" }, pt = { class: "curd-search" }, mt = {
1449
1437
  }
1450
1438
  },
1451
1439
  emits: ["loadDataSuccess"],
1452
- setup(r, { expose: t, emit: e }) {
1453
- const o = r, l = T(!1), a = T(null), g = e, p = T(), n = new ct({ serverConfig: o.serverConfig }), u = T(""), i = T("details"), s = J({
1440
+ setup(l, { expose: t, emit: e }) {
1441
+ const a = l, n = V(!1), i = V(null), g = e, m = V(), o = new kt({ serverConfig: a.serverConfig }), d = V(""), c = V("details"), r = j({
1454
1442
  priKey: "id",
1455
1443
  priKeyType: "string",
1456
1444
  sortField: "id",
@@ -1458,7 +1446,7 @@ const dt = { class: "curd-container" }, pt = { class: "curd-search" }, mt = {
1458
1446
  geomType: "point",
1459
1447
  webFunction: [],
1460
1448
  dataExt: "{}"
1461
- }), c = J({
1449
+ }), f = j({
1462
1450
  showIndex: !0,
1463
1451
  indexWidth: 50,
1464
1452
  showCheckbox: !0,
@@ -1473,118 +1461,118 @@ const dt = { class: "curd-container" }, pt = { class: "curd-search" }, mt = {
1473
1461
  pageUISize: "default",
1474
1462
  showExpand: !1,
1475
1463
  columns: []
1476
- }), V = J({
1464
+ }), D = j({
1477
1465
  total: 0,
1478
- pageSize: c.defaultPageSize,
1466
+ pageSize: f.defaultPageSize,
1479
1467
  currentPage: 1
1480
- }), F = J({
1468
+ }), L = j({
1481
1469
  title: "弹框表单",
1482
1470
  formDialogWidth: "800px",
1483
1471
  labelWidth: "120px"
1484
- }), M = J({
1472
+ }), $ = j({
1485
1473
  columns: [],
1486
1474
  formColumns: []
1487
- }), I = J({
1475
+ }), R = j({
1488
1476
  searchLabelWidth: "80",
1489
1477
  searchFormWidth: "290",
1490
1478
  columns: []
1491
- }), S = T({}), O = T(!1), f = T([]), L = J({
1479
+ }), O = V({}), N = V(!1), P = V([]), F = j({
1492
1480
  data: {}
1493
- }), W = T({}), v = T(!1), D = T(!1), x = T(), U = T([]), A = async () => {
1494
- if (o.serverConfig?.list)
1481
+ }), A = V({}), v = V(!1), k = V(!1), T = V(), W = V([]), x = async () => {
1482
+ if (a.serverConfig?.list)
1495
1483
  try {
1496
- l.value = !0;
1497
- const w = await o.serverConfig?.list({
1498
- whereClause: n.formatSearchForm(S.value),
1484
+ n.value = !0;
1485
+ const w = await a.serverConfig?.list({
1486
+ whereClause: o.formatSearchForm(O.value),
1499
1487
  orderParam: [
1500
1488
  {
1501
- fieldName: s.sortField,
1502
- asc: s.sortOrder === 0
1489
+ fieldName: r.sortField,
1490
+ asc: r.sortOrder === 0
1503
1491
  }
1504
1492
  ],
1505
1493
  pageParam: {
1506
- pageNum: V.currentPage,
1507
- pageSize: V.pageSize
1494
+ pageNum: D.currentPage,
1495
+ pageSize: D.pageSize
1508
1496
  }
1509
1497
  });
1510
1498
  if (w) {
1511
1499
  const y = w.data;
1512
- f.value = y.dataList || [], V.total = y.totalCount, g("loadDataSuccess", f.value);
1500
+ P.value = y.dataList || [], D.total = y.totalCount, g("loadDataSuccess", P.value);
1513
1501
  }
1514
1502
  } catch {
1515
1503
  } finally {
1516
- l.value = !1;
1504
+ n.value = !1;
1517
1505
  }
1518
- }, fe = () => {
1519
- S.value = JSON.parse(n.cloneSearchForm), A();
1520
- }, he = async () => {
1521
- o.serverConfig?.add && (i.value = "add", M.formColumns = n.getFormItems("add"), F.title = "新增信息", O.value = !0, L.data = JSON.parse(n.cloneFormData));
1522
- }, ye = async () => {
1523
- if (o.serverConfig?.deleteBatch && a?.value) {
1524
- const w = a.value.getSelectionRows();
1506
+ }, ke = () => {
1507
+ O.value = JSON.parse(o.cloneSearchForm), x();
1508
+ }, Se = async () => {
1509
+ a.serverConfig?.add && (c.value = "add", $.formColumns = o.getFormItems("add"), L.title = "新增信息", N.value = !0, F.data = JSON.parse(o.cloneFormData));
1510
+ }, Fe = async () => {
1511
+ if (a.serverConfig?.deleteBatch && i?.value) {
1512
+ const w = i.value.getSelectionRows();
1525
1513
  if (w.length === 0) {
1526
- E.warning("请选择要删除的项");
1514
+ z.warning("请选择要删除的项");
1527
1515
  return;
1528
1516
  }
1529
- const y = w.map((z) => z[s.priKey || "id"]);
1530
- y.length > 0 && ue.confirm("确定删除选中项吗?", "提示", {
1517
+ const y = w.map((s) => s[r.priKey || "id"]);
1518
+ y.length > 0 && fe.confirm("确定删除选中项吗?", "提示", {
1531
1519
  confirmButtonText: "确定",
1532
1520
  cancelButtonText: "取消",
1533
1521
  type: "warning"
1534
1522
  }).then(async () => {
1535
- await o.serverConfig?.deleteBatch?.(y.join(",")) ? E.success("删除成功") : E.error("删除失败"), A();
1523
+ await a.serverConfig?.deleteBatch?.(y.join(",")) ? z.success("删除成功") : z.error("删除失败"), x();
1536
1524
  });
1537
1525
  }
1538
- }, ge = (w) => {
1539
- V.pageSize = Number(w), A();
1540
- }, ve = (w) => {
1541
- V.currentPage = w, A();
1542
- }, we = async (w) => {
1543
- if (o.serverConfig?.view) {
1544
- i.value = "details", M.formColumns = n.getFormItems("details"), F.title = "查看详情";
1526
+ }, Ve = (w) => {
1527
+ D.pageSize = Number(w), x();
1528
+ }, De = (w) => {
1529
+ D.currentPage = w, x();
1530
+ }, Pe = async (w) => {
1531
+ if (a.serverConfig?.view) {
1532
+ c.value = "details", $.formColumns = o.getFormItems("details"), L.title = "查看详情";
1545
1533
  try {
1546
- const y = w[s.priKey || "id"];
1534
+ const y = w[r.priKey || "id"];
1547
1535
  if (!y) {
1548
- E.error("查看失败,未获取到主键值");
1536
+ z.error("查看失败,未获取到主键值");
1549
1537
  return;
1550
1538
  }
1551
- const z = await o.serverConfig?.view?.({
1539
+ const s = await a.serverConfig?.view?.({
1552
1540
  key: y
1553
1541
  });
1554
- z.success && z.data ? (L.data = { ...z.data }, O.value = !0) : E.error("查询失败");
1542
+ s.success && s.data ? (F.data = { ...s.data }, N.value = !0) : z.error("查询失败");
1555
1543
  } catch {
1556
- E.error("查询失败");
1544
+ z.error("查询失败");
1557
1545
  }
1558
1546
  }
1559
- }, be = async (w) => {
1560
- o.serverConfig?.update && (i.value = "update", M.formColumns = n.getFormItems("update"), F.title = "编辑信息", O.value = !0, L.data = { ...w });
1561
- }, Ce = (w) => {
1562
- o.serverConfig?.delete && ue.confirm("确定删除选中项吗?", "提示", {
1547
+ }, Le = async (w) => {
1548
+ a.serverConfig?.update && (c.value = "update", $.formColumns = o.getFormItems("update"), L.title = "编辑信息", N.value = !0, F.data = { ...w });
1549
+ }, Te = (w) => {
1550
+ a.serverConfig?.delete && fe.confirm("确定删除选中项吗?", "提示", {
1563
1551
  confirmButtonText: "确定",
1564
1552
  cancelButtonText: "取消",
1565
1553
  type: "warning"
1566
1554
  }).then(async () => {
1567
- const y = w[s.priKey || "id"];
1555
+ const y = w[r.priKey || "id"];
1568
1556
  if (!y) {
1569
- E.error("删除失败,未获取到主键值");
1557
+ z.error("删除失败,未获取到主键值");
1570
1558
  return;
1571
1559
  }
1572
- await o.serverConfig?.delete?.(y) ? (E.success("删除成功"), A()) : E.error("删除失败");
1560
+ await a.serverConfig?.delete?.(y) ? (z.success("删除成功"), x()) : z.error("删除失败");
1573
1561
  });
1574
- }, ke = () => {
1575
- v.value = !0, p.value?.validate(async (w, y) => {
1562
+ }, Me = () => {
1563
+ v.value = !0, m.value?.validate(async (w, y) => {
1576
1564
  if (w) {
1577
- let z = i.value === "add" ? o.serverConfig?.add : o.serverConfig?.update;
1578
- if (z)
1565
+ let s = c.value === "add" ? a.serverConfig?.add : a.serverConfig?.update;
1566
+ if (s)
1579
1567
  try {
1580
- const $ = await z({
1568
+ const M = await s({
1581
1569
  params: {
1582
- ...n.formatFormData(L.data)
1570
+ ...o.formatFormData(F.data)
1583
1571
  }
1584
1572
  });
1585
- $.success ? (E.success(i.value === "add" ? "新增成功" : "编辑成功"), O.value = !1, A()) : E.error("保存失败" + $.msg);
1586
- } catch ($) {
1587
- E.error("保存失败" + $.message);
1573
+ M.success ? (z.success(c.value === "add" ? "新增成功" : "编辑成功"), N.value = !1, x()) : z.error("保存失败" + M.msg);
1574
+ } catch (M) {
1575
+ z.error("保存失败" + M.message);
1588
1576
  } finally {
1589
1577
  v.value = !1;
1590
1578
  }
@@ -1593,390 +1581,387 @@ const dt = { class: "curd-container" }, pt = { class: "curd-search" }, mt = {
1593
1581
  });
1594
1582
  };
1595
1583
  ne(async () => {
1596
- if (o.serverConfig?.init) {
1597
- const w = await o.serverConfig.init();
1584
+ if (a.serverConfig?.init) {
1585
+ const w = await a.serverConfig.init();
1598
1586
  if (w.success && w.data) {
1599
- const y = w.data || {}, z = y.dataExt ? JSON.parse(y.dataExt) : {};
1600
- Object.assign(s, y || {}), Object.assign(c, z?.tableConfig || {}), Object.assign(F, z?.dialogConfig || {}), Object.assign(M?.columns || [], z?.editorConfig || {}), V.pageSize = c.defaultPageSize || V.pageSize, c.visibleOperationButtons = (c.operationButtons || []).map(($) => $.type), console.log("curdConfig", s), console.log("tableConfig", c), console.log("dialogConfig", F), console.log("editorConfig", M), I.searchFormWidth = c.searchFormWidth && c.searchFormWidth !== "" ? c.searchFormWidth : I.searchFormWidth, I.searchLabelWidth = c.searchLabelWidth && c.searchLabelWidth !== "" ? c.searchLabelWidth : I.searchLabelWidth, n.setConfig({ curdConfig: s, searchConfig: I, tableConfig: c, editorConfig: M }), U.value = n.initVisibleColumns(), S.value = n.formatSearchConfigForm(), L.data = n.formatFormConfigData(), W.value = n.formatFormRules(), x.value = n.hasGeometryField(), await n.loadDictionary(), setTimeout(() => {
1601
- A();
1602
- }, 500), se(() => {
1603
- u.value = "100%";
1587
+ const y = w.data || {}, s = y.dataExt ? JSON.parse(y.dataExt) : {};
1588
+ Object.assign(r, y || {}), Object.assign(f, s?.tableConfig || {}), Object.assign(L, s?.dialogConfig || {}), Object.assign($?.columns || [], s?.editorConfig || {}), D.pageSize = f.defaultPageSize || D.pageSize, f.visibleOperationButtons = (f.operationButtons || []).map((M) => M.type), console.log("curdConfig", r), console.log("tableConfig", f), console.log("dialogConfig", L), console.log("editorConfig", $), R.searchFormWidth = f.searchFormWidth && f.searchFormWidth !== "" ? f.searchFormWidth : R.searchFormWidth, R.searchLabelWidth = f.searchLabelWidth && f.searchLabelWidth !== "" ? f.searchLabelWidth : R.searchLabelWidth, o.setConfig({ curdConfig: r, searchConfig: R, tableConfig: f, editorConfig: $ }), W.value = o.initVisibleColumns(), O.value = o.formatSearchConfigForm(), F.data = o.formatFormConfigData(), A.value = o.formatFormRules(), T.value = o.hasGeometryField(), await o.loadDictionary(), setTimeout(() => {
1589
+ x();
1590
+ }, 500), de(() => {
1591
+ d.value = "100%";
1604
1592
  });
1605
1593
  } else
1606
- E.error("未查询到有效配置");
1594
+ z.error("未查询到有效配置");
1607
1595
  } else
1608
- E.error("请配置init方法");
1609
- }), H(O, (w) => {
1610
- w ? se(() => {
1611
- D.value = !0;
1612
- }) : D.value = !1;
1596
+ z.error("请配置init方法");
1597
+ }), q(N, (w) => {
1598
+ w ? de(() => {
1599
+ k.value = !0;
1600
+ }) : k.value = !1;
1613
1601
  });
1614
- const Se = (w) => {
1615
- f.value = w;
1616
- }, Fe = (w) => {
1617
- c.columns = w;
1602
+ const Oe = (w) => {
1603
+ P.value = w;
1604
+ }, ze = (w) => {
1605
+ f.columns = w;
1618
1606
  };
1619
1607
  return t({
1620
1608
  // 设置表单数据
1621
- setTableData: Se,
1622
- getTableData: () => f.value
1623
- }), (w, y) => {
1624
- const z = k("el-form-item"), $ = k("el-button"), ie = k("el-form"), X = k("el-table-column"), Ve = k("el-table"), _e = k("el-pagination"), ee = k("el-col"), ae = k("el-row"), De = k("el-dialog");
1625
- return d(), P(R, null, [
1626
- Y("div", dt, [
1627
- Y("div", pt, [
1628
- b(ie, {
1629
- inline: !0,
1630
- class: "form-inline",
1631
- "label-width": I.searchLabelWidth
1632
- }, {
1633
- default: h(() => [
1634
- (d(!0), P(R, null, K(I.columns, (m) => (d(), C(z, {
1635
- key: m.columnProperty,
1636
- label: m.searchFormLabel || m.columnLabel,
1637
- style: Le(`width: ${I.searchFormWidth}px;`)
1638
- }, {
1639
- default: h(() => [
1640
- m.showMethod === "slot" ? q(w.$slots, "search-" + m.columnProperty, {
1641
- key: 0,
1642
- scope: { ...w.scope, searchForm: S.value, data: S.value[m.columnProperty] }
1643
- }, void 0, !0) : (d(), C(ce, {
1644
- key: 1,
1645
- modelValue: S.value[m.columnProperty],
1646
- "onUpdate:modelValue": (G) => S.value[m.columnProperty] = G,
1647
- item: m,
1648
- dropdownOptions: _(n).getDictOptionsByCode(m.dictService)
1649
- }, null, 8, ["modelValue", "onUpdate:modelValue", "item", "dropdownOptions"]))
1650
- ]),
1651
- _: 2
1652
- }, 1032, ["label", "style"]))), 128)),
1653
- b(z, { style: { "margin-left": "10px" } }, {
1654
- default: h(() => [
1655
- b($, {
1656
- type: "primary",
1657
- size: r.size,
1658
- icon: "Search",
1659
- onClick: A
1660
- }, {
1661
- default: h(() => [...y[6] || (y[6] = [
1662
- B("查询", -1)
1663
- ])]),
1664
- _: 1
1665
- }, 8, ["size"]),
1666
- b($, {
1667
- type: "default",
1668
- size: r.size,
1669
- icon: "Refresh",
1670
- onClick: fe
1671
- }, {
1672
- default: h(() => [...y[7] || (y[7] = [
1673
- B("重置", -1)
1674
- ])]),
1675
- _: 1
1676
- }, 8, ["size"])
1677
- ]),
1678
- _: 1
1679
- })
1680
- ]),
1681
- _: 3
1682
- }, 8, ["label-width"])
1683
- ]),
1684
- s.webFunction.length > 0 ? (d(), P("div", mt, [
1685
- Y("div", ft, [
1686
- r.permissions.add && s.webFunction.includes("add") ? (d(), C($, {
1687
- key: 0,
1688
- type: "primary",
1689
- size: r.size,
1690
- icon: "CirclePlus",
1691
- onClick: he
1609
+ setTableData: Oe,
1610
+ getTableData: () => P.value
1611
+ }), (w, y) => (p(), S(B, null, [
1612
+ G("div", St, [
1613
+ G("div", Ft, [
1614
+ b(u(oe), {
1615
+ inline: !0,
1616
+ class: "form-inline",
1617
+ "label-width": R.searchLabelWidth
1618
+ }, {
1619
+ default: h(() => [
1620
+ (p(!0), S(B, null, J(R.columns, (s) => (p(), C(u(Z), {
1621
+ key: s.columnProperty,
1622
+ label: s.searchFormLabel || s.columnLabel,
1623
+ style: Ie(`width: ${R.searchFormWidth}px;`)
1692
1624
  }, {
1693
- default: h(() => [...y[8] || (y[8] = [
1694
- B("新增", -1)
1695
- ])]),
1696
- _: 1
1697
- }, 8, ["size"])) : N("", !0),
1698
- r.permissions.delete && s.webFunction.includes("batchDelete") ? (d(), C($, {
1699
- key: 1,
1700
- type: "danger",
1701
- size: r.size,
1702
- icon: "Delete",
1703
- onClick: ye
1704
- }, {
1705
- default: h(() => [...y[9] || (y[9] = [
1706
- B("批量删除", -1)
1707
- ])]),
1625
+ default: h(() => [
1626
+ s.showMethod === "slot" ? K(w.$slots, "search-" + s.columnProperty, {
1627
+ key: 0,
1628
+ scope: { ...w.scope, searchForm: O.value, data: O.value[s.columnProperty] }
1629
+ }, void 0, !0) : (p(), C(he, {
1630
+ key: 1,
1631
+ modelValue: O.value[s.columnProperty],
1632
+ "onUpdate:modelValue": (M) => O.value[s.columnProperty] = M,
1633
+ item: s,
1634
+ dropdownOptions: u(o).getDictOptionsByCode(s.dictService)
1635
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "item", "dropdownOptions"]))
1636
+ ]),
1637
+ _: 2
1638
+ }, 1032, ["label", "style"]))), 128)),
1639
+ b(u(Z), { style: { "margin-left": "10px" } }, {
1640
+ default: h(() => [
1641
+ b(u(I), {
1642
+ type: "primary",
1643
+ size: l.size,
1644
+ icon: "Search",
1645
+ onClick: x
1646
+ }, {
1647
+ default: h(() => [...y[6] || (y[6] = [
1648
+ U("查询", -1)
1649
+ ])]),
1650
+ _: 1
1651
+ }, 8, ["size"]),
1652
+ b(u(I), {
1653
+ type: "default",
1654
+ size: l.size,
1655
+ icon: "Refresh",
1656
+ onClick: ke
1657
+ }, {
1658
+ default: h(() => [...y[7] || (y[7] = [
1659
+ U("重置", -1)
1660
+ ])]),
1661
+ _: 1
1662
+ }, 8, ["size"])
1663
+ ]),
1708
1664
  _: 1
1709
- }, 8, ["size"])) : N("", !0),
1710
- q(w.$slots, "table-actions", {}, void 0, !0)
1665
+ })
1711
1666
  ]),
1712
- Y("div", ht, [
1713
- q(w.$slots, "table-actions-right", {}, void 0, !0),
1714
- b(lt, {
1715
- columns: c.columns,
1716
- data: f.value
1717
- }, null, 8, ["columns", "data"]),
1718
- b(ut, {
1719
- "table-columns": c.columns,
1720
- "visible-columns": U.value,
1721
- "onUpdate:visibleColumns": y[0] || (y[0] = (m) => U.value = m),
1722
- "onUpdate:columns": Fe
1723
- }, null, 8, ["table-columns", "visible-columns"])
1724
- ])
1725
- ])) : N("", !0),
1726
- Y("div", yt, [
1727
- b(Ve, {
1728
- ref_key: "tableRef",
1729
- ref: a,
1730
- data: f.value,
1731
- border: "",
1732
- stripe: "",
1733
- size: r.size,
1734
- height: u.value,
1735
- "header-cell-style": { background: "#F5F7FA" }
1667
+ _: 3
1668
+ }, 8, ["label-width"])
1669
+ ]),
1670
+ r.webFunction.length > 0 ? (p(), S("div", Vt, [
1671
+ G("div", Dt, [
1672
+ l.permissions.add && r.webFunction.includes("add") ? (p(), C(u(I), {
1673
+ key: 0,
1674
+ type: "primary",
1675
+ size: l.size,
1676
+ icon: "CirclePlus",
1677
+ onClick: Se
1736
1678
  }, {
1737
- default: h(() => [
1738
- c.showIndex ? (d(), C(X, {
1739
- key: 0,
1740
- type: "index",
1741
- width: c.indexWidth,
1742
- label: "#",
1743
- align: "center"
1744
- }, null, 8, ["width"])) : N("", !0),
1745
- r.permissions.delete && s.webFunction.includes("batchDelete") ? (d(), C(X, {
1746
- key: 1,
1747
- type: "selection",
1748
- width: "55",
1749
- align: "center"
1750
- })) : N("", !0),
1751
- (d(!0), P(R, null, K(c.columns, (m) => (d(), P(R, {
1752
- key: m.prop
1753
- }, [
1754
- U.value.includes(m.columnProperty) ? (d(), C(X, {
1755
- key: 0,
1756
- label: m.columnLabel,
1757
- width: (m.width || "") + "px",
1758
- fixed: m.fixed,
1759
- "show-overflow-tooltip": !m.noWrap,
1760
- align: m.align,
1761
- "header-align": m.headerAlign
1762
- }, {
1763
- default: h((G) => [
1764
- w.$slots["table-column-" + m.columnProperty] ? q(w.$slots, "table-column-" + m.columnProperty, {
1765
- key: 0,
1766
- scope: G
1767
- }, void 0, !0) : (d(), P(R, { key: 1 }, [
1768
- B(re(_(n).formatColumnValue(m, G?.row[m.columnProperty])), 1)
1769
- ], 64))
1770
- ]),
1771
- _: 2
1772
- }, 1032, ["label", "width", "fixed", "show-overflow-tooltip", "align", "header-align"])) : N("", !0)
1773
- ], 64))), 128)),
1774
- b(X, {
1775
- align: c.operationAlign,
1776
- fixed: "right",
1777
- width: c.operationWidth,
1778
- label: "操作"
1779
- }, {
1780
- default: h((m) => [
1781
- c.visibleOperationButtons.includes("detail") ? (d(), C($, {
1782
- key: 0,
1783
- type: "primary",
1784
- plain: "",
1785
- size: c.operationSize,
1786
- onClick: (G) => we(m.row)
1787
- }, {
1788
- default: h(() => [...y[10] || (y[10] = [
1789
- B("详情", -1)
1790
- ])]),
1791
- _: 1
1792
- }, 8, ["size", "onClick"])) : N("", !0),
1793
- c.visibleOperationButtons.includes("edit") && r.permissions.edit ? (d(), C($, {
1794
- key: 1,
1795
- type: "success",
1796
- plain: "",
1797
- size: c.operationSize,
1798
- onClick: (G) => be(m.row)
1799
- }, {
1800
- default: h(() => [...y[11] || (y[11] = [
1801
- B("编辑", -1)
1802
- ])]),
1803
- _: 1
1804
- }, 8, ["size", "onClick"])) : N("", !0),
1805
- c.visibleOperationButtons.includes("delete") && r.permissions.delete ? (d(), C($, {
1806
- key: 2,
1807
- type: "danger",
1808
- plain: "",
1809
- size: c.operationSize,
1810
- onClick: (G) => Ce(m.row)
1811
- }, {
1812
- default: h(() => [...y[12] || (y[12] = [
1813
- B("删除", -1)
1814
- ])]),
1815
- _: 1
1816
- }, 8, ["size", "onClick"])) : N("", !0),
1817
- q(w.$slots, "table-column-action", { scope: m }, void 0, !0)
1818
- ]),
1819
- _: 3
1820
- }, 8, ["align", "width"])
1821
- ]),
1822
- _: 3
1823
- }, 8, ["data", "size", "height"])
1679
+ default: h(() => [...y[8] || (y[8] = [
1680
+ U("新增", -1)
1681
+ ])]),
1682
+ _: 1
1683
+ }, 8, ["size"])) : E("", !0),
1684
+ l.permissions.delete && r.webFunction.includes("batchDelete") ? (p(), C(u(I), {
1685
+ key: 1,
1686
+ type: "danger",
1687
+ size: l.size,
1688
+ icon: "Delete",
1689
+ onClick: Fe
1690
+ }, {
1691
+ default: h(() => [...y[9] || (y[9] = [
1692
+ U("批量删除", -1)
1693
+ ])]),
1694
+ _: 1
1695
+ }, 8, ["size"])) : E("", !0),
1696
+ K(w.$slots, "table-actions", {}, void 0, !0)
1824
1697
  ]),
1825
- c.showPagination ? (d(), P("div", gt, [
1826
- b(_e, {
1827
- "current-page": V.currentPage,
1828
- "onUpdate:currentPage": y[1] || (y[1] = (m) => V.currentPage = m),
1829
- "page-size": V.pageSize,
1830
- "onUpdate:pageSize": y[2] || (y[2] = (m) => V.pageSize = m),
1831
- total: V.total,
1832
- layout: "total, sizes, prev, pager, next",
1833
- background: "",
1834
- size: r.size,
1835
- onSizeChange: ge,
1836
- onCurrentChange: ve
1837
- }, null, 8, ["current-page", "page-size", "total", "size"])
1838
- ])) : N("", !0)
1839
- ]),
1840
- b(De, {
1841
- title: F.title,
1842
- "close-on-click-modal": !1,
1843
- "close-on-press-escape": !1,
1844
- width: F.formDialogWidth,
1845
- modelValue: O.value,
1846
- "onUpdate:modelValue": y[5] || (y[5] = (m) => O.value = m),
1847
- "destroy-on-close": !0,
1848
- draggable: "",
1849
- "append-to-body": !0,
1850
- "align-center": ""
1851
- }, Te({
1852
- default: h(() => [
1853
- b(ae, null, {
1854
- default: h(() => [
1855
- b(ee, {
1856
- span: x.value ? 24 - x.value.span : 24
1857
- }, {
1858
- default: h(() => [
1859
- b(ie, {
1860
- ref_key: "formRef",
1861
- ref: p,
1862
- model: L.data,
1863
- rules: W.value,
1864
- size: "default",
1865
- "label-width": F.labelWidth,
1866
- "label-suffix": ":",
1867
- class: te({ "curd-form-details": i.value === "details" })
1868
- }, {
1869
- default: h(() => [
1870
- b(ae, null, {
1871
- default: h(() => [
1872
- b(ee, { span: 24 }, {
1873
- default: h(() => [
1874
- b(ae, null, {
1875
- default: h(() => [
1876
- (d(!0), P(R, null, K(M.formColumns, (m) => (d(), C(ee, {
1877
- key: m.columnProperty,
1878
- span: m.span || 12
1879
- }, {
1880
- default: h(() => [
1881
- b(z, {
1882
- label: m.columnLabel,
1883
- prop: m.columnProperty
1884
- }, {
1885
- default: h(() => [
1886
- i.value === "details" ? (d(), C(Ie, {
1887
- key: 0,
1888
- item: m,
1889
- modelValue: L.data[m.columnProperty],
1890
- "onUpdate:modelValue": (G) => L.data[m.columnProperty] = G,
1891
- dropdownOptions: _(n).getDictOptionsByColumnProperty(m.columnProperty)
1892
- }, null, 8, ["item", "modelValue", "onUpdate:modelValue", "dropdownOptions"])) : (d(), P(R, { key: 1 }, [
1893
- m.showMethod === "slot" ? q(w.$slots, "form-" + m.columnProperty, {
1894
- key: 0,
1895
- item: m,
1896
- scope: { ...w.scope, formData: L.data, data: L.data[m.columnProperty] }
1897
- }, void 0, !0) : (d(), C(ce, {
1898
- key: 1,
1899
- item: m,
1900
- modelValue: L.data[m.columnProperty],
1901
- "onUpdate:modelValue": (G) => L.data[m.columnProperty] = G,
1902
- dropdownOptions: _(n).getDictOptionsByColumnProperty(m.columnProperty),
1903
- currentOperationType: i.value
1904
- }, null, 8, ["item", "modelValue", "onUpdate:modelValue", "dropdownOptions", "currentOperationType"]))
1905
- ], 64))
1906
- ]),
1907
- _: 2
1908
- }, 1032, ["label", "prop"])
1909
- ]),
1910
- _: 2
1911
- }, 1032, ["span"]))), 128))
1912
- ]),
1913
- _: 3
1914
- })
1915
- ]),
1916
- _: 3
1917
- })
1918
- ]),
1919
- _: 3
1920
- })
1921
- ]),
1922
- _: 3
1923
- }, 8, ["model", "rules", "label-width", "class"])
1924
- ]),
1925
- _: 3
1926
- }, 8, ["span"]),
1927
- x.value ? (d(), C(ee, {
1698
+ G("div", Pt, [
1699
+ K(w.$slots, "table-actions-right", {}, void 0, !0),
1700
+ b(gt, {
1701
+ columns: f.columns,
1702
+ data: P.value
1703
+ }, null, 8, ["columns", "data"]),
1704
+ b(Ct, {
1705
+ "table-columns": f.columns,
1706
+ "visible-columns": W.value,
1707
+ "onUpdate:visibleColumns": y[0] || (y[0] = (s) => W.value = s),
1708
+ "onUpdate:columns": ze
1709
+ }, null, 8, ["table-columns", "visible-columns"])
1710
+ ])
1711
+ ])) : E("", !0),
1712
+ G("div", Lt, [
1713
+ b(u(Be), {
1714
+ ref_key: "tableRef",
1715
+ ref: i,
1716
+ data: P.value,
1717
+ border: "",
1718
+ stripe: "",
1719
+ size: l.size,
1720
+ height: d.value,
1721
+ "header-cell-style": { background: "#F5F7FA" }
1722
+ }, {
1723
+ default: h(() => [
1724
+ f.showIndex ? (p(), C(u(Q), {
1725
+ key: 0,
1726
+ type: "index",
1727
+ width: f.indexWidth,
1728
+ label: "#",
1729
+ align: "center"
1730
+ }, null, 8, ["width"])) : E("", !0),
1731
+ l.permissions.delete && r.webFunction.includes("batchDelete") ? (p(), C(u(Q), {
1732
+ key: 1,
1733
+ type: "selection",
1734
+ width: "55",
1735
+ align: "center"
1736
+ })) : E("", !0),
1737
+ (p(!0), S(B, null, J(f.columns, (s) => (p(), S(B, {
1738
+ key: s.prop
1739
+ }, [
1740
+ W.value.includes(s.columnProperty) ? (p(), C(u(Q), {
1928
1741
  key: 0,
1929
- span: x.value ? x.value.span : 0,
1930
- style: { padding: "0 10px" }
1742
+ label: s.columnLabel,
1743
+ width: (s.width || "") + "px",
1744
+ fixed: s.fixed,
1745
+ "show-overflow-tooltip": !s.noWrap,
1746
+ align: s.align,
1747
+ "header-align": s.headerAlign
1931
1748
  }, {
1932
- default: h(() => [
1933
- D.value ? (d(), C(tt, {
1749
+ default: h((M) => [
1750
+ w.$slots["table-column-" + s.columnProperty] ? K(w.$slots, "table-column-" + s.columnProperty, {
1934
1751
  key: 0,
1935
- modelValue: L.data.wktstr,
1936
- "onUpdate:modelValue": y[3] || (y[3] = (m) => L.data.wktstr = m),
1937
- currentOperationType: i.value,
1938
- mapViewData: r.mapViewData,
1939
- geomType: w.geomType
1940
- }, null, 8, ["modelValue", "currentOperationType", "mapViewData", "geomType"])) : N("", !0)
1752
+ scope: M
1753
+ }, void 0, !0) : (p(), S(B, { key: 1 }, [
1754
+ U(re(u(o).formatColumnValue(s, M?.row[s.columnProperty])), 1)
1755
+ ], 64))
1941
1756
  ]),
1942
- _: 1
1943
- }, 8, ["span"])) : N("", !0)
1944
- ]),
1945
- _: 3
1946
- })
1947
- ]),
1948
- _: 2
1949
- }, [
1950
- i.value !== "details" ? {
1951
- name: "footer",
1952
- fn: h(() => [
1953
- b($, {
1954
- type: "primary",
1955
- onClick: ke,
1956
- loading: v.value
1757
+ _: 2
1758
+ }, 1032, ["label", "width", "fixed", "show-overflow-tooltip", "align", "header-align"])) : E("", !0)
1759
+ ], 64))), 128)),
1760
+ b(u(Q), {
1761
+ align: f.operationAlign,
1762
+ fixed: "right",
1763
+ width: f.operationWidth,
1764
+ label: "操作"
1957
1765
  }, {
1958
- default: h(() => [...y[13] || (y[13] = [
1959
- B("确定", -1)
1960
- ])]),
1961
- _: 1
1962
- }, 8, ["loading"]),
1963
- b($, {
1964
- onClick: y[4] || (y[4] = (m) => O.value = !1)
1766
+ default: h((s) => [
1767
+ f.visibleOperationButtons.includes("detail") ? (p(), C(u(I), {
1768
+ key: 0,
1769
+ type: "primary",
1770
+ plain: "",
1771
+ size: f.operationSize,
1772
+ onClick: (M) => Pe(s.row)
1773
+ }, {
1774
+ default: h(() => [...y[10] || (y[10] = [
1775
+ U("详情", -1)
1776
+ ])]),
1777
+ _: 1
1778
+ }, 8, ["size", "onClick"])) : E("", !0),
1779
+ f.visibleOperationButtons.includes("edit") && l.permissions.edit ? (p(), C(u(I), {
1780
+ key: 1,
1781
+ type: "success",
1782
+ plain: "",
1783
+ size: f.operationSize,
1784
+ onClick: (M) => Le(s.row)
1785
+ }, {
1786
+ default: h(() => [...y[11] || (y[11] = [
1787
+ U("编辑", -1)
1788
+ ])]),
1789
+ _: 1
1790
+ }, 8, ["size", "onClick"])) : E("", !0),
1791
+ f.visibleOperationButtons.includes("delete") && l.permissions.delete ? (p(), C(u(I), {
1792
+ key: 2,
1793
+ type: "danger",
1794
+ plain: "",
1795
+ size: f.operationSize,
1796
+ onClick: (M) => Te(s.row)
1797
+ }, {
1798
+ default: h(() => [...y[12] || (y[12] = [
1799
+ U("删除", -1)
1800
+ ])]),
1801
+ _: 1
1802
+ }, 8, ["size", "onClick"])) : E("", !0),
1803
+ K(w.$slots, "table-column-action", { scope: s }, void 0, !0)
1804
+ ]),
1805
+ _: 3
1806
+ }, 8, ["align", "width"])
1807
+ ]),
1808
+ _: 3
1809
+ }, 8, ["data", "size", "height"])
1810
+ ]),
1811
+ f.showPagination ? (p(), S("div", Tt, [
1812
+ b(u(Re), {
1813
+ "current-page": D.currentPage,
1814
+ "onUpdate:currentPage": y[1] || (y[1] = (s) => D.currentPage = s),
1815
+ "page-size": D.pageSize,
1816
+ "onUpdate:pageSize": y[2] || (y[2] = (s) => D.pageSize = s),
1817
+ total: D.total,
1818
+ layout: "total, sizes, prev, pager, next",
1819
+ background: "",
1820
+ size: l.size,
1821
+ onSizeChange: Ve,
1822
+ onCurrentChange: De
1823
+ }, null, 8, ["current-page", "page-size", "total", "size"])
1824
+ ])) : E("", !0)
1825
+ ]),
1826
+ b(u(be), {
1827
+ title: L.title,
1828
+ "close-on-click-modal": !1,
1829
+ "close-on-press-escape": !1,
1830
+ width: L.formDialogWidth,
1831
+ modelValue: N.value,
1832
+ "onUpdate:modelValue": y[5] || (y[5] = (s) => N.value = s),
1833
+ "destroy-on-close": !0,
1834
+ draggable: "",
1835
+ "append-to-body": !0,
1836
+ "align-center": ""
1837
+ }, xe({
1838
+ default: h(() => [
1839
+ b(u(le), null, {
1840
+ default: h(() => [
1841
+ b(u(X), {
1842
+ span: T.value ? 24 - T.value.span : 24
1965
1843
  }, {
1966
- default: h(() => [...y[14] || (y[14] = [
1967
- B("取消", -1)
1968
- ])]),
1844
+ default: h(() => [
1845
+ b(u(oe), {
1846
+ ref_key: "formRef",
1847
+ ref: m,
1848
+ model: F.data,
1849
+ rules: A.value,
1850
+ size: "default",
1851
+ "label-width": L.labelWidth,
1852
+ "label-suffix": ":",
1853
+ class: ee({ "curd-form-details": c.value === "details" })
1854
+ }, {
1855
+ default: h(() => [
1856
+ b(u(le), null, {
1857
+ default: h(() => [
1858
+ b(u(X), { span: 24 }, {
1859
+ default: h(() => [
1860
+ b(u(le), null, {
1861
+ default: h(() => [
1862
+ (p(!0), S(B, null, J($.formColumns, (s) => (p(), C(u(X), {
1863
+ key: s.columnProperty,
1864
+ span: s.span || 12
1865
+ }, {
1866
+ default: h(() => [
1867
+ b(u(Z), {
1868
+ label: s.columnLabel,
1869
+ prop: s.columnProperty
1870
+ }, {
1871
+ default: h(() => [
1872
+ c.value === "details" ? (p(), C(Ke, {
1873
+ key: 0,
1874
+ item: s,
1875
+ modelValue: F.data[s.columnProperty],
1876
+ "onUpdate:modelValue": (M) => F.data[s.columnProperty] = M,
1877
+ dropdownOptions: u(o).getDictOptionsByColumnProperty(s.columnProperty)
1878
+ }, null, 8, ["item", "modelValue", "onUpdate:modelValue", "dropdownOptions"])) : (p(), S(B, { key: 1 }, [
1879
+ s.showMethod === "slot" ? K(w.$slots, "form-" + s.columnProperty, {
1880
+ key: 0,
1881
+ item: s,
1882
+ scope: { ...w.scope, formData: F.data, data: F.data[s.columnProperty] }
1883
+ }, void 0, !0) : (p(), C(he, {
1884
+ key: 1,
1885
+ item: s,
1886
+ modelValue: F.data[s.columnProperty],
1887
+ "onUpdate:modelValue": (M) => F.data[s.columnProperty] = M,
1888
+ dropdownOptions: u(o).getDictOptionsByColumnProperty(s.columnProperty),
1889
+ currentOperationType: c.value
1890
+ }, null, 8, ["item", "modelValue", "onUpdate:modelValue", "dropdownOptions", "currentOperationType"]))
1891
+ ], 64))
1892
+ ]),
1893
+ _: 2
1894
+ }, 1032, ["label", "prop"])
1895
+ ]),
1896
+ _: 2
1897
+ }, 1032, ["span"]))), 128))
1898
+ ]),
1899
+ _: 3
1900
+ })
1901
+ ]),
1902
+ _: 3
1903
+ })
1904
+ ]),
1905
+ _: 3
1906
+ })
1907
+ ]),
1908
+ _: 3
1909
+ }, 8, ["model", "rules", "label-width", "class"])
1910
+ ]),
1911
+ _: 3
1912
+ }, 8, ["span"]),
1913
+ T.value ? (p(), C(u(X), {
1914
+ key: 0,
1915
+ span: T.value ? T.value.span : 0,
1916
+ style: { padding: "0 10px" }
1917
+ }, {
1918
+ default: h(() => [
1919
+ k.value ? (p(), C(mt, {
1920
+ key: 0,
1921
+ modelValue: F.data.wktstr,
1922
+ "onUpdate:modelValue": y[3] || (y[3] = (s) => F.data.wktstr = s),
1923
+ currentOperationType: c.value,
1924
+ mapViewData: l.mapViewData,
1925
+ geomType: r.geomType
1926
+ }, null, 8, ["modelValue", "currentOperationType", "mapViewData", "geomType"])) : E("", !0)
1927
+ ]),
1969
1928
  _: 1
1970
- })
1929
+ }, 8, ["span"])) : E("", !0)
1971
1930
  ]),
1972
- key: "0"
1973
- } : void 0
1974
- ]), 1032, ["title", "width", "modelValue"])
1975
- ], 64);
1976
- };
1931
+ _: 3
1932
+ })
1933
+ ]),
1934
+ _: 2
1935
+ }, [
1936
+ c.value !== "details" ? {
1937
+ name: "footer",
1938
+ fn: h(() => [
1939
+ b(u(I), {
1940
+ type: "primary",
1941
+ onClick: Me,
1942
+ loading: v.value
1943
+ }, {
1944
+ default: h(() => [...y[13] || (y[13] = [
1945
+ U("确定", -1)
1946
+ ])]),
1947
+ _: 1
1948
+ }, 8, ["loading"]),
1949
+ b(u(I), {
1950
+ onClick: y[4] || (y[4] = (s) => N.value = !1)
1951
+ }, {
1952
+ default: h(() => [...y[14] || (y[14] = [
1953
+ U("取消", -1)
1954
+ ])]),
1955
+ _: 1
1956
+ })
1957
+ ]),
1958
+ key: "0"
1959
+ } : void 0
1960
+ ]), 1032, ["title", "width", "modelValue"])
1961
+ ], 64));
1977
1962
  }
1978
- }), St = /* @__PURE__ */ Q(wt, [["__scopeId", "data-v-da85121d"]]);
1963
+ }), xt = /* @__PURE__ */ _(Ot, [["__scopeId", "data-v-de5218c7"]]);
1979
1964
  export {
1980
- St as CurdForm,
1981
- St as default
1965
+ xt as CurdForm,
1966
+ xt as default
1982
1967
  };