<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>
|