9436e3af368516ee87a32d4f5765b1ec063b24f5.svn-base 1.2 KB

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