Commit b6c3fb5e authored by “yiyousong”'s avatar “yiyousong”

perf: 优化应用黑名单产品列表获取

parent bbec0661
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<a-space> <a-space>
<a-select <a-select
style="min-width: 120px" style="min-width: 120px"
v-model="siteDevTable.searchForm.type" v-model="siteDevTable.searchForm.productName"
showSearch showSearch
optionFilterProp="label" optionFilterProp="label"
> >
...@@ -65,12 +65,12 @@ ...@@ -65,12 +65,12 @@
>全部类型 >全部类型
</a-select-option> </a-select-option>
<a-select-option <a-select-option
v-for="(v, i) in devType" v-for="(v, i) in productList"
:key="i" :key="i"
:value="v" :value="v.productName"
:label="v" :label="v.productName"
> >
{{ v }} {{ v.productName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
<a-input-search <a-input-search
...@@ -136,32 +136,15 @@ import { ...@@ -136,32 +136,15 @@ import {
getBlackAppList, getBlackAppList,
deleteBlackapp, deleteBlackapp,
} from "@/services/market"; } from "@/services/market";
import {getProductList} from "@/services/surface";
import local from "@/utils/local"; import local from "@/utils/local";
import DevToBlack from "../modal/DevToBlack.vue"; import DevToBlack from "../modal/DevToBlack.vue";
import YTable from "@/components/YTable.vue"; import YTable from "@/components/YTable.vue";
const devType = [
"排队机",
"窗口屏",
"呼叫器",
"集中显示屏",
"评价器",
"信息发布屏",
"导视机",
"自助服务终端",
"填单机",
"一码通",
"LED通屏",
"取件柜",
"背靠背评价设备",
"存取件",
"桌面式自助服务终端",
];
export default { export default {
components: { DevToBlack, YTable }, components: { DevToBlack, YTable },
data() { data() {
return { return {
devType,
blackAppTable: { blackAppTable: {
page: 1, page: 1,
size: 10, size: 10,
...@@ -206,7 +189,7 @@ export default { ...@@ -206,7 +189,7 @@ export default {
data: [], data: [],
searchForm: { searchForm: {
deviceCode: "", deviceCode: "",
type: "", productName: "",
}, },
columns: [ columns: [
{ {
...@@ -247,13 +230,27 @@ export default { ...@@ -247,13 +230,27 @@ export default {
selectedRows: [], selectedRows: [],
visible: false, visible: false,
siteId: local.getLocal("siteId"), // 站点id siteId: local.getLocal("siteId"), // 站点id
productList: [], // 产品列表
}; };
}, },
created() { created() {
this.getProductList();
this.getBlackAppList(); this.getBlackAppList();
this.getDeviceList(); this.getDeviceList();
}, },
methods: { methods: {
// 获取产品列表
async getProductList() {
let res = await getProductList({
siteId: this.siteId,
page:1,
size:-1
});
if (res.data.code === 1) {
let { data } = res.data.data;
this.productList = data
}
},
// 获取设备黑名单 // 获取设备黑名单
async getBlackAppList() { async getBlackAppList() {
this.blackAppTable.loading = true; this.blackAppTable.loading = true;
...@@ -282,7 +279,7 @@ export default { ...@@ -282,7 +279,7 @@ export default {
size: this.siteDevTable.size, size: this.siteDevTable.size,
siteId: this.siteId, siteId: this.siteId,
deviceCode: `%${this.siteDevTable.searchForm.deviceCode}%`, deviceCode: `%${this.siteDevTable.searchForm.deviceCode}%`,
productName: `%${this.siteDevTable.searchForm.type}%`, productName: `%${this.siteDevTable.searchForm.productName}%`,
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
let { data, total } = res.data.data; let { data, total } = res.data.data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment