@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "3.0.6",
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.1",
19
- "@jx3box/jx3box-data": "^3.9.2",
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",
@@ -1,115 +1,192 @@
1
1
  <template>
2
- <div class="c-resource c-resource__jx3box">
3
- <!-- 上传触发按钮 -->
4
- <el-button class="u-switch" type="primary" @click="openDialog" :disabled="!enable"> <img class="u-icon" svg-inline :src="boxIcon" />魔盒资源 </el-button>
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
- <el-dialog draggable class="c-large-dialog" title="魔盒资源库" v-model="dialogVisible" :teleported="true">
8
- <div class="c-resource-content" v-loading="loading">
9
- <div class="m-database-search">
10
- <el-radio-group size="large" class="u-client" v-model="comboClient" @change="search" v-if="type === 'combo'">
11
- <el-radio-button value="std">重制</el-radio-button>
12
- <el-radio-button value="origin">缘起</el-radio-button>
13
- </el-radio-group>
14
- <el-input class="u-input" size="large" :placeholder="placeholderText" v-model="query" @change="search" @keyup.enter="search">
15
- <template #prepend>关键词</template>
16
- <template #append>
17
- <el-switch v-model="strict" active-text="精确匹配"></el-switch>
18
- </template>
19
- </el-input>
20
- </div>
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
- <el-tabs class="m-database-tabs" v-model="type" type="card" @tab-click="changeType">
23
- <el-tab-pane label="魔盒用户" name="authors">
24
- <template #label>
25
- <span class="u-tab-label">
26
- <el-icon class="u-tab-icon"><Avatar /></el-icon>
27
- <b>用户</b>
28
- <i class="u-lv-box">Lv2+</i>
29
- </span>
30
- </template>
31
- <p v-if="total && done" class="m-resource-count">
32
- <el-icon><Histogram /></el-icon> 共找到 <b>{{ total }}</b> 条记录
33
- </p>
34
- <ul class="m-resource-list">
35
- <li v-for="(o, i) in authors" class="u-item" :key="i" :class="{ on: !!o.isSelected }" @click="selectAuthor(o, i)" ref="author">
36
- <span class="u-id">ID:{{ o.ID }}</span>
37
- <img class="u-pic" :title="'AuthorID:' + o.display_name" :src="userAvatar(o.user_avatar)" />
38
- <span class="u-primary">
39
- <span class="u-name">
40
- {{ o.display_name }}
41
- </span>
42
- <div class="u-remark">
43
- {{ o.user_bio }}
44
- </div>
45
- </span>
46
- </li>
47
- </ul>
48
- <el-alert v-if="!authors.length && done" title="没有找到相关条目" type="info" show-icon></el-alert>
49
- </el-tab-pane>
50
- <el-tab-pane label="连招" name="combo">
51
- <template #label>
52
- <span class="u-tab-label">
53
- <el-icon class="u-tab-icon"><Lollipop /></el-icon>
54
- <b>连招</b>
55
- </span>
56
- </template>
57
- <ComboVue :query="query" ref="combo" :client="comboClient" :strict="strict" :subtype="subtype"></ComboVue>
58
- </el-tab-pane>
59
- <el-tab-pane label="剑三趣图" name="emotions">
60
- <template #label>
61
- <span class="u-tab-label">
62
- <el-icon class="u-tab-icon"><Sugar></Sugar></el-icon>
63
- <b>趣图</b>
64
- </span>
65
- </template>
66
- <p v-if="total && done" class="m-resource-count">
67
- <el-icon><Histogram /></el-icon> 共找到 <b>{{ total }}</b> 条记录
68
- </p>
69
- <ul class="m-resource-emotion">
70
- <li v-for="o in emotions" class="u-item" :key="o.id" :class="{ on: !!o.isSelected }" @click="selectEmotion(o)" ref="emotion">
71
- <img class="e-jx3-emotion" :src="resolveImagePath(o.url)" :alt="query" />
72
- </li>
73
- </ul>
74
- <el-alert v-if="!emotions.length && done" title="没有找到相关条目" type="info" show-icon></el-alert>
75
- </el-tab-pane>
76
- <el-tab-pane label="信纸" name="letter">
77
- <template #label>
78
- <span class="u-tab-label">
79
- <el-icon class="u-tab-icon"><CoffeeCup /></el-icon>
80
- <b>信纸</b>
81
- </span>
82
- </template>
83
- <div class="m-letter-list">
84
- <div class="m-letter" :class="{ active: !!o.isSelected }" v-for="o in filterLetter" :key="o.id" @click="selectLetter(o)">
85
- <LetterPaper :data="o" />
86
- </div>
87
- </div>
88
- <el-alert v-if="!letter.length && done" title="没有找到相关条目" type="info" show-icon></el-alert>
89
- </el-tab-pane>
90
- </el-tabs>
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
- <template v-if="multipage && type !== 'combo'">
93
- <!-- 下一页 -->
94
- <el-button class="m-archive-more" :class="{ show: hasNextPage }" type="primary" icon="ArrowDown" @click="appendPage" size="large">加载更多</el-button>
95
- <!-- 分页 -->
96
- <el-pagination class="m-archive-pages" background layout="total, prev, pager, next,jumper" :hide-on-single-page="true" :page-size="per" :total="total" v-model:current-page="page" @current-change="changePage"></el-pagination>
97
- </template>
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
- <div class="m-database-tip" v-show="isBlank && type !== 'combo'">❤ 请输入搜索条件查询</div>
100
- </div>
176
+ <div class="m-database-tip" v-show="isBlank && type !== 'combo'">❤ 请输入搜索条件查询</div>
177
+ </div>
101
178
 
