three-trees-ui 1.1.10 → 1.1.12

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.1.10",
3
+ "version": "1.1.12",
4
4
  "publicPath": "/ui",
5
5
  "author": "hotent",
6
6
  "private": false,
@@ -9,6 +9,7 @@
9
9
  :style="inputsContainerWidth"
10
10
  class="ht-file"
11
11
  >
12
+ <ht-input v-show="false" v-model="uploadingStatus" validate="isUploading" />
12
13
  <input
13
14
  v-model="value"
14
15
  v-validate="inputValidate"
@@ -117,6 +118,7 @@
117
118
  </div>
118
119
  </template>
119
120
  <script>
121
+ import '@/validate.js'
120
122
  import { component as viewer } from 'v-viewer'
121
123
  import 'viewerjs/dist/viewer.css'
122
124
  import utils from '@/utils.js'
@@ -275,6 +277,7 @@
275
277
  temp: null,
276
278
  refreshFileUploadDebounce: _.debounce(this.refreshFileUpload, 200),
277
279
  inputVal: [],
280
+ uploadingStatus: false,
278
281
  }
279
282
  },
280
283
  computed: {
@@ -462,6 +465,7 @@
462
465
  }
463
466
  })
464
467
  }
468
+ this.uploadingStatus = loadingStatus
465
469
  this.$emit('update:uploading', loadingStatus)
466
470
  },
467
471
  // 同步附件数据到上传组件
@@ -356,8 +356,10 @@
356
356
  checkValue(data) {
357
357
  let flag = false
358
358
  data.forEach((item) => {
359
- if (this.value.split(',').includes(item[this.propKey])) {
360
- flag = true
359
+ if (this.value) {
360
+ if (this.value.split(',').includes(item[this.propKey])) {
361
+ flag = true
362
+ }
361
363
  }
362
364
  })
363
365
  return flag
@@ -50,6 +50,7 @@ const dict = {
50
50
  return args && args['message'] ? args['message'] : '校验失败'
51
51
  },
52
52
  required: () => '必填',
53
+ isUploading: () => '附件未完成上传',
53
54
  isBefore: (field, args) => {
54
55
  return '日期必须小于' + args
55
56
  },
@@ -139,6 +140,7 @@ const dict = {
139
140
  return args && args['message'] ? args['message'] : '校驗失敗'
140
141
  },
141
142
  required: () => '必填',
143
+ isUploading: () => '附件未完成上傳',
142
144
  isBefore: (field, args) => {
143
145
  return '日期必須小於' + args
144
146
  },
@@ -228,6 +230,7 @@ const dict = {
228
230
  return args && args['message'] ? args['message'] : 'Verification failed'
229
231
  },
230
232
  required: () => 'Required',
233
+ isUploading: () => 'Attachment file is uploading',
231
234
  isBefore: (field, args) => {
232
235
  return 'Must be less than ' + args
233
236
  },
@@ -2390,11 +2390,13 @@ export default {
2390
2390
  .then(() => {
2391
2391
  let s = []
2392
2392
  for (let i = 0; i < this.tableData.selectRows.length; i++) {
2393
- s.push(
2394
- this.tableData.selectRows[i][
2395
- this.templateInfo.pkField ? this.templateInfo.pkField : 'id_'
2396
- ]
2397
- )
2393
+ let delId = this.tableData.selectRows[i][
2394
+ this.templateInfo.pkField ? this.templateInfo.pkField : 'id_'
2395
+ ]
2396
+ if (!delId && this.tableData.selectRows[i]['id_']) {
2397
+ delId = this.tableData.selectRows[i]['id_']
2398
+ }
2399
+ s.push(delId)
2398
2400
  }
2399
2401
  let data = {
2400
2402
  ids: s.join(','),
package/src/validate.js CHANGED
@@ -15,7 +15,7 @@ validate.install = (Vue) => {
15
15
  Validator.localize(dict)
16
16
 
17
17
  //比较类型。1,小于:datelessthan。2,小于等于:daterangeend。3,大于:datemorethan。4,大于等于:daterangestart
18
- const getDatevalAndCompare = function (selfValue, targetValue, compareType) {
18
+ const getDatevalAndCompare = function(selfValue, targetValue, compareType) {
19
19
  let targetDate = targetValue
20
20
  if (!targetDate) {
21
21
  return true
@@ -85,7 +85,15 @@ validate.install = (Vue) => {
85
85
  }
86
86
  return true
87
87
  }
88
-
88
+ Validator.extend('isUploading', {
89
+ validate: (value) => {
90
+ let result = value
91
+ if (value == 'false') {
92
+ result = false
93
+ }
94
+ return !result
95
+ },
96
+ })
89
97
  Validator.extend('isBefore', datelessthan)
90
98
  Validator.extend('isAfter', datemorethan)
91
99
  Validator.extend('isEnd', daterangeend)
@@ -109,10 +117,9 @@ validate.install = (Vue) => {
109
117
  return true
110
118
  }
111
119
  }
112
- var re =
113
- /^([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))/g.test(
114
- dateVal.trim()
115
- )
120
+ var re = /^([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))/g.test(
121
+ dateVal.trim()
122
+ )
116
123
  return re
117
124
  }
118
125
  },