askbot-dragon 1.5.79-beta → 1.5.80-beta

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.79-beta",
3
+ "version": "1.5.80-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -2102,14 +2102,14 @@ export default {
2102
2102
  }
2103
2103
  }
2104
2104
  if(checkDescription.checkImageOrAttachment) {
2105
- if(!this.workOrderDestail.value.includes('img') && this.attachments.length == 0) {
2105
+ if(!this.workOrderDestail.value.includes('img') && this.attachmentList.length == 0) {
2106
2106
  imageOrAttachment = false
2107
2107
  }
2108
2108
  }
2109
2109
  if (checkDescription.checkImage && !this.workOrderDestail.value.includes('img')) {
2110
2110
  imageFlag = false
2111
2111
  }
2112
- if (checkDescription.checkAttachment && this.attachments.length == 0) {
2112
+ if (checkDescription.checkAttachment && this.attachmentList.length == 0) {
2113
2113
  attachmentFlag = false
2114
2114
  }
2115
2115
  let text = this.isBaiLi ? '反馈描述' : '问题描述'
@@ -2140,7 +2140,7 @@ export default {
2140
2140
  } else {
2141
2141
  let d = document.createElement('div')
2142
2142
  d.innerHTML = this.workOrderDestail.value
2143
- if (checkDescription.required && !d.innerText && !this.workOrderDestail.value.includes('img') && this.attachments.length == 0) {
2143
+ if (checkDescription.required && !d.innerText && !this.workOrderDestail.value.includes('img') && this.attachmentList.length == 0) {
2144
2144
  let errorText = this.isBaiLi ? '反馈描述是必填的' : '问题描述是必填的'
2145
2145
  this.$message.error(errorText);
2146
2146
  return false
@@ -2240,7 +2240,6 @@ export default {
2240
2240
  }
2241
2241
  let extInfo = {
2242
2242
  extInfoFieldValue:this.extInfoFieldValue,
2243
- attachments:this.attachments,
2244
2243
  attachmentList:this.attachmentList
2245
2244
  }
2246
2245
  this.$set(this.formShow,'extInfo',extInfo)
@@ -2977,76 +2976,8 @@ export default {
2977
2976
  }
2978
2977
  return flag
2979
2978
  },
2980
- getAttach (newVal) {
2981
- let d = document.createElement('div')
2982
- d.innerHTML = newVal
2983
- let uploadList = d.getElementsByClassName('ask-component-placeholder-container')
2984
- if (uploadList) {
2985
- for (let index = 0; index < uploadList.length; index++) {
2986
- if(!uploadList[index].childNodes[0] || !uploadList[index].childNodes[0].getAttribute) {
2987
- break
2988
- }
2989
- if (uploadList[index].childNodes[0].getAttribute('type') == 'upload' || uploadList[index].childNodes[0].getAttribute('type') == 'undefined') {
2990
- this.uploadImgQueue = true
2991
- let text = uploadList[index].innerText.replace('正在上传...', '')
2992
- let i = uploadList[index].childNodes[0].getAttribute('data')
2993
- if (newVal.includes(text + i)) {
2994
- uploadList[index].setAttribute('type', 'upload')
2995
- let ht = '<span class="ask-component-placeholder-container">' + uploadList[index].innerHTML + '</span>'
2996
- newVal = newVal.replace(ht, '')
2997
- this.uploadImgQueue = false
2998
- let time = setTimeout(() => {
2999
- this.currentEditor.model.change(writer => {
3000
- writer.setSelection(writer.createPositionAt(this.currentEditor.model.document.getRoot(), 'end'));
3001
- })
3002
- this.currentEditor.editing.view.focus();
3003
- clearTimeout(time)
3004
- }, 500)
3005
- }
3006
- }
3007
- if (uploadList[index].childNodes[0].getAttribute('type') == 'MyFile' || uploadList[index].childNodes[0].getAttribute('type') == 'FileUpload') {
3008
- let span = uploadList[index].getElementsByClassName('ask-component-placeholder-span')[0]
3009
- const text = span.innerText
3010
- let value = ''
3011
- let id = ''
3012
- if (typeof span.getAttribute('data') == 'string' && !span.getAttribute('data').includes('default')) {
3013
- id = span.getAttribute('data')
3014
- this.attachmentList.push({
3015
- name: text,
3016
- id: id,
3017
- url: '',
3018
- })
3019
- } else {
3020
- value = JSON.parse(span.getAttribute('data')).default
3021
- id = JSON.parse(span.getAttribute('data')).id
3022
- this.attachments.push(value)
3023
- this.attachmentList = this.attachmentList.filter(attach => {
3024
- return attach.id != id
3025
- })
3026
- this.attachmentList.push({
3027
- name: text,
3028
- url: value,
3029
- })
3030
- let time = setTimeout(() => {
3031
- this.currentEditor.model.change(writer => {
3032
- writer.setSelection(writer.createPositionAt(this.currentEditor.model.document.getRoot(), 'end'));
3033
- })
3034
- this.currentEditor.editing.view.focus();
3035
- clearTimeout(time)
3036
- }, 500)
3037
- }
3038
- uploadList[index].setAttribute('type', 'MyFile')
3039
- let ht = '<span class="ask-component-placeholder-container">' + uploadList[index].innerHTML + '</span>'
3040
- newVal = newVal.replace(ht, '')
3041
- span = null
3042
- }
3043
- }
3044
- }
3045
- d = null
3046
- return newVal
3047
- },
3048
2979
  attachDeleteAttch (index) {
3049
- this.attachments.splice(index, 1)
2980
+ // this.attachments.splice(index, 1)
3050
2981
  this.attachmentList.splice(index, 1)
3051
2982
  },
3052
2983
  attachDeleteFile(index,fieldId){
@@ -3080,7 +3011,6 @@ export default {
3080
3011
  handler(val){
3081
3012
  let newVal = ''
3082
3013
  newVal = val.replace(/ style=".*?"/g, '');
3083
- // newVal = this.getAttach(newVal)
3084
3014
  if (this.currentEditor){
3085
3015
  if (this.workOrderDestail){
3086
3016
  this.$nextTick(() =>{