zhou zhou
10 小时以前 50e95b985a72fcec4a93a2470e9efdfb2620148a
rsf-design/src/views/system/dept/modules/dept-dialog.vue
@@ -21,8 +21,8 @@
    <template #footer>
      <span class="dialog-footer">
        <ElButton @click="handleCancel">取消</ElButton>
        <ElButton type="primary" @click="handleSubmit">确定</ElButton>
        <ElButton @click="handleCancel">{{ t('common.cancel') }}</ElButton>
        <ElButton type="primary" @click="handleSubmit">{{ t('common.confirm') }}</ElButton>
      </span>
    </template>
  </ElDialog>
@@ -30,6 +30,7 @@
<script setup>
  import ArtForm from '@/components/core/forms/art-form/index.vue'
  import { useI18n } from 'vue-i18n'
  import { buildDeptDialogModel, createDeptFormState } from '../deptPage.helpers'
  const props = defineProps({
@@ -39,19 +40,22 @@
  })
  const emit = defineEmits(['update:visible', 'submit'])
  const { t } = useI18n()
  const formRef = ref()
  const form = reactive(createDeptFormState())
  const isEdit = computed(() => Boolean(form.id))
  const dialogTitle = computed(() => (isEdit.value ? '编辑部门' : '新增部门'))
  const dialogTitle = computed(() =>
    isEdit.value ? t('pages.system.dept.dialog.titleEdit') : t('pages.system.dept.dialog.titleCreate')
  )
  const rules = computed(() => ({
    name: [{ required: true, message: '请输入部门名称', trigger: 'blur' }]
    name: [{ required: true, message: t('pages.system.dept.validation.name'), trigger: 'blur' }]
  }))
  const formItems = computed(() => [
    {
      label: '上级部门',
      label: t('pages.system.dept.table.parent'),
      key: 'parentId',
      type: 'treeselect',
      span: 24,
@@ -62,41 +66,41 @@
          value: 'value',
          children: 'children'
        },
        placeholder: '请选择上级部门',
        placeholder: t('pages.system.dept.placeholders.parentId'),
        clearable: false,
        checkStrictly: true,
        defaultExpandAll: true
      }
    },
    {
      label: '部门名称',
      label: t('pages.system.dept.table.name'),
      key: 'name',
      type: 'input',
      props: {
        placeholder: '请输入部门名称',
        placeholder: t('pages.system.dept.placeholders.name'),
        clearable: true
      }
    },
    {
      label: '部门全称',
      label: t('pages.system.dept.table.fullName'),
      key: 'fullName',
      type: 'input',
      props: {
        placeholder: '请输入部门全称',
        placeholder: t('pages.system.dept.placeholders.fullName'),
        clearable: true
      }
    },
    {
      label: '负责人',
      label: t('pages.system.dept.table.leader'),
      key: 'leader',
      type: 'input',
      props: {
        placeholder: '请输入负责人',
        placeholder: t('pages.system.dept.placeholders.leader'),
        clearable: true
      }
    },
    {
      label: '排序',
      label: t('table.sort'),
      key: 'sort',
      type: 'number',
      props: {
@@ -106,26 +110,26 @@
      }
    },
    {
      label: '状态',
      label: t('table.status'),
      key: 'status',
      type: 'select',
      props: {
        placeholder: '请选择状态',
        placeholder: t('pages.system.dept.placeholders.status'),
        options: [
          { label: '正常', value: 1 },
          { label: '禁用', value: 0 }
          { label: t('common.status.normal'), value: 1 },
          { label: t('common.status.disabled'), value: 0 }
        ]
      }
    },
    {
      label: '备注',
      label: t('table.memo'),
      key: 'memo',
      type: 'input',
      span: 24,
      props: {
        type: 'textarea',
        rows: 3,
        placeholder: '请输入备注',
        placeholder: t('pages.system.dept.placeholders.memo'),
        clearable: true
      }
    }