基于Ant Design vue框架之二 修改页面细细拆分

我们还是老规矩,先上效果图吧~~
在这里插入图片描述
需要看整个页面的小盆友可以点下面这个路径哈~~
页面路径总页面展示

继续上干货吧~翠花,上代码~~

在这里插入图片描述
在这里插入图片描述
继续走修改的画面:

<a-modal
        title="用户信息修改页面"
        :width="640"
        :visible="visible"
        :confirmLoading="confirmLoading"
        @cancel="handleCancel"
    >
    <a-spin :spinning="confirmLoading">
        <a-form :form="form">
        <!-- step1 -->
        <div>
            <a-form-item label="用户编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input v-decorator="['id']" disabled/>
            </a-form-item>
            <a-form-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input v-decorator="['account']" />
            </a-form-item>
            <a-form-item label="用户身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input v-decorator="['adminName']" />
            </a-form-item>
            <a-form-item label="身份证号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input v-decorator="['idCard']" />
            </a-form-item>
            <a-form-item label="联系方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input v-decorator="['mobilePhone']" />
            </a-form-item>
            <a-form-item label="用户地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input v-decorator="['address']" />
            </a-form-item>
        </div>
        <!-- step1 end -->
        </a-form>
    </a-spin>
    <template slot="footer">
        <a-button key="cancel" @click="handleCancel">取消</a-button>
        <a-button
        key="forward"
        :loading="confirmLoading"
        type="primary"
        @click="handleNext(currentStep)"
        >确定</a-button>
    </template>
</a-modal>

在这里插入图片描述

edit(record) {
        this.visible = true
        const {
            form: { setFieldsValue }
        } = this
        this.$nextTick(() => {
            setFieldsValue(record)
        })
        },
        handleNext(step) {
        const {
            form: { validateFields }
        } = this
        // last step
        this.confirmLoading = true
        /**
        * @description  将from表单的数据进行传参并修改
        */
        validateFields((errors, values) => {
            console.log('errors:', errors, 'val:', values)
            if (!errors) {
            updateUser(values).then(res => {
                switch (res.code) {
                case 200:
                    this.$message.success('修改成功!')
                    this.$emit('ok', values)
                    this.visible = false
                    this.confirmLoading = false
                    break
                case 199:
                    this.$message.success('修改失败!')
                    break
            }
                    return res.data
            })
            }
        })
        },
        handleCancel() {
        // clear form & currentStep
        this.visible = false
        this.currentStep = 0
        }

修改的页面也就到这里了,若是有其他有想法的小伙伴可以参加其中,大家一起进步,一起共勉!!!!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值