From fc696e6d940ab879823d69eb3bb44b89e01d893d Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Sun, 16 May 2021 17:02:53 +0800 Subject: [PATCH] =?UTF-8?q?'admin-21.05.16:=E4=BC=98=E5=8C=96iframe?= =?UTF-8?q?=E3=80=81=E6=9B=B4=E6=96=B0=E6=9C=80=E6=96=B0=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E3=80=81=E8=A7=84=E8=8C=83=E5=B7=A5=E5=85=B7=E7=B1=BB=E5=91=BD?= =?UTF-8?q?=E5=90=8D'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- src/utils/customDirective.ts | 2 +- src/utils/getStyleSheets.ts | 11 +++++++---- src/utils/request.ts | 1 + src/utils/wartermark.ts | 6 ++++-- src/views/layout/routerView/iframes.vue | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index f8b1e714..f3228d63 100644 --- a/package.json +++ b/package.json @@ -28,12 +28,12 @@ "vue-router": "^4.0.2", "vue-web-screen-shot": "^1.1.9", "vuex": "^4.0.0-rc.2", - "wangeditor": "^4.6.17" + "wangeditor": "^4.7.0" }, "devDependencies": { "@types/axios": "^0.14.0", "@types/clipboard": "^2.0.1", - "@types/node": "^15.0.3", + "@types/node": "^15.3.0", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.10.6", "@typescript-eslint/eslint-plugin": "^4.23.0", @@ -45,7 +45,7 @@ "eslint-plugin-vue": "^7.9.0", "prettier": "^2.3.0", "sass": "^1.32.13", - "sass-loader": "^11.1.0", + "sass-loader": "^11.1.1", "typescript": "^4.2.4", "vite": "^2.3.2", "vue-eslint-parser": "^7.6.0" diff --git a/src/utils/customDirective.ts b/src/utils/customDirective.ts index 39e7b906..c0e3d8c4 100644 --- a/src/utils/customDirective.ts +++ b/src/utils/customDirective.ts @@ -5,7 +5,7 @@ export function wavesDirective(app: App) { app.directive('waves', { mounted(el, binding) { el.classList.add('waves-effect'); - binding.value && el.classList.add('waves-' + binding.value); + binding.value && el.classList.add(`waves-${binding.value}`); function setConvertStyle(obj: any) { let style: string = ''; for (let i in obj) { diff --git a/src/utils/getStyleSheets.ts b/src/utils/getStyleSheets.ts index 10a6c8c5..7b64b2e4 100644 --- a/src/utils/getStyleSheets.ts +++ b/src/utils/getStyleSheets.ts @@ -28,7 +28,7 @@ const getAlicdnIconfont = () => { }; // 初始化获取 css 样式,获取 element plus 自带图标 -const elementPlusIconfont = () => { +const getElementPlusIconfont = () => { return new Promise((resolve, reject) => { nextTick(() => { const styles: any = document.styleSheets; @@ -49,7 +49,7 @@ const elementPlusIconfont = () => { }; // 初始化获取 css 样式,这里使用 fontawesome 的图标 -const awesomeIconfont = () => { +const getAwesomeIconfont = () => { return new Promise((resolve, reject) => { nextTick(() => { const styles: any = document.styleSheets; @@ -81,14 +81,17 @@ const awesomeIconfont = () => { // 定义导出方法集合 const initIconfont = { + // iconfont ali: () => { return getAlicdnIconfont(); }, + // element plus ele: () => { - return elementPlusIconfont(); + return getElementPlusIconfont(); }, + // fontawesome awe: () => { - return awesomeIconfont(); + return getAwesomeIconfont(); }, }; diff --git a/src/utils/request.ts b/src/utils/request.ts index 61b89047..048e4c39 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -59,4 +59,5 @@ service.interceptors.response.use( } ); +// 导出 axios 实例 export default service; diff --git a/src/utils/wartermark.ts b/src/utils/wartermark.ts index adde39ca..d06ad271 100644 --- a/src/utils/wartermark.ts +++ b/src/utils/wartermark.ts @@ -19,13 +19,14 @@ const setWatermark = (str: any) => { div.style.left = '0px'; div.style.position = 'fixed'; div.style.zIndex = '10000000'; - div.style.width = document.documentElement.clientWidth + 'px'; - div.style.height = document.documentElement.clientHeight + 'px'; + div.style.width = `${document.documentElement.clientWidth}px`; + div.style.height = `${document.documentElement.clientHeight}px`; div.style.background = `url(${can.toDataURL('image/png')}) left top repeat`; document.body.appendChild(div); return id; }; +// 定义导出方法集合 const watermark = { // 设置水印 set: (str: any) => { @@ -39,4 +40,5 @@ const watermark = { }, }; +// 导出方法 export default watermark; diff --git a/src/views/layout/routerView/iframes.vue b/src/views/layout/routerView/iframes.vue index fd41ed02..0fe34964 100644 --- a/src/views/layout/routerView/iframes.vue +++ b/src/views/layout/routerView/iframes.vue @@ -1,7 +1,7 @@