修改:网站管理
This commit is contained in:
parent
9851a297ce
commit
65aa2f7605
@ -5,7 +5,7 @@
|
||||
|
||||
import { Icon } from 'ant-design-vue'
|
||||
const IconFont = Icon.createFromIconfontCN({
|
||||
scriptUrl: '//at.alicdn.com/t/font_2024484_poicam3vg6b.js'
|
||||
scriptUrl: '//at.alicdn.com/t/font_2024484_64i0l9tj8gq.js'
|
||||
})
|
||||
|
||||
// 把此段代码贴到iconfont项目页面的控制台中, 以获取图标列表
|
||||
@ -16,7 +16,7 @@ const IconFont = Icon.createFromIconfontCN({
|
||||
// console.log(iconNames.slice(80,160))
|
||||
|
||||
export const iconFonts = {
|
||||
list: ["disk-drive", "menu-fuzhi", "iso", "zuijinhuoyue","key", "shouquan", "sort", "grid", "list", "emoji-a", "emoji-bizui", "emoji-baiyan", "emoji-aixin", "emoji-dajing", "emoji-ziya", "emoji-daxiao", "emoji-esi", "emoji-fadai", "emoji-fankun", "emoji-ganga", "emoji-fennu", "emoji-hanyan", "emoji-jingkong", "emoji-haochi", "emoji-emo", "emoji-jingsong", "emoji-jingya", "emoji-kaixin", "emoji-lengku", "emoji-danao", "emoji-liukoushui", "emoji-liulei", "emoji-mengbi", "mianwubiaoqing", "nanguo", "shuizhuo", "taoyan", "tanchi", "siliao", "tiaopi", "xiaochulei", "wuliao", "xingxingyan", "xieyan", "xiasi", "xiaolian", "ku", "shengqi", "yousiliao", "en", "bushufu", "bianbian", "fankun1", "feiwen", "ganmao", "huaixiao", "liuhan", "outu", "keshui", "renzhe", "santiaoxian", "guaiwu", "shoushang", "tianshi", "shuai", "xianwen", "xiaodiaodaya", "xiong", "yiwen", "yun", "liubixie", "shimo", "dianzan", "biti", "fendou", "huqi", "heng", "kulou", "leng", "taoyan1", "shuixing", "aini", "aixin1", "zhadan", "xinsui",
|
||||
list: ["wulianwang-","zuji","disk-drive", "menu-fuzhi", "iso", "zuijinhuoyue","key", "shouquan", "sort", "grid", "list", "emoji-a", "emoji-bizui", "emoji-baiyan", "emoji-aixin", "emoji-dajing", "emoji-ziya", "emoji-daxiao", "emoji-esi", "emoji-fadai", "emoji-fankun", "emoji-ganga", "emoji-fennu", "emoji-hanyan", "emoji-jingkong", "emoji-haochi", "emoji-emo", "emoji-jingsong", "emoji-jingya", "emoji-kaixin", "emoji-lengku", "emoji-danao", "emoji-liukoushui", "emoji-liulei", "emoji-mengbi", "mianwubiaoqing", "nanguo", "shuizhuo", "taoyan", "tanchi", "siliao", "tiaopi", "xiaochulei", "wuliao", "xingxingyan", "xieyan", "xiasi", "xiaolian", "ku", "shengqi", "yousiliao", "en", "bushufu", "bianbian", "fankun1", "feiwen", "ganmao", "huaixiao", "liuhan", "outu", "keshui", "renzhe", "santiaoxian", "guaiwu", "shoushang", "tianshi", "shuai", "xianwen", "xiaodiaodaya", "xiong", "yiwen", "yun", "liubixie", "shimo", "dianzan", "biti", "fendou", "huqi", "heng", "kulou", "leng", "taoyan1", "shuixing", "aini", "aixin1", "zhadan", "xinsui",
|
||||
"maren", "zhutou", "qie", "youling", "apple-fill", "attachment", "android-fill", "apple", "download", "arrow-up-circle", "arrow-right-circle", "arrow-down", "ashbin", "add", "file_music", "menu", "role", "jiaoseguanli", "yemianshezhi", "drop_down", "yuandian", "tag", "service-directory", "fabu", "wailian", "bianji-", "WEBSITE", "wangzhanguanli", "Up", "up", "fenlei", "guanlizhuanjiawenzhang", "pifu", "tuichudenglu", "shezhi", "wangzhan", "huaban", "yunshezhi", "UserSettings", "blogger", "biaoqian", "myself", "guidang", "quxiaoyulan1-copy", "yulan-copy", "quxiaoyulan1", "yulan"]
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<article-manager :page-title="pageTitle" alone-page></article-manager>
|
||||
<article-manager :page-title="pageTitle" :new-article-text="newArticleText" alone-page></article-manager>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -14,6 +14,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
pageTitle: '管理独立页面',
|
||||
newArticleText: '新增页面'
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
|
||||
@ -9,14 +9,14 @@
|
||||
@open="openDialog"
|
||||
@close="closeDialog"
|
||||
>
|
||||
<markdown-editor ref="editor" :has-change.sync="hasChange" :alone-page="alonePage" @onTitle="onTitle" @onRelease="onRelease"></markdown-editor>
|
||||
<markdown-editor ref="editor" :has-change.sync="hasChange" :alone-page="alonePage" :site-url="siteUrl" :is-edit="isEdit" @onTitle="onTitle" @onRelease="onRelease"></markdown-editor>
|
||||
</el-dialog>
|
||||
<el-card class="box-card">
|
||||
<div slot="header">
|
||||
<div class="box-card-header">
|
||||
<div class="clearfix card-header-back">
|
||||
<span>{{ alonePage ? '管理独立页面':'管理文章' }}</span>
|
||||
<el-button class="card-button" size="mini" type="primary" @click="newArticle">写文章</el-button>
|
||||
<el-button class="card-button" size="mini" type="primary" @click="newArticle">{{newArticleText}}</el-button>
|
||||
</div>
|
||||
<div class="card-header-right" v-show="this.multipleSelection.length > 0">
|
||||
<el-button size="small" type="danger" @click="handleDelete()">删除</el-button>
|
||||
@ -90,7 +90,7 @@
|
||||
label="标题">
|
||||
<template slot-scope="scope">
|
||||
<a :title="'编辑 '+scope.row.name" @click="editArticle(scope.row.id)">{{scope.row.name}}<svg-icon icon-class="bianji-"></svg-icon></a>
|
||||
<router-link :title="'浏览 '+scope.row.name" :to="(alonePage?'/articles/o/':'/articles/s/')+scope.row.slug" target="_blank"><svg-icon class="wailian" icon-class="wailian"></svg-icon></router-link>
|
||||
<a :title="'浏览 '+scope.row.name" :href="(alonePage?siteUrl+'/o/':siteUrl+'/s/')+scope.row.slug" target="_blank"><svg-icon class="wailian" icon-class="wailian"></svg-icon></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -158,6 +158,7 @@ import MarkdownEditor from '@/views/markdown/index'
|
||||
import markdownApi from "@/api/markdown-api";
|
||||
import categoryApi from "@/api/category";
|
||||
import api from "@/api/file-api";
|
||||
import {getSetting} from '@/api/setting-api'
|
||||
import MultipleTreeSelect from "@/components/select/MultipleTree";
|
||||
export default {
|
||||
name: 'articleManager',
|
||||
@ -173,6 +174,10 @@ export default {
|
||||
alonePage: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
newArticleText: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -199,6 +204,8 @@ export default {
|
||||
},
|
||||
draftNums: 0,
|
||||
multipleSelection: [],
|
||||
siteUrl: `${window.location.origin}/articles`,
|
||||
isEdit: false,
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
@ -215,6 +222,7 @@ export default {
|
||||
mounted() {
|
||||
this.getArticleList()
|
||||
this.categoryTree()
|
||||
this.getWebsiteSetting()
|
||||
this.newArticleDialogVisible = !!this.$route.query.operation
|
||||
// 监听返回
|
||||
if (window.history && window.history.pushState) {
|
||||
@ -312,6 +320,14 @@ export default {
|
||||
const operation = this.$route.query.operation
|
||||
this.newArticleDialogVisible = !!operation;
|
||||
},
|
||||
// 获取网站设置
|
||||
getWebsiteSetting() {
|
||||
getSetting({userId: this.$store.state.user.userId}).then((res) => {
|
||||
if(res.data) {
|
||||
this.siteUrl = res.data.siteUrl
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消筛选
|
||||
cancelFilter() {
|
||||
this.query.userId = ''
|
||||
@ -394,8 +410,10 @@ export default {
|
||||
newArticle() {
|
||||
this.newArticleDialogVisible = true
|
||||
this.$router.push({query: {operation: 'new'}})
|
||||
this.isEdit = false
|
||||
},
|
||||
editArticle(id) {
|
||||
this.isEdit = true
|
||||
this.newArticleDialogVisible = true
|
||||
this.$router.push({query: {operation: 'editor', id: id}})
|
||||
if(this.$refs.editor){
|
||||
@ -431,9 +449,11 @@ export default {
|
||||
if(this.alonePage){
|
||||
this.title = '创建新页面 ' + val
|
||||
}
|
||||
this.isEdit = false
|
||||
}
|
||||
if(operation === 'editor'){
|
||||
this.title = '编辑:' + val
|
||||
this.isEdit = true
|
||||
}
|
||||
},
|
||||
openDialog() {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<article-manager :page-title="pageTitle"></article-manager>
|
||||
<article-manager :page-title="pageTitle" :new-article-text="newArticleText"></article-manager>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -15,6 +15,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
pageTitle: '管理文章',
|
||||
newArticleText: '写文章'
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
|
||||
@ -12,8 +12,10 @@
|
||||
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="网站首页背景" name="1">
|
||||
<div class="config-itme-label">站点背景大图:
|
||||
</div>
|
||||
<div class="config-itme-label">站点地址:</div>
|
||||
<el-input autosize type="textarea" width="100%" v-model="form.siteUrl"></el-input>
|
||||
<span class="instruction">在这里填入站点的地址或域名。例如:<a href="https://blog.jmal.top" target="_blank">https://blog.jmal.top</a></span>
|
||||
<div class="config-itme-label">站点背景大图:</div>
|
||||
<upload-image-input v-model="form.backgroundSite"/>
|
||||
<span class="instruction">在这里填入图片的URL地址, 以在网站首页显示一个背景大图。</span>
|
||||
<div class="config-itme-label">首页大图内文字:</div>
|
||||
@ -95,6 +97,7 @@ export default {
|
||||
activeName: '1',
|
||||
example: '<i class="fab fa-github">github</i>',
|
||||
form: {
|
||||
siteUrl: '',
|
||||
backgroundSite: '',
|
||||
backgroundTextSite: '',
|
||||
backgroundDescSite: '',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user