<template>
  <div class="config-form">
    <el-form ref="form" :model="form" label-width="auto">
      <el-row type="flex">
        <el-form-item label="数据库地址">
          <el-input v-model="form.db_host"></el-input>
        </el-form-item>

        <el-col :span="1"></el-col>

        <el-form-item label="数据库端口">
          <el-input v-model="form.db_port" style="width: 100px"></el-input>
        </el-form-item>
      </el-row>

      <el-row type="flex">
        <el-form-item label="数据库用户名">
          <el-input v-model="form.db_name"></el-input>
        </el-form-item>

        <el-col :span="1"></el-col>

        <el-form-item label="数据库密码">
          <el-input v-model="form.db_pass"></el-input>
        </el-form-item>
      </el-row>

      <el-row type="flex">
        <el-form-item label="数据库更新时间">
          <el-date-picker
            type="date"
            v-model="form.db_update_at"
            disabled
            style="width: 200px"
          ></el-date-picker>
        </el-form-item>

        <el-form-item style="margin-left: -30px">
          <el-button type="primary" @click="updateDB">更新</el-button>
        </el-form-item>
      </el-row>

      <!-- <el-divider></el-divider> -->
      <br>

      <el-form-item label="企业微信api">
        <el-input v-model="form.qywx_api" style="width: 500px"></el-input>
      </el-form-item>
      <!-- <el-divider></el-divider> -->
      
      <br>
      <el-row type="flex" justify="center">
        <el-form-item style="margin-left: -150px">
          <el-button type="primary" @click="onSubmit">保存</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "Settings",
  data() {
    return {
      form: {
        name: "testxxxx",
        region: "",
        db_update_at: "2022-11-14",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
      },
    };
  },
  methods: {
    onSubmit() {
      console.log("submit!");
    },
    updateDB() {
      console.log("update database");
    },
  },
};
</script>

<style>
.config-form {
  margin-left: 320px;
  margin-right: 180px;
}
</style>