<template>
  <div class="eibs-tab">
    <c-col :span="24">
      <el-form-item
        :label="`${argadr.title}参考号`"
        :prop="`${argadr.grp}.${argadr.rol}.pts.ref`"
      >
        <c-input
          v-model="model[argadr.grp][argadr.rol].pts.ref"
          :placeholder="'请输入' + argadr.title + '参考号'"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="18">
      <el-form-item
        label="Extkey"
        :prop="`${argadr.grp}.${argadr.rol}.pts.${isAdrblk ? 'extkey' : 'bankno'}`"
      >
        <c-input
          v-model="
            model[argadr.grp][argadr.rol].pts[isAdrblk ? 'extkey' : 'bankno']
          "
          :placeholder="'请输入' + argadr.title + 'Extkey'"
           @keyup.enter.native="showGridPromptDialog(`${argadr.grp}.${argadr.rol}.pts.${isAdrblk ? 'extkey' : 'bankno'}`)"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="6">
      <el-form-item label="" label-width="15px">
        <c-button
          size="small"
          type="primary;width:10%"
          @click="onSeainf(`${argadr.grp}.${argadr.rol}.pts.${isAdrblk ? 'extkey' : 'bankno'}`)"
          >i</c-button
        >
        <c-button size="small" type="primary" @click="onAplpDet">
          Details
        </c-button>
      </el-form-item>
    </c-col>

    <c-col v-if="isAdrblk" :span="24">
      <el-form-item
        label="名称地址"
        :prop="`${argadr.grp}.${argadr.rol}.pts.adrblk`"
      >
        <c-input
          type="textarea"
          :rows="3"
          v-model="model[argadr.grp][argadr.rol].pts.adrblk"
          maxlength="35"
          show-word-limit
          placeholder="请输入名称地址"
        ></c-input>
      </el-form-item>
    </c-col>
    <template v-else>
      <c-col :span="24">
        <el-form-item
          label="名称"
          :prop="`${argadr.grp}.${argadr.rol}.pts.namelc`"
        >
          <c-input
            v-model="model[argadr.grp][argadr.rol].pts.namelc"
            :placeholder="'请输入' + argadr.title + '名称'"
            :disabled="disabled"
          ></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item
          label="地址"
          :prop="`${argadr.grp}.${argadr.rol}.pts.adrelc`"
        >
          <c-input
            v-model="model[argadr.grp][argadr.rol].pts.adrelc"
            :placeholder="'请输入' + argadr.title + '地址'"
            :disabled="disabled"
          ></c-input>
        </el-form-item>
      </c-col>
    </template>
  </div>
</template>
<script>
import Api from "~/service/Api";
import CommonProcess from "~/mixin/CommonProcess";
// 机构信息模块
export default {
  inject: ["root"],
  mixins: [CommonProcess],

  props: {
    model: {
      type: Object,
      default: undefined,
    },
    argadr: {
      type: Object,
      default: function () {
        return {
          title: "", //角色名称
          rol: "", //角色
          grp: "", //所属模块
        };
      },
    },
    disabled: {
      //名称地址是否灰显
      type: Boolean,
      default: false,
    },

    isAdrblk: {
      //名称地址是否为大字段
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {
      data: [],
    };
  },
  watch: {},
  methods: {
    onSeainf(data) {
      this.$emit("onSeainf", data);
    },

    onAplpDet() {
      this.$emit("onAplpDet");
    },
  },
  created: function () {},
};
</script>
<style>
</style>
