n20-common-lib 2.1.25 → 2.1.26
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
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
@keydown.native="stepFn"
|
|
17
17
|
>
|
|
18
18
|
<template v-if="type === 'rate'">
|
|
19
|
-
<span v-if="
|
|
19
|
+
<span v-if="suffixV" slot="suffix" class="el-input__icon">{{ suffix }}</span>
|
|
20
20
|
</template>
|
|
21
21
|
</el-input>
|
|
22
22
|
</div>
|
|
@@ -97,6 +97,12 @@ export default {
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
computed: {
|
|
100
|
+
suffixV() {
|
|
101
|
+
if (!this.isClearable) return true
|
|
102
|
+
if (!this.valueStr) return true
|
|
103
|
+
if (!(this.isHove || this.isFocus)) return true
|
|
104
|
+
return false
|
|
105
|
+
},
|
|
100
106
|
phd() {
|
|
101
107
|
if (this.placeholder) {
|
|
102
108
|
return this.placeholder
|
package/src/index.js
CHANGED
|
@@ -95,8 +95,8 @@ import auth from './utils/auth.js'
|
|
|
95
95
|
import { msgPor, msgboxPor } from './utils/msgboxPor.js'
|
|
96
96
|
import getJsonc from './assets/getJsonc.js'
|
|
97
97
|
import downloadBlob from './utils/downloadBlob.js'
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
98
|
+
import { setTabs } from './utils/handleTab.js'
|
|
99
|
+
import { linkPush, linkGo, closeTab } from './utils/urlToGo'
|
|
100
100
|
import forEachs from './utils/forEachs'
|
|
101
101
|
import list2tree from './utils/list2tree'
|
|
102
102
|
import { has as isHas } from './directives/VHas/index.js'
|
|
@@ -219,6 +219,7 @@ export default {
|
|
|
219
219
|
version,
|
|
220
220
|
install
|
|
221
221
|
}
|
|
222
|
+
const linkClose = closeTab
|
|
222
223
|
export {
|
|
223
224
|
version,
|
|
224
225
|
// 方法
|
|
@@ -230,9 +231,13 @@ export {
|
|
|
230
231
|
forEachs,
|
|
231
232
|
list2tree,
|
|
232
233
|
repairEl,
|
|
234
|
+
// 页签/路由
|
|
235
|
+
setTabs,
|
|
236
|
+
closeTab,
|
|
233
237
|
linkPush,
|
|
234
238
|
linkGo,
|
|
235
239
|
linkClose,
|
|
240
|
+
// 权限
|
|
236
241
|
isHas,
|
|
237
242
|
isHasG,
|
|
238
243
|
dayjs,
|
package/src/utils/urlToGo.js
CHANGED
|
@@ -59,7 +59,7 @@ export function linkPush(url = '', query = {}, $router) {
|
|
|
59
59
|
query._fromNo = Date.now()
|
|
60
60
|
sessionStorage.setItem(query._fromNo, location.href)
|
|
61
61
|
// 如果提供vue-router
|
|
62
|
-
if (
|
|
62
|
+
if (process.env.NODE_ENV === 'development' && $router?.push) {
|
|
63
63
|
let base = $router.options.base || ''
|
|
64
64
|
base = base.replace(/\/$/, '')
|
|
65
65
|
base = new RegExp('^' + base)
|
|
@@ -89,7 +89,7 @@ export function linkGo(N = -1, $router) {
|
|
|
89
89
|
|
|
90
90
|
if (_fromUrl) {
|
|
91
91
|
// 如果提供vue-router
|
|
92
|
-
if (
|
|
92
|
+
if (process.env.NODE_ENV === 'development' && $router?.push) {
|
|
93
93
|
let base = $router.options.base || ''
|
|
94
94
|
base = base.replace(/\/$/, '')
|
|
95
95
|
base = new RegExp('^' + base)
|
|
@@ -107,3 +107,16 @@ export function linkGo(N = -1, $router) {
|
|
|
107
107
|
window.history.go(N)
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
+
|
|
111
|
+
import { closeTab as _closeTab } from './handleTab.js'
|
|
112
|
+
export function closeTab(url, $router) {
|
|
113
|
+
let path = url || window.location.pathname
|
|
114
|
+
if (process.env.NODE_ENV === 'development' && $router?.options) {
|
|
115
|
+
let base = $router.options.base || ''
|
|
116
|
+
base = base.replace(/\/$/, '')
|
|
117
|
+
base = new RegExp('^' + base)
|
|
118
|
+
_closeTab({ path: path.replace(base, '') }, '*')
|
|
119
|
+
} else {
|
|
120
|
+
_closeTab({ path: path }, '*')
|
|
121
|
+
}
|
|
122
|
+
}
|