<!--
 * @Description: create
 * @Version: 1.0
 * @Autor: XuTongZhang
 * @Date: 2020-07-28 17:19:02
 * @LastEditors: XuTongZhang
 * @LastEditTime: 2020-07-29 19:38:47
-->
<template>
  <div class="basicInfo">
    <el-card class="box-card">
      <el-form ref="form" :model="form" label-width="140px" label-position="left">
        <el-form-item label="公司名称">
          <el-input v-model.trim="form.companyName"></el-input>
        </el-form-item>
        <el-form-item label="公司地址">
          <el-input v-model.trim="form.companyAddress"></el-input>
        </el-form-item>
        <el-form-item label="公司简介">
          <editor-bar class="editor" v-model.trim="form.companyIntroduce"></editor-bar>
        </el-form-item>
        <el-form-item class="button-grounp">
          <el-button type="primary" @click="determine">确认修改</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import EditorBar from '../../components/wangEnduit/wangEnduit'
export default {
  data () {
    return {
      form: {}
    }
  },
  components: {
    EditorBar
  },
  created () {
    this.getDetails()
  },
  methods: {
    getDetails () {
      let url = '/companyInfo/queryCompanyInfo'
      let reqdata = {}
      this.$api
        .post(url, {
          reqdata
        })
        .then((res) => {
          this.form = res.object
        })
    },
    determine () {
      let url = '/companyInfo/updateCompanyInfo'
      let reqdata = this.form
      this.$api
        .post(url, {
          reqdata
        })
        .then((res) => {
          this.getDetails()
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.basicInfo {
  display: flex;
  justify-content: center;
  align-content: center;
}
.box-card {
  width: 800rpx;
  padding: 18px 0;
}
.button-grounp {
    display: flex;
    justify-content: flex-end;
}
</style>
