完善商品多属性的页面

This commit is contained in:
季圣华
2022-08-30 00:45:15 +08:00
parent 654a246d84
commit 6bf5df5bca
3 changed files with 52 additions and 8 deletions

View File

@@ -3,6 +3,37 @@
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="属性名" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="请输入属性名查询" v-model="queryParam.attributeName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
@@ -14,9 +45,14 @@
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
@@ -48,7 +84,7 @@
offset: 1
},
// 查询条件
queryParam: {attributeField:''},
queryParam: {attributeName:''},
// 表头
columns: [
{
@@ -61,8 +97,8 @@
return parseInt(index)+1;
}
},
{title: '属性名', dataIndex: 'attributeName', width: 100},
{title: '属性值用竖线隔开', dataIndex: 'attributeValue', width: 400},
{title: '属性名', dataIndex: 'attributeName', width: 200},
{title: '属性值(用竖线隔开)', dataIndex: 'attributeValue', width: 500},
{
title: '操作',
dataIndex: 'action',
@@ -82,7 +118,14 @@
},
methods: {
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>