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