@bytenew/bn-applet-ui 1.1.24 → 1.1.25

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.
@@ -6482,6 +6482,63 @@ module.exports = {
6482
6482
  };
6483
6483
 
6484
6484
 
6485
+ /***/ },
6486
+
6487
+ /***/ 3063
6488
+ (module, __unused_webpack_exports, __webpack_require__) {
6489
+
6490
+ "use strict";
6491
+
6492
+ // https://github.com/zloirock/core-js/issues/280
6493
+ var userAgent = __webpack_require__(2839);
6494
+
6495
+ module.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
6496
+
6497
+
6498
+ /***/ },
6499
+
6500
+ /***/ 533
6501
+ (module, __unused_webpack_exports, __webpack_require__) {
6502
+
6503
+ "use strict";
6504
+
6505
+ var uncurryThis = __webpack_require__(9504);
6506
+ var toLength = __webpack_require__(8014);
6507
+ var toString = __webpack_require__(655);
6508
+ var $repeat = __webpack_require__(2333);
6509
+ var requireObjectCoercible = __webpack_require__(7750);
6510
+
6511
+ var repeat = uncurryThis($repeat);
6512
+ var stringSlice = uncurryThis(''.slice);
6513
+ var ceil = Math.ceil;
6514
+
6515
+ // `String.prototype.{ padStart, padEnd }` methods implementation
6516
+ var createMethod = function (IS_END) {
6517
+ return function ($this, maxLength, fillString) {
6518
+ var S = toString(requireObjectCoercible($this));
6519
+ var intMaxLength = toLength(maxLength);
6520
+ var stringLength = S.length;
6521
+ if (intMaxLength <= stringLength) return S;
6522
+ var fillStr = fillString === undefined ? ' ' : toString(fillString);
6523
+ var fillLen, stringFiller;
6524
+ if (fillStr === '') return S;
6525
+ fillLen = intMaxLength - stringLength;
6526
+ stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));
6527
+ if (stringFiller.length > fillLen) stringFiller = stringSlice(stringFiller, 0, fillLen);
6528
+ return IS_END ? S + stringFiller : stringFiller + S;
6529
+ };
6530
+ };
6531
+
6532
+ module.exports = {
6533
+ // `String.prototype.padStart` method
6534
+ // https://tc39.es/ecma262/#sec-string.prototype.padstart
6535
+ start: createMethod(false),
6536
+ // `String.prototype.padEnd` method
6537
+ // https://tc39.es/ecma262/#sec-string.prototype.padend
6538
+ end: createMethod(true)
6539
+ };
6540
+
6541
+
6485
6542
  /***/ },
6486
6543
 
6487
6544
  /***/ 2333
@@ -9754,6 +9811,26 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa
9754
9811
  });
9755
9812
 
9756
9813
 
9814
+ /***/ },
9815
+
9816
+ /***/ 8156
9817
+ (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
9818
+
9819
+ "use strict";
9820
+
9821
+ var $ = __webpack_require__(6518);
9822
+ var $padStart = (__webpack_require__(533).start);
9823
+ var WEBKIT_BUG = __webpack_require__(3063);
9824
+
9825
+ // `String.prototype.padStart` method
9826
+ // https://tc39.es/ecma262/#sec-string.prototype.padstart
9827
+ $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
9828
+ padStart: function padStart(maxLength /* , fillString = ' ' */) {
9829
+ return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
9830
+ }
9831
+ });
9832
+
9833
+
9757
9834
  /***/ },
9758
9835
 
9759
9836
  /***/ 5440
@@ -19932,13 +20009,95 @@ var es_map = __webpack_require__(6033);
19932
20009
  var es_map_get_or_insert = __webpack_require__(5367);
19933
20010
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.get-or-insert-computed.js
19934
20011
  var es_map_get_or_insert_computed = __webpack_require__(2731);
20012
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.pad-start.js
20013
+ var es_string_pad_start = __webpack_require__(8156);
20014
+ ;// ../../packages/bn-util/config.js
20015
+
20016
+
20017
+
20018
+
20019
+
20020
+
20021
+
20022
+
20023
+
20024
+
20025
+
20026
+
20027
+ /**
20028
+ * 组件库全局配置
20029
+ * 用于解决组件库打包后无法获取使用方项目环境变量的问题
20030
+ */
20031
+
20032
+ // 全局配置对象
20033
+ var globalConfig = {
20034
+ // API基础URL
20035
+ apiBaseUrl: ''
20036
+ // 其他配置项可以在这里添加
20037
+ };
20038
+
20039
+ /**
20040
+ * 设置全局配置
20041
+ * @param {Object} config 配置对象
20042
+ * @param {String} config.apiBaseUrl API基础URL
20043
+ */
20044
+ function setGlobalConfig(config) {
20045
+ if (config.apiBaseUrl !== undefined) {
20046
+ globalConfig.apiBaseUrl = config.apiBaseUrl;
20047
+ }
20048
+ // 支持其他配置项的设置
20049
+ Object.keys(config).forEach(function (key) {
20050
+ if (config[key] !== undefined) {
20051
+ globalConfig[key] = config[key];
20052
+ }
20053
+ });
20054
+ }
20055
+
20056
+ /**
20057
+ * 获取全局配置
20058
+ * @returns {Object} 配置对象
20059
+ */
20060
+ function getGlobalConfig() {
20061
+ return globalConfig;
20062
+ }
20063
+
20064
+ /**
20065
+ * 获取API基础URL
20066
+ * @returns {String} API基础URL
20067
+ */
20068
+ function getApiBaseUrl() {
20069
+ var _window$__BN_CONFIG__, _import$meta$env;
20070
+ // 优先使用设置的配置
20071
+ if (globalConfig.apiBaseUrl) {
20072
+ return globalConfig.apiBaseUrl;
20073
+ }
20074
+
20075
+ // 兼容性处理:尝试从window对象获取
20076
+ if (typeof window !== 'undefined' && (_window$__BN_CONFIG__ = window.__BN_CONFIG__) !== null && _window$__BN_CONFIG__ !== void 0 && _window$__BN_CONFIG__.apiBaseUrl) {
20077
+ return window.__BN_CONFIG__.apiBaseUrl;
20078
+ }
20079
+
20080
+ // 开发环境下尝试使用import.meta.env
20081
+ if ( true && (_import$meta$env = {"NODE_ENV":"production"}) !== null && _import$meta$env !== void 0 && _import$meta$env.VITE_API_BASE_URL) {
20082
+ return undefined;
20083
+ }
20084
+
20085
+ // 返回空字符串作为默认值
20086
+ console.warn('API基础URL未配置,请在使用组件库前调用 setGlobalConfig 设置 apiBaseUrl');
20087
+ return '';
20088
+ }
20089
+ /* harmony default export */ const config = ({
20090
+ setGlobalConfig: setGlobalConfig,
20091
+ getGlobalConfig: getGlobalConfig,
20092
+ getApiBaseUrl: getApiBaseUrl
20093
+ });
19935
20094
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
19936
20095
  var es_array_sort = __webpack_require__(6910);
19937
20096
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.ends-with.js
19938
20097
  var es_string_ends_with = __webpack_require__(9449);
19939
20098
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
19940
20099
  var es_string_trim = __webpack_require__(2762);
19941
- ;// ./packages/util/addressParse.js
20100
+ ;// ../../packages/bn-util/addressParse.js
19942
20101
 
19943
20102
 
19944
20103
 
@@ -20638,7 +20797,12 @@ function addressParse(address, sourceData) {
20638
20797
  var cleanAddress = preprocessAddress(address);
20639
20798
  return parseAddressDetail(cleanAddress, sourceData || {});
20640
20799
  }
20641
- ;// ./packages/util/index.js
20800
+ ;// ../../packages/bn-util/index.js
20801
+ /* unused harmony import specifier */ var bn_util_toConsumableArray;
20802
+ /* unused harmony import specifier */ var _objectSpread;
20803
+ /* unused harmony import specifier */ var bn_util_typeof;
20804
+ /* unused harmony import specifier */ var cloneDeep;
20805
+ /* unused harmony import specifier */ var bn_util_getApiBaseUrl;
20642
20806
 
20643
20807
 
20644
20808
 
