eoss-ui 0.5.81-beta16 → 0.5.81-beta17

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/main.js CHANGED
@@ -3975,8 +3975,8 @@ render._withStripped = true
3975
3975
 
3976
3976
  // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=d62e142c&
3977
3977
 
3978
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/simplicity/index.vue?vue&type=template&id=46b7eb38&scoped=true&
3979
- var simplicityvue_type_template_id_46b7eb38_scoped_true_render = function () {
3978
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/simplicity/index.vue?vue&type=template&id=41b0483a&scoped=true&
3979
+ var simplicityvue_type_template_id_41b0483a_scoped_true_render = function () {
3980
3980
  var _vm = this
3981
3981
  var _h = _vm.$createElement
3982
3982
  var _c = _vm._self._c || _h
@@ -4585,11 +4585,11 @@ var simplicityvue_type_template_id_46b7eb38_scoped_true_render = function () {
4585
4585
  ),
4586
4586
  ])
4587
4587
  }
4588
- var simplicityvue_type_template_id_46b7eb38_scoped_true_staticRenderFns = []
4589
- simplicityvue_type_template_id_46b7eb38_scoped_true_render._withStripped = true
4588
+ var simplicityvue_type_template_id_41b0483a_scoped_true_staticRenderFns = []
4589
+ simplicityvue_type_template_id_41b0483a_scoped_true_render._withStripped = true
4590
4590
 
4591
4591
 
4592
- // CONCATENATED MODULE: ./packages/main/src/simplicity/index.vue?vue&type=template&id=46b7eb38&scoped=true&
4592
+ // CONCATENATED MODULE: ./packages/main/src/simplicity/index.vue?vue&type=template&id=41b0483a&scoped=true&
4593
4593
 
