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