@jx3box/jx3box-ui 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +22 -13
- package/.storybook/storybookMocks.js +191 -0
- package/README.md +6 -19
- package/assets/css/bread/admin.less +20 -2
- package/assets/css/bread/breadcrumb.less +5 -2
- package/assets/css/comment/quick-reply.less +1 -1
- package/assets/css/common/left-sidebar.less +1 -1
- package/assets/css/interact/like2.less +5 -2
- package/assets/css/single/author.less +15 -10
- package/assets/css/single/cms-single.less +1 -0
- package/assets/css/single/thx.less +34 -11
- package/assets/data/nav.json +344 -10
- package/assets/img/comment/comment.svg +1 -1
- package/assets/img/comment/heart_1.svg +1 -1
- package/assets/img/comment/hide.svg +1 -1
- package/assets/img/leftsidebar/medal.svg +1 -1
- package/assets/img/leftsidebar/post.svg +27 -46
- package/i18n/messages/en-US.js +357 -22
- package/i18n/messages/vi.js +350 -22
- package/i18n/messages/zh-CN.js +469 -20
- package/i18n/messages/zh-TW.js +350 -22
- package/index.js +19 -7
- package/package.json +8 -5
- package/service/cms.js +22 -0
- package/service/commit-history.js +18 -0
- package/service/community.js +60 -0
- package/service/fav.js +5 -6
- package/src/App.vue +154 -80
- package/src/Breadcrumb.vue +24 -11
- package/src/CommonFooter.vue +2 -2
- package/src/Footer.vue +13 -5
- package/src/LeftSideToggle.vue +10 -3
- package/src/LeftSidebar.vue +19 -5
- package/src/Main.vue +9 -2
- package/src/RightSidebar.vue +12 -3
- package/src/SuspendCommon.vue +52 -38
- package/src/author/AuthorFans.vue +7 -5
- package/src/author/AuthorFollow.vue +14 -7
- package/src/author/AuthorGift.vue +25 -17
- package/src/author/AuthorInfo.vue +46 -19
- package/src/author/AuthorLink.vue +3 -1
- package/src/author/AuthorMedals.vue +5 -2
- package/src/author/AuthorPosts.vue +31 -13
- package/src/author/AuthorRss.vue +7 -3
- package/src/author/AuthorTeams.vue +3 -1
- package/src/author/UserPop.vue +29 -17
- package/src/bread/Admin.vue +55 -32
- package/src/bread/AdminDirectMessage.vue +15 -8
- package/src/bread/AdminDrop.vue +124 -45
- package/src/bread/CommunityAdmin.vue +527 -0
- package/src/bread/DesignTask.vue +30 -26
- package/src/bread/ListAdmin.vue +199 -0
- package/src/bread/MigrateCommunity.vue +192 -0
- package/src/bread/MoveToCommunityDialog.vue +234 -0
- package/src/comment/Avatar.vue +18 -24
- package/src/comment/CommentContent.vue +57 -37
- package/src/comment/CommentContentSimple.vue +61 -63
- package/src/comment/CommentInputForm.vue +45 -34
- package/src/comment/CommentWithReply.vue +9 -6
- package/src/comment/QuickReply.vue +5 -1
- package/src/comment/ReplyForReply.vue +6 -4
- package/src/comment/ReplyList.vue +28 -18
- package/src/comment/Upload.vue +24 -6
- package/src/filters/clientBy.vue +10 -8
- package/src/filters/markBy.vue +35 -31
- package/src/filters/menuBy.vue +20 -22
- package/src/filters/orderBy.vue +17 -11
- package/src/filters/tagBy.vue +4 -2
- package/src/filters/topicBy.vue +12 -10
- package/src/filters/versionBy.vue +5 -3
- package/src/filters/zlpBy.vue +29 -25
- package/src/footer/copyright.vue +5 -5
- package/src/footer/links.vue +2 -2
- package/src/footer/official.vue +1 -1
- package/src/footer/resource.vue +6 -6
- package/src/header/alternate.vue +35 -18
- package/src/header/asset.vue +9 -19
- package/src/header/box.vue +20 -8
- package/src/header/box2.vue +16 -9
- package/src/header/client.vue +7 -7
- package/src/header/lang.vue +41 -6
- package/src/header/logo.vue +2 -3
- package/src/header/manage.vue +2 -2
- package/src/header/message.vue +3 -3
- package/src/header/nav.vue +26 -23
- package/src/header/publish.vue +2 -2
- package/src/header/search.vue +2 -2
- package/src/header/shop.vue +2 -2
- package/src/header/user.vue +4 -4
- package/src/header/userInfo.vue +22 -24
- package/src/header/vip.vue +2 -2
- package/src/interact/BoxcoinAdmin.vue +30 -16
- package/src/interact/BoxcoinRecords.vue +28 -11
- package/src/interact/BoxcoinUser.vue +33 -17
- package/src/interact/Fav.vue +5 -1
- package/src/interact/Homework.vue +318 -0
- package/src/interact/Like.vue +4 -2
- package/src/interact/Rss.vue +10 -4
- package/src/interact/Share.vue +18 -19
- package/src/interact/WatchLater.vue +5 -1
- package/src/main.js +1 -0
- package/src/single/Author.vue +5 -1
- package/src/single/CmsSingle.vue +29 -15
- package/src/single/Collection.vue +36 -26
- package/src/single/Comment.vue +19 -13
- package/src/single/Creators.vue +5 -3
- package/src/single/PostCollection.vue +158 -0
- package/src/single/PostDirectory.vue +0 -126
- package/src/single/PostGuide.vue +93 -0
- package/src/single/PostHeader.vue +39 -17
- package/src/single/PostTopic.vue +3 -3
- package/src/single/PostVersion.vue +219 -0
- package/src/single/RightAffix.vue +160 -0
- package/src/single/SimpleThx.vue +4 -2
- package/src/single/Thx.vue +14 -2
- package/src/single/VersionDialog.vue +238 -0
- package/src/stories/components/StoryPropsTable.vue +137 -0
- package/src/stories/filters/FilterGallery.stories.js +110 -0
- package/src/stories/filters/clientBy.stories.js +24 -0
- package/src/stories/filters/markBy.stories.js +6 -0
- package/src/stories/filters/menuBy.stories.js +6 -0
- package/src/stories/filters/orderBy.stories.js +6 -0
- package/src/stories/filters/tagBy.stories.js +6 -0
- package/src/stories/filters/topicBy.stories.js +6 -0
- package/src/stories/filters/versionBy.stories.js +6 -0
- package/src/stories/filters/zlpBy.stories.js +6 -0
- package/src/stories/layout/BaseShell.stories.js +38 -0
- package/src/stories/layout/Breadcrumb.stories.js +40 -0
- package/src/stories/layout/CommonFooter.stories.js +1 -1
- package/src/stories/layout/CommonHeader.stories.js +1 -1
- package/src/stories/layout/LeftSideToggle.stories.js +78 -0
- package/src/stories/layout/LeftSidebar.stories.js +40 -0
- package/src/stories/layout/Main.stories.js +41 -0
- package/src/stories/layout/RightSidebar.stories.js +36 -0
- package/src/stories/layout/StorybookShell.vue +271 -0
- package/src/stories/layout/SuspendCommon.stories.js +67 -0
- package/src/stories/layout/SuspendCommonStage.vue +143 -0
- package/src/stories/mockData.js +275 -0
- package/src/stories/other/UserPop.stories.js +51 -0
- package/src/stories/single/Author.stories.js +19 -0
- package/src/stories/single/AuthorStoryStage.vue +103 -0
- package/src/stories/single/CmsSingle.stories.js +19 -0
- package/src/stories/single/CmsSingleStoryStage.vue +118 -0
- package/src/stories/single/Collection.stories.js +34 -0
- package/src/stories/single/Comment.stories.js +36 -0
- package/src/stories/single/Creators.stories.js +34 -0
- package/src/stories/single/PostCollection.stories.js +34 -0
- package/src/stories/single/PostDirectory.stories.js +31 -0
- package/src/stories/single/PostGuide.stories.js +47 -0
- package/src/stories/single/PostHeader.stories.js +39 -0
- package/src/stories/single/PostVersion.stories.js +41 -0
- package/src/stories/single/RightAffix.stories.js +84 -0
- package/src/stories/single/SimpleThx.stories.js +39 -0
- package/src/stories/single/SingleGallery.stories.js +207 -0
- package/src/stories/single/Thx.stories.js +38 -0
- package/vue.config.js +2 -12
- package/assets/css/common/bottom.less +0 -25
- package/assets/css/editor/article.less +0 -36
- package/assets/css/editor/combo.less +0 -362
- package/assets/css/editor/resource.less +0 -399
- package/assets/css/editor/tinymce.less +0 -100
- package/assets/css/editor/upload.less +0 -136
- package/assets/css/module/author.less +0 -231
- package/assets/css/module/buff.less +0 -88
- package/assets/css/module/directory.less +0 -165
- package/assets/css/module/icon.less +0 -25
- package/assets/css/module/item.less +0 -279
- package/assets/css/module/item_simple.less +0 -58
- package/assets/css/module/jx3_element.less +0 -5
- package/assets/css/module/macro.less +0 -89
- package/assets/css/module/npc.less +0 -265
- package/assets/css/module/resource.less +0 -93
- package/assets/css/module/skill.less +0 -74
- package/assets/css/module/talent.less +0 -495
- package/assets/js/a.js +0 -46
- package/assets/js/code.js +0 -13
- package/assets/js/combo.js +0 -40
- package/assets/js/directory.js +0 -114
- package/assets/js/filter2.js +0 -186
- package/assets/js/fold.js +0 -11
- package/assets/js/gallery.js +0 -14
- package/assets/js/hljs_languages.js +0 -177
- package/assets/js/iframe.js +0 -38
- package/assets/js/img.js +0 -23
- package/assets/js/item/attribute_percent.js +0 -88
- package/assets/js/item/bind.js +0 -18
- package/assets/js/item/border.js +0 -19
- package/assets/js/item/border_quest.js +0 -12
- package/assets/js/item/color.js +0 -25
- package/assets/js/item/hljs_languages.js +0 -177
- package/assets/js/item/icon_url.js +0 -15
- package/assets/js/item/second_format.js +0 -19
- package/assets/js/jx3_element.js +0 -73
- package/assets/js/katex.js +0 -181
- package/assets/js/macro.js +0 -16
- package/assets/js/nextpage.js +0 -4
- package/assets/js/pswp.js +0 -67
- package/assets/js/pswp_template.js +0 -66
- package/assets/js/pz_iframe.js +0 -30
- package/assets/js/qixue.js +0 -28
- package/assets/js/renderImgPreview.js +0 -18
- package/assets/js/script.js +0 -6
- package/assets/js/stat.js +0 -107
- package/assets/js/talent2.js +0 -21
- package/assets/js/tex-mml-chtml.js +0 -36310
- package/assets/js/voice.js +0 -238
- package/assets/js/xss.js +0 -130
- package/src/editor/Article.vue +0 -230
- package/src/editor/BoxResource.vue +0 -441
- package/src/editor/Resource.vue +0 -623
- package/src/editor/Tinymce.vue +0 -204
- package/src/editor/Upload.vue +0 -277
- package/src/editor/UploadAlum.vue +0 -176
- package/src/editor/UploadBanner.vue +0 -156
- package/src/editor/components/Author.vue +0 -322
- package/src/editor/components/Avatar.vue +0 -95
- package/src/editor/components/Buff.vue +0 -80
- package/src/editor/components/Combo.vue +0 -259
- package/src/editor/components/Equip.vue +0 -299
- package/src/editor/components/GameText.vue +0 -242
- package/src/editor/components/Item.vue +0 -325
- package/src/editor/components/ItemSimple.vue +0 -134
- package/src/editor/components/Medal.vue +0 -43
- package/src/editor/components/Npc.vue +0 -215
- package/src/editor/components/PostAuthor.vue +0 -102
- package/src/editor/components/Skill.vue +0 -71
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="c-resource c-resource__jx3box">
|
|
3
|
-
<!-- 上传触发按钮 -->
|
|
4
|
-
<el-button class="u-switch" type="primary" @click="openDialog" :disabled="!enable">
|
|
5
|
-
<img class="u-icon" svg-inline :src="boxIcon" />魔盒资源
|
|
6
|
-
</el-button>
|
|
7
|
-
|
|
8
|
-
<!-- 弹出界面 -->
|
|
9
|
-
<el-dialog class="c-large-dialog" title="魔盒资源库" v-model="dialogVisible">
|
|
10
|
-
<div class="c-resource-content" v-loading="loading">
|
|
11
|
-
<div class="m-database-search">
|
|
12
|
-
<el-radio-group class="u-client" v-model="comboClient" @change="search" v-if="type === 'combo'">
|
|
13
|
-
<el-radio-button value="std">剑三</el-radio-button>
|
|
14
|
-
<el-radio-button value="origin">缘起</el-radio-button>
|
|
15
|
-
</el-radio-group>
|
|
16
|
-
<el-input
|
|
17
|
-
class="u-input"
|
|
18
|
-
:placeholder="placeholderText"
|
|
19
|
-
v-model="query"
|
|
20
|
-
@change="search"
|
|
21
|
-
@keyup.enter="search"
|
|
22
|
-
>
|
|
23
|
-
<template #prepend>关键词</template>
|
|
24
|
-
<template #append>
|
|
25
|
-
<el-switch v-model="strict" active-text="精确匹配"></el-switch>
|
|
26
|
-
</template>
|
|
27
|
-
</el-input>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<el-tabs class="m-database-tabs" v-model="type" type="card" @tab-change="changeType">
|
|
31
|
-
<el-tab-pane label="魔盒用户" name="authors">
|
|
32
|
-
<template #label>
|
|
33
|
-
<span class="u-tab-label">
|
|
34
|
-
<el-icon style="margin-right: 5px"><Avatar></Avatar> </el-icon>
|
|
35
|
-
<b>用户</b>
|
|
36
|
-
<i class="u-lv-box">Lv2+</i>
|
|
37
|
-
</span>
|
|
38
|
-
</template>
|
|
39
|
-
<p v-if="total && done" class="m-resource-count">
|
|
40
|
-
<el-icon><Histogram /></el-icon> 共找到 <b>{{ total }}</b> 条记录
|
|
41
|
-
</p>
|
|
42
|
-
<ul class="m-resource-list">
|
|
43
|
-
<li
|
|
44
|
-
v-for="(o, i) in authors"
|
|
45
|
-
class="u-item"
|
|
46
|
-
:key="i"
|
|
47
|
-
:class="{ on: !!o.isSelected }"
|
|
48
|
-
@click="selectAuthor(o, i)"
|
|
49
|
-
ref="author"
|
|
50
|
-
>
|
|
51
|
-
<span class="u-id">ID:{{ o.ID }}</span>
|
|
52
|
-
<img
|
|
53
|
-
class="u-pic"
|
|
54
|
-
:title="'AuthorID:' + o.display_name"
|
|
55
|
-
:src="userAvatar(o.user_avatar)"
|
|
56
|
-
/>
|
|
57
|
-
<span class="u-primary">
|
|
58
|
-
<span class="u-name">
|
|
59
|
-
{{ o.display_name }}
|
|
60
|
-
</span>
|
|
61
|
-
<div class="u-remark">
|
|
62
|
-
{{ o.user_bio }}
|
|
63
|
-
</div>
|
|
64
|
-
</span>
|
|
65
|
-
</li>
|
|
66
|
-
</ul>
|
|
67
|
-
<el-alert
|
|
68
|
-
v-if="!authors.length && done"
|
|
69
|
-
title="没有找到相关条目"
|
|
70
|
-
type="info"
|
|
71
|
-
show-icon
|
|
72
|
-
></el-alert>
|
|
73
|
-
</el-tab-pane>
|
|
74
|
-
<el-tab-pane label="剑三趣图" name="emotions">
|
|
75
|
-
<template #label>
|
|
76
|
-
<span class="u-tab-label">
|
|
77
|
-
<el-icon style="margin-right: 5px"><Sugar /></el-icon>
|
|
78
|
-
<b>趣图</b>
|
|
79
|
-
</span>
|
|
80
|
-
</template>
|
|
81
|
-
|
|
82
|
-
<p v-if="total && done" class="m-resource-count">
|
|
83
|
-
<el-icon><Histogram /></el-icon> 共找到 <b>{{ total }}</b> 条记录
|
|
84
|
-
</p>
|
|
85
|
-
<ul class="m-resource-emotion">
|
|
86
|
-
<li
|
|
87
|
-
v-for="o in emotions"
|
|
88
|
-
class="u-item"
|
|
89
|
-
:key="o.id"
|
|
90
|
-
:class="{ on: !!o.isSelected }"
|
|
91
|
-
@click="selectEmotion(o)"
|
|
92
|
-
ref="emotion"
|
|
93
|
-
>
|
|
94
|
-
<img class="e-jx3-emotion" :src="resolveImagePath(o.url)" :alt="query" />
|
|
95
|
-
</li>
|
|
96
|
-
</ul>
|
|
97
|
-
<el-alert
|
|
98
|
-
v-if="!emotions.length && done"
|
|
99
|
-
title="没有找到相关条目"
|
|
100
|
-
type="info"
|
|
101
|
-
show-icon
|
|
102
|
-
></el-alert>
|
|
103
|
-
</el-tab-pane>
|
|
104
|
-
<!-- <el-tab-pane label="连招" name="combo">
|
|
105
|
-
<template #label>
|
|
106
|
-
<span class="u-tab-label">
|
|
107
|
-
<el-icon style="margin-right: 5px"><Lollipop /></el-icon>
|
|
108
|
-
<b>连招</b>
|
|
109
|
-
</span>
|
|
110
|
-
</template>
|
|
111
|
-
<ComboVue :query="query" ref="combo" :client="comboClient" :strict="strict"></ComboVue>
|
|
112
|
-
</el-tab-pane> -->
|
|
113
|
-
</el-tabs>
|
|
114
|
-
|
|
115
|
-
<template v-if="multipage && type !== 'combo'">
|
|
116
|
-
<!-- 下一页 -->
|
|
117
|
-
<el-button
|
|
118
|
-
class="m-archive-more"
|
|
119
|
-
:class="{ show: hasNextPage }"
|
|
120
|
-
type="primary"
|
|
121
|
-
icon="ArrowDown"
|
|
122
|
-
@click="appendPage"
|
|
123
|
-
>加载更多</el-button
|
|
124
|
-
>
|
|
125
|
-
<!-- 分页 -->
|
|
126
|
-
<el-pagination
|
|
127
|
-
class="m-archive-pages"
|
|
128
|
-
background
|
|
129
|
-
layout="total, prev, pager, next,jumper"
|
|
130
|
-
:hide-on-single-page="true"
|
|
131
|
-
:page-size="per"
|
|
132
|
-
:total="total"
|
|
133
|
-
v-model:current-page="page"
|
|
134
|
-
@current-change="changePage"
|
|
135
|
-
></el-pagination>
|
|
136
|
-
</template>
|
|
137
|
-
|
|
138
|
-
<div class="m-database-tip" v-show="isBlank && type !== 'combo'">❤ 请输入搜索条件查询</div>
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
<!-- 插入按钮 -->
|
|
142
|
-
<template #footer>
|
|
143
|
-
<span class="dialog-footer">
|
|
144
|
-
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
145
|
-
<el-button type="primary" @click="insert">
|
|
146
|
-
{{ buttonTXT }}
|
|
147
|
-
</el-button>
|
|
148
|
-
</span>
|
|
149
|
-
</template>
|
|
150
|
-
</el-dialog>
|
|
151
|
-
</div>
|
|
152
|
-
</template>
|
|
153
|
-
|
|
154
|
-
<script>
|
|
155
|
-
import { loadStat } from "../../service/database";
|
|
156
|
-
import { loadAuthors, loadEmotions } from "../../service/cms";
|
|
157
|
-
import { getUserInfo } from "../../service/author";
|
|
158
|
-
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
|
|
159
|
-
import { getLink, showAvatar, resolveImagePath } from "@jx3box/jx3box-common/js/utils";
|
|
160
|
-
import User from "@jx3box/jx3box-common/js/user";
|
|
161
|
-
const { __Root, __OriginRoot, __imgPath } = JX3BOX;
|
|
162
|
-
|
|
163
|
-
// import ComboVue from "./components/Combo.vue";
|
|
164
|
-
export default {
|
|
165
|
-
name: "BoxResource",
|
|
166
|
-
components: {
|
|
167
|
-
// ComboVue,
|
|
168
|
-
},
|
|
169
|
-
props: {
|
|
170
|
-
enable: {
|
|
171
|
-
type: Boolean,
|
|
172
|
-
default: true,
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
data: function () {
|
|
176
|
-
return {
|
|
177
|
-
dialogVisible: false,
|
|
178
|
-
actived: false,
|
|
179
|
-
userInfo: {},
|
|
180
|
-
|
|
181
|
-
type: "authors",
|
|
182
|
-
query: "",
|
|
183
|
-
strict: false,
|
|
184
|
-
client: location.hostname.includes("origin") ? "origin" : "std",
|
|
185
|
-
comboClient: "std",
|
|
186
|
-
|
|
187
|
-
skill: [],
|
|
188
|
-
buff: [],
|
|
189
|
-
item: [],
|
|
190
|
-
icon: [],
|
|
191
|
-
npc: [],
|
|
192
|
-
authors: [],
|
|
193
|
-
selectedAuthor: {},
|
|
194
|
-
emotions: [],
|
|
195
|
-
|
|
196
|
-
done: false,
|
|
197
|
-
loading: false,
|
|
198
|
-
|
|
199
|
-
isSuper: false,
|
|
200
|
-
|
|
201
|
-
html: "",
|
|
202
|
-
|
|
203
|
-
per: 10,
|
|
204
|
-
page: 1,
|
|
205
|
-
total: 1,
|
|
206
|
-
pages: 1,
|
|
207
|
-
|
|
208
|
-
placeholderTexts: {
|
|
209
|
-
authors: "请输入 ID 或 名称",
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
},
|
|
213
|
-
computed: {
|
|
214
|
-
placeholderText: function () {
|
|
215
|
-
return this.placeholderTexts[this.type];
|
|
216
|
-
},
|
|
217
|
-
buttonTXT: function () {
|
|
218
|
-
return this.selectedCount ? "插 入" : "确 定";
|
|
219
|
-
},
|
|
220
|
-
isBlank: function () {
|
|
221
|
-
return !this.query && !this[this.type]?.["length"];
|
|
222
|
-
},
|
|
223
|
-
selectedCount: function () {
|
|
224
|
-
return !!this.html;
|
|
225
|
-
},
|
|
226
|
-
isNumber: function () {
|
|
227
|
-
return !isNaN(this.query);
|
|
228
|
-
},
|
|
229
|
-
hasNextPage: function () {
|
|
230
|
-
return this.total > 1 && this.page < this.pages;
|
|
231
|
-
},
|
|
232
|
-
multipage: function () {
|
|
233
|
-
return this.type !== "icon" && this.done && this.pages > 1;
|
|
234
|
-
},
|
|
235
|
-
iconDir: function () {
|
|
236
|
-
return this.client === "origin" ? "origin_icon" : "icon";
|
|
237
|
-
},
|
|
238
|
-
userStatus: function () {
|
|
239
|
-
return User.getInfo().status;
|
|
240
|
-
},
|
|
241
|
-
uid: function () {
|
|
242
|
-
return User.getInfo().uid;
|
|
243
|
-
},
|
|
244
|
-
canInsertAuthor: function () {
|
|
245
|
-
return User.getLevel(this.userInfo && this.userInfo.experience) >= 2;
|
|
246
|
-
},
|
|
247
|
-
boxIcon: function () {
|
|
248
|
-
return __imgPath + "image/common/jx3box_white.svg";
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
watch: {
|
|
252
|
-
html: function (newval) {
|
|
253
|
-
this.$emit("update", newval);
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
methods: {
|
|
257
|
-
getData: function (page = 1, append = false) {
|
|
258
|
-
this.loading = true;
|
|
259
|
-
this.per = 10;
|
|
260
|
-
this.done = false;
|
|
261
|
-
let query = this.query;
|
|
262
|
-
let params = {
|
|
263
|
-
strict: ~~this.strict,
|
|
264
|
-
per: this.per,
|
|
265
|
-
page: page,
|
|
266
|
-
client: this.client,
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
// 图标
|
|
270
|
-
if (this.type === "authors") {
|
|
271
|
-
if (!this.query) {
|
|
272
|
-
this.loading = false;
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
params = {
|
|
277
|
-
...params,
|
|
278
|
-
name: query,
|
|
279
|
-
};
|
|
280
|
-
loadAuthors(params)
|
|
281
|
-
.then((res) => {
|
|
282
|
-
if (!append) this.authors = [];
|
|
283
|
-
let list = this.transformData(res.data.data.list);
|
|
284
|
-
this.authors = this.authors.concat(list);
|
|
285
|
-
this.pages = res.data.data.pages;
|
|
286
|
-
this.total = res.data.data.total;
|
|
287
|
-
})
|
|
288
|
-
.finally(() => {
|
|
289
|
-
this.done = true;
|
|
290
|
-
this.loading = false;
|
|
291
|
-
});
|
|
292
|
-
} else if (this.type === "emotions") {
|
|
293
|
-
this.per = 24;
|
|
294
|
-
params = {
|
|
295
|
-
per: this.per,
|
|
296
|
-
page: page,
|
|
297
|
-
search: query,
|
|
298
|
-
};
|
|
299
|
-
loadEmotions(params)
|
|
300
|
-
.then((res) => {
|
|
301
|
-
if (!append) this.emotions = [];
|
|
302
|
-
let list = this.transformData(res.data.data.list);
|
|
303
|
-
this.emotions = this.emotions.concat(list);
|
|
304
|
-
this.pages = res.data.data.pages;
|
|
305
|
-
this.total = res.data.data.total;
|
|
306
|
-
})
|
|
307
|
-
.finally(() => {
|
|
308
|
-
this.done = true;
|
|
309
|
-
this.loading = false;
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
search: function () {
|
|
314
|
-
if (this.type === "combo") {
|
|
315
|
-
this.$refs.combo?.search();
|
|
316
|
-
} else {
|
|
317
|
-
this.page = 1;
|
|
318
|
-
this.getData();
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
appendPage: function () {
|
|
322
|
-
this.getData(++this.page, true);
|
|
323
|
-
},
|
|
324
|
-
changePage: function (i) {
|
|
325
|
-
this.getData(i);
|
|
326
|
-
},
|
|
327
|
-
changeType: function () {
|
|
328
|
-
this.page = 1;
|
|
329
|
-
if (this.type === "combo") {
|
|
330
|
-
this.done = false;
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
this.getData();
|
|
334
|
-
},
|
|
335
|
-
setAuthors: function () {
|
|
336
|
-
try {
|
|
337
|
-
let author = sessionStorage.getItem("atAuthor");
|
|
338
|
-
if (author) {
|
|
339
|
-
author = JSON.parse(author);
|
|
340
|
-
author = author.split(",") || [];
|
|
341
|
-
if (this.selectedAuthor.ID && !author.includes(String(this.selectedAuthor.ID))) {
|
|
342
|
-
author.push(this.selectedAuthor.ID);
|
|
343
|
-
}
|
|
344
|
-
sessionStorage.setItem("atAuthor", JSON.stringify(author.join(",")));
|
|
345
|
-
} else {
|
|
346
|
-
sessionStorage.setItem("atAuthor", JSON.stringify(String(this.selectedAuthor.ID)));
|
|
347
|
-
}
|
|
348
|
-
} catch (error) {
|
|
349
|
-
console.log(error);
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
insert: function () {
|
|
353
|
-
if (this.type === "authors") {
|
|
354
|
-
if (this.userStatus == 0 && this.canInsertAuthor) {
|
|
355
|
-
if (this.selectedAuthor.ID) {
|
|
356
|
-
this.setAuthors();
|
|
357
|
-
this.$emit("insert", this.html);
|
|
358
|
-
this.dialogVisible = false;
|
|
359
|
-
this.selectedAuthor = {};
|
|
360
|
-
} else {
|
|
361
|
-
this.$message.warning("请选择一个用户");
|
|
362
|
-
}
|
|
363
|
-
} else {
|
|
364
|
-
this.$alert("您的等级不足或无权限(Lv2以上可用)", "消息");
|
|
365
|
-
}
|
|
366
|
-
} else {
|
|
367
|
-
if (this.type === "combo") {
|
|
368
|
-
const html = this.$refs.combo.renderVal();
|
|
369
|
-
this.$emit("insert", html);
|
|
370
|
-
} else {
|
|
371
|
-
this.$emit("insert", this.html);
|
|
372
|
-
}
|
|
373
|
-
this.dialogVisible = false;
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
transformData: function (data) {
|
|
377
|
-
data.forEach((item) => {
|
|
378
|
-
item.isSelected = false;
|
|
379
|
-
});
|
|
380
|
-
return data;
|
|
381
|
-
},
|
|
382
|
-
selectAuthor: function (o) {
|
|
383
|
-
this.resetItems();
|
|
384
|
-
this.selectedAuthor = o;
|
|
385
|
-
o.isSelected = true;
|
|
386
|
-
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>`;
|
|
387
|
-
},
|
|
388
|
-
selectEmotion: function (o) {
|
|
389
|
-
this.resetItems();
|
|
390
|
-
o.isSelected = true;
|
|
391
|
-
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>`;
|
|
392
|
-
},
|
|
393
|
-
resetItems: function () {
|
|
394
|
-
let data = this[this.type];
|
|
395
|
-
data.forEach((item) => {
|
|
396
|
-
item.isSelected = false;
|
|
397
|
-
});
|
|
398
|
-
this.html = "";
|
|
399
|
-
},
|
|
400
|
-
getLink: function (type, id) {
|
|
401
|
-
let domain = this.client == "origin" ? __OriginRoot : __Root;
|
|
402
|
-
return domain + getLink(type, id).slice(1);
|
|
403
|
-
},
|
|
404
|
-
userAvatar: function (url) {
|
|
405
|
-
return showAvatar(url, "m");
|
|
406
|
-
},
|
|
407
|
-
loadUserInfo: function () {
|
|
408
|
-
if (!this.uid) return;
|
|
409
|
-
getUserInfo(this.uid).then((res) => {
|
|
410
|
-
this.userInfo = res;
|
|
411
|
-
});
|
|
412
|
-
},
|
|
413
|
-
|
|
414
|
-
// 杂项
|
|
415
|
-
// ==============================
|
|
416
|
-
openDialog: function () {
|
|
417
|
-
this.dialogVisible = true;
|
|
418
|
-
if (!this.actived) {
|
|
419
|
-
loadStat().then((data) => {
|
|
420
|
-
this.stat = data;
|
|
421
|
-
this.actived = true;
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
resolveImagePath,
|
|
426
|
-
},
|
|
427
|
-
created: function () {
|
|
428
|
-
this.loadUserInfo();
|
|
429
|
-
},
|
|
430
|
-
};
|
|
431
|
-
</script>
|
|
432
|
-
|
|
433
|
-
<style lang="less">
|
|
434
|
-
@import "../../assets/css/editor/resource.less";
|
|
435
|
-
|
|
436
|
-
.m-item-pop {
|
|
437
|
-
padding: 0 !important;
|
|
438
|
-
background: none !important;
|
|
439
|
-
border: none;
|
|
440
|
-
}
|
|
441
|
-
</style>
|