@jx3box/jx3box-ui 0.0.1
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/.env +6 -0
- package/README.md +4 -0
- package/assets/css/bread/admin.less +131 -0
- package/assets/css/bread/breadcrumb.less +163 -0
- package/assets/css/bread/crumb.less +17 -0
- package/assets/css/comment/quick-reply.less +56 -0
- package/assets/css/common/bottom.less +21 -0
- package/assets/css/common/footer.less +78 -0
- package/assets/css/common/left-sidebar.less +137 -0
- package/assets/css/common/main.less +75 -0
- package/assets/css/common/right-sidebar.less +193 -0
- package/assets/css/common/suspend-common.less +343 -0
- package/assets/css/editor/article.less +36 -0
- package/assets/css/editor/combo.less +311 -0
- package/assets/css/editor/resource.less +335 -0
- package/assets/css/editor/tinymce.less +80 -0
- package/assets/css/editor/upload.less +111 -0
- package/assets/css/filters/client-by.less +33 -0
- package/assets/css/header/box.less +181 -0
- package/assets/css/interact/like2.less +20 -0
- package/assets/css/interact/share2.less +101 -0
- package/assets/css/mixin.less +64 -0
- package/assets/css/module/author.less +190 -0
- package/assets/css/module/buff.less +78 -0
- package/assets/css/module/directory.less +143 -0
- package/assets/css/module/icon.less +21 -0
- package/assets/css/module/item.less +229 -0
- package/assets/css/module/item_simple.less +51 -0
- package/assets/css/module/jx3_element.less +4 -0
- package/assets/css/module/macro.less +72 -0
- package/assets/css/module/npc.less +220 -0
- package/assets/css/module/resource.less +80 -0
- package/assets/css/module/skill.less +65 -0
- package/assets/css/module/talent.less +424 -0
- package/assets/css/single/author.less +101 -0
- package/assets/css/single/cms-single.less +55 -0
- package/assets/css/single/thx.less +230 -0
- package/assets/css/tinymce/_.less +28 -0
- package/assets/css/tinymce/a.less +29 -0
- package/assets/css/tinymce/code.less +159 -0
- package/assets/css/tinymce/combo.less +86 -0
- package/assets/css/tinymce/fold.less +70 -0
- package/assets/css/tinymce/h.less +58 -0
- package/assets/css/tinymce/hr.less +9 -0
- package/assets/css/tinymce/img.less +16 -0
- package/assets/css/tinymce/imgpreview.less +14 -0
- package/assets/css/tinymce/latex.less +43 -0
- package/assets/css/tinymce/list.less +65 -0
- package/assets/css/tinymce/macro.less +40 -0
- package/assets/css/tinymce/nextpage.less +65 -0
- package/assets/css/tinymce/p.less +8 -0
- package/assets/css/tinymce/plugin.less +3 -0
- package/assets/css/tinymce/pz.less +39 -0
- package/assets/css/tinymce/qixue.less +39 -0
- package/assets/css/tinymce/quote.less +12 -0
- package/assets/css/tinymce/table.less +59 -0
- package/assets/css/tinymce/video.less +61 -0
- package/assets/css/var.less +1 -0
- package/assets/data/box.json +184 -0
- package/assets/data/box2.json +606 -0
- package/assets/data/detach_type.json +29 -0
- package/assets/data/game_font.json +242 -0
- package/assets/data/nav.json +12 -0
- package/assets/data/panel.json +27 -0
- package/assets/data/reply_template.json +6 -0
- package/assets/data/weapon_type.json +20 -0
- package/assets/data/zlp.json +5 -0
- package/assets/img/author/bilibili.png +0 -0
- package/assets/img/author/bilibili.svg +1 -0
- package/assets/img/author/chat.png +0 -0
- package/assets/img/author/douyu.png +0 -0
- package/assets/img/author/douyu.svg +1 -0
- package/assets/img/author/github.svg +1 -0
- package/assets/img/author/huya.png +0 -0
- package/assets/img/author/huya.svg +1 -0
- package/assets/img/author/msg.svg +55 -0
- package/assets/img/author/tuilan.png +0 -0
- package/assets/img/author/weibo.svg +70 -0
- package/assets/img/bread/menu.svg +1 -0
- package/assets/img/comment/comment.svg +1 -0
- package/assets/img/comment/heart_1.svg +1 -0
- package/assets/img/comment/heart_2.svg +1 -0
- package/assets/img/comment/hide.svg +1 -0
- package/assets/img/common/add.svg +1 -0
- package/assets/img/common/android.svg +1 -0
- package/assets/img/common/bell.svg +1 -0
- package/assets/img/common/bilibili-black.svg +1 -0
- package/assets/img/common/bilibili.svg +1 -0
- package/assets/img/common/check.svg +1 -0
- package/assets/img/common/coin.svg +1 -0
- package/assets/img/common/coupon.svg +56 -0
- package/assets/img/common/douyin.svg +1 -0
- package/assets/img/common/edit.svg +1 -0
- package/assets/img/common/followus.svg +18 -0
- package/assets/img/common/gift.svg +1 -0
- package/assets/img/common/harmony.svg +1 -0
- package/assets/img/common/ios.svg +1 -0
- package/assets/img/common/jx3-origin.svg +15 -0
- package/assets/img/common/jx3-www.svg +9 -0
- package/assets/img/common/lang.svg +6 -0
- package/assets/img/common/logo.svg +5 -0
- package/assets/img/common/manage.svg +1 -0
- package/assets/img/common/miniprogram.jpg +0 -0
- package/assets/img/common/miniprogram.svg +1 -0
- package/assets/img/common/mp.jpg +0 -0
- package/assets/img/common/msg.svg +1 -0
- package/assets/img/common/news.svg +20 -0
- package/assets/img/common/qqbot.svg +7 -0
- package/assets/img/common/qrcode.svg +1 -0
- package/assets/img/common/search-key-slash.svg +5 -0
- package/assets/img/common/send.svg +56 -0
- package/assets/img/common/setting.svg +1 -0
- package/assets/img/common/vip.svg +1 -0
- package/assets/img/common/wechat.svg +48 -0
- package/assets/img/common/weibo.svg +70 -0
- package/assets/img/editor/buff.svg +1 -0
- package/assets/img/editor/file.svg +51 -0
- package/assets/img/editor/icons.svg +15 -0
- package/assets/img/editor/item.svg +46 -0
- package/assets/img/editor/jx3.svg +11 -0
- package/assets/img/editor/jx3box.svg +5 -0
- package/assets/img/editor/skill.svg +53 -0
- package/assets/img/editor/view.svg +1 -0
- package/assets/img/footer/android.svg +1 -0
- package/assets/img/footer/china.svg +1 -0
- package/assets/img/footer/harmony.svg +1 -0
- package/assets/img/footer/ios.svg +1 -0
- package/assets/img/footer/logo.svg +5 -0
- package/assets/img/footer/miniprogram.svg +1 -0
- package/assets/img/footer/qqbot.svg +7 -0
- package/assets/img/header/add.svg +1 -0
- package/assets/img/header/bell.svg +1 -0
- package/assets/img/header/check.svg +1 -0
- package/assets/img/header/coin.svg +1 -0
- package/assets/img/header/edit.svg +1 -0
- package/assets/img/header/gift.svg +1 -0
- package/assets/img/header/logo.svg +5 -0
- package/assets/img/header/manage.svg +1 -0
- package/assets/img/header/msg.svg +1 -0
- package/assets/img/header/search-key-slash.svg +5 -0
- package/assets/img/header/send.svg +56 -0
- package/assets/img/header/setting.svg +1 -0
- package/assets/img/header/translator.svg +1 -0
- package/assets/img/header/vip.svg +1 -0
- package/assets/img/leftsidebar/arrow.svg +64 -0
- package/assets/img/leftsidebar/close.svg +49 -0
- package/assets/img/leftsidebar/fans.svg +1 -0
- package/assets/img/leftsidebar/medal.svg +1 -0
- package/assets/img/leftsidebar/more.svg +50 -0
- package/assets/img/leftsidebar/open.svg +51 -0
- package/assets/img/leftsidebar/post.svg +46 -0
- package/assets/img/leftsidebar/team.svg +1 -0
- package/assets/img/leftsidebar/united.svg +1 -0
- package/assets/img/list/post.svg +1 -0
- package/assets/img/mobile/miniprogram.jpg +0 -0
- package/assets/img/mobile/mp.jpg +0 -0
- package/assets/img/npc/attack.svg +69 -0
- package/assets/img/npc/buff.svg +20 -0
- package/assets/img/npc/energy.svg +1 -0
- package/assets/img/npc/miss.svg +1 -0
- package/assets/img/npc/npc.svg +1 -0
- package/assets/img/npc/radar.svg +45 -0
- package/assets/img/npc/shield.svg +1 -0
- package/assets/img/npc/sight.svg +1 -0
- package/assets/img/npc/skull.svg +15 -0
- package/assets/img/npc/target.svg +55 -0
- package/assets/img/price/jin.png +0 -0
- package/assets/img/price/tong.png +0 -0
- package/assets/img/price/yin.png +0 -0
- package/assets/img/price/zhuan.png +0 -0
- package/assets/img/rightsidebar/ac.svg +1 -0
- package/assets/img/rightsidebar/github.svg +1 -0
- package/assets/img/rightsidebar/repo.svg +1 -0
- package/assets/img/rightsidebar/topic_bg.svg +1 -0
- package/assets/img/rightsidebar/topic_bg_bps.svg +113 -0
- package/assets/img/single/author.svg +1 -0
- package/assets/img/single/directory-header.svg +1 -0
- package/assets/img/single/lock.svg +1 -0
- package/assets/img/single/modate.svg +24 -0
- package/assets/img/single/podate.svg +23 -0
- package/assets/img/single/ticket.svg +1 -0
- package/assets/img/suspend/ArrowsLeftRight.svg +1 -0
- package/assets/img/suspend/circle.svg +7 -0
- package/assets/img/suspend/collect.svg +1 -0
- package/assets/img/suspend/collect_slash.svg +1 -0
- package/assets/img/suspend/collect_slash_touchbar.svg +1 -0
- package/assets/img/suspend/collect_slash_touchbar_100.svg +1 -0
- package/assets/img/suspend/collect_touchbar.svg +1 -0
- package/assets/img/suspend/collect_touchbar_100.svg +1 -0
- package/assets/img/suspend/lafter_touchbar.svg +1 -0
- package/assets/img/suspend/later-on.svg +1 -0
- package/assets/img/suspend/line.svg +3 -0
- package/assets/img/suspend/more.svg +1 -0
- package/assets/img/suspend/pin_slash_24.svg +1 -0
- package/assets/img/suspend/pin_slash_touchbar.svg +1 -0
- package/assets/img/suspend/pin_slash_touchbar_24.svg +1 -0
- package/assets/img/suspend/pin_slash_touchbar_40.svg +1 -0
- package/assets/img/suspend/pin_touchbar.svg +1 -0
- package/assets/img/suspend/pin_touchbar_100.svg +1 -0
- package/assets/img/suspend/pin_touchbar_24.svg +1 -0
- package/assets/img/suspend/report_100.svg +1 -0
- package/assets/img/suspend/rss_touchbar.svg +1 -0
- package/assets/img/suspend/rss_touchbar_100.svg +1 -0
- package/assets/img/suspend/search.svg +3 -0
- package/assets/img/suspend/search_touchbar.svg +1 -0
- package/assets/img/widget/admin_gift.svg +10 -0
- package/assets/img/widget/gift.svg +1 -0
- package/assets/img/widget/heart.svg +17 -0
- package/assets/img/widget/heart1.svg +1 -0
- package/assets/img/widget/heart2.svg +11 -0
- package/assets/img/widget/heart3.svg +37 -0
- package/assets/img/widget/like.svg +1 -0
- package/assets/img/widget/like2.svg +1 -0
- package/assets/img/widget/like3.svg +14 -0
- package/assets/img/widget/like4.png +0 -0
- package/assets/img/widget/like4ing.gif +0 -0
- package/assets/img/widget/qq.svg +1 -0
- package/assets/img/widget/qr-code.svg +1 -0
- package/assets/img/widget/qzone.svg +1 -0
- package/assets/img/widget/records.svg +1 -0
- package/assets/img/widget/share-link.png +0 -0
- package/assets/img/widget/share.svg +13 -0
- package/assets/img/widget/share2.svg +19 -0
- package/assets/img/widget/star.svg +9 -0
- package/assets/img/widget/tieba.svg +1 -0
- package/assets/img/widget/unstar.svg +21 -0
- package/assets/img/widget/web_heart_animation.png +0 -0
- package/assets/img/widget/weibo.svg +1 -0
- package/assets/img/widget/weixin.svg +1 -0
- package/assets/js/a.js +46 -0
- package/assets/js/app.js +7 -0
- package/assets/js/code.js +13 -0
- package/assets/js/combo.js +40 -0
- package/assets/js/directory.js +114 -0
- package/assets/js/filter2.js +186 -0
- package/assets/js/fold.js +11 -0
- package/assets/js/gallery.js +14 -0
- package/assets/js/hljs_languages.js +177 -0
- package/assets/js/iframe.js +38 -0
- package/assets/js/img.js +23 -0
- package/assets/js/item/attribute_percent.js +88 -0
- package/assets/js/item/bind.js +18 -0
- package/assets/js/item/border.js +19 -0
- package/assets/js/item/border_quest.js +12 -0
- package/assets/js/item/color.js +25 -0
- package/assets/js/item/hljs_languages.js +177 -0
- package/assets/js/item/icon_url.js +15 -0
- package/assets/js/item/second_format.js +19 -0
- package/assets/js/jx3_element.js +73 -0
- package/assets/js/katex.js +181 -0
- package/assets/js/macro.js +16 -0
- package/assets/js/nextpage.js +4 -0
- package/assets/js/pswp.js +67 -0
- package/assets/js/pswp_template.js +66 -0
- package/assets/js/pz_iframe.js +30 -0
- package/assets/js/qixue.js +28 -0
- package/assets/js/renderImgPreview.js +18 -0
- package/assets/js/script.js +6 -0
- package/assets/js/stat.js +107 -0
- package/assets/js/talent2.js +21 -0
- package/assets/js/tex-mml-chtml.js +36310 -0
- package/assets/js/voice.js +238 -0
- package/assets/js/xss.js +130 -0
- package/babel.config.js +3 -0
- package/docs/README.md +78 -0
- package/i18n/index.js +134 -0
- package/i18n/messages/en-US.js +124 -0
- package/i18n/messages/vi.js +124 -0
- package/i18n/messages/zh-CN.js +124 -0
- package/i18n/messages/zh-TW.js +124 -0
- package/i18n/mixin.js +23 -0
- package/index.js +73 -0
- package/package.json +97 -0
- package/postcss.config.js +3 -0
- package/service/admin.js +20 -0
- package/service/author.js +94 -0
- package/service/breadcrumb.js +13 -0
- package/service/cms.js +137 -0
- package/service/comment.js +187 -0
- package/service/database.js +115 -0
- package/service/design.js +13 -0
- package/service/enum/CollectionPublic.js +13 -0
- package/service/enum/EquipPosition.js +48 -0
- package/service/enum/EquipType.js +33 -0
- package/service/fav.js +27 -0
- package/service/follow.js +55 -0
- package/service/github.js +15 -0
- package/service/header.js +42 -0
- package/service/item.js +22 -0
- package/service/resource.js +31 -0
- package/service/suspend.js +81 -0
- package/service/thx.js +60 -0
- package/src/App.vue +212 -0
- package/src/Bottom.vue +23 -0
- package/src/Box.vue +149 -0
- package/src/Breadcrumb.vue +141 -0
- package/src/CommonFooter.vue +69 -0
- package/src/CommonHeader.vue +270 -0
- package/src/Footer.vue +45 -0
- package/src/LeftSideToggle.vue +64 -0
- package/src/LeftSidebar.vue +123 -0
- package/src/Main.vue +48 -0
- package/src/RightSidebar.vue +61 -0
- package/src/SuspendCommon.vue +705 -0
- package/src/author/AuthorFans.vue +170 -0
- package/src/author/AuthorFollow.vue +205 -0
- package/src/author/AuthorGift.vue +286 -0
- package/src/author/AuthorHonor.vue +128 -0
- package/src/author/AuthorInfo.vue +245 -0
- package/src/author/AuthorLink.vue +113 -0
- package/src/author/AuthorMedals.vue +87 -0
- package/src/author/AuthorMsg.vue +25 -0
- package/src/author/AuthorPosts.vue +114 -0
- package/src/author/AuthorRss.vue +160 -0
- package/src/author/AuthorTeams.vue +106 -0
- package/src/author/Avatar.vue +168 -0
- package/src/author/UserPop.vue +198 -0
- package/src/bread/Admin.vue +400 -0
- package/src/bread/AdminButton.vue +31 -0
- package/src/bread/AdminDirectMessage.vue +73 -0
- package/src/bread/AdminDrop.vue +155 -0
- package/src/bread/Crumb.vue +27 -0
- package/src/bread/DesignTask.vue +194 -0
- package/src/comment/Avatar.vue +124 -0
- package/src/comment/CommentContent.vue +486 -0
- package/src/comment/CommentContentSimple.vue +240 -0
- package/src/comment/CommentInputForm.vue +182 -0
- package/src/comment/CommentWithReply.vue +261 -0
- package/src/comment/QuickReply.vue +64 -0
- package/src/comment/ReplyForReply.vue +127 -0
- package/src/comment/ReplyItem.vue +92 -0
- package/src/comment/ReplyList.vue +126 -0
- package/src/comment/Upload.vue +108 -0
- package/src/editor/Article.vue +230 -0
- package/src/editor/BoxResource.vue +441 -0
- package/src/editor/Resource.vue +623 -0
- package/src/editor/Tinymce.vue +204 -0
- package/src/editor/Upload.vue +277 -0
- package/src/editor/UploadAlum.vue +176 -0
- package/src/editor/UploadBanner.vue +156 -0
- package/src/editor/components/Author.vue +322 -0
- package/src/editor/components/Avatar.vue +95 -0
- package/src/editor/components/Buff.vue +80 -0
- package/src/editor/components/Combo.vue +259 -0
- package/src/editor/components/Equip.vue +299 -0
- package/src/editor/components/GameText.vue +242 -0
- package/src/editor/components/Item.vue +325 -0
- package/src/editor/components/ItemSimple.vue +134 -0
- package/src/editor/components/Medal.vue +43 -0
- package/src/editor/components/Npc.vue +215 -0
- package/src/editor/components/PostAuthor.vue +102 -0
- package/src/editor/components/Skill.vue +71 -0
- package/src/filters/clientBy.vue +96 -0
- package/src/filters/markBy.vue +177 -0
- package/src/filters/menuBy.vue +63 -0
- package/src/filters/orderBy.vue +170 -0
- package/src/filters/tagBy.vue +171 -0
- package/src/filters/topicBy.vue +151 -0
- package/src/filters/versionBy.vue +49 -0
- package/src/filters/zlpBy.vue +70 -0
- package/src/footer/copyright.vue +59 -0
- package/src/footer/links.vue +79 -0
- package/src/footer/official.vue +142 -0
- package/src/footer/resource.vue +146 -0
- package/src/header/alternate.vue +299 -0
- package/src/header/asset.vue +180 -0
- package/src/header/box.vue +161 -0
- package/src/header/box2.vue +479 -0
- package/src/header/bus.js +9 -0
- package/src/header/client.vue +183 -0
- package/src/header/lang.vue +136 -0
- package/src/header/logo.vue +95 -0
- package/src/header/manage.vue +200 -0
- package/src/header/message.vue +93 -0
- package/src/header/nav.vue +356 -0
- package/src/header/publish.vue +38 -0
- package/src/header/search.vue +120 -0
- package/src/header/search_map.json +3 -0
- package/src/header/shop.vue +121 -0
- package/src/header/user.vue +250 -0
- package/src/header/userInfo.vue +621 -0
- package/src/header/utils.js +126 -0
- package/src/header/vip.vue +120 -0
- package/src/interact/BoxcoinAdmin.vue +185 -0
- package/src/interact/BoxcoinRecords.vue +153 -0
- package/src/interact/BoxcoinUser.vue +194 -0
- package/src/interact/Contributors.vue +111 -0
- package/src/interact/Fav.vue +95 -0
- package/src/interact/Like.vue +61 -0
- package/src/interact/Rss.vue +163 -0
- package/src/interact/Share.vue +166 -0
- package/src/interact/WatchLater.vue +108 -0
- package/src/main.js +72 -0
- package/src/single/Author.vue +72 -0
- package/src/single/Collection.vue +176 -0
- package/src/single/Comment.vue +454 -0
- package/src/single/Creators.vue +214 -0
- package/src/single/PostDirectory.vue +147 -0
- package/src/single/PostHeader.vue +397 -0
- package/src/single/PostTopic.vue +127 -0
- package/src/single/SimpleThx.vue +217 -0
- package/src/single/Thx.vue +260 -0
- package/src/single/cms-single.vue +235 -0
- package/tailwind.config.js +13 -0
- package/utils/bus.js +5 -0
- package/utils/emotion.js +21 -0
- package/utils/index.js +36 -0
- package/vue.config.js +158 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-article-tinymce c-article-box">
|
|
3
|
+
<!-- <div id="c-article-origin" class="c-article-origin" ref="origin"><slot></slot></div> -->
|
|
4
|
+
<div id="c-article" class="c-article" ref="article" v-if="pageable">
|
|
5
|
+
<div
|
|
6
|
+
class="c-article-chunk"
|
|
7
|
+
v-for="(text, i) in data"
|
|
8
|
+
:key="i"
|
|
9
|
+
v-html="text"
|
|
10
|
+
:class="{ on: i == page - 1 || all == true }"
|
|
11
|
+
:id="'c-article-part' + ~~(i + 1)"
|
|
12
|
+
></div>
|
|
13
|
+
</div>
|
|
14
|
+
<div id="c-article" class="c-article" ref="article" v-else-if="data && data.length" v-html="data[0]"></div>
|
|
15
|
+
<el-button class="c-article-all" type="primary" v-if="!all && hasPages" @click="showAll">加载全部</el-button>
|
|
16
|
+
<el-pagination
|
|
17
|
+
class="c-article-pages"
|
|
18
|
+
v-if="!all"
|
|
19
|
+
background
|
|
20
|
+
center
|
|
21
|
+
:page-size="1"
|
|
22
|
+
:hide-on-single-page="true"
|
|
23
|
+
@current-change="changePage"
|
|
24
|
+
:current-page="page"
|
|
25
|
+
layout="total, prev, pager, next, jumper"
|
|
26
|
+
:total="total"
|
|
27
|
+
></el-pagination>
|
|
28
|
+
|
|
29
|
+
<div class="w-jx3-element-pop" :style="jx3_element.style">
|
|
30
|
+
<jx3-item :item_id="item.id" :jx3ClientType="item.client" v-show="jx3_element.type == 'item'" />
|
|
31
|
+
<jx3-buff :client="buff.client" :id="buff.id" :level="buff.level" v-show="jx3_element.type == 'buff'" />
|
|
32
|
+
<jx3-skill :client="skill.client" :id="skill.id" :level="skill.level" v-show="jx3_element.type == 'skill'" />
|
|
33
|
+
<jx3-npc :client="npc.client" :id="npc.id" v-show="jx3_element.type === 'npc'" />
|
|
34
|
+
<jx3-author :uid="author.id" v-show="jx3_element.type === 'author'" />
|
|
35
|
+
<jx3-emotion-author :id="emotion.id" v-show="jx3_element.type === 'emotion'" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { ElPagination, ElButton } from "element-plus";
|
|
42
|
+
import "element-plus/dist/index.css";
|
|
43
|
+
|
|
44
|
+
// XSS
|
|
45
|
+
import execFilterXSS from "../../assets/js/script";
|
|
46
|
+
const xss_options = {
|
|
47
|
+
allowCommentTag: true,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// 基本文本
|
|
51
|
+
import execLazyload from "../../assets/js/img";
|
|
52
|
+
import execFilterIframe from "../../assets/js/iframe";
|
|
53
|
+
import execFilterLink from "../../assets/js/a";
|
|
54
|
+
import execSplitPages from "../../assets/js/nextpage";
|
|
55
|
+
|
|
56
|
+
// 扩展文本
|
|
57
|
+
import renderFoldBlock from "../../assets/js/fold";
|
|
58
|
+
import renderDirectory from "../../assets/js/directory";
|
|
59
|
+
import {renderKatexAll} from "../../assets/js/katex";
|
|
60
|
+
import renderCode from "../../assets/js/code";
|
|
61
|
+
import renderImgPreview from "../../assets/js/renderImgPreview";
|
|
62
|
+
import renderMacro from "../../assets/js/macro";
|
|
63
|
+
import renderTalent from "../../assets/js/qixue";
|
|
64
|
+
import renderTalent2 from "../../assets/js/talent2";
|
|
65
|
+
import renderPzIframe from "../../assets/js/pz_iframe";
|
|
66
|
+
import renderCombo from "../../assets/js/combo";
|
|
67
|
+
import renderJx3Element from "../../assets/js/jx3_element";
|
|
68
|
+
|
|
69
|
+
// 剑三
|
|
70
|
+
import Item from "./components/Item.vue";
|
|
71
|
+
import Buff from "./components/Buff.vue";
|
|
72
|
+
import Skill from "./components/Skill.vue";
|
|
73
|
+
import Npc from "./components/Npc.vue";
|
|
74
|
+
import Author from "./components/Author.vue";
|
|
75
|
+
import PostAuthor from "./components/PostAuthor.vue";
|
|
76
|
+
|
|
77
|
+
export default {
|
|
78
|
+
name: "ArticleRender",
|
|
79
|
+
props: {
|
|
80
|
+
content: String,
|
|
81
|
+
directorybox: String,
|
|
82
|
+
pageable: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: true,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
data: function () {
|
|
88
|
+
return {
|
|
89
|
+
// 作品
|
|
90
|
+
all: false,
|
|
91
|
+
page: 1,
|
|
92
|
+
data: [],
|
|
93
|
+
mode: "",
|
|
94
|
+
jx3_element: {
|
|
95
|
+
style: {},
|
|
96
|
+
type: "",
|
|
97
|
+
},
|
|
98
|
+
item: {},
|
|
99
|
+
buff: {},
|
|
100
|
+
skill: {},
|
|
101
|
+
npc: {},
|
|
102
|
+
author: {},
|
|
103
|
+
emotion: {},
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
computed: {
|
|
107
|
+
total: function () {
|
|
108
|
+
return this.chunks.length;
|
|
109
|
+
},
|
|
110
|
+
hasPages: function () {
|
|
111
|
+
return this.chunks.length > 1;
|
|
112
|
+
},
|
|
113
|
+
origin: function () {
|
|
114
|
+
return this.content;
|
|
115
|
+
},
|
|
116
|
+
chunks: function () {
|
|
117
|
+
return this.pageable ? execSplitPages(this.origin) : [this.origin];
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
methods: {
|
|
121
|
+
doReg: function (data) {
|
|
122
|
+
if (data) {
|
|
123
|
+
// 过滤内容
|
|
124
|
+
data = execLazyload(data);
|
|
125
|
+
data = execFilterIframe(data);
|
|
126
|
+
data = execFilterXSS(data, xss_options);
|
|
127
|
+
data = execFilterLink(data);
|
|
128
|
+
return data;
|
|
129
|
+
} else {
|
|
130
|
+
return "";
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
doDOM: function ($root) {
|
|
134
|
+
// 折叠块
|
|
135
|
+
renderFoldBlock($root);
|
|
136
|
+
// 代码
|
|
137
|
+
renderCode(`code[class=^'language-']`);
|
|
138
|
+
// Tatex
|
|
139
|
+
renderKatexAll();
|
|
140
|
+
|
|
141
|
+
// 画廊(需要在宏、奇穴、物品等之前渲染以排除下方自动生成图片)
|
|
142
|
+
renderImgPreview();
|
|
143
|
+
// 宏
|
|
144
|
+
renderMacro();
|
|
145
|
+
// 奇穴
|
|
146
|
+
renderTalent();
|
|
147
|
+
renderTalent2();
|
|
148
|
+
// 物品
|
|
149
|
+
renderJx3Element(this);
|
|
150
|
+
// 配装
|
|
151
|
+
renderPzIframe();
|
|
152
|
+
// 连招
|
|
153
|
+
renderCombo();
|
|
154
|
+
},
|
|
155
|
+
doDir: function () {
|
|
156
|
+
// 显示局部
|
|
157
|
+
let target = "";
|
|
158
|
+
if (this.hasPages && !this.all) {
|
|
159
|
+
target = "#c-article-part" + this.page;
|
|
160
|
+
// 全部
|
|
161
|
+
} else {
|
|
162
|
+
target = "#c-article";
|
|
163
|
+
}
|
|
164
|
+
let dir = renderDirectory(target, this.directorybox);
|
|
165
|
+
this.$emit("directoryRendered", dir);
|
|
166
|
+
},
|
|
167
|
+
changePage: function (i) {
|
|
168
|
+
this.page = i;
|
|
169
|
+
window.scrollTo(0, 0);
|
|
170
|
+
this.$nextTick(() => {
|
|
171
|
+
this.doDir();
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
showAll: function () {
|
|
175
|
+
this.all = true;
|
|
176
|
+
this.$nextTick(() => {
|
|
177
|
+
this.doDir();
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
render: function () {
|
|
181
|
+
let result = [];
|
|
182
|
+
for (let chunk of this.chunks) {
|
|
183
|
+
let _chunk = this.doReg(chunk);
|
|
184
|
+
result.push(_chunk);
|
|
185
|
+
}
|
|
186
|
+
this.data = result;
|
|
187
|
+
},
|
|
188
|
+
run: function () {
|
|
189
|
+
this.render();
|
|
190
|
+
|
|
191
|
+
// 等待html加载完毕后
|
|
192
|
+
this.$nextTick(() => {
|
|
193
|
+
this.$emit("contentLoaded");
|
|
194
|
+
|
|
195
|
+
// 统一DOM处理
|
|
196
|
+
const $root = this.$refs.article;
|
|
197
|
+
this.doDOM($root);
|
|
198
|
+
this.$emit("contentRendered");
|
|
199
|
+
|
|
200
|
+
// 目录处理
|
|
201
|
+
this.doDir();
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
watch: {
|
|
206
|
+
content: function () {
|
|
207
|
+
this.run();
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
mounted: function () {
|
|
211
|
+
const params = new URLSearchParams(location.search);
|
|
212
|
+
this.mode = params.get("mode") || "";
|
|
213
|
+
this.run();
|
|
214
|
+
},
|
|
215
|
+
components: {
|
|
216
|
+
"el-pagination": ElPagination,
|
|
217
|
+
"el-button": ElButton,
|
|
218
|
+
"jx3-item": Item,
|
|
219
|
+
"jx3-buff": Buff,
|
|
220
|
+
"jx3-skill": Skill,
|
|
221
|
+
"jx3-npc": Npc,
|
|
222
|
+
"jx3-author": Author,
|
|
223
|
+
"jx3-emotion-author": PostAuthor,
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
</script>
|
|
227
|
+
|
|
228
|
+
<style lang="less">
|
|
229
|
+
@import "../../assets/css/editor/article.less";
|
|
230
|
+
</style>
|
|
@@ -0,0 +1,441 @@
|
|
|
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 label="std">剑三</el-radio-button>
|
|
14
|
+
<el-radio-button label="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>
|