WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2021-04-21 9276cfcae04d9dd01541210491c04544aa4f06f5
修复数值阀的问题
2 files modified
25 ■■■■■ changed files
forms/numberValve/CNumberValve.vue 23 ●●●●● patch | view | raw | blame | history
forms/numberValve/cNumberValve.scss 2 ●●● patch | view | raw | blame | history
forms/numberValve/CNumberValve.vue
@@ -21,12 +21,6 @@
                <view class="at-icon at-icon-chevron-right"></view>
            </AtInput>
        </view>
        <AtRange
            :min="range[0]"
            :max="range[1]"
            :value="[0, itemRes.formData[itemRes.name]]"
            :onChange="evt => evt && itemRes.onChange(evt[1])"
        />
        <AtFloatLayout
            :isOpened="opened"
            :onClose="evt => handleClose()"
@@ -74,7 +68,7 @@
<script>
import Taro from '@tarojs/taro';
import { $ } from '@tarojs/extend';
import { AtInput, AtFloatLayout, AtButton, AtRange } from 'taro-ui-vue';
import { AtInput, AtFloatLayout, AtButton } from 'taro-ui-vue';
import './cNumberValve.scss';
export default {
@@ -83,7 +77,6 @@
        AtInput,
        AtFloatLayout,
        AtButton,
        AtRange,
    },
    props: {
        // 表单数据资源(表单组件内部机制专用)
@@ -158,12 +151,26 @@
            this.updateRect();
            let currentNext = 0;
            if (type === 'left') {
                const gap = this.current % this.step;
                if (gap === 0) {
                currentNext = this.current - this.step;
                } else {
                    currentNext = this.current - gap;
                }
            } else if (type === 'right') {
                const gap = this.current % this.step;
                if (gap === 0) {
                currentNext = this.current + this.step;
                } else {
                    currentNext = this.current + (this.step - gap);
                }
            } else if (type === 'change') {
                currentNext = value;
            }
            // 范围限制
            currentNext = Math.max(currentNext, this.range[0]);
            currentNext = Math.min(currentNext, this.range[1]);
            // 设置
            const sliderLeft = Math.round(
                ((currentNext - this.range[0]) / (this.range[1] - this.range[0])) * 100
            );
forms/numberValve/cNumberValve.scss
@@ -113,7 +113,7 @@
                .current {
                    @include position(absolute, n 0 0 n, 1);
                    height: 46PX;
                    border-left: #eee 1PX solid;
                    border-left: #e2e2e2 1PX solid;
                    .text {
                        @include position(absolute, -24PX 0 n n);
                        transform: translateX(-50%);