eoss-ui 0.4.57 → 0.4.59

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +929 -0
  2. package/lib/button-group.js +19 -5
  3. package/lib/button.js +19 -5
  4. package/lib/checkbox-group.js +19 -5
  5. package/lib/clients.js +95 -4
  6. package/lib/data-table-form.js +19 -5
  7. package/lib/data-table.js +24 -11
  8. package/lib/date-picker.js +19 -5
  9. package/lib/dialog.js +19 -5
  10. package/lib/eoss-ui.common.js +1361 -1074
  11. package/lib/flow-group.js +928 -860
  12. package/lib/flow-list.js +19 -5
  13. package/lib/flow.js +32 -16
  14. package/lib/form.js +19 -5
  15. package/lib/handle-user.js +19 -5
  16. package/lib/handler.js +38 -15
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +19 -5
  19. package/lib/input.js +31 -10
  20. package/lib/login.js +102 -33
  21. package/lib/main.js +71 -36
  22. package/lib/mainComp.js +19 -5
  23. package/lib/nav.js +19 -5
  24. package/lib/page.js +19 -5
  25. package/lib/player.js +19 -5
  26. package/lib/qr-code.js +19 -5
  27. package/lib/radio-group.js +19 -5
  28. package/lib/retrial-auth.js +24 -9
  29. package/lib/select-ganged.js +19 -5
  30. package/lib/select.js +19 -5
  31. package/lib/selector-panel.js +19 -5
  32. package/lib/selector.js +19 -5
  33. package/lib/sizer.js +19 -5
  34. package/lib/steps.js +19 -5
  35. package/lib/switch.js +19 -5
  36. package/lib/table-form.js +26 -11
  37. package/lib/tabs.js +19 -5
  38. package/lib/theme-chalk/clients.css +1 -1
  39. package/lib/theme-chalk/flow-group.css +1 -1
  40. package/lib/theme-chalk/index.css +1 -1
  41. package/lib/theme-chalk/login.css +1 -1
  42. package/lib/theme-chalk/upload.css +1 -1
  43. package/lib/tips.js +19 -5
  44. package/lib/toolbar.js +0 -1
  45. package/lib/tree-group.js +19 -5
  46. package/lib/tree.js +19 -5
  47. package/lib/upload.js +110 -62
  48. package/lib/utils/util.js +19 -5
  49. package/lib/wujie.js +19 -5
  50. package/lib/wxlogin.js +19 -5
  51. package/package.json +2 -2
  52. package/packages/clients/src/main.vue +60 -2
  53. package/packages/data-table/src/main.vue +0 -1
  54. package/packages/flow/src/main.vue +1 -0
  55. package/packages/flow/src/startTaskRead.vue +2 -2
  56. package/packages/flow-group/src/main.vue +284 -265
  57. package/packages/form/src/table.vue +3 -2
  58. package/packages/handler/src/main.vue +20 -10
  59. package/packages/input/src/main.vue +7 -2
  60. package/packages/login/src/main.vue +77 -27
  61. package/packages/main/src/main.vue +28 -16
  62. package/packages/main/src/userinfo.vue +20 -9
  63. package/packages/retrial-auth/src/main.vue +3 -2
  64. package/packages/theme-chalk/lib/clients.css +1 -1
  65. package/packages/theme-chalk/lib/flow-group.css +1 -1
  66. package/packages/theme-chalk/lib/index.css +1 -1
  67. package/packages/theme-chalk/lib/login.css +1 -1
  68. package/packages/theme-chalk/lib/upload.css +1 -1
  69. package/packages/theme-chalk/src/clients.scss +8 -0
  70. package/packages/theme-chalk/src/flow-group.scss +9 -3
  71. package/packages/theme-chalk/src/login.scss +3 -0
  72. package/packages/theme-chalk/src/upload.scss +50 -26
  73. package/packages/toolbar/src/main.vue +0 -1
  74. package/packages/upload/src/main.vue +56 -37
  75. package/src/index.js +1 -1
  76. package/src/utils/util.js +21 -10
@@ -11,11 +11,12 @@
11
11
  :show-file-list="showList"
12
12
  :file-list="lists"
13
13
  :result-file="resultFile"
14
- :disabled="isDisabled"
14
+ :disabled="isDisabled || isReadonly"
15
+ :readonly="isReadonly"
15
16
  :class="[
16
17
  {
17
18
  'es-avatar-uploader': portrait,
18
- 'es-upload-readonly': isDisabled
19
+ 'es-upload-readonly': isReadonly
19
20
  },
