diff --git a/package.json b/package.json index 4d75a1f34..b238ac955 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "stylus-loader": "^7.1.0", "tinymce": "^5.10.3", "tui-calendar-hi": "^1.15.1-5", - "view-design-hi": "^4.7.0-49", + "view-design-hi": "^4.7.0-50", "vite": "^2.9.15", "vite-plugin-file-copy": "^1.0.0", "vite-plugin-require": "^1.1.10", diff --git a/resources/assets/js/functions/common.js b/resources/assets/js/functions/common.js index c50f30c14..972f26f13 100755 --- a/resources/assets/js/functions/common.js +++ b/resources/assets/js/functions/common.js @@ -1970,30 +1970,57 @@ const localforage = require("localforage"); if (typeof params.success === 'undefined') params.success = () => { }; if (typeof params.error === 'undefined') params.error = () => { }; if (typeof params.header == 'undefined') params.header = {}; + const key = $A.randomString(16); // params.before(); - $A.ihttp({ + $A.__ajaxList.push({ + key, + id: params.requestId || null, url: params.url, - data: params.data, - cache: params.cache, - headers: params.header, - method: params.method.toUpperCase(), - contentType: "OPTIONS", - crossDomain: true, - dataType: params.dataType, - timeout: params.timeout, - success: function (data, status, xhr) { - params.complete(); - params.success(data, status, xhr); - params.after(true); - }, - error: function (xhr, status) { - params.complete(); - params.error(xhr, status); - params.after(false); + request: $A.ihttp({ + url: params.url, + data: params.data, + cache: params.cache, + headers: params.header, + method: params.method.toUpperCase(), + contentType: "OPTIONS", + crossDomain: true, + dataType: params.dataType, + timeout: params.timeout, + success: function (data, status, xhr) { + $A.__ajaxList = $A.__ajaxList.filter(val => val.key !== key); + params.complete(); + params.success(data, status, xhr); + params.after(true); + }, + error: function (xhr, status) { + $A.__ajaxList = $A.__ajaxList.filter(val => val.key !== key); + params.complete(); + params.error(xhr, status); + params.after(false); + } + }) + }); + }, + ajaxcCancel(requestId) { + if (!requestId) { + return 0; + } + let num = 0; + $A.__ajaxList.forEach((val, index) => { + if (val.id === requestId) { + num++; + if (val.request) { + val.request.abort(); + } } }); - } + if (num > 0) { + $A.__ajaxList = $A.__ajaxList.filter(val => val.id !== requestId); + } + return num; + }, + __ajaxList: [], }); window.$A = $; diff --git a/resources/assets/js/pages/manage/components/DialogUpload.vue b/resources/assets/js/pages/manage/components/DialogUpload.vue index 61c7a414c..9de894b81 100644 --- a/resources/assets/js/pages/manage/components/DialogUpload.vue +++ b/resources/assets/js/pages/manage/components/DialogUpload.vue @@ -187,6 +187,11 @@ export default { //手动传file this.$refs.upload.upload(file); }, + + cancel(uid) { + //取消上传 + return this.$refs.upload.cancel(uid); + } } } diff --git a/resources/assets/js/pages/manage/components/DialogView.vue b/resources/assets/js/pages/manage/components/DialogView.vue index f2f3e2c71..18145453d 100644 --- a/resources/assets/js/pages/manage/components/DialogView.vue +++ b/resources/assets/js/pages/manage/components/DialogView.vue @@ -437,9 +437,6 @@ export default { methods: { handleLongpress(event, el) { - if (!this.msgData.created_at) { - return; - } this.$emit("on-longpress", {event, el, msgData: this.msgData}) }, @@ -515,7 +512,7 @@ export default { fileStyle(percentage) { if (percentage) { return { - width: (100 - percentage) + '%' + width: `${percentage}%` }; } return {}; diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 1c5be3ce8..8fb6a7856 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -273,74 +273,86 @@ transfer>
- -