three-trees-ui 1.0.78 → 1.0.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-trees-ui",
3
- "version": "1.0.78",
3
+ "version": "1.0.79",
4
4
  "publicPath": "/ui",
5
5
  "author": "hotent",
6
6
  "private": false,
@@ -111,7 +111,7 @@
111
111
  ? 'id'
112
112
  : this.config && this.config.hasOwnProperty('code')
113
113
  ? 'code'
114
- : this.selectLabel
114
+ : 'id'
115
115
  },
116
116
  },
117
117
  mounted() {
@@ -196,7 +196,7 @@
196
196
  ? 'id'
197
197
  : this.config && this.config.hasOwnProperty('code')
198
198
  ? 'code'
199
- : this.selectLabel
199
+ : 'id'
200
200
  },
201
201
  },
202
202
  watch: {
@@ -971,11 +971,11 @@
971
971
  const {
972
972
  summaryMethod,
973
973
  summaryType,
974
- name,
975
974
  tableName,
976
975
  oldTableField,
977
976
  fieldDesc,
978
977
  } = tableFieldItem
978
+ let name = tableFieldItem.fieldsAlias || tableFieldItem.name
979
979
  if (!summaryMethod) {
980
980
  sums[index] = ''
981
981
  return
@@ -1036,7 +1036,13 @@
1036
1036
  return hasValueList.length
1037
1037
  },
1038
1038
  getSum(data, field) {
1039
- const sumResult = data.reduce((pre, cur) => pre + Number(cur[field]), 0)
1039
+ const sumResult = data.reduce((pre, cur) => {
1040
+ if (!isNaN(Number(cur[field]))) {
1041
+ return pre + Number(cur[field])
1042
+ } else {
1043
+ return pre
1044
+ }
1045
+ }, 0)
1040
1046
  return sumResult ? utils.thousandBit(sumResult) : sumResult
1041
1047
  },
1042
1048
  getPropTable(field, tableName, oldTableField) {
@@ -11,6 +11,8 @@ import moment from 'moment'
11
11
  export default {
12
12
  data() {
13
13
  return {
14
+ bindKey: {},
15
+ bindValue: {},
14
16
  defaultQuerys: [],
15
17
  isInit: true,
16
18
  bpmRunTime: this.$requestConfig.flowUrl,
@@ -613,8 +615,34 @@ export default {
613
615
  alias: this.alias || this.queryView.alias,
614
616
  param: dataTemplateQueryVo,
615
617
  }
618
+ // 自定义对话框查询参数修改
619
+ if (isSearchBtn) {
620
+ obj.param = this.makeCustomDialogParam(obj.param)
621
+ }
616
622
  this.getQuerySqlViewByPagination(obj, cb)
617
623
  },
624
+ // 高级查询 自定义对话框查询参数修改
625
+ makeCustomDialogParam(data) {
626
+ //处理绑定字段
627
+ this.bindValue = this.searchForm.bindValue || this.bindValue
628
+ this.bindKey = this.searchForm.bindKey || this.bindKey
629
+ //记录后再删除
630
+ delete this.searchForm.bindValue
631
+ delete this.searchForm.bindKey
632
+ if (data.queryFilter && data.queryFilter.querys) {
633
+ data.queryFilter.querys.forEach((k) => {
634
+ Object.keys(this.bindKey).forEach((key) => {
635
+ if (key === k.property) {
636
+ let valueKey = this.bindKey[key]
637
+ if (this.bindValue[key] && this.bindValue[key][valueKey]) {
638
+ k.value = this.bindValue[key][valueKey]
639
+ }
640
+ }
641
+ })
642
+ })
643
+ }
644
+ return data
645
+ },
618
646
  getQuerySqlViewByPagination(param, cb) {
619
647
  if (this.needRequestTotal) {
620
648
  // 调用后端接口更新 tableDataTotal
@@ -697,6 +725,12 @@ export default {
697
725
  params = { pageBean: this.pagination, querys }
698
726
  return params
699
727
  } else {
728
+ //处理绑定字段
729
+ this.bindValue = this.searchForm.bindValue || this.bindValue
730
+ this.bindKey = this.searchForm.bindKey || this.bindKey
731
+ //记录后再删除
732
+ delete this.searchForm.bindValue
733
+ delete this.searchForm.bindKey
700
734
  for (var key in this.searchForm) {
701
735
  if (
702
736
  typeof this.searchForm[key] != 'undefined' &&
@@ -727,7 +761,12 @@ export default {
727
761
  })
728
762
  }
729
763
  }
730
- } else if (this.searchForm[key].includes(',') && !specialMap[key]) {
764
+ } else if (
765
+ this.searchForm[key] &&
766
+ typeof this.searchForm[key] === 'string' &&
767
+ this.searchForm[key].includes(',') &&
768
+ !specialMap[key]
769
+ ) {
731
770
  let arr = this.searchForm[key].split(',')
732
771
  for (let i = 0; i < arr.length; i++) {
733
772
  if (
@@ -749,9 +788,20 @@ export default {
749
788
  })
750
789
  })
751
790
  } else {
791
+ let value = this.searchForm[key]
792
+ //在表单列表的查询字段中添加的对话框控件 此处逻辑对应 packages/CustomDialog/src/customDialog.vue:1920行
793
+ if (
794
+ this.bindValue &&
795
+ Object.keys(this.bindValue).length &&
796
+ this.bindValue[key] &&
797
+ Object.keys(this.bindKey).length
798
+ ) {
799
+ //获得绑定字段的值
800
+ value = this.bindValue[key][this.bindKey[key]]
801
+ }
752
802
  querys.push({
753
803
  property: key,
754
- value: this.searchForm[key],
804
+ value: value,
755
805
  group: 'main',
756
806
  operation: operationMap[key],
757
807
  relation: 'AND',
@@ -1396,6 +1446,7 @@ export default {
1396
1446
  alias: this.alias || this.queryView.alias,
1397
1447
  param: dataTemplateQueryVo,
1398
1448
  }
1449
+
1399
1450
  this.getQuerySqlViewByPaginationTotal(obj, cb)
1400
1451
  },
1401
1452
  switchPage(type) {
@@ -12,7 +12,7 @@ import _ from 'lodash'
12
12
  import { decode } from '@/util/base64'
13
13
  import moment from 'moment'
14
14
 
15
- const req = function (url, data = {}, option = {}) {
15
+ const req = function(url, data = {}, option = {}) {
16
16
  const requestData = {
17
17
  url: url,
18
18
  data: data,
@@ -299,7 +299,7 @@ export default {
299
299
  deep: true,
300
300
  },
301
301
  ents: {
302
- handler: function (newVal, oldValue) {
302
+ handler: function(newVal, oldValue) {
303
303
  if (newVal && newVal.length >= 1 && newVal != oldValue) {
304
304
  this.getSubData(this, this.refId)
305
305
  }
@@ -308,7 +308,7 @@ export default {
308
308
  immediate: true,
309
309
  },
310
310
  templateInfo: {
311
- handler: async function (newVal) {
311
+ handler: async function(newVal) {
312
312
  if (newVal && newVal.id) {
313
313
  let _me = this
314
314
  _me.templateInfo = newVal
@@ -428,13 +428,13 @@ export default {
428
428
  deep: true,
429
429
  immediate: true,
430
430
  },
431
- currentTabName: function (newVal) {
431
+ currentTabName: function(newVal) {
432
432
  if (newVal) {
433
433
  this.querySubValue = ''
434
434
  }
435
435
  },
436
436
  rows: {
437
- handler: function (newVal) {
437
+ handler: function(newVal) {
438
438
  if (this.templateInfo.defId) {
439
439
  let this_ = this
440
440
  let boAlias = this.templateInfo.boDefAlias
@@ -476,8 +476,9 @@ export default {
476
476
  if (val) {
477
477
  this.$nextTick(() => {
478
478
  if (document.getElementById('summaryDiv')) {
479
- this.summaryTableHeight =
480
- document.getElementById('summaryDiv').clientHeight
479
+ this.summaryTableHeight = document.getElementById(
480
+ 'summaryDiv'
481
+ ).clientHeight
481
482
  }
482
483
  })
483
484
  }
@@ -488,7 +489,7 @@ export default {
488
489
  //如果当前页面被嵌入iframe里面不显示草稿
489
490
  return !this.isJoinFlow
490
491
  },
491
- navbarCollapseStyle: function () {
492
+ navbarCollapseStyle: function() {
492
493
  if (this.asideShow) {
493
494
  return { left: '200px' }
494
495
  }
@@ -527,7 +528,7 @@ export default {
527
528
  })
528
529
  this.handelBindFiledValua()
529
530
  let this_ = this
530
- this.$on('data-reload-success', function () {
531
+ this.$on('data-reload-success', function() {
531
532
  this_.calcScriptBtnPermission()
532
533
  })
533
534
  this.$emit('afterMounted')
@@ -873,7 +874,7 @@ export default {
873
874
  this.listSelectable = false
874
875
  }
875
876
  let _this = this
876
- setTimeout(function () {
877
+ setTimeout(function() {
877
878
  let tdDom = _this.$el.querySelector('td.right_menu')
878
879
  if (
879
880
  !tdDom ||
@@ -978,7 +979,7 @@ export default {
978
979
  selectList[i].selectValue = value
979
980
 
980
981
  //添加监听
981
- pInst.$watch(path, function (newVal, oldVal) {
982
+ pInst.$watch(path, function(newVal, oldVal) {
982
983
  // 监听中使用间隔请求,减少请求次数
983
984
  clearTimeout(this.timeout)
984
985
  this.timeout = setTimeout(() => {
@@ -1001,7 +1002,7 @@ export default {
1001
1002
  const value = utils.getValueByPath(pInst, path)
1002
1003
 
1003
1004
  bindList[i].fillValue = value
1004
- pInst.$watch(path, function (newVal, oldVal) {
1005
+ pInst.$watch(path, function(newVal, oldVal) {
1005
1006
  // 监听中使用间隔请求,减少请求次数
1006
1007
  clearTimeout(this.timeout)
1007
1008
  this.timeout = setTimeout(() => {
@@ -1259,7 +1260,7 @@ export default {
1259
1260
  }
1260
1261
  let msg = document.createElement('canvas')
1261
1262
 
1262
- this.$qrcode.toCanvas(msg, QRCodeurl, function (error) {
1263
+ this.$qrcode.toCanvas(msg, QRCodeurl, function(error) {
1263
1264
  console.error(error)
1264
1265
  })
1265
1266
  let _canvas = document.createElement('div')
@@ -1299,7 +1300,7 @@ export default {
1299
1300
  .generateAsync({
1300
1301
  type: 'blob',
1301
1302
  })
1302
- .then(function (content) {
1303
+ .then(function(content) {
1303
1304
  let eleLink = document.createElement('a')
1304
1305
  eleLink.download = '二维码.zip'
1305
1306
  eleLink.style.display = 'none'
@@ -1352,7 +1353,7 @@ export default {
1352
1353
  context.scale(2, 2)
1353
1354
  return html2canvas(document.querySelector(classs), {
1354
1355
  canvas: canvas2,
1355
- }).then(function (canvas) {
1356
+ }).then(function(canvas) {
1356
1357
  resolve(canvas)
1357
1358
  })
1358
1359
  })
@@ -1394,7 +1395,7 @@ export default {
1394
1395
  // Base64.encode(this.$store.state.login.currentUser.account);
1395
1396
  let msg = document.getElementById('QRCode')
1396
1397
 
1397
- this.$qrcode.toCanvas(msg, this.QRCodeurl, function (error) {
1398
+ this.$qrcode.toCanvas(msg, this.QRCodeurl, function(error) {
1398
1399
  console.log(error)
1399
1400
  })
1400
1401
  this.QRCodeShow = true
@@ -1419,13 +1420,13 @@ export default {
1419
1420
  this.rowTemplateId = templateId
1420
1421
  this.rowId = id
1421
1422
  },
1422
- handleSizeChange: function (size) {
1423
+ handleSizeChange: function(size) {
1423
1424
  //每页下拉显示数据
1424
1425
  this.pagination.page = 1
1425
1426
  this.pagination.pageSize = size
1426
1427
  this.$refs.multipleTemplateTable.handleFilterChange()
1427
1428
  },
1428
- handleCurrentChange: function (currentPage) {
1429
+ handleCurrentChange: function(currentPage) {
1429
1430
  //点击第几页,如果当前页数没有值,则默认用上一次页数
1430
1431
  this.pagination.page = currentPage ? currentPage : this.lastPage
1431
1432
  this.$refs.multipleTemplateTable.handleFilterChange()
@@ -2196,10 +2197,18 @@ export default {
2196
2197
  ? operationType[operation]
2197
2198
  : operation
2198
2199
  } else if (
2199
- typeof $(searchItems[i]).children().attr('ht-query') != 'undefined'
2200
+ typeof $(searchItems[i])
2201
+ .children()
2202
+ .attr('ht-query') != 'undefined'
2200
2203
  ) {
2201
- operation = $(searchItems[i]).children().attr('operation')
2202
- operationMap[$(searchItems[i]).children().attr('ht-query')] =
2204
+ operation = $(searchItems[i])
2205
+ .children()
2206
+ .attr('operation')
2207
+ operationMap[
2208
+ $(searchItems[i])
2209
+ .children()
2210
+ .attr('ht-query')
2211
+ ] =
2203
2212
  typeof operationType[operation] != 'undefined'
2204
2213
  ? operationType[operation]
2205
2214
  : operation
@@ -2225,10 +2234,18 @@ export default {
2225
2234
  ? operationType[operation]
2226
2235
  : operation
2227
2236
  } else if (
2228
- typeof $(searchItems[i]).children().attr('ht-query') != 'undefined'
2237
+ typeof $(searchItems[i])
2238
+ .children()
2239
+ .attr('ht-query') != 'undefined'
2229
2240
  ) {
2230
- operation = $(searchItems[i]).children().attr('type')
2231
- operationMap[$(searchItems[i]).children().attr('ht-query')] =
2241
+ operation = $(searchItems[i])
2242
+ .children()
2243
+ .attr('type')
2244
+ operationMap[
2245
+ $(searchItems[i])
2246
+ .children()
2247
+ .attr('ht-query')
2248
+ ] =
2232
2249
  typeof operationType[operation] != 'undefined'
2233
2250
  ? operationType[operation]
2234
2251
  : operation
@@ -2251,12 +2268,19 @@ export default {
2251
2268
  ? true
2252
2269
  : false
2253
2270
  } else if (
2254
- typeof $(searchItems[i]).children().attr('ht-query') != 'undefined'
2271
+ typeof $(searchItems[i])
2272
+ .children()
2273
+ .attr('ht-query') != 'undefined'
2255
2274
  ) {
2256
2275
  //查询条件字段
2257
- fieldQueryMap[$(searchItems[i]).children().attr('ht-query')] =
2258
- typeof $(searchItems[i]).children().attr('special-query') !=
2259
- 'undefined'
2276
+ fieldQueryMap[
2277
+ $(searchItems[i])
2278
+ .children()
2279
+ .attr('ht-query')
2280
+ ] =
2281
+ typeof $(searchItems[i])
2282
+ .children()
2283
+ .attr('special-query') != 'undefined'
2260
2284
  ? true
2261
2285
  : false
2262
2286
  }
@@ -2324,7 +2348,7 @@ export default {
2324
2348
  }
2325
2349
  },
2326
2350
  //回车查询
2327
- searchEnterFun: function (e) {
2351
+ searchEnterFun: function(e) {
2328
2352
  let keyCode = window.event ? e.keyCode : e.which
2329
2353
  if (keyCode == 13) {
2330
2354
  this.search()