diff --git a/resources/assets/js/components/ImgUpload.vue b/resources/assets/js/components/ImgUpload.vue index cda682c1d..7c8877156 100755 --- a/resources/assets/js/components/ImgUpload.vue +++ b/resources/assets/js/components/ImgUpload.vue @@ -46,7 +46,7 @@
{{$L('加载中...')}}
-
+
{{$L('无内容')}}
@@ -217,8 +217,9 @@ }, handleView (item) { //查看 - this.visible = true; - this.imgVisible = item.url; + this.$store.dispatch("previewImage", item.url) + // this.visible = true; + // this.imgVisible = item.url; }, handleRemove (item) { //删除 diff --git a/resources/assets/js/components/PreviewImage/state.vue b/resources/assets/js/components/PreviewImage/state.vue index c68ede3db..f67468fc3 100644 --- a/resources/assets/js/components/PreviewImage/state.vue +++ b/resources/assets/js/components/PreviewImage/state.vue @@ -23,8 +23,7 @@ export default { watch: { show(v) { if (v) { - this.$store.state.previewImageIndex = Math.max(this.$store.state.previewImageIndex, 0) - this.$store.state.previewImageIndex = Math.min(this.$store.state.previewImageIndex, this.$store.state.previewImageList.length - 1) + this.$store.state.previewImageIndex = Math.min(Math.max(this.$store.state.previewImageIndex, 0), this.$store.state.previewImageList.length - 1) } else { this.$store.state.previewImageIndex = 0; this.$store.state.previewImageList = []; @@ -33,9 +32,8 @@ export default { previewImageList(l) { if (l.length > 0) { if ($A.isEEUiApp) { - let position = Math.max(this.$store.state.previewImageIndex, 0) - position = Math.min(position, this.$store.state.previewImageList.length - 1) - let paths = l.map(item => { + const position = Math.min(Math.max(this.$store.state.previewImageIndex, 0), this.$store.state.previewImageList.length - 1) + const paths = l.map(item => { if ($A.isJson(item)) { return $A.rightDelete(item.src, "_thumb.jpg"); } diff --git a/resources/assets/js/components/TEditor.vue b/resources/assets/js/components/TEditor.vue index 64b073549..44c99083b 100755 --- a/resources/assets/js/components/TEditor.vue +++ b/resources/assets/js/components/TEditor.vue @@ -333,8 +333,7 @@ if (imgElm && imgElm.nodeName === "IMG") { index = array.findIndex(item => item.src === imgElm.getAttribute("src")); } - this.$store.state.previewImageIndex = index; - this.$store.state.previewImageList = array; + this.$store.dispatch("previewImage", {index, list: array}) } }); editor.ui.registry.addButton('uploadFiles', { diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 11bc58cc4..63eae9a4f 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -18,7 +18,7 @@
-
+