yangfeng
2023-12-11 14101bd42ce17dfb9d951d0738abe9d303fb3fe5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import cookies from "./util.cookies";
import db from "./util.db";
import log from "./util.log";
 
const util = {
  cookies,
  db,
  log,
};
 
/**
 * @description 更新标题
 * @param {String} title 标题
 */
util.title = function (titleText) {
  // const processTitle = process.env.VUE_APP_TITLE || "Basic生产排程系统";
  const processTitle = "智慧工厂";
  window.document.title = `${processTitle}${
    titleText ? ` | ${titleText}` : ""
  }`;
};
 
/**
 * @description 打开新页面
 * @param {String} url 地址
 */
util.open = function (url) {
  var a = document.createElement("a");
  a.setAttribute("href", url);
  a.setAttribute("target", "_blank");
  a.setAttribute("id", "d2admin-link-temp");
  document.body.appendChild(a);
  a.click();
  document.body.removeChild(document.getElementById("d2admin-link-temp"));
};
 
export default util;