@jx3box/jx3box-editor 3.0.6 → 3.0.8
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 +3 -3
- package/src/BoxResource.vue +514 -437
- package/src/Markdown.vue +4 -0
- package/src/Resource.vue +73 -20
- package/src/Upload.vue +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-editor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"description": "JX3BOX Article & Editor",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@element-plus/icons-vue": "^2.0.10",
|
|
17
17
|
"@imengyu/vue3-context-menu": "^1.5.4",
|
|
18
|
-
"@jx3box/jx3box-common": "^9.1.
|
|
19
|
-
"@jx3box/jx3box-data": "^3.9.
|
|
18
|
+
"@jx3box/jx3box-common": "^9.1.3",
|
|
19
|
+
"@jx3box/jx3box-data": "^3.9.4",
|
|
20
20
|
"@jx3box/jx3box-emotion": "^1.3.0",
|
|
21
21
|
"@jx3box/jx3box-macro": "^1.0.3",
|
|
22
22
|
"@jx3box/jx3box-talent": "^1.3.12",
|
package/src/BoxResource.vue
CHANGED
|
@@ -1,115 +1,192 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<div class="c-resource c-resource__jx3box">
|
|
3
|
+
<!-- 上传触发按钮 -->
|
|
4
|
+
<el-button class="u-switch" type="primary" size="large" @click="openDialog" :disabled="!enable">
|
|
5
|
+
<img class="u-icon" svg-inline :src="boxIcon" />魔盒资源
|
|
6
|
+
</el-button>
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
<!-- 弹出界面 -->
|
|
9
|
+
<el-dialog draggable class="c-large-dialog" title="魔盒资源库" v-model="dialogVisible" :teleported="true">
|
|
10
|
+
<div class="c-resource-content" v-loading="loading">
|
|
11
|
+
<div class="m-database-search">
|
|
12
|
+
<el-radio-group
|
|
13
|
+
size="large"
|
|
14
|
+
class="u-client"
|
|
15
|
+
v-model="comboClient"
|
|
16
|
+
@change="search"
|
|
17
|
+
v-if="type === 'combo'"
|
|
18
|
+
>
|
|
19
|
+
<el-radio-button value="std">重制</el-radio-button>
|
|
20
|
+
<el-radio-button value="origin">缘起</el-radio-button>
|
|
21
|
+
</el-radio-group>
|
|
22
|
+
<el-input
|
|
23
|
+
class="u-input"
|
|
24
|
+
size="large"
|
|
25
|
+
:placeholder="placeholderText"
|
|
26
|
+
v-model="query"
|
|
27
|
+
@change="search"
|
|
28
|
+
@keyup.enter="search"
|
|
29
|
+
>
|
|
30
|
+
<template #prepend>关键词</template>
|
|
31
|
+
<template #append>
|
|
32
|
+
<el-switch v-model="strict" active-text="精确匹配"></el-switch>
|
|
33
|
+
</template>
|
|
34
|
+
</el-input>
|
|
35
|
+
</div>
|
|
21
36
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
37
|
+
<el-tabs class="m-database-tabs" v-model="type" type="card" @tab-click="changeType">
|
|
38
|
+
<el-tab-pane label="魔盒用户" name="authors">
|
|
39
|
+
<template #label>
|
|
40
|
+
<span class="u-tab-label">
|
|
41
|
+
<el-icon class="u-tab-icon"><Avatar /></el-icon>
|
|
42
|
+
<b>用户</b>
|
|
43
|
+
<i class="u-lv-box">Lv2+</i>
|
|
44
|
+
</span>
|
|
45
|
+
</template>
|
|
46
|
+
<p v-if="total && done" class="m-resource-count">
|
|
47
|
+
<el-icon><Histogram /></el-icon> 共找到 <b>{{ total }}</b> 条记录
|
|
48
|
+
</p>
|
|
49
|
+
<ul class="m-resource-list">
|
|
50
|
+
<li
|
|
51
|
+
v-for="(o, i) in authors"
|
|
52
|
+
class="u-item"
|
|
53
|
+
:key="i"
|
|
54
|
+
:class="{ on: !!o.isSelected }"
|
|
55
|
+
@click="selectAuthor(o, i)"
|
|
56
|
+
ref="author"
|
|
57
|
+
>
|
|
58
|
+
<span class="u-id">ID:{{ o.ID }}</span>
|
|
59
|
+
<img
|
|
60
|
+
class="u-pic"
|
|
61
|
+
:title="'AuthorID:' + o.display_name"
|
|
62
|
+
:src="userAvatar(o.user_avatar)"
|
|
63
|
+
/>
|
|
64
|
+
<span class="u-primary">
|
|
65
|
+
<span class="u-name">
|
|
66
|
+
{{ o.display_name }}
|
|
67
|
+
</span>
|
|
68
|
+
<div class="u-remark">
|
|
69
|
+
{{ o.user_bio }}
|
|
70
|
+
</div>
|
|
71
|
+
</span>
|
|
72
|
+
</li>
|
|
73
|
+
</ul>
|
|
74
|
+
<el-alert
|
|
75
|
+
v-if="!authors.length && done"
|
|
76
|
+
title="没有找到相关条目"
|
|
77
|
+
type="info"
|
|
78
|
+
show-icon
|
|
79
|
+
></el-alert>
|
|
80
|
+
</el-tab-pane>
|
|
81
|
+
<el-tab-pane label="连招" name="combo">
|
|
82
|
+
<template #label>
|
|
83
|
+
<span class="u-tab-label">
|
|
84
|
+
<el-icon class="u-tab-icon"><Lollipop /></el-icon>
|
|
85
|
+
<b>连招</b>
|
|
86
|
+
</span>
|
|
87
|
+
</template>
|
|
88
|
+
<ComboVue
|
|
89
|
+
:query="query"
|
|
90
|
+
ref="combo"
|
|
91
|
+
:client="comboClient"
|
|
92
|
+
:strict="strict"
|
|
93
|
+
:subtype="subtype"
|
|
94
|
+
></ComboVue>
|
|
95
|
+
</el-tab-pane>
|
|
96
|
+
<el-tab-pane label="剑三趣图" name="emotions">
|
|
97
|
+
<template #label>
|
|
98
|
+
<span class="u-tab-label">
|
|
99
|
+
<el-icon class="u-tab-icon"><Sugar></Sugar></el-icon>
|
|
100
|
+
<b>趣图</b>
|
|
101
|
+
</span>
|
|
102
|
+
</template>
|
|
103
|
+
<p v-if="total && done" class="m-resource-count">
|
|
104
|
+
<el-icon><Histogram /></el-icon> 共找到 <b>{{ total }}</b> 条记录
|
|
105
|
+
</p>
|
|
106
|
+
<ul class="m-resource-emotion">
|
|
107
|
+
<li
|
|
108
|
+
v-for="o in emotions"
|
|
109
|
+
class="u-item"
|
|
110
|
+
:key="o.id"
|
|
111
|
+
:class="{ on: !!o.isSelected }"
|
|
112
|
+
@click="selectEmotion(o)"
|
|
113
|
+
ref="emotion"
|
|
114
|
+
>
|
|
115
|
+
<img class="e-jx3-emotion" :src="resolveImagePath(o.url)" :alt="query" />
|
|
116
|
+
</li>
|
|
117
|
+
</ul>
|
|
118
|
+
<el-alert
|
|
119
|
+
v-if="!emotions.length && done"
|
|
120
|
+
title="没有找到相关条目"
|
|
121
|
+
type="info"
|
|
122
|
+
show-icon
|
|
123
|
+
></el-alert>
|
|
124
|
+
</el-tab-pane>
|
|
125
|
+
<el-tab-pane label="信纸" name="letter">
|
|
126
|
+
<template #label>
|
|
127
|
+
<span class="u-tab-label">
|
|
128
|
+
<el-icon class="u-tab-icon"><CoffeeCup /></el-icon>
|
|
129
|
+
<b>信纸</b>
|
|
130
|
+
</span>
|
|
131
|
+
</template>
|
|
132
|
+
<div class="m-letter-list">
|
|
133
|
+
<div
|
|
134
|
+
class="m-letter"
|
|
135
|
+
:class="{ active: !!o.isSelected }"
|
|
136
|
+
v-for="o in filterLetter"
|
|
137
|
+
:key="o.id"
|
|
138
|
+
@click="selectLetter(o)"
|
|
139
|
+
>
|
|
140
|
+
<LetterPaper :data="o" />
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
<el-alert
|
|
144
|
+
v-if="!letter.length && done"
|
|
145
|
+
title="没有找到相关条目"
|
|
146
|
+
type="info"
|
|
147
|
+
show-icon
|
|
148
|
+
></el-alert>
|
|
149
|
+
</el-tab-pane>
|
|
150
|
+
</el-tabs>
|
|
91
151
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
152
|
+
<template v-if="multipage && type !== 'combo'">
|
|
153
|
+
<!-- 下一页 -->
|
|
154
|
+
<el-button
|
|
155
|
+
class="m-archive-more"
|
|
156
|
+
:class="{ show: hasNextPage }"
|
|
157
|
+
type="primary"
|
|
158
|
+
icon="ArrowDown"
|
|
159
|
+
@click="appendPage"
|
|
160
|
+
size="large"
|
|
161
|
+
>加载更多</el-button
|
|
162
|
+
>
|
|
163
|
+
<!-- 分页 -->
|
|
164
|
+
<el-pagination
|
|
165
|
+
class="m-archive-pages"
|
|
166
|
+
background
|
|
167
|
+
layout="total, prev, pager, next,jumper"
|
|
168
|
+
:hide-on-single-page="true"
|
|
169
|
+
:page-size="per"
|
|
170
|
+
:total="total"
|
|
171
|
+
v-model:current-page="page"
|
|
172
|
+
@current-change="changePage"
|
|
173
|
+
></el-pagination>
|
|
174
|
+
</template>
|
|
98
175
|
|
|
99
|
-
|
|
100
|
-
|
|
176
|
+
<div class="m-database-tip" v-show="isBlank && type !== 'combo'">❤ 请输入搜索条件查询</div>
|
|
177
|
+
</div>
|
|
101
178
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
179
|
+
<!-- 插入按钮 -->
|
|
180
|
+
<template #footer>
|
|
181
|
+
<span class="dialog-footer">
|
|
182
|
+
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
183
|
+
<el-button type="primary" @click="insert" size="large">
|
|
184
|
+
{{ buttonTXT }}
|
|
185
|
+
</el-button>
|
|
186
|
+
</span>
|
|
187
|
+
</template>
|
|
188
|
+
</el-dialog>
|
|
189
|
+
</div>
|
|
113
190
|
</template>
|
|
114
191
|
|
|
115
192
|
<script>
|
|
@@ -125,318 +202,318 @@ const { __iconPath, __Root, __OriginRoot, __imgPath } = JX3BOX;
|
|
|
125
202
|
import ComboVue from "./components/Combo.vue";
|
|
126
203
|
import LetterPaper from "./components/Letter.vue";
|
|
127
204
|
export default {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
205
|
+
name: "BoxResource",
|
|
206
|
+
components: {
|
|
207
|
+
ComboVue,
|
|
208
|
+
LetterPaper,
|
|
209
|
+
},
|
|
210
|
+
props: {
|
|
211
|
+
enable: {
|
|
212
|
+
type: Boolean,
|
|
213
|
+
default: true,
|
|
214
|
+
},
|
|
215
|
+
subtype: {
|
|
216
|
+
type: String,
|
|
217
|
+
default: "通用",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
data: function () {
|
|
221
|
+
return {
|
|
222
|
+
dialogVisible: false,
|
|
223
|
+
actived: false,
|
|
224
|
+
userInfo: {},
|
|
148
225
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
226
|
+
type: "authors",
|
|
227
|
+
query: "",
|
|
228
|
+
strict: false,
|
|
229
|
+
client: location.hostname.includes("origin") ? "origin" : "std",
|
|
230
|
+
comboClient: "std",
|
|
154
231
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
232
|
+
skill: [],
|
|
233
|
+
buff: [],
|
|
234
|
+
item: [],
|
|
235
|
+
icon: [],
|
|
236
|
+
npc: [],
|
|
237
|
+
authors: [],
|
|
238
|
+
selectedAuthor: {},
|
|
239
|
+
emotions: [],
|
|
240
|
+
letter: [],
|
|
164
241
|
|
|
165
|
-
|
|
166
|
-
|
|
242
|
+
done: false,
|
|
243
|
+
loading: false,
|
|
167
244
|
|
|
168
|
-
|
|
245
|
+
isSuper: false,
|
|
169
246
|
|
|
170
|
-
|
|
247
|
+
html: "",
|
|
171
248
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
249
|
+
per: 10,
|
|
250
|
+
page: 1,
|
|
251
|
+
total: 1,
|
|
252
|
+
pages: 1,
|
|
176
253
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
254
|
+
placeholderTexts: {
|
|
255
|
+
authors: "请输入 ID 或 名称",
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
},
|
|
259
|
+
computed: {
|
|
260
|
+
placeholderText: function () {
|
|
261
|
+
return this.placeholderTexts[this.type];
|
|
262
|
+
},
|
|
263
|
+
buttonTXT: function () {
|
|
264
|
+
return this.selectedCount ? "插 入" : "确 定";
|
|
265
|
+
},
|
|
266
|
+
isBlank: function () {
|
|
267
|
+
return !this.query && !this[this.type]?.["length"];
|
|
268
|
+
},
|
|
269
|
+
selectedCount: function () {
|
|
270
|
+
return !!this.html;
|
|
271
|
+
},
|
|
272
|
+
isNumber: function () {
|
|
273
|
+
return !isNaN(this.query);
|
|
274
|
+
},
|
|
275
|
+
hasNextPage: function () {
|
|
276
|
+
return this.total > 1 && this.page < this.pages;
|
|
277
|
+
},
|
|
278
|
+
multipage: function () {
|
|
279
|
+
return this.type !== "icon" && this.done && this.pages > 1;
|
|
280
|
+
},
|
|
281
|
+
iconDir: function () {
|
|
282
|
+
return this.client === "origin" ? "origin_icon" : "icon";
|
|
283
|
+
},
|
|
284
|
+
userStatus: function () {
|
|
285
|
+
return User.getInfo().status;
|
|
286
|
+
},
|
|
287
|
+
uid: function () {
|
|
288
|
+
return User.getInfo().uid;
|
|
289
|
+
},
|
|
290
|
+
canInsertAuthor: function () {
|
|
291
|
+
return User.getLevel(this.userInfo && this.userInfo.experience) >= 2;
|
|
292
|
+
},
|
|
293
|
+
boxIcon: function () {
|
|
294
|
+
return __imgPath + "image/common/jx3box_white.svg";
|
|
295
|
+
},
|
|
296
|
+
filterLetter() {
|
|
297
|
+
return this.letter;
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
watch: {
|
|
301
|
+
html: function (newval) {
|
|
302
|
+
this.$emit("update", newval);
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
methods: {
|
|
306
|
+
resetResultState: function (type = this.type) {
|
|
307
|
+
if (Array.isArray(this[type])) {
|
|
308
|
+
this[type] = [];
|
|
309
|
+
}
|
|
310
|
+
this.total = 0;
|
|
311
|
+
this.pages = 1;
|
|
312
|
+
this.loading = false;
|
|
313
|
+
this.done = false;
|
|
314
|
+
},
|
|
315
|
+
getData: function (page = 1, append = false) {
|
|
316
|
+
this.loading = true;
|
|
317
|
+
this.per = 10;
|
|
318
|
+
this.done = false;
|
|
319
|
+
let query = this.query;
|
|
320
|
+
let params = {
|
|
321
|
+
strict: ~~this.strict,
|
|
322
|
+
per: this.per,
|
|
323
|
+
page: page,
|
|
324
|
+
client: this.client,
|
|
325
|
+
};
|
|
249
326
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
327
|
+
// 图标
|
|
328
|
+
if (this.type === "authors") {
|
|
329
|
+
if (!this.query) {
|
|
330
|
+
this.resetResultState("authors");
|
|
331
|
+
this.done = true;
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
257
334
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
335
|
+
params = {
|
|
336
|
+
...params,
|
|
337
|
+
name: query,
|
|
338
|
+
};
|
|
339
|
+
loadAuthors(params)
|
|
340
|
+
.then((res) => {
|
|
341
|
+
if (!append) this.authors = [];
|
|
342
|
+
let list = this.transformData(res.data.data.list);
|
|
343
|
+
this.authors = this.authors.concat(list);
|
|
344
|
+
this.pages = res.data.data.pages;
|
|
345
|
+
this.total = res.data.data.total;
|
|
346
|
+
})
|
|
347
|
+
.finally(() => {
|
|
348
|
+
this.done = true;
|
|
349
|
+
this.loading = false;
|
|
350
|
+
});
|
|
351
|
+
} else if (this.type === "emotions") {
|
|
352
|
+
this.per = 24;
|
|
353
|
+
params = {
|
|
354
|
+
per: this.per,
|
|
355
|
+
page: page,
|
|
356
|
+
search: query,
|
|
357
|
+
};
|
|
358
|
+
loadEmotions(params)
|
|
359
|
+
.then((res) => {
|
|
360
|
+
if (!append) this.emotions = [];
|
|
361
|
+
let list = this.transformData(res.data.data.list);
|
|
362
|
+
this.emotions = this.emotions.concat(list);
|
|
363
|
+
this.pages = res.data.data.pages;
|
|
364
|
+
this.total = res.data.data.total;
|
|
365
|
+
})
|
|
366
|
+
.finally(() => {
|
|
367
|
+
this.done = true;
|
|
368
|
+
this.loading = false;
|
|
369
|
+
});
|
|
370
|
+
} else if (this.type === "letter") {
|
|
371
|
+
const { per, page } = params;
|
|
372
|
+
const _params = { per, page };
|
|
373
|
+
if (this.query) _params._search = this.query;
|
|
374
|
+
getLetterPaper(_params)
|
|
375
|
+
.then((res) => {
|
|
376
|
+
if (!append) this.letter = [];
|
|
377
|
+
let list = this.transformData(res.data.data.list);
|
|
378
|
+
this.letter = this.letter.concat(list);
|
|
379
|
+
this.pages = res.data.data.pages;
|
|
380
|
+
this.total = res.data.data.total;
|
|
381
|
+
})
|
|
382
|
+
.finally(() => {
|
|
383
|
+
this.done = true;
|
|
384
|
+
this.loading = false;
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
search: function () {
|
|
389
|
+
if (this.type === "combo") {
|
|
390
|
+
this.$refs.combo?.search();
|
|
391
|
+
} else {
|
|
392
|
+
this.page = 1;
|
|
393
|
+
this.getData();
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
appendPage: function () {
|
|
397
|
+
this.getData(++this.page, true);
|
|
398
|
+
},
|
|
399
|
+
changePage: function (i) {
|
|
400
|
+
this.getData(i);
|
|
401
|
+
},
|
|
402
|
+
changeType: function (tab) {
|
|
403
|
+
const nextType = tab?.paneName || tab?.props?.name || tab?.name;
|
|
404
|
+
if (nextType) this.type = nextType;
|
|
405
|
+
this.page = 1;
|
|
406
|
+
this.resetResultState(this.type);
|
|
407
|
+
this.html = "";
|
|
408
|
+
if (this.type === "combo") {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
this.getData();
|
|
412
|
+
},
|
|
413
|
+
setAuthors: function () {
|
|
414
|
+
try {
|
|
415
|
+
let author = sessionStorage.getItem("atAuthor");
|
|
416
|
+
if (author) {
|
|
417
|
+
author = JSON.parse(author);
|
|
418
|
+
author = author.split(",") || [];
|
|
419
|
+
if (this.selectedAuthor.ID && !author.includes(String(this.selectedAuthor.ID))) {
|
|
420
|
+
author.push(this.selectedAuthor.ID);
|
|
421
|
+
}
|
|
422
|
+
sessionStorage.setItem("atAuthor", JSON.stringify(author.join(",")));
|
|
423
|
+
} else {
|
|
424
|
+
sessionStorage.setItem("atAuthor", JSON.stringify(String(this.selectedAuthor.ID)));
|
|
425
|
+
}
|
|
426
|
+
} catch (error) {
|
|
427
|
+
console.log(error);
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
insert: function () {
|
|
431
|
+
if (this.type === "authors") {
|
|
432
|
+
if (this.userStatus == 0 && this.canInsertAuthor) {
|
|
433
|
+
if (this.selectedAuthor.ID) {
|
|
434
|
+
this.setAuthors();
|
|
435
|
+
this.$emit("insert", this.html);
|
|
436
|
+
this.dialogVisible = false;
|
|
437
|
+
this.selectedAuthor = {};
|
|
438
|
+
} else {
|
|
439
|
+
this.$message.warning("请选择一个用户");
|
|
440
|
+
}
|
|
441
|
+
} else {
|
|
442
|
+
this.$alert("您的等级不足或无权限(Lv2以上可用)", "消息");
|
|
443
|
+
}
|
|
444
|
+
} else {
|
|
445
|
+
if (this.type === "combo") {
|
|
446
|
+
const html = this.$refs.combo.renderVal();
|
|
447
|
+
this.$emit("insert", html);
|
|
448
|
+
} else {
|
|
449
|
+
this.$emit("insert", this.html);
|
|
450
|
+
}
|
|
451
|
+
this.dialogVisible = false;
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
transformData: function (data) {
|
|
455
|
+
data.forEach((item) => {
|
|
456
|
+
item.isSelected = false;
|
|
457
|
+
});
|
|
458
|
+
return data;
|
|
459
|
+
},
|
|
460
|
+
selectAuthor: function (o) {
|
|
461
|
+
this.resetItems();
|
|
462
|
+
this.selectedAuthor = o;
|
|
463
|
+
o.isSelected = true;
|
|
464
|
+
this.html = `<a data-type="author" class="e-jx3-author w-jx3-element" data-mode="" data-id="${o.ID}" target="_blank" href="/author/${o.ID}">@${o.display_name}</a>`;
|
|
465
|
+
},
|
|
466
|
+
selectEmotion: function (o) {
|
|
467
|
+
this.resetItems();
|
|
468
|
+
o.isSelected = true;
|
|
469
|
+
this.html = `<a data-type="emotion" class="e-jx3-emotion w-jx3-element" data-id="${o.id}" target="_blank" href="/emotion/${o.id}"><img class="e-jx3-emotion-img" data-type="emotion" data-id="${o.id}" style="width:180px;" src="${o.url}" alt="${o.id}"/></a>`;
|
|
470
|
+
},
|
|
471
|
+
// 信纸
|
|
472
|
+
selectLetter(o) {
|
|
473
|
+
this.resetItems();
|
|
474
|
+
o.isSelected = true;
|
|
475
|
+
const { slug, style, remark } = o;
|
|
476
|
+
const titleHtml = `<div class="e-letter-title letter-title--${slug}">${remark}</div>`;
|
|
477
|
+
const contentHtml = `<div class="e-letter-content letter-body--${slug}"><div class="u-letter-content--header letter-header--${slug}"><div class="u-letter-content--footer letter-footer--${slug}"><p>~ 魔盒真好玩,魔盒真好用 ~</p></div></div></div>`;
|
|
478
|
+
this.html = `<div class="e-letter letter--${slug}">${titleHtml}<br/> ${contentHtml}</div></div><style>${style}</style>`;
|
|
479
|
+
},
|
|
480
|
+
resetItems: function () {
|
|
481
|
+
let data = this[this.type];
|
|
482
|
+
data.forEach((item) => {
|
|
483
|
+
item.isSelected = false;
|
|
484
|
+
});
|
|
485
|
+
this.html = "";
|
|
486
|
+
},
|
|
487
|
+
getLink: function (type, id) {
|
|
488
|
+
let domain = this.client == "origin" ? __OriginRoot : __Root;
|
|
489
|
+
return domain + getLink(type, id).slice(1);
|
|
490
|
+
},
|
|
491
|
+
userAvatar: function (url) {
|
|
492
|
+
return showAvatar(url, "m");
|
|
493
|
+
},
|
|
494
|
+
loadUserInfo: function () {
|
|
495
|
+
if (!this.uid) return;
|
|
496
|
+
getUserInfo(this.uid).then((res) => {
|
|
497
|
+
this.userInfo = res;
|
|
498
|
+
});
|
|
499
|
+
},
|
|
423
500
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
501
|
+
// 杂项
|
|
502
|
+
// ==============================
|
|
503
|
+
openDialog: function () {
|
|
504
|
+
this.dialogVisible = true;
|
|
505
|
+
if (!this.actived) {
|
|
506
|
+
loadStat().then((data) => {
|
|
507
|
+
this.stat = data;
|
|
508
|
+
this.actived = true;
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
resolveImagePath,
|
|
513
|
+
},
|
|
514
|
+
created: function () {
|
|
515
|
+
this.loadUserInfo();
|
|
516
|
+
},
|
|
440
517
|
};
|
|
441
518
|
</script>
|
|
442
519
|
|
|
@@ -444,36 +521,36 @@ export default {
|
|
|
444
521
|
@import "./assets/css/resource.less";
|
|
445
522
|
|
|
446
523
|
.m-item-pop {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
524
|
+
padding: 0 !important;
|
|
525
|
+
background: none !important;
|
|
526
|
+
border: none;
|
|
450
527
|
}
|
|
451
528
|
.m-database-tabs .m-letter-list {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
529
|
+
.flex;
|
|
530
|
+
flex-wrap: wrap;
|
|
531
|
+
gap: 20px;
|
|
532
|
+
.m-letter {
|
|
533
|
+
.pointer;
|
|
534
|
+
.pr;
|
|
535
|
+
.size(20%,80px);
|
|
536
|
+
box-sizing: border-box;
|
|
537
|
+
border: 3px solid transparent;
|
|
538
|
+
&.active {
|
|
539
|
+
.r(5px);
|
|
540
|
+
border: 3px solid #409eff;
|
|
541
|
+
&::after {
|
|
542
|
+
.none;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
.e-letter {
|
|
546
|
+
.w(100%);
|
|
547
|
+
.e-letter-title {
|
|
548
|
+
.w(100%);
|
|
549
|
+
}
|
|
550
|
+
.e-letter-content {
|
|
551
|
+
.none;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
478
555
|
}
|
|
479
556
|
</style>
|
package/src/Markdown.vue
CHANGED
package/src/Resource.vue
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="c-resource">
|
|
3
3
|
<!-- 上传触发按钮 -->
|
|
4
|
-
<el-button class="u-switch" type="primary" @click="openDialog" :disabled="!enable">
|
|
4
|
+
<el-button class="u-switch" size="large" type="primary" @click="openDialog" :disabled="!enable">
|
|
5
|
+
<img class="u-icon" svg-inline src="./assets/img/jx3.svg" />剑三资源
|
|
6
|
+
</el-button>
|
|
5
7
|
|
|
6
8
|
<!-- 弹出界面 -->
|
|
7
9
|
<el-dialog class="c-large-dialog" title="剑三数据库" v-model="dialogVisible" draggable>
|
|
@@ -11,10 +13,22 @@
|
|
|
11
13
|
<el-radio-button value="std">重制</el-radio-button>
|
|
12
14
|
<el-radio-button value="origin">缘起</el-radio-button>
|
|
13
15
|
</el-radio-group>
|
|
14
|
-
<el-input
|
|
16
|
+
<el-input
|
|
17
|
+
size="large"
|
|
18
|
+
class="u-input"
|
|
19
|
+
placeholder="请输入 ID 或 名称"
|
|
20
|
+
v-model="query"
|
|
21
|
+
@change="search"
|
|
22
|
+
@keyup.enter="search"
|
|
23
|
+
>
|
|
15
24
|
<template #prepend>ID /名称</template>
|
|
16
25
|
<template #append v-if="isPC">
|
|
17
|
-
<el-switch
|
|
26
|
+
<el-switch
|
|
27
|
+
v-model="strict"
|
|
28
|
+
active-text="精确匹配"
|
|
29
|
+
@change="search"
|
|
30
|
+
title="仅对Buff/Skill有效"
|
|
31
|
+
></el-switch>
|
|
18
32
|
</template>
|
|
19
33
|
</el-input>
|
|
20
34
|
</div>
|
|
@@ -105,7 +119,12 @@
|
|
|
105
119
|
</span>
|
|
106
120
|
</li>
|
|
107
121
|
</ul>
|
|
108
|
-
<el-alert
|
|
122
|
+
<el-alert
|
|
123
|
+
v-if="!skill.length && done"
|
|
124
|
+
title="没有找到相关条目"
|
|
125
|
+
type="info"
|
|
126
|
+
show-icon
|
|
127
|
+
></el-alert>
|
|
109
128
|
</el-tab-pane>
|
|
110
129
|
<el-tab-pane label="物品" name="item">
|
|
111
130
|
<template #label>
|
|
@@ -120,9 +139,21 @@
|
|
|
120
139
|
共找到 <b>{{ total }}</b> 条记录
|
|
121
140
|
</p>
|
|
122
141
|
<ul class="m-resource-list" v-if="item.length">
|
|
123
|
-
<el-popover
|
|
142
|
+
<el-popover
|
|
143
|
+
popper-class="m-item-pop"
|
|
144
|
+
:visible-arrow="false"
|
|
145
|
+
trigger="hover"
|
|
146
|
+
placement="left"
|
|
147
|
+
v-for="(o, i) in item"
|
|
148
|
+
:key="o.id"
|
|
149
|
+
>
|
|
124
150
|
<template #reference>
|
|
125
|
-
<li
|
|
151
|
+
<li
|
|
152
|
+
class="u-item"
|
|
153
|
+
:class="{ on: o.isSelected }"
|
|
154
|
+
@click="selectItem(o, i)"
|
|
155
|
+
:ref="(el) => setResultItemRef('item', i, el)"
|
|
156
|
+
>
|
|
126
157
|
<span class="u-id">ID:{{ o.id }}</span>
|
|
127
158
|
<img class="u-pic" :title="'IconID:' + o.IconID" :src="iconURL(o.IconID)" />
|
|
128
159
|
<span class="u-name">{{ o.Name }}</span>
|
|
@@ -215,7 +246,15 @@
|
|
|
215
246
|
|
|
216
247
|
<template v-if="multipage">
|
|
217
248
|
<!-- 下一页 -->
|
|
218
|
-
<el-button
|
|
249
|
+
<el-button
|
|
250
|
+
class="m-archive-more"
|
|
251
|
+
:class="{ show: hasNextPage }"
|
|
252
|
+
type="primary"
|
|
253
|
+
icon="ArrowDown"
|
|
254
|
+
@click="appendPage"
|
|
255
|
+
size="large"
|
|
256
|
+
>加载更多</el-button
|
|
257
|
+
>
|
|
219
258
|
<!-- 分页 -->
|
|
220
259
|
<el-pagination
|
|
221
260
|
class="m-archive-pages"
|
|
@@ -490,31 +529,41 @@ export default {
|
|
|
490
529
|
this.resetItems();
|
|
491
530
|
o.isSelected = true;
|
|
492
531
|
if (this.buff_mode === "simple") {
|
|
493
|
-
this.html = `<a data-type="buff" class="e-jx3-buff w-jx3-element ${
|
|
494
|
-
"
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
)}" data-client="${this.client}" data-id="${o.BuffID}" data-level="${o.Level}">[${o.Name}]</a>`;
|
|
532
|
+
this.html = `<a data-type="buff" class="e-jx3-buff w-jx3-element ${
|
|
533
|
+
o.CanCancel === 1 ? "isBuff" : "isDebuff"
|
|
534
|
+
}" href="${this.getDbLink("buff", this.client, o.BuffID, o.Level)}" data-client="${
|
|
535
|
+
this.client
|
|
536
|
+
}" data-id="${o.BuffID}" data-level="${o.Level}">[${o.Name}]</a>`;
|
|
499
537
|
} else {
|
|
500
|
-
this.html = `<pre data-type="buff" data-id="${o.BuffID}" class="e-jx3-resource">${this.nl2br(
|
|
538
|
+
this.html = `<pre data-type="buff" data-id="${o.BuffID}" class="e-jx3-resource">${this.nl2br(
|
|
539
|
+
this.getResultItemHtml("buff", i)
|
|
540
|
+
)}</pre>`;
|
|
501
541
|
}
|
|
502
542
|
},
|
|
503
543
|
selectSkill(o, i) {
|
|
504
544
|
this.resetItems();
|
|
505
545
|
o.isSelected = true;
|
|
506
546
|
if (this.skill_mode === "simple") {
|
|
507
|
-
this.html = `<a data-type="skill" class="e-jx3-skill w-jx3-element" href="${this.getDbLink(
|
|
508
|
-
|
|
509
|
-
|
|
547
|
+
this.html = `<a data-type="skill" class="e-jx3-skill w-jx3-element" href="${this.getDbLink(
|
|
548
|
+
"skill",
|
|
549
|
+
this.client,
|
|
550
|
+
o.SkillID,
|
|
551
|
+
o.Level
|
|
552
|
+
)}" data-client="${this.client}" data-id="${o.SkillID}" data-level="${o.Level}">[${o.Name}]</a>`;
|
|
510
553
|
} else {
|
|
511
|
-
this.html = `<pre data-type="skill" data-id="${o.SkillID}" class="e-jx3-resource">${this.nl2br(
|
|
554
|
+
this.html = `<pre data-type="skill" data-id="${o.SkillID}" class="e-jx3-resource">${this.nl2br(
|
|
555
|
+
this.getResultItemHtml("skill", i)
|
|
556
|
+
)}</pre>`;
|
|
512
557
|
}
|
|
513
558
|
},
|
|
514
559
|
selectItem(o) {
|
|
515
560
|
this.resetItems();
|
|
516
561
|
o.isSelected = true;
|
|
517
|
-
this.html = `<a data-type="item" class="e-jx3-item e-jx3-item-q${
|
|
562
|
+
this.html = `<a data-type="item" class="e-jx3-item e-jx3-item-q${
|
|
563
|
+
o.Quality
|
|
564
|
+
} w-jx3-element" data-mode="" data-id="${o.id}" data-quality="${o.Quality}" data-client="${
|
|
565
|
+
this.client
|
|
566
|
+
}" target="_blank" href="${this.getLink("item", o.id)}">[${o.Name}]</a>`;
|
|
518
567
|
},
|
|
519
568
|
selectIcon(o) {
|
|
520
569
|
this.resetItems();
|
|
@@ -524,7 +573,11 @@ export default {
|
|
|
524
573
|
selectNpc(o) {
|
|
525
574
|
this.resetItems();
|
|
526
575
|
o.isSelected = true;
|
|
527
|
-
this.html = `<a data-type="npc" class="e-jx3-npc w-jx3-element" data-mode="" data-id="${
|
|
576
|
+
this.html = `<a data-type="npc" class="e-jx3-npc w-jx3-element" data-mode="" data-id="${
|
|
577
|
+
o.ID
|
|
578
|
+
}" data-client="${this.client}" target="_blank" href="${this.getDbLink("npc", this.client, o.ID)}">[${
|
|
579
|
+
o.Name
|
|
580
|
+
}]</a>`;
|
|
528
581
|
},
|
|
529
582
|
resetItems() {
|
|
530
583
|
this.currentList.forEach((item) => {
|
package/src/Upload.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="c-upload">
|
|
3
|
-
<el-button type="primary" :disabled="!enable" @click="dialogVisible = true">
|
|
3
|
+
<el-button type="primary" :disabled="!enable" size="large" @click="dialogVisible = true">
|
|
4
4
|
<el-icon><UploadFilled /></el-icon>
|
|
5
5
|
<span>{{ buttonText }}</span>
|
|
6
6
|
</el-button>
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
><el-icon> <Delete /> </el-icon><span>清空</span></el-button
|
|
13
13
|
>
|
|
14
14
|
<!-- 限制提示 -->
|
|
15
|
-
<div class="u-upload-tip" :title="tipText" type="info" show-icon :closable="false"
|
|
15
|
+
<div class="u-upload-tip" :title="tipText" type="info" show-icon :closable="false">
|
|
16
|
+
<span>{{ tipText }}</span>
|
|
17
|
+
</div>
|
|
16
18
|
</div>
|
|
17
19
|
|
|
18
20
|
<el-upload
|