20
21
  'es-upload-' + listType
21
22
  ]"
@@ -76,14 +77,15 @@
76
77
  <i
77
78
  v-else
78
79
  class="avatar-uploader-icon"
79
- :class="{ 'el-icon-plus': !isDisabled }"
80
+ :class="{ 'el-icon-plus': !isReadonly, 'is-disabled': isDisabled }"
80
81
  :style="{ width: width, height: height, lineHeight: height }"
81
82
  ></i>
82
83
  </template>
83
84
  <template v-else>
84
- <template v-if="!isDisabled">
85
+ <template v-if="!isReadonly">
85
86
  <i
86
87
  class="el-icon-plus es-uploader-icon"
88
+ :class="{ 'is-disabled': isDisabled }"
87
89
  v-if="selectType === 'icon-plus'"
88
90
  ></i>
89
91
  <el-button
@@ -92,6 +94,7 @@
92
94
  :class="icon"
93
95
  :type="selectType"
94
96
  :size="btnSize"
97
+ :disabled="isDisabled"
95
98
  >{{
96
99
  text ? text : autoUpload ? '点击上传' : '选择文件'
97
100
  }}</el-button
@@ -101,6 +104,7 @@
101
104
  v-if="!autoUpload"
102
105
  :type="uploadType"
103
106
  :size="btnSize"
107
+ :disabled="isDisabled"
104
108
  @click.stop="handleUpload"
105
109
  >
106
110
  上传文件
@@ -142,8 +146,15 @@
142
146
  <div v-if="tips" class="el-upload__tip">{{ tips }}</div>
143
147
  </slot>
144
148
  </template>
145
-
146
- <es-dialog :title="title" :visible.sync="showImg" slot="dialog">
149
+ <el-image-viewer
150
+ slot="dialog"
151
+ v-if="previewScale && showImg"
152
+ :z-index="9999"
153
+ :initial-index="0"
154
+ :url-list="[imgUrl]"
155
+ :on-close="closeViewer"
156
+ ></el-image-viewer>
157
+ <es-dialog v-else :title="title" :visible.sync="showImg" slot="dialog">
147
158
  <div
148
159
  v-loading="imgChange"
149
160
  element-loading-background="rgba(0, 0, 0, 0.8)"
@@ -393,6 +404,10 @@ export default {
393
404
  default() {
394
405
  return {};
395
406
  }
407
+ },
408
+ previewScale: {
409
+ type: Boolean,
410
+ default: true
396
411
  }
397
412
  },
