Commit 99aaf13f by cwq0219

编辑

1 parent 1a4e4121
......@@ -12,20 +12,29 @@
style="margin-top: 20px;"
:tab-position="tabPosition"
v-model='activeName'
@tab-click='handleClick'
>
@tab-click='handleClick'>
<gl-tab-pane
label='基本信息'
name='first'
>
<gl-col v-loading="basicLoading" :span="24" class="detail-basic">
<gl-col :span="24">
<gl-button
type="primary"
@click="handleEdit(false)"
>{{isEdit ? "保存" : "编辑"}}</gl-button>
<gl-button
@click="handleEdit(true)"
v-if="isEdit"
>取消</gl-button>
</gl-col>
<gl-col
class="detail-row"
:span="i.isMap? 24 : 8"
v-for="(i, index) in List"
:key="index+''"
>
<span>{{i.label}}:
<span style="line-height: 50px;">{{i.label}}:
<div
v-if="i.isMap"
class='amap-page-container'
......@@ -46,6 +55,11 @@
:src="i.value"
alt=""
>
<gl-input
v-else-if="isEdit && editOptions.includes(i.name)"
v-model="i.value"
:placeholder=i.label
></gl-input>
<span v-else>{{i.value}}</span>
</span>
</gl-col>
......@@ -143,6 +157,8 @@ export default {
IdChange: [0, 0, 0],
activeName: 'first',
merchantInfo: {},
isEdit: false,
editOptions: ['address', 'merchantChannelName', 'contactor', 'contactPhone', 'phone', 'email'],
List: [
{
name: 'merchantName',
......@@ -320,6 +336,16 @@ export default {
this.activeName = 'first'
this.merchantId = row.merchantId
},
// 编辑,取消
handleEdit(isCancel) {
// 保存
if (!isCancel && this.isEdit) {
console.log('调保存接口--')
this.isEdit = !this.isEdit
} else {
this.isEdit = !this.isEdit
}
},
// 切换tab
handleClick(tab, event) {
switch (tab.name) {
......@@ -468,5 +494,8 @@ export default {
.el-tabs__header{
background-color: #fafafa;
}
.detail .el-input {
width: 80%;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!