Support attachment query by type.

pull/9/head
ruibaby 2019-04-22 00:23:42 +08:00
parent 539df22c82
commit 7170619e6a
3 changed files with 39 additions and 60 deletions

View File

@ -12,17 +12,19 @@
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="年月份">
<a-select placeholder="请选择年月">
<a-select-option value="2019-01">2019-01</a-select-option>
<a-select-option value="2019-02">2019-02</a-select-option>
<a-select-option value="2019-03">2019-03</a-select-option>
<a-form-item label="存储位置">
<a-select v-model="queryParam.attachmentType">
<a-select-option value="local">本地</a-select-option>
<a-select-option value="smms">SM.MS</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-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="类型">
<a-select placeholder="请选择类型" v-model="queryParam.mediaType">
<a-form-item label="文件类型">
<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>
</a-form-item>
@ -116,7 +118,8 @@ export default {
size: 18,
sort: null,
keyword: null,
mediaType: null
mediaType: null,
attachmentType: null
},
uploadHandler: attachmentApi.upload,
drawerVisiable: false
@ -172,6 +175,7 @@ export default {
resetParam() {
this.queryParam.keyword = null
this.queryParam.mediaType = null
this.queryParam.attachmentType = null
this.loadAttachments()
},
handleDelete(attachment) {

View File

@ -7,21 +7,14 @@
:md="10"
:sm="24"
:xs="24"
:style="{ 'padding-bottom': '12px' }"
>
:style="{ 'padding-bottom': '12px' }">
<a-card title="添加菜单">
<a-form layout="horizontal">
<a-form-item
label="名称:"
help="* 页面上所显示的名称"
>
<a-input v-model="menuToCreate.name" />
<a-form-item label="名称:" help="* 页面上所显示的名称">
<a-input v-model="menuToCreate.name"/>
</a-form-item>
<a-form-item
label="路径:"
help="* 菜单的路径"
>
<a-input v-model="menuToCreate.url" />
<a-form-item label="路径:" help="* 菜单的路径">
<a-input v-model="menuToCreate.url"/>
</a-form-item>
<a-form-item label="上级菜单:">
<a-select v-model="menuToCreate.parentId">
@ -33,31 +26,23 @@
</a-select>
</a-form-item>
<a-form-item label="排序编号:">
<a-input
type="number"
v-model="menuToCreate.sort"
/>
<a-input type="number" v-model="menuToCreate.sort"/>
</a-form-item>
<a-form-item
label="图标:"
help="* 请根据主题的支持选填"
>
<a-input v-model="menuToCreate.icon" />
<a-form-item label="图标:" help="* 请根据主题的支持选填" :style="{ display: fieldExpand ? 'block' : 'none' }">
<a-input v-model="menuToCreate.icon"/>
</a-form-item>
<a-form-item label="打开方式:">
<a-select
defaultValue="_self"
v-model="menuToCreate.target"
>
<a-form-item label="打开方式:" :style="{ display: fieldExpand ? 'block' : 'none' }">
<a-select defaultValue="_self" v-model="menuToCreate.target">
<a-select-option value="_self">当前窗口</a-select-option>
<a-select-option value="_blank">新窗口</a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<a-button
type="primary"
@click="createMenu"
>保存</a-button>
<a-button type="primary" @click="createMenu"></a-button>
<a :style="{ marginLeft: '8px'}" @click="toggleExpand">
更多选项
<a-icon :type="fieldExpand ? 'up' : 'down'"/>
</a>
</a-form-item>
</a-form>
</a-card>
@ -68,8 +53,7 @@
:md="14"
:sm="24"
:xs="24"
:style="{ 'padding-bottom': '12px' }"
>
:style="{ 'padding-bottom': '12px' }">
<a-card title="所有菜单">
<a-table
:columns="columns"
@ -77,23 +61,10 @@
:loading="loading"
:rowKey="menu => menu.id"
>
<ellipsis
:length="30"
tooltip
slot="name"
slot-scope="text"
>
{{ text }}
</ellipsis>
<span
slot="action"
slot-scope="text, record"
>
<a
href="javascript:;"
@click="editMenu(record.id)"
>编辑</a>
<a-divider type="vertical" />
<ellipsis :length="30" tooltip slot="name" 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
:title="'你确定要删除【' + record.name + '】菜单?'"
@confirm="deleteMenu(record.id)"
@ -143,7 +114,8 @@ export default {
loading: true,
columns,
menus: [],
menuToCreate: {}
menuToCreate: {},
fieldExpand: false
}
},
created() {
@ -169,6 +141,9 @@ export default {
this.$message.success('删除成功!')
this.loadMenus()
})
},
toggleExpand() {
this.fieldExpand = !this.fieldExpand
}
}
}

View File

@ -182,7 +182,7 @@
>
<a-select-option value="local">本地</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="aliyun">阿里云</a-select-option>
</a-select>
@ -407,7 +407,7 @@ export default {
this.qnyunFormHidden = false
this.aliyunFormHidden = false
break
case 'ypyun':
case 'upyun':
this.upyunFormHidden = true
this.qnyunFormHidden = false
this.aliyunFormHidden = false