w-vue-middle
Version:
统一公共服务组件
84 lines (82 loc) • 2.46 kB
JavaScript
/*
* @Author: Jason Liu
* @Date: 2023-11-29 13:37:07
* @Desc:
*/
/**
* @Author: Jason Liu
* @description: 数据集成服务
*/
const { getVariableList } = require("w-vue-middle/api/dataIntegration");
export default {
props: {
},
watch: {
},
data() {
return {
name: undefined,
loading: false,
dataList: [],
pager: {
pageNum: 1,
pageSize: 10000,
queryParams: {
F_isDel_eq: 0,
F_isEnable_eq: 0,
F_variableLevel_eq: "0",
F_name_like: undefined,
},
},
tableKey: 0,
}
},
created() {
this.getDataList();
},
methods: {
/**
* @Author: Jason Liu
* @description: 数据查询
*/
filterMethod({ option, row }) {
return row.variableCode.toLocaleLowerCase().indexOf(option.data) > -1 || (row.variableDesc && row.variableDesc.toLocaleLowerCase().indexOf(option.data) > -1);
},
/**
* @Author: Jason Liu
* @description: 查询函数
*/
searchProblem(e) {
if (e) {
const xTable = this.$refs.dataList;
const column = xTable.getColumnByField("variableCode");
// 修改第二个选项为勾选状态
const option = column.filters[0];
option.data = e.toLocaleLowerCase();
option.checked = true;
// 修改条件之后,需要手动调用 updateData 处理表格数据
xTable.updateData();
} else {
this.tableKey++;
}
},
/**
* @Author: Jason Liu
* @description: 获取集成变量信息
*/
getDataList() {
this.loading = true;
getVariableList(this.pager).then(req => {
this.dataList = req.data.map(item => {
return {
...item,
code: `'${"${" + item.variableCode + "}"}'`
}
});
this.$emit("loaded", this.dataList);
}).finally(() => {
this.loading = false;
});
},
},
}