@jx3box/jx3box-editor 2.0.3 → 2.0.4
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/assets/css/tinymce/p.less +2 -2
- package/package.json +1 -1
- package/public/css/article.css +1 -1
- package/service/cms.js +10 -1
- package/src/BoxResource.vue +415 -455
- package/src/Tinymce.vue +142 -204
- package/src/components/Letter.vue +37 -0
- package/src/components/LetterDemo.vue +93 -0
package/src/BoxResource.vue
CHANGED
|
@@ -1,480 +1,408 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class="u-switch"
|
|
6
|
-
type="primary"
|
|
7
|
-
@click="openDialog"
|
|
8
|
-
:disabled="!enable"
|
|
9
|
-
>
|
|
10
|
-
<img class="u-icon" svg-inline :src="boxIcon" />魔盒资源
|
|
11
|
-
</el-button>
|
|
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>
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<el-radio-button label="std">重制</el-radio-button>
|
|
29
|
-
<el-radio-button label="origin">缘起</el-radio-button>
|
|
30
|
-
</el-radio-group>
|
|
31
|
-
<el-input
|
|
32
|
-
class="u-input"
|
|
33
|
-
:placeholder="placeholderText"
|
|
34
|
-
v-model="query"
|
|
35
|
-
@change="search"
|
|
36
|
-
@keyup.enter.native="search"
|
|
37
|
-
>
|
|
38
|
-
<template slot="prepend">关键词</template>
|
|
39
|
-
<template slot="append">
|
|
40
|
-
<el-switch v-model="strict" active-text="精确匹配"></el-switch>
|
|
41
|
-
</template>
|
|
42
|
-
</el-input>
|
|
43
|
-
</div>
|
|
6
|
+
<!-- 弹出界面 -->
|
|
7
|
+
<el-dialog v-draggable class="c-large-dialog" title="魔盒资源库" :visible.sync="dialogVisible">
|
|
8
|
+
<div class="c-resource-content" v-loading="loading">
|
|
9
|
+
<div class="m-database-search">
|
|
10
|
+
<el-radio-group class="u-client" v-model="comboClient" @change="search" v-if="type === 'combo'">
|
|
11
|
+
<el-radio-button label="std">重制</el-radio-button>
|
|
12
|
+
<el-radio-button label="origin">缘起</el-radio-button>
|
|
13
|
+
</el-radio-group>
|
|
14
|
+
<el-input class="u-input" :placeholder="placeholderText" v-model="query" @change="search" @keyup.enter.native="search">
|
|
15
|
+
<template slot="prepend">关键词</template>
|
|
16
|
+
<template slot="append">
|
|
17
|
+
<el-switch v-model="strict" active-text="精确匹配"></el-switch>
|
|
18
|
+
</template>
|
|
19
|
+
</el-input>
|
|
20
|
+
</div>
|
|
44
21
|
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<b>{{ total }}</b> 条记录
|
|
107
|
-
</p>
|
|
108
|
-
<ul class="m-resource-emotion">
|
|
109
|
-
<li
|
|
110
|
-
v-for="o in emotions"
|
|
111
|
-
class="u-item"
|
|
112
|
-
:key="o.id"
|
|
113
|
-
:class="{ on: !!o.isSelected }"
|
|
114
|
-
@click="selectEmotion(o)"
|
|
115
|
-
ref="emotion"
|
|
116
|
-
>
|
|
117
|
-
<img
|
|
118
|
-
class="e-jx3-emotion"
|
|
119
|
-
:src="resolveImagePath(o.url)"
|
|
120
|
-
:alt="query"
|
|
121
|
-
/>
|
|
122
|
-
</li>
|
|
123
|
-
</ul>
|
|
124
|
-
<el-alert
|
|
125
|
-
v-if="!emotions.length && done"
|
|
126
|
-
title="没有找到相关条目"
|
|
127
|
-
type="info"
|
|
128
|
-
show-icon
|
|
129
|
-
></el-alert>
|
|
130
|
-
</el-tab-pane>
|
|
131
|
-
<el-tab-pane label="连招" name="combo">
|
|
132
|
-
<span slot="label" class="u-tab-label">
|
|
133
|
-
<i
|
|
134
|
-
class="el-icon-lollipop"
|
|
135
|
-
style="margin-right: 5px"
|
|
136
|
-
></i>
|
|
137
|
-
<b>连招</b>
|
|
138
|
-
</span>
|
|
139
|
-
<ComboVue :query="query" ref="combo" :client="comboClient" :strict="strict"></ComboVue>
|
|
140
|
-
</el-tab-pane>
|
|
141
|
-
</el-tabs>
|
|
22
|
+
<el-tabs class="m-database-tabs" v-model="type" type="card" @tab-click="changeType">
|
|
23
|
+
<el-tab-pane label="魔盒用户" name="authors">
|
|
24
|
+
<span slot="label" class="u-tab-label">
|
|
25
|
+
<i class="el-icon-s-custom" style="margin-right: 5px"></i>
|
|
26
|
+
<b>用户</b>
|
|
27
|
+
<i class="u-lv-box">Lv2+</i>
|
|
28
|
+
</span>
|
|
29
|
+
<p v-if="total && done" class="m-resource-count">
|
|
30
|
+
<i class="el-icon-s-data"></i> 共找到 <b>{{ total }}</b> 条记录
|
|
31
|
+
</p>
|
|
32
|
+
<ul class="m-resource-list">
|
|
33
|
+
<li v-for="(o, i) in authors" class="u-item" :key="i" :class="{ on: !!o.isSelected }" @click="selectAuthor(o, i)" ref="author">
|
|
34
|
+
<span class="u-id">ID:{{ o.ID }}</span>
|
|
35
|
+
<img class="u-pic" :title="'AuthorID:' + o.display_name" :src="userAvatar(o.user_avatar)" />
|
|
36
|
+
<span class="u-primary">
|
|
37
|
+
<span class="u-name">
|
|
38
|
+
{{ o.display_name }}
|
|
39
|
+
</span>
|
|
40
|
+
<div class="u-remark">
|
|
41
|
+
{{ o.user_bio }}
|
|
42
|
+
</div>
|
|
43
|
+
</span>
|
|
44
|
+
</li>
|
|
45
|
+
</ul>
|
|
46
|
+
<el-alert v-if="!authors.length && done" title="没有找到相关条目" type="info" show-icon></el-alert>
|
|
47
|
+
</el-tab-pane>
|
|
48
|
+
<el-tab-pane label="剑三趣图" name="emotions">
|
|
49
|
+
<span slot="label" class="u-tab-label">
|
|
50
|
+
<i class="el-icon-sugar" style="margin-right: 5px"></i>
|
|
51
|
+
<b>趣图</b>
|
|
52
|
+
</span>
|
|
53
|
+
<p v-if="total && done" class="m-resource-count">
|
|
54
|
+
<i class="el-icon-s-data"></i> 共找到 <b>{{ total }}</b> 条记录
|
|
55
|
+
</p>
|
|
56
|
+
<ul class="m-resource-emotion">
|
|
57
|
+
<li v-for="o in emotions" class="u-item" :key="o.id" :class="{ on: !!o.isSelected }" @click="selectEmotion(o)" ref="emotion">
|
|
58
|
+
<img class="e-jx3-emotion" :src="resolveImagePath(o.url)" :alt="query" />
|
|
59
|
+
</li>
|
|
60
|
+
</ul>
|
|
61
|
+
<el-alert v-if="!emotions.length && done" title="没有找到相关条目" type="info" show-icon></el-alert>
|
|
62
|
+
</el-tab-pane>
|
|
63
|
+
<el-tab-pane label="连招" name="combo">
|
|
64
|
+
<span slot="label" class="u-tab-label">
|
|
65
|
+
<i class="el-icon-lollipop" style="margin-right: 5px"></i>
|
|
66
|
+
<b>连招</b>
|
|
67
|
+
</span>
|
|
68
|
+
<ComboVue :query="query" ref="combo" :client="comboClient" :strict="strict"></ComboVue>
|
|
69
|
+
</el-tab-pane>
|
|
70
|
+
<el-tab-pane label="信纸" name="letter">
|
|
71
|
+
<span slot="label" class="u-tab-label">
|
|
72
|
+
<i class="el-icon-coffee-cup" style="margin-right: 5px"></i>
|
|
73
|
+
<b>信纸</b>
|
|
74
|
+
</span>
|
|
75
|
+
<div class="m-letter-list">
|
|
76
|
+
<div class="m-letter" :class="{ active: !!o.isSelected }" v-for="o in filterLetter" :key="o.id" @click="selectLetter(o)">
|
|
77
|
+
<LetterPaper :data="o" />
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
<el-alert v-if="!letter.length && done" title="没有找到相关条目" type="info" show-icon></el-alert>
|
|
81
|
+
</el-tab-pane>
|
|
82
|
+
</el-tabs>
|
|
142
83
|
|
|
143
|
-
|
|
144
|
-
{{ multipage && type !== "combo" }}
|
|
145
|
-
<!-- 下一页 -->
|
|
146
|
-
<el-button
|
|
147
|
-
class="m-archive-more"
|
|
148
|
-
:class="{ show: hasNextPage }"
|
|
149
|
-
type="primary"
|
|
150
|
-
icon="el-icon-arrow-down"
|
|
151
|
-
@click="appendPage"
|
|
152
|
-
>加载更多</el-button
|
|
153
|
-
>
|
|
154
|
-
<!-- 分页 -->
|
|
155
|
-
<el-pagination
|
|
156
|
-
class="m-archive-pages"
|
|
157
|
-
background
|
|
158
|
-
layout="total, prev, pager, next,jumper"
|
|
159
|
-
:hide-on-single-page="true"
|
|
160
|
-
:page-size="per"
|
|
161
|
-
:total="total"
|
|
162
|
-
:current-page.sync="page"
|
|
163
|
-
@current-change="changePage"
|
|
164
|
-
></el-pagination>
|
|
165
|
-
</template>
|
|
84
|
+
<template v-if="multipage && type !== 'combo'"> </template>
|
|
166
85
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
86
|
+
<div class="m-database-tip" v-show="isBlank && type !== 'combo'">❤ 请输入搜索条件查询</div>
|
|
87
|
+
</div>
|
|
171
88
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
89
|
+
<!-- 插入按钮 -->
|
|
90
|
+
<span slot="footer" class="dialog-footer">
|
|
91
|
+
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
92
|
+
<el-button type="primary" @click="insert">
|
|
93
|
+
{{ buttonTXT }}
|
|
94
|
+
</el-button>
|
|
95
|
+
</span>
|
|
96
|
+
</el-dialog>
|
|
97
|
+
</div>
|
|
181
98
|
</template>
|
|
182
99
|
|
|
183
100
|
<script>
|
|
184
101
|
import { loadStat } from "../service/database";
|
|
185
|
-
import { loadAuthors, loadEmotions } from "../service/cms";
|
|
102
|
+
import { loadAuthors, loadEmotions, getLetterPaper } from "../service/cms";
|
|
186
103
|
import { getUserInfo } from "../service/author";
|
|
187
|
-
import {
|
|
188
|
-
|
|
189
|
-
__Root,
|
|
190
|
-
__OriginRoot,
|
|
191
|
-
__imgPath,
|
|
192
|
-
} from "@jx3box/jx3box-common/data/jx3box.json";
|
|
193
|
-
import {
|
|
194
|
-
getLink,
|
|
195
|
-
showAvatar,
|
|
196
|
-
resolveImagePath,
|
|
197
|
-
} from "@jx3box/jx3box-common/js/utils";
|
|
104
|
+
import { __iconPath, __Root, __OriginRoot, __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
105
|
+
import { getLink, showAvatar, resolveImagePath } from "@jx3box/jx3box-common/js/utils";
|
|
198
106
|
import User from "@jx3box/jx3box-common/js/user";
|
|
199
107
|
|
|
200
108
|
import ComboVue from "./components/Combo.vue";
|
|
109
|
+
import LetterPaper from "./components/Letter.vue";
|
|
201
110
|
export default {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
111
|
+
name: "BoxResource",
|
|
112
|
+
components: {
|
|
113
|
+
ComboVue,
|
|
114
|
+
LetterPaper,
|
|
115
|
+
},
|
|
116
|
+
props: {
|
|
117
|
+
enable: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: true,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
data: function () {
|
|
123
|
+
return {
|
|
124
|
+
dialogVisible: false,
|
|
125
|
+
actived: false,
|
|
126
|
+
userInfo: {},
|
|
217
127
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
128
|
+
type: "authors",
|
|
129
|
+
query: "",
|
|
130
|
+
strict: false,
|
|
131
|
+
client: location.hostname.includes("origin") ? "origin" : "std",
|
|
132
|
+
comboClient: "std",
|
|
223
133
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
134
|
+
skill: [],
|
|
135
|
+
buff: [],
|
|
136
|
+
item: [],
|
|
137
|
+
icon: [],
|
|
138
|
+
npc: [],
|
|
139
|
+
authors: [],
|
|
140
|
+
selectedAuthor: {},
|
|
141
|
+
emotions: [],
|
|
142
|
+
letter: [],
|
|
232
143
|
|
|
233
|
-
|
|
234
|
-
|
|
144
|
+
done: false,
|
|
145
|
+
loading: false,
|
|
235
146
|
|
|
236
|
-
|
|
147
|
+
isSuper: false,
|
|
237
148
|
|
|
238
|
-
|
|
149
|
+
html: "",
|
|
239
150
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
151
|
+
per: 10,
|
|
152
|
+
page: 1,
|
|
153
|
+
total: 1,
|
|
154
|
+
pages: 1,
|
|
244
155
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
156
|
+
placeholderTexts: {
|
|
157
|
+
authors: "请输入 ID 或 名称",
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
computed: {
|
|
162
|
+
placeholderText: function () {
|
|
163
|
+
return this.placeholderTexts[this.type];
|
|
164
|
+
},
|
|
165
|
+
buttonTXT: function () {
|
|
166
|
+
return this.selectedCount ? "插 入" : "确 定";
|
|
167
|
+
},
|
|
168
|
+
isBlank: function () {
|
|
169
|
+
return !this.query && !this[this.type]?.["length"];
|
|
170
|
+
},
|
|
171
|
+
selectedCount: function () {
|
|
172
|
+
return !!this.html;
|
|
173
|
+
},
|
|
174
|
+
isNumber: function () {
|
|
175
|
+
return !isNaN(this.query);
|
|
176
|
+
},
|
|
177
|
+
hasNextPage: function () {
|
|
178
|
+
return this.total > 1 && this.page < this.pages;
|
|
179
|
+
},
|
|
180
|
+
multipage: function () {
|
|
181
|
+
return this.type !== "icon" && this.done && this.pages > 1;
|
|
182
|
+
},
|
|
183
|
+
iconDir: function () {
|
|
184
|
+
return this.client === "origin" ? "origin_icon" : "icon";
|
|
185
|
+
},
|
|
186
|
+
userStatus: function () {
|
|
187
|
+
return User.getInfo().status;
|
|
188
|
+
},
|
|
189
|
+
uid: function () {
|
|
190
|
+
return User.getInfo().uid;
|
|
191
|
+
},
|
|
192
|
+
canInsertAuthor: function () {
|
|
193
|
+
return User.getLevel(this.userInfo && this.userInfo.experience) >= 2;
|
|
194
|
+
},
|
|
195
|
+
boxIcon: function () {
|
|
196
|
+
return __imgPath + "image/common/jx3box_white.svg";
|
|
197
|
+
},
|
|
198
|
+
filterLetter() {
|
|
199
|
+
return this.letter;
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
watch: {
|
|
203
|
+
html: function (newval) {
|
|
204
|
+
this.$emit("update", newval);
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
methods: {
|
|
208
|
+
getData: function (page = 1, append = false) {
|
|
209
|
+
this.loading = true;
|
|
210
|
+
this.per = 10;
|
|
211
|
+
this.done = false;
|
|
212
|
+
let query = this.query;
|
|
213
|
+
let params = {
|
|
214
|
+
strict: ~~this.strict,
|
|
215
|
+
per: this.per,
|
|
216
|
+
page: page,
|
|
217
|
+
client: this.client,
|
|
218
|
+
};
|
|
307
219
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
220
|
+
// 图标
|
|
221
|
+
if (this.type === "authors") {
|
|
222
|
+
if (!this.query) {
|
|
223
|
+
this.loading = false;
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
314
226
|
|
|
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
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
227
|
+
params = {
|
|
228
|
+
...params,
|
|
229
|
+
name: query,
|
|
230
|
+
};
|
|
231
|
+
loadAuthors(params)
|
|
232
|
+
.then((res) => {
|
|
233
|
+
if (!append) this.authors = [];
|
|
234
|
+
let list = this.transformData(res.data.data.list);
|
|
235
|
+
this.authors = this.authors.concat(list);
|
|
236
|
+
this.pages = res.data.data.pages;
|
|
237
|
+
this.total = res.data.data.total;
|
|
238
|
+
})
|
|
239
|
+
.finally(() => {
|
|
240
|
+
this.done = true;
|
|
241
|
+
this.loading = false;
|
|
242
|
+
});
|
|
243
|
+
} else if (this.type === "emotions") {
|
|
244
|
+
this.per = 24;
|
|
245
|
+
params = {
|
|
246
|
+
per: this.per,
|
|
247
|
+
page: page,
|
|
248
|
+
search: query,
|
|
249
|
+
};
|
|
250
|
+
loadEmotions(params)
|
|
251
|
+
.then((res) => {
|
|
252
|
+
if (!append) this.emotions = [];
|
|
253
|
+
let list = this.transformData(res.data.data.list);
|
|
254
|
+
this.emotions = this.emotions.concat(list);
|
|
255
|
+
this.pages = res.data.data.pages;
|
|
256
|
+
this.total = res.data.data.total;
|
|
257
|
+
})
|
|
258
|
+
.finally(() => {
|
|
259
|
+
this.done = true;
|
|
260
|
+
this.loading = false;
|
|
261
|
+
});
|
|
262
|
+
} else if (this.type === "letter") {
|
|
263
|
+
const { per, page } = params;
|
|
264
|
+
const _params = { per, page };
|
|
265
|
+
if (this.query) _params._search = this.query;
|
|
266
|
+
getLetterPaper(_params)
|
|
267
|
+
.then((res) => {
|
|
268
|
+
if (!append) this.letter = [];
|
|
269
|
+
let list = this.transformData(res.data.data.list);
|
|
270
|
+
this.letter = this.letter.concat(list);
|
|
271
|
+
this.pages = res.data.data.pages;
|
|
272
|
+
this.total = res.data.data.total;
|
|
273
|
+
})
|
|
274
|
+
.finally(() => {
|
|
275
|
+
this.done = true;
|
|
276
|
+
this.loading = false;
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
search: function () {
|
|
281
|
+
if (this.type === "combo") {
|
|
282
|
+
this.$refs.combo?.search();
|
|
283
|
+
} else {
|
|
284
|
+
this.page = 1;
|
|
285
|
+
this.getData();
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
appendPage: function () {
|
|
289
|
+
this.getData(++this.page, true);
|
|
290
|
+
},
|
|
291
|
+
changePage: function (i) {
|
|
292
|
+
this.getData(i);
|
|
293
|
+
},
|
|
294
|
+
changeType: function () {
|
|
295
|
+
this.page = 1;
|
|
296
|
+
if (this.type === "combo") {
|
|
297
|
+
this.done = false;
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
this.getData();
|
|
301
|
+
},
|
|
302
|
+
setAuthors: function () {
|
|
303
|
+
try {
|
|
304
|
+
let author = sessionStorage.getItem("atAuthor");
|
|
305
|
+
if (author) {
|
|
306
|
+
author = JSON.parse(author);
|
|
307
|
+
author = author.split(",") || [];
|
|
308
|
+
if (this.selectedAuthor.ID && !author.includes(String(this.selectedAuthor.ID))) {
|
|
309
|
+
author.push(this.selectedAuthor.ID);
|
|
310
|
+
}
|
|
311
|
+
sessionStorage.setItem("atAuthor", JSON.stringify(author.join(",")));
|
|
312
|
+
} else {
|
|
313
|
+
sessionStorage.setItem("atAuthor", JSON.stringify(String(this.selectedAuthor.ID)));
|
|
314
|
+
}
|
|
315
|
+
} catch (error) {
|
|
316
|
+
console.log(error);
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
insert: function () {
|
|
320
|
+
if (this.type === "authors") {
|
|
321
|
+
if (this.userStatus == 0 && this.canInsertAuthor) {
|
|
322
|
+
if (this.selectedAuthor.ID) {
|
|
323
|
+
this.setAuthors();
|
|
324
|
+
this.$emit("insert", this.html);
|
|
325
|
+
this.dialogVisible = false;
|
|
326
|
+
this.selectedAuthor = {};
|
|
327
|
+
} else {
|
|
328
|
+
this.$message.warning("请选择一个用户");
|
|
329
|
+
}
|
|
330
|
+
} else {
|
|
331
|
+
this.$alert("您的等级不足或无权限(Lv2以上可用)", "消息");
|
|
332
|
+
}
|
|
333
|
+
} else {
|
|
334
|
+
if (this.type === "combo") {
|
|
335
|
+
const html = this.$refs.combo.renderVal();
|
|
336
|
+
this.$emit("insert", html);
|
|
337
|
+
} else {
|
|
338
|
+
this.$emit("insert", this.html);
|
|
339
|
+
}
|
|
340
|
+
this.dialogVisible = false;
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
transformData: function (data) {
|
|
344
|
+
data.forEach((item) => {
|
|
345
|
+
item.isSelected = false;
|
|
346
|
+
});
|
|
347
|
+
return data;
|
|
348
|
+
},
|
|
349
|
+
selectAuthor: function (o) {
|
|
350
|
+
this.resetItems();
|
|
351
|
+
this.selectedAuthor = o;
|
|
352
|
+
o.isSelected = true;
|
|
353
|
+
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>`;
|
|
354
|
+
},
|
|
355
|
+
selectEmotion: function (o) {
|
|
356
|
+
this.resetItems();
|
|
357
|
+
o.isSelected = true;
|
|
358
|
+
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>`;
|
|
359
|
+
},
|
|
360
|
+
// 信纸
|
|
361
|
+
selectLetter(o) {
|
|
362
|
+
this.resetItems();
|
|
363
|
+
o.isSelected = true;
|
|
364
|
+
const { slug, style } = o;
|
|
365
|
+
const titleHtml = `<div class="e-letter-title letter-title--${slug}">我是标题</div>`;
|
|
366
|
+
const contentHtml = `<div class="e-letter-content letter-header--${slug}"><div class="u-letter-content--header letter-footer--${slug}"><div class="u-letter-content--footer letter-body--${slug}"><p>明月几时有,把酒问青天。</p></div></div></div>`;
|
|
367
|
+
this.html = `<div class="e-letter letter--${slug}">${titleHtml}<br/> ${contentHtml}</div></div><style>${style}</style>`;
|
|
368
|
+
},
|
|
369
|
+
resetItems: function () {
|
|
370
|
+
let data = this[this.type];
|
|
371
|
+
data.forEach((item) => {
|
|
372
|
+
item.isSelected = false;
|
|
373
|
+
});
|
|
374
|
+
this.html = "";
|
|
375
|
+
},
|
|
376
|
+
getLink: function (type, id) {
|
|
377
|
+
let domain = this.client == "origin" ? __OriginRoot : __Root;
|
|
378
|
+
return domain + getLink(type, id).slice(1);
|
|
379
|
+
},
|
|
380
|
+
userAvatar: function (url) {
|
|
381
|
+
return showAvatar(url, "m");
|
|
382
|
+
},
|
|
383
|
+
loadUserInfo: function () {
|
|
384
|
+
if (!this.uid) return;
|
|
385
|
+
getUserInfo(this.uid).then((res) => {
|
|
386
|
+
this.userInfo = res;
|
|
387
|
+
});
|
|
388
|
+
},
|
|
461
389
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
390
|
+
// 杂项
|
|
391
|
+
// ==============================
|
|
392
|
+
openDialog: function () {
|
|
393
|
+
this.dialogVisible = true;
|
|
394
|
+
if (!this.actived) {
|
|
395
|
+
loadStat().then((data) => {
|
|
396
|
+
this.stat = data;
|
|
397
|
+
this.actived = true;
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
resolveImagePath,
|
|
402
|
+
},
|
|
403
|
+
created: function () {
|
|
404
|
+
this.loadUserInfo();
|
|
405
|
+
},
|
|
478
406
|
};
|
|
479
407
|
</script>
|
|
480
408
|
|
|
@@ -482,8 +410,40 @@ export default {
|
|
|
482
410
|
@import "../assets/css/resource.less";
|
|
483
411
|
|
|
484
412
|
.m-item-pop {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
413
|
+
padding: 0 !important;
|
|
414
|
+
background: none !important;
|
|
415
|
+
border: none;
|
|
416
|
+
}
|
|
417
|
+
.m-database-tabs .m-letter-list {
|
|
418
|
+
.flex;
|
|
419
|
+
flex-wrap: wrap;
|
|
420
|
+
gap: 20px;
|
|
421
|
+
.m-letter {
|
|
422
|
+
.pointer;
|
|
423
|
+
.pr;
|
|
424
|
+
box-sizing: border-box;
|
|
425
|
+
border: 3px solid transparent;
|
|
426
|
+
&::after {
|
|
427
|
+
content: "";
|
|
428
|
+
display: block;
|
|
429
|
+
.full;
|
|
430
|
+
.pa;
|
|
431
|
+
.lt(0);
|
|
432
|
+
.z(1);
|
|
433
|
+
.tm(0.3);
|
|
434
|
+
.r(3px);
|
|
435
|
+
background: #000;
|
|
436
|
+
}
|
|
437
|
+
&.active {
|
|
438
|
+
.r(5px);
|
|
439
|
+
border: 3px solid #409eff;
|
|
440
|
+
&::after {
|
|
441
|
+
.none;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
.e-letter {
|
|
445
|
+
zoom: 0.7;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
488
448
|
}
|
|
489
449
|
</style>
|