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 @@
<el-radio label="ParamsType1">
适配通用配置
</el-radio>
<el-radio label="ParamsType2">
<el-radio v-if="[3, 4].includes(curParamsAssessFactorValue)" label="ParamsType2">
适配渗透率配置
</el-radio>
</el-radio-group>
......@@ -35,7 +35,7 @@
</template>
<script>
import { last } from "lodash-es";
import { isObject, last } from "lodash-es";
import { mapState } from "vuex";
import { paramConfigListTemplate } from "../performanceRuleSelection/options.js";
import ParamsType1 from "./type1.vue";
......@@ -68,6 +68,12 @@ export default {
this.formData.paramConfigList[this.configIndex] = value;
},
},
curParamsAssessFactorValue() {
if (isObject(this.curParamsConfig.assessmentFactor)) {
return this.curParamsConfig.assessmentFactor?.value;
}
return this.curParamsConfig.assessmentFactor;
},
},
mounted() {
......
<template>
<template>
<div class="params-config-table">
<el-table border
class="params-config-table"
:data="curParamsConfig.ParamsType1">
<!-- <el-table-column align="center"
:label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`"
width="270px"> -->
<el-table-column align="center"
:label="`考核因子${assessmentFactorSort}:${assessmentFactorTitle}`"
width="270px">
width="320px">
<template #default="{ $index }">
<div class="assessment-factor-column">
<EditableText v-model="curParamsConfig.ParamsType1[$index].priceRange[0]"
......@@ -33,12 +32,12 @@
<el-table-column align="center"
label="提成方式"
min-width="180"
prop="commissionTypes">
prop="commissionTypes"
width="180">
<template #default="{ $index }">
<el-select v-model="curParamsConfig.ParamsType1[$index].commissionTypes"
placeholder="请选择"
style="width:120px"
style="width:140px"
@change="handleCommissionTypesChange($index)">
<el-option v-for="subItem in commissionTypesOptions"
:key="subItem.value"
......@@ -50,8 +49,8 @@
<el-table-column v-for="(product, index) in curParamsConfig.ParamsType1Products"
:key="index"
align="center"
prop="productLabel"
width="180px">
min-width="220px"
prop="productLabel">
<template #header="{ $index }">
<div class="product-cascader-wrapper">
......@@ -210,7 +209,7 @@ export default {
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;
}
......@@ -262,76 +261,5 @@ export default {
</script>
<style scoped lang="scss">
.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;
.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;
}
}
}
@import "./common.scss";
</style>
<template>
<div class="params-config-table">
<el-table border
class="params-config-table"
:data="curParamsConfig.ParamsType2">
<el-table border :data="curParamsConfig.ParamsType2">
<el-table-column align="center"
:label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`"
width="270px">
......@@ -43,11 +41,12 @@
@change="handleProductChange">
</el-cascader>
<span v-if="showGoodsConfigTypesBtn"
class="el-icon-sort icon"
style="line-height:normal;height:14px; vertical-align: middle;"
@click="handleChangeGoodsConfigTypes($index)">
</span>
<div v-if="showGoodsConfigTypesBtn"
class="el-icon-sort icon"
style="line-height:normal;height:14px; vertical-align: middle;"
title="切换商品分类"
@click="handleChangeGoodsConfigTypes($index)">
</div>
</div>
</template>
......@@ -57,7 +56,7 @@
<template #header>
<el-select v-model="curParamsConfig.ParamsType2CommissionTypes"
placeholder="请选择"
style="width:120px"
style="width:140px"
@change="handleCommissionTypesChange">
<el-option v-for="subItem in commissionTypesOptions"
:key="subItem.value"
......@@ -71,11 +70,11 @@
<component :is="paramConfigConditionType[curParamsConfig.ParamsType2[$index].condition].component"
:config-index="configIndex"
:row="$index" />
<span v-if="curParamsConfig.ParamsType2[$index].condition !== 0"
class="el-icon-sort icon"
style="line-height:normal;height:14px; vertical-align: middle;"
@click="handleChangeCondition($index)">
</span>
<div v-if="curParamsConfig.ParamsType2[$index].condition !== 0"
class="el-icon-sort icon"
title="切换条件"
@click="handleChangeCondition($index)">
</div>
</div>
</template>
</el-table-column>
......@@ -192,84 +191,44 @@ export default {
</script>
<style scoped lang="scss">
.params-config-table {
@import "./common.scss";
.product-category-wrapper {
display: flex;
align-items: center;
justify-content: center;
}
.condition-wrapper {
display: flex;
width: 100%;
margin-bottom: 20px !important;
.condition-wrapper {
display: flex;
width: 100%;
bottom: 1px solid red;
align-items: center;
justify-content: flex-start;
}
.product-category-wrapper {
display: flex;
align-items: center;
justify-content: center;
> .icon {
margin-left: 6px;
cursor: pointer;
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;
}
}
}
.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;
align-items: center;
justify-content: flex-start;
}
.product-category-wrapper,
.condition-wrapper {
.icon {
cursor: pointer;
line-height: normal;
font-size: 16px;
vertical-align: middle;
transition: color 200ms;
position: relative;
padding-left: 6px;
margin-left: 6px;
color: #2a58ad;
// transform: rotate(90deg);
&::after {
content: "";
width: 1px;
height: 80%;
position: absolute;
left: 0;
top: 50%;
background-color: rgb(235, 238, 245);
transform: translateY(-50%);
}
.el-input_showing {
width: 120px;
height: 32px;
line-height: 30px;
&:hover {
color: #2a58ad;
}
}
}
......
......@@ -13,7 +13,7 @@
</div>
<div>
<div style="display:flex;align-items:center;">
<span class="label">
<span class="label" style="margin:0 6px">
1.
</span>
......@@ -31,7 +31,7 @@
@change="handleProductChange">
</el-cascader>
<span class="label">
<span class="label" style="margin:0 6px">
渗透率在
</span>
<EditableText v-model="permeabilityMin"
......@@ -41,7 +41,7 @@
:precision="2"
type="number">
</EditableText>
<span class="label">
<span class="label" style="margin:0 6px">
~
</span>
<EditableText v-model="permeabilityMax"
......@@ -52,12 +52,12 @@
type="number">
</EditableText>
<span class="label">
<span class="label" style="margin:0 6px">
区间时执行
</span>
</div>
<div style="display:flex;align-items:center;">
<span>2. </span>
<span style="margin:0 6px">2. </span>
<GoodsCategoryCascader v-if="goodsCategory === 0"
v-model="productValue1"
@change="handleProductChange" />
......@@ -69,7 +69,7 @@
:show-all-levels="false"
@change="handleProductChange">
</el-cascader>
<span class="label">
<span class="label" style="margin:0 6px">
渗透率在
</span>
<EditableText v-model="permeabilityMin1"
......@@ -79,7 +79,7 @@
:precision="2"
type="number">
</EditableText>
<span class="label">
<span class="label" style="margin:0 6px">
~
</span>
<EditableText v-model="permeabilityMax1"
......@@ -89,7 +89,7 @@
:precision="2"
type="number">
</EditableText>
<span class="label">
<span class="label" style="margin:0 6px">
区间时执行
</span>
</div>
......@@ -232,6 +232,7 @@ export default {
display: flex;
// flex-wrap: nowrap;
align-items: center;
padding-left: 6px;
> span.label {
color: #666666;
font-size: 14px;
......
......@@ -99,6 +99,7 @@ export default {
<style scoped lang="scss">
.param-config-type-2-condition-type {
padding-left: 10px;
> span.label {
color: #666666;
font-size: 14px;
......
......@@ -6,10 +6,7 @@
v-bind="getComponentsProp">
</EditableText>
<span class="label">
且
</span>
<span class="label">
整体增加指标达成奖励
且 整体增加指标达成奖励
</span>
<EditableText v-model="increaseReward"
:controls="false"
......@@ -114,6 +111,7 @@ export default {
// display: flex;
// flex-wrap: nowrap;
// align-items: center;
padding-left: 10px;
> span.label {
color: #666666;
font-size: 14px;
......
......@@ -6,10 +6,9 @@
v-bind="getComponentsProp">
</EditableText>
<span class="label">
且
且 提出
</span>
<span class="label">
提出
</span>
<!-- 品类cascader -->
<GoodsCategoryCascader v-if="goodsCategory === 0"
......@@ -117,9 +116,10 @@ export default {
<style scoped lang="scss">
.param-config-type-2-condition-type {
// overflow-x: auto;
// display: flex;
// flex-wrap: nowrap;
// align-items: center;
display: flex;
flex-wrap: nowrap;
align-items: center;
padding-left: 10px;
> span.label {
color: #666666;
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 {
</script>
<style scoped lang="scss">
.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;
}
}
}
}
}
@import "./common.scss";
</style>
......@@ -276,94 +276,5 @@ export default {
</script>
<style scoped lang="scss">
.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;
}
}
}
}
}
@import "./common.scss";
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!