<!--
 * @Author: your name
 * @Date: 2020-12-01 09:07:41
 * @LastEditTime: 2020-12-03 15:40:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \rs-cloud\src\views\webSiteManagement\aboutUs.vue
-->
<template>
  <div id="AboutUs">
    <!-- 顶部功能栏 -->
    <div class="top">
      <div class="title">关于我们</div>
    </div>
    <div class="content">
      <el-form ref="form" :model="form" label-width="180px">
        <el-form-item label="*联系电话">
          <el-col :span="12">
              <el-input v-model="form.title" placeholder="请输入联系电话"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="*邮箱">
          <el-col :span="12">
              <el-input v-model="form.email" placeholder="请输入邮箱"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="*公司地址">
          <el-col :span="12">
              <el-input v-model="form.address" placeholder="请输入公司地址"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="">
          <div id="map-container">
            <baidu-map class="bm-view"></baidu-map>
          </div>
        </el-form-item>
        <el-form-item label="*公司简介">
            <el-col :span="20">
                <Kind-editor  ref="kindeditor" :html="form.html" @input="getContent"></Kind-editor>
            </el-col>
        </el-form-item>
        <el-form-item>
          <el-button>取消</el-button>
          <el-button type="primary" @click="onSubmit">确定</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import KindEditor from "@/components/Kindeditor"; 
export default {
  name: "AboutUs",
  components: {
      KindEditor
  },
  data() {
    return {
      form: {
          title: '',
          email: '',
          address: '',  
          html: 'https://ebusiness-1255313385.cosbj.myqcloud.com/image/20190823/center2019082304054532.html',
          introduce: ''
      }
    };
  },
  mounted() {

  },
  methods: {
    // 获取编辑器内容
    getContent(introduce) {
        this.form.introduce = introduce
    },
    // 编辑器内容转换成在线url
    async getcontent2Url() {
        try {
            const htmlUrl =  await this.$refs.kindeditor.content2Url()
            return htmlUrl
        } catch (error) {
            console.log(error)
        }
    },
    onSubmit() {
      console.log('submit!');
    }
  },
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
#AboutUs {
  margin: 0 1% 0 1%;
  width: 98%;
  height: auto;
  .top {
    width: 100%;
    height: 68px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid #eeeeee;
    .title {
      width: 114px;
      height: 46px;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      color: #000000;
      overflow: hidden;
    }
  }
  .content {
    margin: 1% 1% 0 1%;
    width: 98%;
    height: calc(99% - 68px);
  }
  #map-container{
    width: 500px;
    height: 250px;
  }
}
</style>