peng
2026-03-25 67d3b57765b0ba66ae25a9da84a16e44a4ef2937
src/views/dataAnalysis/components/CustTypeConfig.vue
@@ -46,6 +46,9 @@
<script>
import CustTypeModal from './CustTypeModal'
import { JeecgListMixin } from '@tievd/cube-block/lib/mixins/JeecgListMixin'
import { UI_CACHE_DB_DICT_DATA } from '@tievd/cube-block/lib/store/mutation-types'
import { deleteAction, getAction } from '@tievd/cube-block/lib/api/manage'
import Vue from 'vue'
export default {
  name: 'ActivityList',
@@ -123,6 +126,35 @@
  },
  methods: {
    modalFormOk() {
      this.loadData()
      this.refreshDictCache()
    },
    refreshDictCache() {
      getAction('/sys/dict/queryAllDictItems').then((res) => {
        if (res.success) {
          Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
          Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
        }
      })
    },
    handleDelete(id) {
      // 删除前清除前端字典缓存
      // 删除后刷新页面以更新字典缓存
      deleteAction(this.url.delete, { id: id })
        .then((res) => {
          if (res.success) {
            this.$message.success(res.message)
            this.loadData()
            this.refreshDictCache()
          } else {
            this.$message.warning(res.message)
          }
        })
        .finally(() => {
          this.loading = false
        })
    },
    transformConfigText(obj) {
      var text = ''
      if (obj.timeStr == '1,YEARS') {