| | |
| | | <div class="val">{{ formData.areaName || '-' }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">部署模式</div> |
| | | <div class="val">{{ deploymentModeLabel(formData.deploymentMode) }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">排序</div> |
| | | <div class="val">{{ formData.sort }}</div> |
| | | </el-col> |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="部署模式" prop="deploymentMode"> |
| | | <el-radio-group v-model="formData.deploymentMode" class="command-radio-group"> |
| | | <el-radio :label="0">统一部署</el-radio> |
| | | <el-radio :label="1">独立部署</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input class="command-input" v-model="formData.remark" type="textarea" :rows="3" placeholder="请输入" clearable /> |
| | |
| | | deptNature: null, |
| | | areaCode: [], |
| | | areaName: '', |
| | | deploymentMode: 0, |
| | | sort: 0, |
| | | remark: '', |
| | | }) |
| | |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) |
| | | const formData = ref(initForm()) |
| | | const visible = ref(false) |
| | | const visible = defineModel() |
| | | const dialogMode = ref('add') |
| | | const submitting = ref(false) |
| | | const isAddChild = ref(false) |
| | |
| | | deptCategory: fieldRules(true), |
| | | deptNature: fieldRules(true), |
| | | areaCode: fieldRules(true), |
| | | deploymentMode: fieldRules(true), |
| | | sort: fieldRules(true), |
| | | } |
| | | |
| | | function deploymentModeLabel(value) { |
| | | if (value === 1) return '独立部署' |
| | | if (value === 0) return '统一部署' |
| | | return value ?? '-' |
| | | } |
| | | |
| | | function normalizeAreaCode(value) { |
| | |
| | | }) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | | emit('success') |
| | | emit('success', { parentId: formData.value.parentId || null, mode: dialogMode.value, isAddChild: isAddChild.value }) |
| | | } finally { |
| | | submitting.value = false |
| | | } |
| | |
| | | |
| | | async function open({ mode, row, parent } = {}) { |
| | | dialogMode.value = mode || 'add' |
| | | visible.value = true |
| | | isAddChild.value = mode === 'add' && !!parent?.id |
| | | await getDeptTree().then(res => { |
| | | if (deptTree) { |