@andrey4emk/npm-app-front-b24 0.1.10 → 0.1.11
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/dist/npm-app-front-b24.es.js +139 -145
- package/dist/npm-app-front-b24.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
2
|
-
const N = (l,
|
|
3
|
-
const
|
|
4
|
-
for (const [
|
|
5
|
-
|
|
6
|
-
return
|
|
1
|
+
import { createElementBlock as i, openBlock as o, createElementVNode as t, createCommentVNode as f, withDirectives as A, vModelCheckbox as g, createTextVNode as p, toDisplayString as d, Fragment as D, renderList as T, normalizeClass as S } from "vue";
|
|
2
|
+
const N = (l, e) => {
|
|
3
|
+
const c = l.__vccOpts || l;
|
|
4
|
+
for (const [h, r] of e)
|
|
5
|
+
c[h] = r;
|
|
6
|
+
return c;
|
|
7
7
|
}, m = {
|
|
8
8
|
name: "Subscriptions",
|
|
9
9
|
// props: {
|
|
@@ -26,7 +26,7 @@ const N = (l, t) => {
|
|
|
26
26
|
computed: {},
|
|
27
27
|
methods: {
|
|
28
28
|
pause(l) {
|
|
29
|
-
return new Promise((
|
|
29
|
+
return new Promise((e) => setTimeout(e, l));
|
|
30
30
|
},
|
|
31
31
|
async eventsList() {
|
|
32
32
|
console.log("Запускаем eventsList");
|
|
@@ -48,8 +48,8 @@ const N = (l, t) => {
|
|
|
48
48
|
// auth_type: "138",
|
|
49
49
|
auth_connector: this.auth_connector
|
|
50
50
|
}), console.log(`Подписались на событие ${l}.`);
|
|
51
|
-
} catch (
|
|
52
|
-
console.error("Ошибка при подписке на события:",
|
|
51
|
+
} catch (e) {
|
|
52
|
+
console.error("Ошибка при подписке на события:", e);
|
|
53
53
|
}
|
|
54
54
|
await this.pause(1e3), await this.getSubscribedEvents();
|
|
55
55
|
},
|
|
@@ -68,12 +68,12 @@ const N = (l, t) => {
|
|
|
68
68
|
event_type: l.offline == 1 ? "offline" : "online",
|
|
69
69
|
auth_connector: l.connector_id
|
|
70
70
|
}), await this.pause(1e3), await this.getSubscribedEvents();
|
|
71
|
-
} catch (
|
|
72
|
-
console.error("Ошибка при отписке от событий:",
|
|
71
|
+
} catch (e) {
|
|
72
|
+
console.error("Ошибка при отписке от событий:", e);
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
async loadOfflineEntitiesList() {
|
|
76
|
-
let
|
|
76
|
+
let e = await $b24.callListMethod(
|
|
77
77
|
"event.offline.list",
|
|
78
78
|
{
|
|
79
79
|
start: 0,
|
|
@@ -85,28 +85,28 @@ const N = (l, t) => {
|
|
|
85
85
|
// },
|
|
86
86
|
// "units"
|
|
87
87
|
);
|
|
88
|
-
this.entities.list =
|
|
88
|
+
this.entities.list = e.getData(), this.entities.total = e.getData().length;
|
|
89
89
|
},
|
|
90
90
|
async deleteOfflineEntities(l) {
|
|
91
|
-
let
|
|
91
|
+
let e = await $b24.callMethod("event.offline.clear", {
|
|
92
92
|
process_id: l.PROCESS_ID,
|
|
93
93
|
id: [l.ID],
|
|
94
94
|
auth_connector: this.auth_connector
|
|
95
95
|
});
|
|
96
|
-
console.log("Удалили сущности из оффлан событий:",
|
|
96
|
+
console.log("Удалили сущности из оффлан событий:", e.getData()), await this.pause(1e3), await this.loadOfflineEntitiesList();
|
|
97
97
|
},
|
|
98
98
|
async deleteOfflineEntitiesAll() {
|
|
99
99
|
if (!confirm("Вы уверены, что хотите удалить все НЕ обработанные сущности? Это действие необратимо!"))
|
|
100
100
|
return;
|
|
101
101
|
let l = this.entities.total / 50 + 1;
|
|
102
102
|
console.log("Всего страниц для удаления:", l);
|
|
103
|
-
for (let
|
|
104
|
-
let
|
|
103
|
+
for (let c = 1; c <= l; c++) {
|
|
104
|
+
let r = (await $b24.callMethod("event.offline.list", {
|
|
105
105
|
start: 0
|
|
106
106
|
})).getData().result.map((u) => u.PROCESS_ID).filter((u) => u);
|
|
107
|
-
console.log("PROCESS_ID для удаления:",
|
|
107
|
+
console.log("PROCESS_ID для удаления:", r);
|
|
108
108
|
let n = {};
|
|
109
|
-
|
|
109
|
+
r.forEach((u, b) => {
|
|
110
110
|
n[`clear_${b}`] = {
|
|
111
111
|
method: "event.offline.clear",
|
|
112
112
|
params: {
|
|
@@ -117,13 +117,13 @@ const N = (l, t) => {
|
|
|
117
117
|
let s = await $b24.callBatch(n);
|
|
118
118
|
console.log("Результат batch удаления сущностей:", s.getData());
|
|
119
119
|
}
|
|
120
|
-
let
|
|
120
|
+
let e = await $b24.callMethod("event.offline.clear", {
|
|
121
121
|
process_id: ""
|
|
122
122
|
});
|
|
123
|
-
console.log("Результат финального удаления сущностей с пустым PROCESS_ID:",
|
|
123
|
+
console.log("Результат финального удаления сущностей с пустым PROCESS_ID:", e.getData()), await this.pause(500), await this.loadOfflineEntitiesList();
|
|
124
124
|
},
|
|
125
125
|
isSubscribed(l) {
|
|
126
|
-
return this.subscribedEvents.some((
|
|
126
|
+
return this.subscribedEvents.some((e) => e.event == l);
|
|
127
127
|
},
|
|
128
128
|
autoRefreshEntities() {
|
|
129
129
|
this.autoRefresh && setTimeout(async () => {
|
|
@@ -131,64 +131,58 @@ const N = (l, t) => {
|
|
|
131
131
|
}, 3e3);
|
|
132
132
|
},
|
|
133
133
|
async entityUpdate(l) {
|
|
134
|
-
var
|
|
135
|
-
let
|
|
136
|
-
console.log("Запущена функция entityUpdate для изменения сущности с ID:", (
|
|
134
|
+
var c, h, r, n, s, u, b;
|
|
135
|
+
let e = !1;
|
|
136
|
+
console.log("Запущена функция entityUpdate для изменения сущности с ID:", (c = l.EVENT_DATA.FIELDS) == null ? void 0 : c.ID);
|
|
137
137
|
try {
|
|
138
|
-
if ((
|
|
139
|
-
let
|
|
138
|
+
if ((h = l.EVENT_DATA.FIELDS) != null && h.ENTITY_TYPE_ID && ((r = l.EVENT_DATA.FIELDS) == null ? void 0 : r.ENTITY_TYPE_ID) > 0) {
|
|
139
|
+
let a = await $b24.callMethod("crm.item.get", {
|
|
140
140
|
entityTypeId: l.EVENT_DATA.FIELDS.ENTITY_TYPE_ID,
|
|
141
141
|
id: l.EVENT_DATA.FIELDS.ID
|
|
142
142
|
});
|
|
143
|
-
if (
|
|
144
|
-
let
|
|
143
|
+
if (a = a.getData().result.item, console.log("Данные смарт процесса до изменения:", a), a.id == ((n = l.EVENT_DATA.FIELDS) == null ? void 0 : n.ID)) {
|
|
144
|
+
let E = await $b24.callMethod("crm.item.update", {
|
|
145
145
|
entityTypeId: l.EVENT_DATA.FIELDS.ENTITY_TYPE_ID,
|
|
146
146
|
id: l.EVENT_DATA.FIELDS.ID,
|
|
147
147
|
fields: {
|
|
148
|
-
title:
|
|
149
|
-
}
|
|
150
|
-
}), h = await $b24.callMethod("crm.item.update", {
|
|
151
|
-
entityTypeId: l.EVENT_DATA.FIELDS.ENTITY_TYPE_ID,
|
|
152
|
-
id: l.EVENT_DATA.FIELDS.ID,
|
|
153
|
-
fields: {
|
|
154
|
-
title: i.title
|
|
148
|
+
title: a.title + "123"
|
|
155
149
|
}
|
|
156
150
|
});
|
|
157
|
-
console.log("Результат обновления смарт процесса:",
|
|
151
|
+
console.log("Результат обновления смарт процесса:", E.getData());
|
|
158
152
|
} else
|
|
159
|
-
|
|
153
|
+
e = !0;
|
|
160
154
|
} else {
|
|
161
|
-
let
|
|
155
|
+
let a = await $b24.callMethod("crm.deal.get", {
|
|
162
156
|
id: (s = l.EVENT_DATA.FIELDS) == null ? void 0 : s.ID
|
|
163
157
|
});
|
|
164
|
-
if (
|
|
165
|
-
let
|
|
158
|
+
if (a = a.getData().result, console.log("Данные сделки до изменения:", a), a.ID == ((u = l.EVENT_DATA.FIELDS) == null ? void 0 : u.ID)) {
|
|
159
|
+
let E = await $b24.callMethod("crm.deal.update", {
|
|
166
160
|
id: (b = l.EVENT_DATA.FIELDS) == null ? void 0 : b.ID,
|
|
167
161
|
fields: {
|
|
168
|
-
TITLE:
|
|
162
|
+
TITLE: a.TITLE
|
|
169
163
|
}
|
|
170
164
|
});
|
|
171
|
-
console.log("Результат обновления сделки:",
|
|
165
|
+
console.log("Результат обновления сделки:", E.getData()), E = E.getData().result, E === !0 ? console.log("Сущность успешно обновлена.") : (console.error("Ошибка при обновлении сущности."), e = !0);
|
|
172
166
|
} else
|
|
173
|
-
|
|
167
|
+
e = !0;
|
|
174
168
|
}
|
|
175
|
-
} catch (
|
|
176
|
-
console.error("Ошибка при обновлении сущности:",
|
|
169
|
+
} catch (a) {
|
|
170
|
+
console.error("Ошибка при обновлении сущности:", a), a = !0;
|
|
177
171
|
}
|
|
178
|
-
|
|
172
|
+
e || await this.deleteOfflineEntities(l);
|
|
179
173
|
}
|
|
180
174
|
},
|
|
181
175
|
watch: {},
|
|
182
176
|
mounted() {
|
|
183
177
|
this.getSubscribedEvents(), this.eventsList(), this.loadOfflineEntitiesList(), this.autoRefreshEntities();
|
|
184
178
|
}
|
|
185
|
-
},
|
|
179
|
+
}, v = { class: "Subscriptions" }, k = { key: 0 }, L = ["disabled"], C = {
|
|
186
180
|
class: "switch tooltipParent",
|
|
187
181
|
style: { top: "12px" }
|
|
188
|
-
},
|
|
182
|
+
}, w = { key: 0 }, V = {
|
|
189
183
|
key: 0,
|
|
190
184
|
class: "main"
|
|
191
|
-
}, O = ["onClick"],
|
|
185
|
+
}, O = ["onClick"], M = ["onClick"], R = ["href"], y = {
|
|
192
186
|
class: "tooltipParent",
|
|
193
187
|
style: {}
|
|
194
188
|
}, P = { class: "tooltip" }, F = { key: 1 }, Y = { key: 1 }, U = {
|
|
@@ -198,139 +192,139 @@ const N = (l, t) => {
|
|
|
198
192
|
key: 0,
|
|
199
193
|
class: "main"
|
|
200
194
|
}, z = ["onClick", "disabled"], j = { key: 1 }, q = { key: 2 };
|
|
201
|
-
function G(l,
|
|
202
|
-
return
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
onClick:
|
|
195
|
+
function G(l, e, c, h, r, n) {
|
|
196
|
+
return o(), i("div", v, [
|
|
197
|
+
e[14] || (e[14] = t("h1", null, "Страница подписок", -1)),
|
|
198
|
+
t("button", {
|
|
199
|
+
onClick: e[0] || (e[0] = (s) => l.selectTab("tab1"))
|
|
206
200
|
}, "Сущности"),
|
|
207
|
-
|
|
208
|
-
onClick:
|
|
201
|
+
t("button", {
|
|
202
|
+
onClick: e[1] || (e[1] = (s) => l.selectTab("tab2"))
|
|
209
203
|
}, "События"),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
l.tabs.tab1 ? (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
onClick:
|
|
204
|
+
e[15] || (e[15] = t("br", null, null, -1)),
|
|
205
|
+
e[16] || (e[16] = t("br", null, null, -1)),
|
|
206
|
+
e[17] || (e[17] = t("br", null, null, -1)),
|
|
207
|
+
l.tabs.tab1 ? (o(), i("div", k, [
|
|
208
|
+
t("div", null, [
|
|
209
|
+
t("button", {
|
|
210
|
+
onClick: e[2] || (e[2] = (...s) => n.loadOfflineEntitiesList && n.loadOfflineEntitiesList(...s)),
|
|
217
211
|
disabled: l.loading
|
|
218
|
-
}, "Обновить", 8,
|
|
219
|
-
|
|
220
|
-
A(
|
|
212
|
+
}, "Обновить", 8, L),
|
|
213
|
+
t("label", C, [
|
|
214
|
+
A(t("input", {
|
|
221
215
|
type: "checkbox",
|
|
222
|
-
"onUpdate:modelValue":
|
|
223
|
-
onChange:
|
|
216
|
+
"onUpdate:modelValue": e[3] || (e[3] = (s) => r.autoRefresh = s),
|
|
217
|
+
onChange: e[4] || (e[4] = (...s) => n.autoRefreshEntities && n.autoRefreshEntities(...s))
|
|
224
218
|
}, null, 544), [
|
|
225
|
-
[g,
|
|
219
|
+
[g, r.autoRefresh]
|
|
226
220
|
]),
|
|
227
|
-
|
|
228
|
-
|
|
221
|
+
e[6] || (e[6] = t("span", { class: "slider" }, null, -1)),
|
|
222
|
+
e[7] || (e[7] = t("span", { class: "tooltip" }, "Автообновление каждые 3 секунды", -1))
|
|
229
223
|
])
|
|
230
224
|
]),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
onClick:
|
|
225
|
+
r.entities.list.length > 0 ? (o(), i("div", w, [
|
|
226
|
+
t("p", null, [
|
|
227
|
+
t("button", {
|
|
228
|
+
onClick: e[5] || (e[5] = (...s) => n.deleteOfflineEntitiesAll && n.deleteOfflineEntitiesAll(...s))
|
|
235
229
|
}, "Удалить все"),
|
|
236
|
-
p(" Всего измененных сущностей " + d(
|
|
230
|
+
p(" Всего измененных сущностей " + d(r.entities.total), 1)
|
|
237
231
|
]),
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
232
|
+
r.entities.list.length ? (o(), i("table", V, [
|
|
233
|
+
e[9] || (e[9] = t("thead", null, [
|
|
234
|
+
t("tr", null, [
|
|
235
|
+
t("th", null, "#"),
|
|
236
|
+
t("th", null, "Удалить"),
|
|
237
|
+
t("th", null, "Обновить"),
|
|
238
|
+
t("th", null, "PROCESS_ID"),
|
|
239
|
+
t("th", null, "EVENT_NAME"),
|
|
240
|
+
t("th", null, "Ссылка"),
|
|
241
|
+
t("th", null, "EVENT_DATA"),
|
|
242
|
+
t("th", null, "who_update"),
|
|
243
|
+
t("th", null, "entity")
|
|
250
244
|
])
|
|
251
245
|
], -1)),
|
|
252
|
-
|
|
253
|
-
(
|
|
254
|
-
var b,
|
|
255
|
-
return
|
|
246
|
+
t("tbody", null, [
|
|
247
|
+
(o(!0), i(D, null, T(r.entities.list, (s, u) => {
|
|
248
|
+
var b, a, E, _;
|
|
249
|
+
return o(), i("tr", {
|
|
256
250
|
key: s.PROCESS_ID + "-" + s.ID
|
|
257
251
|
}, [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
252
|
+
t("td", null, d(u + 1), 1),
|
|
253
|
+
t("td", null, [
|
|
254
|
+
t("button", {
|
|
261
255
|
onClick: (I) => n.deleteOfflineEntities(s)
|
|
262
256
|
}, "Удалить", 8, O)
|
|
263
257
|
]),
|
|
264
|
-
|
|
265
|
-
(b = s.EVENT_DATA.FIELDS) != null && b.ID && (s.EVENT_NAME == "ONCRMDEALUPDATE" || s.EVENT_NAME.includes("ONCRMDYNAMICITEMUPDATE_")) ? (
|
|
258
|
+
t("td", null, [
|
|
259
|
+
(b = s.EVENT_DATA.FIELDS) != null && b.ID && (s.EVENT_NAME == "ONCRMDEALUPDATE" || s.EVENT_NAME.includes("ONCRMDYNAMICITEMUPDATE_")) ? (o(), i("button", {
|
|
266
260
|
key: 0,
|
|
267
261
|
onClick: (I) => n.entityUpdate(s)
|
|
268
|
-
}, "Изменить", 8,
|
|
262
|
+
}, "Изменить", 8, M)) : f("", !0)
|
|
269
263
|
]),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
(
|
|
264
|
+
t("td", null, d(s.PROCESS_ID), 1),
|
|
265
|
+
t("td", null, d(s.EVENT_NAME), 1),
|
|
266
|
+
t("td", null, [
|
|
267
|
+
(a = s.EVENT_DATA.FIELDS) != null && a.ID && s.EVENT_NAME == "ONCRMDEALUPDATE" ? (o(), i("a", {
|
|
274
268
|
key: 0,
|
|
275
|
-
href: "https://repacheb.bitrix24.ru/crm/deal/details/" + ((
|
|
269
|
+
href: "https://repacheb.bitrix24.ru/crm/deal/details/" + ((E = s.EVENT_DATA.FIELDS) == null ? void 0 : E.ID) + "/",
|
|
276
270
|
target: "_blank",
|
|
277
271
|
rel: "noopener noreferrer"
|
|
278
|
-
}, d((
|
|
272
|
+
}, d((_ = s.EVENT_DATA.FIELDS) == null ? void 0 : _.ID), 9, R)) : f("", !0)
|
|
279
273
|
]),
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
274
|
+
t("td", null, d(s.EVENT_DATA), 1),
|
|
275
|
+
t("td", null, d(s.EVENT_ADDITIONAL.user_id), 1),
|
|
276
|
+
t("td", y, [
|
|
277
|
+
e[8] || (e[8] = t("span", null, "Подробней", -1)),
|
|
278
|
+
t("span", P, d(s), 1)
|
|
285
279
|
])
|
|
286
280
|
]);
|
|
287
281
|
}), 128))
|
|
288
282
|
])
|
|
289
283
|
])) : f("", !0)
|
|
290
|
-
])) : (
|
|
284
|
+
])) : (o(), i("div", F, "Список сущностей пуст."))
|
|
291
285
|
])) : f("", !0),
|
|
292
|
-
l.tabs.tab2 ? (
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
286
|
+
l.tabs.tab2 ? (o(), i("div", Y, [
|
|
287
|
+
t("div", null, [
|
|
288
|
+
e[11] || (e[11] = t("h3", null, "Подписаны на события:", -1)),
|
|
289
|
+
r.subscribedEvents.length ? (o(), i("table", U, [
|
|
290
|
+
e[10] || (e[10] = t("thead", null, [
|
|
291
|
+
t("tr", null, [
|
|
292
|
+
t("th", null, "Событие"),
|
|
293
|
+
t("th", null, "connector_id"),
|
|
294
|
+
t("th", null, "offline"),
|
|
295
|
+
t("th", null, "Отписаться")
|
|
302
296
|
])
|
|
303
297
|
], -1)),
|
|
304
|
-
|
|
305
|
-
(
|
|
298
|
+
t("tbody", null, [
|
|
299
|
+
(o(!0), i(D, null, T(r.subscribedEvents, (s) => (o(), i("tr", {
|
|
306
300
|
key: s.id
|
|
307
301
|
}, [
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
302
|
+
t("td", null, d(s.event), 1),
|
|
303
|
+
t("td", null, d(s.connector_id), 1),
|
|
304
|
+
t("td", null, d(s.offline), 1),
|
|
305
|
+
t("td", null, [
|
|
306
|
+
t("button", {
|
|
313
307
|
onClick: (u) => n.unbindSubscribedEvents(s)
|
|
314
308
|
}, "Отписаться от событий", 8, $)
|
|
315
309
|
])
|
|
316
310
|
]))), 128))
|
|
317
311
|
])
|
|
318
|
-
])) : (
|
|
312
|
+
])) : (o(), i("p", x, "Подписок на события нет."))
|
|
319
313
|
]),
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
314
|
+
t("div", null, [
|
|
315
|
+
e[13] || (e[13] = t("h3", null, "На какие события можно подписаться:", -1)),
|
|
316
|
+
r.events.length ? (o(), i("table", B, [
|
|
317
|
+
e[12] || (e[12] = t("thead", null, [
|
|
318
|
+
t("tr", null, [
|
|
319
|
+
t("th", null, "Событие"),
|
|
320
|
+
t("th", null, "Подписаться")
|
|
327
321
|
])
|
|
328
322
|
], -1)),
|
|
329
|
-
|
|
330
|
-
(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
323
|
+
t("tbody", null, [
|
|
324
|
+
(o(!0), i(D, null, T(r.events, (s) => (o(), i("tr", { key: s }, [
|
|
325
|
+
t("td", null, d(s), 1),
|
|
326
|
+
t("td", null, [
|
|
327
|
+
t("button", {
|
|
334
328
|
onClick: (u) => n.subscribeToEvents(s),
|
|
335
329
|
disabled: n.isSubscribed(s),
|
|
336
330
|
class: S({ "disabled-button": n.isSubscribed(s) })
|
|
@@ -338,15 +332,15 @@ function G(l, t, E, D, a, n) {
|
|
|
338
332
|
])
|
|
339
333
|
]))), 128))
|
|
340
334
|
])
|
|
341
|
-
])) : (
|
|
335
|
+
])) : (o(), i("p", j, "Список событий пуст."))
|
|
342
336
|
])
|
|
343
337
|
])) : f("", !0),
|
|
344
|
-
l.tabs.tab3 ? (
|
|
338
|
+
l.tabs.tab3 ? (o(), i("div", q)) : f("", !0)
|
|
345
339
|
]);
|
|
346
340
|
}
|
|
347
341
|
const H = /* @__PURE__ */ N(m, [["render", G]]), K = {
|
|
348
|
-
install(l,
|
|
349
|
-
l.component("Subscriptions", H),
|
|
342
|
+
install(l, e = {}) {
|
|
343
|
+
l.component("Subscriptions", H), e.b24 && (l.config.globalProperties.$b24 = e.b24);
|
|
350
344
|
}
|
|
351
345
|
};
|
|
352
346
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.NpmAppFrontB24={},d.Vue))})(this,function(d,e){"use strict";const D=(l,t)=>{const a=l.__vccOpts||l;for(const[N,r]of t)a[N]=r;return a},V={name:"Subscriptions",data(){return{events:[],subscribedEvents:[],entities:{list:[],total:0},autoRefresh:!0,auth_connector:""}},computed:{},methods:{pause(l){return new Promise(t=>setTimeout(t,l))},async eventsList(){console.log("Запускаем eventsList");try{let l=await $b24.callMethod("events",{});this.events=l.getData().result}catch(l){console.error("Ошибка при получении списка событий:",l)}},async subscribeToEvents(l){try{await $b24.callMethod("event.bind",{event:l,event_type:"offline",auth_connector:this.auth_connector}),console.log(`Подписались на событие ${l}.`)}catch(t){console.error("Ошибка при подписке на события:",t)}await this.pause(1e3),await this.getSubscribedEvents()},async getSubscribedEvents(){try{let l=await $b24.callMethod("event.get",{});this.subscribedEvents=l.getData().result,console.log("Подписанные события:",this.subscribedEvents)}catch(l){console.error("Ошибка при получении подписанных событий:",l)}},async unbindSubscribedEvents(l){try{await $b24.callMethod("event.unbind",{event:l.event,event_type:l.offline==1?"offline":"online",auth_connector:l.connector_id}),await this.pause(1e3),await this.getSubscribedEvents()}catch(t){console.error("Ошибка при отписке от событий:",t)}},async loadOfflineEntitiesList(){let t=await $b24.callListMethod("event.offline.list",{start:0,auth_connector:this.auth_connector});this.entities.list=t.getData(),this.entities.total=t.getData().length},async deleteOfflineEntities(l){let t=await $b24.callMethod("event.offline.clear",{process_id:l.PROCESS_ID,id:[l.ID],auth_connector:this.auth_connector});console.log("Удалили сущности из оффлан событий:",t.getData()),await this.pause(1e3),await this.loadOfflineEntitiesList()},async deleteOfflineEntitiesAll(){if(!confirm("Вы уверены, что хотите удалить все НЕ обработанные сущности? Это действие необратимо!"))return;let l=this.entities.total/50+1;console.log("Всего страниц для удаления:",l);for(let a=1;a<=l;a++){let r=(await $b24.callMethod("event.offline.list",{start:0})).getData().result.map(i=>i.PROCESS_ID).filter(i=>i);console.log("PROCESS_ID для удаления:",r);let n={};r.forEach((i,E)=>{n[`clear_${E}`]={method:"event.offline.clear",params:{process_id:i}}}),console.log("batchCommands:",n);let o=await $b24.callBatch(n);console.log("Результат batch удаления сущностей:",o.getData())}let t=await $b24.callMethod("event.offline.clear",{process_id:""});console.log("Результат финального удаления сущностей с пустым PROCESS_ID:",t.getData()),await this.pause(500),await this.loadOfflineEntitiesList()},isSubscribed(l){return this.subscribedEvents.some(t=>t.event==l)},autoRefreshEntities(){this.autoRefresh&&setTimeout(async()=>{await this.loadOfflineEntitiesList(),this.autoRefreshEntities()},3e3)},async entityUpdate(l){var a,N,r,n,o,i,E;let t=!1;console.log("Запущена функция entityUpdate для изменения сущности с ID:",(a=l.EVENT_DATA.FIELDS)==null?void 0:a.ID);try{if((N=l.EVENT_DATA.FIELDS)!=null&&N.ENTITY_TYPE_ID&&((r=l.EVENT_DATA.FIELDS)==null?void 0:r.ENTITY_TYPE_ID)>0){let s=await $b24.callMethod("crm.item.get",{entityTypeId:l.EVENT_DATA.FIELDS.ENTITY_TYPE_ID,id:l.EVENT_DATA.FIELDS.ID});if(s=s.getData().result.item,console.log("Данные смарт процесса до изменения:",s),s.id==((n=l.EVENT_DATA.FIELDS)==null?void 0:n.ID)){let c=await $b24.callMethod("crm.item.update",{entityTypeId:l.EVENT_DATA.FIELDS.ENTITY_TYPE_ID,id:l.EVENT_DATA.FIELDS.ID,fields:{title:s.title+" "}}),m=await $b24.callMethod("crm.item.update",{entityTypeId:l.EVENT_DATA.FIELDS.ENTITY_TYPE_ID,id:l.EVENT_DATA.FIELDS.ID,fields:{title:s.title}});console.log("Результат обновления смарт процесса:",c.getData()),m=m.getData().result.item,console.log("updateResult:",m),m.id===s.id?(console.log("Сущность успешно обновлена."),t=!0):(console.error("Ошибка при обновлении сущности."),t=!0)}else t=!0}else{let s=await $b24.callMethod("crm.deal.get",{id:(o=l.EVENT_DATA.FIELDS)==null?void 0:o.ID});if(s=s.getData().result,console.log("Данные сделки до изменения:",s),s.ID==((i=l.EVENT_DATA.FIELDS)==null?void 0:i.ID)){let c=await $b24.callMethod("crm.deal.update",{id:(E=l.EVENT_DATA.FIELDS)==null?void 0:E.ID,fields:{TITLE:s.TITLE}});console.log("Результат обновления сделки:",c.getData()),c=c.getData().result,c===!0?console.log("Сущность успешно обновлена."):(console.error("Ошибка при обновлении сущности."),t=!0)}else t=!0}}catch(s){console.error("Ошибка при обновлении сущности:",s),s=!0}t||await this.deleteOfflineEntities(l)}},watch:{},mounted(){this.getSubscribedEvents(),this.eventsList(),this.loadOfflineEntitiesList(),this.autoRefreshEntities()}},f={class:"Subscriptions"},h={key:0},p=["disabled"],T={class:"switch tooltipParent",style:{top:"12px"}},_={key:0},k={key:0,class:"main"},g=["onClick"],u=["onClick"],I=["href"],S={class:"tooltipParent",style:{}},A={class:"tooltip"},B={key:1},y={key:1},L={key:0,class:"main"},C=["onClick"],w={key:1},M={key:0,class:"main"},O=["onClick","disabled"],R={key:1},F={key:2};function P(l,t,a,N,r,n){return e.openBlock(),e.createElementBlock("div",f,[t[14]||(t[14]=e.createElementVNode("h1",null,"Страница подписок",-1)),e.createElementVNode("button",{onClick:t[0]||(t[0]=o=>l.selectTab("tab1"))},"Сущности"),e.createElementVNode("button",{onClick:t[1]||(t[1]=o=>l.selectTab("tab2"))},"События"),t[15]||(t[15]=e.createElementVNode("br",null,null,-1)),t[16]||(t[16]=e.createElementVNode("br",null,null,-1)),t[17]||(t[17]=e.createElementVNode("br",null,null,-1)),l.tabs.tab1?(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:t[2]||(t[2]=(...o)=>n.loadOfflineEntitiesList&&n.loadOfflineEntitiesList(...o)),disabled:l.loading},"Обновить",8,p),e.createElementVNode("label",T,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=o=>r.autoRefresh=o),onChange:t[4]||(t[4]=(...o)=>n.autoRefreshEntities&&n.autoRefreshEntities(...o))},null,544),[[e.vModelCheckbox,r.autoRefresh]]),t[6]||(t[6]=e.createElementVNode("span",{class:"slider"},null,-1)),t[7]||(t[7]=e.createElementVNode("span",{class:"tooltip"},"Автообновление каждые 3 секунды",-1))])]),r.entities.list.length>0?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("p",null,[e.createElementVNode("button",{onClick:t[5]||(t[5]=(...o)=>n.deleteOfflineEntitiesAll&&n.deleteOfflineEntitiesAll(...o))},"Удалить все"),e.createTextVNode(" Всего измененных сущностей "+e.toDisplayString(r.entities.total),1)]),r.entities.list.length?(e.openBlock(),e.createElementBlock("table",k,[t[9]||(t[9]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,"#"),e.createElementVNode("th",null,"Удалить"),e.createElementVNode("th",null,"Обновить"),e.createElementVNode("th",null,"PROCESS_ID"),e.createElementVNode("th",null,"EVENT_NAME"),e.createElementVNode("th",null,"Ссылка"),e.createElementVNode("th",null,"EVENT_DATA"),e.createElementVNode("th",null,"who_update"),e.createElementVNode("th",null,"entity")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.entities.list,(o,i)=>{var E,s,c,m;return e.openBlock(),e.createElementBlock("tr",{key:o.PROCESS_ID+"-"+o.ID},[e.createElementVNode("td",null,e.toDisplayString(i+1),1),e.createElementVNode("td",null,[e.createElementVNode("button",{onClick:U=>n.deleteOfflineEntities(o)},"Удалить",8,g)]),e.createElementVNode("td",null,[(E=o.EVENT_DATA.FIELDS)!=null&&E.ID&&(o.EVENT_NAME=="ONCRMDEALUPDATE"||o.EVENT_NAME.includes("ONCRMDYNAMICITEMUPDATE_"))?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:U=>n.entityUpdate(o)},"Изменить",8,u)):e.createCommentVNode("",!0)]),e.createElementVNode("td",null,e.toDisplayString(o.PROCESS_ID),1),e.createElementVNode("td",null,e.toDisplayString(o.EVENT_NAME),1),e.createElementVNode("td",null,[(s=o.EVENT_DATA.FIELDS)!=null&&s.ID&&o.EVENT_NAME=="ONCRMDEALUPDATE"?(e.openBlock(),e.createElementBlock("a",{key:0,href:"https://repacheb.bitrix24.ru/crm/deal/details/"+((c=o.EVENT_DATA.FIELDS)==null?void 0:c.ID)+"/",target:"_blank",rel:"noopener noreferrer"},e.toDisplayString((m=o.EVENT_DATA.FIELDS)==null?void 0:m.ID),9,I)):e.createCommentVNode("",!0)]),e.createElementVNode("td",null,e.toDisplayString(o.EVENT_DATA),1),e.createElementVNode("td",null,e.toDisplayString(o.EVENT_ADDITIONAL.user_id),1),e.createElementVNode("td",S,[t[8]||(t[8]=e.createElementVNode("span",null,"Подробней",-1)),e.createElementVNode("span",A,e.toDisplayString(o),1)])])}),128))])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",B,"Список сущностей пуст."))])):e.createCommentVNode("",!0),l.tabs.tab2?(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",null,[t[11]||(t[11]=e.createElementVNode("h3",null,"Подписаны на события:",-1)),r.subscribedEvents.length?(e.openBlock(),e.createElementBlock("table",L,[t[10]||(t[10]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,"Событие"),e.createElementVNode("th",null,"connector_id"),e.createElementVNode("th",null,"offline"),e.createElementVNode("th",null,"Отписаться")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.subscribedEvents,o=>(e.openBlock(),e.createElementBlock("tr",{key:o.id},[e.createElementVNode("td",null,e.toDisplayString(o.event),1),e.createElementVNode("td",null,e.toDisplayString(o.connector_id),1),e.createElementVNode("td",null,e.toDisplayString(o.offline),1),e.createElementVNode("td",null,[e.createElementVNode("button",{onClick:i=>n.unbindSubscribedEvents(o)},"Отписаться от событий",8,C)])]))),128))])])):(e.openBlock(),e.createElementBlock("p",w,"Подписок на события нет."))]),e.createElementVNode("div",null,[t[13]||(t[13]=e.createElementVNode("h3",null,"На какие события можно подписаться:",-1)),r.events.length?(e.openBlock(),e.createElementBlock("table",M,[t[12]||(t[12]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,"Событие"),e.createElementVNode("th",null,"Подписаться")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.events,o=>(e.openBlock(),e.createElementBlock("tr",{key:o},[e.createElementVNode("td",null,e.toDisplayString(o),1),e.createElementVNode("td",null,[e.createElementVNode("button",{onClick:i=>n.subscribeToEvents(o),disabled:n.isSubscribed(o),class:e.normalizeClass({"disabled-button":n.isSubscribed(o)})},"Подписаться",10,O)])]))),128))])])):(e.openBlock(),e.createElementBlock("p",R,"Список событий пуст."))])])):e.createCommentVNode("",!0),l.tabs.tab3?(e.openBlock(),e.createElementBlock("div",F)):e.createCommentVNode("",!0)])}const b=D(V,[["render",P]]),Y={install(l,t={}){l.component("Subscriptions",b),t.b24&&(l.config.globalProperties.$b24=t.b24)}};d.Subscriptions=b,d.default=Y,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.NpmAppFrontB24={},d.Vue))})(this,function(d,e){"use strict";const V=(l,t)=>{const a=l.__vccOpts||l;for(const[m,s]of t)a[m]=s;return a},f={name:"Subscriptions",data(){return{events:[],subscribedEvents:[],entities:{list:[],total:0},autoRefresh:!0,auth_connector:""}},computed:{},methods:{pause(l){return new Promise(t=>setTimeout(t,l))},async eventsList(){console.log("Запускаем eventsList");try{let l=await $b24.callMethod("events",{});this.events=l.getData().result}catch(l){console.error("Ошибка при получении списка событий:",l)}},async subscribeToEvents(l){try{await $b24.callMethod("event.bind",{event:l,event_type:"offline",auth_connector:this.auth_connector}),console.log(`Подписались на событие ${l}.`)}catch(t){console.error("Ошибка при подписке на события:",t)}await this.pause(1e3),await this.getSubscribedEvents()},async getSubscribedEvents(){try{let l=await $b24.callMethod("event.get",{});this.subscribedEvents=l.getData().result,console.log("Подписанные события:",this.subscribedEvents)}catch(l){console.error("Ошибка при получении подписанных событий:",l)}},async unbindSubscribedEvents(l){try{await $b24.callMethod("event.unbind",{event:l.event,event_type:l.offline==1?"offline":"online",auth_connector:l.connector_id}),await this.pause(1e3),await this.getSubscribedEvents()}catch(t){console.error("Ошибка при отписке от событий:",t)}},async loadOfflineEntitiesList(){let t=await $b24.callListMethod("event.offline.list",{start:0,auth_connector:this.auth_connector});this.entities.list=t.getData(),this.entities.total=t.getData().length},async deleteOfflineEntities(l){let t=await $b24.callMethod("event.offline.clear",{process_id:l.PROCESS_ID,id:[l.ID],auth_connector:this.auth_connector});console.log("Удалили сущности из оффлан событий:",t.getData()),await this.pause(1e3),await this.loadOfflineEntitiesList()},async deleteOfflineEntitiesAll(){if(!confirm("Вы уверены, что хотите удалить все НЕ обработанные сущности? Это действие необратимо!"))return;let l=this.entities.total/50+1;console.log("Всего страниц для удаления:",l);for(let a=1;a<=l;a++){let s=(await $b24.callMethod("event.offline.list",{start:0})).getData().result.map(i=>i.PROCESS_ID).filter(i=>i);console.log("PROCESS_ID для удаления:",s);let o={};s.forEach((i,E)=>{o[`clear_${E}`]={method:"event.offline.clear",params:{process_id:i}}}),console.log("batchCommands:",o);let n=await $b24.callBatch(o);console.log("Результат batch удаления сущностей:",n.getData())}let t=await $b24.callMethod("event.offline.clear",{process_id:""});console.log("Результат финального удаления сущностей с пустым PROCESS_ID:",t.getData()),await this.pause(500),await this.loadOfflineEntitiesList()},isSubscribed(l){return this.subscribedEvents.some(t=>t.event==l)},autoRefreshEntities(){this.autoRefresh&&setTimeout(async()=>{await this.loadOfflineEntitiesList(),this.autoRefreshEntities()},3e3)},async entityUpdate(l){var a,m,s,o,n,i,E;let t=!1;console.log("Запущена функция entityUpdate для изменения сущности с ID:",(a=l.EVENT_DATA.FIELDS)==null?void 0:a.ID);try{if((m=l.EVENT_DATA.FIELDS)!=null&&m.ENTITY_TYPE_ID&&((s=l.EVENT_DATA.FIELDS)==null?void 0:s.ENTITY_TYPE_ID)>0){let r=await $b24.callMethod("crm.item.get",{entityTypeId:l.EVENT_DATA.FIELDS.ENTITY_TYPE_ID,id:l.EVENT_DATA.FIELDS.ID});if(r=r.getData().result.item,console.log("Данные смарт процесса до изменения:",r),r.id==((o=l.EVENT_DATA.FIELDS)==null?void 0:o.ID)){let c=await $b24.callMethod("crm.item.update",{entityTypeId:l.EVENT_DATA.FIELDS.ENTITY_TYPE_ID,id:l.EVENT_DATA.FIELDS.ID,fields:{title:r.title+"123"}});console.log("Результат обновления смарт процесса:",c.getData())}else t=!0}else{let r=await $b24.callMethod("crm.deal.get",{id:(n=l.EVENT_DATA.FIELDS)==null?void 0:n.ID});if(r=r.getData().result,console.log("Данные сделки до изменения:",r),r.ID==((i=l.EVENT_DATA.FIELDS)==null?void 0:i.ID)){let c=await $b24.callMethod("crm.deal.update",{id:(E=l.EVENT_DATA.FIELDS)==null?void 0:E.ID,fields:{TITLE:r.TITLE}});console.log("Результат обновления сделки:",c.getData()),c=c.getData().result,c===!0?console.log("Сущность успешно обновлена."):(console.error("Ошибка при обновлении сущности."),t=!0)}else t=!0}}catch(r){console.error("Ошибка при обновлении сущности:",r),r=!0}t||await this.deleteOfflineEntities(l)}},watch:{},mounted(){this.getSubscribedEvents(),this.eventsList(),this.loadOfflineEntitiesList(),this.autoRefreshEntities()}},h={class:"Subscriptions"},D={key:0},p=["disabled"],T={class:"switch tooltipParent",style:{top:"12px"}},k={key:0},_={key:0,class:"main"},g=["onClick"],u=["onClick"],S=["href"],A={class:"tooltipParent",style:{}},I={class:"tooltip"},B={key:1},y={key:1},C={key:0,class:"main"},L=["onClick"],w={key:1},O={key:0,class:"main"},M=["onClick","disabled"],R={key:1},F={key:2};function P(l,t,a,m,s,o){return e.openBlock(),e.createElementBlock("div",h,[t[14]||(t[14]=e.createElementVNode("h1",null,"Страница подписок",-1)),e.createElementVNode("button",{onClick:t[0]||(t[0]=n=>l.selectTab("tab1"))},"Сущности"),e.createElementVNode("button",{onClick:t[1]||(t[1]=n=>l.selectTab("tab2"))},"События"),t[15]||(t[15]=e.createElementVNode("br",null,null,-1)),t[16]||(t[16]=e.createElementVNode("br",null,null,-1)),t[17]||(t[17]=e.createElementVNode("br",null,null,-1)),l.tabs.tab1?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:t[2]||(t[2]=(...n)=>o.loadOfflineEntitiesList&&o.loadOfflineEntitiesList(...n)),disabled:l.loading},"Обновить",8,p),e.createElementVNode("label",T,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=n=>s.autoRefresh=n),onChange:t[4]||(t[4]=(...n)=>o.autoRefreshEntities&&o.autoRefreshEntities(...n))},null,544),[[e.vModelCheckbox,s.autoRefresh]]),t[6]||(t[6]=e.createElementVNode("span",{class:"slider"},null,-1)),t[7]||(t[7]=e.createElementVNode("span",{class:"tooltip"},"Автообновление каждые 3 секунды",-1))])]),s.entities.list.length>0?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("p",null,[e.createElementVNode("button",{onClick:t[5]||(t[5]=(...n)=>o.deleteOfflineEntitiesAll&&o.deleteOfflineEntitiesAll(...n))},"Удалить все"),e.createTextVNode(" Всего измененных сущностей "+e.toDisplayString(s.entities.total),1)]),s.entities.list.length?(e.openBlock(),e.createElementBlock("table",_,[t[9]||(t[9]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,"#"),e.createElementVNode("th",null,"Удалить"),e.createElementVNode("th",null,"Обновить"),e.createElementVNode("th",null,"PROCESS_ID"),e.createElementVNode("th",null,"EVENT_NAME"),e.createElementVNode("th",null,"Ссылка"),e.createElementVNode("th",null,"EVENT_DATA"),e.createElementVNode("th",null,"who_update"),e.createElementVNode("th",null,"entity")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.entities.list,(n,i)=>{var E,r,c,b;return e.openBlock(),e.createElementBlock("tr",{key:n.PROCESS_ID+"-"+n.ID},[e.createElementVNode("td",null,e.toDisplayString(i+1),1),e.createElementVNode("td",null,[e.createElementVNode("button",{onClick:U=>o.deleteOfflineEntities(n)},"Удалить",8,g)]),e.createElementVNode("td",null,[(E=n.EVENT_DATA.FIELDS)!=null&&E.ID&&(n.EVENT_NAME=="ONCRMDEALUPDATE"||n.EVENT_NAME.includes("ONCRMDYNAMICITEMUPDATE_"))?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:U=>o.entityUpdate(n)},"Изменить",8,u)):e.createCommentVNode("",!0)]),e.createElementVNode("td",null,e.toDisplayString(n.PROCESS_ID),1),e.createElementVNode("td",null,e.toDisplayString(n.EVENT_NAME),1),e.createElementVNode("td",null,[(r=n.EVENT_DATA.FIELDS)!=null&&r.ID&&n.EVENT_NAME=="ONCRMDEALUPDATE"?(e.openBlock(),e.createElementBlock("a",{key:0,href:"https://repacheb.bitrix24.ru/crm/deal/details/"+((c=n.EVENT_DATA.FIELDS)==null?void 0:c.ID)+"/",target:"_blank",rel:"noopener noreferrer"},e.toDisplayString((b=n.EVENT_DATA.FIELDS)==null?void 0:b.ID),9,S)):e.createCommentVNode("",!0)]),e.createElementVNode("td",null,e.toDisplayString(n.EVENT_DATA),1),e.createElementVNode("td",null,e.toDisplayString(n.EVENT_ADDITIONAL.user_id),1),e.createElementVNode("td",A,[t[8]||(t[8]=e.createElementVNode("span",null,"Подробней",-1)),e.createElementVNode("span",I,e.toDisplayString(n),1)])])}),128))])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",B,"Список сущностей пуст."))])):e.createCommentVNode("",!0),l.tabs.tab2?(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",null,[t[11]||(t[11]=e.createElementVNode("h3",null,"Подписаны на события:",-1)),s.subscribedEvents.length?(e.openBlock(),e.createElementBlock("table",C,[t[10]||(t[10]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,"Событие"),e.createElementVNode("th",null,"connector_id"),e.createElementVNode("th",null,"offline"),e.createElementVNode("th",null,"Отписаться")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.subscribedEvents,n=>(e.openBlock(),e.createElementBlock("tr",{key:n.id},[e.createElementVNode("td",null,e.toDisplayString(n.event),1),e.createElementVNode("td",null,e.toDisplayString(n.connector_id),1),e.createElementVNode("td",null,e.toDisplayString(n.offline),1),e.createElementVNode("td",null,[e.createElementVNode("button",{onClick:i=>o.unbindSubscribedEvents(n)},"Отписаться от событий",8,L)])]))),128))])])):(e.openBlock(),e.createElementBlock("p",w,"Подписок на события нет."))]),e.createElementVNode("div",null,[t[13]||(t[13]=e.createElementVNode("h3",null,"На какие события можно подписаться:",-1)),s.events.length?(e.openBlock(),e.createElementBlock("table",O,[t[12]||(t[12]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,"Событие"),e.createElementVNode("th",null,"Подписаться")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.events,n=>(e.openBlock(),e.createElementBlock("tr",{key:n},[e.createElementVNode("td",null,e.toDisplayString(n),1),e.createElementVNode("td",null,[e.createElementVNode("button",{onClick:i=>o.subscribeToEvents(n),disabled:o.isSubscribed(n),class:e.normalizeClass({"disabled-button":o.isSubscribed(n)})},"Подписаться",10,M)])]))),128))])])):(e.openBlock(),e.createElementBlock("p",R,"Список событий пуст."))])])):e.createCommentVNode("",!0),l.tabs.tab3?(e.openBlock(),e.createElementBlock("div",F)):e.createCommentVNode("",!0)])}const N=V(f,[["render",P]]),Y={install(l,t={}){l.component("Subscriptions",N),t.b24&&(l.config.globalProperties.$b24=t.b24)}};d.Subscriptions=N,d.default=Y,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED