<template>
    <FormItem
        :tip="
      t(
        '临时传阅人是指由上一节点审批人指定下一节点传阅人过程中，是否允许在传阅人基础上添加组织架构人员。',
      )
    "
        :label="t('临时传阅人：')"
    >
        <a-switch :checked="provisionalDistributor" @change="changeProvisionalDistributor" />
    </FormItem>
    <FormItem :label="t('传阅人最多：')">
        <a-input-number
            v-model:value="maxCirculate"
            :min="0"
            :max="100"
            @change="changeMaxCirculate"
        />
    </FormItem>
    <FormItem :label="t('传阅人最少：')">
        <a-input-number
            v-model:value="minCirculate"
            :min="0"
            :max="100"
            @change="changeMinCirculate"
        />
    </FormItem>
</template>

<script setup lang="ts" name="ProcessBasic">
  import FormItem from '/@bpmn/layout/FormItem.vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  const { t } = useI18n();
  const emits = defineEmits([
    'update:provisionalDistributor',
    'update:maxCirculate',
    'update:minCirculate'
  ]);
  const props = defineProps({
    isChooseMulti: {
      type: Boolean,
      default: true,
    },
    isChooseAll: {
      type: Boolean,
      default: false,
    },
    provisionalDistributor: {
      type: Boolean || undefined,
      default: undefined,
    },
    maxCirculate: {
        type: Number,
        default: 0,
    },
    minCirculate: {
        type: Number,
        default: 0,
    },
  });

  // 临时传阅人
  function changeProvisionalDistributor(val: Boolean) {
    emits('update:provisionalDistributor', val);
  }
  //最多传阅人
  function changeMaxCirculate(val: number) {
      emits('update:maxCirculate', val);
  }
  //最少传阅人
  function changeMinCirculate(val: number) {
      emits('update:minCirculate', val);
  }
</script>

<style lang="less" scoped></style>
