Skip to content

Commit 337e47c

Browse files
committed
fix:amis
1 parent 212ab09 commit 337e47c

3 files changed

Lines changed: 34 additions & 28 deletions

File tree

src/components/Amis/render.vue

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44

55
<script>
66
import store from "@/store";
7-
import { Message } from 'element-ui'
7+
import { Message } from "element-ui";
88
import { mapGetters } from "vuex";
99
10-
// const _ = require("lodash");
10+
// const _ = require("lodash");
1111
/**
1212
* @description amis配置参数
1313
*/
1414
// https://baidu.gitee.io/amis/zh-CN/docs/start/getting-started#props
1515
// eslint-disable
16-
import { alert, confirm, render as renderSchema, toast } from 'amis'
17-
import ReactDOM from 'react-dom'
16+
import { alert, confirm, render as renderSchema, toast } from "amis";
17+
import ReactDOM from "react-dom";
1818
1919
// import element from 'element-ui/lib/theme-chalk/index.css'
20-
import qs from 'qs'
21-
import axios from 'axios'
20+
import qs from "qs";
21+
import axios from "axios";
2222
import copy from "copy-to-clipboard";
2323
export default {
2424
name: "AmisRender",
@@ -52,18 +52,18 @@ export default {
5252
...mapGetters(["token", "departmentToken"]),
5353
},
5454
mounted() {
55-
this.initEnv()
56-
ReactDOM.render(
57-
renderSchema(
58-
this.schema,
59-
{
60-
onAction: this.onAction || this.handleAction,
61-
theme: this.theme
62-
},
63-
this.env
64-
),
65-
this.$refs.renderBox
66-
)
55+
this.initEnv();
56+
ReactDOM.render(
57+
renderSchema(
58+
this.schema,
59+
{
60+
onAction: this.onAction || this.handleAction,
61+
theme: this.theme,
62+
},
63+
this.env
64+
),
65+
this.$refs.renderBox
66+
);
6767
// ReactDOM.render(
6868
// renderAmis(
6969
// this.schema,
@@ -89,7 +89,7 @@ export default {
8989
// console.log('link',link);
9090
let search = "";
9191
const idx = link.indexOf("?");
92-
if (idx !=-1) {
92+
if (idx != -1) {
9393
pathname = link.substring(0, idx);
9494
search = link.substring(idx);
9595
}
@@ -125,7 +125,7 @@ export default {
125125
_.merge(config.headers, {
126126
platform: "amis",
127127
departmentToken: this.departmentToken,
128-
sessionToken: this.token,
128+
sessionToken: localStorage.getItem("sessionToken")|| '',
129129
author: "xxb",
130130
email: "258650676@qq.com",
131131
});
@@ -227,13 +227,13 @@ export default {
227227
const { path } = this.$route;
228228
// 解决设计界面弹出提示问题
229229
console.log(path.indexOf("design"), path);
230-
if (!path.indexOf('design')) {
231-
Message({
232-
type: type,
233-
message: msg,
234-
duration: 2000,
235-
showClose: true,
236-
});
230+
if (!path.indexOf("design")) {
231+
Message({
232+
type: type,
233+
message: msg,
234+
duration: 2000,
235+
showClose: true,
236+
});
237237
}
238238
},
239239
confirm,

src/views/CloudOc/AmisPage/component/TopoDevice.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ export default {
421421
setTimeout(() => {
422422
console.log("第二次重绘");
423423
this.devicelayer.batchDraw();
424+
}, 1000);
425+
setTimeout(() => {
426+
console.log("第三次重绘");
427+
this.devicelayer.batchDraw();
424428
}, 1000);
425429
this.vueComponents = list;
426430
this.vueFlag = true;

src/views/dashboard/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ export default {
256256
async mounted() {
257257
console.log('localStorage.getItem("isPC")', localStorage.getItem("isPC"));
258258
this.isPC = localStorage.getItem("isPC") == "true" ? true : false;
259-
// console.log("console.log(this.isPC);", this.isPC);
260259
localStorage.setItem("dgiottopbar", "[]");
261260
this.$store.dispatch("settings/changeSetting", {
262261
key: "treeFlag",
@@ -278,6 +277,7 @@ export default {
278277
return false;
279278
} else {
280279
let dashboardList = [],
280+
amisScreenList = [],
281281
flag = true;
282282
results.forEach((item) => {
283283
if (item.type == "Dashboard" && flag) {
@@ -289,6 +289,8 @@ export default {
289289
this.dashboardId = item.objectId;
290290
} else if (item.type == "Dashboard") {
291291
dashboardList.push(item);
292+
} else if (item.flag == "Amis") {
293+
amisScreenList.push(item);
292294
}
293295
});
294296
this.dashboardList = dashboardList;

0 commit comments

Comments
 (0)