cloud-web-corejs 1.0.54-dev.770 → 1.0.54-dev.771
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -2
- package/src/components/luckysheet/view.vue +3 -25
- package/src/index.js +359 -204
- package/src/permission.js +18 -74
- package/src/store/modules/permission.js +31 -33
- package/src/store/modules/settings.js +2 -0
- package/src/store/modules/tagsView.js +2 -1
- package/src/store/modules/user.js +11 -17
- package/src/utils/pddLog.js +4 -18
- package/src/views/user/login/indexMixin.js +71 -163
- package/src/bootstrap/business.js +0 -31
- package/src/bootstrap/businessFeatures.js +0 -108
- package/src/utils/externalAssets.js +0 -62
- package/src/utils/loginVab.js +0 -68
- package/src/utils/prefixGlobals.js +0 -11
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import Vue from "vue";
|
|
2
|
-
import Cookies from "js-cookie";
|
|
3
|
-
import Element from "element-ui";
|
|
4
|
-
|
|
5
|
-
import BaseKeepAlive from "@base/utils/keepAlive.js";
|
|
6
|
-
import VXETable from "vxe-table";
|
|
7
|
-
import "vxe-table/lib/style.css";
|
|
8
|
-
import "@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js";
|
|
9
|
-
import "@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css";
|
|
10
|
-
import "@base/components/table/index.js";
|
|
11
|
-
import Vab from "@base/utils/vab";
|
|
12
|
-
import drag from "@base/directive/el-drag-dialog/index.js";
|
|
13
|
-
import elDialogCenter from "@base/directive/el-dialog-center/index.js";
|
|
14
|
-
import ErroreBox from "@base/components/errorMsg/index.js";
|
|
15
|
-
import ExcelExport from "@base/components/excelExport/index.js";
|
|
16
|
-
import ExcelImport from "@base/components/excelImport/index.js";
|
|
17
|
-
import ConfirmDialog from "@base/components/confirmDialog/index.js";
|
|
18
|
-
import baseAlert from "@base/components/baseAlert/index.js";
|
|
19
|
-
import FormDialog from "@base/components/formDialog/index.js";
|
|
20
|
-
import permission from "@base/directive/permission";
|
|
21
|
-
import VabUpload from "@base/components/VabUpload/index.js";
|
|
22
|
-
import baseAttachment from "@base/components/baseAttachment/install";
|
|
23
|
-
import vxeFilter from "@base/components/table/vxeFilter/index.js";
|
|
24
|
-
import baseTableExport from "@base/components/excelExport/button.vue";
|
|
25
|
-
import LimitNumber from "@base/directive/LimitNumber/index.js";
|
|
26
|
-
import baseInputNumber from "@base/components/baseInputNumber/index.vue";
|
|
27
|
-
import elReadonly from "@base/directive/el-readonly/index.js";
|
|
28
|
-
import oplogTable from "@base/components/oplogTable/index.vue";
|
|
29
|
-
import baseInputBatch from "@base/components/baseInputBatch/index.vue";
|
|
30
|
-
import baseArea from "@base/components/baseArea/index.vue";
|
|
31
|
-
import baseTabs from "@base/components/baseTabs/index.vue";
|
|
32
|
-
import baseTabPane from "@base/components/baseTabs/baseTabPane.vue";
|
|
33
|
-
import vbTabs from "@base/components/vb-tabs/index.vue";
|
|
34
|
-
import vbTabPane from "@base/components/vb-tabs/tab-pane.vue";
|
|
35
|
-
import xTabs from "@base/components/vb-tabs/x-tabs.vue";
|
|
36
|
-
import baseTextarea from "@base/components/base-textarea/index.vue";
|
|
37
|
-
import jsonImport from "@base/components/jsonImport/index.js";
|
|
38
|
-
import langImport from "@base/components/langImport/index.js";
|
|
39
|
-
import * as filters from "@base/filters";
|
|
40
|
-
import {
|
|
41
|
-
getPublicAssetUrl,
|
|
42
|
-
loadStyle,
|
|
43
|
-
} from "@base/utils/externalAssets";
|
|
44
|
-
|
|
45
|
-
Vue.component("BaseKeepAlive", BaseKeepAlive);
|
|
46
|
-
Vue.use(Element, { size: Cookies.get("size") || "medium" });
|
|
47
|
-
Vue.use(Vab);
|
|
48
|
-
Vue.use(VXETable);
|
|
49
|
-
Vue.use(drag.install);
|
|
50
|
-
Vue.use(elDialogCenter.install);
|
|
51
|
-
Vue.use(ErroreBox);
|
|
52
|
-
Vue.use(ExcelExport);
|
|
53
|
-
Vue.use(ExcelImport);
|
|
54
|
-
Vue.use(ConfirmDialog);
|
|
55
|
-
Vue.use(baseAlert);
|
|
56
|
-
Vue.use(FormDialog);
|
|
57
|
-
Vue.use(permission);
|
|
58
|
-
Vue.use(VabUpload);
|
|
59
|
-
Vue.use(baseAttachment);
|
|
60
|
-
Vue.use(vxeFilter);
|
|
61
|
-
Vue.use(LimitNumber);
|
|
62
|
-
Vue.use(elReadonly);
|
|
63
|
-
Vue.use(jsonImport);
|
|
64
|
-
Vue.use(langImport);
|
|
65
|
-
|
|
66
|
-
Vue.component("baseUpload", () =>
|
|
67
|
-
import("@base/components/VabUpload/view.vue")
|
|
68
|
-
);
|
|
69
|
-
Vue.component("attachmentShowList", () =>
|
|
70
|
-
import("@base/components/baseAttachment/showList")
|
|
71
|
-
);
|
|
72
|
-
Vue.component(baseTableExport.name, baseTableExport);
|
|
73
|
-
Vue.component(baseInputNumber.name, baseInputNumber);
|
|
74
|
-
Vue.component(oplogTable.name, oplogTable);
|
|
75
|
-
Vue.component(baseInputBatch.name, baseInputBatch);
|
|
76
|
-
Vue.component(baseArea.name, baseArea);
|
|
77
|
-
Vue.component("baseInputExport", () =>
|
|
78
|
-
import("@base/components/baseInputExport/index.vue")
|
|
79
|
-
);
|
|
80
|
-
Vue.component("advancedSearchDialog", () =>
|
|
81
|
-
import("@base/components/advancedSearchDialog/index.vue")
|
|
82
|
-
);
|
|
83
|
-
Vue.component(baseTabs.name, baseTabs);
|
|
84
|
-
Vue.component(baseTabPane.name, baseTabPane);
|
|
85
|
-
Vue.component(vbTabs.name, vbTabs);
|
|
86
|
-
Vue.component(vbTabPane.name, vbTabPane);
|
|
87
|
-
Vue.component(xTabs.name, xTabs);
|
|
88
|
-
Vue.component("status-tag", () =>
|
|
89
|
-
import("@base/components/statusTag/index.vue")
|
|
90
|
-
);
|
|
91
|
-
Vue.component("CodeEditor", () =>
|
|
92
|
-
import("@base/components/code-editor/index.vue")
|
|
93
|
-
);
|
|
94
|
-
Vue.component("scriptDescriptionButton", () =>
|
|
95
|
-
import("@base/components/scriptDescription/button")
|
|
96
|
-
);
|
|
97
|
-
Vue.component("scriptTestButton", () =>
|
|
98
|
-
import("@base/components/scriptTest/button")
|
|
99
|
-
);
|
|
100
|
-
Vue.component(baseTextarea.name, baseTextarea);
|
|
101
|
-
|
|
102
|
-
Object.keys(filters).forEach((key) => {
|
|
103
|
-
Vue.filter(key, filters[key]);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
loadStyle(getPublicAssetUrl("css/print-lock.css"), { media: "print" }).catch(
|
|
107
|
-
(error) => console.warn("[bootstrap] 打印样式加载失败", error)
|
|
108
|
-
);
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const assetPromises = Object.create(null);
|
|
2
|
-
|
|
3
|
-
export function getPublicAssetUrl(path) {
|
|
4
|
-
const baseUrl = (process.env.BASE_URL || "/").replace(/\/?$/, "/");
|
|
5
|
-
return baseUrl + String(path || "").replace(/^\//, "");
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function findAsset(tagName, attribute, url) {
|
|
9
|
-
return Array.from(document.getElementsByTagName(tagName)).find(
|
|
10
|
-
(element) => element.getAttribute(attribute) === url
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function loadStyle(href, attributes = {}) {
|
|
15
|
-
const key = "style:" + href;
|
|
16
|
-
if (assetPromises[key]) return assetPromises[key];
|
|
17
|
-
const existing = findAsset("link", "href", href);
|
|
18
|
-
if (existing) return Promise.resolve(existing);
|
|
19
|
-
|
|
20
|
-
assetPromises[key] = new Promise((resolve, reject) => {
|
|
21
|
-
const link = document.createElement("link");
|
|
22
|
-
link.rel = "stylesheet";
|
|
23
|
-
link.href = href;
|
|
24
|
-
Object.keys(attributes).forEach((name) => {
|
|
25
|
-
link.setAttribute(name, attributes[name]);
|
|
26
|
-
});
|
|
27
|
-
link.onload = () => resolve(link);
|
|
28
|
-
link.onerror = () => {
|
|
29
|
-
delete assetPromises[key];
|
|
30
|
-
link.remove();
|
|
31
|
-
reject(new Error("样式加载失败:" + href));
|
|
32
|
-
};
|
|
33
|
-
document.head.appendChild(link);
|
|
34
|
-
});
|
|
35
|
-
return assetPromises[key];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function loadStyles(hrefs) {
|
|
39
|
-
return Promise.all(hrefs.map((href) => loadStyle(href)));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function loadScript(src) {
|
|
43
|
-
const key = "script:" + src;
|
|
44
|
-
if (assetPromises[key]) return assetPromises[key];
|
|
45
|
-
const existing = findAsset("script", "src", src);
|
|
46
|
-
if (existing) return Promise.resolve(existing);
|
|
47
|
-
|
|
48
|
-
assetPromises[key] = new Promise((resolve, reject) => {
|
|
49
|
-
const script = document.createElement("script");
|
|
50
|
-
script.src = src;
|
|
51
|
-
script.async = true;
|
|
52
|
-
script.onload = () => resolve(script);
|
|
53
|
-
script.onerror = () => {
|
|
54
|
-
delete assetPromises[key];
|
|
55
|
-
script.remove();
|
|
56
|
-
reject(new Error("脚本加载失败:" + src));
|
|
57
|
-
};
|
|
58
|
-
document.head.appendChild(script);
|
|
59
|
-
});
|
|
60
|
-
return assetPromises[key];
|
|
61
|
-
}
|
|
62
|
-
|
package/src/utils/loginVab.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// API 模块沿用 USER_PREFIX 等全局常量;完整 Vab 延迟加载后,登录阶段需先恢复
|
|
2
|
-
// 这项原本由 vab.js 模块初始化完成的副作用。
|
|
3
|
-
import "@base/utils/prefixGlobals";
|
|
4
|
-
import Loading from "element-ui/lib/loading";
|
|
5
|
-
import MessageBox from "element-ui/lib/message-box";
|
|
6
|
-
import request from "@base/utils/request";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 登录阶段需要的最小 Vab 能力。完整 Vab 会连带 lodash、moment、XEUtils、
|
|
10
|
-
* 图片预览等后台依赖,改为进入业务路由后再覆盖安装。
|
|
11
|
-
*/
|
|
12
|
-
export default function installLoginVab(Vue) {
|
|
13
|
-
Vue.prototype.$baseEventBus = new Vue();
|
|
14
|
-
const $http = async function (option = {}) {
|
|
15
|
-
if (!option.loadingTarget && this.$el) {
|
|
16
|
-
option.loadingTarget = this.$el;
|
|
17
|
-
}
|
|
18
|
-
if (!option.vueTarget) {
|
|
19
|
-
option.vueTarget = this;
|
|
20
|
-
}
|
|
21
|
-
return option.sync === false ? await request(option) : request(option);
|
|
22
|
-
};
|
|
23
|
-
Object.assign($http, request);
|
|
24
|
-
$http.prototype = request.prototype;
|
|
25
|
-
Vue.prototype.$http = $http;
|
|
26
|
-
|
|
27
|
-
Vue.prototype.$baseLoading = function (option = {}) {
|
|
28
|
-
const opts = {
|
|
29
|
-
lock: true,
|
|
30
|
-
background: "hsla(0,0%,100%,.8)",
|
|
31
|
-
target: this.$el,
|
|
32
|
-
...option,
|
|
33
|
-
};
|
|
34
|
-
if (option.index) {
|
|
35
|
-
opts.spinner = "vab-loading-type" + option.index;
|
|
36
|
-
}
|
|
37
|
-
return Loading.service(opts);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
Vue.prototype.$baseAlert = function (content, title, callback) {
|
|
41
|
-
return MessageBox.alert(content, title || "提示", {
|
|
42
|
-
confirmButtonText: "确定",
|
|
43
|
-
dangerouslyUseHTMLString: true,
|
|
44
|
-
target: this.$el,
|
|
45
|
-
confirmButtonClass: "icondui",
|
|
46
|
-
customClass: "dialog-style",
|
|
47
|
-
callback,
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
Vue.prototype.$t1 = function (path, values) {
|
|
52
|
-
const root = this.$root || window.$vueRoot;
|
|
53
|
-
if (!root || !root._i18n) return path;
|
|
54
|
-
const i18n = root.$i18n;
|
|
55
|
-
if (i18n.locale === "zh" || !i18n.te(path)) {
|
|
56
|
-
return i18n._t(path, i18n.locale, { zh: { [path]: path } }, null, values);
|
|
57
|
-
}
|
|
58
|
-
return i18n.t(path, values) || path;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
Vue.prototype.$t2 = function (defaultValue, path, values) {
|
|
62
|
-
const root = this.$root || window.$vueRoot;
|
|
63
|
-
if (!root || !root._i18n) return defaultValue;
|
|
64
|
-
const i18n = root.$i18n;
|
|
65
|
-
const key = path || defaultValue;
|
|
66
|
-
return i18n.te(key) ? i18n.t(key, values) : defaultValue;
|
|
67
|
-
};
|
|
68
|
-
}
|