user login

This commit is contained in:
simple321vip
2022-04-12 23:36:57 +08:00
parent 1c8c8264c2
commit 18da3c57b7
7 changed files with 137 additions and 49 deletions
+4 -9
View File
@@ -1,22 +1,17 @@
<template>
<div class="blog_list" v-for="item in data_list">
<span style="cursor: pointer;" @click="openBlog">{{ item.blog_title }}</span>
<span style="font-size: 12px;">{{ item.blog_prex }}</span>
</div>
<!-- <md-editor v-model="text" previewOnly /> -->
<h3 style="cursor: pointer;" @click="openBlog">{{ item.blog_title }}</h3>
<span style="font-size: 12px;">{{ item.blog_prex }}</span> </div>
</template>
<script setup lang="ts">
import MdEditor from 'md-editor-v3';
import 'md-editor-v3/lib/style.css';
import { reactive, ref } from 'vue';
import { get_blogs } from '../../api/blog'
import router from '../../router/index'
type Blog = {
blog_id: number,
blog_type_id: number,
blog_id: String,
blog_type_id: String,
blog_type_name: string,
blog_title: string,
blog_prex: string
+12 -25
View File
@@ -12,24 +12,15 @@
</el-col>
</el-row>
<div class="tag_list">
<el-tag
class="ml-2 click-icon"
:type="item.clicked ? 'danger' : 'info'"
v-for="(item) in bookmark_types"
@click="handleTags(item)"
>{{ item.bk_type_name }}</el-tag>
<el-tag class="ml-2 click-icon" :type="item.clicked ? 'danger' : 'info'" v-for="(item) in bookmark_types"
@click="handleTags(item)">{{ item.bk_type_name }}</el-tag>
</div>
</el-form>
<div class="create_dialog">
<el-button type="primary" @click="handleInsert">新建</el-button>
</div>
<el-table
ref="multipleTableRef"
:data="tableData"
@selection-change="handleSelectionChange"
style="width: 100%"
>
<el-table ref="multipleTableRef" :data="tableData" @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="index" width="180" />
<el-table-column prop="bk_type_name" label="分类" width="180" />
@@ -55,19 +46,13 @@
</div>
<el-dialog v-model="dialogFormVisible" title="添加书签">
<bookmark_dialog
:dialog_form="currentDialogData"
:operate_code="operate"
:types="bookmark_types"
@on-concel="closeDialog"
@on-submit="doSubmit"
></bookmark_dialog>
<bookmark_dialog :dialog_form="currentDialogData" :operate_code="operate" :types="bookmark_types"
@on-concel="closeDialog" @on-submit="doSubmit"></bookmark_dialog>
</el-dialog>
<el-dialog v-model="dialogVisible">
<delete_dialog :delete_id="currentDialogData.bk_id" @on-submit="doDelete"></delete_dialog>
</el-dialog>
</div>
</el-dialog> </div>
</template>
<script setup lang="ts">
@@ -99,7 +84,7 @@ bookmark_type().then(response => {
// 定义书签格式
type Bookmark = {
bk_id: number,
bk_id: string,
bk_type_id: number,
bk_type_name: String,
comment: String,
@@ -121,7 +106,7 @@ const search_form = reactive<Searchform>({
const tableData = reactive<Bookmark[]>([])
// 响应式dialog数据
const currentDialogData = reactive<Bookmark>({
bk_id: -1,
bk_id: "-1",
bk_type_id: 1,
bk_type_name: '未分类',
comment: '',
@@ -150,7 +135,7 @@ let dialogVisible = ref(false)
// 操作-》添加
const handleInsert = () => {
operate.value = '0'
currentDialogData.bk_id = -1
currentDialogData.bk_id = "-1"
currentDialogData.bk_type_id = 1
currentDialogData.bk_type_name = '未分类'
currentDialogData.comment = ''
@@ -190,7 +175,7 @@ const handleSelectionChange = (val: Bookmark[]) => {
}
const openUrl = (url: string) => {
window.open("https://www.runoob.com");
window.open(url);
}
const doSearch = () => {
@@ -243,11 +228,13 @@ const copyNumber = (record: Bookmark) => {
border-top: 1px solid rgba(151, 151, 151, 0.3);
border-bottom: 1px solid rgba(151, 151, 151, 0.3);
}
.click-icon {
width: 40px;
margin: 10px;
cursor: pointer;
}
.create_dialog {
margin: 10px;
}