| | |
| | | <el-input v-model="formData.name" placeholder="请输入分组名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="排序" prop="sort"> |
| | | <el-input v-model="formData.sort" placeholder="请输入排序" /> |
| | | <el-input-number v-model="formData.sort" :min="0" clearable controls-position="right" /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | |
| | | const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
| | | const formData = ref({ |
| | | id: undefined, |
| | | menuId: '', |
| | | name: '', |
| | | sort: undefined |
| | | }) |
| | |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (type: string, id?: number) => { |
| | | const open = async (type: string, id?: string, menuId?: string) => { |
| | | dialogVisible.value = true |
| | | dialogTitle.value = t('action.' + type) |
| | | formType.value = type |
| | | resetForm() |
| | | if (menuId) { |
| | | formData.value.menuId = menuId |
| | | } |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |