pull/9/head
unknown 2019-04-26 23:26:48 +08:00
commit 79a0cc0d0f
11 changed files with 130 additions and 77 deletions

View File

@ -28,4 +28,11 @@ journalApi.update = (journalId, journal) => {
}) })
} }
journalApi.delete = journalId => {
return service({
url: `${baseUrl}/${journalId}`,
method: 'delete'
})
}
export default journalApi export default journalApi

View File

@ -8,7 +8,8 @@ body {
height: auto; height: auto;
overflow-x: hidden; overflow-x: hidden;
&.mobile,&.tablet { &.mobile,
&.tablet {
.ant-layout-content { .ant-layout-content {
@ -25,11 +26,14 @@ body {
.ant-table-content { .ant-table-content {
overflow-y: auto; overflow-y: auto;
} }
.ant-table-body { .ant-table-body {
min-width: 800px; min-width: 800px;
} }
} }
.topmenu { .topmenu {
/* 必须为 topmenu 才能启用流式布局 */ /* 必须为 topmenu 才能启用流式布局 */
&.content-width-Fluid { &.content-width-Fluid {
.header-index-wide { .header-index-wide {
@ -43,7 +47,8 @@ body {
.sidemenu { .sidemenu {
.ant-header-fixedHeader { .ant-header-fixedHeader {
&.ant-header-side-opened, &.ant-header-side-closed { &.ant-header-side-opened,
&.ant-header-side-closed {
width: 100% width: 100%
} }
} }
@ -60,6 +65,7 @@ body {
padding: 0 24px; padding: 0 24px;
cursor: pointer; cursor: pointer;
transition: color .3s; transition: color .3s;
&:hover { &:hover {
background: rgba(0, 0, 0, 0.025); background: rgba(0, 0, 0, 0.025);
} }
@ -82,6 +88,7 @@ body {
width: 100%; width: 100%;
} }
} }
/* 必须为 topmenu 才能启用流式布局 */ /* 必须为 topmenu 才能启用流式布局 */
&.content-width-Fluid { &.content-width-Fluid {
.header-index-wide { .header-index-wide {
@ -123,7 +130,8 @@ body {
position: relative; position: relative;
} }
.header, .top-nav-header-index { .header,
.top-nav-header-index {
.user-wrapper { .user-wrapper {
float: right; float: right;
@ -160,6 +168,7 @@ body {
.action { .action {
color: rgba(255, 255, 255, 0.85); color: rgba(255, 255, 255, 0.85);
a { a {
color: rgba(255, 255, 255, 0.85); color: rgba(255, 255, 255, 0.85);
} }
@ -172,7 +181,8 @@ body {
} }
} }
&.mobile,&.tablet { &.mobile,
&.tablet {
.top-nav-header-index { .top-nav-header-index {
.header-index-wide { .header-index-wide {
@ -188,6 +198,7 @@ body {
flex: 0; flex: 0;
text-align: center; text-align: center;
line-height: 58px; line-height: 58px;
h1 { h1 {
display: none; display: none;
} }
@ -205,12 +216,14 @@ body {
} }
} }
} }
// //
} }
} }
} }
&.tablet { &.tablet {
// overflow: hidden; text-overflow:ellipsis; white-space: nowrap; // overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
.top-nav-header-index { .top-nav-header-index {
@ -223,6 +236,7 @@ body {
white-space: nowrap; white-space: nowrap;
} }
} }
.ant-menu.ant-menu-horizontal { .ant-menu.ant-menu-horizontal {
flex: 1 1; flex: 1 1;
white-space: normal; white-space: normal;
@ -262,7 +276,8 @@ body {
transition: all .3s; transition: all .3s;
overflow: hidden; overflow: hidden;
img, svg { img,
svg {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
height: 32px; height: 32px;
@ -330,8 +345,10 @@ body {
background-color: rgb(0, 21, 41); background-color: rgb(0, 21, 41);
} }
} }
&.light { &.light {
box-shadow: none; box-shadow: none;
.ant-drawer-content { .ant-drawer-content {
background-color: #fff; background-color: #fff;
} }
@ -352,6 +369,7 @@ body {
.ant-layout-sider-children { .ant-layout-sider-children {
padding-top: 64px; padding-top: 64px;
overflow-y: hidden; overflow-y: hidden;
&:hover { &:hover {
overflow-y: auto; overflow-y: auto;
} }
@ -376,12 +394,15 @@ body {
overflow: hidden; overflow: hidden;
z-index: 9; z-index: 9;
img, svg, h1 { img,
svg,
h1 {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
img, svg { img,
svg {
height: 32px; height: 32px;
width: 32px; width: 32px;
} }
@ -422,6 +443,7 @@ body {
user-select: none; user-select: none;
} }
} }
.user-dropdown-menu-wrapper.ant-dropdown-menu { .user-dropdown-menu-wrapper.ant-dropdown-menu {
padding: 4px 0; padding: 4px 0;
@ -431,8 +453,7 @@ body {
.ant-dropdown-menu-item>.anticon:first-child, .ant-dropdown-menu-item>.anticon:first-child,
.ant-dropdown-menu-item>a>.anticon:first-child, .ant-dropdown-menu-item>a>.anticon:first-child,
.ant-dropdown-menu-submenu-title > .anticon:first-child .ant-dropdown-menu-submenu-title>.anticon:first-child .ant-dropdown-menu-submenu-title>a>.anticon:first-child {
.ant-dropdown-menu-submenu-title > a > .anticon:first-child {
min-width: 12px; min-width: 12px;
margin-right: 8px; margin-right: 8px;
} }
@ -464,6 +485,7 @@ body {
padding-right: 8px; padding-right: 8px;
width: auto; width: auto;
} }
.ant-form-item-control { .ant-form-item-control {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
@ -493,6 +515,7 @@ body {
.ant-card { .ant-card {
.ant-card-head { .ant-card-head {
padding: 0 16px !important; padding: 0 16px !important;
.ant-card-head-wrapper { .ant-card-head-wrapper {
.ant-card-head-title { .ant-card-head-title {
padding: 12px 0 !important; padding: 12px 0 !important;
@ -520,21 +543,26 @@ body {
.card-container { .card-container {
background: #f5f5f5; background: #f5f5f5;
&>.ant-tabs-card { &>.ant-tabs-card {
&>.ant-tabs-content { &>.ant-tabs-content {
margin-top: -16px; margin-top: -16px;
&>.ant-tabs-tabpane { &>.ant-tabs-tabpane {
background: #fff; background: #fff;
padding: 16px; padding: 16px;
} }
} }
&>.ant-tabs-bar { &>.ant-tabs-bar {
border-color: #fff; border-color: #fff;
.ant-tabs-tab { .ant-tabs-tab {
border: none !important; border: none !important;
margin-right: 0 !important; margin-right: 0 !important;
background: transparent; background: transparent;
} }
.ant-tabs-tab-active { .ant-tabs-tab-active {
border-color: #fff; border-color: #fff;
background: #fff; background: #fff;
@ -554,3 +582,22 @@ body {
background: rgb(255, 255, 255); background: rgb(255, 255, 255);
border-radius: 0px 0px 4px 4px; border-radius: 0px 0px 4px 4px;
} }
.page-wrapper {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-flow: row wrap;
flex-flow: row wrap;
.ant-pagination-options-size-changer.ant-select{
margin:0
}
}

View File

@ -107,10 +107,7 @@
</a-list> </a-list>
</a-col> </a-col>
</a-row> </a-row>
<a-row <div class="page-wrapper">
type="flex"
justify="end"
>
<a-pagination <a-pagination
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size" :defaultPageSize="pagination.size"
@ -119,7 +116,7 @@
@change="handlePaginationChange" @change="handlePaginationChange"
@showSizeChange="handlePaginationChange" @showSizeChange="handlePaginationChange"
/> />
</a-row> </div>
<a-modal <a-modal
title="上传附件" title="上传附件"
v-model="uploadVisible" v-model="uploadVisible"

View File

@ -42,16 +42,13 @@
</a-skeleton> </a-skeleton>
</a-row> </a-row>
<a-divider /> <a-divider />
<a-row <div class="page-wrapper">
type="flex"
justify="end"
>
<a-pagination <a-pagination
:defaultPageSize="pagination.size" :defaultPageSize="pagination.size"
:total="pagination.total" :total="pagination.total"
@change="handlePaginationChange" @change="handlePaginationChange"
></a-pagination> ></a-pagination>
</a-row> </div>
<AttachmentDetailDrawer <AttachmentDetailDrawer
v-model="detailVisiable" v-model="detailVisiable"

View File

@ -40,16 +40,13 @@
</a-skeleton> </a-skeleton>
</a-row> </a-row>
<a-divider /> <a-divider />
<a-row <div class="page-wrapper">
type="flex"
justify="end"
>
<a-pagination <a-pagination
:defaultPageSize="pagination.size" :defaultPageSize="pagination.size"
:total="pagination.total" :total="pagination.total"
@change="handlePaginationChange" @change="handlePaginationChange"
></a-pagination> ></a-pagination>
</a-row> </div>
<a-divider /> <a-divider />
<div class="bottom-control"> <div class="bottom-control">
<a-button <a-button

View File

@ -102,11 +102,7 @@
>删除</a> >删除</a>
</span> </span>
</a-table> </a-table>
<a-row <div class="page-wrapper">
type="flex"
justify="end"
align="middle"
>
<a-pagination <a-pagination
class="pagination" class="pagination"
:total="pagination.total" :total="pagination.total"
@ -115,7 +111,7 @@
@showSizeChange="onPaginationChange" @showSizeChange="onPaginationChange"
@change="onPaginationChange" @change="onPaginationChange"
/> />
</a-row> </div>
</div> </div>
</a-card> </a-card>
</page-view> </page-view>

View File

@ -205,14 +205,15 @@ export default {
if (this.menuToCreate.id) { if (this.menuToCreate.id) {
menuApi.update(this.menuToCreate.id, this.menuToCreate).then(response => { menuApi.update(this.menuToCreate.id, this.menuToCreate).then(response => {
this.$message.success('更新成功!') this.$message.success('更新成功!')
this.loadMenus()
}) })
} else { } else {
menuApi.create(this.menuToCreate).then(response => { menuApi.create(this.menuToCreate).then(response => {
this.$message.success('保存成功!') this.$message.success('保存成功!')
this.loadMenus()
}) })
} }
this.handleAddMenu() this.handleAddMenu()
this.loadMenus()
}, },
toggleExpand() { toggleExpand() {
this.fieldExpand = !this.fieldExpand this.fieldExpand = !this.fieldExpand

View File

@ -176,11 +176,7 @@
</a-popconfirm> </a-popconfirm>
</span> </span>
</a-table> </a-table>
<a-row <div class="page-wrapper">
type="flex"
justify="end"
align="middle"
>
<a-pagination <a-pagination
class="pagination" class="pagination"
:total="pagination.total" :total="pagination.total"
@ -189,7 +185,7 @@
@showSizeChange="onPaginationChange" @showSizeChange="onPaginationChange"
@change="onPaginationChange" @change="onPaginationChange"
/> />
</a-row> </div>
</div> </div>
</a-card> </a-card>
</div> </div>

View File

@ -17,7 +17,7 @@
:sm="24" :sm="24"
> >
<a-form-item label="关键词"> <a-form-item label="关键词">
<a-input /> <a-input v-model="queryParam.keyword"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col <a-col
@ -40,7 +40,10 @@
type="primary" type="primary"
@click="loadJournals(true)" @click="loadJournals(true)"
>查询</a-button> >查询</a-button>
<a-button style="margin-left: 8px;" @click="resetParam"></a-button> <a-button
style="margin-left: 8px;"
@click="resetParam"
>重置</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
@ -84,7 +87,14 @@
@click="handleEdit(item)" @click="handleEdit(item)"
>编辑</a> >编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm
title="你确定要删除这条日志?"
@confirm="handleDelete(item.id)"
okText="确定"
cancelText="取消"
>
<a href="javascript:void(0);">删除</a> <a href="javascript:void(0);">删除</a>
</a-popconfirm>
</template> </template>
<a-list-item-meta :description="item.content"> <a-list-item-meta :description="item.content">
<span slot="title">{{ item.createTime | moment }}</span> <span slot="title">{{ item.createTime | moment }}</span>
@ -95,7 +105,7 @@
/> />
</a-list-item-meta> </a-list-item-meta>
</a-list-item> </a-list-item>
<template> <div class="page-wrapper">
<a-pagination <a-pagination
class="pagination" class="pagination"
:total="pagination.total" :total="pagination.total"
@ -104,7 +114,7 @@
@showSizeChange="onPaginationChange" @showSizeChange="onPaginationChange"
@change="onPaginationChange" @change="onPaginationChange"
/> />
</template> </div>
</a-list> </a-list>
</div> </div>
</a-card> </a-card>
@ -190,18 +200,25 @@ export default {
this.journal = item this.journal = item
this.visible = true this.visible = true
}, },
handleDelete(id) {
journalApi.delete(id).then(response => {
this.$message.success('删除成功!')
this.loadJournals()
})
},
createOrUpdateJournal() { createOrUpdateJournal() {
if (this.journal.id) { if (this.journal.id) {
journalApi.update(this.journal.id, this.journal).then(response => { journalApi.update(this.journal.id, this.journal).then(response => {
this.$message.success('更新成功!') this.$message.success('更新成功!')
this.loadJournals()
}) })
} else { } else {
journalApi.create(this.journal).then(response => { journalApi.create(this.journal).then(response => {
this.$message.success('发表成功!') this.$message.success('发表成功!')
this.loadJournals()
}) })
} }
this.visible = false this.visible = false
this.loadJournals()
}, },
onPaginationChange(page, pageSize) { onPaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`) this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)

View File

@ -183,14 +183,15 @@ export default {
if (this.link.id) { if (this.link.id) {
linkApi.update(this.link.id, this.link).then(response => { linkApi.update(this.link.id, this.link).then(response => {
this.$message.success('更新成功!') this.$message.success('更新成功!')
this.loadLinks()
}) })
} else { } else {
linkApi.create(this.link).then(response => { linkApi.create(this.link).then(response => {
this.$message.success('保存成功!') this.$message.success('保存成功!')
this.loadLinks()
}) })
} }
this.handleAddLink() this.handleAddLink()
this.loadLinks()
} }
} }
} }

View File

@ -90,10 +90,7 @@
</a-list> </a-list>
</a-col> </a-col>
</a-row> </a-row>
<a-row <div class="page-wrapper">
type="flex"
justify="end"
>
<a-pagination <a-pagination
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size" :defaultPageSize="pagination.size"
@ -102,7 +99,7 @@
@change="handlePaginationChange" @change="handlePaginationChange"
@showSizeChange="handlePaginationChange" @showSizeChange="handlePaginationChange"
/> />
</a-row> </div>
<a-drawer <a-drawer
title="图片详情" title="图片详情"
:width="isMobile()?'100%':'460'" :width="isMobile()?'100%':'460'"