<template>
  <div>
    <el-dialog title="模型预警"  @close="closed" width="1400px" :model-value="props.modelValue">
      <el-form :model="listQuery" label-width="100px">
        <el-form-item prop="mxlx" label="模型类型">
          <el-select v-model="listQuery.mxlx">
            <el-option
              v-for="(dict, index) in gzyList"
              :key="index"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="模型名称" prop="mxmc">
          <el-input
            v-model="listQuery.mxmc"
            placeholder="请输入模型名称"
            clearable
          />
        </el-form-item>
        <el-form-item label="感知源" prop="gzy">
          <el-input v-model="listQuery.gzy" readonly clearable />
        </el-form-item>
        <el-form-item prop="yjsc" label="预警时长">
          <div class="itemText">
            <el-select v-model="listQuery.yjsc">
              <el-option
                v-for="(dict, index) in arrList"
                :key="index"
                :label="dict.label"
                :value="dict.value"
              ></el-option>
            </el-select>
            <el-input v-model="listQuery.sc" readonly clearable />
            <div class="text">分钟</div>
          </div>
        </el-form-item>
        <el-form-item prop="yjry" label="预警人员">
          <div class="itemText">
            <el-select v-model="listQuery.yjry">
              <el-option
                v-for="(dict, index) in arrList"
                :key="index"
                :label="dict.label"
                :value="dict.value"
              ></el-option>
            </el-select>
            <el-input v-model="listQuery.rysc" readonly clearable />
            <div class="text">人</div>
          </div>
        </el-form-item>
        <el-form-item prop="rylb" label="人员类别">
          <el-select v-model="listQuery.rylb">
            <el-option
              v-for="(dict, index) in D_BZ_RYBQ"
              :key="index"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closed">取消</el-button>
          <el-button type="primary" @click="onComfirm">确认</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import { ref, getCurrentInstance, defineProps,defineEmits } from "vue";
const props = defineProps({
  type: String,
  modelValue:Boolean
});
const emits = defineEmits(["update:modelValue"]);
const { proxy } = getCurrentInstance();
const { D_BZ_RYBQ } = proxy.$dict("D_BZ_RYBQ");
const listQuery = ref({
  gzy: "所有",
  mxlx: "01",
  sc: 0,
  rysc:0
});
const gzyList = ref([
  { label: "感知源模型", value: "01" },
  { label: "位置模型", value: "02" },
  { label: "关注对象模型", value: "03" }
]);
const arrList = ref([
  { label: "小于", value: "01" },
  { label: "大于", value: "02" },
  { label: "等于", value: "03" },
  { label: "小于等于", value: "04" },
  { label: "大于等于", value: "05" }
]);
const modelValue = ref(false);

const closed = () => {
  emits("update:modelValue", false);
};
</script>

<style lang="scss" scoped>
.itemText {
  display: flex;
  width: 100%;
  .text{
      width: 60px;
  }
}
</style>