1
yangbin
2025-02-11 94bc4dbd93169255a13c3c5ae0a03f767e22fbc6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
  <a-progress
    :class="clazz"
    :percent="innerValue"
    size="small"
    v-bind="cellProps"
  />
</template>
 
<script>
  import JVxeCellMixins from '@/components/jeecg/JVxeTable/mixins/JVxeCellMixins'
 
  // JVxe 进度条组件
  export default {
    name: 'JVxeProgressCell',
    mixins: [JVxeCellMixins],
    data() {
      return {}
    },
    computed: {
      clazz() {
        return {
          'j-vxe-progress': true,
          'no-animation': this.scrolling
        }
      },
      scrolling() {
        return !!this.renderOptions.scrolling
      },
    },
    methods: {},
    // 【组件增强】注释详见:JVxeCellMixins.js
    enhanced: {
      switches: {
        editRender: false,
      },
      setValue(value) {
        try {
          if (typeof value !== 'number') {
            return Number.parseFloat(value)
          } else {
            return value
          }
        } catch {
          return 0
        }
      },
    }
  }
</script>
 
<style scoped lang="less">
  // 关闭进度条的动画,防止滚动时动态赋值出现问题
  .j-vxe-progress.no-animation {
    /deep/ .ant-progress-success-bg,
    /deep/ .ant-progress-bg {
      transition: none !important;
    }
  }
</style>