Commit 81d95a2433832161fda30231d578e368c4d82066
1 parent
f82bee8b
修改栏目type取值规则
Showing
3 changed files
with
16 additions
and
8 deletions
docs/develop/discuss.md
src/views/column/config.ts
| 1 | import type { EnumArrayItem } from "@/@type/module/basic" | 1 | import type { EnumArrayItem } from "@/@type/module/basic" |
| 2 | 2 | ||
| 3 | +interface EnumArrayItemWithMatch extends EnumArrayItem { | ||
| 4 | + match: boolean | ||
| 5 | +} | ||
| 6 | + | ||
| 3 | /** | 7 | /** |
| 4 | * 栏目类型 | 8 | * 栏目类型 |
| 5 | */ | 9 | */ |
| 6 | -export const types: EnumArrayItem[] = [ | 10 | +export const types: EnumArrayItemWithMatch[] = [ |
| 7 | { | 11 | { |
| 8 | label: '权威资讯', | 12 | label: '权威资讯', |
| 9 | - value: '1' | 13 | + value: '1', |
| 14 | + match: false | ||
| 10 | }, { | 15 | }, { |
| 11 | label: '公益活动', | 16 | label: '公益活动', |
| 12 | - value: '2' | 17 | + value: '2', |
| 18 | + match: true | ||
| 13 | }, { | 19 | }, { |
| 14 | label: '服务', | 20 | label: '服务', |
| 15 | - value: '3' | 21 | + value: '3', |
| 22 | + match: false | ||
| 16 | } | 23 | } |
| 17 | ] | 24 | ] |
| 18 | \ No newline at end of file | 25 | \ No newline at end of file |
src/views/column/edit.vue
| @@ -121,19 +121,20 @@ onMounted(() => { | @@ -121,19 +121,20 @@ onMounted(() => { | ||
| 121 | maxlength="15" | 121 | maxlength="15" |
| 122 | /> | 122 | /> |
| 123 | </el-form-item> | 123 | </el-form-item> |
| 124 | - <!-- 仅一级栏目有type选择 --> | 124 | + <!-- 一级栏目type可以选权威咨询和服务 |
| 125 | + 二级栏目type可以选公益活动 --> | ||
| 125 | <el-form-item | 126 | <el-form-item |
| 126 | label="栏目类型" | 127 | label="栏目类型" |
| 127 | prop="type" | 128 | prop="type" |
| 128 | style="width: 50%" | 129 | style="width: 50%" |
| 129 | - v-show="!form.data.parentColumnId" | ||
| 130 | - > | 130 | + > |
| 131 | <el-select v-model="form.data.type" placeholder="请选择栏目类型"> | 131 | <el-select v-model="form.data.type" placeholder="请选择栏目类型"> |
| 132 | <el-option | 132 | <el-option |
| 133 | v-for="(item, index) in types" | 133 | v-for="(item, index) in types" |
| 134 | :key="index" | 134 | :key="index" |
| 135 | :label="item.label" | 135 | :label="item.label" |
| 136 | :value="item.value" | 136 | :value="item.value" |
| 137 | + :disabled="!(!!form.data.parentColumnId === item.match)" | ||
| 137 | ></el-option> | 138 | ></el-option> |
| 138 | </el-select> | 139 | </el-select> |
| 139 | </el-form-item> | 140 | </el-form-item> |