zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<template>
  <TableList
    ref="imageTablelist"
    :condtionConfig="condtionConfig"
    :columnConfig="columnConfig"
    :formItemsConfig="formItemsConfig"
    :defValuesConfig="defValuesConfig"
    :formRulesConfig="formRulesConfig"
    :condformdefConfig="condformdefConfig"
    :operateBtns="operateBtns"
    rowKeyName="dirno"
    :isParentOperate="true"
    @handleClickRowBtn="handleClickRowBtn"
    @operateHandleClick="operateHandleClick"
    listApiName="qryBusinessImageConfigList"
  />
</template>
 
<script>
import { mapState, mapGetters, mapActions } from "vuex";
import TableList from "../../components/TableList.vue";
import {
  IMAGEDATACONFIGCOND,
  IMAGEDATACONFIGDEF
} from "../config/condtion.config";
import { IMAGEDATACONFIGCOLUMN } from "../config/column.config";
import { IMAGEDATACONFIGDEFVALUE } from "../config/defValues.config";
import { IMAGEDATACONFIGRULES } from "../config/rules.config";
import { IMAGEDATACONFIGFORM } from "../config/formItem.config";
import { delBusinessImageCatalog } from "../../../http/api";
export default {
  props: {},
  data() {
    return {
      condtionConfig: [...IMAGEDATACONFIGCOND],
      columnConfig: [...IMAGEDATACONFIGCOLUMN],
      formItemsConfig: [...IMAGEDATACONFIGFORM],
      defValuesConfig: { ...IMAGEDATACONFIGDEFVALUE },
      formRulesConfig: { ...IMAGEDATACONFIGRULES },
      condformdefConfig: { ...IMAGEDATACONFIGDEF },
      optionsArr: ["IsInUse", "ProductCode", "ImageType", "flowModelList"],
      operateBtns: [
        { label: "详情", type: "DETAIL", value: true },
        { label: "修改", type: "EDIT", value: true },
        { label: "删除", type: "DELETE", value: true }
      ]
    };
  },
  computed: {
    // 获取state值
    ...mapState("rlc", {
      optionsMap: state => state.OPTIONSMAP
    }),
    // 通过getters获取值
    ...mapGetters("rlc", ["getOptionsMap"])
  },
  async created() {
    this.getOptionsData(this.optionsArr);
    this.getUserInfo();
  },
  mounted() {},
  watch: {},
  methods: {
    ...mapActions("rlc", [
      // 将 `this.setOptionsMap()` 映射为 `this.$store.dispatch('setOptionsMap')`
      "getOptionsData",
      "getUserInfo"
    ]),
    operateHandleClick() {
      this.$router.push({ name: "addImageDataConfig" });
    },
    async handleClickRowBtn(type, item) {
      if (type === "EDIT") {
        this.$router.push({
          name: "editImageDataConfig",
          query: { from: "edit", dirno: item.dirno }
        });
      }
      if (type === "DETAIL") {
        this.$router.push({
          name: "imageDataConfigDetail",
          query: { from: "edit", dirno: item.dirno }
        });
      }
      if (type === "DELETE") {
        const params = {
          dirno: item.dirno
        };
        const delRes = await delBusinessImageCatalog(params);
        if (delRes && delRes.code === "00") {
          this.$message.success("删除成功");
          this.$refs.imageTablelist.getTableList();
        }
      }
    }
  },
  components: { TableList }
};
</script>
 
<style lang="less" scoped></style>