askbot-dragon 1.5.29 → 1.5.30

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": "askbot-dragon",
3
- "version": "1.5.29",
3
+ "version": "1.5.30",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1870,7 +1870,12 @@ export default {
1870
1870
  if (type === 'TIME_PICKER') {
1871
1871
  if(this.formList.form.formFieldRelation[i].value!==''&& this.formList.form.formFieldRelation[i].value!==null)
1872
1872
  {
1873
- const dateTime = new Date(this.formList.form.formFieldRelation[i].value)
1873
+ // 判断是否是时间戳 时间戳为字符串转换为Number
1874
+ var regex = /^\d{13}$/;
1875
+ if (regex.test(this.formList.form.formFieldRelation[i].value)){
1876
+ this.formList.form.formFieldRelation[i].value = Number(this.formList.form.formFieldRelation[i].value)
1877
+ }
1878
+ const dateTime = new Date(this.formList.form.formFieldRelation[i].value);
1874
1879
  if (!this.formList.form.formFieldRelation[i].formField.extInfo.mold ||
1875
1880
  this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'TIME' ||
1876
1881
  this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'TIME'){
@@ -1883,10 +1888,18 @@ export default {
1883
1888
  this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = this.formList.form.formFieldRelation[i].value;
1884
1889
  this.formList.form.formFieldRelation[i].value = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate() + " " + this.formList.form.formFieldRelation[i].value;
1885
1890
  } else {
1886
- this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = this.formList.form.formFieldRelation[i].value
1891
+ if (regex.test(this.formList.form.formFieldRelation[i].value)){
1892
+ this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = dateTime
1893
+ } else {
1894
+ this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = this.formList.form.formFieldRelation[i].value
1895
+ }
1887
1896
  }
1888
1897
  } else {
1889
- this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = this.formList.form.formFieldRelation[i].value
1898
+ if (regex.test(this.formList.form.formFieldRelation[i].value)){
1899
+ this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = dateTime.Format('hh:mm')
1900
+ } else {
1901
+ this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = this.formList.form.formFieldRelation[i].value
1902
+ }
1890
1903
  }
1891
1904
  }
1892
1905
  else if (this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATA_TIME' ||
@@ -2080,8 +2093,10 @@ export default {
2080
2093
  let textFlag = true
2081
2094
  let imageFlag = true
2082
2095
  let attachmentFlag = true
2096
+ let imageOrAttachment = true
2083
2097
  let errorText = ''
2084
2098
  let checkDescription = {
2099
+ checkImageOrAttachment:this.workOrderDestail.checkImageOrAttachment ? this.workOrderDestail.checkImageOrAttachment : false,
2085
2100
  checkText:this.workOrderDestail.checkText ? this.workOrderDestail.checkText : false,
2086
2101
  checkImage:this.workOrderDestail.checkImage ? this.workOrderDestail.checkImage : false,
2087
2102
  checkAttachment:this.workOrderDestail.checkAttachment ? this.workOrderDestail.checkAttachment : false,
@@ -2099,16 +2114,24 @@ export default {
2099
2114
  d = null
2100
2115
  }
2101
2116
  }
2117
+ if(checkDescription.checkImageOrAttachment) {
2118
+ if(!this.workOrderDestail.value.includes('img') && this.attachmentList.length == 0) {
2119
+ imageOrAttachment = false
2120
+ }
2121
+ }
2102
2122
  if (checkDescription.checkImage && !this.workOrderDestail.value.includes('img')) {
2103
2123
  imageFlag = false
2104
2124
  }
2105
- if (checkDescription.checkAttachment && this.attachments.length == 0) {
2125
+ if (checkDescription.checkAttachment && this.attachmentList.length == 0) {
2106
2126
  attachmentFlag = false
2107
2127
  }
2108
2128
  let text = this.isBaiLi ? '反馈描述' : '问题描述'
2109
2129
  if (!textFlag) {
2110
2130
  errorText = text + '必须要有文字'
2111
2131
  }
2132
+ if(!imageOrAttachment) {
2133
+ errorText = text + '必须要有图片或附件'
2134
+ }
2112
2135
  if (!imageFlag) {
2113
2136
  errorText = text + '必须要有图片'
2114
2137
  }
@@ -2130,7 +2153,7 @@ export default {
2130
2153
  } else {
2131
2154
  let d = document.createElement('div')
2132
2155
  d.innerHTML = this.workOrderDestail.value
2133
- if (checkDescription.required && !d.innerText && !this.workOrderDestail.value.includes('img') && this.attachments.length == 0) {
2156
+ if (checkDescription.required && !d.innerText && !this.workOrderDestail.value.includes('img') && this.attachmentList.length == 0) {
2134
2157
  let errorText = this.isBaiLi ? '反馈描述是必填的' : '问题描述是必填的'
2135
2158
  this.$message.error(errorText);
2136
2159
  return false
@@ -2230,7 +2253,6 @@ export default {
2230
2253
  }
2231
2254
  let extInfo = {
2232
2255
  extInfoFieldValue:this.extInfoFieldValue,
2233
- attachments:this.attachments,
2234
2256
  attachmentList:this.attachmentList
2235
2257
  }
2236
2258
  this.$set(this.formShow,'extInfo',extInfo)
@@ -2967,76 +2989,8 @@ export default {
2967
2989
  }
2968
2990
  return flag
2969
2991
  },
2970
- getAttach (newVal) {
2971
- let d = document.createElement('div')
2972
- d.innerHTML = newVal
2973
- let uploadList = d.getElementsByClassName('ask-component-placeholder-container')
2974
- if (uploadList) {
2975
- for (let index = 0; index < uploadList.length; index++) {
2976
- if(!uploadList[index].childNodes[0] || !uploadList[index].childNodes[0].getAttribute) {
2977
- break
2978
- }
2979
- if (uploadList[index].childNodes[0].getAttribute('type') == 'upload' || uploadList[index].childNodes[0].getAttribute('type') == 'undefined') {
2980
- this.uploadImgQueue = true
2981
- let text = uploadList[index].innerText.replace('正在上传...', '')
2982
- let i = uploadList[index].childNodes[0].getAttribute('data')
2983
- if (newVal.includes(text + i)) {
2984
- uploadList[index].setAttribute('type', 'upload')
2985
- let ht = '<span class="ask-component-placeholder-container">' + uploadList[index].innerHTML + '</span>'
2986
- newVal = newVal.replace(ht, '')
2987
- this.uploadImgQueue = false
2988
- let time = setTimeout(() => {
2989
- this.currentEditor.model.change(writer => {
2990
- writer.setSelection(writer.createPositionAt(this.currentEditor.model.document.getRoot(), 'end'));
2991
- })
2992
- this.currentEditor.editing.view.focus();
2993
- clearTimeout(time)
2994
- }, 500)
2995
- }
2996
- }
2997
- if (uploadList[index].childNodes[0].getAttribute('type') == 'MyFile' || uploadList[index].childNodes[0].getAttribute('type') == 'FileUpload') {
2998
- let span = uploadList[index].getElementsByClassName('ask-component-placeholder-span')[0]
2999
- const text = span.innerText
3000
- let value = ''
3001
- let id = ''
3002
- if (typeof span.getAttribute('data') == 'string' && !span.getAttribute('data').includes('default')) {
3003
- id = span.getAttribute('data')
3004
- this.attachmentList.push({
3005
- name: text,
3006
- id: id,
3007
- url: '',
3008
- })
3009
- } else {
3010
- value = JSON.parse(span.getAttribute('data')).default
3011
- id = JSON.parse(span.getAttribute('data')).id
3012
- this.attachments.push(value)
3013
- this.attachmentList = this.attachmentList.filter(attach => {
3014
- return attach.id != id
3015
- })
3016
- this.attachmentList.push({
3017
- name: text,
3018
- url: value,
3019
- })
3020
- let time = setTimeout(() => {
3021
- this.currentEditor.model.change(writer => {
3022
- writer.setSelection(writer.createPositionAt(this.currentEditor.model.document.getRoot(), 'end'));
3023
- })
3024
- this.currentEditor.editing.view.focus();
3025
- clearTimeout(time)
3026
- }, 500)
3027
- }
3028
- uploadList[index].setAttribute('type', 'MyFile')
3029
- let ht = '<span class="ask-component-placeholder-container">' + uploadList[index].innerHTML + '</span>'
3030
- newVal = newVal.replace(ht, '')
3031
- span = null
3032
- }
3033
- }
3034
- }
3035
- d = null
3036
- return newVal
3037
- },
3038
2992
  attachDeleteAttch (index) {
3039
- this.attachments.splice(index, 1)
2993
+ // this.attachments.splice(index, 1)
3040
2994
  this.attachmentList.splice(index, 1)
3041
2995
  },
3042
2996
  attachDeleteFile(index,fieldId){
@@ -3070,7 +3024,6 @@ export default {
3070
3024
  handler(val){
3071
3025
  let newVal = ''
3072
3026
  newVal = val.replace(/ style=".*?"/g, '');
3073
- // newVal = this.getAttach(newVal)
3074
3027
  if (this.currentEditor){
3075
3028
  if (this.workOrderDestail){
3076
3029
  this.$nextTick(() =>{