eoss-ui 0.8.41 → 0.8.43

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/lib/selector.js CHANGED
@@ -4689,7 +4689,7 @@ module.exports = require("json-bigint");
4689
4689
  // ESM COMPAT FLAG
4690
4690
  __webpack_require__.r(__webpack_exports__);
4691
4691
 
4692
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/selector/src/main.vue?vue&type=template&id=18a2e4a6&
4692
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/selector/src/main.vue?vue&type=template&id=060f91c3&
4693
4693
  var render = function () {
4694
4694
  var _vm = this
4695
4695
  var _h = _vm.$createElement
@@ -4700,16 +4700,29 @@ var render = function () {
4700
4700
  {
4701
4701
  ref: "esSelector",
4702
4702
  staticClass: "es-selector",
4703
- class: { "is-button": _vm.button && !_vm.readonly },
4703
+ class: { "is-button": _vm.button && !_vm.isReadonly },
4704
+ on: {
4705
+ click: function ($event) {
4706
+ $event.stopPropagation()
4707
+ return _vm.handleClick($event)
4708
+ },
4709
+ },
4704
4710
  },
4705
4711
  [
4706
4712
  _vm.form
4707
4713
  ? [
4708
- _vm.button && !_vm.readonly
4714
+ _vm.button && !_vm.isReadonly
4709
4715
  ? _c(
4710
4716
  "el-button",
4711
4717
  _vm._b(
4712
- { on: { click: _vm.openDialog } },
4718
+ {
4719
+ on: {
4720
+ click: function ($event) {
4721
+ $event.stopPropagation()
4722
+ return _vm.openDialog($event)
4723
+ },
4724
+ },
4725
+ },
4713
4726
  "el-button",
4714
4727
  _vm.button,
4715
4728
  false
@@ -4724,13 +4737,13 @@ var render = function () {
4724
4737
  2
4725
4738
  )
4726
4739
  : [
4727
- !(_vm.multiple && _vm.readonly)
4740
+ !(_vm.multiple && _vm.isReadonly)
4728
4741
  ? _c(
4729
4742
  "el-autocomplete",
4730
4743
  {
4731
4744
  attrs: {
4732
4745
  "value-key": "showname",
4733
- readonly: _vm.readonly,
4746
+ readonly: _vm.isReadonly || !this.isSearch,
4734
4747
  "fetch-suggestions": _vm.search,
4735
4748
  placeholder: _vm.placeholder,
4736
4749
  "trigger-on-focus": false,
@@ -4749,7 +4762,7 @@ var render = function () {
4749
4762
  },
4750
4763
  },
4751
4764
  [
4752
- !_vm.readonly
4765
+ !_vm.isReadonly
4753
4766
  ? _c("el-button", {
4754
4767
  staticClass: "es-selector-btn",
4755
4768
  attrs: {
@@ -4777,7 +4790,7 @@ var render = function () {
4777
4790
  ref: "tags",
4778
4791
  staticClass: "es-select__tags",
4779
4792
  class: {
4780
- "is-edit": !_vm.readonly,
4793
+ "is-edit": !_vm.isReadonly,
4781
4794
  "is-show": _vm.selected.length,
4782
4795
  },
4783
4796
  },
@@ -4789,7 +4802,7 @@ var render = function () {
4789
4802
  attrs: {
4790
4803
  closable:
4791
4804
  !_vm.selectorDisabled &&
4792
- !_vm.readonly &&
4805
+ !_vm.isReadonly &&
4793
4806
  _vm.selected.length > _vm.min,
4794
4807
  type: "info",
4795
4808
  "disable-transitions": "",
@@ -4815,7 +4828,7 @@ var render = function () {
4815
4828
  ],
4816
4829
  ]
4817
4830
  : _vm._e(),
4818
- !_vm.readonly
4831
+ !_vm.isReadonly
4819
4832
  ? _c(
4820
4833
  "es-dialog",
4821
4834
  {
@@ -4890,7 +4903,7 @@ var staticRenderFns = []
4890
4903
  render._withStripped = true
4891
4904
 
4892
4905
 
4893
- // CONCATENATED MODULE: ./packages/selector/src/main.vue?vue&type=template&id=18a2e4a6&
4906
+ // CONCATENATED MODULE: ./packages/selector/src/main.vue?vue&type=template&id=060f91c3&
4894
4907
 
4895
4908
  // EXTERNAL MODULE: ./src/utils/util.js + 1 modules
4896
4909
  var util = __webpack_require__(0);
@@ -4996,6 +5009,13 @@ var external_throttle_debounce_ = __webpack_require__(13);
4996
5009
  //
4997
5010
  //
4998
5011
  //
5012
+ //
5013
+ //
5014
+ //
5015
+ //
5016
+ //
5017
+ //
5018
+ //
4999
5019
 
5000
5020
 
5001
5021
 
@@ -5145,7 +5165,10 @@ var external_throttle_debounce_ = __webpack_require__(13);
5145
5165
  default: true
5146
5166
  },
5147
5167
  //弹窗关闭时是否销毁子组件
5148
- destroyOnClose: Boolean,
5168
+ destroyOnClose: {
5169
+ type: Boolean,
5170
+ default: true
5171
+ },
5149
5172
  //树结构标题
5150
5173
  treeTitle: String,
5151
5174
  //是否显示切换按钮
@@ -5153,7 +5176,12 @@ var external_throttle_debounce_ = __webpack_require__(13);
5153
5176
  type: Boolean,
5154
5177
  default: true
5155
5178
  },
5156
- selection: [Array, String]
5179
+ selection: [Array, String],
5180
+ //输入框是否可搜索
5181
+ isSearch: {
5182
+ type: Boolean,
5183
+ default: true
5184
+ }
5157
5185
  },
5158
5186
  data: function data() {
5159
5187
  return {
@@ -5173,6 +5201,9 @@ var external_throttle_debounce_ = __webpack_require__(13);
5173
5201
  },
5174
5202
 
5175
5203
  computed: {
5204
+ isReadonly: function isReadonly() {
5205
+ return this.readonly || (this.elForm || {}).readonly;
5206
+ },
5176
5207
  isRender: function isRender() {
5177
5208
  var useCaseCodes = util["a" /* default */].getStorage('useCaseCodes');
5178
5209
  if (useCaseCodes && this.useCaseCode) {
@@ -5260,11 +5291,6 @@ var external_throttle_debounce_ = __webpack_require__(13);
5260
5291
  _this2.$refs.reference && (_this2.minWidth = _this2.$refs.reference.$el.children[0].offsetWidth);
5261
5292
  });
5262
5293
  }
5263
- if (this.$refs.openDialog) {
5264
- this.$refs.openDialog.$el.parentNode.addEventListener('click', function () {
5265
- _this2.openDialog();
5266
- });
5267
- }
5268
5294
  },
5269
5295
 
5270
5296
  methods: {
@@ -5295,8 +5321,14 @@ var external_throttle_debounce_ = __webpack_require__(13);
5295
5321
  getValueKey: function getValueKey(obj) {
5296
5322
  return util["a" /* default */].isObject(obj) ? obj[this.valueKey] : obj;
5297
5323
  },
5324
+ handleClick: function handleClick() {
5325
+ console.log('handleClick');
5326
+ if (!this.isSearch) {
5327
+ this.openDialog();
5328
+ }
5329
+ },
5298
5330
  openDialog: function openDialog() {
5299
- if (!this.selectorDisabled && !this.readonly && this.select) {
5331
+ if (!this.selectorDisabled && !this.isReadonly && this.select) {
5300
5332
  this.visible = true;
5301
5333
  }
5302
5334
  },
@@ -5462,7 +5494,7 @@ var external_throttle_debounce_ = __webpack_require__(13);
5462
5494
  }
5463
5495
  }
5464
5496
  if (height) {
5465
- if (_this4.readonly) {
5497
+ if (_this4.isReadonly) {
5466
5498
  _this4.$refs.reference.style.height = height;
5467
5499
  } else {
5468
5500
  var inputChildNodes = _this4.$refs.reference.$el.childNodes;
package/lib/upload.js CHANGED
@@ -4750,8 +4750,8 @@ module.exports = require("spark-md5");
4750
4750
  // ESM COMPAT FLAG
4751
4751
  __webpack_require__.r(__webpack_exports__);
4752
4752
 
4753
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=template&id=2e5de86a&
4754
- var mainvue_type_template_id_2e5de86a_render = function () {
4753
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=template&id=7388a79d&
4754
+ var mainvue_type_template_id_7388a79d_render = function () {
4755
4755
  var _vm = this
4756
4756
  var _h = _vm.$createElement
4757
4757
  var _c = _vm._self._c || _h
@@ -5135,10 +5135,10 @@ var mainvue_type_template_id_2e5de86a_render = function () {
5135
5135
  : _vm._e()
5136
5136
  }
5137
5137
  var staticRenderFns = []
5138
- mainvue_type_template_id_2e5de86a_render._withStripped = true
5138
+ mainvue_type_template_id_7388a79d_render._withStripped = true
5139
5139
 
5140
5140
 
5141
- // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=template&id=2e5de86a&
5141
+ // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=template&id=7388a79d&
5142
5142
 
5143
5143
  // EXTERNAL MODULE: ./src/config/api.js
5144
5144
  var api = __webpack_require__(1);
@@ -6324,6 +6324,7 @@ var _props;
6324
6324
  handleSort: function handleSort(files) {
6325
6325
  var _this10 = this;
6326
6326
 
6327
+ console.log('files', files);
6327
6328
  if (this.isSort) {
6328
6329
  if (this.onSort) {
6329
6330
  this.onSort(files);
@@ -6417,7 +6418,18 @@ var _props;
6417
6418
  this.onRemove && this.onRemove(file, fileList);
6418
6419
  },
6419
6420
  handleError: function handleError(err, file, fileList) {
6420
- var errorMsg = err.response && err.response.data && err.response.data.msg;
6421
+ console.log('err', err);
6422
+ console.log('type', typeof err === 'undefined' ? 'undefined' : _typeof(err));
6423
+ var errorMsg = '';
6424
+ try {
6425
+ var raw = err.message || '';
6426
+ var jsonStr = raw.replace(/^Error:\s*/, '');
6427
+ var parsed = JSON.parse(jsonStr);
6428
+ errorMsg = parsed.msg || parsed.message || '';
6429
+ } catch (e) {
6430
+ errorMsg = err.message || err.msg || '上传失败:请联系管理员';
6431
+ }
6432
+ errorMsg = errorMsg || err.msg || err.message || '上传失败:请联系管理员';
6421
6433
  if (this.showMessage.error) {
6422
6434
  if (this.dangerouslyUseHTMLString) {
6423
6435
  this.$alert(errorMsg ? errorMsg : err.msg ? err.msg : '上传失败:请联系管理员', '提示', {
@@ -6770,7 +6782,7 @@ var componentNormalizer = __webpack_require__(3);
6770
6782
 
6771
6783
  var component = Object(componentNormalizer["a" /* default */])(
6772
6784
  src_mainvue_type_script_lang_js_,
6773
- mainvue_type_template_id_2e5de86a_render,
6785
+ mainvue_type_template_id_7388a79d_render,
6774
6786
  staticRenderFns,
6775
6787
  false,
6776
6788
  null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.8.41",
3
+ "version": "0.8.43",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@interactjs/feedback": "^1.10.3",
57
57
  "axios": "^0.27.2",
58
- "eoss-element": "^0.3.77",
58
+ "eoss-element": "^0.3.79",
59
59
  "interactjs": "^1.10.26",
60
60
  "js-base64": "^3.7.5",
61
61
  "json-bigint": "^1.0.0",
@@ -1187,6 +1187,7 @@
1187
1187
  :opinion="value"
1188
1188
  :businessName="businessName"
1189
1189
  :type="taskReadType"
1190
+ :resetAppId="resetAppId"
1190
1191
  :showTooltip="showTooltip"
1191
1192
  :flowLabelConfig="flowLabelConfig"
1192
1193
  :hideMessage="hideMessage"
@@ -1,12 +1,17 @@
1
1
  <template>
2
2
  <div
3
+ @click.stop="handleClick"
3
4
  v-if="isRender"
4
5
  class="es-selector"
5
6
  ref="esSelector"
6
- :class="{ 'is-button': button && !readonly }"
7
+ :class="{ 'is-button': button && !isReadonly }"
7
8
  >
8
9
  <template v-if="form">
9
- <el-button v-if="button && !readonly" v-bind="button" @click="openDialog">
10
+ <el-button
11
+ v-if="button && !isReadonly"
12
+ v-bind="button"
13
+ @click.stop="openDialog"
14
+ >
10
15
  <slot>
11
16
  <es-icon v-if="icon" :contents="icon"></es-icon>
12
17
  <template v-else>选择</template>
@@ -14,10 +19,10 @@
14
19
  </el-button>
15
20
  <template v-else>
16
21
  <el-autocomplete
17
- v-if="!(multiple && readonly)"
22
+ v-if="!(multiple && isReadonly)"
18
23
  v-model="selectedLabel"
19
24
  value-key="showname"
20
- :readonly="readonly"
25
+ :readonly="isReadonly || !this.isSearch"
21
26
  :fetch-suggestions="search"
22
27
  :placeholder="placeholder"
23
28
  :trigger-on-focus="false"
@@ -26,7 +31,7 @@
26
31
  @change="handleChange"
27
32
  >
28
33
  <el-button
29
- v-if="!readonly"
34
+ v-if="!isReadonly"
30
35
  slot="suffix"
31
36
  type="text"
32
37
  class="es-selector-btn"
@@ -38,12 +43,14 @@
38
43
  v-if="multiple"
39
44
  ref="tags"
40
45
  class="es-select__tags"
41
- :class="{ 'is-edit': !readonly, 'is-show': selected.length }"
46
+ :class="{ 'is-edit': !isReadonly, 'is-show': selected.length }"
42
47
  >
43
48
  <el-tag
44
49
  v-for="(item, index) in selected"
45
50
  :key="getValueKey(item)"
46
- :closable="!selectorDisabled && !readonly && selected.length > min"
51
+ :closable="
52
+ !selectorDisabled && !isReadonly && selected.length > min
53
+ "
47
54
  type="info"
48
55
  disable-transitions
49
56
  @close="deleteTag($event, item, index)"
@@ -54,7 +61,7 @@
54
61
  </template>
55
62
  </template>
56
63
  <es-dialog
57
- v-if="!readonly"
64
+ v-if="!isReadonly"
58
65
  :title="title"
59
66
  :visible.sync="visible"
60
67
  :width="width"
@@ -237,7 +244,10 @@ export default {
237
244
  default: true
238
245
  },
239
246
  //弹窗关闭时是否销毁子组件
240
- destroyOnClose: Boolean,
247
+ destroyOnClose: {
248
+ type: Boolean,
249
+ default: true
250
+ },
241
251
  //树结构标题
242
252
  treeTitle: String,
243
253
  //是否显示切换按钮
@@ -245,7 +255,12 @@ export default {
245
255
  type: Boolean,
246
256
  default: true
247
257
  },
248
- selection: [Array, String]
258
+ selection: [Array, String],
259
+ //输入框是否可搜索
260
+ isSearch: {
261
+ type: Boolean,
262
+ default: true
263
+ }
249
264
  },
250
265
  data() {
251
266
  return {
@@ -264,6 +279,9 @@ export default {
264
279
  };
265
280
  },
266
281
  computed: {
282
+ isReadonly() {
283
+ return this.readonly || (this.elForm || {}).readonly;
284
+ },
267
285
  isRender() {
268
286
  let useCaseCodes = util.getStorage('useCaseCodes');
269
287
  if (useCaseCodes && this.useCaseCode) {
@@ -352,11 +370,6 @@ export default {
352
370
  (this.minWidth = this.$refs.reference.$el.children[0].offsetWidth);
353
371
  });
354
372
  }
355
- if (this.$refs.openDialog) {
356
- this.$refs.openDialog.$el.parentNode.addEventListener('click', () => {
357
- this.openDialog();
358
- });
359
- }
360
373
  },
361
374
  methods: {
362
375
  getSysParam() {
@@ -388,8 +401,14 @@ export default {
388
401
  getValueKey(obj) {
389
402
  return util.isObject(obj) ? obj[this.valueKey] : obj;
390
403
  },
404
+ handleClick() {
405
+ console.log('handleClick');
406
+ if (!this.isSearch) {
407
+ this.openDialog();
408
+ }
409
+ },
391
410
  openDialog() {
392
- if (!this.selectorDisabled && !this.readonly && this.select) {
411
+ if (!this.selectorDisabled && !this.isReadonly && this.select) {
393
412
  this.visible = true;
394
413
  }
395
414
  },
@@ -573,7 +592,7 @@ export default {
573
592
  }
574
593
  }
575
594
  if (height) {
576
- if (this.readonly) {
595
+ if (this.isReadonly) {
577
596
  this.$refs.reference.style.height = height;
578
597
  } else {
579
598
  let inputChildNodes = this.$refs.reference.$el.childNodes;
@@ -1353,6 +1353,7 @@ export default {
1353
1353
  a.dispatchEvent(event);
1354
1354
  },
1355
1355
  handleSort(files) {
1356
+ console.log('files', files);
1356
1357
  if (this.isSort) {
1357
1358
  if (this.onSort) {
1358
1359
  this.onSort(files);
@@ -1461,7 +1462,18 @@ export default {
1461
1462
  this.onRemove && this.onRemove(file, fileList);
1462
1463
  },
1463
1464
  handleError(err, file, fileList) {
1464
- let errorMsg = err.response && err.response.data && err.response.data.msg;
1465
+ console.log('err', err);
1466
+ console.log('type', typeof err);
1467
+ let errorMsg = '';
1468
+ try {
1469
+ const raw = err.message || '';
1470
+ const jsonStr = raw.replace(/^Error:\s*/, '');
1471
+ const parsed = JSON.parse(jsonStr);
1472
+ errorMsg = parsed.msg || parsed.message || '';
1473
+ } catch (e) {
1474
+ errorMsg = err.message || err.msg || '上传失败:请联系管理员';
1475
+ }
1476
+ errorMsg = errorMsg || err.msg || err.message || '上传失败:请联系管理员';
1465
1477
  if (this.showMessage.error) {
1466
1478
  if (this.dangerouslyUseHTMLString) {
1467
1479
  this.$alert(
package/src/index.js CHANGED
@@ -127,7 +127,7 @@ if (typeof window !== 'undefined' && window.Vue) {
127
127
  }
128
128
 
129
129
  export default {
130
- version: '0.8.41',
130
+ version: '0.8.43',
131
131
  install,
132
132
  Archives,
133
133
  Button,