| | |
| | | "jquery": "^3.5.1", |
| | | "less-loader": "^6.2.0", |
| | | "moment": "^2.27.0", |
| | | "ol": "^6.9.0", |
| | | "pug": "^3.0.0", |
| | | "pug-plain-loader": "^1.0.0", |
| | | "qs": "^6.9.4", |
| | |
| | | data() { |
| | | return { |
| | | buttonAuthority: sessionStorage.getItem('buttonAuthoritys') || [], |
| | | defaultBgUrl:"/images/desktop/background.png" |
| | | // defaultBgUrl:"/images/desktop/background.png" |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | ) |
| | | } |
| | | return false |
| | | }, |
| | | defaultBgUrl(){ |
| | | return JSON.parse(sessionStorage.getItem('userInfo')).backgroundpic |
| | | } |
| | | }, |
| | | mounted() { |
| | | // document.getElementById('app').style.backgroundImage = process.env.VUE_APP_MAIN_URL; |
| | | const url = localStorage.getItem("backgroundPic") |
| | | document.getElementById('app').style.backgroundImage = `url(${url||this.defaultBgUrl})` |
| | | document.getElementById('app').style.backgroundImage = `url(${this.defaultBgUrl})` |
| | | this.showApps(); |
| | | let _that = this; |
| | | let msgResp = require("./mock/messages.json") |
| | |
| | | }, |
| | | onChangeBg(v){ |
| | | document.getElementById('app').style.backgroundImage = "url(" + v + ")" |
| | | this.defaultBgUrl = v |
| | | localStorage.setItem("backgroundPic", v) |
| | | }, |
| | | showApps() { |
| | | let _that = this; |
| | |
| | | <script>
|
| | | import { saveAlarmConfig, getDevInfo } from "@/api/system";
|
| | | import { uploadSound, getSoundList, deleteSound } from "@/api/event";
|
| | |
|
| | | import {
|
| | | updateUser,
|
| | | } from "@/api/user";
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | |
| | | { url: "/images/settings/系统设置.png" },
|
| | | ],
|
| | | tableBGList: [
|
| | | { name: "background", url: "/images/settings/background.png" },
|
| | | { name: "message", url: "/images/settings/数据推送.png" },
|
| | | { name: "weather", url: "/images/settings/系统设置.png" },
|
| | | { name: "background", url: "/images/desktop/background.png" },
|
| | | { name: "message", url: "/images/desktop/message.png" },
|
| | | { name: "weather", url: "/images/desktop/weather.png" },
|
| | | ],
|
| | | universalColor:'',
|
| | | colorList: [
|
| | |
| | | _this.curPlayingIndex = null;
|
| | | }
|
| | | });
|
| | | const url = localStorage.getItem("backgroundPic");
|
| | | const url = this.curUser.backgroundpic;
|
| | | if (url) {
|
| | | const arr = url.split("/");
|
| | | // const arr = url.split("/");
|
| | | this.activeBg = this.tableBGList.findIndex((x) => {
|
| | | return x.url.includes(arr[arr.length - 1]);
|
| | | return x.url == url;
|
| | | });
|
| | | } else {
|
| | | this.activeBg = 0;
|
| | |
| | | max_video_len() {
|
| | | return Math.round(this.fakeObj.max * 1.2);
|
| | | },
|
| | | curUser() {
|
| | | const info = JSON.parse(sessionStorage.getItem("userInfo"));
|
| | | return info;
|
| | | },
|
| | | },
|
| | | methods: {
|
| | | formatTooltip(v) {
|
| | |
| | | pickBg(item, i) {
|
| | | this.activeBg = i;
|
| | | let message = "changeBackground?" + item.name;
|
| | | window.parent.postMessage(
|
| | | {
|
| | | msg: message,
|
| | | },
|
| | | "*"
|
| | | );
|
| | | window.parent.postMessage( {msg: message, }, "*" );
|
| | | updateUser({
|
| | | id: this.curUser.id,
|
| | | backgroundpic: item.url,
|
| | | }).then((res) => {
|
| | | if (res.success) {
|
| | | sessionStorage.setItem("userInfo", JSON.stringify(res.data))
|
| | | this.$message.success(res.msg);
|
| | | }
|
| | | });
|
| | | this.$forceUpdate()
|
| | | },
|
| | | togglePlay(item, i) {
|