398
413
  data() {
@@ -500,11 +515,10 @@ export default {
500
515
  return false;
501
516
  },
502
517
  isDisabled() {
503
- if (this.readonly || this.disabled) {
504
- return true;
505
- } else {
506
- return false;
507
- }
518
+ return this.disabled || (this.elForm || {}).disabled;
519
+ },
520
+ isReadonly() {
521
+ return this.readonly || (this.elForm || {}).readonly;
508
522
  },
509
523
  isRemove() {
510
524
  if (this.remove || this.deleted) {
@@ -513,7 +527,7 @@ export default {
513
527
  return false;
514
528
  },
515
529
  isSort() {
516
- return this.dragSort && !this.isDisabled;
530
+ return this.dragSort && !this.isDisabled && this.isReadonly;
517
531
  },
518
532
  datas() {
519
533
  if (this.data) {
@@ -806,11 +820,12 @@ export default {
806
820
  suffix.includes('gif') ||
807
821
  suffix.includes('png')
808
822
  ) {
809
- this.imgUrl =
810
- this.host +
811
- (url ? url : this.previewAdjunct) +
812
- '?adjunctId=' +
813
- file.adjunctId;
823
+ this.imgUrl = res.url
824
+ ? res.url
825
+ : this.host +
826
+ (url ? url : this.previewAdjunct) +
827
+ '?adjunctId=' +
828
+ file.adjunctId;
814
829
  this.title = file.originalName;
815
830
  this.showImg = true;
816
831
  this.$nextTick(() => {
@@ -840,32 +855,36 @@ export default {
840
855
  }
841
856
  }
842
857
  },
858
+ closeViewer() {
859
+ this.showImg = false;
860
+ },
843
861
  loadImage() {
844
- this.$refs.showImg.onload = () => {
845
- this.imgChange = false;
846
- let w = this.$refs.showImg.naturalWidth;
847
- let h = this.$refs.showImg.naturalHeight;
848
- let pw = this.$refs.showImg.parentNode.offsetWidth;
849
- let ph = this.$refs.showImg.parentNode.offsetHeight;
850
- if (w / h > pw / ph) {
851
- this.styles = { 'max-width': '100%' };
852
- } else {
853
- this.styles = { 'max-height': '100%' };
854
- }
855
- if (w < pw) {
856
- this.styles.width = w + 'px';
857
- }
858
- if (h < ph) {
859
- this.styles.height = h + 'px';
860
- }
861
- };
862
+ this.$refs.showImg &&
863
+ (this.$refs.showImg.onload = () => {
864
+ this.imgChange = false;
865
+ let w = this.$refs.showImg.naturalWidth;
866
+ let h = this.$refs.showImg.naturalHeight;
867
+ let pw = this.$refs.showImg.parentNode.offsetWidth;
868
+ let ph = this.$refs.showImg.parentNode.offsetHeight;
869
+ if (w / h > pw / ph) {
870
+ this.styles = { 'max-width': '100%' };
871
+ } else {
872
+ this.styles = { 'max-height': '100%' };
873
+ }
874
+ if (w < pw) {
875
+ this.styles.width = w + 'px';
876
+ }
877
+ if (h < ph) {
878
+ this.styles.height = h + 'px';
879
+ }
880
+ });
862
881
  },
863
882
  isLt(file) {
864
883
  let flag = false;
865
884
  let flieArr = file.name.split('.');
866
- let suffix = '.' + flieArr[flieArr.length - 1];
885
+ let suffix = '.' + flieArr[flieArr.length - 1].toLowerCase();
867
886
  if (this.accepts) {
868
- let accepts = this.accepts.split(',');
887
+ let accepts = this.accepts.toLowerCase().split(',');
869
888
  flag = accepts.includes(suffix);
870
889
  if (!flag) {
871
890
  this.$message.error(`文件类型错误,请上传${this.accepts}类型文件!`);
package/src/index.js CHANGED
@@ -119,7 +119,7 @@ if (typeof window !== 'undefined' && window.Vue) {
119
119
  }
120
120
 
121
121
  export default {
122
- version: '0.4.57',
122
+ version: '0.4.59',
123
123
  install,
124
124
  Button,
125
125
  ButtonGroup,
package/src/utils/util.js CHANGED
@@ -201,26 +201,36 @@ const ajax = function ({
201
201
  .then(() => {
202
202
  const loginPage = getStorage('login') || getStorage('loginPage');
203
203
  if (loginPage) {
204
- win.top.location.href = loginPage;
205
- } else if (win.top.location.href.indexOf('main.html') > -1) {
204
+ let src;
205
+ if (!startWith(loginPage, ['http', '/'])) {
206
+ let pathname = win.top.location.pathname;
207
+ if (pathname !== '/') {
208
+ pathname = pathname.split('/');
209
+ pathname.splice(pathname.length - 1);
210
+ pathname = pathname.join('/');
211
+ }
212
+ src = pathname + loginPage.replace('./', '');
213
+ } else {
214
+ src = loginPage;
215
+ }
216
+ win.top.location.href = src;
217
+ } else if (
218
+ win.top.location.href.indexOf('main.html') > -1
219
+ ) {
206
220
  win.top.location.href = './login.html';
207
221
  } else {
208
222
  const hash = win.top.location.hash;
209
- if (
210
- hash ||
211
- (win.top.location.indexOf('model=') &&
212
- win.top.location.indexOf('view=') &&
213
- win.top.location.indexOf('render.html'))
214
- ) {
223
+ if (hash) {
215
224
  const len = win.top.location.href.indexOf(hash);
216
- let href = win.top.location.href.slice(0, len) + '#/login';
217
- win.top.location.href = href;
225
+ win.top.location.href =
226
+ win.location.href.slice(0, len) + '#/login';
218
227
  } else {
219
228
  win.top.location.href = '/login.html';
220
229
  }
221
230
  }
222
231
  })
223
232
  .catch(e => {
233
+ sessionStorage.removeItem('remind');
224
234
  });
225
235
  }, 1000));
226
236
  }
@@ -239,6 +249,7 @@ const ajax = function ({
239
249
  return h('es-retrial-auth', {
240
250
  ref: 'auth',
241
251
  props: {
252
+ reload: response.data.results.reload || response.data.results.refresh,
242
253
  group: response.data.results.retrialAuthGroupIds,
243
254
  type: response.data.results.retrialAuthType,
244
255
  msgBox: msgBox