@@ -20660,52 +20824,1713 @@ function addressParse(address, sourceData) {
20660
20824
 
20661
20825
 
20662
20826
 
20663
- /**
20664
- * 通过id列表,和options将title拼接出来 ,id的key名和 title的key名可以传过来,默认是id和title
20665
- * id:[1,2] options:[{id:1,title:'name'},{id:2,title:'name2'}] 或 {1:'name',2:'name2'}
20666
- * 结果返回 'name,name2'
20667
- * @param {Array} ids ID列表
20668
- * @param {Array|Object} options 选项数组或对象映射
20669
- * @param {String} idKey ID的键名,默认为'id',仅当options为数组时使用
20670
- * @param {String} nameKey 名称的键名,默认为'title',仅当options为数组时使用
20671
- * @param {String} separator 自定义分隔符,默认为中文逗号','
20672
- * @return {String} 拼接后的字符串
20673
- * */
20674
- function idsToTexts(ids, options) {
20675
- var idKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
20676
- var nameKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'title';
20677
- var separator = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ',';
20678
- // 快速路径:空值检查
20679
- if (!(ids !== null && ids !== void 0 && ids.length)) return '';
20680
- if (!options) return ids.join(separator);
20681
20827
 
20682
- // 使用Map代替普通对象,在大量数据时性能更好
20683
- var map = new Map();
20684
20828
 
20685
- // 判断options类型并进行相应处理
20686
- if (Array.isArray(options)) {
20687
- // 数组类型的options: [{id:1,title:'name'},{id:2,title:'name2'}]
20688
- for (var i = 0, len = options.length; i < len; i++) {
20689
- var item = options[i];
20690
- if (item) map.set(item[idKey], item[nameKey]);
20691
- }
20692
- } else if (_typeof(options) === 'object') {
20693
- // 对象映射类型的options: {1:'name',2:'name2'}
20694
- var keys = Object.keys(options);
20695
- for (var _i = 0, _len = keys.length; _i < _len; _i++) {
20696
- var key = keys[_i];
20697
- map.set(key, options[key]);
20698
- }
20699
- }
20700
20829
 
20701
- // 使用join的第二种模式,减少中间数组创建
20702
- var result = '';
20703
- for (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) {
20704
- var id = ids[_i2];
20705
- result += (_i2 > 0 ? separator : '') + (map.has(String(id)) ? map.get(String(id)) : map.has(id) ? map.get(id) : id);
20830
+
20831
+
20832
+
20833
+
20834
+
20835
+
20836
+
20837
+
20838
+
20839
+
20840
+
20841
+
20842
+
20843
+
20844
+
20845
+
20846
+
20847
+
20848
+
20849
+
20850
+
20851
+
20852
+
20853
+
20854
+
20855
+
20856
+
20857
+
20858
+
20859
+
20860
+
20861
+
20862
+
20863
+
20864
+
20865
+
20866
+
20867
+
20868
+
20869
+
20870
+
20871
+
20872
+
20873
+ /**
20874
+ * 规则配置默认支持的条件
20875
+ * */
20876
+ var ruleTypeMap = {
20877
+ 1: [{
20878
+ title: '等于',
20879
+ id: '1'
20880
+ }, {
20881
+ title: '不等于',
20882
+ id: '2'
20883
+ }, {
20884
+ title: '包含',
20885
+ id: '3'
20886
+ }, {
20887
+ title: '不包含',
20888
+ id: '4'
20889
+ }, {
20890
+ title: '包含任一项',
20891
+ id: '5'
20892
+ }, {
20893
+ title: '不包含任一项',
20894
+ id: '6'
20895
+ }, {
20896
+ title: '为空',
20897
+ id: '9'
20898
+ }, {
20899
+ title: '不为空',
20900
+ id: '10'
20706
20901
  }
20707
- return result;
20708
- }
20902
+ // {title: '不重复', id: '14'},
20903
+ // {title: '重复', id: '15'}
20904
+ ],
20905
+ 2: [{
20906
+ title: '等于',
20907
+ id: '1'
20908
+ }, {
20909
+ title: '不等于',
20910
+ id: '2'
20911
+ }, {
20912
+ title: '大于',
20913
+ id: '16'
20914
+ }, {
20915
+ title: '小于',
20916
+ id: '17'
20917
+ }, {
20918
+ title: '大于等于',
20919
+ id: '18'
20920
+ }, {
20921
+ title: '小于等于',
20922
+ id: '19'
20923
+ },
20924
+ // {title: '范围', id: '8'},
20925
+ {
20926
+ title: '为空',
20927
+ id: '9'
20928
+ }, {
20929
+ title: '不为空',
20930
+ id: '10'
20931
+ }],
20932
+ 3: [{
20933
+ title: '等于',
20934
+ id: '1'
20935
+ }, {
20936
+ title: '不等于',
20937
+ id: '2'
20938
+ }, {
20939
+ title: '包含任一项',
20940
+ id: '5'
20941
+ }, {
20942
+ title: '不包含任一项',
20943
+ id: '6'
20944
+ }, {
20945
+ title: '为空',
20946
+ id: '9'
20947
+ }, {
20948
+ title: '不为空',
20949
+ id: '10'
20950
+ }],
20951
+ 4: [{
20952
+ title: '等于',
20953
+ id: '1'
20954
+ }, {
20955
+ title: '不等于',
20956
+ id: '2'
20957
+ }, {
20958
+ title: '包含任一项',
20959
+ id: '5'
20960
+ }, {
20961
+ title: '不包含任一项',
20962
+ id: '6'
20963
+ }, {
20964
+ title: '为空',
20965
+ id: '9'
20966
+ }, {
20967
+ title: '不为空',
20968
+ id: '10'
20969
+ }],
20970
+ 5: [{
20971
+ title: '等于',
20972
+ id: '1'
20973
+ }, {
20974
+ title: '不等于',
20975
+ id: '2'
20976
+ }, {
20977
+ title: '包含任一项',
20978
+ id: '5'
20979
+ }, {
20980
+ title: '不包含任一项',
20981
+ id: '6'
20982
+ }, {
20983
+ title: '包含所有项',
20984
+ id: '7'
20985
+ }, {
20986
+ title: '为空',
20987
+ id: '9'
20988
+ }, {
20989
+ title: '不为空',
20990
+ id: '10'
20991
+ }],
20992
+ 6: [{
20993
+ title: '等于',
20994
+ id: '1'
20995
+ }, {
20996
+ title: '不等于',
20997
+ id: '2'
20998
+ }, {
20999
+ title: '包含任一项',
21000
+ id: '5'
21001
+ }, {
21002
+ title: '不包含任一项',
21003
+ id: '6'
21004
+ },
21005
+ // {title: '包含所有项', id: '7'},
21006
+ {
21007
+ title: '包含',
21008
+ id: '3'
21009
+ }, {
21010
+ title: '不包含',
21011
+ id: '4'
21012
+ }, {
21013
+ title: '为空',
21014
+ id: '9'
21015
+ }, {
21016
+ title: '不为空',
21017
+ id: '10'
21018
+ }
21019
+ // {title: '重复', id: '15'}
21020
+ ],
21021
+ 20: [{
21022
+ title: '等于',
21023
+ id: '1'
21024
+ }, {
21025
+ title: '不等于',
21026
+ id: '2'
21027
+ }, {
21028
+ title: '包含',
21029
+ id: '3'
21030
+ }, {
21031
+ title: '不包含',
21032
+ id: '4'
21033
+ }, {
21034
+ title: '包含任一项',
21035
+ id: '5'
21036
+ }, {
21037
+ title: '不包含任一项',
21038
+ id: '6'
21039
+ },
21040
+ // {title: '包含所有项', id: '7'},
21041
+ {
21042
+ title: '为空',
21043
+ id: '9'
21044
+ }, {
21045
+ title: '不为空',
21046
+ id: '10'
21047
+ }
21048
+ // {title: '重复', id: '15'}
21049
+ ],
21050
+ 7: [
21051
+ // {title: '范围', id: '8'},
21052
+ {
21053
+ title: '等于',
21054
+ id: '1'
21055
+ }, {
21056
+ title: '不等于',
21057
+ id: '2'
21058
+ }, {
21059
+ title: '大于',
21060
+ id: '16'
21061
+ }, {
21062
+ title: '小于',
21063
+ id: '17'
21064
+ }, {
21065
+ title: '大于等于',
21066
+ id: '18'
21067
+ }, {
21068
+ title: '小于等于',
21069
+ id: '19'
21070
+ }, {
21071
+ title: '为空',
21072
+ id: '9'
21073
+ }, {
21074
+ title: '不为空',
21075
+ id: '10'
21076
+ }],
21077
+ 8: [{
21078
+ title: '范围',
21079
+ id: '8'
21080
+ }, {
21081
+ title: '包含',
21082
+ id: '3'
21083
+ }, {
21084
+ title: '不包含',
21085
+ id: '4'
21086
+ }, {
21087
+ title: '为空',
21088
+ id: '9'
21089
+ }, {
21090
+ title: '不为空',
21091
+ id: '10'
21092
+ }, {
21093
+ title: '属于',
21094
+ id: '11'
21095
+ }, {
21096
+ title: '有交集',
21097
+ id: '12'
21098
+ }, {
21099
+ title: '无交集',
21100
+ id: '13'
21101
+ }],
21102
+ 9: [{
21103
+ title: '范围',
21104
+ id: '8'
21105
+ }, {
21106
+ title: '为空',
21107
+ id: '9'
21108
+ }, {
21109
+ title: '不为空',
21110
+ id: '10'
21111
+ }],
21112
+ 10: [{
21113
+ title: '为空',
21114
+ id: '9'
21115
+ }, {
21116
+ title: '不为空',
21117
+ id: '10'
21118
+ }],
21119
+ 11: [{
21120
+ title: '等于',
21121
+ id: '1'
21122
+ }, {
21123
+ title: '不等于',
21124
+ id: '2'
21125
+ }, {
21126
+ title: '包含',
21127
+ id: '3'
21128
+ }, {
21129
+ title: '不包含',
21130
+ id: '4'
21131
+ }, {
21132
+ title: '包含任一项',
21133
+ id: '5'
21134
+ }, {
21135
+ title: '不包含任一项',
21136
+ id: '6'
21137
+ }, {
21138
+ title: '包含所有项',
21139
+ id: '7'
21140
+ }, {
21141
+ title: '范围',
21142
+ id: '8'
21143
+ }, {
21144
+ title: '为空',
21145
+ id: '9'
21146
+ }, {
21147
+ title: '不为空',
21148
+ id: '10'
21149
+ }, {
21150
+ title: '属于',
21151
+ id: '11'
21152
+ }, {
21153
+ title: '有交集',
21154
+ id: '12'
21155
+ }, {
21156
+ title: '无交集',
21157
+ id: '13'
21158
+ }],
21159
+ 12: [{
21160
+ title: '等于',
21161
+ id: '1'
21162
+ }, {
21163
+ title: '不等于',
21164
+ id: '2'
21165
+ }, {
21166
+ title: '包含',
21167
+ id: '3'
21168
+ }, {
21169
+ title: '不包含',
21170
+ id: '4'
21171
+ }, {
21172
+ title: '包含任一项',
21173
+ id: '5'
21174
+ }, {
21175
+ title: '不包含任一项',
21176
+ id: '6'
21177
+ }, {
21178
+ title: '包含所有项',
21179
+ id: '7'
21180
+ }, {
21181
+ title: '范围',
21182
+ id: '8'
21183
+ }, {
21184
+ title: '为空',
21185
+ id: '9'
21186
+ }, {
21187
+ title: '不为空',
21188
+ id: '10'
21189
+ }, {
21190
+ title: '属于',
21191
+ id: '11'
21192
+ }, {
21193
+ title: '有交集',
21194
+ id: '12'
21195
+ }, {
21196
+ title: '无交集',
21197
+ id: '13'
21198
+ }],
21199
+ 13: [{
21200
+ title: '等于',
21201
+ id: '1'
21202
+ }, {
21203
+ title: '不等于',
21204
+ id: '2'
21205
+ }, {
21206
+ title: '包含',
21207
+ id: '3'
21208
+ }, {
21209
+ title: '不包含',
21210
+ id: '4'
21211
+ }, {
21212
+ title: '包含任一项',
21213
+ id: '5'
21214
+ }, {
21215
+ title: '不包含任一项',
21216
+ id: '6'
21217
+ }, {
21218
+ title: '包含所有项',
21219
+ id: '7'
21220
+ }, {
21221
+ title: '范围',
21222
+ id: '8'
21223
+ }, {
21224
+ title: '为空',
21225
+ id: '9'
21226
+ }, {
21227
+ title: '不为空',
21228
+ id: '10'
21229
+ }, {
21230
+ title: '属于',
21231
+ id: '11'
21232
+ }, {
21233
+ title: '有交集',
21234
+ id: '12'
21235
+ }, {
21236
+ title: '无交集',
21237
+ id: '13'
21238
+ }],
21239
+ 14: [{
21240
+ title: '等于',
21241
+ id: '1'
21242
+ }, {
21243
+ title: '不等于',
21244
+ id: '2'
21245
+ }, {
21246
+ title: '包含',
21247
+ id: '3'
21248
+ }, {
21249
+ title: '包含任一项',
21250
+ id: '5'
21251
+ }, {
21252
+ title: '不包含任一项',
21253
+ id: '6'
21254
+ },
21255
+ // {title: '包含所有项', id: '7'},
21256
+ {
21257
+ title: '为空',
21258
+ id: '9'
21259
+ }, {
21260
+ title: '不为空',
21261
+ id: '10'
21262
+ }],
21263
+ 15: [
21264
+ // {title: '等于', id: '1'},
21265
+ // {title: '不等于', id: '2'},
21266
+ // {title: '包含', id: '3'},
21267
+ // {title: '包含任一项', id: '5'},
21268
+ // {title: '不包含任一项', id: '6'},
21269
+ // {title: '包含所有项', id: '7'},
21270
+ {
21271
+ title: '为空',
21272
+ id: '9'
21273
+ }, {
21274
+ title: '不为空',
21275
+ id: '10'
21276
+ }]
21277
+ /*8: [
21278
+ {title: '范围', id: '8'},
21279
+ {title: '为空', id: '9'},
21280
+ {title: '不为空', id: '10'},
21281
+ // {title: '属于', id: '11'},
21282
+ // {title: '有交集', id: '12'},
21283
+ // {title: '无交集', id: '13'},
21284
+ ],
21285
+ 9: [
21286
+ {title: '范围', id: '8'},
21287
+ {title: '为空', id: '9'},
21288
+ {title: '不为空', id: '10'},
21289
+ ],
21290
+ 11: [
21291
+ {title: '等于', id: '1'},
21292
+ {title: '不等于', id: '2'},
21293
+ {title: '包含', id: '3'},
21294
+ {title: '不包含', id: '4'},
21295
+ {title: '包含任一项', id: '5'},
21296
+ {title: '不包含任一项', id: '6'},
21297
+ {title: '包含所有项', id: '7'},
21298
+ {title: '范围', id: '8'},
21299
+ {title: '为空', id: '9'},
21300
+ {title: '不为空', id: '10'},
21301
+ {title: '属于', id: '11'},
21302
+ {title: '有交集', id: '12'},
21303
+ {title: '无交集', id: '13'},],
21304
+ 12: [
21305
+ {title: '等于', id: '1'},
21306
+ {title: '不等于', id: '2'},
21307
+ {title: '包含', id: '3'},
21308
+ {title: '不包含', id: '4'},
21309
+ {title: '包含任一项', id: '5'},
21310
+ {title: '不包含任一项', id: '6'},
21311
+ {title: '包含所有项', id: '7'},
21312
+ {title: '范围', id: '8'},
21313
+ {title: '为空', id: '9'},
21314
+ {title: '不为空', id: '10'},
21315
+ {title: '属于', id: '11'},
21316
+ {title: '有交集', id: '12'},
21317
+ {title: '无交集', id: '13'},],
21318
+ 13: [
21319
+ {title: '等于', id: '1'},
21320
+ {title: '不等于', id: '2'},
21321
+ {title: '包含', id: '3'},
21322
+ {title: '不包含', id: '4'},
21323
+ {title: '包含任一项', id: '5'},
21324
+ {title: '不包含任一项', id: '6'},
21325
+ {title: '包含所有项', id: '7'},
21326
+ {title: '范围', id: '8'},
21327
+ {title: '为空', id: '9'},
21328
+ {title: '不为空', id: '10'},
21329
+ {title: '属于', id: '11'},
21330
+ {title: '有交集', id: '12'},
21331
+ {title: '无交集', id: '13'},],
21332
+ 15: [
21333
+ {title: '等于', id: '1'},
21334
+ {title: '为空', id: '9'},
21335
+ {title: '不为空', id: '10'}
21336
+ ],*/
21337
+ };
21338
+ /**
21339
+ * 规则配置各组件默认支持的数值条件 当前值、选择其他组件 这种
21340
+ * */
21341
+ var valueTypeMap = {
21342
+ 1: '0',
21343
+ 2: '0',
21344
+ 3: '2',
21345
+ 4: '2',
21346
+ 5: '2',
21347
+ 6: '2',
21348
+ 7: '0',
21349
+ 8: '0',
21350
+ 9: '0',
21351
+ 10: '2',
21352
+ 11: '2',
21353
+ 12: '2',
21354
+ 13: '2',
21355
+ 14: '2',
21356
+ 15: '2'
21357
+ };
21358
+ /**
21359
+ * 字段,组件数据格式化
21360
+ * */
21361
+ var searchTypeMap = {
21362
+ 1: [{
21363
+ title: '等于',
21364
+ id: '1'
21365
+ }, {
21366
+ title: '不等于',
21367
+ id: '2'
21368
+ }, {
21369
+ title: '包含',
21370
+ id: '3'
21371
+ }, {
21372
+ title: '不包含',
21373
+ id: '4'
21374
+ }, {
21375
+ title: '包含任一项',
21376
+ id: '5'
21377
+ }, {
21378
+ title: '为空',
21379
+ id: '9'
21380
+ }, {
21381
+ title: '不为空',
21382
+ id: '10'
21383
+ }, {
21384
+ title: '重复',
21385
+ id: '15'
21386
+ }, {
21387
+ title: '不重复',
21388
+ id: '14'
21389
+ }],
21390
+ 2: [{
21391
+ title: '范围',
21392
+ id: '8'
21393
+ }, {
21394
+ title: '等于',
21395
+ id: '1'
21396
+ }, {
21397
+ title: '不等于',
21398
+ id: '2'
21399
+ }, {
21400
+ title: '包含任一项',
21401
+ id: '5'
21402
+ }, {
21403
+ title: '为空',
21404
+ id: '9'
21405
+ }, {
21406
+ title: '不为空',
21407
+ id: '10'
21408
+ }],
21409
+ 3: [{
21410
+ title: '包含任一项',
21411
+ id: '5'
21412
+ }, {
21413
+ title: '不包含任一项',
21414
+ id: '6'
21415
+ }, {
21416
+ title: '为空',
21417
+ id: '9'
21418
+ }, {
21419
+ title: '不为空',
21420
+ id: '10'
21421
+ }],
21422
+ 4: [{
21423
+ title: '包含任一项',
21424
+ id: '5'
21425
+ },
21426
+ // {title: '不包含任一项', id: '6'},
21427
+ {
21428
+ title: '为空',
21429
+ id: '9'
21430
+ }, {
21431
+ title: '不为空',
21432
+ id: '10'
21433
+ }],
21434
+ 5: [{
21435
+ title: '等于',
21436
+ id: '1'
21437
+ }, {
21438
+ title: '不等于',
21439
+ id: '2'
21440
+ }, {
21441
+ title: '包含任一项',
21442
+ id: '5'
21443
+ }, {
21444
+ title: '不包含任一项',
21445
+ id: '6'
21446
+ }, {
21447
+ title: '包含所有项',
21448
+ id: '7'
21449
+ }, {
21450
+ title: '为空',
21451
+ id: '9'
21452
+ }, {
21453
+ title: '不为空',
21454
+ id: '10'
21455
+ }],
21456
+ 6: [
21457
+ // {title: '等于', id: '1'},
21458
+ // {title: '不等于', id: '2'},
21459
+ {
21460
+ title: '包含',
21461
+ id: '3'
21462
+ }, {
21463
+ title: '不包含',
21464
+ id: '4'
21465
+ }, {
21466
+ title: '包含任一项',
21467
+ id: '5'
21468
+ }, {
21469
+ title: '不包含任一项',
21470
+ id: '6'
21471
+ }, {
21472
+ title: '包含所有项',
21473
+ id: '7'
21474
+ }, {
21475
+ title: '为空',
21476
+ id: '9'
21477
+ }, {
21478
+ title: '不为空',
21479
+ id: '10'
21480
+ }
21481
+ // {title: '重复', id: '15'}
21482
+ ],
21483
+ 20: [{
21484
+ title: '等于',
21485
+ id: '1'
21486
+ }, {
21487
+ title: '不等于',
21488
+ id: '2'
21489
+ }, {
21490
+ title: '包含',
21491
+ id: '3'
21492
+ }, {
21493
+ title: '不包含',
21494
+ id: '4'
21495
+ }, {
21496
+ title: '包含任一项',
21497
+ id: '5'
21498
+ }, {
21499
+ title: '不包含任一项',
21500
+ id: '6'
21501
+ },
21502
+ // {title: '包含所有项', id: '7'},
21503
+ {
21504
+ title: '为空',
21505
+ id: '9'
21506
+ }, {
21507
+ title: '不为空',
21508
+ id: '10'
21509
+ }
21510
+ // {title: '重复', id: '15'}
21511
+ ],
21512
+ 7: [{
21513
+ title: '范围',
21514
+ id: '8'
21515
+ }, {
21516
+ title: '为空',
21517
+ id: '9'
21518
+ }, {
21519
+ title: '不为空',
21520
+ id: '10'
21521
+ }],
21522
+ 8: [{
21523
+ title: '范围',
21524
+ id: '8'
21525
+ }, {
21526
+ title: '包含',
21527
+ id: '3'
21528
+ }, {
21529
+ title: '不包含',
21530
+ id: '4'
21531
+ }, {
21532
+ title: '为空',
21533
+ id: '9'
21534
+ }, {
21535
+ title: '不为空',
21536
+ id: '10'
21537
+ }, {
21538
+ title: '属于',
21539
+ id: '11'
21540
+ }, {
21541
+ title: '有交集',
21542
+ id: '12'
21543
+ }, {
21544
+ title: '无交集',
21545
+ id: '13'
21546
+ }],
21547
+ 9: [{
21548
+ title: '范围',
21549
+ id: '8'
21550
+ }, {
21551
+ title: '为空',
21552
+ id: '9'
21553
+ }, {
21554
+ title: '不为空',
21555
+ id: '10'
21556
+ }],
21557
+ 10: [{
21558
+ title: '为空',
21559
+ id: '9'
21560
+ }, {
21561
+ title: '不为空',
21562
+ id: '10'
21563
+ }],
21564
+ 11: [{
21565
+ title: '等于',
21566
+ id: '1'
21567
+ }, {
21568
+ title: '不等于',
21569
+ id: '2'
21570
+ }, {
21571
+ title: '包含',
21572
+ id: '3'
21573
+ }, {
21574
+ title: '不包含',
21575
+ id: '4'
21576
+ }, {
21577
+ title: '包含任一项',
21578
+ id: '5'
21579
+ }, {
21580
+ title: '不包含任一项',
21581
+ id: '6'
21582
+ }, {
21583
+ title: '包含所有项',
21584
+ id: '7'
21585
+ }, {
21586
+ title: '范围',
21587
+ id: '8'
21588
+ }, {
21589
+ title: '为空',
21590
+ id: '9'
21591
+ }, {
21592
+ title: '不为空',
21593
+ id: '10'
21594
+ }, {
21595
+ title: '属于',
21596
+ id: '11'
21597
+ }, {
21598
+ title: '有交集',
21599
+ id: '12'
21600
+ }, {
21601
+ title: '无交集',
21602
+ id: '13'
21603
+ }],
21604
+ 12: [{
21605
+ title: '等于',
21606
+ id: '1'
21607
+ }, {
21608
+ title: '不等于',
21609
+ id: '2'
21610
+ }, {
21611
+ title: '包含',
21612
+ id: '3'
21613
+ }, {
21614
+ title: '不包含',
21615
+ id: '4'
21616
+ }, {
21617
+ title: '包含任一项',
21618
+ id: '5'
21619
+ }, {
21620
+ title: '不包含任一项',
21621
+ id: '6'
21622
+ }, {
21623
+ title: '包含所有项',
21624
+ id: '7'
21625
+ }, {
21626
+ title: '范围',
21627
+ id: '8'
21628
+ }, {
21629
+ title: '为空',
21630
+ id: '9'
21631
+ }, {
21632
+ title: '不为空',
21633
+ id: '10'
21634
+ }, {
21635
+ title: '属于',
21636
+ id: '11'
21637
+ }, {
21638
+ title: '有交集',
21639
+ id: '12'
21640
+ }, {
21641
+ title: '无交集',
21642
+ id: '13'
21643
+ }],
21644
+ 13: [{
21645
+ title: '等于',
21646
+ id: '1'
21647
+ }, {
21648
+ title: '不等于',
21649
+ id: '2'
21650
+ }, {
21651
+ title: '包含',
21652
+ id: '3'
21653
+ }, {
21654
+ title: '不包含',
21655
+ id: '4'
21656
+ }, {
21657
+ title: '包含任一项',
21658
+ id: '5'
21659
+ }, {
21660
+ title: '不包含任一项',
21661
+ id: '6'
21662
+ }, {
21663
+ title: '包含所有项',
21664
+ id: '7'
21665
+ }, {
21666
+ title: '范围',
21667
+ id: '8'
21668
+ }, {
21669
+ title: '为空',
21670
+ id: '9'
21671
+ }, {
21672
+ title: '不为空',
21673
+ id: '10'
21674
+ }, {
21675
+ title: '属于',
21676
+ id: '11'
21677
+ }, {
21678
+ title: '有交集',
21679
+ id: '12'
21680
+ }, {
21681
+ title: '无交集',
21682
+ id: '13'
21683
+ }],
21684
+ 14: [{
21685
+ title: '等于',
21686
+ id: '1'
21687
+ }, {
21688
+ title: '不等于',
21689
+ id: '2'
21690
+ }, {
21691
+ title: '包含',
21692
+ id: '3'
21693
+ }, {
21694
+ title: '不包含',
21695
+ id: '4'
21696
+ }, {
21697
+ title: '为空',
21698
+ id: '9'
21699
+ }, {
21700
+ title: '不为空',
21701
+ id: '10'
21702
+ }],
21703
+ 15: [{
21704
+ title: '等于',
21705
+ id: '1'
21706
+ }, {
21707
+ title: '包含',
21708
+ id: '3'
21709
+ }, {
21710
+ title: '不包含',
21711
+ id: '4'
21712
+ }, {
21713
+ title: '为空',
21714
+ id: '9'
21715
+ }, {
21716
+ title: '不为空',
21717
+ id: '10'
21718
+ }]
21719
+ };
21720
+ /**
21721
+ * 全局默认成员列表
21722
+ * */
21723
+ var userConst = [{
21724
+ title: "班牛助手(工单)",
21725
+ code: "10001487",
21726
+ id: "10001487"
21727
+ }, {
21728
+ title: "班牛助手(服务大厅)",
21729
+ code: "857",
21730
+ id: "857"
21731
+ }, {
21732
+ title: "班牛助手(API)",
21733
+ code: "110430206",
21734
+ id: "110430206"
21735
+ }];
21736
+
21737
+ /**
21738
+ * 通过id列表,和options将title拼接出来 ,id的key名和 title的key名可以传过来,默认是id和title
21739
+ * id:[1,2] options:[{id:1,title:'name'},{id:2,title:'name2'}] 或 {1:'name',2:'name2'}
21740
+ * 结果返回 'name,name2'
21741
+ * @param {Array} ids ID列表
21742
+ * @param {Array|Object} options 选项数组或对象映射
21743
+ * @param {String} idKey ID的键名,默认为'id',仅当options为数组时使用
21744
+ * @param {String} nameKey 名称的键名,默认为'title',仅当options为数组时使用
21745
+ * @param {String} separator 自定义分隔符,默认为中文逗号','
21746
+ * @return {String} 拼接后的字符串
21747
+ * */
21748
+ function idsToTexts(ids, options) {
21749
+ var idKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
21750
+ var nameKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'title';
21751
+ var separator = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ',';
21752
+ // 快速路径:空值检查
21753
+ if (!(ids !== null && ids !== void 0 && ids.length)) return '';
21754
+ if (!options) return ids.join(separator);
21755
+
21756
+ // 使用Map代替普通对象,在大量数据时性能更好
21757
+ var map = new Map();
21758
+
21759
+ // 判断options类型并进行相应处理
21760
+ if (Array.isArray(options)) {
21761
+ // 数组类型的options: [{id:1,title:'name'},{id:2,title:'name2'}]
21762
+ for (var i = 0, len = options.length; i < len; i++) {
21763
+ var item = options[i];
21764
+ if (item) map.set(item[idKey], item[nameKey]);
21765
+ }
21766
+ } else if (_typeof(options) === 'object') {
21767
+ // 对象映射类型的options: {1:'name',2:'name2'}
21768
+ var keys = Object.keys(options);
21769
+ for (var _i = 0, _len = keys.length; _i < _len; _i++) {
21770
+ var key = keys[_i];
21771
+ map.set(key, options[key]);
21772
+ }
21773
+ }
21774
+
21775
+ // 使用join的第二种模式,减少中间数组创建
21776
+ var result = '';
21777
+ for (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) {
21778
+ var id = ids[_i2];
21779
+ result += (_i2 > 0 ? separator : '') + (map.has(String(id)) ? map.get(String(id)) : map.has(id) ? map.get(id) : id);
21780
+ }
21781
+ return result;
21782
+ }
21783
+
21784
+ /**
21785
+ * 向输入框的光标位置插入字符
21786
+ * */
21787
+ function insertText(dom, value) {
21788
+ var selectRange;
21789
+ if (document.selection) {
21790
+ // IE Support
21791
+ dom.focus();
21792
+ selectRange = document.selection.createRange();
21793
+ selectRange.text = value;
21794
+ dom.focus();
21795
+ } else if (dom.selectionStart || dom.selectionStart == '0') {
21796
+ // Firefox support
21797
+ var startPos = dom.selectionStart;
21798
+ var endPos = dom.selectionEnd;
21799
+ var scrollTop = dom.scrollTop;
21800
+ dom.value = dom.value.substring(0, startPos) + value + dom.value.substring(endPos, dom.value.length);
21801
+ dom.focus();
21802
+ dom.selectionStart = startPos + value.length;
21803
+ dom.selectionEnd = startPos + value.length;
21804
+ dom.scrollTop = scrollTop;
21805
+ } else {
21806
+ dom.value += value;
21807
+ dom.focus();
21808
+ }
21809
+ return dom.value;
21810
+ }
21811
+
21812
+ /**
21813
+ * 格式化查看、高级筛选的组件信息
21814
+ * @param Object component 组件信息
21815
+ * */
21816
+ function tidyRuleComponent(component) {
21817
+ var _ruleTypeMap$componen;
21818
+ // 组件必须可见
21819
+ if (component.extraInfo.listShow != 1) {
21820
+ return null;
21821
+ }
21822
+ var data = {
21823
+ id: component.id,
21824
+ behaviorType: component.behaviorType,
21825
+ columnCode: component.columnCode,
21826
+ name: component.name,
21827
+ valueType: valueTypeMap[component.behaviorType],
21828
+ extraInfo: component.extraInfo || {},
21829
+ moduleDefinition: component.moduleDefinition || [],
21830
+ insideDataSourceInfo: component.insideDataSourceInfo,
21831
+ outDataSourceInfo: component.outDataSourceInfo || [],
21832
+ matchType: (_ruleTypeMap$componen = ruleTypeMap[component.behaviorType][0]) === null || _ruleTypeMap$componen === void 0 ? void 0 : _ruleTypeMap$componen.id,
21833
+ parentCode: component.parent ? component.parent.columnCode : '',
21834
+ parentId: component.parent ? component.parent.id : '',
21835
+ parentBehaviorType: component.parent ? component.parent.behaviorType : ''
21836
+ };
21837
+ switch (data.behaviorType) {
21838
+ case 1: //文本
21839
+ case 9: //评分
21840
+ case 11:
21841
+ //富文本
21842
+ {
21843
+ data.value = '';
21844
+ break;
21845
+ }
21846
+ case 3: //单选
21847
+ case 4:
21848
+ //下拉
21849
+ {
21850
+ if (component.insideDataSourceInfo && component.insideDataSourceInfo.type) {
21851
+ data.postData = _objectSpread({
21852
+ appId: component.appId,
21853
+ projectId: component.tableId
21854
+ }, component.insideDataSourceInfo);
21855
+ data.pathUrl = '/v2/project/column/select';
21856
+ }
21857
+ data.value = {};
21858
+ //筛选时,当计算条件是等于、不等于、为空、不为空时,值是空对象,其他条件都是数组
21859
+ if (data.matchType && !['1', '2', '9', '10'].includes(data.matchType)) {
21860
+ data.value = [];
21861
+ }
21862
+ break;
21863
+ }
21864
+ case 5: //多选
21865
+ case 6: //联动组件
21866
+ case 20: //多选联动组件
21867
+ case 12:
21868
+ //标签
21869
+ {
21870
+ if (component.parent && [14, 15].includes(component.parent.behaviorType)) {
21871
+ data.pathUrl = '/address/getAreaDataList';
21872
+ }
21873
+ data.value = [];
21874
+ break;
21875
+ }
21876
+ case 10:
21877
+ //附件
21878
+ {
21879
+ data.pathUrl = bn_util_getApiBaseUrl() + "/v2/attachment/upload/task";
21880
+ data.value = [];
21881
+ break;
21882
+ }
21883
+ case 2: //数值
21884
+ case 7:
21885
+ //日期
21886
+ {
21887
+ data.value = '';
21888
+ //筛选时,值是空对象
21889
+ if (data.matchType) {
21890
+ data.value = {
21891
+ start: '',
21892
+ end: ''
21893
+ };
21894
+ }
21895
+ break;
21896
+ }
21897
+ case 8:
21898
+ //日期区间
21899
+ {
21900
+ data.value = [];
21901
+ //筛选时,值是空对象
21902
+ if (data.matchType) {
21903
+ data.value = {
21904
+ start: '',
21905
+ end: ''
21906
+ };
21907
+ }
21908
+ break;
21909
+ }
21910
+ case 13:
21911
+ //子表单
21912
+ {
21913
+ data.value = [];
21914
+ data.moduleDefinition = data.moduleDefinition ? data.moduleDefinition : [];
21915
+ var moduleDefinition = [];
21916
+ for (var i in data.moduleDefinition) {
21917
+ var childColumn = tidyRuleComponent(data.moduleDefinition[i]);
21918
+ if (childColumn) {
21919
+ moduleDefinition.push(childColumn);
21920
+ }
21921
+ }
21922
+ data.moduleDefinition = moduleDefinition;
21923
+ break;
21924
+ }
21925
+ }
21926
+ return data;
21927
+ }
21928
+
21929
+ /**
21930
+ * 格式化规则配置组件列表
21931
+ * */
21932
+ function tidyRuleComponents(components, appId, tableId) {
21933
+ var componentList = [];
21934
+ components.forEach(function (item) {
21935
+ if ([13, 14, 15].includes(item.behaviorType)) {
21936
+ item.moduleDefinition.forEach(function (ite) {
21937
+ var component = tidyRuleComponent(_objectSpread(_objectSpread({}, ite), {}, {
21938
+ name: "".concat(item.name, "-").concat(ite.name),
21939
+ parent: item,
21940
+ appId: appId,
21941
+ tableId: tableId
21942
+ }));
21943
+ if (component) {
21944
+ componentList.push(component);
21945
+ }
21946
+ });
21947
+ } else {
21948
+ var component = tidyRuleComponent(_objectSpread(_objectSpread({}, item), {}, {
21949
+ appId: appId,
21950
+ tableId: tableId
21951
+ }));
21952
+ if (component) {
21953
+ componentList.push(component);
21954
+ }
21955
+ }
21956
+ });
21957
+ return componentList;
21958
+ }
21959
+
21960
+ /**
21961
+ * 将高级筛选的value格式化成json
21962
+ * */
21963
+ function searchValueToJson(components) {
21964
+ var list = cloneDeep(components);
21965
+ list.forEach(function (item) {
21966
+ if (item.value != null) {
21967
+ // 排除 null 和 undefined
21968
+ var valueType = bn_util_typeof(item.value);
21969
+ // 保留 string、number 和 boolean 原始值,其他都转换为 JSON
21970
+ if (valueType !== 'string' && valueType !== 'number' && valueType !== 'boolean') {
21971
+ try {
21972
+ item.value = JSON.stringify(item.value);
21973
+ } catch (e) {
21974
+ console.warn('JSON stringify failed for value:', item.value);
21975
+ item.value = String(item.value); // 降级处理
21976
+ }
21977
+ }
21978
+ }
21979
+ });
21980
+ return list;
21981
+ }
21982
+
21983
+ /**
21984
+ * 格式化查看、高级筛选的组件信息
21985
+ * @param Object component 组件信息
21986
+ * @param String power 权限字段,跟简易工单admin配置对应,不穿则不校验权限
21987
+ * */
21988
+ function formatComponent(component, power) {
21989
+ // 先校验权限 展示的地方特殊判断下id
21990
+ if (power && component.extraInfo[power] != 1) {
21991
+ return null;
21992
+ }
21993
+ var data = {
21994
+ id: component.id,
21995
+ type: component.type,
21996
+ behaviorType: component.behaviorType,
21997
+ defaultInfo: component.defaultInfo,
21998
+ columnCode: component.columnCode,
21999
+ name: component.name,
22000
+ extraInfo: component.extraInfo || {},
22001
+ style: component.style || {},
22002
+ moduleDefinition: component.moduleDefinition || [],
22003
+ insideDataSourceInfo: component.insideDataSourceInfo,
22004
+ outDataSourceInfo: component.outDataSourceInfo || []
22005
+ };
22006
+ // 高级筛选条件
22007
+ if (power == 'queryShow') {
22008
+ var _searchTypeMap$compon;
22009
+ data.searchType = (_searchTypeMap$compon = searchTypeMap[component.behaviorType][0]) === null || _searchTypeMap$compon === void 0 ? void 0 : _searchTypeMap$compon.id;
22010
+ data.parentCode = component.parent ? component.parent.columnCode : null;
22011
+ // 过滤公共筛选条件
22012
+ if (['alarm_status', 'sync_status'].includes(component.columnCode)) {
22013
+ return null;
22014
+ }
22015
+ }
22016
+ switch (data.behaviorType) {
22017
+ case 1: //文本
22018
+ case 9: //评分
22019
+ case 11:
22020
+ //富文本
22021
+ {
22022
+ data.value = '';
22023
+ break;
22024
+ }
22025
+ case 3: //单选
22026
+ case 4:
22027
+ //下拉
22028
+ {
22029
+ if (component.insideDataSourceInfo && component.insideDataSourceInfo.type) {
22030
+ data.postData = _objectSpread({
22031
+ appId: component.appId,
22032
+ projectId: component.tableId,
22033
+ ids: JSON.stringify(component.insideDataSourceInfo)
22034
+ }, component.insideDataSourceInfo);
22035
+ if (component.insideDataSourceInfo.type == 'user') {
22036
+ data.postData.selectParams = "{\"userColId\":\"-1\"}";
22037
+ data.moduleDefinition = cloneDeep(userConst);
22038
+ }
22039
+ data.pathUrl = '/v2/project/column/select';
22040
+ }
22041
+ data.value = {};
22042
+ //筛选时,当计算条件是等于、不等于、为空、不为空时,值是空对象,其他条件都是数组
22043
+ if (data.searchType && !['1', '2', '9', '10'].includes(data.searchType)) {
22044
+ data.value = [];
22045
+ }
22046
+ break;
22047
+ }
22048
+ case 5: //多选
22049
+ case 6: //联动组件
22050
+ case 20: //多选联动组件
22051
+ case 12:
22052
+ //标签
22053
+ {
22054
+ if (component.parent && [14, 15].includes(component.parent.behaviorType)) {
22055
+ data.pathUrl = '/address/getAreaDataList';
22056
+ }
22057
+ data.value = [];
22058
+ break;
22059
+ }
22060
+ case 10:
22061
+ //附件
22062
+ {
22063
+ data.pathUrl = bn_util_getApiBaseUrl() + "/v2/attachment/upload/task";
22064
+ data.value = [];
22065
+ break;
22066
+ }
22067
+ case 2: //数值
22068
+ case 7:
22069
+ //日期
22070
+ {
22071
+ data.value = '';
22072
+ //筛选时,值是空对象
22073
+ if (data.searchType) {
22074
+ data.value = {
22075
+ start: '',
22076
+ end: ''
22077
+ };
22078
+ }
22079
+ break;
22080
+ }
22081
+ case 8:
22082
+ //日期区间
22083
+ {
22084
+ data.value = [];
22085
+ //筛选时,值是空对象
22086
+ if (data.searchType) {
22087
+ data.value = {
22088
+ start: '',
22089
+ end: ''
22090
+ };
22091
+ }
22092
+ break;
22093
+ }
22094
+ case 13:
22095
+ //子表单
22096
+ {
22097
+ data.value = [];
22098
+ data.moduleDefinition = data.moduleDefinition ? data.moduleDefinition : [];
22099
+ var moduleDefinition = [];
22100
+ for (var i in data.moduleDefinition) {
22101
+ var childColumn = formatComponent(data.moduleDefinition[i], power);
22102
+ if (childColumn) {
22103
+ moduleDefinition.push(childColumn);
22104
+ }
22105
+ }
22106
+ data.moduleDefinition = moduleDefinition;
22107
+ break;
22108
+ }
22109
+ case 14: //地址组件
22110
+ case 15:
22111
+ //收寄信息组件
22112
+ {
22113
+ var val = {};
22114
+ data.moduleDefinition.forEach(function (item) {
22115
+ val[item.columnCode] = item.behaviorType == 6 ? [] : '';
22116
+ });
22117
+ data.value = val;
22118
+ }
22119
+ }
22120
+ return data;
22121
+ }
22122
+
22123
+ /**
22124
+ * 格式化高级筛选组件列表
22125
+ * */
22126
+ function getSearchComponents(components, appId, tableId) {
22127
+ var componentList = [];
22128
+ components.forEach(function (item) {
22129
+ if ([13, 14, 15].includes(item.behaviorType) && item.extraInfo.queryShow == 1 && item.moduleDefinition.length > 0) {
22130
+ item.moduleDefinition.forEach(function (ite) {
22131
+ var component = formatComponent(_objectSpread(_objectSpread({}, ite), {}, {
22132
+ name: "".concat(item.name, "-").concat(ite.name),
22133
+ parent: item,
22134
+ appId: appId,
22135
+ tableId: tableId
22136
+ }), 'queryShow');
22137
+ if (component) {
22138
+ componentList.push(component);
22139
+ }
22140
+ });
22141
+ } else {
22142
+ var component = formatComponent(_objectSpread(_objectSpread({}, item), {}, {
22143
+ appId: appId,
22144
+ tableId: tableId
22145
+ }), 'queryShow');
22146
+ if (component) {
22147
+ componentList.push(component);
22148
+ }
22149
+ }
22150
+ });
22151
+ return componentList;
22152
+ }
22153
+
22154
+ /**
22155
+ * 格式化查看、详情组件列表
22156
+ * */
22157
+ function getWatchComponents(components, appId, tableId) {
22158
+ var power = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'listShow';
22159
+ var componentList = [];
22160
+ components.forEach(function (item) {
22161
+ var component = formatComponent(_objectSpread(_objectSpread({}, item), {}, {
22162
+ appId: appId,
22163
+ tableId: tableId
22164
+ }), power);
22165
+ if (component) {
22166
+ componentList.push(component);
22167
+ }
22168
+ });
22169
+ return componentList;
22170
+ }
22171
+
22172
+ /**
22173
+ * 格式化新建、编辑 组件的value
22174
+ * @param Object component 组件信息
22175
+ * @param Object values 编辑表单时,传入的工单数据
22176
+ * @param String power 权限,当不是编辑的时候,将只给有新建权限的组件进行赋值 component.extraInfo[power]
22177
+ * */
22178
+ function formatColumnVal(component, values, power) {
22179
+ var data = {
22180
+ id: component.id,
22181
+ type: component.type,
22182
+ behaviorType: component.behaviorType,
22183
+ columnCode: component.columnCode,
22184
+ defaultInfo: component.defaultInfo,
22185
+ name: component.name,
22186
+ extraInfo: component.extraInfo || {},
22187
+ style: component.style || {},
22188
+ moduleDefinition: component.moduleDefinition || [],
22189
+ insideDataSourceInfo: component.insideDataSourceInfo,
22190
+ outDataSourceInfo: component.outDataSourceInfo || []
22191
+ };
22192
+ var isSetValue = false;
22193
+ try {
22194
+ isSetValue = values && data.extraInfo[power];
22195
+ } catch (e) {
22196
+ // 缺少判断,isSetValue保持false
22197
+ }
22198
+ switch (data.behaviorType) {
22199
+ case 1: //文本
22200
+ case 2: //数值
22201
+ case 7: //日期
22202
+ case 9: //评分
22203
+ case 11:
22204
+ //富文本
22205
+ {
22206
+ if (isSetValue) {
22207
+ data.value = values[data.columnCode] || '';
22208
+ } else {
22209
+ data.value = data.defaultInfo || '';
22210
+ }
22211
+ break;
22212
+ }
22213
+ case 3: //单选
22214
+ case 4:
22215
+ //下拉
22216
+ {
22217
+ if (component.insideDataSourceInfo && component.insideDataSourceInfo.type) {
22218
+ data.postData = _objectSpread({
22219
+ appId: component.appId,
22220
+ projectId: component.tableId,
22221
+ ids: JSON.stringify(component.insideDataSourceInfo)
22222
+ }, component.insideDataSourceInfo);
22223
+ if (component.insideDataSourceInfo.type == 'user') {
22224
+ data.postData.selectParams = "{\"userColId\":\"-1\"}";
22225
+ }
22226
+ data.pathUrl = '/v2/project/column/select';
22227
+ }
22228
+ if (isSetValue) {
22229
+ data.value = values[data.columnCode] || {};
22230
+ } else {
22231
+ try {
22232
+ data.value = component.defaultInfo || {};
22233
+ } catch (e) {
22234
+ data.value = {};
22235
+ }
22236
+ }
22237
+ break;
22238
+ }
22239
+ case 5: //多选
22240
+ case 6: //联动组件
22241
+ case 8: //日期区间
22242
+ case 20: //多选联动组件
22243
+ case 12:
22244
+ //标签
22245
+ {
22246
+ if (isSetValue) {
22247
+ if (data.behaviorType == 6 && values[data.columnCode]) {
22248
+ data.value = values[data.columnCode].map(function (i) {
22249
+ return i.code;
22250
+ });
22251
+ } else {
22252
+ data.value = values[data.columnCode] || [];
22253
+ }
22254
+ } else {
22255
+ try {
22256
+ data.value = component.defaultInfo || [];
22257
+ if (data.behaviorType == 6 && component.defaultInfo) {
22258
+ data.value = component.defaultInfo.map(function (i) {
22259
+ return i.code;
22260
+ });
22261
+ }
22262
+ } catch (e) {
22263
+ data.value = [];
22264
+ }
22265
+ }
22266
+ break;
22267
+ }
22268
+ case 10:
22269
+ //附件
22270
+ {
22271
+ data.pathUrl = bn_util_getApiBaseUrl() + "/v2/attachment/upload/task";
22272
+ if (isSetValue) {
22273
+ data.value = values[data.columnCode] || [];
22274
+ } else {
22275
+ try {
22276
+ data.value = component.defaultInfo || [];
22277
+ } catch (e) {
22278
+ data.value = [];
22279
+ }
22280
+ }
22281
+ break;
22282
+ }
22283
+ case 13:
22284
+ //子表单
22285
+ {
22286
+ data.value = values ? values[data.columnCode] || [] : [];
22287
+ data.moduleDefinition = data.moduleDefinition ? data.moduleDefinition : [];
22288
+ var moduleDefinition = [];
22289
+ for (var i in data.moduleDefinition) {
22290
+ var childColumn = formatColumnVal(data.moduleDefinition[i]);
22291
+ if (childColumn) {
22292
+ moduleDefinition.push(childColumn);
22293
+ }
22294
+ }
22295
+ data.moduleDefinition = moduleDefinition;
22296
+
22297
+ // 性能优化:预先构建默认值映射,减少重复计算
22298
+ if (data.value.length > 0 && data.moduleDefinition.length > 0) {
22299
+ var defaultValueMap = {};
22300
+ data.moduleDefinition.forEach(function (definition) {
22301
+ defaultValueMap[definition.columnCode] = definition.value;
22302
+ });
22303
+
22304
+ // 修正data.value中的数据,确保每个对象都包含moduleDefinition中所有字段
22305
+ data.value.forEach(function (item) {
22306
+ // 直接在原对象上补充缺失字段,避免创建新对象
22307
+ for (var columnCode in defaultValueMap) {
22308
+ if (!(columnCode in item)) {
22309
+ item[columnCode] = defaultValueMap[columnCode];
22310
+ }
22311
+ }
22312
+ });
22313
+ }
22314
+ break;
22315
+ }
22316
+ case 14: //地址组件
22317
+ case 15:
22318
+ //收寄信息组件
22319
+ {
22320
+ var val = {};
22321
+ var editValue = values ? values[data.columnCode] : null;
22322
+ data.moduleDefinition.forEach(function (item) {
22323
+ if (editValue) {
22324
+ val[item.columnCode] = editValue[item.columnCode] || (item.behaviorType == 6 ? [] : '');
22325
+ } else {
22326
+ val[item.columnCode] = item.behaviorType == 6 ? [] : '';
22327
+ }
22328
+ });
22329
+ data.value = val;
22330
+ break;
22331
+ }
22332
+ }
22333
+ return data;
22334
+ }
22335
+
22336
+ /**
22337
+ * 格式化查看、编辑、组件列表
22338
+ * */
22339
+ function tidyComponents(components, appId, tableId, values) {
22340
+ var componentList = [];
22341
+ var power = values && values.id ? 'isEditable' : 'isAddable';
22342
+ components.forEach(function (item) {
22343
+ var component = formatColumnVal(_objectSpread(_objectSpread({}, item), {}, {
22344
+ appId: appId,
22345
+ tableId: tableId
22346
+ }), values, power);
22347
+ if (component) {
22348
+ componentList.push(component);
22349
+ }
22350
+ });
22351
+ return componentList;
22352
+ }
22353
+
22354
+ /**
22355
+ * 展示子表单详情,将附件的完整value进行组装,只能在展示的时候用哦,编辑可别用
22356
+ * component 子表单
22357
+ * data 整条工单数据包含子表单包含inside
22358
+ * */
22359
+ function tidyShowSubDataFile(component, data) {
22360
+ var fullSubData = cloneDeep(data.inside[component.columnCode]);
22361
+ var subData = cloneDeep(data[component.columnCode]);
22362
+ var files = component.moduleDefinition.filter(function (c) {
22363
+ return c.behaviorType == 10;
22364
+ });
22365
+ if (files.length > 0) {
22366
+ subData.forEach(function (item, index) {
22367
+ item.inside = {};
22368
+ files.forEach(function (i) {
22369
+ if (item[i.columnCode]) {
22370
+ item.inside[i.columnCode] = fullSubData[index][i.columnCode];
22371
+ }
22372
+ });
22373
+ });
22374
+ }
22375
+ return subData;
22376
+ }
22377
+
22378
+ /**
22379
+ * 整理跳转工作表的筛选条件
22380
+ * */
22381
+ function tidyJumpSearchData(searchData, components) {
22382
+ var searchList = [];
22383
+ try {
22384
+ searchData.forEach(function (item) {
22385
+ var component = components.find(function (i) {
22386
+ return i.columnCode == item.id;
22387
+ });
22388
+ if (component) {
22389
+ searchList.push({
22390
+ behaviorType: component.behaviorType,
22391
+ columnCode: component.columnCode,
22392
+ name: component.name,
22393
+ searchType: item.searchType,
22394
+ value: item.value
22395
+ });
22396
+ }
22397
+ });
22398
+ } catch (e) {
22399
+ console.log('tidyJumpSearchDataErr:' + e);
22400
+ }
22401
+ return searchList;
22402
+ }
22403
+
22404
+ /**
22405
+ * 接口日志记录器,将系统最近100条接口请求记录到localStrage缓存中去
22406
+ * @param {Object} res 接口返回体
22407
+ */
22408
+ function formatLogDate() {
22409
+ var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
22410
+ var d = new Date(date);
22411
+ var pad = function pad(n) {
22412
+ return String(n).padStart(2, '0');
22413
+ };
22414
+ var year = d.getFullYear();
22415
+ var month = pad(d.getMonth() + 1);
22416
+ var day = pad(d.getDate());
22417
+ var hour = pad(d.getHours());
22418
+ var minute = pad(d.getMinutes());
22419
+ var second = pad(d.getSeconds());
22420
+ return "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hour, ":").concat(minute, ":").concat(second);
22421
+ }
22422
+ /**
22423
+ * 接口日志记录器,将系统最近100条接口请求记录到localStrage缓存中去
22424
+ * @param {Object} res 接口返回体
22425
+ */
22426
+ var recordApiLog = function recordApiLog(res) {
22427
+ try {
22428
+ var logs = JSON.parse(localStorage.getItem('webLog') || 'false') || [];
22429
+ var sessionInfo = JSON.parse(localStorage.getItem('sessionInfo') || 'false') || {};
22430
+ // 获取用户信息
22431
+ try {
22432
+ var params = res.config.data ? JSON.parse(res.config.data) : {};
22433
+ var data = res.data.data;
22434
+ if (res.config.url.indexOf('/v2/logins/checkSession') >= 0) {
22435
+ var _data$userInfo, _data$userInfo2, _data$company, _data$company2;
22436
+ sessionInfo.userName = (_data$userInfo = data.userInfo) === null || _data$userInfo === void 0 ? void 0 : _data$userInfo.workNick;
22437
+ sessionInfo.userId = (_data$userInfo2 = data.userInfo) === null || _data$userInfo2 === void 0 ? void 0 : _data$userInfo2.id;
22438
+ sessionInfo.companyName = (_data$company = data.company) === null || _data$company === void 0 ? void 0 : _data$company.companyName;
22439
+ sessionInfo.companyId = (_data$company2 = data.company) === null || _data$company2 === void 0 ? void 0 : _data$company2.id;
22440
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22441
+ } else if (res.config.url.indexOf('/biztable/definition/table?tableCode') >= 0) {
22442
+ sessionInfo.appId = data.appId;
22443
+ sessionInfo.tableId = data.tableId;
22444
+ sessionInfo.tableCode = data.tableCode;
22445
+ sessionInfo.taskId = '';
22446
+ sessionInfo.url = window.location.href;
22447
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22448
+ } else if (res.config.url.indexOf('/biztable/content/get') >= 0) {
22449
+ sessionInfo.taskId = data.view.id;
22450
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22451
+ } else if (res.config.url.indexOf('/v2/project/task/queryV3/') >= 0) {
22452
+ sessionInfo.appId = params.appId;
22453
+ sessionInfo.tableId = params.id;
22454
+ sessionInfo.taskId = '';
22455
+ sessionInfo.tableCode = '';
22456
+ sessionInfo.workflowId = '';
22457
+ sessionInfo.workFlowNodeId = '';
22458
+ sessionInfo.instanceId = '';
22459
+ sessionInfo.processCode = '';
22460
+ sessionInfo.url = window.location.href;
22461
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22462
+ } else if (res.config.url.indexOf('/v2/project/task/queryByTaskId') >= 0) {
22463
+ sessionInfo.taskId = data.id;
22464
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22465
+ }
22466
+ // 流程代办取小程序id,工作表id
22467
+ else if (res.config.url.indexOf('/v2/unitman/list/todo/pendingTaskList') >= 0) {
22468
+ sessionInfo.appId = params.appId;
22469
+ sessionInfo.tableId = params.tableId;
22470
+ sessionInfo.taskId = '';
22471
+ sessionInfo.tableCode = '';
22472
+ sessionInfo.workflowId = '';
22473
+ sessionInfo.workFlowNodeId = '';
22474
+ sessionInfo.instanceId = '';
22475
+ sessionInfo.processCode = '';
22476
+ sessionInfo.url = window.location.href;
22477
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22478
+ }
22479
+ // 流程代办取流程详细信息
22480
+ else if (res.config.url.indexOf('v2/unitman/list/taskDetail') >= 0) {
22481
+ sessionInfo.taskId = params.tableTaskId;
22482
+ sessionInfo.workflowId = params.workflowId;
22483
+ sessionInfo.workFlowNodeId = params.workflowNodeId;
22484
+ sessionInfo.instanceId = data.workflowInstanceId;
22485
+ sessionInfo.processCode = data.processCode;
22486
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22487
+ }
22488
+ // 流程工单获取流程id
22489
+ else if (res.config.url.indexOf('/wf/config/findWfTmpVersionByInstanceId') >= 0) {
22490
+ sessionInfo.workflowId = data.id;
22491
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22492
+ } // 流程工单获取流程编号
22493
+ else if (res.config.url.indexOf('/wf/config/findWfTmpVersionByInstanceId') >= 0) {
22494
+ sessionInfo.taskId = data.id;
22495
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22496
+ } //获取流程其他信息
22497
+ else if (res.config.url.indexOf('/v2/scheduleCenter/query/queryNodeList') >= 0) {
22498
+ var node = data.content ? data.content[0] : {};
22499
+ sessionInfo.workFlowNodeId = node.templateNodeId;
22500
+ sessionInfo.instanceId = node.instanceId;
22501
+ sessionInfo.processCode = node.processCode;
22502
+ localStorage.setItem('sessionInfo', JSON.stringify(sessionInfo));
22503
+ }
22504
+ } catch (e) {
22505
+ console.log('apiLog:' + e);
22506
+ }
22507
+ var log = {
22508
+ url: res.config.url,
22509
+ code: res.data ? res.data.code : null,
22510
+ time: formatLogDate(res.headers.date),
22511
+ traceId: res.headers['trace-id'] || '未返回'
22512
+ };
22513
+ logs = [log].concat(bn_util_toConsumableArray(logs)).slice(0, 50);
22514
+ localStorage.setItem('webLog', JSON.stringify(logs));
22515
+ } catch (err) {
22516
+ console.log("\u4E00\u6761\u65E5\u5FD7\u672A\u80FD\u6210\u529F\u6355\u6349\uFF1A".concat(JSON.stringify(res)));
22517
+ }
22518
+ };
22519
+ /**
22520
+ * 跳转主应用路由
22521
+ * 无界子应用内通过 bus 通知主应用改地址栏;独立运行时跳转到主应用入口
22522
+ * @param {string|{ name?: string, path?: string, params?: object, query?: object }} route
22523
+ */
22524
+
22525
+ function mainAppRouterPush(route) {
22526
+ if (window.__POWERED_BY_WUJIE__) {
22527
+ var _window$$wujie;
22528
+ (_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 || _window$$wujie.bus.$emit('router-jump', route);
22529
+ } else {}
22530
+ }
22531
+ /**
22532
+ * 地址自动识别
22533
+ * */
20709
22534
 
20710
22535
  ;// ./install.js
20711
22536
  // install.js - BnAppletUi 组件库入口