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