Selaa lähdekoodia

1941 移动端文件上传功能开发

cyy 1 vuosi sitten
vanhempi
sitoutus
16badeb0ca

+ 9 - 1
src/business/platform/file/uploader/index.vue

@@ -72,7 +72,7 @@
               </van-cell-group>
             </van-checkbox-group>
           </van-tab>
-          <van-tab :title="$t('components.uploader.uploadedTitle')">
+          <van-tab :title="$t('components.uploader.uploadedTitle')" v-if="alreadyUploaded">
             <van-sticky :offset-top="45">
               <van-pagination v-show="pagination.totalCount >0" v-model="pagination.page"
                 :total-items="pagination.totalCount" :items-per-page="pagination.limit"
@@ -192,6 +192,10 @@
         type: Boolean,
         default: true
       },
+      alreadyUploaded:{
+        type:Boolean,
+        default: true
+      },
       store: { // 返回值类型  array: 数组。string 字符串类型
         type: String,
         default: 'id',
@@ -521,6 +525,10 @@
       onCancel() {
         this.checkbox = []
         this.showPopup = false
+        this.changeShow()
+      },
+      changeShow(index) {
+        this.$emit('close', this.showPopup)
       },
       onConfirm() {
         if (this.$utils.isEmpty(this.checkbox)) {

+ 0 - 1
src/components/ibps-file-preview/index.vue

@@ -132,7 +132,6 @@ export default {
     file: {
       handler: function(val, oldVal) {
         // this.dialogVisible = this.visible
-        console.log('1121212121212')
         this.loadViewer()
       },
       immediate: true,

+ 6 - 0
src/router/routes.js

@@ -306,6 +306,12 @@ const frameCustom = [
         meta: { title: "可撤销事务" },
         component: _import("/platform/bpmn/my-revoke/index")
       },
+      {
+        path: "uploadAttachment/index",
+        name: "uploadAttachment",
+        meta: { title: "上传附件" },
+        component: _import("/platform/bpmn/upload-attachment/index")
+      },
       {
         path: "myCompleted/index",
         name: "myCompleted",

+ 5 - 5
src/setting.js

@@ -5,7 +5,7 @@ export default {
   // 版本
   releases: {
     version: version,
-    api: "" // 更新版本的api
+    api: "", // 更新版本的api
   },
   system: {
     size: "small",
@@ -14,8 +14,8 @@ export default {
       { value: "zh-CN", label: "简体中文" },
       { value: "zh-TW", label: "繁体中文" },
       { value: "en", label: "English" },
-      { value: "ja", label: "日本語" }
-    ]
+      { value: "ja", label: "日本語" },
+    ],
   },
   whiteRouterList: [
     "/login",
@@ -26,7 +26,7 @@ export default {
     "/authredirect",
     "/ziliao",
     "/sealCompleted",
-    "/fileView"
+    "/fileView",
   ],
   // 全局key
   globalKey: "ibps-app-" + version,
@@ -36,5 +36,5 @@ export default {
    * The default is only used in the production env
    * If you want to also use it in dev, you can pass ['production', 'development']
    */
-  errorLog: "production"
+  errorLog: "production",
 };

+ 70 - 0
src/views/platform/bpmn/upload-attachment/index.vue

@@ -0,0 +1,70 @@
+<template>
+  <div class="backgroundSty" :style =" 'height:'+0+'px'">
+    <!-- <div style="height:5%">
+      <van-sticky>
+        <van-nav-bar :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
+        :left-text="$t('common.button.back')" left-arrow
+        @click-left="$router.push({ name: 'dashboard' })" />
+      </van-sticky>
+    </div> -->
+    <div class="scrollView" style="opacity: 0;">
+      <ibps-uploader
+        ref="atta"
+        v-model="attachment"
+        label="上传附件"
+        download
+        placeholder="请上传附件"
+        :have-padding="false"
+        multiple
+        clearable
+        :alreadyUploaded="false"
+        @input="input"
+        @close = "close"
+      />
+      <!-- <div class="padding flex flex-direction">
+        <van-button
+          v-if="id == ''"
+          type="success"
+          class="btn btn-back-color"
+          @click="onSubmit"
+          >提交</van-button
+        >
+      </div> -->
+    </div>
+  </div>
+</template>
+<script>
+import IbpsUploader from '@/business/platform/file/uploader'
+import i18n from '@/utils/i18n'
+export default {
+  components: {
+    IbpsUploader
+  },
+  data() {
+    return {
+      attachment:'',
+      height:window.innerHeight
+    }
+  },
+  
+  mounted() {
+    this.$refs.atta.onClick()
+  },
+  methods: {
+    input(val){
+      this.$router.push({ name: 'dashboard' })
+    },
+    close(){
+      this.$router.push({ name: 'dashboard' })
+    },
+    generateTitle(name, title) { // generateTitle by vue-i18n
+      return i18n.generateTitle(name, title)
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+.backgroundSty{
+  background: #f8f8f8;
+}
+</style>