@pangu-backend-ui/apputil-core 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +206 -204
- package/index.umd.cjs +1 -1
- package/package.json +1 -1
- package/types/views/BannerListView.vue.d.ts +12 -12
- package/types/views/components/BannerDialog.vue.d.ts +1 -1
package/index.js
CHANGED
|
@@ -1,87 +1,96 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as x, ref as v, inject as W, resolveComponent as u, openBlock as i, createBlock as p, withCtx as a, createVNode as e, createTextVNode as f, createElementBlock as D, Fragment as S, renderList as I, onBeforeMount as J, resolveDirective as Q, withDirectives as z, createCommentVNode as P, toDisplayString as k, unref as K } from "vue";
|
|
2
|
+
const X = [], Y = {
|
|
3
|
+
WEB_URL: {
|
|
4
|
+
name: "Web地址"
|
|
5
|
+
},
|
|
6
|
+
PAGE_PATH: {
|
|
7
|
+
name: "页面地址"
|
|
8
|
+
},
|
|
9
|
+
API: {
|
|
10
|
+
name: "API地址"
|
|
11
|
+
}
|
|
12
|
+
}, Z = /* @__PURE__ */ x({
|
|
3
13
|
__name: "BannerDialog",
|
|
4
14
|
emits: ["success"],
|
|
5
|
-
setup(
|
|
6
|
-
const
|
|
15
|
+
setup(w, { expose: r, emit: d }) {
|
|
16
|
+
const c = v(!1), o = v({
|
|
7
17
|
sceneCode: null,
|
|
8
18
|
image: null,
|
|
9
19
|
targetPath: null,
|
|
10
20
|
targetPathType: null,
|
|
11
21
|
params: null,
|
|
12
22
|
shelfTimeArr: []
|
|
13
|
-
}),
|
|
23
|
+
}), E = v({
|
|
14
24
|
sceneCode: [{ required: !0, message: "请输入场景代码" }],
|
|
15
25
|
image: [{ required: !0, message: "请上传图片" }],
|
|
16
26
|
targetPath: [{ required: !0, message: "请输入目标地址" }],
|
|
17
27
|
targetPathType: [{ required: !0, message: "请选择目标地址类型" }]
|
|
18
|
-
}), C =
|
|
19
|
-
function
|
|
28
|
+
}), C = v(!1), b = W("http"), A = v();
|
|
29
|
+
function $() {
|
|
20
30
|
var y;
|
|
21
|
-
(y =
|
|
22
|
-
if (
|
|
31
|
+
(y = A.value) == null || y.validate((l) => {
|
|
32
|
+
if (l) {
|
|
23
33
|
C.value = !0;
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
d("success"), (
|
|
34
|
+
let n = `/api/banner/${T.value ?? ""}/${T.value ? "update" : "create"}`, m = { ...o.value };
|
|
35
|
+
o.value.shelfTimeArr.length && (m.shelfTime = o.value.shelfTimeArr[0], m.offShelfTime = o.value.shelfTimeArr[1]), b == null || b.post(n, m).then((h) => {
|
|
36
|
+
var g;
|
|
37
|
+
d("success"), (g = A.value) == null || g.resetFields(), c.value = !1;
|
|
28
38
|
}).finally(() => {
|
|
29
39
|
C.value = !1;
|
|
30
40
|
});
|
|
31
41
|
}
|
|
32
42
|
});
|
|
33
43
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
U.value = y, w = null, (o = k.value) == null || o.resetFields(), t && (w = t.id, Object.assign(n.value, t), n.value.shelfTimeArr = [new Date(t.shelfTime), new Date(t.offShelfTime)]), m.value = !0;
|
|
44
|
+
const F = v([]), T = v(null);
|
|
45
|
+
function U(y, l) {
|
|
46
|
+
var n;
|
|
47
|
+
F.value = y, T.value = null, (n = A.value) == null || n.resetFields(), l && (T.value = l.id, Object.assign(o.value, l), o.value.shelfTimeArr = [new Date(l.shelfTime), new Date(l.offShelfTime)]), c.value = !0;
|
|
39
48
|
}
|
|
40
49
|
return r({
|
|
41
|
-
show:
|
|
42
|
-
}), (y,
|
|
43
|
-
const
|
|
44
|
-
return i(),
|
|
45
|
-
modelValue:
|
|
46
|
-
"onUpdate:modelValue":
|
|
50
|
+
show: U
|
|
51
|
+
}), (y, l) => {
|
|
52
|
+
const n = u("el-option"), m = u("el-select"), h = u("el-form-item"), g = u("pg-upload"), B = u("el-input"), R = u("el-date-picker"), _ = u("el-form"), N = u("el-button"), L = u("el-dialog");
|
|
53
|
+
return i(), p(L, {
|
|
54
|
+
modelValue: c.value,
|
|
55
|
+
"onUpdate:modelValue": l[6] || (l[6] = (s) => c.value = s),
|
|
47
56
|
width: "400"
|
|
48
57
|
}, {
|
|
49
|
-
footer:
|
|
50
|
-
e(
|
|
58
|
+
footer: a(() => [
|
|
59
|
+
e(N, {
|
|
51
60
|
type: "primary",
|
|
52
61
|
disabled: C.value,
|
|
53
62
|
loading: C.value,
|
|
54
|
-
onClick:
|
|
63
|
+
onClick: $
|
|
55
64
|
}, {
|
|
56
|
-
default:
|
|
65
|
+
default: a(() => [
|
|
57
66
|
f("提交")
|
|
58
67
|
]),
|
|
59
68
|
_: 1
|
|
60
69
|
}, 8, ["disabled", "loading"])
|
|
61
70
|
]),
|
|
62
|
-
default:
|
|
63
|
-
e(
|
|
71
|
+
default: a(() => [
|
|
72
|
+
e(_, {
|
|
64
73
|
ref_key: "form",
|
|
65
|
-
ref:
|
|
66
|
-
rules:
|
|
67
|
-
model:
|
|
74
|
+
ref: A,
|
|
75
|
+
rules: E.value,
|
|
76
|
+
model: o.value,
|
|
68
77
|
"label-position": "top"
|
|
69
78
|
}, {
|
|
70
|
-
default:
|
|
79
|
+
default: a(() => [
|
|
71
80
|
e(h, {
|
|
72
81
|
label: "场景代码",
|
|
73
82
|
prop: "sceneCode"
|
|
74
83
|
}, {
|
|
75
|
-
default:
|
|
76
|
-
e(
|
|
77
|
-
modelValue:
|
|
78
|
-
"onUpdate:modelValue":
|
|
84
|
+
default: a(() => [
|
|
85
|
+
e(m, {
|
|
86
|
+
modelValue: o.value.sceneCode,
|
|
87
|
+
"onUpdate:modelValue": l[0] || (l[0] = (s) => o.value.sceneCode = s),
|
|
79
88
|
placeholder: "请输入/选择场景代码",
|
|
80
89
|
"allow-create": "",
|
|
81
90
|
filterable: ""
|
|
82
91
|
}, {
|
|
83
|
-
default:
|
|
84
|
-
(i(!0), S
|
|
92
|
+
default: a(() => [
|
|
93
|
+
(i(!0), D(S, null, I(F.value, (s) => (i(), p(n, {
|
|
85
94
|
key: s,
|
|
86
95
|
value: s,
|
|
87
96
|
label: s
|
|
@@ -96,15 +105,16 @@ const z = [], K = /* @__PURE__ */ W({
|
|
|
96
105
|
label: "图片",
|
|
97
106
|
prop: "image"
|
|
98
107
|
}, {
|
|
99
|
-
default:
|
|
100
|
-
|
|
108
|
+
default: a(() => [
|
|
109
|
+
(i(), p(g, {
|
|
101
110
|
accept: "jpg,jpeg,png",
|
|
102
|
-
modelValue:
|
|
103
|
-
"onUpdate:modelValue":
|
|
111
|
+
modelValue: o.value.image,
|
|
112
|
+
"onUpdate:modelValue": l[1] || (l[1] = (s) => o.value.image = s),
|
|
113
|
+
key: `img_${T.value}`,
|
|
104
114
|
"list-type": "picture-card",
|
|
105
115
|
"upload-type": "banner",
|
|
106
116
|
limit: 1
|
|
107
|
-
}, null, 8, ["modelValue"])
|
|
117
|
+
}, null, 8, ["modelValue"]))
|
|
108
118
|
]),
|
|
109
119
|
_: 1
|
|
110
120
|
}),
|
|
@@ -112,11 +122,11 @@ const z = [], K = /* @__PURE__ */ W({
|
|
|
112
122
|
label: "目标地址",
|
|
113
123
|
prop: "targetPath"
|
|
114
124
|
}, {
|
|
115
|
-
default:
|
|
116
|
-
e(
|
|
125
|
+
default: a(() => [
|
|
126
|
+
e(B, {
|
|
117
127
|
placeholder: "请输入目标地址",
|
|
118
|
-
modelValue:
|
|
119
|
-
"onUpdate:modelValue":
|
|
128
|
+
modelValue: o.value.targetPath,
|
|
129
|
+
"onUpdate:modelValue": l[2] || (l[2] = (s) => o.value.targetPath = s)
|
|
120
130
|
}, null, 8, ["modelValue"])
|
|
121
131
|
]),
|
|
122
132
|
_: 1
|
|
@@ -125,22 +135,22 @@ const z = [], K = /* @__PURE__ */ W({
|
|
|
125
135
|
label: "目标地址类型",
|
|
126
136
|
prop: "targetPathType"
|
|
127
137
|
}, {
|
|
128
|
-
default:
|
|
129
|
-
e(
|
|
138
|
+
default: a(() => [
|
|
139
|
+
e(m, {
|
|
130
140
|
placeholder: "请选择目标地址类型",
|
|
131
|
-
modelValue:
|
|
132
|
-
"onUpdate:modelValue":
|
|
141
|
+
modelValue: o.value.targetPathType,
|
|
142
|
+
"onUpdate:modelValue": l[3] || (l[3] = (s) => o.value.targetPathType = s)
|
|
133
143
|
}, {
|
|
134
|
-
default:
|
|
135
|
-
e(
|
|
144
|
+
default: a(() => [
|
|
145
|
+
e(n, {
|
|
136
146
|
value: "WEB_URL",
|
|
137
147
|
label: "Web地址"
|
|
138
148
|
}),
|
|
139
|
-
e(
|
|
149
|
+
e(n, {
|
|
140
150
|
value: "PAGE_PATH",
|
|
141
151
|
label: "页面地址"
|
|
142
152
|
}),
|
|
143
|
-
e(
|
|
153
|
+
e(n, {
|
|
144
154
|
value: "API",
|
|
145
155
|
label: "API地址"
|
|
146
156
|
})
|
|
@@ -154,11 +164,11 @@ const z = [], K = /* @__PURE__ */ W({
|
|
|
154
164
|
label: "目标地址参数",
|
|
155
165
|
prop: "params"
|
|
156
166
|
}, {
|
|
157
|
-
default:
|
|
158
|
-
e(
|
|
167
|
+
default: a(() => [
|
|
168
|
+
e(B, {
|
|
159
169
|
type: "textarea",
|
|
160
|
-
modelValue:
|
|
161
|
-
"onUpdate:modelValue":
|
|
170
|
+
modelValue: o.value.params,
|
|
171
|
+
"onUpdate:modelValue": l[4] || (l[4] = (s) => o.value.params = s)
|
|
162
172
|
}, null, 8, ["modelValue"])
|
|
163
173
|
]),
|
|
164
174
|
_: 1
|
|
@@ -167,11 +177,11 @@ const z = [], K = /* @__PURE__ */ W({
|
|
|
167
177
|
label: "生效时段",
|
|
168
178
|
prop: "shelfTimeArr"
|
|
169
179
|
}, {
|
|
170
|
-
default:
|
|
171
|
-
e(
|
|
180
|
+
default: a(() => [
|
|
181
|
+
e(R, {
|
|
172
182
|
type: "datetimerange",
|
|
173
|
-
modelValue:
|
|
174
|
-
"onUpdate:modelValue":
|
|
183
|
+
modelValue: o.value.shelfTimeArr,
|
|
184
|
+
"onUpdate:modelValue": l[5] || (l[5] = (s) => o.value.shelfTimeArr = s),
|
|
175
185
|
"start-placeholder": "上架时间",
|
|
176
186
|
"end-placeholder": "下架时间",
|
|
177
187
|
"default-time": [new Date(2e3, 1, 1, 0, 0, 0), new Date(2e3, 1, 1, 23, 59, 59)]
|
|
@@ -187,354 +197,346 @@ const z = [], K = /* @__PURE__ */ W({
|
|
|
187
197
|
}, 8, ["modelValue"]);
|
|
188
198
|
};
|
|
189
199
|
}
|
|
190
|
-
}),
|
|
191
|
-
WEB_URL: {
|
|
192
|
-
name: "Web地址"
|
|
193
|
-
},
|
|
194
|
-
PAGE_PATH: {
|
|
195
|
-
name: "页面地址"
|
|
196
|
-
},
|
|
197
|
-
API: {
|
|
198
|
-
name: "API地址"
|
|
199
|
-
}
|
|
200
|
-
}, X = /* @__PURE__ */ W({
|
|
200
|
+
}), ee = /* @__PURE__ */ x({
|
|
201
201
|
__name: "BannerListView",
|
|
202
|
-
setup(
|
|
203
|
-
const r =
|
|
202
|
+
setup(w) {
|
|
203
|
+
const r = W("http"), d = v({
|
|
204
204
|
sceneCode: null,
|
|
205
205
|
status: null
|
|
206
|
-
}),
|
|
207
|
-
function
|
|
208
|
-
r == null || r.get("/api/banner/all-scene-code").then((
|
|
209
|
-
|
|
206
|
+
}), c = v([]);
|
|
207
|
+
function o() {
|
|
208
|
+
r == null || r.get("/api/banner/all-scene-code").then((l) => {
|
|
209
|
+
c.value = l.data;
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
-
const
|
|
212
|
+
const E = v(), C = v(!1);
|
|
213
213
|
function b() {
|
|
214
|
-
C.value = !!d.value.sceneCode,
|
|
214
|
+
C.value = !!d.value.sceneCode, E.value.search();
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
r == null || r.post(`/api/banner/${
|
|
216
|
+
function A(l) {
|
|
217
|
+
r == null || r.post(`/api/banner/${l}/publish`).then((n) => {
|
|
218
218
|
b();
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
r == null || r.post(`/api/banner/${
|
|
221
|
+
function $(l) {
|
|
222
|
+
r == null || r.post(`/api/banner/${l}/off-shelf`).then((n) => {
|
|
223
223
|
b();
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
r == null || r.post(`/api/banner/${
|
|
228
|
-
d.value.sceneCode =
|
|
226
|
+
function F(l, n) {
|
|
227
|
+
r == null || r.post(`/api/banner/${l}/move-up`).then((m) => {
|
|
228
|
+
d.value.sceneCode = n, b();
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
r == null || r.post(`/api/banner/${
|
|
233
|
-
d.value.sceneCode =
|
|
231
|
+
function T(l, n) {
|
|
232
|
+
r == null || r.post(`/api/banner/${l}/move-down`).then((m) => {
|
|
233
|
+
d.value.sceneCode = n, b();
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
J(() => {
|
|
237
|
-
|
|
237
|
+
o();
|
|
238
238
|
});
|
|
239
|
-
const
|
|
240
|
-
function y(
|
|
241
|
-
|
|
239
|
+
const U = v();
|
|
240
|
+
function y(l) {
|
|
241
|
+
U.value.show(c.value, l);
|
|
242
242
|
}
|
|
243
|
-
return (
|
|
244
|
-
const
|
|
245
|
-
return i(), S
|
|
246
|
-
e(
|
|
247
|
-
default:
|
|
248
|
-
e(
|
|
249
|
-
default:
|
|
243
|
+
return (l, n) => {
|
|
244
|
+
const m = u("el-option"), h = u("el-select"), g = u("el-button"), B = u("el-space"), R = u("el-card"), _ = u("el-table-column"), N = u("el-image"), L = u("el-descriptions-item"), s = u("el-descriptions"), j = u("el-popover"), H = u("el-tag"), O = u("el-popconfirm"), q = u("pg-table"), G = Q("permission");
|
|
245
|
+
return i(), D(S, null, [
|
|
246
|
+
e(R, null, {
|
|
247
|
+
default: a(() => [
|
|
248
|
+
e(B, null, {
|
|
249
|
+
default: a(() => [
|
|
250
250
|
e(h, {
|
|
251
251
|
modelValue: d.value.sceneCode,
|
|
252
|
-
"onUpdate:modelValue":
|
|
252
|
+
"onUpdate:modelValue": n[0] || (n[0] = (t) => d.value.sceneCode = t),
|
|
253
253
|
placeholder: "场景代码",
|
|
254
254
|
clearable: ""
|
|
255
255
|
}, {
|
|
256
|
-
default:
|
|
257
|
-
(i(!0), S
|
|
258
|
-
label:
|
|
259
|
-
value:
|
|
260
|
-
key: `sc_con_${
|
|
256
|
+
default: a(() => [
|
|
257
|
+
(i(!0), D(S, null, I(c.value, (t, V) => (i(), p(m, {
|
|
258
|
+
label: t,
|
|
259
|
+
value: t,
|
|
260
|
+
key: `sc_con_${V}`
|
|
261
261
|
}, null, 8, ["label", "value"]))), 128))
|
|
262
262
|
]),
|
|
263
263
|
_: 1
|
|
264
264
|
}, 8, ["modelValue"]),
|
|
265
265
|
e(h, {
|
|
266
266
|
modelValue: d.value.status,
|
|
267
|
-
"onUpdate:modelValue":
|
|
267
|
+
"onUpdate:modelValue": n[1] || (n[1] = (t) => d.value.status = t),
|
|
268
268
|
placeholder: "状态",
|
|
269
269
|
clearable: "",
|
|
270
270
|
style: { width: "150px" }
|
|
271
271
|
}, {
|
|
272
|
-
default:
|
|
273
|
-
e(
|
|
272
|
+
default: a(() => [
|
|
273
|
+
e(m, {
|
|
274
274
|
label: "草稿",
|
|
275
275
|
value: "DRAFT"
|
|
276
276
|
}),
|
|
277
|
-
e(
|
|
277
|
+
e(m, {
|
|
278
278
|
label: "已发布",
|
|
279
279
|
value: "PUBLISH"
|
|
280
280
|
}),
|
|
281
|
-
e(
|
|
281
|
+
e(m, {
|
|
282
282
|
label: "已下架",
|
|
283
283
|
value: "OFF_SHELF"
|
|
284
284
|
})
|
|
285
285
|
]),
|
|
286
286
|
_: 1
|
|
287
287
|
}, 8, ["modelValue"]),
|
|
288
|
-
e(
|
|
288
|
+
e(g, {
|
|
289
289
|
type: "primary",
|
|
290
290
|
icon: "search",
|
|
291
291
|
onClick: b
|
|
292
292
|
}, {
|
|
293
|
-
default:
|
|
293
|
+
default: a(() => [
|
|
294
294
|
f("搜索")
|
|
295
295
|
]),
|
|
296
296
|
_: 1
|
|
297
297
|
}),
|
|
298
|
-
|
|
298
|
+
z((i(), p(g, {
|
|
299
299
|
icon: "plus",
|
|
300
|
-
onClick:
|
|
300
|
+
onClick: n[2] || (n[2] = (t) => y())
|
|
301
301
|
}, {
|
|
302
|
-
default:
|
|
302
|
+
default: a(() => [
|
|
303
303
|
f("创建Banner")
|
|
304
304
|
]),
|
|
305
305
|
_: 1
|
|
306
|
-
})
|
|
306
|
+
})), [
|
|
307
|
+
[G, "CREATE_BANNER"]
|
|
308
|
+
])
|
|
307
309
|
]),
|
|
308
310
|
_: 1
|
|
309
311
|
})
|
|
310
312
|
]),
|
|
311
313
|
_: 1
|
|
312
314
|
}),
|
|
313
|
-
e(
|
|
315
|
+
e(q, {
|
|
314
316
|
ref_key: "table",
|
|
315
|
-
ref:
|
|
317
|
+
ref: E,
|
|
316
318
|
"data-url": "/api/banner/page",
|
|
317
|
-
onRowDbClick: y,
|
|
319
|
+
onRowDbClick: n[3] || (n[3] = (t) => l.$hasPer("UPDATE_BANNER") ? y(t) : null),
|
|
318
320
|
condition: d.value,
|
|
319
321
|
style: { "margin-top": "10px" }
|
|
320
322
|
}, {
|
|
321
|
-
default:
|
|
322
|
-
C.value ? (i(), _
|
|
323
|
+
default: a(() => [
|
|
324
|
+
C.value && l.$hasPer("BANNER_SEQ_MOVE_UP_DOWN") ? (i(), p(_, {
|
|
323
325
|
key: 0,
|
|
324
326
|
align: "center",
|
|
325
327
|
width: "80"
|
|
326
328
|
}, {
|
|
327
|
-
default:
|
|
328
|
-
e(
|
|
329
|
-
default:
|
|
330
|
-
e(
|
|
329
|
+
default: a(({ row: t }) => [
|
|
330
|
+
e(B, { direction: "vertical" }, {
|
|
331
|
+
default: a(() => [
|
|
332
|
+
e(g, {
|
|
331
333
|
icon: "ArrowUpBold",
|
|
332
|
-
onClick: (
|
|
334
|
+
onClick: (V) => F(t.id, t.sceneCode)
|
|
333
335
|
}, null, 8, ["onClick"]),
|
|
334
|
-
e(
|
|
336
|
+
e(g, {
|
|
335
337
|
icon: "ArrowDownBold",
|
|
336
|
-
onClick: (
|
|
338
|
+
onClick: (V) => T(t.id, t.sceneCode)
|
|
337
339
|
}, null, 8, ["onClick"])
|
|
338
340
|
]),
|
|
339
341
|
_: 2
|
|
340
342
|
}, 1024)
|
|
341
343
|
]),
|
|
342
344
|
_: 1
|
|
343
|
-
})) :
|
|
344
|
-
e(
|
|
345
|
+
})) : P("", !0),
|
|
346
|
+
e(_, {
|
|
345
347
|
label: "场景代码",
|
|
346
348
|
prop: "sceneCode",
|
|
347
349
|
width: "150"
|
|
348
350
|
}),
|
|
349
|
-
e(
|
|
351
|
+
e(_, {
|
|
350
352
|
label: "图片",
|
|
351
353
|
width: "300",
|
|
352
354
|
align: "center"
|
|
353
355
|
}, {
|
|
354
|
-
default:
|
|
355
|
-
e(
|
|
356
|
-
src:
|
|
356
|
+
default: a(({ row: t }) => [
|
|
357
|
+
e(N, {
|
|
358
|
+
src: t.image,
|
|
357
359
|
style: { "max-width": "300px" },
|
|
358
|
-
"preview-src-list": [
|
|
360
|
+
"preview-src-list": [t.image],
|
|
359
361
|
"preview-teleported": ""
|
|
360
362
|
}, null, 8, ["src", "preview-src-list"])
|
|
361
363
|
]),
|
|
362
364
|
_: 1
|
|
363
365
|
}),
|
|
364
|
-
e(
|
|
366
|
+
e(_, {
|
|
365
367
|
label: "目标路径",
|
|
366
368
|
prop: "targetPath",
|
|
367
369
|
"show-overflow-tooltip": ""
|
|
368
370
|
}),
|
|
369
|
-
e(
|
|
371
|
+
e(_, {
|
|
370
372
|
label: "目标路径类型",
|
|
371
373
|
prop: "targetPathType",
|
|
372
374
|
width: "120"
|
|
373
375
|
}, {
|
|
374
|
-
default:
|
|
375
|
-
f(
|
|
376
|
+
default: a(({ row: t }) => [
|
|
377
|
+
f(k(K(Y)[t.targetPathType].name), 1)
|
|
376
378
|
]),
|
|
377
379
|
_: 1
|
|
378
380
|
}),
|
|
379
|
-
e(
|
|
381
|
+
e(_, {
|
|
380
382
|
label: "目标路径参数",
|
|
381
383
|
width: "120",
|
|
382
384
|
"show-overflow-tooltip": ""
|
|
383
385
|
}, {
|
|
384
|
-
default:
|
|
385
|
-
|
|
386
|
+
default: a(({ row: t }) => [
|
|
387
|
+
t.params ? (i(), p(j, {
|
|
386
388
|
key: 0,
|
|
387
389
|
trigger: "hover",
|
|
388
|
-
width: "
|
|
390
|
+
width: "350"
|
|
389
391
|
}, {
|
|
390
|
-
reference:
|
|
391
|
-
f(
|
|
392
|
+
reference: a(() => [
|
|
393
|
+
f(k(t.params.substring(0, 100)) + k(t.params.length > 100 ? "..." : ""), 1)
|
|
392
394
|
]),
|
|
393
|
-
default:
|
|
394
|
-
|
|
395
|
+
default: a(() => [
|
|
396
|
+
t.params.startsWith("{") ? (i(), p(s, {
|
|
395
397
|
key: 0,
|
|
396
398
|
column: "1",
|
|
397
399
|
border: ""
|
|
398
400
|
}, {
|
|
399
|
-
default:
|
|
400
|
-
(i(!0), S
|
|
401
|
-
label:
|
|
401
|
+
default: a(() => [
|
|
402
|
+
(i(!0), D(S, null, I(JSON.parse(t.params), (V, M) => (i(), p(L, {
|
|
403
|
+
label: M,
|
|
402
404
|
"min-width": "150"
|
|
403
405
|
}, {
|
|
404
|
-
default:
|
|
405
|
-
f(
|
|
406
|
+
default: a(() => [
|
|
407
|
+
f(k(V), 1)
|
|
406
408
|
]),
|
|
407
409
|
_: 2
|
|
408
410
|
}, 1032, ["label"]))), 256))
|
|
409
411
|
]),
|
|
410
412
|
_: 2
|
|
411
|
-
}, 1024)) : (i(), S
|
|
412
|
-
f(
|
|
413
|
+
}, 1024)) : (i(), D(S, { key: 1 }, [
|
|
414
|
+
f(k(t.params), 1)
|
|
413
415
|
], 64))
|
|
414
416
|
]),
|
|
415
417
|
_: 2
|
|
416
|
-
}, 1024)) :
|
|
418
|
+
}, 1024)) : P("", !0)
|
|
417
419
|
]),
|
|
418
420
|
_: 1
|
|
419
421
|
}),
|
|
420
|
-
e(
|
|
422
|
+
e(_, {
|
|
421
423
|
label: "上架时间",
|
|
422
424
|
prop: "shelfTime",
|
|
423
425
|
width: "180",
|
|
424
426
|
align: "center"
|
|
425
427
|
}),
|
|
426
|
-
e(
|
|
428
|
+
e(_, {
|
|
427
429
|
label: "下架时间",
|
|
428
430
|
prop: "offShelfTime",
|
|
429
431
|
width: "180",
|
|
430
432
|
align: "center"
|
|
431
433
|
}),
|
|
432
|
-
e(
|
|
434
|
+
e(_, {
|
|
433
435
|
label: "状态",
|
|
434
436
|
align: "center",
|
|
435
437
|
width: "88"
|
|
436
438
|
}, {
|
|
437
|
-
default:
|
|
438
|
-
|
|
439
|
+
default: a(({ row: t }) => [
|
|
440
|
+
t.status == "DRAFT" ? (i(), p(H, {
|
|
439
441
|
key: 0,
|
|
440
442
|
type: "danger"
|
|
441
443
|
}, {
|
|
442
|
-
default:
|
|
444
|
+
default: a(() => [
|
|
443
445
|
f("草稿")
|
|
444
446
|
]),
|
|
445
447
|
_: 1
|
|
446
|
-
})) :
|
|
447
|
-
|
|
448
|
+
})) : P("", !0),
|
|
449
|
+
t.status == "PUBLISH" ? (i(), p(H, {
|
|
448
450
|
key: 1,
|
|
449
451
|
type: "success"
|
|
450
452
|
}, {
|
|
451
|
-
default:
|
|
453
|
+
default: a(() => [
|
|
452
454
|
f("已发布")
|
|
453
455
|
]),
|
|
454
456
|
_: 1
|
|
455
|
-
})) :
|
|
456
|
-
|
|
457
|
+
})) : P("", !0),
|
|
458
|
+
t.status == "OFF_SHELF" ? (i(), p(H, {
|
|
457
459
|
key: 2,
|
|
458
460
|
type: "warning"
|
|
459
461
|
}, {
|
|
460
|
-
default:
|
|
462
|
+
default: a(() => [
|
|
461
463
|
f("已下架")
|
|
462
464
|
]),
|
|
463
465
|
_: 1
|
|
464
|
-
})) :
|
|
466
|
+
})) : P("", !0)
|
|
465
467
|
]),
|
|
466
468
|
_: 1
|
|
467
469
|
}),
|
|
468
|
-
e(
|
|
470
|
+
e(_, {
|
|
469
471
|
align: "center",
|
|
470
472
|
width: "90"
|
|
471
473
|
}, {
|
|
472
|
-
default:
|
|
473
|
-
["DRAFT", "OFF_SHELF"].indexOf(
|
|
474
|
+
default: a(({ row: t }) => [
|
|
475
|
+
["DRAFT", "OFF_SHELF"].indexOf(t.status) >= 0 && l.$hasPer("BANNER_PUBLISH") ? (i(), p(O, {
|
|
474
476
|
key: 0,
|
|
475
|
-
onConfirm: (
|
|
476
|
-
title: `确定要${
|
|
477
|
+
onConfirm: (V) => A(t.id),
|
|
478
|
+
title: `确定要${t.status == "DRAFT" ? "发布" : "上架"}该Banner吗?`
|
|
477
479
|
}, {
|
|
478
|
-
reference:
|
|
479
|
-
e(
|
|
480
|
-
default:
|
|
481
|
-
f(
|
|
480
|
+
reference: a(() => [
|
|
481
|
+
e(g, { type: "success" }, {
|
|
482
|
+
default: a(() => [
|
|
483
|
+
f(k(t.status == "DRAFT" ? "发布" : "上架"), 1)
|
|
482
484
|
]),
|
|
483
485
|
_: 2
|
|
484
486
|
}, 1024)
|
|
485
487
|
]),
|
|
486
488
|
_: 2
|
|
487
|
-
}, 1032, ["onConfirm", "title"])) :
|
|
488
|
-
|
|
489
|
+
}, 1032, ["onConfirm", "title"])) : P("", !0),
|
|
490
|
+
t.status == "PUBLISH" && l.$hasPer("BANNER_OFF_SHELF") ? (i(), p(O, {
|
|
489
491
|
key: 1,
|
|
490
|
-
onConfirm: (
|
|
492
|
+
onConfirm: (V) => $(t.id),
|
|
491
493
|
title: "确定要[下架]该Banner吗?"
|
|
492
494
|
}, {
|
|
493
|
-
reference:
|
|
494
|
-
e(
|
|
495
|
-
default:
|
|
495
|
+
reference: a(() => [
|
|
496
|
+
e(g, { type: "warning" }, {
|
|
497
|
+
default: a(() => [
|
|
496
498
|
f("下架")
|
|
497
499
|
]),
|
|
498
500
|
_: 1
|
|
499
501
|
})
|
|
500
502
|
]),
|
|
501
503
|
_: 2
|
|
502
|
-
}, 1032, ["onConfirm"])) :
|
|
504
|
+
}, 1032, ["onConfirm"])) : P("", !0)
|
|
503
505
|
]),
|
|
504
506
|
_: 1
|
|
505
507
|
})
|
|
506
508
|
]),
|
|
507
509
|
_: 1
|
|
508
510
|
}, 8, ["condition"]),
|
|
509
|
-
e(
|
|
511
|
+
e(Z, {
|
|
510
512
|
ref_key: "bannerDialog",
|
|
511
|
-
ref:
|
|
513
|
+
ref: U,
|
|
512
514
|
onSuccess: b
|
|
513
515
|
}, null, 512)
|
|
514
516
|
], 64);
|
|
515
517
|
};
|
|
516
518
|
}
|
|
517
|
-
}),
|
|
518
|
-
install: (
|
|
519
|
-
let d = r.router,
|
|
520
|
-
|
|
519
|
+
}), le = {
|
|
520
|
+
install: (w, r) => {
|
|
521
|
+
let d = r.router, c = d.getRoutes().find((o) => o.path == "/");
|
|
522
|
+
c && c.meta && d.addRoute({
|
|
521
523
|
path: "/terminal/banner",
|
|
522
524
|
name: "TerminalBanner",
|
|
523
525
|
redirect: "/terminal/banner/list",
|
|
524
|
-
component:
|
|
526
|
+
component: c.meta.commonLayout,
|
|
525
527
|
children: [{
|
|
526
528
|
path: "list",
|
|
527
529
|
name: "BannerListView",
|
|
528
|
-
component:
|
|
530
|
+
component: ee
|
|
529
531
|
}]
|
|
530
532
|
});
|
|
531
533
|
}
|
|
532
|
-
},
|
|
533
|
-
|
|
534
|
-
},
|
|
535
|
-
install:
|
|
534
|
+
}, te = (w, r) => {
|
|
535
|
+
X.forEach((d) => w.use(d)), w.use(le, r);
|
|
536
|
+
}, ne = {
|
|
537
|
+
install: te
|
|
536
538
|
};
|
|
537
539
|
export {
|
|
538
|
-
|
|
539
|
-
|
|
540
|
+
ne as default,
|
|
541
|
+
te as install
|
|
540
542
|
};
|
package/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(_=typeof globalThis<"u"?globalThis:_||self,e(_["pg-user-core"]={},_.Vue))})(this,function(_,e){"use strict";const F=[],U=e.defineComponent({__name:"BannerDialog",emits:["success"],setup(b,{expose:n,emit:c}){const s=e.ref(!1),l=e.ref({sceneCode:null,image:null,targetPath:null,targetPathType:null,params:null,shelfTimeArr:[]}),N=e.ref({sceneCode:[{required:!0,message:"请输入场景代码"}],image:[{required:!0,message:"请上传图片"}],targetPath:[{required:!0,message:"请输入目标地址"}],targetPathType:[{required:!0,message:"请选择目标地址类型"}]}),h=e.ref(!1),m=e.inject("http"),g=e.ref();function B(){var C;(C=g.value)==null||C.validate(t=>{if(t){h.value=!0;let a=`/api/banner/${u??""}/${u?"update":"create"}`,i={...l.value};l.value.shelfTimeArr.length&&(i.shelfTime=l.value.shelfTimeArr[0],i.offShelfTime=l.value.shelfTimeArr[1]),m==null||m.post(a,i).then(f=>{var p;c("success"),(p=g.value)==null||p.resetFields(),s.value=!1}).finally(()=>{h.value=!1})}})}const x=e.ref([]);let u=null;function k(C,t){var a;x.value=C,u=null,(a=g.value)==null||a.resetFields(),t&&(u=t.id,Object.assign(l.value,t),l.value.shelfTimeArr=[new Date(t.shelfTime),new Date(t.offShelfTime)]),s.value=!0}return n({show:k}),(C,t)=>{const a=e.resolveComponent("el-option"),i=e.resolveComponent("el-select"),f=e.resolveComponent("el-form-item"),p=e.resolveComponent("pg-upload"),w=e.resolveComponent("el-input"),y=e.resolveComponent("el-date-picker"),d=e.resolveComponent("el-form"),T=e.resolveComponent("el-button"),P=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(P,{modelValue:s.value,"onUpdate:modelValue":t[6]||(t[6]=r=>s.value=r),width:"400"},{footer:e.withCtx(()=>[e.createVNode(T,{type:"primary",disabled:h.value,loading:h.value,onClick:B},{default:e.withCtx(()=>[e.createTextVNode("提交")]),_:1},8,["disabled","loading"])]),default:e.withCtx(()=>[e.createVNode(d,{ref_key:"form",ref:g,rules:N.value,model:l.value,"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(f,{label:"场景代码",prop:"sceneCode"},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:l.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=r=>l.value.sceneCode=r),placeholder:"请输入/选择场景代码","allow-create":"",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,r=>(e.openBlock(),e.createBlock(a,{key:r,value:r,label:r},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(f,{label:"图片",prop:"image"},{default:e.withCtx(()=>[e.createVNode(p,{accept:"jpg,jpeg,png",modelValue:l.value.image,"onUpdate:modelValue":t[1]||(t[1]=r=>l.value.image=r),"list-type":"picture-card","upload-type":"banner",limit:1},null,8,["modelValue"])]),_:1}),e.createVNode(f,{label:"目标地址",prop:"targetPath"},{default:e.withCtx(()=>[e.createVNode(w,{placeholder:"请输入目标地址",modelValue:l.value.targetPath,"onUpdate:modelValue":t[2]||(t[2]=r=>l.value.targetPath=r)},null,8,["modelValue"])]),_:1}),e.createVNode(f,{label:"目标地址类型",prop:"targetPathType"},{default:e.withCtx(()=>[e.createVNode(i,{placeholder:"请选择目标地址类型",modelValue:l.value.targetPathType,"onUpdate:modelValue":t[3]||(t[3]=r=>l.value.targetPathType=r)},{default:e.withCtx(()=>[e.createVNode(a,{value:"WEB_URL",label:"Web地址"}),e.createVNode(a,{value:"PAGE_PATH",label:"页面地址"}),e.createVNode(a,{value:"API",label:"API地址"})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(f,{label:"目标地址参数",prop:"params"},{default:e.withCtx(()=>[e.createVNode(w,{type:"textarea",modelValue:l.value.params,"onUpdate:modelValue":t[4]||(t[4]=r=>l.value.params=r)},null,8,["modelValue"])]),_:1}),e.createVNode(f,{label:"生效时段",prop:"shelfTimeArr"},{default:e.withCtx(()=>[e.createVNode(y,{type:"datetimerange",modelValue:l.value.shelfTimeArr,"onUpdate:modelValue":t[5]||(t[5]=r=>l.value.shelfTimeArr=r),"start-placeholder":"上架时间","end-placeholder":"下架时间","default-time":[new Date(2e3,1,1,0,0,0),new Date(2e3,1,1,23,59,59)]},null,8,["modelValue","default-time"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["modelValue"])}}}),L={WEB_URL:{name:"Web地址"},PAGE_PATH:{name:"页面地址"},API:{name:"API地址"}},$=e.defineComponent({__name:"BannerListView",setup(b){const n=e.inject("http"),c=e.ref({sceneCode:null,status:null}),s=e.ref([]);function l(){n==null||n.get("/api/banner/all-scene-code").then(t=>{s.value=t.data})}const N=e.ref(),h=e.ref(!1);function m(){h.value=!!c.value.sceneCode,N.value.search()}function g(t){n==null||n.post(`/api/banner/${t}/publish`).then(a=>{m()})}function B(t){n==null||n.post(`/api/banner/${t}/off-shelf`).then(a=>{m()})}function x(t,a){n==null||n.post(`/api/banner/${t}/move-up`).then(i=>{c.value.sceneCode=a,m()})}function u(t,a){n==null||n.post(`/api/banner/${t}/move-down`).then(i=>{c.value.sceneCode=a,m()})}e.onBeforeMount(()=>{l()});const k=e.ref();function C(t){k.value.show(s.value,t)}return(t,a)=>{const i=e.resolveComponent("el-option"),f=e.resolveComponent("el-select"),p=e.resolveComponent("el-button"),w=e.resolveComponent("el-space"),y=e.resolveComponent("el-card"),d=e.resolveComponent("el-table-column"),T=e.resolveComponent("el-image"),P=e.resolveComponent("el-descriptions-item"),r=e.resolveComponent("el-descriptions"),H=e.resolveComponent("el-popover"),S=e.resolveComponent("el-tag"),D=e.resolveComponent("el-popconfirm"),I=e.resolveComponent("pg-table");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(f,{modelValue:c.value.sceneCode,"onUpdate:modelValue":a[0]||(a[0]=o=>c.value.sceneCode=o),placeholder:"场景代码",clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(o,V)=>(e.openBlock(),e.createBlock(i,{label:o,value:o,key:`sc_con_${V}`},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(f,{modelValue:c.value.status,"onUpdate:modelValue":a[1]||(a[1]=o=>c.value.status=o),placeholder:"状态",clearable:"",style:{width:"150px"}},{default:e.withCtx(()=>[e.createVNode(i,{label:"草稿",value:"DRAFT"}),e.createVNode(i,{label:"已发布",value:"PUBLISH"}),e.createVNode(i,{label:"已下架",value:"OFF_SHELF"})]),_:1},8,["modelValue"]),e.createVNode(p,{type:"primary",icon:"search",onClick:m},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1}),e.createVNode(p,{icon:"plus",onClick:a[2]||(a[2]=o=>C())},{default:e.withCtx(()=>[e.createTextVNode("创建Banner")]),_:1})]),_:1})]),_:1}),e.createVNode(I,{ref_key:"table",ref:N,"data-url":"/api/banner/page",onRowDbClick:C,condition:c.value,style:{"margin-top":"10px"}},{default:e.withCtx(()=>[h.value?(e.openBlock(),e.createBlock(d,{key:0,align:"center",width:"80"},{default:e.withCtx(({row:o})=>[e.createVNode(w,{direction:"vertical"},{default:e.withCtx(()=>[e.createVNode(p,{icon:"ArrowUpBold",onClick:V=>x(o.id,o.sceneCode)},null,8,["onClick"]),e.createVNode(p,{icon:"ArrowDownBold",onClick:V=>u(o.id,o.sceneCode)},null,8,["onClick"])]),_:2},1024)]),_:1})):e.createCommentVNode("",!0),e.createVNode(d,{label:"场景代码",prop:"sceneCode",width:"150"}),e.createVNode(d,{label:"图片",width:"300",align:"center"},{default:e.withCtx(({row:o})=>[e.createVNode(T,{src:o.image,style:{"max-width":"300px"},"preview-src-list":[o.image],"preview-teleported":""},null,8,["src","preview-src-list"])]),_:1}),e.createVNode(d,{label:"目标路径",prop:"targetPath","show-overflow-tooltip":""}),e.createVNode(d,{label:"目标路径类型",prop:"targetPathType",width:"120"},{default:e.withCtx(({row:o})=>[e.createTextVNode(e.toDisplayString(e.unref(L)[o.targetPathType].name),1)]),_:1}),e.createVNode(d,{label:"目标路径参数",width:"120","show-overflow-tooltip":""},{default:e.withCtx(({row:o})=>[o.params?(e.openBlock(),e.createBlock(H,{key:0,trigger:"hover",width:"300"},{reference:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.params.substring(0,100))+"... ",1)]),default:e.withCtx(()=>[o.params.startsWith("{")?(e.openBlock(),e.createBlock(r,{key:0,column:"1",border:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(JSON.parse(o.params),(V,j)=>(e.openBlock(),e.createBlock(P,{label:j,"min-width":"150"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V),1)]),_:2},1032,["label"]))),256))]),_:2},1024)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o.params),1)],64))]),_:2},1024)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(d,{label:"上架时间",prop:"shelfTime",width:"180",align:"center"}),e.createVNode(d,{label:"下架时间",prop:"offShelfTime",width:"180",align:"center"}),e.createVNode(d,{label:"状态",align:"center",width:"88"},{default:e.withCtx(({row:o})=>[o.status=="DRAFT"?(e.openBlock(),e.createBlock(S,{key:0,type:"danger"},{default:e.withCtx(()=>[e.createTextVNode("草稿")]),_:1})):e.createCommentVNode("",!0),o.status=="PUBLISH"?(e.openBlock(),e.createBlock(S,{key:1,type:"success"},{default:e.withCtx(()=>[e.createTextVNode("已发布")]),_:1})):e.createCommentVNode("",!0),o.status=="OFF_SHELF"?(e.openBlock(),e.createBlock(S,{key:2,type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("已下架")]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(d,{align:"center",width:"90"},{default:e.withCtx(({row:o})=>[["DRAFT","OFF_SHELF"].indexOf(o.status)>=0?(e.openBlock(),e.createBlock(D,{key:0,onConfirm:V=>g(o.id),title:`确定要${o.status=="DRAFT"?"发布":"上架"}该Banner吗?`},{reference:e.withCtx(()=>[e.createVNode(p,{type:"success"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.status=="DRAFT"?"发布":"上架"),1)]),_:2},1024)]),_:2},1032,["onConfirm","title"])):e.createCommentVNode("",!0),o.status=="PUBLISH"?(e.openBlock(),e.createBlock(D,{key:1,onConfirm:V=>B(o.id),title:"确定要[下架]该Banner吗?"},{reference:e.withCtx(()=>[e.createVNode(p,{type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("下架")]),_:1})]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["condition"]),e.createVNode(U,{ref_key:"bannerDialog",ref:k,onSuccess:m},null,512)],64)}}}),E={install:(b,n)=>{let c=n.router,s=c.getRoutes().find(l=>l.path=="/");s&&s.meta&&c.addRoute({path:"/terminal/banner",name:"TerminalBanner",redirect:"/terminal/banner/list",component:s.meta.commonLayout,children:[{path:"list",name:"BannerListView",component:$}]})}},A=(b,n)=>{F.forEach(c=>b.use(c)),b.use(E,n)},R={install:A};_.default=R,_.install=A,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(_,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(_=typeof globalThis<"u"?globalThis:_||self,e(_["pg-user-core"]={},_.Vue))})(this,function(_,e){"use strict";const E=[],F={WEB_URL:{name:"Web地址"},PAGE_PATH:{name:"页面地址"},API:{name:"API地址"}},U=e.defineComponent({__name:"BannerDialog",emits:["success"],setup(u,{expose:n,emit:i}){const c=e.ref(!1),a=e.ref({sceneCode:null,image:null,targetPath:null,targetPathType:null,params:null,shelfTimeArr:[]}),k=e.ref({sceneCode:[{required:!0,message:"请输入场景代码"}],image:[{required:!0,message:"请上传图片"}],targetPath:[{required:!0,message:"请输入目标地址"}],targetPathType:[{required:!0,message:"请选择目标地址类型"}]}),h=e.ref(!1),m=e.inject("http"),N=e.ref();function x(){var C;(C=N.value)==null||C.validate(t=>{if(t){h.value=!0;let o=`/api/banner/${V.value??""}/${V.value?"update":"create"}`,s={...a.value};a.value.shelfTimeArr.length&&(s.shelfTime=a.value.shelfTimeArr[0],s.offShelfTime=a.value.shelfTimeArr[1]),m==null||m.post(o,s).then(f=>{var p;i("success"),(p=N.value)==null||p.resetFields(),c.value=!1}).finally(()=>{h.value=!1})}})}const w=e.ref([]),V=e.ref(null);function B(C,t){var o;w.value=C,V.value=null,(o=N.value)==null||o.resetFields(),t&&(V.value=t.id,Object.assign(a.value,t),a.value.shelfTimeArr=[new Date(t.shelfTime),new Date(t.offShelfTime)]),c.value=!0}return n({show:B}),(C,t)=>{const o=e.resolveComponent("el-option"),s=e.resolveComponent("el-select"),f=e.resolveComponent("el-form-item"),p=e.resolveComponent("pg-upload"),b=e.resolveComponent("el-input"),y=e.resolveComponent("el-date-picker"),d=e.resolveComponent("el-form"),T=e.resolveComponent("el-button"),P=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(P,{modelValue:c.value,"onUpdate:modelValue":t[6]||(t[6]=r=>c.value=r),width:"400"},{footer:e.withCtx(()=>[e.createVNode(T,{type:"primary",disabled:h.value,loading:h.value,onClick:x},{default:e.withCtx(()=>[e.createTextVNode("提交")]),_:1},8,["disabled","loading"])]),default:e.withCtx(()=>[e.createVNode(d,{ref_key:"form",ref:N,rules:k.value,model:a.value,"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(f,{label:"场景代码",prop:"sceneCode"},{default:e.withCtx(()=>[e.createVNode(s,{modelValue:a.value.sceneCode,"onUpdate:modelValue":t[0]||(t[0]=r=>a.value.sceneCode=r),placeholder:"请输入/选择场景代码","allow-create":"",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,r=>(e.openBlock(),e.createBlock(o,{key:r,value:r,label:r},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(f,{label:"图片",prop:"image"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{accept:"jpg,jpeg,png",modelValue:a.value.image,"onUpdate:modelValue":t[1]||(t[1]=r=>a.value.image=r),key:`img_${V.value}`,"list-type":"picture-card","upload-type":"banner",limit:1},null,8,["modelValue"]))]),_:1}),e.createVNode(f,{label:"目标地址",prop:"targetPath"},{default:e.withCtx(()=>[e.createVNode(b,{placeholder:"请输入目标地址",modelValue:a.value.targetPath,"onUpdate:modelValue":t[2]||(t[2]=r=>a.value.targetPath=r)},null,8,["modelValue"])]),_:1}),e.createVNode(f,{label:"目标地址类型",prop:"targetPathType"},{default:e.withCtx(()=>[e.createVNode(s,{placeholder:"请选择目标地址类型",modelValue:a.value.targetPathType,"onUpdate:modelValue":t[3]||(t[3]=r=>a.value.targetPathType=r)},{default:e.withCtx(()=>[e.createVNode(o,{value:"WEB_URL",label:"Web地址"}),e.createVNode(o,{value:"PAGE_PATH",label:"页面地址"}),e.createVNode(o,{value:"API",label:"API地址"})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(f,{label:"目标地址参数",prop:"params"},{default:e.withCtx(()=>[e.createVNode(b,{type:"textarea",modelValue:a.value.params,"onUpdate:modelValue":t[4]||(t[4]=r=>a.value.params=r)},null,8,["modelValue"])]),_:1}),e.createVNode(f,{label:"生效时段",prop:"shelfTimeArr"},{default:e.withCtx(()=>[e.createVNode(y,{type:"datetimerange",modelValue:a.value.shelfTimeArr,"onUpdate:modelValue":t[5]||(t[5]=r=>a.value.shelfTimeArr=r),"start-placeholder":"上架时间","end-placeholder":"下架时间","default-time":[new Date(2e3,1,1,0,0,0),new Date(2e3,1,1,23,59,59)]},null,8,["modelValue","default-time"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["modelValue"])}}}),$=e.defineComponent({__name:"BannerListView",setup(u){const n=e.inject("http"),i=e.ref({sceneCode:null,status:null}),c=e.ref([]);function a(){n==null||n.get("/api/banner/all-scene-code").then(t=>{c.value=t.data})}const k=e.ref(),h=e.ref(!1);function m(){h.value=!!i.value.sceneCode,k.value.search()}function N(t){n==null||n.post(`/api/banner/${t}/publish`).then(o=>{m()})}function x(t){n==null||n.post(`/api/banner/${t}/off-shelf`).then(o=>{m()})}function w(t,o){n==null||n.post(`/api/banner/${t}/move-up`).then(s=>{i.value.sceneCode=o,m()})}function V(t,o){n==null||n.post(`/api/banner/${t}/move-down`).then(s=>{i.value.sceneCode=o,m()})}e.onBeforeMount(()=>{a()});const B=e.ref();function C(t){B.value.show(c.value,t)}return(t,o)=>{const s=e.resolveComponent("el-option"),f=e.resolveComponent("el-select"),p=e.resolveComponent("el-button"),b=e.resolveComponent("el-space"),y=e.resolveComponent("el-card"),d=e.resolveComponent("el-table-column"),T=e.resolveComponent("el-image"),P=e.resolveComponent("el-descriptions-item"),r=e.resolveComponent("el-descriptions"),H=e.resolveComponent("el-popover"),A=e.resolveComponent("el-tag"),D=e.resolveComponent("el-popconfirm"),O=e.resolveComponent("pg-table"),I=e.resolveDirective("permission");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode(b,null,{default:e.withCtx(()=>[e.createVNode(f,{modelValue:i.value.sceneCode,"onUpdate:modelValue":o[0]||(o[0]=l=>i.value.sceneCode=l),placeholder:"场景代码",clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,g)=>(e.openBlock(),e.createBlock(s,{label:l,value:l,key:`sc_con_${g}`},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(f,{modelValue:i.value.status,"onUpdate:modelValue":o[1]||(o[1]=l=>i.value.status=l),placeholder:"状态",clearable:"",style:{width:"150px"}},{default:e.withCtx(()=>[e.createVNode(s,{label:"草稿",value:"DRAFT"}),e.createVNode(s,{label:"已发布",value:"PUBLISH"}),e.createVNode(s,{label:"已下架",value:"OFF_SHELF"})]),_:1},8,["modelValue"]),e.createVNode(p,{type:"primary",icon:"search",onClick:m},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1}),e.withDirectives((e.openBlock(),e.createBlock(p,{icon:"plus",onClick:o[2]||(o[2]=l=>C())},{default:e.withCtx(()=>[e.createTextVNode("创建Banner")]),_:1})),[[I,"CREATE_BANNER"]])]),_:1})]),_:1}),e.createVNode(O,{ref_key:"table",ref:k,"data-url":"/api/banner/page",onRowDbClick:o[3]||(o[3]=l=>t.$hasPer("UPDATE_BANNER")?C(l):null),condition:i.value,style:{"margin-top":"10px"}},{default:e.withCtx(()=>[h.value&&t.$hasPer("BANNER_SEQ_MOVE_UP_DOWN")?(e.openBlock(),e.createBlock(d,{key:0,align:"center",width:"80"},{default:e.withCtx(({row:l})=>[e.createVNode(b,{direction:"vertical"},{default:e.withCtx(()=>[e.createVNode(p,{icon:"ArrowUpBold",onClick:g=>w(l.id,l.sceneCode)},null,8,["onClick"]),e.createVNode(p,{icon:"ArrowDownBold",onClick:g=>V(l.id,l.sceneCode)},null,8,["onClick"])]),_:2},1024)]),_:1})):e.createCommentVNode("",!0),e.createVNode(d,{label:"场景代码",prop:"sceneCode",width:"150"}),e.createVNode(d,{label:"图片",width:"300",align:"center"},{default:e.withCtx(({row:l})=>[e.createVNode(T,{src:l.image,style:{"max-width":"300px"},"preview-src-list":[l.image],"preview-teleported":""},null,8,["src","preview-src-list"])]),_:1}),e.createVNode(d,{label:"目标路径",prop:"targetPath","show-overflow-tooltip":""}),e.createVNode(d,{label:"目标路径类型",prop:"targetPathType",width:"120"},{default:e.withCtx(({row:l})=>[e.createTextVNode(e.toDisplayString(e.unref(F)[l.targetPathType].name),1)]),_:1}),e.createVNode(d,{label:"目标路径参数",width:"120","show-overflow-tooltip":""},{default:e.withCtx(({row:l})=>[l.params?(e.openBlock(),e.createBlock(H,{key:0,trigger:"hover",width:"350"},{reference:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.params.substring(0,100))+e.toDisplayString(l.params.length>100?"...":""),1)]),default:e.withCtx(()=>[l.params.startsWith("{")?(e.openBlock(),e.createBlock(r,{key:0,column:"1",border:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(JSON.parse(l.params),(g,j)=>(e.openBlock(),e.createBlock(P,{label:j,"min-width":"150"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g),1)]),_:2},1032,["label"]))),256))]),_:2},1024)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.params),1)],64))]),_:2},1024)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(d,{label:"上架时间",prop:"shelfTime",width:"180",align:"center"}),e.createVNode(d,{label:"下架时间",prop:"offShelfTime",width:"180",align:"center"}),e.createVNode(d,{label:"状态",align:"center",width:"88"},{default:e.withCtx(({row:l})=>[l.status=="DRAFT"?(e.openBlock(),e.createBlock(A,{key:0,type:"danger"},{default:e.withCtx(()=>[e.createTextVNode("草稿")]),_:1})):e.createCommentVNode("",!0),l.status=="PUBLISH"?(e.openBlock(),e.createBlock(A,{key:1,type:"success"},{default:e.withCtx(()=>[e.createTextVNode("已发布")]),_:1})):e.createCommentVNode("",!0),l.status=="OFF_SHELF"?(e.openBlock(),e.createBlock(A,{key:2,type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("已下架")]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(d,{align:"center",width:"90"},{default:e.withCtx(({row:l})=>[["DRAFT","OFF_SHELF"].indexOf(l.status)>=0&&t.$hasPer("BANNER_PUBLISH")?(e.openBlock(),e.createBlock(D,{key:0,onConfirm:g=>N(l.id),title:`确定要${l.status=="DRAFT"?"发布":"上架"}该Banner吗?`},{reference:e.withCtx(()=>[e.createVNode(p,{type:"success"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.status=="DRAFT"?"发布":"上架"),1)]),_:2},1024)]),_:2},1032,["onConfirm","title"])):e.createCommentVNode("",!0),l.status=="PUBLISH"&&t.$hasPer("BANNER_OFF_SHELF")?(e.openBlock(),e.createBlock(D,{key:1,onConfirm:g=>x(l.id),title:"确定要[下架]该Banner吗?"},{reference:e.withCtx(()=>[e.createVNode(p,{type:"warning"},{default:e.withCtx(()=>[e.createTextVNode("下架")]),_:1})]),_:2},1032,["onConfirm"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["condition"]),e.createVNode(U,{ref_key:"bannerDialog",ref:B,onSuccess:m},null,512)],64)}}}),R={install:(u,n)=>{let i=n.router,c=i.getRoutes().find(a=>a.path=="/");c&&c.meta&&i.addRoute({path:"/terminal/banner",name:"TerminalBanner",redirect:"/terminal/banner/list",component:c.meta.commonLayout,children:[{path:"list",name:"BannerListView",component:$}]})}},S=(u,n)=>{E.forEach(i=>u.use(i)),u.use(R,n)},L={install:S};_.default=L,_.install=S,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -16,6 +16,17 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
16
16
|
moveDown: (id: number, sceneCode: string) => void;
|
|
17
17
|
bannerDialog: import("vue").Ref<any>;
|
|
18
18
|
showBannerDialog: (banner?: any) => void;
|
|
19
|
+
readonly bannerTargetPathType: {
|
|
20
|
+
WEB_URL: {
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
PAGE_PATH: {
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
API: {
|
|
27
|
+
name: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
19
30
|
BannerDialog: import("vue").DefineComponent<{}, {
|
|
20
31
|
emits: (event: "success", ...args: any[]) => void;
|
|
21
32
|
showState: import("vue").Ref<boolean>;
|
|
@@ -374,21 +385,10 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
374
385
|
}> & {} & import("vue").ComponentCustomProperties & {}) | undefined>;
|
|
375
386
|
submit: () => void;
|
|
376
387
|
allSceneCodes: import("vue").Ref<string[]>;
|
|
377
|
-
bannerId: number | null
|
|
388
|
+
bannerId: import("vue").Ref<number | null>;
|
|
378
389
|
show: (allSceneCodesParam: string[], banner?: any) => void;
|
|
379
390
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "success"[], "success", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
380
391
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
381
392
|
}, {}>;
|
|
382
|
-
readonly bannerTargetPathType: {
|
|
383
|
-
WEB_URL: {
|
|
384
|
-
name: string;
|
|
385
|
-
};
|
|
386
|
-
PAGE_PATH: {
|
|
387
|
-
name: string;
|
|
388
|
-
};
|
|
389
|
-
API: {
|
|
390
|
-
name: string;
|
|
391
|
-
};
|
|
392
|
-
};
|
|
393
393
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
394
394
|
export default _sfc_main;
|
|
@@ -357,7 +357,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
357
357
|
}> & {} & import("vue").ComponentCustomProperties & {}) | undefined>;
|
|
358
358
|
submit: () => void;
|
|
359
359
|
allSceneCodes: import("vue").Ref<string[]>;
|
|
360
|
-
bannerId: number | null
|
|
360
|
+
bannerId: import("vue").Ref<number | null>;
|
|
361
361
|
show: (allSceneCodesParam: string[], banner?: any) => void;
|
|
362
362
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "success"[], "success", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
363
363
|
onSuccess?: ((...args: any[]) => any) | undefined;
|