|
|
@@ -195,6 +195,8 @@ export default {
|
|
|
c_department: "",
|
|
|
},
|
|
|
},
|
|
|
+ // 搜索微功能服务的防抖定时器
|
|
|
+ searchTimeout: null,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -204,44 +206,50 @@ export default {
|
|
|
methods: {
|
|
|
// 搜索微功能服务
|
|
|
searchServerList() {
|
|
|
- let requestParams = {
|
|
|
- columnId: 1651,
|
|
|
- states: 0,
|
|
|
- pageSize: 999,
|
|
|
- page: 0,
|
|
|
- };
|
|
|
- if (this.searchStr) {
|
|
|
- requestParams.search = JSON.stringify([
|
|
|
- {
|
|
|
- field: "title",
|
|
|
- searchType: 2,
|
|
|
- content: { value: "%" + this.searchStr + "%" },
|
|
|
- },
|
|
|
- ]);
|
|
|
+ // 添加防抖功能,避免频繁搜索导致性能问题
|
|
|
+ if (this.searchTimeout != null) {
|
|
|
+ clearTimeout(this.searchTimeout);
|
|
|
}
|
|
|
- // 获取微功能服务列表
|
|
|
- wgn
|
|
|
- .getDmsData(requestParams)
|
|
|
- .then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.dmsServerList = res.content.data;
|
|
|
- this.$message({
|
|
|
- message: "搜索到" + this.dmsServerList.length + "条微功能服务",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- } else {
|
|
|
+ this.searchTimeout = setTimeout(() => {
|
|
|
+ let requestParams = {
|
|
|
+ columnId: 1651,
|
|
|
+ states: 0,
|
|
|
+ pageSize: 999,
|
|
|
+ page: 0,
|
|
|
+ };
|
|
|
+ if (this.searchStr) {
|
|
|
+ requestParams.search = JSON.stringify([
|
|
|
+ {
|
|
|
+ field: "title",
|
|
|
+ searchType: 2,
|
|
|
+ content: { value: "%" + this.searchStr + "%" },
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ // 获取微功能服务列表
|
|
|
+ wgn
|
|
|
+ .getDmsData(requestParams)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.dmsServerList = res.content.data;
|
|
|
+ this.$message({
|
|
|
+ message: "搜索到" + this.dmsServerList.length + "条微功能服务",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "搜索到0条微功能服务",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
this.$message({
|
|
|
- message: "搜索到0条微功能服务",
|
|
|
- type: "warning",
|
|
|
+ message: "搜索微功能服务失败" + e,
|
|
|
+ type: "error",
|
|
|
});
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- this.$message({
|
|
|
- message: "搜索微功能服务失败" + e,
|
|
|
- type: "error",
|
|
|
});
|
|
|
- });
|
|
|
+ }, 0);
|
|
|
},
|
|
|
// 申请使用微功能服务
|
|
|
handleApply(item) {
|
|
|
@@ -306,15 +314,16 @@ export default {
|
|
|
routerPath = {
|
|
|
path: item.c_url,
|
|
|
};
|
|
|
+ this.$router.push(routerPath);
|
|
|
} else {
|
|
|
routerPath = {
|
|
|
path: "/wgnSingle", // 微功能
|
|
|
query: { sceneId: item.c_scene_name },
|
|
|
};
|
|
|
+ const routeData = this.$router.resolve(routerPath);
|
|
|
+ // 2. 打开新窗口(_blank 表示新窗口)
|
|
|
+ window.open(routeData.href, "_blank");
|
|
|
}
|
|
|
- const routeData = this.$router.resolve(routerPath);
|
|
|
- // 2. 打开新窗口(_blank 表示新窗口)
|
|
|
- window.open(routeData.href, "_blank");
|
|
|
},
|
|
|
},
|
|
|
};
|