4594
4594
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/simplicity/avatar.vue?vue&type=template&id=1560e8bf&scoped=true&
4595
4595
  var avatarvue_type_template_id_1560e8bf_scoped_true_render = function () {
@@ -9774,6 +9774,8 @@ var events = [function (tabs, index, that) {
9774
9774
  * @date 2024年9月7日
9775
9775
  **/
9776
9776
  handlerClickMenu: function handlerClickMenu(res) {
9777
+ var _this5 = this;
9778
+
9777
9779
  if (this.recordApp) {
9778
9780
  utils_util["a" /* default */].ajax({
9779
9781
  url: api["mb" /* recordUserApp */],
@@ -9793,6 +9795,16 @@ var events = [function (tabs, index, that) {
9793
9795
  } else {
9794
9796
  if (res.method == 'iframe') {
9795
9797
  res.url = utils_util["a" /* default */].handlerUrl(res.url);
9798
+ } else {
9799
+ var _tab6 = this.tabs[i];
9800
+ if (_tab6.method === 'iframe') {
9801
+ this.$set(this.tabs[i], 'url', utils_util["a" /* default */].handlerUrl(_tab6.url));
9802
+ } else {
9803
+ this.$set(this.tabs[i], 'refresh', false);
9804
+ this.$nextTick(function () {
9805
+ _this5.$set(_this5.tabs[i], 'refresh', true);
9806
+ });
9807
+ }
9796
9808
  }
9797
9809
  }
9798
9810
  },
@@ -9843,15 +9855,23 @@ var events = [function (tabs, index, that) {
9843
9855
  * @date 2024年9月7日
9844
9856
  **/
9845
9857
  handleRefresh: function handleRefresh() {
9858
+ var _this6 = this;
9859
+
9846
9860
  var i = utils_util["a" /* default */].indexOfObj(this.tabs, this.activeName, 'id');
9847
9861
  var tab = this.tabs[i];
9848
9862
  if (tab.method === 'iframe') {
9849
9863
  tab.url = utils_util["a" /* default */].handlerUrl(tab.url);
9864
+ } else {
9865
+ var _tab7 = this.tabs[i];
9866
+ if (_tab7.method === 'iframe') {
9867
+ this.$set(this.tabs[i], 'url', utils_util["a" /* default */].handlerUrl(_tab7.url));
9868
+ } else {
9869
+ this.$set(this.tabs[i], 'refresh', false);
9870
+ this.$nextTick(function () {
9871
+ _this6.$set(_this6.tabs[i], 'refresh', true);
9872
+ });
9873
+ }
9850
9874
  }
9851
- tab.refresh = false;
9852
- this.$nextTick(function () {
9853
- tab.refresh = true;
9854
- });
9855
9875
  },
9856
9876
 
9857
9877
  /**
@@ -9929,6 +9949,8 @@ var events = [function (tabs, index, that) {
9929
9949
  * @date 2024年9月7日
9930
9950
  **/
9931
9951
  handleClick: function handleClick(res) {
9952
+ var _this7 = this;
9953
+
9932
9954
  var type = res.type,
9933
9955
  event = res.event,
9934
9956
  open = res.open,
@@ -9939,7 +9961,7 @@ var events = [function (tabs, index, that) {
9939
9961
  } else if (open) {
9940
9962
  utils_util["a" /* default */].win.open(open);
9941
9963
  } else if (link) {
9942
- utils_util["a" /* default */].win.location.href = link;
9964
+ utils_util["a" /* default */].win.open(link, '_self');
9943
9965
  } else {
9944
9966
  switch (type) {
9945
9967
  case 'quit':
@@ -9963,15 +9985,23 @@ var events = [function (tabs, index, that) {
9963
9985
  this.showMsg = false;
9964
9986
  break;
9965
9987
  case 'home':
9966
- if (this.homePage.id !== this.activeName) {
9967
- var i = utils_util["a" /* default */].indexOfObj(this.tabs, this.homePage.id, 'id');
9968
- if (i == -1) {
9969
- this.tabs.unshift(this.homePage);
9988
+ var i = utils_util["a" /* default */].indexOfObj(this.tabs, this.homePage.id, 'id');
9989
+ if (i == -1) {
9990
+ this.tabs.unshift(this.homePage);
9991
+ } else {
9992
+ var tab = this.tabs[i];
9993
+ if (tab.method === 'iframe') {
9994
+ this.$set(this.tabs[i], 'url', utils_util["a" /* default */].handlerUrl(tab.url));
9995
+ } else {
9996
+ this.$set(this.tabs[i], 'refresh', false);
9997
+ this.$nextTick(function () {
9998
+ _this7.$set(_this7.tabs[i], 'refresh', true);
9999
+ });
9970
10000
  }
9971
- this.activeName = this.homePage.id;
9972
- this.showMsg = false;
9973
- this.showSet = false;
9974
10001
  }
10002
+ this.activeName = this.homePage.id;
10003
+ this.showMsg = false;
10004
+ this.showSet = false;
9975
10005
  break;
9976
10006
  case 'search':
9977
10007
  this.handlerSetDrawer(res);
@@ -9992,7 +10022,7 @@ var events = [function (tabs, index, that) {
9992
10022
  * @date 2024年9月7日
9993
10023
  **/
9994
10024
  handleQuit: function handleQuit() {
9995
- var _this5 = this;
10025
+ var _this8 = this;
9996
10026
 
9997
10027
  this.$confirm('确定注销吗?', '退出系统', {
9998
10028
  confirmButtonText: '确定',
@@ -10002,8 +10032,8 @@ var events = [function (tabs, index, that) {
10002
10032
  utils_util["a" /* default */].ajax({ method: 'post', url: api["eb" /* logout */] }).then(function (res) {
10003
10033
  if (res.rCode == 0) {
10004
10034
  utils_util["a" /* default */].removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'auth', 'deviceUnique', 'menus', 'useCaseCodes', 'mainConfig', 'jump']);
10005
- if (_this5.onQuit && typeof _this5.onQuit === 'function') {
10006
- _this5.onQuit();
10035
+ if (_this8.onQuit && typeof _this8.onQuit === 'function') {
10036
+ _this8.onQuit();
10007
10037
  } else {
10008
10038
  try {
10009
10039
  var loginPage = utils_util["a" /* default */].getStorage('login') || utils_util["a" /* default */].getStorage('loginPage');
@@ -10041,7 +10071,7 @@ var events = [function (tabs, index, that) {
10041
10071
  }
10042
10072
  }).catch(function (err) {
10043
10073
  if (err.message && err.message !== 'canceled') {
10044
- _this5.$message.error(err.message);
10074
+ _this8.$message.error(err.message);
10045
10075
  }
10046
10076
  });
10047
10077
  }).catch(function (e) {});
@@ -10086,19 +10116,21 @@ var events = [function (tabs, index, that) {
10086
10116
  * @date 2024年9月7日
10087
10117
  **/
10088
10118
  handleOpened: function handleOpened(res) {
10089
- var _this6 = this;
10119
+ var _this9 = this;
10090
10120
 
10091
10121
  if (res === undefined) {
10092
10122
  this.sysMsg = [];
10093
10123
  } else if (res == false && this.sysMsg.length) {
10094
10124
  this.sysMsgOut = setTimeout(function () {
10095
- _this6.sysMsg = [];
10125
+ _this9.sysMsg = [];
10096
10126
  }, 3000);
10097
10127
  } else if (this.sysMsgOut) {
10098
10128
  clearTimeout(this.sysMsgOut);
10099
10129
  }
10100
10130
  },
10101
10131
  jumpMenu: function jumpMenu(res) {
10132
+ var _this10 = this;
10133
+
10102
10134
  var apps = res;
10103
10135
  if (typeof res === 'string') {
10104
10136
  apps = res.split(',');
@@ -10111,6 +10143,16 @@ var events = [function (tabs, index, that) {
10111
10143
  if (i == -1) {
10112
10144
  var tab = this.setIframeType(obj);
10113
10145
  this.tabs.splice(n + 1, 0, tab);
10146
+ } else {
10147
+ var _tab8 = this.tabs[i];
10148
+ if (_tab8.method === 'iframe') {
10149
+ this.$set(this.tabs[i], 'url', utils_util["a" /* default */].handlerUrl(_tab8.url));
10150
+ } else {
10151
+ this.$set(this.tabs[i], 'refresh', false);
10152
+ this.$nextTick(function () {
10153
+ _this10.$set(_this10.tabs[i], 'refresh', true);
10154
+ });
10155
+ }
10114
10156
  }
10115
10157
  } else {
10116
10158
  this.$message.error('没有此菜单!');
@@ -10119,13 +10161,13 @@ var events = [function (tabs, index, that) {
10119
10161
 
10120
10162
  //监听改变菜单
10121
10163
  handleListener: function handleListener() {
10122
- var _this7 = this;
10164
+ var _this11 = this;
10123
10165
 
10124
10166
  utils_util["a" /* default */].win.addEventListener('message', function (e) {
10125
10167
  var msg = e.data;
10126
10168
  if (msg.key == 'jump_Menu') {
10127
10169
  var res = msg.data1;
10128
- _this7.jumpMenu(res);
10170
+ _this11.jumpMenu(res);
10129
10171
  }
10130
10172
  }, false);
10131
10173
  }
@@ -10150,11 +10192,11 @@ var events = [function (tabs, index, that) {
10150
10192
 
10151
10193
  var simplicity_component = Object(componentNormalizer["a" /* default */])(
10152
10194
  src_simplicityvue_type_script_lang_js_,
10153
- simplicityvue_type_template_id_46b7eb38_scoped_true_render,
10154
- simplicityvue_type_template_id_46b7eb38_scoped_true_staticRenderFns,
10195
+ simplicityvue_type_template_id_41b0483a_scoped_true_render,
10196
+ simplicityvue_type_template_id_41b0483a_scoped_true_staticRenderFns,
10155
10197
  false,
10156
10198
  null,
10157
- "46b7eb38",
10199
+ "41b0483a",
10158
10200
  null
10159
10201
 
10160
10202
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.5.81-beta16",
3
+ "version": "0.5.81-beta17",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -10,10 +10,49 @@
10
10
  :rules="isNotRule(scope) ? [] : rules"
11
11
  :index="scope.$index"
12
12
  >
13
+ <component
14
+ v-if="getType(scope.row.formConfigs, 'component')"
15
+ :is="tag"
16
+ v-bind="formOption"
17
+ v-model="scope.row[field || prop]"
18
+ :data="getData(scope.row.formOptions)"
19
+ @blur="
20
+ (event) => {
21
+ handleBlur({
22
+ item: config,
23
+ event: event,
24
+ data: scope.row,
25
+ scope: scope
26
+ });
27
+ }
28
+ "
29
+ @focus="
30
+ (event) => {
31
+ handleFocus({
32
+ item: config,
33
+ event: event,
34
+ data: scope.row,
35
+ scope: scope
36
+ });
37
+ }
38
+ "
39
+ @change="
40
+ (value) => {
41
+ handleChange({
42
+ item: config,
43
+ name: field || prop,
44
+ value: value,
45
+ data: scope.row,
46
+ scope: scope
47
+ });
48
+ }
49
+ "
50
+ ></component>
13
51
  <es-select
14
- v-if="type === 'select'"
52
+ v-else-if="getType(scope.row.formConfigs, 'select')"
15
53
  v-bind="formOption"
16
54
  v-model="scope.row[field || prop]"
55
+ :data="getData(scope.row.formOptions)"
17
56
  @blur="
18
57
  (event) => {
19
58
  handleBlur({
@@ -45,11 +84,13 @@
45
84
  });
46
85
  }
47
86
  "
48
- ></es-select>
87
+ >
88
+ </es-select>
49
89
  <es-cascader
50
- v-else-if="type == 'cascader'"
90
+ v-else-if="getType(scope.row.formConfigs, 'cascader')"
51
91
  v-bind="formOption"
52
92
  v-model="scope.row[field || prop]"
93
+ :data="getData(scope.row.formOptions)"
53
94
  @blur="
54
95
  (event) => {
55
96
  handleBlur({
@@ -84,10 +125,10 @@
84
125
  >
85
126
  </es-cascader>
86
127
  <es-select-ganged
87
- v-else-if="type === 'ganged'"
128
+ v-else-if="getType(scope.row.formConfigs, 'ganged')"
88
129
  v-bind="formOption"
89
130
  v-model="scope.row[field || prop]"
90
- :data="init(option, config)"
131
+ :data="init(getData(scope.row.formOptions), config)"
91
132
  @change="
92
133
  (value) => {
93
134
  handleChange({
@@ -98,11 +139,13 @@
98
139
  });
99
140
  }
100
141
  "
101
- ></es-select-ganged>
142
+ >
143
+ </es-select-ganged>
102
144
  <es-radio-group
103
- v-else-if="type === 'radio'"
145
+ v-else-if="getType(scope.row.formConfigs, 'radio')"
104
146
  v-bind="formOption"
105
147
  v-model="scope.row[field || prop]"
148
+ :data="getData(scope.row.formOptions)"
106
149
  @change="
107
150
  (value) => {
108
151
  handleChange({
@@ -113,11 +156,13 @@
113
156
  });
114
157
  }
115
158
  "
116
- ></es-radio-group>
159
+ >
160
+ </es-radio-group>
117
161
  <es-checkbox-group
118
- v-else-if="type === 'checkbox'"
162
+ v-else-if="getType(scope.row.formConfigs, 'checkbox')"
119
163
  v-bind="formOption"
120
164
  v-model="scope.row[field || prop]"
165
+ :data="getData(scope.row.formOptions)"
121
166
  @change="
122
167
  (value) => {
123
168
  handleChange({
@@ -128,11 +173,13 @@
128
173
  });
129
174
  }
130
175
  "
131
- ></es-checkbox-group>
176
+ >
177
+ </es-checkbox-group>
132
178
  <es-switch
133
- v-else-if="type === 'switch'"
179
+ v-else-if="getType(scope.row.formConfigs, 'switch')"
134
180
  v-bind="formOption"
135
181
  v-model="scope.row[field || prop]"
182
+ :data="getData(scope.row.formOptions)"
136
183
  @change="
137
184
  (value) => {
138
185
  handleChange({
@@ -143,22 +190,25 @@
143
190
  });
144
191
  }
145
192
  "
146
- ></es-switch>
193
+ >
194
+ </es-switch>
147
195
  <es-date-picker
148
196
  v-else-if="
149
197
  config.date ||
150
- type == 'date' ||
151
- type == 'year' ||
152
- type == 'month' ||
153
- type == 'date' ||
154
- type == 'dates' ||
155
- type == 'week' ||
156
- type == 'datetime' ||
157
- type == 'datetimerange' ||
158
- type == 'daterange' ||
159
- type == 'monthrange' ||
160
- type == 'quarter' ||
161
- type == 'halfyear'
198
+ getType(scope.row.formConfigs, [
199
+ 'date',
200
+ 'year',
201
+ 'month',
202
+ 'date',
203
+ 'dates',
204
+ 'week',
205
+ 'datetime',
206
+ 'datetimerange',
207
+ 'daterange',
208
+ 'monthrange',
209
+ 'quarter',
210
+ 'halfyear'
211
+ ])
162
212
  "
163
213
  v-bind="formOption"
164
214
  v-model="scope.row[field || prop]"
@@ -194,9 +244,10 @@
194
244
  });
195
245
  }
196
246
  "
197
- ></es-date-picker>
247
+ >
248
+ </es-date-picker>
198
249
  <es-input-number
199
- v-else-if="type == 'number'"
250
+ v-else-if="getType(scope.row.formConfigs, 'number')"
200
251
  v-bind="formOption"
201
252
  v-model="scope.row[field || prop]"
202
253
  @blur="
@@ -230,9 +281,10 @@
230
281
  });
231
282
  }
232
283
  "
233
- ></es-input-number>
284
+ >
285
+ </es-input-number>
234
286
  <es-selector
235
- v-else-if="type == 'selector'"
287
+ v-else-if="getType(scope.row.formConfigs, 'selector')"
236
288
  v-bind="formOption"
237
289
  v-model="scope.row[field || prop]"
238
290
  v-on="
@@ -251,15 +303,16 @@
251
303
  });
252
304
  }
253
305
  "
254
- ></es-selector>
306
+ >
307
+ </es-selector>
255
308
  <template
256
309
  v-else-if="
257
- type === 'text' || type === 'input' || type === 'textarea'
310
+ getType(scope.row.formConfigs, ['text', 'input', 'textarea'])
258
311
  "
259
312
  >
260
313
  <template v-if="config.lazy">
261
314
  <input
262
- v-if="type === 'text' || type === 'input'"
315
+ v-if="getType(scope.row.formConfigs, ['text', 'input'])"
263
316
  class="el-input__inner"
264
317
  v-bind="formOption"
265
318
  v-model.lazy="scope.row[field]"
@@ -370,7 +423,8 @@
370
423
  });
371
424
  }
372
425
  "
373
- ></es-input>
426
+ >
427
+ </es-input>
374
428
  </template>
375
429
  </el-form-item>
376
430
  </template>
@@ -460,6 +514,7 @@ export default {
460
514
  }
461
515
  },
462
516
  props: {
517
+ tag: String,
463
518
  mode: String,
464
519
  service: String,
465
520
  form: Boolean,
@@ -584,8 +639,7 @@ export default {
584
639
  : this.valueKey,
585
640
  rules: this.rules,
586
641
  events: this.events,
587
- ...this.$attrs,
588
- data: this.option
642
+ ...this.$attrs
589
643
  };
590
644
  return config;
591
645
  },
@@ -727,6 +781,18 @@ export default {
727
781
  }
728
782
  return data;
729
783
  },
784
+ getType(config, types) {
785
+ let type =
786
+ config && config[this.field || this.prop]
787
+ ? config[this.field || this.prop]
788
+ : this.type;
789
+ return Array.isArray(types) ? types.includes(type) : type == types;
790
+ },
791
+ getData(res) {
792
+ return res && res[this.field || this.prop]
793
+ ? res[this.field || this.prop]
794
+ : this.option;
795
+ },
730
796
  exclAttribute({ data, attrs }) {
731
797
  return util.exclAttribute({ data, attrs });
732
798
  },
@@ -826,10 +892,14 @@ export default {
826
892
  this.$emit('formFocus', data);
827
893
  this.$emit('form-focus', data);
828
894
  },
829
- handleChange(data) {
830
- let { item } = data;
831
- if (item && this.type == 'ganged') {
832
- let { index, value } = data.value;
895
+ handleChange(datas) {
896
+ let { item, name, data } = datas;
897
+ if (
898
+ item &&
899
+ ((data.formConfigs && data.formConfigs[name] == 'ganged') ||
900
+ this.type == 'ganged')
901
+ ) {
902
+ let { index, value } = datas.value;
833
903
  if (
834
904
  (item.url || this.sysCode) &&
835
905
  ((item.ganged && index > item.ganged - 1) || value.hasSub)
@@ -890,9 +960,9 @@ export default {
890
960
  }
891
961
  }
892
962
  }
893
- this.events && this.events.change && this.events.change(data);
894
- this.$emit('formChange', data);
895
- this.$emit('form-change', data);
963
+ this.events && this.events.change && this.events.change(datas);
964
+ this.$emit('formChange', datas);
965
+ this.$emit('form-change', datas);
896
966
  },
897
967
  handleClick(data) {
898
968
  this.$emit('handleClick', data);
@@ -1,16 +1,15 @@
1
1
  <template>
2
2
  <el-form-item
3
- v-if="!(type === 'handle' && !scope.row.hideHandle)"
4
3
  :name="name"
5
4
  :prop="field || prop"
6
- :rules="isNotRule(scope) ? [] : rules"
7
- :index="scope.$index"
5
+ :rules="rules"
6
+ :index="index"
8
7
  >
9
8
  <es-select
10
9
  v-if="type == 'select'"
11
10
  v-bind="formOption"
12
11
  :data="option"
13
- v-model="scope.row[field || prop]"
12
+ v-model="model"
14
13
  @blur="
15
14
  (event) => {
16
15
  handleBlur({
@@ -380,16 +379,33 @@
380
379
 
381
380
  <script>
382
381
  export default {
383
- name: '',
382
+ name: 'FormItem',
384
383
  components: {},
385
384
  props: {
385
+ scope: {},
386
386
  type: String,
387
- scope: {}
387
+ name: String,
388
+ value: {},
389
+ index: [String, Number],
390
+ labelKey: String,
391
+ valueKey: String,
392
+ field: String,
393
+ prop: String,
394
+ rules: [Array, Object]
388
395
  },
389
396
  data() {
390
397
  return {};
391
398
  },
392
- computed: {},
399
+ computed: {
400
+ model: {
401
+ get() {
402
+ return this.value;
403
+ },
404
+ set(val) {
405
+ this.$emit('input', val);
406
+ }
407
+ }
408
+ },
393
409
  watch: {},
394
410
  created() {},
395
411
  mounted() {},
@@ -100,6 +100,7 @@
100
100
  <children
101
101
  v-else
102
102
  :key="item.label || item.title"
103
+ :tag="item.tag"
103
104
  v-bind="{
104
105
  mode: mode,
105
106
  name: name,