Commit 6a144cc1 by Jaxon

style(performanceScheme): 优化组件样式并提取公共样式文件

- 为参数配置组件添加统一的左侧内边距
- 合并相邻的标签文本以精简结构
- 提取重复的表格和布局样式到公共文件
- 修复条件判断中使用 Number.isNaN 替代 isNaN
- 为切换按钮添加悬停效果和视觉分隔线
- 调整表格列宽和组件宽度以改善布局
1 parent cccf21a7
.params-config-table {
width: 100%;
margin-bottom: 20px !important;
::v-deep .el-table {
.product-cascader-wrapper {
.icon {
line-height: normal;
height: 14px;
vertical-align: middle;
position: absolute;
left: 6px;
top: 50%;
transform: rotate(90deg);
transform: translate(0, -50%);
padding: 0;
cursor: pointer;
}
}
.el-table__header {
th {
background-color: #f2f4f7;
padding: 4px 0 !important;
.cell {
padding: 0 12px 0 12px;
position: relative;
}
}
}
.el-table__row {
.assessment-factor-column {
display: flex;
align-items: center;
justify-content: center;
padding-right: 10px;
.el-input {
min-width: 80px;
}
.el-input-number {
min-width: 80px;
}
.el-input_showing {
min-width: 80px;
}
.tag {
margin: 0 6px;
}
}
td {
padding-top: 10px !important;
padding-bottom: 10px !important;
}
.tag {
margin: 0 2px;
}
}
.el-input {
width: 140px;
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
.el-input-number {
width: 140px;
height: 32px;
line-height: 32px;
}
.el-input_showing {
width: 140px;
height: 32px;
line-height: 30px;
}
}
}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<el-radio label="ParamsType1"> <el-radio label="ParamsType1">
适配通用配置 适配通用配置
</el-radio> </el-radio>
<el-radio label="ParamsType2"> <el-radio v-if="[3, 4].includes(curParamsAssessFactorValue)" label="ParamsType2">
适配渗透率配置 适配渗透率配置
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</template> </template>
<script> <script>
import { last } from "lodash-es"; import { isObject, last } from "lodash-es";
import { mapState } from "vuex"; import { mapState } from "vuex";
import { paramConfigListTemplate } from "../performanceRuleSelection/options.js"; import { paramConfigListTemplate } from "../performanceRuleSelection/options.js";
import ParamsType1 from "./type1.vue"; import ParamsType1 from "./type1.vue";
...@@ -68,6 +68,12 @@ export default { ...@@ -68,6 +68,12 @@ export default {
this.formData.paramConfigList[this.configIndex] = value; this.formData.paramConfigList[this.configIndex] = value;
}, },
}, },
curParamsAssessFactorValue() {
if (isObject(this.curParamsConfig.assessmentFactor)) {
return this.curParamsConfig.assessmentFactor?.value;
}
return this.curParamsConfig.assessmentFactor;
},
}, },
mounted() { mounted() {
......
<template> <template>
<div class="params-config-table"> <div class="params-config-table">
<el-table border <el-table border
class="params-config-table"
:data="curParamsConfig.ParamsType1"> :data="curParamsConfig.ParamsType1">
<!-- <el-table-column align="center" <!-- <el-table-column align="center"
:label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`" :label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`"
width="270px"> --> width="270px"> -->
<el-table-column align="center" <el-table-column align="center"
:label="`考核因子${assessmentFactorSort}:${assessmentFactorTitle}`" :label="`考核因子${assessmentFactorSort}:${assessmentFactorTitle}`"
width="270px"> width="320px">
<template #default="{ $index }"> <template #default="{ $index }">
<div class="assessment-factor-column"> <div class="assessment-factor-column">
<EditableText v-model="curParamsConfig.ParamsType1[$index].priceRange[0]" <EditableText v-model="curParamsConfig.ParamsType1[$index].priceRange[0]"
...@@ -33,12 +32,12 @@ ...@@ -33,12 +32,12 @@
<el-table-column align="center" <el-table-column align="center"
label="提成方式" label="提成方式"
min-width="180" prop="commissionTypes"
prop="commissionTypes"> width="180">
<template #default="{ $index }"> <template #default="{ $index }">
<el-select v-model="curParamsConfig.ParamsType1[$index].commissionTypes" <el-select v-model="curParamsConfig.ParamsType1[$index].commissionTypes"
placeholder="请选择" placeholder="请选择"
style="width:120px" style="width:140px"
@change="handleCommissionTypesChange($index)"> @change="handleCommissionTypesChange($index)">
<el-option v-for="subItem in commissionTypesOptions" <el-option v-for="subItem in commissionTypesOptions"
:key="subItem.value" :key="subItem.value"
...@@ -50,8 +49,8 @@ ...@@ -50,8 +49,8 @@
<el-table-column v-for="(product, index) in curParamsConfig.ParamsType1Products" <el-table-column v-for="(product, index) in curParamsConfig.ParamsType1Products"
:key="index" :key="index"
align="center" align="center"
prop="productLabel" min-width="220px"
width="180px"> prop="productLabel">
<template #header="{ $index }"> <template #header="{ $index }">
<div class="product-cascader-wrapper"> <div class="product-cascader-wrapper">
...@@ -210,7 +209,7 @@ export default { ...@@ -210,7 +209,7 @@ export default {
const endValue = Number(priceRange[1]); const endValue = Number(priceRange[1]);
// 检查值是否有效 // 检查值是否有效
if (isNaN(startValue) || isNaN(endValue) || startValue === null || endValue === null || startValue === undefined || endValue === undefined) { if (Number.isNaN(startValue) || Number.isNaN(endValue) || startValue === null || endValue === null || startValue === undefined || endValue === undefined) {
return; return;
} }
...@@ -262,76 +261,5 @@ export default { ...@@ -262,76 +261,5 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.params-config-table { @import "./common.scss";
width: 100%;
margin-bottom: 20px !important;
::v-deep .el-table {
.product-cascader-wrapper {
.icon {
line-height: normal;
height: 14px;
vertical-align: middle;
position: absolute;
left: 6px;
top: 50%;
transform: rotate(90deg);
transform: translate(0, -50%);
padding: 0;
cursor: pointer;
}
}
.el-table__header {
th {
background-color: #f2f4f7;
padding: 4px 0 !important;
.cell {
padding: 0 12px 0 12px;
position: relative;
}
}
}
.el-table__row {
.assessment-factor-column {
display: flex;
align-items: center;
justify-content: center;
.el-input {
min-width: 80px;
}
.el-input-number {
min-width: 80px;
}
.el-input_showing {
min-width: 80px;
}
}
td {
padding-top: 10px !important;
padding-bottom: 10px !important;
}
.tag {
margin: 0 2px;
}
}
.el-input {
width: 120px;
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
.el-input-number {
width: 120px;
height: 32px;
line-height: 32px;
}
.el-input_showing {
width: 120px;
height: 32px;
line-height: 30px;
}
}
}
</style> </style>
<template> <template>
<div class="params-config-table"> <div class="params-config-table">
<el-table border <el-table border :data="curParamsConfig.ParamsType2">
class="params-config-table"
:data="curParamsConfig.ParamsType2">
<el-table-column align="center" <el-table-column align="center"
:label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`" :label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`"
width="270px"> width="270px">
...@@ -43,11 +41,12 @@ ...@@ -43,11 +41,12 @@
@change="handleProductChange"> @change="handleProductChange">
</el-cascader> </el-cascader>
<span v-if="showGoodsConfigTypesBtn" <div v-if="showGoodsConfigTypesBtn"
class="el-icon-sort icon" class="el-icon-sort icon"
style="line-height:normal;height:14px; vertical-align: middle;" style="line-height:normal;height:14px; vertical-align: middle;"
title="切换商品分类"
@click="handleChangeGoodsConfigTypes($index)"> @click="handleChangeGoodsConfigTypes($index)">
</span> </div>
</div> </div>
</template> </template>
...@@ -57,7 +56,7 @@ ...@@ -57,7 +56,7 @@
<template #header> <template #header>
<el-select v-model="curParamsConfig.ParamsType2CommissionTypes" <el-select v-model="curParamsConfig.ParamsType2CommissionTypes"
placeholder="请选择" placeholder="请选择"
style="width:120px" style="width:140px"
@change="handleCommissionTypesChange"> @change="handleCommissionTypesChange">
<el-option v-for="subItem in commissionTypesOptions" <el-option v-for="subItem in commissionTypesOptions"
:key="subItem.value" :key="subItem.value"
...@@ -71,11 +70,11 @@ ...@@ -71,11 +70,11 @@
<component :is="paramConfigConditionType[curParamsConfig.ParamsType2[$index].condition].component" <component :is="paramConfigConditionType[curParamsConfig.ParamsType2[$index].condition].component"
:config-index="configIndex" :config-index="configIndex"
:row="$index" /> :row="$index" />
<span v-if="curParamsConfig.ParamsType2[$index].condition !== 0" <div v-if="curParamsConfig.ParamsType2[$index].condition !== 0"
class="el-icon-sort icon" class="el-icon-sort icon"
style="line-height:normal;height:14px; vertical-align: middle;" title="切换条件"
@click="handleChangeCondition($index)"> @click="handleChangeCondition($index)">
</span> </div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -192,84 +191,44 @@ export default { ...@@ -192,84 +191,44 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.params-config-table { @import "./common.scss";
width: 100%; .product-category-wrapper {
margin-bottom: 20px !important;
.condition-wrapper {
display: flex; display: flex;
width: 100%;
bottom: 1px solid red;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: center;
} }
.condition-wrapper {
.product-category-wrapper {
display: flex; display: flex;
width: 100%;
align-items: center; align-items: center;
justify-content: center; justify-content: flex-start;
> .icon { }
margin-left: 6px; .product-category-wrapper,
.condition-wrapper {
.icon {
cursor: pointer; cursor: pointer;
line-height: normal;
font-size: 16px;
vertical-align: middle;
transition: color 200ms; transition: color 200ms;
transform: rotate(90deg);
&:hover {
color: #2a58ad;
}
}
}
::v-deep .el-table {
.el-table__header {
th {
background-color: #f2f4f7;
padding: 4px 0 !important;
.cell {
padding: 0 12px 0 12px;
position: relative; position: relative;
} padding-left: 6px;
} margin-left: 6px;
} color: #2a58ad;
.el-table__row { // transform: rotate(90deg);
.assessment-factor-column { &::after {
display: flex; content: "";
align-items: center; width: 1px;
justify-content: center; height: 80%;
.el-input { position: absolute;
min-width: 80px; left: 0;
} top: 50%;
.el-input-number { background-color: rgb(235, 238, 245);
min-width: 80px; transform: translateY(-50%);
}
.el-input_showing {
min-width: 80px;
}
}
td {
padding-top: 10px !important;
padding-bottom: 10px !important;
}
.tag {
margin: 0 2px;
}
}
.el-input {
width: 120px;
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
.el-input-number {
width: 120px;
height: 32px;
line-height: 32px;
} }
.el-input_showing { &:hover {
width: 120px; color: #2a58ad;
height: 32px;
line-height: 30px;
} }
} }
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
<div> <div>
<div style="display:flex;align-items:center;"> <div style="display:flex;align-items:center;">
<span class="label"> <span class="label" style="margin:0 6px">
1. 1.
</span> </span>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
@change="handleProductChange"> @change="handleProductChange">
</el-cascader> </el-cascader>
<span class="label"> <span class="label" style="margin:0 6px">
渗透率在 渗透率在
</span> </span>
<EditableText v-model="permeabilityMin" <EditableText v-model="permeabilityMin"
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
:precision="2" :precision="2"
type="number"> type="number">
</EditableText> </EditableText>
<span class="label"> <span class="label" style="margin:0 6px">
~ ~
</span> </span>
<EditableText v-model="permeabilityMax" <EditableText v-model="permeabilityMax"
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
type="number"> type="number">
</EditableText> </EditableText>
<span class="label"> <span class="label" style="margin:0 6px">
区间时执行 区间时执行
</span> </span>
</div> </div>
<div style="display:flex;align-items:center;"> <div style="display:flex;align-items:center;">
<span>2. </span> <span style="margin:0 6px">2. </span>
<GoodsCategoryCascader v-if="goodsCategory === 0" <GoodsCategoryCascader v-if="goodsCategory === 0"
v-model="productValue1" v-model="productValue1"
@change="handleProductChange" /> @change="handleProductChange" />
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
:show-all-levels="false" :show-all-levels="false"
@change="handleProductChange"> @change="handleProductChange">
</el-cascader> </el-cascader>
<span class="label"> <span class="label" style="margin:0 6px">
渗透率在 渗透率在
</span> </span>
<EditableText v-model="permeabilityMin1" <EditableText v-model="permeabilityMin1"
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
:precision="2" :precision="2"
type="number"> type="number">
</EditableText> </EditableText>
<span class="label"> <span class="label" style="margin:0 6px">
~ ~
</span> </span>
<EditableText v-model="permeabilityMax1" <EditableText v-model="permeabilityMax1"
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
:precision="2" :precision="2"
type="number"> type="number">
</EditableText> </EditableText>
<span class="label"> <span class="label" style="margin:0 6px">
区间时执行 区间时执行
</span> </span>
</div> </div>
...@@ -232,6 +232,7 @@ export default { ...@@ -232,6 +232,7 @@ export default {
display: flex; display: flex;
// flex-wrap: nowrap; // flex-wrap: nowrap;
align-items: center; align-items: center;
padding-left: 6px;
> span.label { > span.label {
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
......
...@@ -99,6 +99,7 @@ export default { ...@@ -99,6 +99,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.param-config-type-2-condition-type { .param-config-type-2-condition-type {
padding-left: 10px;
> span.label { > span.label {
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
......
...@@ -6,10 +6,7 @@ ...@@ -6,10 +6,7 @@
v-bind="getComponentsProp"> v-bind="getComponentsProp">
</EditableText> </EditableText>
<span class="label"> <span class="label">
且 且 整体增加指标达成奖励
</span>
<span class="label">
整体增加指标达成奖励
</span> </span>
<EditableText v-model="increaseReward" <EditableText v-model="increaseReward"
:controls="false" :controls="false"
...@@ -114,6 +111,7 @@ export default { ...@@ -114,6 +111,7 @@ export default {
// display: flex; // display: flex;
// flex-wrap: nowrap; // flex-wrap: nowrap;
// align-items: center; // align-items: center;
padding-left: 10px;
> span.label { > span.label {
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
......
...@@ -6,10 +6,9 @@ ...@@ -6,10 +6,9 @@
v-bind="getComponentsProp"> v-bind="getComponentsProp">
</EditableText> </EditableText>
<span class="label"> <span class="label">
且 且 提出
</span> </span>
<span class="label"> <span class="label">
提出
</span> </span>
<!-- 品类cascader --> <!-- 品类cascader -->
<GoodsCategoryCascader v-if="goodsCategory === 0" <GoodsCategoryCascader v-if="goodsCategory === 0"
...@@ -117,9 +116,10 @@ export default { ...@@ -117,9 +116,10 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.param-config-type-2-condition-type { .param-config-type-2-condition-type {
// overflow-x: auto; // overflow-x: auto;
// display: flex; display: flex;
// flex-wrap: nowrap; flex-wrap: nowrap;
// align-items: center; align-items: center;
padding-left: 10px;
> span.label { > span.label {
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
......
.performance-scheme-wrapper {
.warp-box {
background: #fff;
margin-bottom: 16px;
position: relative;
.title {
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
display: flex;
align-items: center;
margin-bottom: 16px;
.title-wrap {
display: flex;
align-items: center;
}
.merchant-text {
font-size: 14px;
font-weight: normal;
color: #666666;
}
}
.space-b {
justify-content: space-between;
}
::v-deep .el-form-item__label {
padding: 0;
}
.warp-content {
padding: 0 20px 20px;
.params-config-list {
border-bottom: 1px solid #e5e5e5;
margin-top: 18px;
&:first-child {
margin-top: 0;
}
&:last-child {
border-bottom: 0;
}
}
}
}
.btn-box {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
.btn {
box-sizing: border-box;
font-size: 14px;
height: 32px;
padding: 5px 14px;
line-height: 22px;
border-radius: 4px;
line-height: 22px;
}
.check-btn {
border: 1px solid #2a58ad;
background: #2a58ad;
color: #ffffff;
}
.save-btn {
width: 76px;
border: 1px solid #2a58ad;
background: #eff3f6;
color: #2a58ad;
}
.cancel-btn {
color: #666666;
width: 56px;
background: #e8e8e8;
}
}
.form-performance-name {
::v-deep .el-form-item {
margin-bottom: 14px;
.el-input {
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
}
}
}
...@@ -207,94 +207,5 @@ export default { ...@@ -207,94 +207,5 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.performance-scheme-wrapper { @import "./common.scss";
.warp-box {
background: #fff;
margin-bottom: 16px;
position: relative;
.title {
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
display: flex;
align-items: center;
margin-bottom: 16px;
.title-wrap {
display: flex;
align-items: center;
}
.merchant-text {
font-size: 14px;
font-weight: normal;
color: #666666;
}
}
.space-b {
justify-content: space-between;
}
::v-deep .el-form-item__label {
padding: 0;
}
.warp-content {
padding: 0 20px 20px;
.params-config-list {
border-bottom: 1px solid #e5e5e5;
margin-top: 18px;
&:first-child {
margin-top: 0;
}
&:last-child {
border-bottom: 0;
}
}
}
}
.btn-box {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
.btn {
box-sizing: border-box;
font-size: 14px;
height: 32px;
padding: 5px 14px;
line-height: 22px;
border-radius: 4px;
line-height: 22px;
}
.check-btn {
border: 1px solid #2a58ad;
background: #2a58ad;
color: #ffffff;
}
.save-btn {
width: 76px;
border: 1px solid #2a58ad;
background: #eff3f6;
color: #2a58ad;
}
.cancel-btn {
color: #666666;
width: 56px;
background: #e8e8e8;
}
}
.form-performance-name {
::v-deep .el-form-item {
margin-bottom: 14px;
.el-input {
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
}
}
}
</style> </style>
...@@ -276,94 +276,5 @@ export default { ...@@ -276,94 +276,5 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.performance-scheme-wrapper { @import "./common.scss";
.warp-box {
background: #fff;
margin-bottom: 16px;
position: relative;
.title {
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
display: flex;
align-items: center;
margin-bottom: 16px;
.title-wrap {
display: flex;
align-items: center;
}
.merchant-text {
font-size: 14px;
font-weight: normal;
color: #666666;
}
}
.space-b {
justify-content: space-between;
}
::v-deep .el-form-item__label {
padding: 0;
}
.warp-content {
padding: 0 20px 20px;
.params-config-list {
border-bottom: 1px solid #e5e5e5;
margin-top: 18px;
&:first-child {
margin-top: 0;
}
&:last-child {
border-bottom: 0;
}
}
}
}
.btn-box {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
.btn {
box-sizing: border-box;
font-size: 14px;
height: 32px;
padding: 5px 14px;
line-height: 22px;
border-radius: 4px;
line-height: 22px;
}
.check-btn {
border: 1px solid #2a58ad;
background: #2a58ad;
color: #ffffff;
}
.save-btn {
width: 76px;
border: 1px solid #2a58ad;
background: #eff3f6;
color: #2a58ad;
}
.cancel-btn {
color: #666666;
width: 56px;
background: #e8e8e8;
}
}
.form-performance-name {
::v-deep .el-form-item {
margin-bottom: 14px;
.el-input {
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
}
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!