<template>
  <div>
    <el-form-item label="是否多选">
      <el-switch v-model="optionModel.multipleChoices"
                 v-if="selectedWidget.type !== 'singerSearch' && selectedWidget.type !== 'multiSearch'"></el-switch>
      <span v-else>{{ optionModel.multipleChoices ? '是' : '否' }}</span>
    </el-form-item>
    <el-form-item label="关联字段" v-if="optionModel.multipleChoices">
      <el-input type="text" v-model="optionModel.valueField"></el-input>
    </el-form-item>
    <el-form-item label="展示字段">
      <el-input type="text" v-model="optionModel.vabSearchName"></el-input>
    </el-form-item>
    <template v-if="!optionModel.multipleChoices">
      <el-form-item label="默认当前用户">
        <el-switch v-model="optionModel.userDefaultVabSearch"
                   @change="optionModel.saleOrgDefaultVabSearch=false"></el-switch>
      </el-form-item>
      <el-form-item label="默认当前机构">
        <el-switch v-model="optionModel.saleOrgDefaultVabSearch"
                   @change="optionModel.userDefaultVabSearch=false"></el-switch>
      </el-form-item>
    </template>
  </div>
</template>

<script>
import i18n from "../../../../../../components/xform/utils/i18n"
import propertyMixin from "../../../../../../components/xform/form-designer/setting-panel/property-editor/propertyMixin"

export default {
  name: "vabSearchName-editor",
  mixins: [i18n, propertyMixin],
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
  },
}
</script>

<style scoped>

</style>
