<template>
  <div class="queryTemplate">
    <Search title="新增查询模板" :isSearch="false">
      <button class="btnAner">测试</button>
      <button class="btnAn">保存</button>
    </Search>
    <el-form
      style="margin-top: 10px"
      :inline="true"
      :rules="infoRules"
      :model="ruleForm"
      label-width="auto"
      ref="ruleForm"
      class="demo-ruleForm"
    >
      <el-row :gutter="24" class="b24">
        <el-col :span="5">
          <el-form-item label="查询模板名称" prop="name">
            <el-input
              size="medium"
              placeholder="暂无数据"
              v-model="ruleForm.name"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="查询协议" prop="agreement">
            <el-select v-model="ruleForm.agreement" placeholder="暂无数据">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="查询模板描述" prop="describe">
            <el-input
              size="medium"
              placeholder="暂无数据"
              v-model="ruleForm.describe"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item label="查询配置" prop="desc" style="margin-bottom: 24px">
        <el-input
          v-model="ruleForm.desc"
          class="desc"
          type="textarea"
          resize="none"
          :autosize="{ minRows: 4, maxRows: 4 }"
          placeholder="描述内容···"
          size="small"
        />
      </el-form-item>
      <el-form-item label="查询语句" prop="desc">
        <el-input
          v-model="ruleForm.sentence"
          class="desc"
          type="textarea"
          resize="none"
          :autosize="{ minRows: 26, maxRows: 26 }"
          placeholder="描述内容···"
          size="small"
        />
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import Search from "@/layout/components/Search/index.vue";
export default {
  data() {
    return {
      ruleForm: {
        name: "",
        agreement: "",
        describe: "",
        desc: "",
      },
      options: [],
      rules: {
        name: [
          { required: true, message: "请输入查询模板名称", trigger: "blur" },
        ],
        agreement: [
          { required: true, message: "请输入查询协议", trigger: "blur" },
        ],
        agreement: [
          { required: true, message: "请输入查询模板描述", trigger: "blur" },
        ],
        desc: [{ required: true, message: "请选查询配置", trigger: "change" }],
        sentence: [
          { required: true, message: "请选择查询语句", trigger: "change" },
        ],
      },
    };
  },
  components: {
    Search,
  },
};
</script>
<style lang="scss" scoped>
.queryTemplate {
  padding: 20px 30px 0 24px;
  height: 87vh;
  background: #ffffff;
  border-radius: 4px;
  .btnAner {
    width: 64px;
    height: 32px;
    background: #ffffff;
    border: 1px solid #9ebbf7;
    border-radius: 4px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: #2d67e3;
    margin-right: 16px;
  }
  ::v-deep .el-form-item {
    margin-bottom: 0px;
    margin-right: 0px;
  }
  .b24 {
    ::v-deep .el-input__inner {
      height: 32px;
    }
  }
  ::v-deep .el-form-item__content {
    width: calc(100% - 96px);
  }
  ::v-deep .el-form-item {
    width: 100%;
  }
  // .desc {
  //   ::v-deep .el-input__inner {
  //     height: 96px;
  //   }
  // }
}
</style>