@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,198 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
class="w-userpop"
|
|
4
|
+
:title="title"
|
|
5
|
+
v-model="visible"
|
|
6
|
+
:close-on-click-modal="false"
|
|
7
|
+
:close-on-press-escape="false"
|
|
8
|
+
>
|
|
9
|
+
<div class="u-tip">
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="u-input">
|
|
13
|
+
<el-input
|
|
14
|
+
v-model.trim.lazy="search"
|
|
15
|
+
placeholder="请输入用户 UID 或者昵称进行搜索"
|
|
16
|
+
@keydown.enter="onSearch"
|
|
17
|
+
>
|
|
18
|
+
<template #prepend>
|
|
19
|
+
<el-icon><Search /></el-icon>
|
|
20
|
+
</template>
|
|
21
|
+
</el-input>
|
|
22
|
+
<el-button class="u-search-btn" type="primary" @click="onSearch" :disabled="!search">搜索</el-button>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="u-preview" v-loading="loading">
|
|
25
|
+
<template v-if="searched && status">
|
|
26
|
+
<a class="u-author" :href="'/author/' + userdata.ID" target="_blank">
|
|
27
|
+
<img class="u-avatar" :src="showAvatar(userdata.user_avatar)" />
|
|
28
|
+
<span class="u-name">{{ userdata.display_name || "-" }}</span>
|
|
29
|
+
</a>
|
|
30
|
+
</template>
|
|
31
|
+
<template v-else>
|
|
32
|
+
<img class="u-avatar" :src="showAvatar('')" />
|
|
33
|
+
<span class="u-name">-</span>
|
|
34
|
+
<div class="u-empty">
|
|
35
|
+
<el-icon><Warning /></el-icon>{{ searched ? "未找到匹配项" : "请输入搜索条件" }}
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
</div>
|
|
39
|
+
<template #footer>
|
|
40
|
+
<div class="dialog-footer">
|
|
41
|
+
<el-button @click="cancel">取 消</el-button>
|
|
42
|
+
<el-button type="primary" @click="confirm">确 定</el-button>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
</el-dialog>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import * as utilModule from "@jx3box/jx3box-common/js/utils";
|
|
50
|
+
const { showAvatar } = utilModule;
|
|
51
|
+
import { getUserInfoByUidOrName } from "../../service/author";
|
|
52
|
+
export default {
|
|
53
|
+
name: "UserPop",
|
|
54
|
+
props: ["title", "show"],
|
|
55
|
+
data: function () {
|
|
56
|
+
return {
|
|
57
|
+
visible: false,
|
|
58
|
+
search: "",
|
|
59
|
+
searched: false,
|
|
60
|
+
userdata: {
|
|
61
|
+
ID: "",
|
|
62
|
+
name: "",
|
|
63
|
+
avatar: "",
|
|
64
|
+
},
|
|
65
|
+
status: true,
|
|
66
|
+
loading: false,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
model: {
|
|
70
|
+
prop: "show",
|
|
71
|
+
event: "switchUserPop",
|
|
72
|
+
},
|
|
73
|
+
watch: {
|
|
74
|
+
show: function (val) {
|
|
75
|
+
this.visible = val;
|
|
76
|
+
},
|
|
77
|
+
visible: function (val) {
|
|
78
|
+
this.$emit("switchUserPop", val);
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
confirm: function () {
|
|
83
|
+
if (this.status) {
|
|
84
|
+
this.visible = false;
|
|
85
|
+
this.$emit("confirm", this.userdata);
|
|
86
|
+
} else {
|
|
87
|
+
this.$alert("用户不存在 或 UID不正确", "提醒", {
|
|
88
|
+
confirmButtonText: "确定",
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
showAvatar: function (val) {
|
|
93
|
+
return showAvatar(val, "l");
|
|
94
|
+
},
|
|
95
|
+
onSearch() {
|
|
96
|
+
if (!this.search) {
|
|
97
|
+
this.userdata = {
|
|
98
|
+
name: "",
|
|
99
|
+
avatar: "",
|
|
100
|
+
};
|
|
101
|
+
this.status = true;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.loading = true;
|
|
105
|
+
this.searched = false;
|
|
106
|
+
getUserInfoByUidOrName({ search: this.search })
|
|
107
|
+
.then((data) => {
|
|
108
|
+
if (data) {
|
|
109
|
+
this.status = true;
|
|
110
|
+
this.userdata = data;
|
|
111
|
+
} else {
|
|
112
|
+
this.status = false;
|
|
113
|
+
this.userdata = {
|
|
114
|
+
name: "",
|
|
115
|
+
avatar: "",
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
.finally(() => {
|
|
120
|
+
this.loading = false;
|
|
121
|
+
this.searched = true;
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
cancel() {
|
|
125
|
+
this.visible = false;
|
|
126
|
+
this.search = "";
|
|
127
|
+
this.userdata = {
|
|
128
|
+
name: "",
|
|
129
|
+
avatar: "",
|
|
130
|
+
};
|
|
131
|
+
this.status = true;
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
mounted: function () {},
|
|
135
|
+
components: {},
|
|
136
|
+
};
|
|
137
|
+
</script>
|
|
138
|
+
|
|
139
|
+
<style lang="less">
|
|
140
|
+
.w-userpop {
|
|
141
|
+
.fz(1rem, 2.5);
|
|
142
|
+
.el-dialog {
|
|
143
|
+
min-width: 520px;
|
|
144
|
+
}
|
|
145
|
+
.el-dialog__body {
|
|
146
|
+
padding: 0 20px;
|
|
147
|
+
}
|
|
148
|
+
.u-avatar {
|
|
149
|
+
.mt(20px);
|
|
150
|
+
.size(120px);
|
|
151
|
+
.db;
|
|
152
|
+
.auto(x);
|
|
153
|
+
border: 1px solid #eee;
|
|
154
|
+
padding: 5px;
|
|
155
|
+
}
|
|
156
|
+
.u-name {
|
|
157
|
+
.bold;
|
|
158
|
+
.x;
|
|
159
|
+
.db;
|
|
160
|
+
}
|
|
161
|
+
.u-author {
|
|
162
|
+
.db;
|
|
163
|
+
max-width: 280px;
|
|
164
|
+
.auto(x);
|
|
165
|
+
&:hover {
|
|
166
|
+
.u-avatar {
|
|
167
|
+
border-color: #ff71b8;
|
|
168
|
+
}
|
|
169
|
+
.u-name {
|
|
170
|
+
color: #ff71b8;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
.u-tip {
|
|
175
|
+
.fz(13px);
|
|
176
|
+
}
|
|
177
|
+
.u-input {
|
|
178
|
+
.flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
gap: 10px;
|
|
181
|
+
}
|
|
182
|
+
.u-empty {
|
|
183
|
+
color: #999;
|
|
184
|
+
.x;
|
|
185
|
+
}
|
|
186
|
+
.dialog-footer {
|
|
187
|
+
text-align: center;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@media screen and (max-width: @phone) {
|
|
192
|
+
.w-userpop .el-dialog {
|
|
193
|
+
.w(100%) !important;
|
|
194
|
+
min-width: 0;
|
|
195
|
+
margin-top: 0 !important;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer
|
|
3
|
+
class="c-admin"
|
|
4
|
+
title="管理面板"
|
|
5
|
+
v-model="dialog_visible"
|
|
6
|
+
:before-close="close"
|
|
7
|
+
append-to-body
|
|
8
|
+
:with-header="true"
|
|
9
|
+
v-if="hasRight"
|
|
10
|
+
:close-on-click-modal="true"
|
|
11
|
+
>
|
|
12
|
+
<div class="c-admin-wrapper" ref="adminDrawer">
|
|
13
|
+
<!-- <template v-if="isAdmin"> -->
|
|
14
|
+
<el-divider content-position="left">状态变更</el-divider>
|
|
15
|
+
<el-radio-group v-model="post_status" class="c-admin-status">
|
|
16
|
+
<el-radio-button v-for="(option, key) in status_options" :label="key" :key="key">{{
|
|
17
|
+
option
|
|
18
|
+
}}</el-radio-button>
|
|
19
|
+
</el-radio-group>
|
|
20
|
+
<el-button type="primary" class="u-refresh-btn" @click="onRefreshCache">刷新缓存</el-button>
|
|
21
|
+
<!-- </template> -->
|
|
22
|
+
|
|
23
|
+
<el-divider content-position="left">可见性变更</el-divider>
|
|
24
|
+
<el-radio-group v-model="visible" class="c-admin-status">
|
|
25
|
+
<el-radio-button v-for="(option, key) in visible_options" :label="key" :key="key">{{
|
|
26
|
+
option
|
|
27
|
+
}}</el-radio-button>
|
|
28
|
+
</el-radio-group>
|
|
29
|
+
|
|
30
|
+
<el-divider content-position="left">推荐角标</el-divider>
|
|
31
|
+
<el-checkbox-group v-model="mark" class="c-admin-mark">
|
|
32
|
+
<el-checkbox v-for="(option, key) in mark_options" :label="key" :key="key">{{ option }}</el-checkbox>
|
|
33
|
+
</el-checkbox-group>
|
|
34
|
+
|
|
35
|
+
<el-divider content-position="left">高亮置顶</el-divider>
|
|
36
|
+
<el-checkbox class="c-admin-highlight-checkbox" v-model="isSticky">置顶</el-checkbox>
|
|
37
|
+
<el-checkbox class="c-admin-highlight-checkbox" v-model="isHighlight">开启高亮</el-checkbox>
|
|
38
|
+
<template v-if="isHighlight">
|
|
39
|
+
<el-color-picker
|
|
40
|
+
class="c-admin-highlight-block"
|
|
41
|
+
v-model="color"
|
|
42
|
+
:predefine="color_options"
|
|
43
|
+
></el-color-picker>
|
|
44
|
+
<span class="c-admin-highlight-preview" :style="{ color: color }">预览高亮效果</span>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<el-divider content-position="left">封面海报</el-divider>
|
|
48
|
+
<div class="c-admin-banner">
|
|
49
|
+
<el-upload
|
|
50
|
+
class="c-admin-upload el-upload--picture-card"
|
|
51
|
+
:action="uploadurl"
|
|
52
|
+
:with-credentials="true"
|
|
53
|
+
:show-file-list="false"
|
|
54
|
+
:on-success="uploadSuccess"
|
|
55
|
+
:on-error="uploadFail"
|
|
56
|
+
>
|
|
57
|
+
<img v-if="post_banner" :src="post_banner" />
|
|
58
|
+
<el-icon><Plus /></el-icon>
|
|
59
|
+
</el-upload>
|
|
60
|
+
<el-input class="u-banner" v-model="post_banner">
|
|
61
|
+
<template #prepend>
|
|
62
|
+
<span>海报地址</span>
|
|
63
|
+
</template>
|
|
64
|
+
<template #append>
|
|
65
|
+
<span>
|
|
66
|
+
<span class="u-btn" @click="removeBanner">
|
|
67
|
+
<el-icon><CircleClose /></el-icon> 移除海报
|
|
68
|
+
</span>
|
|
69
|
+
</span>
|
|
70
|
+
</template>
|
|
71
|
+
</el-input>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<el-divider content-position="left">元信息</el-divider>
|
|
75
|
+
<div class="c-admin-info">
|
|
76
|
+
<div class="w-select c-admin-type">
|
|
77
|
+
<div class="u-select-label">板块</div>
|
|
78
|
+
<el-select
|
|
79
|
+
v-model="post_type"
|
|
80
|
+
placeholder="请选择板块"
|
|
81
|
+
style="width: 100%"
|
|
82
|
+
class="u-select drawer-item-content"
|
|
83
|
+
:disabled="appDisabled"
|
|
84
|
+
>
|
|
85
|
+
<el-option
|
|
86
|
+
v-for="type in type_options"
|
|
87
|
+
:key="type.value"
|
|
88
|
+
:label="type.label"
|
|
89
|
+
:value="type.value"
|
|
90
|
+
></el-option>
|
|
91
|
+
</el-select>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="c-admin-author">
|
|
94
|
+
<el-input v-model="post_author" placeholder="请输入作者ID" class="input-author drawer-item-content">
|
|
95
|
+
<template #prepend>
|
|
96
|
+
<span class="u-keyword">作者ID</span>
|
|
97
|
+
</template>
|
|
98
|
+
</el-input>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div class="c-admin-buttons">
|
|
103
|
+
<el-button type="primary" @click="submit" :loading="pushing">提交</el-button>
|
|
104
|
+
<el-button plain @click="close">取消</el-button>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</el-drawer>
|
|
108
|
+
</template>
|
|
109
|
+
|
|
110
|
+
<script>
|
|
111
|
+
import Bus from "../../utils/bus";
|
|
112
|
+
import * as utilModule from "@jx3box/jx3box-common/js/utils";
|
|
113
|
+
const { getRewrite } = utilModule;
|
|
114
|
+
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
|
|
115
|
+
import { getSetting, postSetting } from "../../service/admin";
|
|
116
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
117
|
+
import CMS_MARKS from "@jx3box/jx3box-common/data/mark.json";
|
|
118
|
+
import { getTopicBucket } from "../../service/cms";
|
|
119
|
+
import emitter from "../../utils/bus";
|
|
120
|
+
|
|
121
|
+
const { cms: marks } = CMS_MARKS;
|
|
122
|
+
// import { onClickOutside } from "@vueuse/core";
|
|
123
|
+
export default {
|
|
124
|
+
name: "BreadAdmin",
|
|
125
|
+
emits: ["update"],
|
|
126
|
+
props: {
|
|
127
|
+
marksOptions: {
|
|
128
|
+
type: Object,
|
|
129
|
+
default: () => {},
|
|
130
|
+
},
|
|
131
|
+
// 入口是否是后台管理/list
|
|
132
|
+
fromList: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
default: false,
|
|
135
|
+
},
|
|
136
|
+
show: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: false,
|
|
139
|
+
},
|
|
140
|
+
postId: {
|
|
141
|
+
type: [Number, String],
|
|
142
|
+
default: 0,
|
|
143
|
+
},
|
|
144
|
+
// 是否禁止板块选择
|
|
145
|
+
appDisabled: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: false,
|
|
148
|
+
},
|
|
149
|
+
showExtend: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: false,
|
|
152
|
+
},
|
|
153
|
+
subtypeMap: {
|
|
154
|
+
type: Object,
|
|
155
|
+
default: () => {},
|
|
156
|
+
},
|
|
157
|
+
app: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: "",
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
data() {
|
|
163
|
+
return {
|
|
164
|
+
// 可视
|
|
165
|
+
dialog_visible: false,
|
|
166
|
+
|
|
167
|
+
// 数据
|
|
168
|
+
pulled: false,
|
|
169
|
+
pushing: false,
|
|
170
|
+
|
|
171
|
+
// 权限
|
|
172
|
+
hasRight: false,
|
|
173
|
+
pid: 0,
|
|
174
|
+
channel: "",
|
|
175
|
+
|
|
176
|
+
// 状态
|
|
177
|
+
post_status: "publish",
|
|
178
|
+
status_options: {
|
|
179
|
+
publish: "默认",
|
|
180
|
+
draft: "草稿",
|
|
181
|
+
pending: "待审核",
|
|
182
|
+
dustbin: "删除",
|
|
183
|
+
},
|
|
184
|
+
visible: "0",
|
|
185
|
+
visible_options: JX3BOX.__visibleMap,
|
|
186
|
+
|
|
187
|
+
// 角标
|
|
188
|
+
mark: [],
|
|
189
|
+
|
|
190
|
+
// 高亮
|
|
191
|
+
isHighlight: false,
|
|
192
|
+
color: "rgb(255,0,1)",
|
|
193
|
+
color_options: [
|
|
194
|
+
"rgb(255,0,1)",
|
|
195
|
+
"rgb(2,209,248)",
|
|
196
|
+
"rgb(147,217,25)",
|
|
197
|
+
"rgb(255,154,2)",
|
|
198
|
+
"rgb(255,44,142)",
|
|
199
|
+
"rgb(142,46,255)",
|
|
200
|
+
],
|
|
201
|
+
|
|
202
|
+
// 置顶
|
|
203
|
+
isSticky: false,
|
|
204
|
+
sticky: 0,
|
|
205
|
+
isStar: 0,
|
|
206
|
+
|
|
207
|
+
// 海报
|
|
208
|
+
uploadurl: JX3BOX.__cms + "api/cms/upload",
|
|
209
|
+
banner_preview: "",
|
|
210
|
+
post_banner: "",
|
|
211
|
+
|
|
212
|
+
// 类型
|
|
213
|
+
post_type: "",
|
|
214
|
+
type_options: [],
|
|
215
|
+
post_subtype: "",
|
|
216
|
+
topics: [],
|
|
217
|
+
tags: [],
|
|
218
|
+
|
|
219
|
+
// 作者
|
|
220
|
+
post_author: "",
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
computed: {
|
|
224
|
+
data: function () {
|
|
225
|
+
return {
|
|
226
|
+
ID: this.pid,
|
|
227
|
+
post_status: this.post_status || "publish",
|
|
228
|
+
visible: this.visible || "0",
|
|
229
|
+
post_author: this.post_author || 1,
|
|
230
|
+
post_type: this.post_type || "bbs",
|
|
231
|
+
post_banner: this.post_banner || "",
|
|
232
|
+
color: this.isHighlight ? this.color : "",
|
|
233
|
+
mark: this.mark || [],
|
|
234
|
+
sticky: this.isSticky ? Date.now() : null,
|
|
235
|
+
star: this.isStar,
|
|
236
|
+
topics: this.topics,
|
|
237
|
+
post_subtype: this.post_subtype,
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
isAdmin: function () {
|
|
241
|
+
return User.isAdmin();
|
|
242
|
+
},
|
|
243
|
+
mark_options: function () {
|
|
244
|
+
return this.marksOptions && Object.keys(this.marksOptions)
|
|
245
|
+
? Object.assign({}, marks, this.marksOptions)
|
|
246
|
+
: marks;
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
methods: {
|
|
250
|
+
// 是否有权限
|
|
251
|
+
checkHasRight: function () {
|
|
252
|
+
this.hasRight = User.isEditor();
|
|
253
|
+
},
|
|
254
|
+
// 获取pid
|
|
255
|
+
checkPostID: function () {
|
|
256
|
+
this.pid = getRewrite("pid") || (this.$route && this.$route.params && this.$route.params.id) || 0;
|
|
257
|
+
},
|
|
258
|
+
// 获取type
|
|
259
|
+
checkChannel: function () {
|
|
260
|
+
this.channel = location.pathname.split("/")[1];
|
|
261
|
+
},
|
|
262
|
+
// 加载类型选项
|
|
263
|
+
initTypeOptions: function () {
|
|
264
|
+
let types = [];
|
|
265
|
+
for (let key in JX3BOX.__postType) {
|
|
266
|
+
types.push({
|
|
267
|
+
value: key,
|
|
268
|
+
label: JX3BOX.__postType[key],
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
this.type_options = types;
|
|
272
|
+
},
|
|
273
|
+
// 上传
|
|
274
|
+
uploadSuccess: function (res, file) {
|
|
275
|
+
this.banner_preview = URL.createObjectURL(file.raw);
|
|
276
|
+
this.post_banner = res.data[0];
|
|
277
|
+
},
|
|
278
|
+
uploadFail: function (err) {
|
|
279
|
+
this.$message.error("上传失败");
|
|
280
|
+
console.log(err);
|
|
281
|
+
},
|
|
282
|
+
removeBanner: function () {
|
|
283
|
+
this.post_banner = "";
|
|
284
|
+
},
|
|
285
|
+
// 关闭
|
|
286
|
+
close() {
|
|
287
|
+
this.dialog_visible = false;
|
|
288
|
+
this.$emit("update", {
|
|
289
|
+
show: false,
|
|
290
|
+
});
|
|
291
|
+
},
|
|
292
|
+
// 拉
|
|
293
|
+
pull: function () {
|
|
294
|
+
getSetting(this.pid).then((data) => {
|
|
295
|
+
let { ID, color, mark, post_status, post_author, sticky, post_banner, post_type, visible, star, post_subtype, topics } = data;
|
|
296
|
+
this.pid = ID;
|
|
297
|
+
this.post_status = post_status;
|
|
298
|
+
this.visible = visible;
|
|
299
|
+
this.post_author = post_author;
|
|
300
|
+
this.post_type = post_type;
|
|
301
|
+
this.post_banner = post_banner;
|
|
302
|
+
this.color = color;
|
|
303
|
+
if (this.color) this.isHighlight = true;
|
|
304
|
+
this.mark = mark || [];
|
|
305
|
+
this.sticky = sticky || 0;
|
|
306
|
+
if (this.sticky) this.isSticky = true;
|
|
307
|
+
|
|
308
|
+
this.isStar = star || 0;
|
|
309
|
+
this.topics = topics?.map(item => item.topic) || [];
|
|
310
|
+
this.post_subtype = post_subtype || "";
|
|
311
|
+
|
|
312
|
+
// 设置加载完成标识
|
|
313
|
+
this.pulled = true;
|
|
314
|
+
});
|
|
315
|
+
},
|
|
316
|
+
// 提交
|
|
317
|
+
submit: function () {
|
|
318
|
+
this.pushing = true;
|
|
319
|
+
this.push();
|
|
320
|
+
},
|
|
321
|
+
// 推
|
|
322
|
+
push: function () {
|
|
323
|
+
postSetting(this.data)
|
|
324
|
+
.then(() => {
|
|
325
|
+
this.$emit("update", {
|
|
326
|
+
show: false,
|
|
327
|
+
data: this.data,
|
|
328
|
+
});
|
|
329
|
+
this.$message({
|
|
330
|
+
message: "设置成功",
|
|
331
|
+
type: "success",
|
|
332
|
+
});
|
|
333
|
+
})
|
|
334
|
+
.finally(() => {
|
|
335
|
+
this.pushing = false;
|
|
336
|
+
this.close();
|
|
337
|
+
});
|
|
338
|
+
},
|
|
339
|
+
// 获取topic标签
|
|
340
|
+
loadTopic() {
|
|
341
|
+
getTopicBucket({ type: "bbs" }).then((res) => {
|
|
342
|
+
const data = res.data.data?.map((item) => item.name) || [];
|
|
343
|
+
this.tags = data;
|
|
344
|
+
});
|
|
345
|
+
},
|
|
346
|
+
onRefreshCache() {
|
|
347
|
+
emitter.emit("refreshCache", {
|
|
348
|
+
type: this.post_type,
|
|
349
|
+
id: this.pid,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
watch: {
|
|
354
|
+
"$route.params.id": function () {
|
|
355
|
+
this.checkPostID();
|
|
356
|
+
},
|
|
357
|
+
show: {
|
|
358
|
+
immediate: true,
|
|
359
|
+
handler(bol) {
|
|
360
|
+
if (this.fromList) {
|
|
361
|
+
this.dialog_visible = bol;
|
|
362
|
+
if (bol) {
|
|
363
|
+
this.pid = this.postId;
|
|
364
|
+
this.pull();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
created: function () {
|
|
371
|
+
// 是否mount
|
|
372
|
+
this.checkHasRight();
|
|
373
|
+
// 预设信息
|
|
374
|
+
this.initTypeOptions();
|
|
375
|
+
},
|
|
376
|
+
mounted: function () {
|
|
377
|
+
// 基本信息
|
|
378
|
+
this.checkPostID();
|
|
379
|
+
this.checkChannel();
|
|
380
|
+
|
|
381
|
+
// 绑定监听
|
|
382
|
+
Bus.on("toggleAdminPanel", () => {
|
|
383
|
+
this.dialog_visible = !this.dialog_visible;
|
|
384
|
+
this.checkPostID();
|
|
385
|
+
// 文章类型的加载
|
|
386
|
+
if (this.pid && this.hasRight) {
|
|
387
|
+
this.pull();
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (this.showExtend && this.app && this.dialog_visible) {
|
|
391
|
+
this.loadTopic();
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
},
|
|
395
|
+
};
|
|
396
|
+
</script>
|
|
397
|
+
|
|
398
|
+
<style lang="less">
|
|
399
|
+
@import "../../assets/css/bread/admin.less";
|
|
400
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-button
|
|
3
|
+
v-if="show"
|
|
4
|
+
class="c-admin-button"
|
|
5
|
+
type="primary"
|
|
6
|
+
:size="button_size"
|
|
7
|
+
icon="Setting"
|
|
8
|
+
@click="toggleAdminPanel"
|
|
9
|
+
>管理</el-button
|
|
10
|
+
>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import Bus from "../../utils/bus";
|
|
15
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
16
|
+
export default {
|
|
17
|
+
name: "BreadAdminButton",
|
|
18
|
+
props: ["size"],
|
|
19
|
+
data: function () {
|
|
20
|
+
return {
|
|
21
|
+
show: User.isEditor(),
|
|
22
|
+
button_size: this.size || "",
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
toggleAdminPanel: function () {
|
|
27
|
+
Bus.emit("toggleAdminPanel");
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a
|
|
3
|
+
class="u-message el-button el-button--warning el-button--medium u-op-public"
|
|
4
|
+
@click="onButtonClick"
|
|
5
|
+
v-if="isEditor"
|
|
6
|
+
>
|
|
7
|
+
<el-icon><Message></Message></el-icon>
|
|
8
|
+
<span>私信</span>
|
|
9
|
+
</a>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { sendMessage } from "../../service/admin";
|
|
14
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
15
|
+
export default {
|
|
16
|
+
name: "AdminDirectMessage",
|
|
17
|
+
props: {
|
|
18
|
+
size: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "default",
|
|
21
|
+
},
|
|
22
|
+
sourceId: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0,
|
|
25
|
+
},
|
|
26
|
+
sourceType: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "",
|
|
29
|
+
},
|
|
30
|
+
userId: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 0,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
isEditor() {
|
|
37
|
+
return User.isEditor();
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
methods: {
|
|
41
|
+
onButtonClick() {
|
|
42
|
+
this.$prompt("请输入私信内容", "管理私信", {
|
|
43
|
+
confirmButtonText: "确定",
|
|
44
|
+
cancelButtonText: "取消",
|
|
45
|
+
inputPlaceholder: "请输入私信内容",
|
|
46
|
+
inputValidator: (value) => {
|
|
47
|
+
if (!value) {
|
|
48
|
+
return "请输入私信内容";
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
beforeClose: (action, instance, done) => {
|
|
52
|
+
if (action === "confirm") {
|
|
53
|
+
const data = {
|
|
54
|
+
source_id: this.sourceId,
|
|
55
|
+
source_type: this.sourceType,
|
|
56
|
+
user_id: this.userId,
|
|
57
|
+
content: "运营通知:" + instance.inputValue,
|
|
58
|
+
type: "system",
|
|
59
|
+
subtype: "admin_message"
|
|
60
|
+
};
|
|
61
|
+
sendMessage(data).then(() => {
|
|
62
|
+
this.$message.success("私信成功");
|
|
63
|
+
done();
|
|
64
|
+
})
|
|
65
|
+
} else {
|
|
66
|
+
done();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|