Commit 2b8a5b00 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 243ec0a8 5781f259
...@@ -16,10 +16,16 @@ ...@@ -16,10 +16,16 @@
@click="handleSync(siteData[0].id)" @click="handleSync(siteData[0].id)"
>同步数据</a-button >同步数据</a-button
> >
<a-button type="primary" @click="editSiteInfo(siteData[0])" <a-button
type="primary"
v-permission="[1]"
@click="editSiteInfo(siteData[0])"
>编辑</a-button >编辑</a-button
> >
<a-button type="danger" @click="deleteSite(siteData[0].id, 0)" <a-button
type="danger"
v-permission="[1]"
@click="deleteSite(siteData[0].id, 0)"
>删除</a-button >删除</a-button
> >
</a-space> </a-space>
......
...@@ -19,8 +19,6 @@ Vue.use(GlobalComponents); ...@@ -19,8 +19,6 @@ Vue.use(GlobalComponents);
import common from "./utils/commin"; import common from "./utils/commin";
Vue.use(common); Vue.use(common);
import VScaleScreen from "v-scale-screen";
Vue.use(VScaleScreen);
// 公共样式 // 公共样式
import "@/assets/css/normalize.css"; import "@/assets/css/normalize.css";
import "@/assets/css/reset.css"; import "@/assets/css/reset.css";
......
...@@ -45,7 +45,11 @@ ...@@ -45,7 +45,11 @@
v-for="(v, i) in collectList" v-for="(v, i) in collectList"
:key="'' + v.id + i" :key="'' + v.id + i"
> >
<div class="item-logo cursor-pointer" @click="openWindow(v)"> <div
class="item-logo cursor-pointer"
@click="openWindow($event, v, 'click')"
@contextmenu="openWindow($event, v)"
>
<img <img
class="w-full h-full object-contain" class="w-full h-full object-contain"
:src="api + v.modelIcon" :src="api + v.modelIcon"
...@@ -91,7 +95,11 @@ ...@@ -91,7 +95,11 @@
v-for="item in v.list" v-for="item in v.list"
:key="item.id" :key="item.id"
> >
<div class="item-logo cursor-pointer" @click="openWindow(item)"> <div
class="item-logo cursor-pointer"
@click="openWindow($event, item, 'click')"
@contextmenu="openWindow($event, item)"
>
<img <img
class="w-full h-full object-contain" class="w-full h-full object-contain"
:src="api + item.modelIcon" :src="api + item.modelIcon"
...@@ -157,7 +165,7 @@ export default { ...@@ -157,7 +165,7 @@ export default {
this.siteModelList = data; this.siteModelList = data;
} }
}, },
openWindow(row) { async openWindow(event, row, type) {
let siteid = Storage.get(2, "siteId") || 0; let siteid = Storage.get(2, "siteId") || 0;
let siteName = Storage.get(2, "siteName") || ""; let siteName = Storage.get(2, "siteName") || "";
let userInfo = JSON.stringify({ let userInfo = JSON.stringify({
...@@ -166,13 +174,48 @@ export default { ...@@ -166,13 +174,48 @@ export default {
}); });
let { modelUrl, modelName, modelIcon } = row; let { modelUrl, modelName, modelIcon } = row;
let path = this.$route.path; let path = this.$route.path;
modelName = encodeURI(modelName); let compileModelName = encodeURI(modelName);
window.open( let params = `?token=${this.token}&siteid=${siteid}&siteName=${encodeURI(
`${modelUrl}?token=${this.token}&siteid=${siteid}&siteName=${encodeURI(
siteName siteName
)}&userInfo=${userInfo}&sysName=${modelName}&sysLogo=${modelIcon}&path=${path}`, )}&userInfo=${userInfo}&sysName=${compileModelName}&sysLogo=${modelIcon}&path=${path}`;
"_blank" if (type === "click") {
); window.open(`${modelUrl}${params}`, "_blank");
return;
}
if (this.userData.admin || this.userData.id == 1) {
event.preventDefault();
// let redirectUrl = "";
// let hash = "";
// let redirect = await this.getFinalRedirect(modelUrl);
// if (!modelUrl.includes("http")) {
// let index = modelUrl.indexOf("/");
// hash = modelUrl.slice(index + 1);
// }
// if (redirect) {
// redirectUrl = redirect + hash;
// } else {
// redirectUrl = modelUrl;
// }
this.$notification.open({
message: "跳转链接",
key: 1,
duration: null,
description: (
<div>
<div class="notif-name">{modelName}-完整链接:</div>
<div>{modelUrl + params}</div>
<div class="notif-name">链接参数:</div>
<div>{params}</div>
</div>
),
style: {
"word-break": "break-all",
},
icon: <a-icon type="smile" style="color: #108ee9" />,
});
}
}, },
handleJoin() { handleJoin() {
...@@ -230,15 +273,36 @@ export default { ...@@ -230,15 +273,36 @@ export default {
} }
return false; return false;
}, },
// 获取重定向地址
// getFinalRedirect(url) {
// return fetch(url, { method: "GET", redirect: "follow" })
// .then((response) => {
// if (!response.ok) {
// throw new Error("Network response was not ok");
// }
// return response.url;
// })
// .catch((error) => {
// console.error("Error:", error);
// return null;
// });
// },
}, },
}; };
</script> </script>
<style>
.notif-name {
font-size: 14px;
font-weight: 600;
}
</style>
<style lang="less" scoped> <style lang="less" scoped>
.station { .station {
background: url("@/assets/images/siteArrange/bg_2.png") no-repeat; background: url("@/assets/images/siteArrange/bg_2.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
overflow: hidden; overflow: hidden;
.del-box { .del-box {
width: 100%; width: 100%;
height: 150px; height: 150px;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
v-model="userform.searchVal" v-model="userform.searchVal"
style="width: 250px" style="width: 250px"
placeholder="请输入关键字搜索" placeholder="请输入关键字搜索"
@pressEnter="handleSearch"
> >
<a-icon slot="prefix" type="search" /> <a-icon slot="prefix" type="search" />
</a-input> </a-input>
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
>{{ v }}</a-select-option >{{ v }}</a-select-option
> >
</a-select> </a-select>
<a-button type="primary" class="addclass" @click="getUserList" <a-button type="primary" class="addclass" @click="handleSearch"
>搜索</a-button >搜索</a-button
> >
<a-button @click="resetList">重置</a-button> <a-button @click="resetList">重置</a-button>
...@@ -202,6 +203,12 @@ export default { ...@@ -202,6 +203,12 @@ export default {
this.getUserList(); this.getUserList();
}, },
// 搜索
handleSearch() {
this.tablePagination.current = 1;
this.getUserList();
},
// 获取用户列表 // 获取用户列表
async getUserList() { async getUserList() {
this.tableLoading = true; this.tableLoading = true;
......
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