eoss-ui 0.4.31 → 0.4.33
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/CHANGELOG.md +929 -0
- package/lib/button-group.js +33 -61
- package/lib/button.js +33 -61
- package/lib/checkbox-group.js +33 -61
- package/lib/data-table-form.js +33 -61
- package/lib/data-table.js +47 -67
- package/lib/date-picker.js +33 -61
- package/lib/dialog.js +33 -61
- package/lib/eoss-ui.common.js +197 -174
- package/lib/flow-group.js +43 -67
- package/lib/flow-list.js +33 -61
- package/lib/flow.js +33 -61
- package/lib/form.js +38 -65
- package/lib/handle-user.js +33 -61
- package/lib/handler.js +33 -61
- package/lib/index.js +1 -1
- package/lib/input-number.js +33 -61
- package/lib/input.js +33 -61
- package/lib/login.js +47 -72
- package/lib/main.js +58 -75
- package/lib/mainComp.js +36 -68
- package/lib/nav.js +33 -61
- package/lib/page.js +33 -61
- package/lib/player.js +33 -61
- package/lib/qr-code.js +33 -61
- package/lib/radio-group.js +33 -61
- package/lib/select-ganged.js +33 -61
- package/lib/select.js +33 -61
- package/lib/selector-panel.js +33 -61
- package/lib/selector.js +33 -61
- package/lib/sizer.js +33 -61
- package/lib/steps.js +33 -61
- package/lib/switch.js +33 -61
- package/lib/table-form.js +33 -61
- package/lib/tabs.js +33 -61
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/tips.js +33 -61
- package/lib/tree-group.js +43 -63
- package/lib/tree.js +48 -63
- package/lib/upload.js +61 -82
- package/lib/utils/util.js +33 -61
- package/lib/wujie.js +33 -61
- package/lib/wxlogin.js +33 -61
- package/package.json +2 -2
- package/packages/data-table/src/main.vue +9 -2
- package/packages/flow-group/src/main.vue +5 -4
- package/packages/form/src/main.vue +4 -2
- package/packages/login/src/main.vue +12 -9
- package/packages/main/src/main.vue +13 -3
- package/packages/main/src/userinfo.vue +21 -24
- package/packages/mainComp/src/main.vue +1 -5
- package/packages/theme-chalk/lib/form.css +1 -1
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/src/form.scss +1 -1
- package/packages/tree/src/main.vue +12 -0
- package/packages/tree-group/src/main.vue +6 -0
- package/packages/upload/src/main.vue +25 -25
- package/src/index.js +1 -1
- package/src/utils/util.js +50 -77
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
:expand-on-click-node="false"
|
|
62
62
|
:highlight-current="true"
|
|
63
63
|
:show-checkbox="showCheckbox"
|
|
64
|
+
:current-node-key="currentNodeKey"
|
|
64
65
|
v-on="{
|
|
65
66
|
...$listeners,
|
|
66
67
|
'node-click': handleNodeClick,
|
|
@@ -159,6 +160,8 @@ export default {
|
|
|
159
160
|
},
|
|
160
161
|
// 选择项本地数据
|
|
161
162
|
data: Array,
|
|
163
|
+
currentFirst: Boolean,
|
|
164
|
+
currentNodeKey: [String, Number],
|
|
162
165
|
icon: {
|
|
163
166
|
type: Boolean,
|
|
164
167
|
default: true
|
|
@@ -381,6 +384,15 @@ export default {
|
|
|
381
384
|
this.loading = false;
|
|
382
385
|
if (res.rCode === 0) {
|
|
383
386
|
this.treeList = JSON.parse(JSON.stringify(res.results));
|
|
387
|
+
if (this.currentFirst) {
|
|
388
|
+
let currentNode = this.treeList[0].children[0].id;
|
|
389
|
+
this.$emit('current-first', this.treeList[0]);
|
|
390
|
+
if (!this.currentNodeKey) {
|
|
391
|
+
this.$nextTick(() => {
|
|
392
|
+
this.$refs.oaTree.setCurrentKey(currentNode);
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
384
396
|
this.expandedKeys = this.treeList.filter((item) => {
|
|
385
397
|
if (item.open) {
|
|
386
398
|
return item.id;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
:ref="item.ref ? item.ref : 'groupTree' + index"
|
|
26
26
|
@node-click="handleNodeClick"
|
|
27
27
|
@check-change="handleCheckChange"
|
|
28
|
+
@current-first="handleCurrentFirst"
|
|
28
29
|
v-on="item.tree && item.tree.events ? item.tree.events : {}"
|
|
29
30
|
>
|
|
30
31
|
<template v-if="item.enterprise" slot="filtrate">
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
ref="groupTree"
|
|
49
50
|
@node-click="handleNodeClick"
|
|
50
51
|
@check-change="handleCheckChange"
|
|
52
|
+
@current-first="handleCurrentFirst"
|
|
51
53
|
v-on="tree.events ? tree.events : {}"
|
|
52
54
|
>
|
|
53
55
|
<template v-if="enterprise" slot="filtrate">
|
|
@@ -432,6 +434,10 @@ export default {
|
|
|
432
434
|
handleConfirm(res) {
|
|
433
435
|
this.checkeds = res;
|
|
434
436
|
this.$emit('enterprise-confirm', res);
|
|
437
|
+
},
|
|
438
|
+
handleCurrentFirst(res) {
|
|
439
|
+
this.checkeds = res.children[0];
|
|
440
|
+
this.$emit('current-first', res);
|
|
435
441
|
}
|
|
436
442
|
}
|
|
437
443
|
};
|
|
@@ -542,12 +542,14 @@ export default {
|
|
|
542
542
|
return this.image;
|
|
543
543
|
}
|
|
544
544
|
return (
|
|
545
|
-
this.host + previewAdjunct + '?adjunctId=' + this.image.adjunctId
|
|
545
|
+
this.host + this.previewAdjunct + '?adjunctId=' + this.image.adjunctId
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
548
|
if (this.value) {
|
|
549
549
|
if (typeof this.value === 'string') {
|
|
550
|
-
if (this.value.indexOf('data:image/') ===
|
|
550
|
+
if (this.value.indexOf('data:image/') === 0) {
|
|
551
|
+
return this.value;
|
|
552
|
+
} else if (this.value.indexOf(this.previewAdjunct) > -1) {
|
|
551
553
|
let val =
|
|
552
554
|
this.host +
|
|
553
555
|
util.jointUrl({
|
|
@@ -555,38 +557,36 @@ export default {
|
|
|
555
557
|
reg: '/main2'
|
|
556
558
|
});
|
|
557
559
|
return val;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
this.value.indexOf(previewAdjunct) === -1 ||
|
|
561
|
-
this.value.indexOf('/') === -1
|
|
562
|
-
) {
|
|
563
|
-
return this.host + previewAdjunct + '?adjunctId=' + this.value;
|
|
560
|
+
} else if (this.value.indexOf('/') === -1) {
|
|
561
|
+
return this.host + this.previewAdjunct + '?adjunctId=' + this.value;
|
|
564
562
|
}
|
|
565
563
|
return this.value;
|
|
566
564
|
} else if (Array.isArray(this.value)) {
|
|
567
565
|
let adjunctId = this.value[0].response
|
|
568
566
|
? this.value[0].response.adjunctId
|
|
569
567
|
: this.value[0].adjunctId;
|
|
570
|
-
return this.host + previewAdjunct + '?adjunctId=' + adjunctId;
|
|
568
|
+
return this.host + this.previewAdjunct + '?adjunctId=' + adjunctId;
|
|
571
569
|
} else {
|
|
572
570
|
let adjunctId = this.value.response
|
|
573
571
|
? this.value.response.adjunctId
|
|
574
572
|
: this.value.adjunctId;
|
|
575
|
-
return this.host + previewAdjunct + '?adjunctId=' + adjunctId;
|
|
573
|
+
return this.host + this.previewAdjunct + '?adjunctId=' + adjunctId;
|
|
576
574
|
}
|
|
577
575
|
}
|
|
578
|
-
if (
|
|
579
|
-
this.photo
|
|
580
|
-
|
|
581
|
-
this.photo.indexOf(
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
576
|
+
if (this.photo && typeof this.photo === 'string') {
|
|
577
|
+
if (this.photo.indexOf('data:image/') === 0) {
|
|
578
|
+
return this.photo;
|
|
579
|
+
} else if (this.photo.indexOf(this.previewAdjunct) > -1) {
|
|
580
|
+
let val =
|
|
581
|
+
this.host +
|
|
582
|
+
util.jointUrl({
|
|
583
|
+
url: this.value,
|
|
584
|
+
reg: '/main2'
|
|
585
|
+
});
|
|
586
|
+
return val;
|
|
587
|
+
} else if (this.photo.indexOf('/') === -1) {
|
|
588
|
+
return this.host + this.previewAdjunct + '?adjunctId=' + this.photo;
|
|
589
|
+
}
|
|
590
590
|
}
|
|
591
591
|
return this.photo;
|
|
592
592
|
}
|
|
@@ -782,7 +782,7 @@ export default {
|
|
|
782
782
|
) {
|
|
783
783
|
this.imgUrl =
|
|
784
784
|
this.host +
|
|
785
|
-
(url ? url : previewAdjunct) +
|
|
785
|
+
(url ? url : this.previewAdjunct) +
|
|
786
786
|
'?adjunctId=' +
|
|
787
787
|
file.adjunctId;
|
|
788
788
|
this.title = file.originalName;
|
|
@@ -794,7 +794,7 @@ export default {
|
|
|
794
794
|
this.source = {
|
|
795
795
|
src:
|
|
796
796
|
this.host +
|
|
797
|
-
(url ? url : previewAdjunct) +
|
|
797
|
+
(url ? url : this.previewAdjunct) +
|
|
798
798
|
'?adjunctId=' +
|
|
799
799
|
file.adjunctId
|
|
800
800
|
};
|
|
@@ -803,7 +803,7 @@ export default {
|
|
|
803
803
|
} else {
|
|
804
804
|
util.win.open(
|
|
805
805
|
this.host +
|
|
806
|
-
(url ? url : previewAdjunct) +
|
|
806
|
+
(url ? url : this.previewAdjunct) +
|
|
807
807
|
'?adjunctId=' +
|
|
808
808
|
file.adjunctId
|
|
809
809
|
);
|
package/src/index.js
CHANGED
package/src/utils/util.js
CHANGED
|
@@ -22,6 +22,7 @@ const $brightnessStep2 = 0.15;
|
|
|
22
22
|
const $lightColorCount = 5;
|
|
23
23
|
const $darkColorCount = 4;
|
|
24
24
|
const publicKey = 'abcdefghijklmnopqrstuvwxyz12345678';
|
|
25
|
+
let loginMsg;
|
|
25
26
|
|
|
26
27
|
const JSONbigToString = JSONbig({ storeAsString: true });
|
|
27
28
|
import { MessageBox, Loading } from 'eoss-element';
|
|
@@ -43,7 +44,6 @@ import { MessageBox, Loading } from 'eoss-element';
|
|
|
43
44
|
* @param {Object} [loading] - loading加载对象
|
|
44
45
|
**/
|
|
45
46
|
// 请求
|
|
46
|
-
let _timer = null;
|
|
47
47
|
const pendingRequest = new Map();
|
|
48
48
|
function getRequestKey(config) {
|
|
49
49
|
const { method, url, params, data } = config;
|
|
@@ -169,63 +169,55 @@ const ajax = function ({
|
|
|
169
169
|
'useCaseCodes',
|
|
170
170
|
'mainConfig'
|
|
171
171
|
]);
|
|
172
|
-
|
|
173
|
-
let timer = getStorage('timer') || 0;
|
|
174
|
-
timer = parseInt(timer, 10);
|
|
175
172
|
if (
|
|
176
173
|
win.top.location.href.indexOf('#/login') === -1 &&
|
|
177
|
-
win.top.location.href.indexOf('/login.html') === -1
|
|
178
|
-
!timer
|
|
174
|
+
win.top.location.href.indexOf('/login.html') === -1
|
|
179
175
|
) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
win.top.location.href
|
|
205
|
-
|
|
206
|
-
const hash = win.top.location.hash;
|
|
207
|
-
if (
|
|
208
|
-
hash ||
|
|
209
|
-
(win.top.location.indexOf('model=') &&
|
|
210
|
-
win.top.location.indexOf('view=') &&
|
|
211
|
-
win.top.location.indexOf('render.html'))
|
|
212
|
-
) {
|
|
213
|
-
const len = win.top.location.href.indexOf(hash);
|
|
214
|
-
let href = win.top.location.href.slice(0, len) + '#/login';
|
|
215
|
-
win.top.location.href = href;
|
|
176
|
+
clearTimeout(loginMsg);
|
|
177
|
+
loginMsg = setTimeout(() => {
|
|
178
|
+
MessageBox.confirm(
|
|
179
|
+
response.data.rCode === 69
|
|
180
|
+
? '该账号在其他地方已登陆!'
|
|
181
|
+
: '登录已过期,请重新登录!',
|
|
182
|
+
'提示',
|
|
183
|
+
response.data.rCode === 69
|
|
184
|
+
? {
|
|
185
|
+
confirmButtonText: '确定',
|
|
186
|
+
closeOnClickModal: false,
|
|
187
|
+
type: 'warning'
|
|
188
|
+
}
|
|
189
|
+
: {
|
|
190
|
+
confirmButtonText: '确定',
|
|
191
|
+
cancelButtonText: '取消',
|
|
192
|
+
closeOnClickModal: false,
|
|
193
|
+
type: 'warning'
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
.then(() => {
|
|
197
|
+
const loginPage = getStorage('login') || getStorage('loginPage');
|
|
198
|
+
if (loginPage) {
|
|
199
|
+
win.top.location.href = loginPage;
|
|
200
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
201
|
+
win.top.location.href = './login.html';
|
|
216
202
|
} else {
|
|
217
|
-
win.top.location.
|
|
203
|
+
const hash = win.top.location.hash;
|
|
204
|
+
if (
|
|
205
|
+
hash ||
|
|
206
|
+
(win.top.location.indexOf('model=') &&
|
|
207
|
+
win.top.location.indexOf('view=') &&
|
|
208
|
+
win.top.location.indexOf('render.html'))
|
|
209
|
+
) {
|
|
210
|
+
const len = win.top.location.href.indexOf(hash);
|
|
211
|
+
let href = win.top.location.href.slice(0, len) + '#/login';
|
|
212
|
+
win.top.location.href = href;
|
|
213
|
+
} else {
|
|
214
|
+
win.top.location.href = '/login.html';
|
|
215
|
+
}
|
|
218
216
|
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
_timer = setTimeout(() => {
|
|
224
|
-
removeStorage('timer');
|
|
225
|
-
clearTimeout(_timer);
|
|
226
|
-
_timer = null;
|
|
227
|
-
}, 1000);
|
|
228
|
-
});
|
|
217
|
+
})
|
|
218
|
+
.catch(e => {
|
|
219
|
+
});
|
|
220
|
+
}, 1000);
|
|
229
221
|
}
|
|
230
222
|
return Promise.reject(response.data);
|
|
231
223
|
} else {
|
|
@@ -371,32 +363,13 @@ const browser = function () {
|
|
|
371
363
|
* @param {Boolean} [immediate] - 是否首次触发执行
|
|
372
364
|
**/
|
|
373
365
|
|
|
374
|
-
const debounce = function (
|
|
375
|
-
|
|
366
|
+
const debounce = function (callback, delay) {
|
|
367
|
+
var timeout = null;
|
|
376
368
|
return function () {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
if (timeout) clearTimeout(timeout);
|
|
381
|
-
// 是否在某一批事件中首次执行
|
|
382
|
-
if (immediate) {
|
|
383
|
-
let callNow = !timeout;
|
|
384
|
-
timeout = setTimeout(function () {
|
|
385
|
-
timeout = null;
|
|
386
|
-
fn.apply(self, args);
|
|
387
|
-
immediate = true;
|
|
388
|
-
}, wait);
|
|
389
|
-
if (callNow) {
|
|
390
|
-
fn.apply(self, args);
|
|
391
|
-
}
|
|
392
|
-
immediate = false;
|
|
393
|
-
} else {
|
|
394
|
-
timeout = setTimeout(function () {
|
|
395
|
-
fn.apply(self, args);
|
|
396
|
-
immediate = true;
|
|
397
|
-
}, wait);
|
|
398
|
-
}
|
|
369
|
+
clearTimeout(timeout);
|
|
370
|
+
timeout = setTimeout(callback, delay ? delay : 500);
|
|
399
371
|
};
|
|
372
|
+
|
|
400
373
|
};
|
|
401
374
|
/**
|
|
402
375
|
* delUrlParam
|