From 3c71cc74e6dd5f1015329c64e11e8ec1cd7a97c1 Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Wed, 31 Aug 2022 18:11:16 +0800 Subject: [PATCH] 新增编辑页 日志列表接口 --- src/api/blogArticle.js | 9 ++++ src/components/common/MyTextarea.vue | 10 ----- src/api/blogArticleType.js | 2 + src/components/swichLabel/edit.vue | 55 ++++++++++++++------------- src/components/group/MyModal.vue | 2 5 files changed, 41 insertions(+), 37 deletions(-) diff --git a/src/api/blogArticle.js b/src/api/blogArticle.js index 818fae8..9e948c7 100644 --- a/src/api/blogArticle.js +++ b/src/api/blogArticle.js @@ -48,3 +48,12 @@ params: parameter }) } + + +export function queryBlogArticlePrivateList(parameter) { + return axios({ + url: '/outside/private/blogArticle/queryBlogArticlePrivateList', + method: 'get', + params: parameter + }) +} diff --git a/src/api/blogArticleType.js b/src/api/blogArticleType.js index 2443f49..d161b4b 100644 --- a/src/api/blogArticleType.js +++ b/src/api/blogArticleType.js @@ -20,3 +20,5 @@ params: parameter }) } + + diff --git a/src/components/common/MyTextarea.vue b/src/components/common/MyTextarea.vue index fbc432a..d62634b 100644 --- a/src/components/common/MyTextarea.vue +++ b/src/components/common/MyTextarea.vue @@ -25,16 +25,6 @@ }, watch: { visitorContent: function(newValue, oldValue) { - // if (newValue.length > 0) { - // if (!this.init) { - // this.showTip = true; - // setTimeout(() => { - // this.showTip = false; - // }, 5000); - // } - // this.init = true; - // this.initOwO(); - // } this.$emit("update:content", newValue) }, }, diff --git a/src/components/group/MyModal.vue b/src/components/group/MyModal.vue index bd193de..c662521 100644 --- a/src/components/group/MyModal.vue +++ b/src/components/group/MyModal.vue @@ -63,7 +63,7 @@ let tempData = this.$refs.modalBox.form; var param = { introduce: tempData.introduce, - secret: tempData.secret, + secret: tempData.secret == "" ? null : md5(tempData.secret), title: tempData.title, articleTypeId: tempData.class, isOnline: !tempData.online ? 1 : 0, diff --git a/src/components/swichLabel/edit.vue b/src/components/swichLabel/edit.vue index b1068a7..7a6ab8a 100644 --- a/src/components/swichLabel/edit.vue +++ b/src/components/swichLabel/edit.vue @@ -20,8 +20,7 @@ <div class="edit-article-value"> <a-select v-model="typeId" :allowClear="true" mode="default" placeholder="日志分类" :getPopupContainer="getCalendarContainer()" style="width: 100%;"> - <a-select-option v-for="(item,index) in this.blogArticleType" :key="index" - :value="item.id"> + <a-select-option v-for="(item,index) in blogArticleType" :key="index" :value="item.id"> {{ item.typeName }} </a-select-option> </a-select> @@ -255,30 +254,23 @@ <div class="edit-tool blog-container"> <div class="edit-tool-item" style="gap: 0px;"> - <div style="display: flex;width: 350px;"> + <div style="display: flex;width: 290px;"> <div style="display: flex;align-items: center;justify-content: flex-end;margin-right: 5px;"> <span>日志选取:</span> </div> - <a-select v-model="articleTypeId" mode="default" placeholder="" - :getPopupContainer="getCalendarContainer()" style="width: 100%;"> - <a-select-option value="1"> - 十里平湖霜满天 - </a-select-option> - <a-select-option value="2"> - 寸寸青丝愁华年 - </a-select-option> - <a-select-option value="3"> - 对月形单望相护 - </a-select-option> - <a-select-option value="4"> - 只羡鸳鸯不羡仙 - </a-select-option> - <a-select-option value="5"> - 江水春沉沉 - </a-select-option> - <a-select-option value="9"> - 上有双竹林 - </a-select-option> + <a-select v-model="articleTypeId" placeholder="键入搜索.." :showSearch="true" + :getPopupContainer="getCalendarContainer()"> + <!-- <a-select-option v-for="(item,index) in blogArticleTitleList" :key="index" + :value="item.id"> + {{ item.title }} + </a-select-option> --> + <template #dropdownRender="{ menuNode: menu }"> + {{menu}} + <a-divider style="margin: 4px 0" /> + <div style="padding: 4px 8px; cursor: pointer" @mousedown="e => e.preventDefault()"> + <a-icon type="down"></a-icon> 更多 + </div> + </template> </a-select> <a-button style="margin-left: 10px;"> <a-icon type="reload"></a-icon> @@ -292,12 +284,12 @@ <span class="myTip">(触发前提示手动保存)</span> </div> - <div style="display: flex;width: 350px;"> + <div style="display: flex;"> <div style="display: flex;align-items: center;justify-content: flex-end;margin-right: 5px"> <span>草稿列表:</span> </div> - <a-select v-model="articleTypeId" mode="default" placeholder="" - :getPopupContainer="getCalendarContainer()" style="width: 100%;"> + <a-select mode="default" placeholder="" :getPopupContainer="getCalendarContainer()" + style="width: 100%;"> <a-select-option value="1"> 十里平湖霜满天 </a-select-option> @@ -396,6 +388,10 @@ queryBlogArticleType } from '../../api/blogArticleType.js' + import { + queryBlogArticlePrivateList + } from '../../api/blogArticle.js' + import MyOwO from '../common/MyOwO.vue' import VueMarkdown from 'vue-markdown' @@ -414,6 +410,12 @@ queryBlogArticleType({}).then((res) => { this.blogArticleType = res.data; }) + + queryBlogArticlePrivateList({ + pageSize: 10 + }).then((res) => { + this.blogArticleTitleList = res.data.records; + }) }, data() { return { @@ -421,6 +423,7 @@ articleTypeId: "", typeId: "", blogArticleType: [], + blogArticleTitleList: [], } }, methods: { -- Gitblit v1.9.1