mirror of https://github.com/halo-dev/halo
Support attachment query by type.
parent
539df22c82
commit
7170619e6a
|
@ -12,17 +12,19 @@
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :md="6" :sm="24">
|
<a-col :md="6" :sm="24">
|
||||||
<a-form-item label="年月份">
|
<a-form-item label="存储位置">
|
||||||
<a-select placeholder="请选择年月">
|
<a-select v-model="queryParam.attachmentType">
|
||||||
<a-select-option value="2019-01">2019-01</a-select-option>
|
<a-select-option value="local">本地</a-select-option>
|
||||||
<a-select-option value="2019-02">2019-02</a-select-option>
|
<a-select-option value="smms">SM.MS</a-select-option>
|
||||||
<a-select-option value="2019-03">2019-03</a-select-option>
|
<a-select-option value="upyun">又拍云</a-select-option>
|
||||||
|
<a-select-option value="qnyun">七牛云</a-select-option>
|
||||||
|
<a-select-option value="aliyun">阿里云</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :md="6" :sm="24">
|
<a-col :md="6" :sm="24">
|
||||||
<a-form-item label="类型">
|
<a-form-item label="文件类型">
|
||||||
<a-select placeholder="请选择类型" v-model="queryParam.mediaType">
|
<a-select v-model="queryParam.mediaType">
|
||||||
<a-select-option v-for="(item,index) in mediaTypes" :key="index" :value="item">{{ item }}</a-select-option>
|
<a-select-option v-for="(item,index) in mediaTypes" :key="index" :value="item">{{ item }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
@ -116,7 +118,8 @@ export default {
|
||||||
size: 18,
|
size: 18,
|
||||||
sort: null,
|
sort: null,
|
||||||
keyword: null,
|
keyword: null,
|
||||||
mediaType: null
|
mediaType: null,
|
||||||
|
attachmentType: null
|
||||||
},
|
},
|
||||||
uploadHandler: attachmentApi.upload,
|
uploadHandler: attachmentApi.upload,
|
||||||
drawerVisiable: false
|
drawerVisiable: false
|
||||||
|
@ -172,6 +175,7 @@ export default {
|
||||||
resetParam() {
|
resetParam() {
|
||||||
this.queryParam.keyword = null
|
this.queryParam.keyword = null
|
||||||
this.queryParam.mediaType = null
|
this.queryParam.mediaType = null
|
||||||
|
this.queryParam.attachmentType = null
|
||||||
this.loadAttachments()
|
this.loadAttachments()
|
||||||
},
|
},
|
||||||
handleDelete(attachment) {
|
handleDelete(attachment) {
|
||||||
|
|
|
@ -7,21 +7,14 @@
|
||||||
:md="10"
|
:md="10"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:style="{ 'padding-bottom': '12px' }"
|
:style="{ 'padding-bottom': '12px' }">
|
||||||
>
|
|
||||||
<a-card title="添加菜单">
|
<a-card title="添加菜单">
|
||||||
<a-form layout="horizontal">
|
<a-form layout="horizontal">
|
||||||
<a-form-item
|
<a-form-item label="名称:" help="* 页面上所显示的名称">
|
||||||
label="名称:"
|
<a-input v-model="menuToCreate.name"/>
|
||||||
help="* 页面上所显示的名称"
|
|
||||||
>
|
|
||||||
<a-input v-model="menuToCreate.name" />
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item label="路径:" help="* 菜单的路径">
|
||||||
label="路径:"
|
<a-input v-model="menuToCreate.url"/>
|
||||||
help="* 菜单的路径"
|
|
||||||
>
|
|
||||||
<a-input v-model="menuToCreate.url" />
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="上级菜单:">
|
<a-form-item label="上级菜单:">
|
||||||
<a-select v-model="menuToCreate.parentId">
|
<a-select v-model="menuToCreate.parentId">
|
||||||
|
@ -33,31 +26,23 @@
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="排序编号:">
|
<a-form-item label="排序编号:">
|
||||||
<a-input
|
<a-input type="number" v-model="menuToCreate.sort"/>
|
||||||
type="number"
|
|
||||||
v-model="menuToCreate.sort"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item label="图标:" help="* 请根据主题的支持选填" :style="{ display: fieldExpand ? 'block' : 'none' }">
|
||||||
label="图标:"
|
<a-input v-model="menuToCreate.icon"/>
|
||||||
help="* 请根据主题的支持选填"
|
|
||||||
>
|
|
||||||
<a-input v-model="menuToCreate.icon" />
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="打开方式:">
|
<a-form-item label="打开方式:" :style="{ display: fieldExpand ? 'block' : 'none' }">
|
||||||
<a-select
|
<a-select defaultValue="_self" v-model="menuToCreate.target">
|
||||||
defaultValue="_self"
|
|
||||||
v-model="menuToCreate.target"
|
|
||||||
>
|
|
||||||
<a-select-option value="_self">当前窗口</a-select-option>
|
<a-select-option value="_self">当前窗口</a-select-option>
|
||||||
<a-select-option value="_blank">新窗口</a-select-option>
|
<a-select-option value="_blank">新窗口</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-button
|
<a-button type="primary" @click="createMenu">保存</a-button>
|
||||||
type="primary"
|
<a :style="{ marginLeft: '8px'}" @click="toggleExpand">
|
||||||
@click="createMenu"
|
更多选项
|
||||||
>保存</a-button>
|
<a-icon :type="fieldExpand ? 'up' : 'down'"/>
|
||||||
|
</a>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
@ -68,8 +53,7 @@
|
||||||
:md="14"
|
:md="14"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:style="{ 'padding-bottom': '12px' }"
|
:style="{ 'padding-bottom': '12px' }">
|
||||||
>
|
|
||||||
<a-card title="所有菜单">
|
<a-card title="所有菜单">
|
||||||
<a-table
|
<a-table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -77,23 +61,10 @@
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:rowKey="menu => menu.id"
|
:rowKey="menu => menu.id"
|
||||||
>
|
>
|
||||||
<ellipsis
|
<ellipsis :length="30" tooltip slot="name" slot-scope="text">{{ text }}</ellipsis>
|
||||||
:length="30"
|
<span slot="action" slot-scope="text, record">
|
||||||
tooltip
|
<a href="javascript:;" @click="editMenu(record.id)">编辑</a>
|
||||||
slot="name"
|
<a-divider type="vertical"/>
|
||||||
slot-scope="text"
|
|
||||||
>
|
|
||||||
{{ text }}
|
|
||||||
</ellipsis>
|
|
||||||
<span
|
|
||||||
slot="action"
|
|
||||||
slot-scope="text, record"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href="javascript:;"
|
|
||||||
@click="editMenu(record.id)"
|
|
||||||
>编辑</a>
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="'你确定要删除【' + record.name + '】菜单?'"
|
:title="'你确定要删除【' + record.name + '】菜单?'"
|
||||||
@confirm="deleteMenu(record.id)"
|
@confirm="deleteMenu(record.id)"
|
||||||
|
@ -143,7 +114,8 @@ export default {
|
||||||
loading: true,
|
loading: true,
|
||||||
columns,
|
columns,
|
||||||
menus: [],
|
menus: [],
|
||||||
menuToCreate: {}
|
menuToCreate: {},
|
||||||
|
fieldExpand: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -169,6 +141,9 @@ export default {
|
||||||
this.$message.success('删除成功!')
|
this.$message.success('删除成功!')
|
||||||
this.loadMenus()
|
this.loadMenus()
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
toggleExpand() {
|
||||||
|
this.fieldExpand = !this.fieldExpand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
>
|
>
|
||||||
<a-select-option value="local">本地</a-select-option>
|
<a-select-option value="local">本地</a-select-option>
|
||||||
<a-select-option value="smms">SM.MS</a-select-option>
|
<a-select-option value="smms">SM.MS</a-select-option>
|
||||||
<a-select-option value="ypyun">又拍云</a-select-option>
|
<a-select-option value="upyun">又拍云</a-select-option>
|
||||||
<a-select-option value="qnyun">七牛云</a-select-option>
|
<a-select-option value="qnyun">七牛云</a-select-option>
|
||||||
<a-select-option value="aliyun">阿里云</a-select-option>
|
<a-select-option value="aliyun">阿里云</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
|
@ -407,7 +407,7 @@ export default {
|
||||||
this.qnyunFormHidden = false
|
this.qnyunFormHidden = false
|
||||||
this.aliyunFormHidden = false
|
this.aliyunFormHidden = false
|
||||||
break
|
break
|
||||||
case 'ypyun':
|
case 'upyun':
|
||||||
this.upyunFormHidden = true
|
this.upyunFormHidden = true
|
||||||
this.qnyunFormHidden = false
|
this.qnyunFormHidden = false
|
||||||
this.aliyunFormHidden = false
|
this.aliyunFormHidden = false
|
||||||
|
|
Loading…
Reference in New Issue