Browse Source

1. 修改低代码界面的设置。
2. 修改文件资源的上传 返回值。

杨志杰 3 years ago
parent
commit
701c276414

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "3.0.2",
+  "version": "3.0.3",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 3 - 3
src/api/dic/AmisWindowResource.js → src/api/dic/LowcodeWindowResource.js

@@ -10,10 +10,10 @@ export default {
   /**
 	 * 工具类自动生成的方法
 	 * 工具作者: 杨志杰
-	 * 读取文件服务器下面{}/AmisWindow/{moduleNo}/{amisWindowNo}.{amisWindowName}.json文件内容 
+	 * 读取文件服务器下面{}/LowcodeWindow/{moduleNo}/{lowcodeWindowNo}.{lowcodeWindowName}.json文件内容 
 	 */
-  readJson: function(amisWindowNo){
-    var requestUrl = 'api/AmisWindowResource/readJson?amisWindowNo='+amisWindowNo;
+  readJson: function(lowcodeWindowNo){
+    var requestUrl = 'api/LowcodeWindowResource/readJson?lowcodeWindowNo='+lowcodeWindowNo;
 
 
     return new Promise((resolve, reject) => {

+ 2 - 2
src/client/MenuNode.vue

@@ -177,8 +177,8 @@ export default {
         }, errorData => {
           Common.processException(errorData);
         });
-      }else if(nodeType == 'AMIS'){
-        let url = '/desktop/amis-example/' + _self.model.amisWindowNo;
+      }else if(nodeType == 'LOWCODE'){
+        let url = '/desktop/lowcode-example/' + _self.model.lowcodeWindowNo;
         this.$router.push({
           path: url,
         });

+ 1 - 0
src/client/top-nav-user-info.vue

@@ -80,6 +80,7 @@ export default {
       $.removeCookie('#accountId', { path: '/pcapp' });
       $.removeCookie('token', { path: '/pcapp' });
 
+      this.$router.push('/login');
       // 这边存在问题,模块化以后,需要修复
       // AuthSettingResource.getAuthSettingDto().then(
       //   successData => {

+ 1 - 1
src/confirm/StudyVideo.vue

@@ -23,7 +23,7 @@ export default {
   },
         
   mounted() {
-    //this.src = Common.getResourceUrl('video', 'com.leanwo.prodog.model.asset.AssetConfig', '测试用例-培训1(1).mp4');
+    //this.src = Common.getResourceUrl('video', 'com.leanwo.prodog.asset.model.AssetConfig', '测试用例-培训1(1).mp4');
            
   },
   methods: {

+ 1 - 1
src/confirm/privacy-statement.vue

@@ -49,7 +49,7 @@ export default {
       //   successData => {
       //     if (successData.errorCode == 0) {
       //       console.log(successData);
-      //       let fileUrl = Common.getResourceUrl('file', 'com.leanwo.prodog.model.asset.AssetConfig', successData.results.privacyStatement);
+      //       let fileUrl = Common.getResourceUrl('file', 'com.leanwo.prodog.asset.model.AssetConfig', successData.results.privacyStatement);
       //       let xhr = null,
       //         okStatus = document.location.protocol === 'file' ? 0 : 200;
       //       xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new XMLHttpRequest();      

+ 4 - 1
src/customer/DataImportPanel.vue

@@ -116,6 +116,7 @@ import Common from '../common/Common.js';
 import DownloadService from '../resource/file/DownloadService.js';
 import WorkflowResource from '../api/workflow/WorkflowResource.js';
 import { Notify, Uuid } from 'pc-component-v3';
+import { notificationError } from '../common/notification.js';
 
 export default {
   components: {
@@ -492,7 +493,9 @@ export default {
         contentType: false,
         processData: false,
         success: function (data) {
-          console.log(data);
+          if (data.errorCode != 0) {
+            notificationError(data.errorMessage, '导入文件上传失败');
+          }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
           Common.processException(XMLHttpRequest, textStatus, errorThrown);

+ 0 - 83
src/lowcode/AmisExample.vue

@@ -1,83 +0,0 @@
-<template>
-  <div id="amis-box" />
-</template>
-
-
-<script>
-
-// import 'amis/sdk/sdk.js';
-// import 'amis/lib/themes/antd.css';
-// import 'amis/lib/helper.css';
-// import 'amis/sdk/iconfont.css';
-import { amisConfig } from './AmisConfig.js';
-import AmisWindowResource from '../api/dic/AmisWindowResource.js';
-import Common from '../base/common/Common.js';
-import { Notify, Uuid } from 'pc-component-v3';
-
-export default {
-
-  name: 'AmisExample',
-
-  watch: {
-    '$route': function (to, from) {
-      let amisWindowNo = this.$route.params.no;
-      if(amisWindowNo != null && amisWindowNo != undefined){
-        this.init();
-      }
-    },
-  },
-
-
-  mounted(){
-    let _self = this;
-    this.$nextTick(function(){
-      let amisWindowNo = this.$route.params.no;
-      if(amisWindowNo != null && amisWindowNo != undefined){
-        this.init();
-      }
-    });
-  },
-
-  beforeUnmount(){
-    // 销毁 amis
-    this.destory();
-  },
-
-  methods: {
-
-    /**
-     * 初始化amis实例
-     */
-    init(){
-      // 初始化amis实例之前,先判断是否已经有amis实例,如果有的话就销毁。
-      this.destory();
-      let amisWindowNo = this.$route.params.amisWindowNo;
-      let amis = window.amisRequire('amis/embed');
-      let _self = this;
-
-      AmisWindowResource.readJson(amisWindowNo).then(baseObjectResponse => {
-        if(baseObjectResponse.errorCode === 0){
-          let amisJSON = JSON.parse(baseObjectResponse.data);
-          _self.amisScoped = amis.embed('#amis-box', amisJSON, {}, amisConfig);
-        }else{
-          let amisJSON = {};
-          Notify.error('提示', baseObjectResponse.errorMessage, false);
-        }
-      },errorData => {
-        Common.processException(errorData);
-      });
-    },
-
-    /**
-     * 销毁amis实例
-     */
-    destory(){
-      let _self = this;
-      if(_self.amisScoped != null){
-        _self.amisScoped.unmount();
-        _self.amisScoped = null;
-      }
-    },
-  },
-};
-</script>

+ 7 - 7
src/lowcode/LowcodeConfig.js

@@ -1,29 +1,29 @@
 import { buildComponents, AssetLoader } from '@leanwo/lowcode-utils';
-import AmisWindowResource from '../api/dic/AmisWindowResource.js';
+import LowcodeWindowResource from '../api/dic/LowcodeWindowResource.js';
 import { Notify, Uuid } from 'pc-component-v3';
 
 /**
  * 从服务器端获取 Project Schema
- * @param {*} amisWindowNo 
+ * @param {*} lowcodeWindowNo 
  * @returns 
  */
-const getProjectSchema = async amisWindowNo => {
-  let baseObjectResponse = await AmisWindowResource.readJson(amisWindowNo);
+const getProjectSchema = async lowcodeWindowNo => {
+  let baseObjectResponse = await LowcodeWindowResource.readJson(lowcodeWindowNo);
   
   if(baseObjectResponse.errorCode === 0){
     let projectSchema = JSON.parse(baseObjectResponse.data);
     return projectSchema;
   }else{
-    let amisJSON = {};
+    let lowcodeJSON = {};
     Notify.error('提示', baseObjectResponse.errorMessage, false);
   }
 };
 
-const init = async amisWindowNo => {
+const init = async lowcodeWindowNo => {
   const packages = [{'package':'lowcode-engine-vue-material-dashboard','version':'1.0.0','library':'lowcode-engine-vue-material-dashboard','urls':['http://127.0.0.1:9002\\index.js']}];
   // const packages = JSON.parse(window.localStorage.getItem('packages') || '[]');
   // const projectSchema = JSON.parse(window.localStorage.getItem('projectSchema') || '{}');
-  const projectSchema = await getProjectSchema(amisWindowNo);
+  const projectSchema = await getProjectSchema(lowcodeWindowNo);
   const { componentsMap: componentsMapArray = [], componentsTree = [] } = projectSchema;
 
   const componentsMap = {};

+ 83 - 0
src/lowcode/LowcodeExample.vue

@@ -0,0 +1,83 @@
+<template>
+  <div id="lowcode-box" />
+</template>
+
+
+<script>
+
+// import 'lowcode/sdk/sdk.js';
+// import 'lowcode/lib/themes/antd.css';
+// import 'lowcode/lib/helper.css';
+// import 'lowcode/sdk/iconfont.css';
+import { lowcodeConfig } from './LowcodeConfig.js';
+import LowcodeWindowResource from '../api/dic/LowcodeWindowResource.js';
+import Common from '../base/common/Common.js';
+import { Notify, Uuid } from 'pc-component-v3';
+
+export default {
+
+  name: 'LowcodeExample',
+
+  watch: {
+    '$route': function (to, from) {
+      let lowcodeWindowNo = this.$route.params.no;
+      if(lowcodeWindowNo != null && lowcodeWindowNo != undefined){
+        this.init();
+      }
+    },
+  },
+
+
+  mounted(){
+    let _self = this;
+    this.$nextTick(function(){
+      let lowcodeWindowNo = this.$route.params.no;
+      if(lowcodeWindowNo != null && lowcodeWindowNo != undefined){
+        this.init();
+      }
+    });
+  },
+
+  beforeUnmount(){
+    // 销毁 lowcode
+    this.destory();
+  },
+
+  methods: {
+
+    /**
+     * 初始化lowcode实例
+     */
+    init(){
+      // 初始化lowcode实例之前,先判断是否已经有lowcode实例,如果有的话就销毁。
+      this.destory();
+      let lowcodeWindowNo = this.$route.params.lowcodeWindowNo;
+      let lowcode = window.lowcodeRequire('lowcode/embed');
+      let _self = this;
+
+      LowcodeWindowResource.readJson(lowcodeWindowNo).then(baseObjectResponse => {
+        if(baseObjectResponse.errorCode === 0){
+          let lowcodeJSON = JSON.parse(baseObjectResponse.data);
+          _self.lowcodeScoped = lowcode.embed('#lowcode-box', lowcodeJSON, {}, lowcodeConfig);
+        }else{
+          let lowcodeJSON = {};
+          Notify.error('提示', baseObjectResponse.errorMessage, false);
+        }
+      },errorData => {
+        Common.processException(errorData);
+      });
+    },
+
+    /**
+     * 销毁lowcode实例
+     */
+    destory(){
+      let _self = this;
+      if(_self.lowcodeScoped != null){
+        _self.lowcodeScoped.unmount();
+        _self.lowcodeScoped = null;
+      }
+    },
+  },
+};
+</script>

+ 1 - 1
src/lowcode/LowcodePage.js

@@ -8,7 +8,7 @@ const LowcodePage = defineComponent(() => {
   const route = useRoute();
 
   onMounted(async () => {
-    let lowcodeWindowNo = toRaw(route).params.value.amisWindowNo;
+    let lowcodeWindowNo = toRaw(route).params.value.lowcodeWindowNo;
     Object.assign(data, await init(lowcodeWindowNo));
   });
 

+ 2 - 2
src/routes/main_routes.js

@@ -302,7 +302,7 @@ export default [
       },
 
       // 执行列表
-      { path: 'amis-example/:amisWindowNo', component: LowcodePage },
+      { path: 'lowcode-example/:lowcodeWindowNo', component: LowcodePage },
 
 
       { path: 'pdf-print', component: PdfPrint },
@@ -315,7 +315,7 @@ export default [
   },
 
   // 执行列表
-  { path: '/lowcode-page/:amisWindowNo', component: LowcodePage },
+  { path: '/lowcode-page/:lowcodeWindowNo', component: LowcodePage },
   // 打印页面
   { path: '/single/PrintPage', component: PrintPage },
 

+ 13 - 9
src/widget/AudioField.vue

@@ -38,6 +38,7 @@
 
 <script type="text/javascript">
 import Common from "../common/Common.js";
+import { notificationError } from '../common/notification.js';
 import recording from './audioSrc/recorder.js'
 import AuthAudio from "./AuthAudio.vue";
 export default {
@@ -182,7 +183,6 @@ export default {
          * @param {Object} blob
          */
         audioUpload: function (blob) {
-            var fileName;
             var _self = this;
             if (_self.isTouchEnd == false) {
                 // 将获取的二进制对象转为二进制文件流
@@ -206,14 +206,18 @@ export default {
                     contentType: false,
                     processData: false,
                     success: function (data) {
-                        if (data != "error") {
-                            fileName = data.substring(data.indexOf(":") + 1);
-                            const url = URL.createObjectURL(blob);
-                            _self.$emit('handleStop', {
-                                url: url,
-                                mblob: blob,
-                                fileName: fileName
-                            })
+                        if (data.errorCode === 0) {
+                            if(data.datas != null && data.datas.length > 0){
+                                let fileName = data.datas[0];
+                                const url = URL.createObjectURL(blob);
+                                _self.$emit('handleStop', {
+                                    url: url,
+                                    mblob: blob,
+                                    fileName: fileName
+                                })
+                            }
+                        }else{
+                            notificationError(data.errorMessage, '音频上传失败');
                         }
                     },
                     error: function (XMLHttpRequest, textStatus, errorThrown) {

+ 8 - 3
src/widget/image-upload.vue

@@ -25,6 +25,7 @@
 <script>
 import { getThumbnailImageSrc } from '../common/image-src.js';
 import { requestFailed } from '../common/request-result.js';
+import {notificationError} from '../common/notification.js';
 
 import Common from '../common/Common.js';
 
@@ -99,9 +100,13 @@ export default {
         formData.append('images', this.imagefile);
         formData.append('className', this.className);
         _self.imageUpload(formData).then(res => {
-          if (res != 'error') {
-            var imageName = res.substring(res.indexOf(':') + 1);
-            _self.$emit('update:modelValue', imageName);
+          if (res.errorCode == 0) {
+            if(res.datas != null && res.datas.length > 0){
+              var imageName = res.datas[0];
+              _self.$emit('update:modelValue', imageName);
+            }
+          } else {
+            notificationError(res.errorMessage, '图片上传失败');
           }
         }).catch(err => {
           requestFailed(err);

+ 2 - 2
src/window/attachment/AttachmentPanel.vue

@@ -212,8 +212,8 @@ export default {
         fileName: fileName,
       };
       AttachmentService.deleteAttachment(data).then(successData => {
-        if (data == false) {
-          Notify.error(_self.$t('lang.Notify.warning'), _self.$t('lang.attachmentPanel.describe1'), false);
+        if (data.errorCode != 0) {
+          Notify.error(_self.$t('lang.Notify.warning'), successData.errorMessage, false);
         }
         _self.refresh();
       });

+ 7 - 2
src/window/attachment/AttachmentUpload.vue

@@ -140,12 +140,17 @@ export default {
       _self.loading=true;
       AttachmentService.uploadAttachment(formData).then(successData => {
         _self.loading=false;
-        if (successData == 'success') {
+        if (successData.errorCode == 0) {
           Notify.success(_self.$t('lang.attachmentUpload.uploadSucceeded'), _self.$t('lang.attachmentUpload.attachmentUploadedSuccessfully'), true);
         }
-        if (successData == 'noRole') {
+        if (successData.errorCode == 1) {
           Notify.error(_self.$t('lang.Notify.warning'), _self.$t('lang.attachmentUpload.noPermissionUploadAttachments'), false);
         }
+
+        if (successData.errorCode) {
+          Notify.error(_self.$t('lang.Notify.warning'), successData.errorMessage, false);
+        }
+
         _self.$emit('uploadSuccess');
       }, error => {
         _self.loading=false;

+ 14 - 6
src/window/tabFormWidget/FileListWidget.vue

@@ -39,6 +39,7 @@
 
 import Common from '../../common/Common.js';
 import UploadButton from '../../widget/UploadButton.vue';
+import { notificationError } from '../../common/notification.js';
 
 export default {
 
@@ -154,7 +155,7 @@ export default {
       var formData = new FormData();
       formData.append('files', selectedFile);
       formData.append('className', _self.className);
-      _self.loading=true;
+      _self.loading = true;
       $.ajax({
         url: Common.getApiURL('file/classFileUpload'),
         type: 'post',
@@ -167,9 +168,11 @@ export default {
         success: function (data) {
           _self.loading=false;
           console.log(data);
-          if (data != 'error') {
-            var fileName = data.substring(data.indexOf(':') + 1);
-            _self.addFile(fileName);
+          if (data.errorCode === 0) {
+            var fileNames = data.datas;
+            _self.addFiles(fileNames);
+          }else{
+            notificationError(data.errorMessage, '文件上传失败');
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
@@ -183,12 +186,17 @@ export default {
      * 添加文件
      * @param {String} imageName 添加的文件名称
      */
-    addFile: function (fileName) {
+    addFiles: function (fileNames) {
       var _self = this;
       if (_self.newFieldValue.displayValue == undefined) {
         _self.newFieldValue.displayValue = new Array();
       }
-      _self.newFieldValue.displayValue.push(fileName);
+      if(fileNames != null){
+        fileNames.forEach(element => {
+          _self.newFieldValue.displayValue.push(element);
+        });
+      }
+      
       var files = _self.newFieldValue.displayValue.join(',');
       _self.fieldValue.displayValue[0] = files;
       this.$emit('valueChanged', _self.fieldValue);

+ 13 - 7
src/window/tabFormWidget/ImageListViewWidget.vue

@@ -30,6 +30,7 @@
 <script>
 
 import Common from '../../common/Common.js';
+import {notificationError} from '../../common/notification.js';
 
 
 import AuthImage from '../../widget/AuthImage.vue';
@@ -144,11 +145,11 @@ export default {
         contentType: false,
         processData: false,
         success: function (data) {
-          _self.loading=false;
-          console.log(data);
-          if (data != 'error') {
-            var imageName = data.substring(data.indexOf(':') + 1);
-            _self.addImg(imageName);
+          _self.loading = false;
+          if (data.errorCode == 0) {
+            _self.addImgs(data.datas);
+          }else{
+            notificationError(data.errorMessage, '图片上传失败');
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
@@ -161,12 +162,17 @@ export default {
          * 添加图片
          * @param {String} imageName 添加的图片名称
          */
-    addImg: function (imageName) {
+    addImgs: function (imageNames) {
       var _self = this;
       if (_self.newFieldValue.displayValue == undefined) {
         _self.newFieldValue.displayValue = new Array();
       }
-      _self.newFieldValue.displayValue.push(imageName);
+      if(imageNames != null){
+        imageNames.forEach(element => {
+          _self.newFieldValue.displayValue.push(element);
+        });
+      }
+      
       var images = _self.newFieldValue.displayValue.join(',');
       _self.fieldValue.displayValue[0] = images;
       this.$emit('valueChanged', _self.fieldValue);

+ 14 - 5
src/window/tabFormWidget/ImageListWidget.vue

@@ -69,6 +69,7 @@
 
 import AuthImage from '../../widget/AuthImage.vue';
 import Common from '../../common/Common.js';
+import {notificationError} from '../../common/notification.js';
 import { Notify, Uuid } from 'pc-component-v3';
 
 export default {
@@ -225,10 +226,12 @@ export default {
         success: function (data) {
           _self.loading=false;
           console.log(data);
-          if (data != 'error') {
-            var imageName = data.substring(data.indexOf(':') + 1);
-            _self.addImg(imageName);
+          if (data.errorCode == 0) {
+            _self.addImgs(data.datas);
+          }else{
+            notificationError(data.errorMessage, '图片上传失败');
           }
+          
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
           _self.loading=false;
@@ -241,12 +244,18 @@ export default {
          * 添加图片
          * @param {String} imageName 添加的图片名称
          */
-    addImg: function (imageName) {
+    addImgs: function (imageNames) {
       var _self = this;
       if (_self.newFieldValue.displayValue == undefined) {
         _self.newFieldValue.displayValue = new Array();
       }
-      _self.newFieldValue.displayValue.push(imageName);
+      
+      if(imageNames != null){
+        imageNames.forEach(element => {
+          _self.newFieldValue.displayValue.push(element);
+        });
+      }
+
       var images = _self.newFieldValue.displayValue.join(',');
       _self.fieldValue.displayValue[0] = images;
       this.$emit('valueChanged', _self.fieldValue);

+ 1 - 54
src/window/tabFormWidget/ImageViewWidget.vue

@@ -30,6 +30,7 @@
 
 <script>
 import Common from '../../common/Common.js';
+import {notificationError} from '../../common/notification.js';
 
 
 import AuthImage from '../../widget/AuthImage.vue';
@@ -115,60 +116,6 @@ export default {
       this.$emit('valueChanged', newFieldValue);
     },
 
-    // 选择的文件发生改变
-    onFileChange(e) {
-      var files = e.target.files || e.dataTransfer.files;
-      if (!files.length)
-        return;
-      this.uploadImage(files[0]);
-    },
-
-    uploadImage: function (selectedFile) {
-      var _self = this;
-      if (selectedFile == undefined) {
-        return;
-      }
-      if (!/image\/\w+/.test(selectedFile.type)) {
-        alert('请确保文件为图像类型');
-        return;
-      }
-      var formData = new FormData();
-      formData.append('images', selectedFile);
-      formData.append('className', _self.className);
-      _self.loading=true;
-      $.ajax({
-        url: Common.getApiURL('file/imageUpload'),
-        type: 'post',
-        beforeSend: function (request) {
-          Common.addTokenToRequest(request);
-        },
-        data: formData,
-        contentType: false,
-        processData: false,
-        success: function (data) {
-          _self.loading=false;
-          console.log(data);
-          if (data != 'error') {
-            var imageName = data.substring(data.indexOf(':') + 1);
-            _self.addImg(imageName);
-          }
-        },
-        error: function (XMLHttpRequest, textStatus, errorThrown) {
-          _self.loading=false;
-          Common.processException(XMLHttpRequest, textStatus, errorThrown);
-        },
-      });
-    },
-    addImg: function (imageName) {
-      var that = this;
-      var reader = new FileReader();
-      var newFieldValue = {
-        displayValue: [],
-        fieldType: 'String',
-      };
-      newFieldValue.displayValue[0] = imageName;
-      this.$emit('valueChanged', newFieldValue);
-    },
   },
 };
 </script>

+ 27 - 6
src/window/tabFormWidget/ImageWidget.vue

@@ -194,11 +194,23 @@ export default {
 
       this.loading=true;
       ImageService.uploadImage(formData).then(
-        imageName => {
+        data => {
           _self.loading=false;
           _self.addModal = false;
-          Notify.success(_self.$t('lang.Notify.prompt'), _self.$t('lang.ImageWidget.describe2'), 1500);
-          _self.emitFieldValue(imageName);
+
+          console.log(data);
+          
+          if (data.errorCode == 0) {
+            if(data.datas != null && data.datas.length > 0){
+              Notify.success(_self.$t('lang.Notify.prompt'), _self.$t('lang.ImageWidget.describe2'), 1500);
+              _self.emitFieldValue(data.datas[0]);
+            } 
+          }else{
+            Notify.success('图片上传失败', data.errorMessage, 1500);
+          }
+
+
+
         },
         errorData => {
           _self.loading=false;
@@ -218,11 +230,20 @@ export default {
       formData.append('className', _self.className);
       this.loading=true;
       ImageService.uploadImage(formData).then(
-        imageName => {
+        data => {
           _self.loading=false;
           _self.addModal = false;
-          Notify.success(_self.$t('lang.Notify.prompt'), _self.$t('lang.ImageWidget.describe3'), 1500);
-          _self.emitFieldValue(imageName);
+
+          console.log(data);
+          
+          if (data.errorCode == 0) {
+            if(data.datas != null && data.datas.length > 0){
+              Notify.success(_self.$t('lang.Notify.prompt'), _self.$t('lang.ImageWidget.describe2'), 1500);
+              _self.emitFieldValue(data.datas[0]);
+            } 
+          }else{
+            Notify.success('图片上传失败', data.errorMessage, 1500);
+          }
         },
         errorData => {
           _self.loading=false;

+ 13 - 7
src/window/tabFormWidget/RichTextAreaEditorWidget.vue

@@ -7,6 +7,7 @@
 <script>
 import Common from '../../common/Common.js';
 import DynamicJsLoader from '../../common/DynamicJsLoader.js';
+import {notificationError} from '../../common/notification.js';
 import { Notify, Uuid } from 'pc-component-v3';
 export default {
 
@@ -116,13 +117,18 @@ export default {
         contentType: false,
         processData: false,
         success: function (data) {
-          if (data != 'error') {
-            var imageName = data.substring(data.indexOf(':') + 1);
-            $('#summernote').summernote(
-              'insertImage',
-              Common.getResourceUrl('image', _self.className, imageName),
-              'image name',
-            );
+          if (data.errorCode == 0) {
+            if(data.datas != null && data.datas.length > 0){
+              data.datas.forEach(imageName => {
+                $('#summernote').summernote(
+                  'insertImage',
+                  Common.getResourceUrl('image', _self.className, imageName),
+                  'image name',
+                );
+              });
+            }
+          }else{
+            notificationError(data.errorMessage, '图片上传失败');
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {

+ 16 - 6
src/window/tabFormWidget/VideoListWidget.vue

@@ -33,6 +33,7 @@
 
 import AuthImage from '../../widget/AuthImage.vue';
 import Common from '../../common/Common.js';
+import { notificationError } from '../../common/notification.js';
 import { Notify, Uuid } from 'pc-component-v3';
 
 export default {
@@ -144,9 +145,11 @@ export default {
         success: function (data) {
           _self.loading=false;
           console.log(data);
-          if (data != 'error') {
-            var videoName = data.substring(data.indexOf(':') + 1);
-            _self.addVideo(videoName);
+          if (data.errorCode == 0) {
+            var videoNames = data.datas;
+            _self.addVideos(videoNames);
+          } else {
+            notificationError(data.errorMessage, '视频上传失败');
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
@@ -156,16 +159,23 @@ export default {
       });
     },
 
+    
     /**
      * 添加视频
-     * @param {String} imageName 添加的图片名称
+     * @param {String} videoNames 添加的图片名称
      */
-    addVideo: function (videoName) {
+    addVideos: function (videoNames) {
       var _self = this;
       if (_self.newFieldValue.displayValue == undefined) {
         _self.newFieldValue.displayValue = new Array();
       }
-      _self.newFieldValue.displayValue.push(videoName);
+
+      if(videoNames != null){
+        videoNames.forEach(element => {
+          _self.newFieldValue.displayValue.push(element);
+        });
+      }
+      
       var videos = _self.newFieldValue.displayValue.join(',');
       _self.fieldValue.displayValue[0] = videos;
       this.$emit('valueChanged', _self.fieldValue);

+ 7 - 14
src/window/tabGridWidget/ImageCell.vue

@@ -23,15 +23,6 @@
           @change="onFileChange"
         />
       </div>
-      <!-- <button class="btn btn-success" @click="toggleShow">选择图片</button>
-			<my-upload field="img"
-  v-model="show"
-				:width="300"
-				:height="200"
-				img-format="png"
-				:classNapme="className" 
-				@addImg="addImg"
-				></my-upload> -->
     </div>
     <Loading v-if="loading" />
   </div>
@@ -42,6 +33,7 @@
 
 import AuthImage from '../../widget/AuthImage.vue';
 import Common from '../../common/Common.js';
+import {notificationError} from '../../common/notification.js';
 
 export default {
 
@@ -169,9 +161,12 @@ export default {
         success: function (data) {
           _self.loading=false;
           console.log(data);
-          if (data != 'error') {
-            var imageName = data.substring(data.indexOf(':') + 1);
-            _self.addImg(imageName);
+          if (data.errorCode == 0) {
+            if(data.datas.length > 0){
+              _self.addImg(data.datas[0]);
+            }
+          }else{
+            notificationError(data.errorMessage, '图片上传失败');
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
@@ -185,8 +180,6 @@ export default {
      * @param {String} imageName 添加的图片名称
      */
     addImg: function (imageName) {
-      var that = this;
-      var reader = new FileReader();
       var newFieldValue = {
         displayValue: [],
         fieldType: 'String',

+ 16 - 7
src/window/tabGridWidget/ImageListCell.vue

@@ -44,6 +44,7 @@
 
 import AuthImage from "../widget/AuthImage.vue";
 import Common from "../../common/Common.js";
+import {notificationError} from '../../common/notification.js';
 
 export default {
     props: ["field", "fieldValue", "className", "readonly"],
@@ -119,12 +120,13 @@ export default {
                 contentType: false,
                 processData: false,
                 success: function (data) {
-                    _self.loading=false;
-                    console.log(data);
-                    if (data != "error") {
-                        var imageName = data.substring(data.indexOf(":") + 1);
-                        _self.addImg(imageName);
+                    _self.loading = false;
+                    if (data.errorCode == 0) {
+                        _self.addImgs(data.datas);
+                    }else{
+                        notificationError(data.errorMessage, '图片上传失败');
                     }
+
                 },
                 error: function (XMLHttpRequest, textStatus, errorThrown) {
                     _self.loading=false;
@@ -137,12 +139,19 @@ export default {
          * 添加图片
          * @param {String} imageName 添加的图片名称
          */
-        addImg: function (imageName) {
+        addImgs: function (imageNames) {
             var _self = this;
+            
             if (_self.newFieldValue.displayValue == undefined) {
                 _self.newFieldValue.displayValue = new Array();
             }
-            _self.newFieldValue.displayValue.push(imageName);
+
+            if(imageNames != null){
+                imageNames.forEach(element => {
+                    _self.newFieldValue.displayValue.push(element);
+                });
+            }
+
             var images = _self.newFieldValue.displayValue.join(",");
             _self.fieldValue.displayValue[0] = images;
             this.$emit("valueChanged", _self.fieldValue);

+ 14 - 5
src/window/tabGridWidget/VideoListCell.vue

@@ -28,6 +28,7 @@
 <script>
 
 import Common from '../../common/Common.js';
+import { notificationError } from '../../common/notification.js';
 import { Notify, Uuid } from 'pc-component-v3';
 
 export default {
@@ -137,9 +138,11 @@ export default {
         success: function (data) {
           _self.loading=false;
           console.log(data);
-          if (data != 'error') {
-            var videoName = data.substring(data.indexOf(':') + 1);
-            _self.addVideo(videoName);
+          if (data.errorCode == 0) {
+            var videoNames = data.datas;
+            _self.addVideos(videoNames);
+          } else {
+            notificationError(data.errorMessage, '视频上传失败');
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
@@ -153,12 +156,18 @@ export default {
      * 添加视频
      * @param {String} imageName 添加的图片名称
      */
-    addVideo: function (videoName) {
+    addVideos: function (videoNames) {
       var _self = this;
       if (_self.newFieldValue.displayValue == undefined) {
         _self.newFieldValue.displayValue = new Array();
       }
-      _self.newFieldValue.displayValue.push(videoName);
+      
+      if(videoNames != null){
+        videoNames.forEach(element => {
+          _self.newFieldValue.displayValue.push(element);
+        });
+      }
+      
       var videos = _self.newFieldValue.displayValue.join(',');
       _self.fieldValue.displayValue[0] = videos;
       this.$emit('valueChanged', _self.fieldValue);

+ 12 - 5
src/workflow/ImageListWidget.vue

@@ -25,6 +25,8 @@
 
 
 import AuthImage from '../widget/AuthImage.vue';
+
+import {notificationError} from '../common/notification.js';
 import Common from '../common/Common.js';
 
 export default {
@@ -103,9 +105,10 @@ export default {
         success: function (data) {
           _self.loading=false;
           console.log(data);
-          if (data != 'error') {
-            var imageName = data.substring(data.indexOf(':') + 1);
-            _self.addImg(imageName);
+          if (data.errorCode == 0) {
+            _self.addImgs(data.datas);
+          }else{
+            notificationError(data.errorMessage, '图片上传失败');
           }
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
@@ -119,9 +122,13 @@ export default {
      * 添加图片
      * @param {String} imageName 添加的图片名称
      */
-    addImg: function (imageName) {
+    addImgs: function (imageNames) {
       var _self = this;
-      _self.images.push(imageName);
+      if(imageNames != null){
+        imageNames.forEach(element => {
+          _self.images.push(element);
+        });
+      }
     },
 
     /**

+ 0 - 1
test/fingerDemo.vue

@@ -12,7 +12,6 @@
       v-multipointEnd="{methods: multipointEnd, arg: {index:9,item:'multipointEnd'}}"
       v-pinch="{methods: pinch, arg: arg}" 
       class="finger-demo-img" 
-      src="@/assets/image/template-logo.png"
       :style="imgStyle"
     />
     <div>{{ msg }}</div>