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/components/swichLabel/edit.vue |   60 +++++++++++++++++++++++++++++++++---------------------------
 1 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/src/components/swichLabel/edit.vue b/src/components/swichLabel/edit.vue
index 220052c..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,12 @@
 		queryBlogArticleType
 	} from '../../api/blogArticleType.js'
 
+	import {
+		queryBlogArticlePrivateList
+	} from '../../api/blogArticle.js'
+
+	import MyOwO from '../common/MyOwO.vue'
+
 	import VueMarkdown from 'vue-markdown'
 	const exp1 =
 		"### &ensp;&ensp;十里平湖 \r> ##### (卢照邻·唐)  \r> 化自《长安古意》 \r* 十里平湖霜满天 \r* 寸寸青丝愁华年 \r* 对月形单望相护 \r* 只羡鸳鸯不羡仙 \r![](http://blog.inleft.com/photo/example.jpg)\n\n";
@@ -405,11 +403,18 @@
 
 	export default {
 		components: {
-			VueMarkdown
+			VueMarkdown,
+			MyOwO,
 		},
 		beforeMount() {
 			queryBlogArticleType({}).then((res) => {
 				this.blogArticleType = res.data;
+			})
+
+			queryBlogArticlePrivateList({
+				pageSize: 10
+			}).then((res) => {
+				this.blogArticleTitleList = res.data.records;
 			})
 		},
 		data() {
@@ -418,6 +423,7 @@
 				articleTypeId: "",
 				typeId: "",
 				blogArticleType: [],
+				blogArticleTitleList: [],
 			}
 		},
 		methods: {

--
Gitblit v1.9.1