@nebulars/sseengine 1.3.109 → 1.3.112
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebulars/sseengine",
|
|
3
3
|
"description": "An engine for sse",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.112",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "forage serve --name sseengine",
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"axios": "^1.11.0",
|
|
20
20
|
"vuex-fast": "^2.2.2"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "9413ea7a560bfe4bcdacdc2c3c953dff7ffcb9b4"
|
|
23
23
|
}
|
|
@@ -116,11 +116,14 @@ export default {
|
|
|
116
116
|
},
|
|
117
117
|
|
|
118
118
|
async tubHandler({ target }) {
|
|
119
|
+
// Get Cash
|
|
120
|
+
const { $, closest } = this.$util;
|
|
121
|
+
|
|
119
122
|
// Get Container
|
|
120
|
-
const container =
|
|
123
|
+
const container = closest(target, '.markdown-table-ops', true);
|
|
121
124
|
|
|
122
125
|
// Get Element by Closest
|
|
123
|
-
const element =
|
|
126
|
+
const element = closest(target, '[data-event]', true);
|
|
124
127
|
|
|
125
128
|
// No Element
|
|
126
129
|
if (!container || !element) return;
|
|
@@ -135,7 +138,39 @@ export default {
|
|
|
135
138
|
const markdown = snap ? decodeURIComponent(snap) : null;
|
|
136
139
|
|
|
137
140
|
// Get Table
|
|
138
|
-
|
|
141
|
+
let { nextSibling: table } = container;
|
|
142
|
+
|
|
143
|
+
// Tolerance Table
|
|
144
|
+
if (!table) {
|
|
145
|
+
table = $(closest(container, '.ant-modal-body')).find('table').get(0);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Get Query and Title
|
|
149
|
+
let { query, title } = table.dataset;
|
|
150
|
+
|
|
151
|
+
// No Query
|
|
152
|
+
if (!query) {
|
|
153
|
+
// Get Wrapper
|
|
154
|
+
const wrapper = closest(table, '[query-id]', true);
|
|
155
|
+
|
|
156
|
+
// Get Query ID
|
|
157
|
+
query = wrapper.getAttribute('query-id');
|
|
158
|
+
|
|
159
|
+
// Set Data
|
|
160
|
+
table.setAttribute('data-query', query);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// No Title
|
|
164
|
+
if (!title) {
|
|
165
|
+
// Get Wrapper
|
|
166
|
+
const wrapper = closest(table, '[query-id]', true);
|
|
167
|
+
|
|
168
|
+
// Get Title
|
|
169
|
+
title = $(wrapper).find('.fqa-query-content').html();
|
|
170
|
+
|
|
171
|
+
// Set Data
|
|
172
|
+
table.setAttribute('data-title', title);
|
|
173
|
+
}
|
|
139
174
|
|
|
140
175
|
// Trigger Action
|
|
141
176
|
await this.$store.dispatch(`sseengine/TUB_${namespace}`, { table, markdown });
|
|
@@ -119,8 +119,11 @@ export default {
|
|
|
119
119
|
// Get Markdown
|
|
120
120
|
const { html } = await this.context(e);
|
|
121
121
|
|
|
122
|
+
// Remove Footage
|
|
123
|
+
const footage = html.replace(/\[\d+\]/g, '');
|
|
124
|
+
|
|
122
125
|
// Add to Copy
|
|
123
|
-
await this.$util.copy(
|
|
126
|
+
await this.$util.copy(footage);
|
|
124
127
|
|
|
125
128
|
// Toast
|
|
126
129
|
await this.$util.toast.success('已复制到剪贴板');
|
package/src/store/tub.js
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
export default ({ http, closest, copy, toimg, download, excel, time, toast, blob, $ }) => {
|
|
2
2
|
return {
|
|
3
3
|
async TUB_FULLSCREEN({ state }, { table }) {
|
|
4
|
+
// The Table
|
|
5
|
+
const tabler = $(table);
|
|
6
|
+
|
|
4
7
|
// Set Cloner
|
|
5
|
-
const cloner =
|
|
8
|
+
const cloner = tabler.clone().prop('outerHTML');
|
|
9
|
+
|
|
10
|
+
// Set Ops
|
|
11
|
+
const operat = tabler.prev().clone();
|
|
12
|
+
|
|
13
|
+
// Insert
|
|
14
|
+
const out = setTimeout(() => {
|
|
15
|
+
// Get Dom
|
|
16
|
+
const container = $('#fullscreen-operat');
|
|
17
|
+
|
|
18
|
+
// Sync Space
|
|
19
|
+
container.width(tabler.outerWidth());
|
|
20
|
+
|
|
21
|
+
// Clean Dom and Insert
|
|
22
|
+
container.empty().append(operat);
|
|
23
|
+
|
|
24
|
+
// Clear Timeout
|
|
25
|
+
clearTimeout(out);
|
|
26
|
+
}, 600);
|
|
6
27
|
|
|
7
28
|
// Set Fullscreen
|
|
8
29
|
const fullscreen = true;
|
|
@@ -76,15 +97,8 @@ export default ({ http, closest, copy, toimg, download, excel, time, toast, blob
|
|
|
76
97
|
// Set Book
|
|
77
98
|
excel.utils.book_append_sheet(book, sheet, 'Gold Data');
|
|
78
99
|
|
|
79
|
-
// Get ID
|
|
80
|
-
// const query = closest(table, '[query-id]', true).getAttribute('query-id');
|
|
81
|
-
// const answer = closest(table, '[answer-id]', true).getAttribute('answer-id');
|
|
82
|
-
|
|
83
|
-
// Get Query
|
|
84
|
-
const query = closest(table, '[query-id]', true);
|
|
85
|
-
|
|
86
100
|
// Get Title from Query
|
|
87
|
-
const title =
|
|
101
|
+
const title = table.dataset.title;
|
|
88
102
|
|
|
89
103
|
// Get Time
|
|
90
104
|
const fmt = time.Format(new Date(), 'YYYY-MM-DD');
|