Commit c3514209 by 李伟康

style(form): 更新表单样式以支持查看模式下的必填字段标记

- 为非查看模式下的标签添加 required 样式类
- 在查看模式下禁用表单项的验证属性
- 添加 CSS 样式规则以显示必填字段的星号标记
1 parent 0d750076
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="first-box flex"> <div class="first-box flex">
<template v-for="(item, index) in fourFormObj"> <template v-for="(item, index) in fourFormObj">
<div class="item first-form-item" :key="index"> <div class="item first-form-item" :key="index">
<div class="label">{{ item.name }}:</div> <div :class="['label',{required:!isViewMode}]">{{ item.name }}:</div>
<template v-if="isViewMode">{{ getSelectText(item, componentData.pointsConfig) }}</template> <template v-if="isViewMode">{{ getSelectText(item, componentData.pointsConfig) }}</template>
<el-select :size="size" v-model="componentData.pointsConfig[item.key]" class="step-select" <el-select :size="size" v-model="componentData.pointsConfig[item.key]" class="step-select"
:disabled="disabled" v-else> :disabled="disabled" v-else>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<div class="form-box"> <div class="form-box">
<template v-for="(item, index) in fourFormTwoObj"> <template v-for="(item, index) in fourFormTwoObj">
<el-form-item :label="item.name + ':'" :key="index" :prop="item.key"> <el-form-item :label="item.name + ':'" :key="index" :prop="isViewMode ? '' : (item.inputKey || item.key)">
<template v-if="item.type == 'addHtml'"> <template v-if="item.type == 'addHtml'">
{{ formateData(componentData.productCategoryRules[productCategoryIndex][item.key]) }} {{ formateData(componentData.productCategoryRules[productCategoryIndex][item.key]) }}
</template> </template>
...@@ -362,6 +362,9 @@ export default { ...@@ -362,6 +362,9 @@ export default {
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
}
.required{
&::before { &::before {
content: '*'; content: '*';
color: #F56C6C; color: #F56C6C;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<SplitPayment :disabled="disabled || isViewMode" :list="componentData.divisionRuleAutos" /> <SplitPayment :disabled="disabled || isViewMode" :list="componentData.divisionRuleAutos" />
<div class="item"> <div class="item">
<div class="label">流量方分账方:</div> <div :class="['label',{required:!isViewMode}]">流量方分账方:</div>
<template v-if="componentData.autoDivideConfig"> <template v-if="componentData.autoDivideConfig">
<template v-if="shelfType == 1"> <template v-if="shelfType == 1">
<template v-if="isViewMode"> <template v-if="isViewMode">
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<div class="form-box"> <div class="form-box">
<template v-for="(item, index) in threeFormObj"> <template v-for="(item, index) in threeFormObj">
<el-form-item :label="item.name + ':'" :key="index" :prop="item.inputKey || item.key"> <el-form-item :label="item.name + ':'" :key="index" :prop="isViewMode ? '' : (item.inputKey || item.key)">
<template v-if="item.type == 'addHtml'"> <template v-if="item.type == 'addHtml'">
<template v-if="item.htmlName == 'RemoteSelect'"> <template v-if="item.htmlName == 'RemoteSelect'">
<div class="remote-select"> <div class="remote-select">
...@@ -467,6 +467,9 @@ export default { ...@@ -467,6 +467,9 @@ export default {
color: #333333; color: #333333;
}
.required {
&::before { &::before {
content: '*'; content: '*';
color: #F56C6C; color: #F56C6C;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!