102
- <!-- 插入按钮 -->
103
- <template #footer>
104
- <span class="dialog-footer">
105
- <el-button @click="dialogVisible = false" size="large">取 消</el-button>
106
- <el-button type="primary" @click="insert" size="large">
107
- {{ buttonTXT }}
108
- </el-button>
109
- </span>
110
- </template>
111
- </el-dialog>
112
- </div>
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
- name: "BoxResource",
129
- components: {
130
- ComboVue,
131
- LetterPaper,
132
- },
133
- props: {
134
- enable: {
135
- type: Boolean,
136
- default: true,
137
- },
138
- subtype: {
139
- type: String,
140
- default: "通用",
141
- }
142
- },
143
- data: function () {
144
- return {
145
- dialogVisible: false,
146
- actived: false,
147
- userInfo: {},
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
- type: "authors",
150
- query: "",
151
- strict: false,
152
- client: location.hostname.includes("origin") ? "origin" : "std",
153
- comboClient: "std",
226
+ type: "authors",
227
+ query: "",
228
+ strict: false,
229
+ client: location.hostname.includes("origin") ? "origin" : "std",
230
+ comboClient: "std",
154
231
 
155
- skill: [],
156
- buff: [],
157
- item: [],
158
- icon: [],
159
- npc: [],
160
- authors: [],
161
- selectedAuthor: {},
162
- emotions: [],
163
- letter: [],
232
+ skill: [],
233
+ buff: [],
234
+ item: [],
235
+ icon: [],
236
+ npc: [],
237
+ authors: [],
238
+ selectedAuthor: {},
239
+ emotions: [],
240
+ letter: [],
164
241
 
165
- done: false,
166
- loading: false,
242
+ done: false,
243
+ loading: false,
167
244
 
168
- isSuper: false,
245
+ isSuper: false,
169
246
 
170
- html: "",
247
+ html: "",
171
248
 
172
- per: 10,
173
- page: 1,
174
- total: 1,
175
- pages: 1,
249
+ per: 10,
250
+ page: 1,
251
+ total: 1,
252
+ pages: 1,
176
253
 
177
- placeholderTexts: {
178
- authors: "请输入 ID 或 名称",
179
- },
180
- };
181
- },
182
- computed: {
183
- placeholderText: function () {
184
- return this.placeholderTexts[this.type];
185
- },
186
- buttonTXT: function () {
187
- return this.selectedCount ? "插 入" : "确 定";
188
- },
189
- isBlank: function () {
190
- return !this.query && !this[this.type]?.["length"];
191
- },
192
- selectedCount: function () {
193
- return !!this.html;
194
- },
195
- isNumber: function () {
196
- return !isNaN(this.query);
197
- },
198
- hasNextPage: function () {
199
- return this.total > 1 && this.page < this.pages;
200
- },
201
- multipage: function () {
202
- return this.type !== "icon" && this.done && this.pages > 1;
203
- },
204
- iconDir: function () {
205
- return this.client === "origin" ? "origin_icon" : "icon";
206
- },
207
- userStatus: function () {
208
- return User.getInfo().status;
209
- },
210
- uid: function () {
211
- return User.getInfo().uid;
212
- },
213
- canInsertAuthor: function () {
214
- return User.getLevel(this.userInfo && this.userInfo.experience) >= 2;
215
- },
216
- boxIcon: function () {
217
- return __imgPath + "image/common/jx3box_white.svg";
218
- },
219
- filterLetter() {
220
- return this.letter;
221
- },
222
- },
223
- watch: {
224
- html: function (newval) {
225
- this.$emit("update", newval);
226
- },
227
- },
228
- methods: {
229
- resetResultState: function (type = this.type) {
230
- if (Array.isArray(this[type])) {
231
- this[type] = [];
232
- }
233
- this.total = 0;
234
- this.pages = 1;
235
- this.loading = false;
236
- this.done = false;
237
- },
238
- getData: function (page = 1, append = false) {
239
- this.loading = true;
240
- this.per = 10;
241
- this.done = false;
242
- let query = this.query;
243
- let params = {
244
- strict: ~~this.strict,
245
- per: this.per,
246
- page: page,
247
- client: this.client,
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
- if (this.type === "authors") {
252
- if (!this.query) {
253
- this.resetResultState("authors");
254
- this.done = true;
255
- return;
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
- params = {
259
- ...params,
260
- name: query,
261
- };
262
- loadAuthors(params)
263
- .then((res) => {
264
- if (!append) this.authors = [];
265
- let list = this.transformData(res.data.data.list);
266
- this.authors = this.authors.concat(list);
267
- this.pages = res.data.data.pages;
268
- this.total = res.data.data.total;
269
- })
270
- .finally(() => {
271
- this.done = true;
272
- this.loading = false;
273
- });
274
- } else if (this.type === "emotions") {
275
- this.per = 24;
276
- params = {
277
- per: this.per,
278
- page: page,
279
- search: query,
280
- };
281
- loadEmotions(params)
282
- .then((res) => {
283
- if (!append) this.emotions = [];
284
- let list = this.transformData(res.data.data.list);
285
- this.emotions = this.emotions.concat(list);
286
- this.pages = res.data.data.pages;
287
- this.total = res.data.data.total;
288
- })
289
- .finally(() => {
290
- this.done = true;
291
- this.loading = false;
292
- });
293
- } else if (this.type === "letter") {
294
- const { per, page } = params;
295
- const _params = { per, page };
296
- if (this.query) _params._search = this.query;
297
- getLetterPaper(_params)
298
- .then((res) => {
299
- if (!append) this.letter = [];
300
- let list = this.transformData(res.data.data.list);
301
- this.letter = this.letter.concat(list);
302
- this.pages = res.data.data.pages;
303
- this.total = res.data.data.total;
304
- })
305
- .finally(() => {
306
- this.done = true;
307
- this.loading = false;
308
- });
309
- }
310
- },
311
- search: function () {
312
- if (this.type === "combo") {
313
- this.$refs.combo?.search();
314
- } else {
315
- this.page = 1;
316
- this.getData();
317
- }
318
- },
319
- appendPage: function () {
320
- this.getData(++this.page, true);
321
- },
322
- changePage: function (i) {
323
- this.getData(i);
324
- },
325
- changeType: function (tab) {
326
- const nextType = tab?.paneName || tab?.props?.name || tab?.name;
327
- if (nextType) this.type = nextType;
328
- this.page = 1;
329
- this.resetResultState(this.type);
330
- this.html = "";
331
- if (this.type === "combo") {
332
- return;
333
- }
334
- this.getData();
335
- },
336
- setAuthors: function () {
337
- try {
338
- let author = sessionStorage.getItem("atAuthor");
339
- if (author) {
340
- author = JSON.parse(author);
341
- author = author.split(",") || [];
342
- if (this.selectedAuthor.ID && !author.includes(String(this.selectedAuthor.ID))) {
343
- author.push(this.selectedAuthor.ID);
344
- }
345
- sessionStorage.setItem("atAuthor", JSON.stringify(author.join(",")));
346
- } else {
347
- sessionStorage.setItem("atAuthor", JSON.stringify(String(this.selectedAuthor.ID)));
348
- }
349
- } catch (error) {
350
- console.log(error);
351
- }
352
- },
353
- insert: function () {
354
- if (this.type === "authors") {
355
- if (this.userStatus == 0 && this.canInsertAuthor) {
356
- if (this.selectedAuthor.ID) {
357
- this.setAuthors();
358
- this.$emit("insert", this.html);
359
- this.dialogVisible = false;
360
- this.selectedAuthor = {};
361
- } else {
362
- this.$message.warning("请选择一个用户");
363
- }
364
- } else {
365
- this.$alert("您的等级不足或无权限(Lv2以上可用)", "消息");
366
- }
367
- } else {
368
- if (this.type === "combo") {
369
- const html = this.$refs.combo.renderVal();
370
- this.$emit("insert", html);
371
- } else {
372
- this.$emit("insert", this.html);
373
- }
374
- this.dialogVisible = false;
375
- }
376
- },
377
- transformData: function (data) {
378
- data.forEach((item) => {
379
- item.isSelected = false;
380
- });
381
- return data;
382
- },
383
- selectAuthor: function (o) {
384
- this.resetItems();
385
- this.selectedAuthor = o;
386
- o.isSelected = true;
387
- 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>`;
388
- },
389
- selectEmotion: function (o) {
390
- this.resetItems();
391
- o.isSelected = true;
392
- 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>`;
393
- },
394
- // 信纸
395
- selectLetter(o) {
396
- this.resetItems();
397
- o.isSelected = true;
398
- const { slug, style, remark } = o;
399
- const titleHtml = `<div class="e-letter-title letter-title--${slug}">${remark}</div>`;
400
- 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>`;
401
- this.html = `<div class="e-letter letter--${slug}">${titleHtml}<br/> ${contentHtml}</div></div><style>${style}</style>`;
402
- },
403
- resetItems: function () {
404
- let data = this[this.type];
405
- data.forEach((item) => {
406
- item.isSelected = false;
407
- });
408
- this.html = "";
409
- },
410
- getLink: function (type, id) {
411
- let domain = this.client == "origin" ? __OriginRoot : __Root;
412
- return domain + getLink(type, id).slice(1);
413
- },
414
- userAvatar: function (url) {
415
- return showAvatar(url, "m");
416
- },
417
- loadUserInfo: function () {
418
- if (!this.uid) return;
419
- getUserInfo(this.uid).then((res) => {
420
- this.userInfo = res;
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
- openDialog: function () {
427
- this.dialogVisible = true;
428
- if (!this.actived) {
429
- loadStat().then((data) => {
430
- this.stat = data;
431
- this.actived = true;
432
- });
433
- }
434
- },
435
- resolveImagePath,
436
- },
437
- created: function () {
438
- this.loadUserInfo();
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
- padding: 0 !important;
448
- background: none !important;
449
- border: none;
524
+ padding: 0 !important;
525
+ background: none !important;
526
+ border: none;
450
527
  }
451
528
  .m-database-tabs .m-letter-list {
452
- .flex;
453
- flex-wrap: wrap;
454
- gap: 20px;
455
- .m-letter {
456
- .pointer;
457
- .pr;
458
- .size(20%,80px);
459
- box-sizing: border-box;
460
- border: 3px solid transparent;
461
- &.active {
462
- .r(5px);
463
- border: 3px solid #409eff;
464
- &::after {
465
- .none;
466
- }
467
- }
468
- .e-letter {
469
- .w(100%);
470
- .e-letter-title {
471
- .w(100%);
472
- }
473
- .e-letter-content {
474
- .none;
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
@@ -541,6 +541,10 @@ export default {
541
541
  flex-direction: column;
542
542
  gap: 12px;
543
543
 
544
+ .vditor-sv{
545
+ font-family: var(--apple-font-family);
546
+ }
547
+
544
548
  &__host {
545
549
  overflow: visible;
546
550
  border: 1px solid #dcdfe6;
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"> <img class="u-icon" svg-inline src="./assets/img/jx3.svg" />剑三资源 </el-button>
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 size="large" class="u-input" placeholder="请输入 ID 或 名称" v-model="query" @change="search" @keyup.enter="search">
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 v-model="strict" active-text="精确匹配" @change="search" title="仅对Buff/Skill有效"></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 v-if="!skill.length && done" title="没有找到相关条目" type="info" show-icon></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 popper-class="m-item-pop" :visible-arrow="false" trigger="hover" placement="left" v-for="(o, i) in item" :key="o.id">
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 class="u-item" :class="{ on: o.isSelected }" @click="selectItem(o, i)" :ref="(el) => setResultItemRef('item', i, el)">
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 class="m-archive-more" :class="{ show: hasNextPage }" type="primary" icon="ArrowDown" @click="appendPage" size="large">加载更多</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 ${o.CanCancel === 1 ? "isBuff" : "isDebuff"}" href="${this.getDbLink(
494
- "buff",
495
- this.client,
496
- o.BuffID,
497
- o.Level
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(this.getResultItemHtml("buff", i))}</pre>`;
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("skill", this.client, o.SkillID, o.Level)}" data-client="${this.client}" data-id="${
508
- o.SkillID
509
- }" data-level="${o.Level}">[${o.Name}]</a>`;
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(this.getResultItemHtml("skill", i))}</pre>`;
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${o.Quality} w-jx3-element" data-mode="" data-id="${o.id}" data-quality="${o.Quality}" data-client="${this.client}" target="_blank" href="${this.getLink("item", o.id)}">[${o.Name}]</a>`;
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="${o.ID}" data-client="${this.client}" target="_blank" href="${this.getDbLink("npc", this.client, o.ID)}">[${o.Name}]</a>`;
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"><span>{{ tipText }}</span></div>
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