Showing
1 changed file
with
9 additions
and
6 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-14 14:44:30 | 2 | * @Date: 2022-09-14 14:44:30 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-07-25 15:33:38 | 4 | + * @LastEditTime: 2024-07-31 14:36:50 |
| 5 | * @FilePath: /data-table/src/components/NumberField/index.vue | 5 | * @FilePath: /data-table/src/components/NumberField/index.vue |
| 6 | * @Description: 数字输入框 | 6 | * @Description: 数字输入框 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | <div v-if="HideShow" class="number-page"> | 9 | <div v-if="HideShow" class="number-page"> |
| 10 | <div class="label"> | 10 | <div class="label"> |
| 11 | - <span v-if="item.component_props.required"> *</span> | 11 | + <span v-if="item.component_props.required" style="color: red"> *</span> |
| 12 | - {{ item.component_props.label }} | 12 | + <span :class="[ReadonlyShow ? 'readonly-show' : '']">{{ item.component_props.label }}</span> |
| 13 | </div> | 13 | </div> |
| 14 | <div | 14 | <div |
| 15 | v-if="item.component_props.note" | 15 | v-if="item.component_props.note" |
| ... | @@ -53,6 +53,8 @@ | ... | @@ -53,6 +53,8 @@ |
| 53 | <script setup> | 53 | <script setup> |
| 54 | import $ from "jquery"; | 54 | import $ from "jquery"; |
| 55 | import { storeToRefs, mainStore } from "@/utils/generatePackage"; | 55 | import { storeToRefs, mainStore } from "@/utils/generatePackage"; |
| 56 | +import { useRoute } from "vue-router"; | ||
| 57 | +const $route = useRoute(); | ||
| 56 | 58 | ||
| 57 | const props = defineProps({ | 59 | const props = defineProps({ |
| 58 | item: Object, | 60 | item: Object, |
| ... | @@ -61,6 +63,10 @@ const props = defineProps({ | ... | @@ -61,6 +63,10 @@ const props = defineProps({ |
| 61 | const HideShow = computed(() => { | 63 | const HideShow = computed(() => { |
| 62 | return !props.item.component_props.disabled | 64 | return !props.item.component_props.disabled |
| 63 | }) | 65 | }) |
| 66 | +// 只读显示-流程模式 | ||
| 67 | +const ReadonlyShow = computed(() => { | ||
| 68 | + return $route.query.page_type === 'flow' && !props.item.component_props.readonly; | ||
| 69 | +}); | ||
| 64 | let content = ""; | 70 | let content = ""; |
| 65 | 71 | ||
| 66 | onMounted(() => { | 72 | onMounted(() => { |
| ... | @@ -183,9 +189,6 @@ const onDelete = () => {}; | ... | @@ -183,9 +189,6 @@ const onDelete = () => {}; |
| 183 | padding: 1rem 1rem 0 1rem; | 189 | padding: 1rem 1rem 0 1rem; |
| 184 | font-size: 0.9rem; | 190 | font-size: 0.9rem; |
| 185 | font-weight: bold; | 191 | font-weight: bold; |
| 186 | - span { | ||
| 187 | - color: red; | ||
| 188 | - } | ||
| 189 | } | 192 | } |
| 190 | } | 193 | } |
| 191 | 194 | ... | ... |
-
Please register or login to post a comment