Просмотр исходного кода

Merge branches 'master' and 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

liujiayin 2 лет назад
Родитель
Сommit
c5df25a4ee

+ 10 - 10
src/business/platform/bpmn/form/action.js

@@ -415,12 +415,12 @@ export default {
                 }).then(() => {
                     this.approveDialogVisible = false
                     // 更改数据状态为已终止
-                    const { key = '' } = this.getFormEL().formDefData || {}
+                    const { code = '' } = this.getFormEL().formDefData || {}
                     const { id = '' } = this.getFormEL().formData || {}
-                    if (!id || !key) {
+                    if (!id || !code) {
                         return
                     }
-                    this.updateState(id, key, '已终止', null)
+                    this.updateState(id, code, '已终止', null)
                     // 后置事件
                     this.afterScript(this.actionName, {
                         data: response.data,
@@ -645,10 +645,10 @@ export default {
             })
         },
         async createSnapshot (bizKey, proId) {
-            const { key = '', name = '' } = this.getFormEL().formDefData || {}
+            const { code = '', name = '' } = this.getFormEL().formDefData || {}
             const { proInstId = '' } = this.getFormEL().params || {}
             const id = bizKey || this.getFormEL().formData.id
-            if (!key) {
+            if (!code) {
                 return
             }
             // 轮询流程是否结束,流程未结束不生成快照,每2秒查询一次,最多等待10秒钟
@@ -664,11 +664,11 @@ export default {
                 // 等待一段时间后再次查询
                 await new Promise(resolve => setTimeout(resolve, intervalTime))
             }
-            const sql = `select * from t_lcidglbdbb where shi_fou_zi_biao_ = 't_${key}' and ti_jiao_kuai_zhao = '是'`
+            const sql = `select * from t_lcidglbdbb where shi_fou_zi_biao_ = 't_${code}' and ti_jiao_kuai_zhao = '是'`
             this.$common.request('sql', sql).then(res => {
                 const { data = [] } = res.variables || {}
                 if (!data.length) {
-                    this.updateState(id, key, '已完成', null)
+                    this.updateState(id, code, '已完成', null)
                     return
                 }
                 const path = data[0].bao_biao_lu_jing_
@@ -685,7 +685,7 @@ export default {
                     }
                     const fileId = res.data && res.data.id ? res.data.id : ''
                     const fileParams = fileId ? { kuai_zhao_: fileId } : {}
-                    this.updateState(id, key, '已完成', fileParams)
+                    this.updateState(id, code, '已完成', fileParams)
                 })
             })
         },
@@ -697,9 +697,9 @@ export default {
             return data.length > 0
         },
         // 更新数据状态
-        updateState (id, key, state, fileParams) {
+        updateState (id, code, state, fileParams) {
             const params = {
-                tableName: `t_${key}`,
+                tableName: `t_${code}`,
                 updList: [{
                     where: {
                         id_: id

+ 0 - 3
src/business/platform/bpmn/setting/bpmn-setting/settings/button-setting.vue

@@ -137,9 +137,6 @@ export default {
         this.editData = null
     },
     methods: {
-        test (v) {
-            this.buttons = v
-        },
         // 新增、编辑变量
         editButton (index) {
             const data = this.$utils.isNotEmpty(index) ? this.buttons[index] : {}

+ 346 - 329
src/business/platform/file/attachment/index.vue

@@ -1,349 +1,366 @@
 <template>
-  <div class="ibps-attachment-selector">
-    <template v-if="uploadable">
-      <!--ibps 附件上传方式-->
-      <template v-if="uploadType==='attachment'">
-        <ul
-          :class="{disabled:disabled}"
-          class="selector-list"
-          @click="handleUpload"
-        >
-          <label>
-            <div class="plus">+</div>
-            <div class="selector-empty">{{ placeholder }}</div>
-          </label>
-        </ul>
-      </template>
-      <!--直接弹出选择文件框-->
-      <template v-else>
-        <el-upload
-          ref="upload"
-          :file-list="fileList"
-          :on-success="handleSuccess"
-          :on-error="handleError"
-          :before-upload="beforeUpload"
-          :http-request="httpRequest"
-          :multiple="multiple"
-          :accept="accept"
-          :show-file-list="false"
-          action="https://www.bpmhome.cn/post"
-          name="file"
-          drag
-          class="ibps-default-upload"
-        >
-          <ul
-            :class="{disabled:disabled}"
-            class="selector-list"
-          >
-            <label>
-              <div class="plus">+</div>
-              <div class="selector-empty">{{ placeholder }}</div>
-            </label>
-          </ul>
-        </el-upload>
-
-        <!--重选附件-->
-        <el-upload
-          ref="defaultReselectUpload"
-          style="display:none;"
-          action="https://www.bpmhome.cn/post"
-          :on-success="handleReselectSuccess"
-          :before-upload="beforeUpload"
-          :http-request="httpRequest"
-          :file-list="fileList"
-          :multiple="false"
-          :accept="accept"
-          name="file"
-          drag
-        />
-      </template>
-    </template>
-
-
-    <ul
-      v-if="$utils.isNotEmpty(items)"
-      :class="[
-        'el-upload-list',
-        'el-upload-list--' + listType,
-        { 'is-disabled': !editable }
-      ]"
-    >
-      <li
-        v-for="(file,index) in items"
-        :key="index"
-        :class="['el-upload-list__item', focusing ? 'focusing' : '']"
-        tabindex="0"
-        @focus="focusing = true"
-        @blur="focusing = false"
-        @click.stop="focusing = false"
-      >
-        <span :file="file" >
-          <a
-            class="el-upload-list__item-name"
-            :style="{
-              marginRight:toolsWidth
-            }"
-            :title="file"
-            @click.stop="handlePreview(index)"
-            >
-         <i class="el-icon-document" />{{ file | ellipsis }}
-          </a>
-          <label
-            class="tools"
-          >
-           <template v-if="operation_status!='none' && editable">
-              <el-tooltip effect="dark" content="编辑" placement="bottom-start">
-                <el-link type="primary" :underline="false" icon="el-icon-edit" @click.stop="handleEdit(index)">&nbsp;</el-link>
-              </el-tooltip>
-            </template>
-             <el-divider direction="vertical" />
-            <template v-if="editable">
-              <!--默认附件上传 -->
-              <el-tooltip effect="dark" content="重新选择" placement="bottom-start">
-                <el-link type="primary" :underline="false" icon="ibps-icon-undo" @click.stop="handleReselect(index)">&nbsp;</el-link>
-              </el-tooltip>
-              <el-divider direction="vertical" />
-              <el-tooltip effect="dark" content="删除" placement="bottom-start">
-                <el-link type="danger" :underline="false" icon="ibps-icon-delete" @click.stop="handleRemove(index)">&nbsp;</el-link>
-              </el-tooltip>
-              <el-divider v-if="download" direction="vertical" />
-            </template>
-            <template v-if="download">
-              <el-tooltip effect="dark" content="下载" placement="bottom-start">
-                <el-link type="primary" :underline="false" icon="ibps-icon-download" @click.stop="handleDownload(index)">&nbsp;</el-link>
-              </el-tooltip>
+    <div class="ibps-attachment-selector">
+        <template v-if="uploadable">
+            <!--ibps 附件上传方式-->
+            <template v-if="uploadType==='attachment'">
+                <ul
+                    :class="{disabled:disabled}"
+                    class="selector-list"
+                    @click="handleUpload"
+                >
+                    <label>
+                        <div class="plus">+</div>
+                        <div class="selector-empty">{{ placeholder }}</div>
+                    </label>
+                </ul>
             </template>
-          </label>
-        </span>
-
-
-      </li>
-    </ul>
+            <!--直接弹出选择文件框-->
+            <template v-else>
+                <el-upload
+                    ref="upload"
+                    :file-list="fileList"
+                    :on-success="handleSuccess"
+                    :on-error="handleError"
+                    :before-upload="beforeUpload"
+                    :http-request="httpRequest"
+                    :multiple="multiple"
+                    :accept="accept"
+                    :show-file-list="false"
+                    action="https://www.bpmhome.cn/post"
+                    name="file"
+                    drag
+                    class="ibps-default-upload"
+                >
+                    <ul
+                        :class="{disabled:disabled}"
+                        class="selector-list"
+                    >
+                        <label>
+                            <div class="plus">+</div>
+                            <div class="selector-empty">{{ placeholder }}</div>
+                        </label>
+                    </ul>
+                </el-upload>
 
+                <!--重选附件-->
+                <el-upload
+                    ref="defaultReselectUpload"
+                    style="display:none;"
+                    action="https://www.bpmhome.cn/post"
+                    :on-success="handleReselectSuccess"
+                    :before-upload="beforeUpload"
+                    :http-request="httpRequest"
+                    :file-list="fileList"
+                    :multiple="false"
+                    :accept="accept"
+                    name="file"
+                    drag
+                />
+            </template>
+        </template>
 
-  </div>
+        <ul
+            v-if="$utils.isNotEmpty(items)"
+            :class="['el-upload-list', 'el-upload-list--' + listType, { 'is-disabled': !editable }]"
+        >
+            <vue-draggable
+                v-model="sortList"
+                v-bind="draggableOptions"
+                class="list-group"
+                @start="isDragging = true"
+                @end="()=>{isDragging= false}"
+                @update="updateSort"
+            >
+                <li
+                    v-for="(file,index) in items"
+                    :key="index"
+                    :class="['el-upload-list__item', focusing ? 'focusing' : '']"
+                    tabindex="0"
+                    @focus="focusing = true"
+                    @blur="focusing = false"
+                    @click.stop="focusing = false"
+                >
+                    <span :file="file">
+                        <a
+                            class="el-upload-list__item-name"
+                            :style="{ marginRight:toolsWidth }"
+                            :title="file"
+                            @click.stop="handlePreview(index)"
+                        >
+                            <i class="el-icon-document" />{{ file | ellipsis }}
+                        </a>
+                        <label class="tools">
+                            <template v-if="operation_status!='none' && editable">
+                                <el-tooltip effect="dark" content="编辑" placement="bottom-start">
+                                    <el-link type="primary" :underline="false" icon="el-icon-edit" @click.stop="handleEdit(index)">&nbsp;</el-link>
+                                </el-tooltip>
+                            </template>
+                            <el-divider direction="vertical" />
+                            <template v-if="editable">
+                                <!--默认附件上传 -->
+                                <!-- <el-tooltip effect="dark" content="拖拽排序" placement="bottom-start">
+                                    <el-link type="info" :underline="false" icon="ibps-icon-arrows" class="draggable">&nbsp;</el-link>
+                                </el-tooltip>
+                                <el-divider direction="vertical" /> -->
+                                <el-tooltip effect="dark" content="重新选择" placement="bottom-start">
+                                    <el-link type="primary" :underline="false" icon="ibps-icon-undo" @click.stop="handleReselect(index)">&nbsp;</el-link>
+                                </el-tooltip>
+                                <el-divider direction="vertical" />
+                                <el-tooltip effect="dark" content="删除" placement="bottom-start">
+                                    <el-link type="danger" :underline="false" icon="ibps-icon-delete" @click.stop="handleRemove(index)">&nbsp;</el-link>
+                                </el-tooltip>
+                                <el-divider v-if="download" direction="vertical" />
+                            </template>
+                            <template v-if="download">
+                                <el-tooltip effect="dark" content="下载" placement="bottom-start">
+                                    <el-link type="primary" :underline="false" icon="ibps-icon-download" @click.stop="handleDownload(index)">&nbsp;</el-link>
+                                </el-tooltip>
+                            </template>
+                        </label>
+                    </span>
+                </li>
+            </vue-draggable>
+        </ul>
+    </div>
 </template>
 <script>
 
 import { fileTypes, allFileTypes, accept as acceptTypes } from '@/business/platform/file/constants/fileTypes'
 import { uploadFile } from '@/api/platform/file/attachment'
+import VueDraggable from 'vuedraggable'
 
 export default {
-  name: 'ibps-attachment-selector',
-  props: {
-    items: {
-      type: Array
-    },
-    operation_status: String, //编辑
-    value: {
-      type: [Array, Object]
-    },
-    mediaType: String,
-    media: String,
-    placeholder: {
-      type: String,
-      default: '请选择'
-    },
-    multiple: { // 是否多选
-      type: Boolean,
-      default: false
-    },
-    limit: { // 最大允许上传个数
-      type: Number
-    },
-    disabled: {
-      type: Boolean,
-      default: false
-    },
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    download: {
-      type: Boolean,
-      default: false
+    name: 'ibps-attachment-selector',
+    components: { VueDraggable },
+    filters: {
+        ellipsis (val) {
+            if (!val) return ''
+            if (val.length > 60) {
+                return val.slice(0, 60) + '...'
+            }
+            return val
+        }
     },
-    preview: {
-      type: Boolean,
-      default: true
+    props: {
+        items: {
+            type: Array
+        },
+        operation_status: String, // 编辑
+        value: {
+            type: [Array, Object]
+        },
+        mediaType: String,
+        media: String,
+        placeholder: {
+            type: String,
+            default: '请选择'
+        },
+        multiple: { // 是否多选
+            type: Boolean,
+            default: false
+        },
+        limit: { // 最大允许上传个数
+            type: Number
+        },
+        disabled: {
+            type: Boolean,
+            default: false
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        download: {
+            type: Boolean,
+            default: false
+        },
+        preview: {
+            type: Boolean,
+            default: true
+        },
+        uploadType: { // 上传方式 ( default:直接打开上传,attachment:ibps上传附件打开上传 )
+            type: String,
+            default: 'attachment'
+        },
+        accept: String, // 允许上传类型
+        fileSize: Number, // 尺寸
+        fileExt: {
+            type: Array,
+            default: () => []
+        }
     },
-    uploadType: { // 上传方式 ( default:直接打开上传,attachment:ibps上传附件打开上传 )
-      type: String,
-      default: 'attachment'
+    data () {
+        console.log(this.value)
+        return {
+            fileList: [],
+            targetExt: false,
+            fileTypes: fileTypes,
+            allFileTypes: allFileTypes,
+            acceptTypes: acceptTypes,
+            defaultSelectIndex: 0,
+            listType: 'text',
+            focusing: false,
+            defaultDisabled: true,
+            sortList: [],
+            isDragging: false,
+            draggableOptions: {
+                handle: '.draggable',
+                ghostClass: 'sortable-ghost',
+                distance: 1,
+                disabled: false,
+                animation: 200,
+                axis: 'y'
+            }
+        }
     },
-    accept: String, // 允许上传类型
-    fileSize: Number, // 尺寸
-    fileExt: {
-      type: Array,
-      default: () => []
-    }
-  },
-  filters:{
-    ellipsis(val){
-      if(!val) return ""
-      if(val.length>45){
-        return val.slice(0,45) +"...";
-      }
-      return val
-    }
-  },
-  data() {
-    return {
-      fileList: [],
-      targetExt: false,
-      fileTypes: fileTypes,
-      allFileTypes: allFileTypes,
-      acceptTypes: acceptTypes,
-      defaultSelectIndex: 0,
-      listType: 'text',
-      focusing: false,
-      defaultDisabled: true,
-    }
-  },
-  computed: {
+    computed: {
     // 是否允许上传
-    uploadable() {
-      if (this.readonly) return false
-      if (!this.multiple && this.items.length >= 1) return false
-      if (this.multiple && (this.limit && this.items.length >= this.limit)) return false
-      return true
-    },
-    editable() {
-      return !(this.readonly || this.disabled)
-    },
-    toolsWidth() {
-      const length = this.editable ? 3 : 1
-      return (30 * length) + 'px'
-    }
-  },
-  methods: {
-    init() {
-      this.fileList = []
-    },
-    handleUpload() {
-      if (!this.editable) return
-      this.$emit('action-event', 'select')
-    },
-    /* 在线编辑报表*/
-    handleEdit(index){
-       this.$emit('action-event', 'edit',index,this.value[index]||this.value,this.operation_status)
-    },
-    handleReselect(index) {
-      if (!this.editable) return
-      if (this.uploadType === 'attachment') {
-        this.$emit('action-event', 'reselect', index)
-      } else {
-        this.$refs.defaultReselectUpload.$refs['upload-inner'].handleClick()
-        this.defaultSelectIndex = index
-      }
-    },
-    handleRemove(index) {
-      if (!this.editable) return
-      this.$emit('action-event', 'remove', index)
-    },
-    handleDownload(index) {
-      this.$emit('action-event', 'download', index)
-    },
-    handlePreview(index) {
-      this.$emit('action-event', 'preview', index)
-    },
-    // 默认上传模块
-    httpRequest(options) {
-      return uploadFile(options.file, {})
-    },
-    handleSuccess(response, file, fileList) {
-      this.fileList = fileList
-      this.emitCallback(fileList, file)
-    },
-    emitCallback(list, file) {
-      let data = this.multiple ? [] : {}
-      if (this.multiple) {
-        data = this.getFileDataList(list)
-      } else {
-        data = file.response.data
-      }
-      this.$emit('action-event', 'confirm', data)
-    },
-    getFileDataList(fileList) {
-      if (this.$utils.isEmpty(fileList)) {
-        return []
-      }
-      return fileList.map((file) => {
-        return file.response.data
-      })
-    },
-    handleError() {
-      // TODO:
-    },
-    beforeUpload(file) {
-      if (this.limit && this.limit === 0) {
-        this.$message({
-          message: '上传文件个数不能为0,请重新设置',
-          type: 'warning'
-        })
-        return false
-      }
-      if (this.fileSize && file.size > this.fileSize) {
-        this.$message.closeAll()
-        this.$message({
-          message: `上传文件的尺寸大于${this.$utils.formatSize(this.fileSize, 2, ['B', 'K', 'M', 'G', 'TB'])}`,
-          type: 'warning'
-        })
-        return false
-      }
-      if (this.accept && !this.fileExtType(file)) {
-        this.$message.closeAll()
-        this.$message({
-          message: '不允许的文件类型',
-          type: 'warning'
-        })
-        return false
-      }
-    },
-    /**
-     * 文件类型的检测
-     */
-    fileExtType(file) {
-      const accept = this.accept
-      const acceptTypes = this.acceptTypes
-      const fileTypes = this.fileTypes
-      const arr = file.name.split('.')
-      const result = arr[arr.length - 1]
-      let type = ''
-      this.targetExt = false
-      for (const i in acceptTypes) {
-        if (acceptTypes[i] === accept) {
-          type = i
+        uploadable () {
+            if (this.readonly) return false
+            if (!this.multiple && this.items.length >= 1) return false
+            if (this.multiple && (this.limit && this.items.length >= this.limit)) return false
+            return true
+        },
+        editable () {
+            return !(this.readonly || this.disabled)
+        },
+        toolsWidth () {
+            const length = this.editable ? 3 : 1
+            return (30 * length) + 'px'
         }
-      }
-      if (type !== '' && this.accept !== '*') {
-        // 现存的附件类型
-        const targetFileTypes = fileTypes[type]
-        this.targetExt = targetFileTypes.includes(result)
-      } else {
-        if (this.accept === '*') {
-        // 不限制
-          this.targetExt = true
-        } else {
-        // 自定义
-          const targetFileTypes = this.accept.split(',')
-          this.targetExt = targetFileTypes.includes('.' + result)
-        }
-      }
-      return this.targetExt
     },
-
-    handleReselectSuccess(response, file, fileList) {
-      this.fileList = fileList
-      const targetFile = file.response.data
-      var data = this.value
-      if (this.multiple) {
-        data.splice(this.defaultSelectIndex, 1, targetFile)
-      } else {
-        data = targetFile
-      }
-      this.$emit('action-event', 'confirm', data)
+    methods: {
+        init () {
+            this.fileList = []
+        },
+        handleUpload () {
+            if (!this.editable) return
+            this.$emit('action-event', 'select')
+        },
+        // 在线编辑报表
+        handleEdit (index) {
+            this.$emit('action-event', 'edit', index, this.value[index] || this.value, this.operation_status)
+        },
+        handleReselect (index) {
+            if (!this.editable) return
+            if (this.uploadType === 'attachment') {
+                this.$emit('action-event', 'reselect', index)
+            } else {
+                this.$refs.defaultReselectUpload.$refs['upload-inner'].handleClick()
+                this.defaultSelectIndex = index
+            }
+        },
+        handleRemove (index) {
+            if (!this.editable) return
+            this.$emit('action-event', 'remove', index)
+        },
+        handleDownload (index) {
+            this.$emit('action-event', 'download', index)
+        },
+        handlePreview (index) {
+            this.$emit('action-event', 'preview', index)
+        },
+        // 默认上传模块
+        httpRequest (options) {
+            return uploadFile(options.file, {})
+        },
+        handleSuccess (response, file, fileList) {
+            this.fileList = fileList
+            this.emitCallback(fileList, file)
+        },
+        emitCallback (list, file) {
+            let data = this.multiple ? [] : {}
+            if (this.multiple) {
+                data = this.getFileDataList(list)
+            } else {
+                data = file.response.data
+            }
+            this.$emit('action-event', 'confirm', data)
+        },
+        getFileDataList (fileList) {
+            if (this.$utils.isEmpty(fileList)) {
+                return []
+            }
+            return fileList.map((file) => {
+                return file.response.data
+            })
+        },
+        handleError () {
+            // TODO:
+        },
+        beforeUpload (file) {
+            if (this.limit && this.limit === 0) {
+                this.$message({
+                    message: '上传文件个数不能为0,请重新设置',
+                    type: 'warning'
+                })
+                return false
+            }
+            if (this.fileSize && file.size > this.fileSize) {
+                this.$message.closeAll()
+                this.$message({
+                    message: `上传文件的尺寸大于${this.$utils.formatSize(this.fileSize, 2, ['B', 'K', 'M', 'G', 'TB'])}`,
+                    type: 'warning'
+                })
+                return false
+            }
+            if (this.accept && !this.fileExtType(file)) {
+                this.$message.closeAll()
+                this.$message({
+                    message: '不允许的文件类型',
+                    type: 'warning'
+                })
+                return false
+            }
+        },
+        /**
+         * 文件类型的检测
+         */
+        fileExtType (file) {
+            const accept = this.accept
+            const acceptTypes = this.acceptTypes
+            const fileTypes = this.fileTypes
+            const arr = file.name.split('.')
+            const result = arr[arr.length - 1]
+            let type = ''
+            this.targetExt = false
+            for (const i in acceptTypes) {
+                if (acceptTypes[i] === accept) {
+                    type = i
+                }
+            }
+            if (type !== '' && this.accept !== '*') {
+                // 现存的附件类型
+                const targetFileTypes = fileTypes[type]
+                this.targetExt = targetFileTypes.includes(result)
+            } else {
+                if (this.accept === '*') {
+                    // 不限制
+                    this.targetExt = true
+                } else {
+                    // 自定义
+                    const targetFileTypes = this.accept.split(',')
+                    this.targetExt = targetFileTypes.includes('.' + result)
+                }
+            }
+            return this.targetExt
+        },
+        handleReselectSuccess (response, file, fileList) {
+            this.fileList = fileList
+            const targetFile = file.response.data
+            var data = this.value
+            if (this.multiple) {
+                data.splice(this.defaultSelectIndex, 1, targetFile)
+            } else {
+                data = targetFile
+            }
+            this.$emit('action-event', 'confirm', data)
+        },
+        updateSort ({ to, from, item, clone, oldIndex, newlndex }) {
+            // console.log(to, from, item, clone, oldIndex, newlndex)
+            console.log(this.value)
+            console.log(this.sortList)
+        }
     }
-  }
 }
 </script>

+ 540 - 522
src/business/platform/file/image/index.vue

@@ -1,93 +1,94 @@
 <template>
-  <div class="ibps-image">
-    <!--展示-->
-    <ul class="ibps-p-0">
-      <li
-        v-for="(item, index) in fileList"
-        :key="index"
-        class="image-reader-item"
-        :style="{
-          'backgroundImage': 'url(' + getImageUrl(item.id) + ')' ,
-          'backgroundPosition': 'center center',
-          'backgroundRepeat': 'no-repeat',
-          'backgroundSize': 'cover',
-          'width':`${$utils.isEmpty(width)?100:width}px`,
-          'height':`${$utils.isEmpty(height)?100:height}px`
-        }"
-        @click="clickHandler(item, index)"
-        @mouseover="showTips(item, index)"
-        @mouseout="hideTips(item, index)"
-      >
-        <el-tag
-          v-if="!disabled"
-          class="image-reader-item-tag"
-          @click.stop="onDeleteImage(index)"
-        >
-          <i class="el-icon-delete" />
-        </el-tag>
-        <el-tag
-          v-if="!disabled"
-          class="image-reader-item-tag"
-          @click.stop="onDownloadImage(index)"
-        >
-          <i class="el-icon-download" />
-        </el-tag>
-        <div
-          :class="{'image-tip-visible':item.uid !== uid,'image-tip':item.uid === uid}"
-          v-text="tip"
+    <div class="ibps-image">
+        <!--展示-->
+        <ul class="ibps-p-0">
+            <vue-draggable
+                v-if="fileList && fileList.length"
+                v-model="fileList"
+                v-bind="draggableOptions"
+                class="list-group"
+                @start="isDragging = true"
+                @end="()=>{isDragging= false}"
+            >
+                <li
+                    v-for="(item, index) in fileList"
+                    :key="index"
+                    class="image-reader-item"
+                    :style="{
+                        'backgroundImage': 'url(' + getImageUrl(item.id) + ')',
+                        'backgroundPosition': 'center center',
+                        'backgroundRepeat': 'no-repeat',
+                        'backgroundSize': 'cover',
+                        'width': `${$utils.isEmpty(width) ? 100 : width}px`,
+                        'height': `${$utils.isEmpty(height) ? 100 : height}px`
+                    }"
+                    @click="clickHandler(item, index)"
+                    @mouseover="showTips(item, index)"
+                    @mouseout="hideTips(item, index)"
+                >
+                    <el-tag v-if="!disabled" class="image-reader-item-tag" @click.stop="onDeleteImage(index)">
+                        <i class="el-icon-delete" />
+                    </el-tag>
+                    <el-tag v-if="!disabled" class="image-reader-item-tag" @click.stop="onDownloadImage(index)">
+                        <i class="el-icon-download" />
+                    </el-tag>
+                    <el-tag v-if="!disabled" class="image-reader-item-tag draggable" @click.stop="onDownloadImage(index)">
+                        <i class="el-icon-rank" />
+                    </el-tag>
+                    <div :class="{ 'image-tip-visible': item.uid !== uid, 'image-tip': item.uid === uid }" v-text="tip" />
+                </li>
+            </vue-draggable>
+        </ul>
+        <template v-if="!disabled && (isBuilder || fileList.length < limit || !limit)">
+            <!--ibps 附件上传方式-->
+            <el-upload
+                v-if="uploadType === 'attachment'"
+                :style="uploadStyle"
+                :action="action"
+                :disabled="true"
+                :file-list="fileList"
+                list-type="picture-card"
+                @click.native="clickAttachmentUpload"
+            >
+                <i class="el-icon-plus" />
+            </el-upload>
+            <!--默认附件上传方式-->
+            <el-upload
+                v-else
+                :style="uploadStyle"
+                action="action"
+                list-type="picture-card"
+                :http-request="httpRequest"
+                :file-list="fileList"
+                :multiple="multiple"
+                :accept="fileAccept"
+                :limit="flieLimit"
+                :disabled="disabled"
+                :on-exceed="handlePicAmount"
+                :before-upload="beforeUpload"
+            >
+                <i class="el-icon-plus" />
+            </el-upload>
+        </template>
+        <!--图片预览-->
+        <ibps-image-viewer
+            v-if="showViewer"
+            :z-index="zIndex"
+            :initial-index="initialIndex"
+            :on-close="closeViewer"
+            :url-list="previewSrcList"
         />
-      </li>
-    </ul>
-    <template v-if="!disabled&&(isBuilder||fileList.length<limit||!limit)">
-      <!--ibps 附件上传方式-->
-      <el-upload
-        v-if="uploadType === 'attachment'"
-        :style="uploadStyle"
-        :action="action"
-        :disabled="true"
-        :file-list="fileList"
-        list-type="picture-card"
-        @click.native="clickAttachmentUpload"
-      >
-        <i class="el-icon-plus" />
-      </el-upload>
-      <!--默认附件上传方式-->
-      <el-upload
-        v-else
-        :style="uploadStyle"
-        action="action"
-        list-type="picture-card"
-        :http-request="httpRequest"
-        :file-list="fileList"
-        :multiple="multiple"
-        :accept="fileAccept"
-        :limit="flieLimit"
-        :disabled="disabled"
-        :on-exceed="handlePicAmount"
-        :before-upload="beforeUpload"
-      >
-        <i class="el-icon-plus" />
-      </el-upload>
-    </template>
-    <!--图片预览-->
-    <ibps-image-viewer
-      v-if="showViewer"
-      :z-index="zIndex"
-      :initial-index="initialIndex"
-      :on-close="closeViewer"
-      :url-list="previewSrcList"
-    />
 
-    <ibps-uploader-selector-dialog
-      :visible="uploaderSelectorVisible"
-      :value="selectorValue"
-      :multiple="multiple"
-      :accept="accept"
-      :file-size="size"
-      @close="visible => uploaderSelectorVisible = visible"
-      @action-event="handleUpload"
-    />
-  </div>
+        <ibps-uploader-selector-dialog
+            :visible="uploaderSelectorVisible"
+            :value="selectorValue"
+            :multiple="multiple"
+            :accept="accept"
+            :file-size="size"
+            @close="visible => uploaderSelectorVisible = visible"
+            @action-event="handleUpload"
+        />
+    </div>
 </template>
 
 <script>
@@ -101,457 +102,474 @@ import PopupManager from '@/utils/popup'
 import IbpsUploaderSelectorDialog from '@/business/platform/file/uploader'
 import IbpsImageViewer from '@/components/ibps-file-viewer/image'
 import { TRANSFER_DATA } from '@/constant'
+import VueDraggable from 'vuedraggable'
 
 export default {
-  name: 'ibps-image',
-  components: {
-    IbpsUploaderSelectorDialog,
-    IbpsImageViewer
-  },
-  mixins: [emitter],
-  props: {
-    value: {
-      type: [String, Number, Array, Object]
-    },
-    size: [Number, String], // 限制大小
-    accept: String, // 限制图片类型
-    tip: String, // 提示消息
-    limit: [Number, String], // 上传数量
-    // quality: Number, // 压缩质量
-    width: { // 宽
-      type: String,
-      default: '150'
-    },
-    height: { // 高
-      type: String,
-      default: '150'
-    },
-    disabled: { // 是否禁用
-      type: Boolean,
-      default: false
-    },
-    isBuilder: { // 是否表单设计
-      type: Boolean,
-      default: false
-    },
-    multiple: { // 是否支持选择多张
-      type: Boolean,
-      default: true
-    },
-    uploadType: { // 上传方式 ( default:直接打开上传,attachment:ibps上传附件打开上传 )
-      type: String,
-      default: 'attachment'
-    },
-    store: {
-      type: String,
-      default: 'json',
-      validator: function(value) {
-        return ['id', 'json', 'array', 'arrayId', 'bind'].indexOf(value) !== -1
-      }
-    },
-    labelKey: { // 展示的值
-      type: String,
-      default: 'fileName'
-    },
-    valueKey: { // 存储唯一值
-      type: String,
-      default: 'id'
-    }
-  },
-  inject: {
-    elForm: {
-      default: ''
-    },
-    elFormItem: {
-      default: ''
-    }
-  },
-  data() {
-    return {
-      action: 'https://www.bpmhome.cn/post',
-      fileList: [],
-      realFileList: [],
-      selectorValue: this.multiple ? [] : {},
-      cacheData: {}, // 缓存数据
-      initialIndex: 0,
-      showViewer: false,
-      zIndex: 2000,
-      uploaderSelectorVisible: false,
-      isActive: false,
-      uid: ''
-    }
-  },
-  computed: {
-    flieLimit() {
-      return this.$utils.isNotEmpty(this.limit) ? parseInt(this.limit) : null
-    },
-    fileAccept() {
-      if (this.$utils.isEmpty(this.accept) || this.accept === '*') {
-        return 'image/*'
-      }
-      return this.converImageAccept(this.accept)
-    },
-    previewSrcList() {
-      const list = []
-      this.fileList.forEach(file => {
-        list.push(previewFile(file.id))
-      })
-      return list
-    },
-    uploadStyle() {
-      const { width, height } = this
-      return {
-        'width': `${this.$utils.isEmpty(width) ? 100 : width}px`,
-        'height': `${this.$utils.isEmpty(height) ? 100 : height}px`,
-        'lineHeight': `${this.$utils.isEmpty(height) ? 100 : height}px`,
-        'display': 'inline'
-      }
-    }
-  },
-  watch: {
-    value(val, oldVal) {
-      this.setValue()
-      if (!valueEquals(val, oldVal)) {
-        this.dispatch('ElFormItem', 'el.form.change', val)
-      }
-    },
-    fileList: {
-      handler(val, oldVal) {
-        this.$emit('input', this.getValue())
-      },
-      deep: true
-    }
-  },
-  mounted() {
-    this.setValue()
-  },
-  methods: {
-    /**
-     * zxh 修复zindex 不是最高的被遮住
-     */
-    fixZIndex() {
-      return PopupManager.getZIndex()
-    },
-    converImageAccept(accept) {
-      const accepts = accept.split(',')
-      const fileAccept = []
-      accepts.forEach((item) => {
-        let type = item
-        if (item.substr(0, 1) === '.') {
-          type = item.substr(1)
+    name: 'ibps-image',
+    components: {
+        IbpsUploaderSelectorDialog,
+        IbpsImageViewer,
+        VueDraggable
+    },
+    mixins: [emitter],
+    props: {
+        value: {
+            type: [String, Number, Array, Object]
+        },
+        size: [Number, String], // 限制大小
+        accept: String, // 限制图片类型
+        tip: String, // 提示消息
+        limit: [Number, String], // 上传数量
+        // quality: Number, // 压缩质量
+        width: { // 宽
+            type: String,
+            default: '150'
+        },
+        height: { // 高
+            type: String,
+            default: '150'
+        },
+        disabled: { // 是否禁用
+            type: Boolean,
+            default: false
+        },
+        isBuilder: { // 是否表单设计
+            type: Boolean,
+            default: false
+        },
+        multiple: { // 是否支持选择多张
+            type: Boolean,
+            default: true
+        },
+        uploadType: { // 上传方式 ( default:直接打开上传,attachment:ibps上传附件打开上传 )
+            type: String,
+            default: 'attachment'
+        },
+        store: {
+            type: String,
+            default: 'json',
+            validator: function (value) {
+                return ['id', 'json', 'array', 'arrayId', 'bind'].indexOf(value) !== -1
+            }
+        },
+        labelKey: { // 展示的值
+            type: String,
+            default: 'fileName'
+        },
+        valueKey: { // 存储唯一值
+            type: String,
+            default: 'id'
         }
-        fileAccept.push('.' + type)
-      })
-      return fileAccept.join(',')
     },
-    converFileAccept(accept) {
-      const accepts = accept.split(',')
-      const fileAccept = []
-      accepts.forEach((item) => {
-        let type = item
-        if (item.substr(0, 1) === '.') {
-          type = item.substr(1)
+    inject: {
+        elForm: {
+            default: ''
+        },
+        elFormItem: {
+            default: ''
         }
-        fileAccept.push(imageAccept[type])
-      })
-      return fileAccept
     },
-    setValue() {
-      if (this.$utils.isEmpty(this.value)) {
-        this.fileList = []
-        return
-      }
-      // TODO: id展示问题
-      this.fileList = this.getArrayValue(this.value)
-      this.initRealFileList()
-    },
-    initRealFileList() {
-      this.realFileList = []
-      this.fileList.forEach(v => {
-        const id = v[this.valueKey]
-        if (this.cacheData[id]) {
-          this.setRealFileList(id)
-        } else {
-          this.getDataInfo(id)
+    data () {
+        return {
+            action: 'https://www.bpmhome.cn/post',
+            fileList: [],
+            realFileList: [],
+            selectorValue: this.multiple ? [] : {},
+            cacheData: {}, // 缓存数据
+            initialIndex: 0,
+            showViewer: false,
+            zIndex: 2000,
+            uploaderSelectorVisible: false,
+            isActive: false,
+            uid: '',
+            isDragging: false,
+            draggableOptions: {
+                handle: '.draggable',
+                ghostClass: 'sortable-ghost',
+                distance: 1,
+                disabled: false,
+                animation: 200,
+                axis: 'y'
+            }
         }
-      })
-    },
-    setCacheData(v) {
-      this.cacheData[v[this.valueKey]] = v
-    },
-    setRealFileList(v) {
-      this.realFileList.push(this.cacheData[v])
-    },
-    /**
-    * 通过ID获取数据
-     */
-    getDataInfo(id) {
-      if (TRANSFER_DATA === 'transfer') {
-        this.getTransferData(id)
-      } else {
-        this.getRemoteData(id)
-      }
-    },
-    getTransferData(id) {
-      remoteTransRequest('attachment', id).then(idset => {
-        const ids = Array.from(idset)
-        remoteRequest('attachmentIds', ids, () => {
-          return this.getRemoteTransFunc(ids)
-        }).then(response => {
-          const responseData = response.data
-          const data = responseData[id]
-          this.setRemoteData(data)
-        }).catch(() => {
-        })
-      })
-    },
-    getRemoteTransFunc(ids) {
-      return new Promise((resolve, reject) => {
-        transfer({
-          'ids': ids
-        }).then(response => {
-          resolve(response)
-        }).catch((error) => {
-          reject(error)
-        })
-      })
     },
-
-    getRemoteData(id) {
-      remoteRequest('attachment' + this.valueKey, id, () => {
-        return this.getRemoteByIdFunc(id)
-      }).then(response => {
-        const data = response.data
-        this.setRemoteData(data)
-      }).catch(() => {
-      })
-    },
-    getRemoteByIdFunc(id) {
-      return new Promise((resolve, reject) => {
-        get({
-          attachmentId: id
-        }).then(response => {
-          resolve(response)
-        }).catch(() => {
-        })
-      })
-    },
-    setRemoteData(data) {
-      if (this.$utils.isNotEmpty(data)) {
-        this.cacheData[data[this.valueKey]] = data
-        this.setSelectorValue(data[this.valueKey])
-      }
-    },
-    /**
-     * 获得数组数据
-     */
-    getArrayValue(value) {
-      if (this.$utils.isEmpty(value)) {
-        return []
-      }
-      if (this.store === 'json') { // json
-        try {
-          return this.$utils.parseData(value)
-        } catch (error) {
-          console.error(error)
-          return []
+    computed: {
+        flieLimit () {
+            return this.$utils.isNotEmpty(this.limit) ? parseInt(this.limit) : null
+        },
+        fileAccept () {
+            if (this.$utils.isEmpty(this.accept) || this.accept === '*') {
+                return 'image/*'
+            }
+            return this.converImageAccept(this.accept)
+        },
+        previewSrcList () {
+            const list = []
+            this.fileList.forEach(file => {
+                list.push(previewFile(file.id))
+            })
+            return list
+        },
+        uploadStyle () {
+            const { width, height } = this
+            return {
+                'width': `${this.$utils.isEmpty(width) ? 100 : width}px`,
+                'height': `${this.$utils.isEmpty(height) ? 100 : height}px`,
+                'lineHeight': `${this.$utils.isEmpty(height) ? 100 : height}px`,
+                'display': 'inline'
+            }
         }
-      } else if (this.store === 'id') { // id
-        return this.$utils.isString(value) ? value.split(this.storeSeparator) : []
-      } else { // array
-        return value.map((d) => {
-          return d[this.valueKey]
-        })
-      }
     },
-    getStoreValue(value) {
-      const res = []
-      if (this.store === 'json') { // json
-        if (this.$utils.isEmpty(value)) {
-          return ''
+    watch: {
+        value (val, oldVal) {
+            this.setValue()
+            if (!valueEquals(val, oldVal)) {
+                this.dispatch('ElFormItem', 'el.form.change', val)
+            }
+        },
+        fileList: {
+            handler (val, oldVal) {
+                console.log(val)
+                this.$emit('input', this.getValue())
+            },
+            deep: true
         }
-        value.forEach(v => {
-          const o = {}
-          o[this.valueKey] = v[this.valueKey]
-          o[this.labelKey] = v[this.labelKey]
-          res.push(o)
-        })
-        return JSON.stringify(res)
-      } else if (this.store === 'id') { // id
-        if (this.$utils.isEmpty(value)) {
-          return ''
-        }
-        value.forEach(v => {
-          res.push(v[this.valueKey])
-        })
-        return res.join(this.storeSeparator)
-      } else { // 数组 array
-        return value || []
-      }
-    },
-    getValue() {
-      return this.getStoreValue(this.fileList)
-    },
-    showTips(item, index) {
-      this.uid = item.uid
-      // item.isActive = true
-    },
-    hideTips(item, index) {
-      this.uid = ''
-    },
-    /**
-     * 文件上传
-     */
-    httpRequest(options) {
-      return uploadFile(options.file, {}).then((response) => {
-        const data = response.data
-        this.setCacheData(data)
-        this.fileList.push(data)
-      })
-    },
-    /**
-     * 上传方式为ibps附件上传时
-     */
-    clickAttachmentUpload() {
-      this.uploaderSelectorVisible = true
-    },
-    handleSuccess(response, file, fileList) {
-      if (!this.disabled) {
-        this.fileList = fileList.map(item => {
-          item.isActive = false
-          return item
-        })
-      }
-    },
-    // handleChange(file, fileList) {
-    //   this.fileList = fileList
-    // },
-    // handleRemove(file, fileList) {
-    //   this.fileList = fileList
-    // },
-    // 预览
-    clickHandler(file, index) {
-      this.zIndex = this.fixZIndex()
-      this.initialIndex = index
-      this.showViewer = true
-    },
-    closeViewer() {
-      this.showViewer = false
-    },
-    /**
-     *  删除图片
-     */
-    onDeleteImage(index) {
-      // if (this.uploadType === 'default') {
-      // TODD:删除同时删除数据库的
-      // } else {
-      this.fileList.splice(index, 1)
-      // }
     },
-    // 下载
-    onDownloadImage(index) {
-      this.setRealFileList(this.fileList[index][this.valueKey])
-      this.$nextTick(() => {
-        downloadFile(this.realFileList[index])
-      })
-    },
-    // 图片上传数量限制
-    handlePicAmount(files, fileList) {
-      if (this.multiple && this.limit) {
-        this.$message.closeAll()
-        this.$message({
-          message: `图片上传上限${this.limit}张`,
-          type: 'warning'
-        })
-      }
-    },
-    // 格式、大小限制
-    beforeUpload(file) {
-      let isType = true
-      if (this.$utils.isNotEmpty(this.accept) && this.accept !== '*') {
-        const acceptType = this.converFileAccept(this.accept)
-        isType = this.accept ? acceptType.includes(file.type) : true
-        if (!isType) {
-          this.$message.closeAll()
-          this.$message.error(`上传图片的格式必须为【${this.accept}】`)
-          return false
-        }
-      }
+    mounted () {
+        this.setValue()
+    },
+    methods: {
+        /**
+         * zxh 修复zindex 不是最高的被遮住
+         */
+        fixZIndex () {
+            return PopupManager.getZIndex()
+        },
+        converImageAccept (accept) {
+            const accepts = accept.split(',')
+            const fileAccept = []
+            accepts.forEach((item) => {
+                let type = item
+                if (item.substr(0, 1) === '.') {
+                    type = item.substr(1)
+                }
+                fileAccept.push('.' + type)
+            })
+            return fileAccept.join(',')
+        },
+        converFileAccept (accept) {
+            const accepts = accept.split(',')
+            const fileAccept = []
+            accepts.forEach((item) => {
+                let type = item
+                if (item.substr(0, 1) === '.') {
+                    type = item.substr(1)
+                }
+                fileAccept.push(imageAccept[type])
+            })
+            return fileAccept
+        },
+        setValue () {
+            if (this.$utils.isEmpty(this.value)) {
+                this.fileList = []
+                return
+            }
+            // TODO: id展示问题
+            this.fileList = this.getArrayValue(this.value)
+            this.initRealFileList()
+        },
+        initRealFileList () {
+            this.realFileList = []
+            this.fileList.forEach(v => {
+                const id = v[this.valueKey]
+                if (this.cacheData[id]) {
+                    this.setRealFileList(id)
+                } else {
+                    this.getDataInfo(id)
+                }
+            })
+        },
+        setCacheData (v) {
+            this.cacheData[v[this.valueKey]] = v
+        },
+        setRealFileList (v) {
+            this.realFileList.push(this.cacheData[v])
+        },
+        /**
+        * 通过ID获取数据
+        */
+        getDataInfo (id) {
+            if (TRANSFER_DATA === 'transfer') {
+                this.getTransferData(id)
+            } else {
+                this.getRemoteData(id)
+            }
+        },
+        getTransferData (id) {
+            remoteTransRequest('attachment', id).then(idset => {
+                const ids = Array.from(idset)
+                remoteRequest('attachmentIds', ids, () => {
+                    return this.getRemoteTransFunc(ids)
+                }).then(response => {
+                    const responseData = response.data
+                    const data = responseData[id]
+                    this.setRemoteData(data)
+                }).catch(() => {
+                })
+            })
+        },
+        getRemoteTransFunc (ids) {
+            return new Promise((resolve, reject) => {
+                transfer({
+                    'ids': ids
+                }).then(response => {
+                    resolve(response)
+                }).catch((error) => {
+                    reject(error)
+                })
+            })
+        },
 
-      const isLimitSize = this.size ? (file.size / 1024 / 1024 < this.size) : true
-      if (!isLimitSize) {
-        this.$message.closeAll()
-        this.$message.error(`上传图片的大小不能超过 ${this.size}M!`)
-        return false
-      }
-      return isLimitSize && isType
-    },
-    handleUpload(buttonKey, data) {
-      const limit = parseInt(this.limit)
-      if (this.$utils.isNotEmpty(this.limit) && data.length > limit) {
-        this.$message.closeAll()
-        this.$message.error(`图片上传上限${this.limit}张`)
-        return
-      }
-      if (this.$utils.isNotEmpty(this.fileList) && (this.fileList.length >= limit || this.fileList.length + data.length > limit)) {
-        this.$message.closeAll()
-        this.$message.error(`图片数量上限为${this.limit}张`)
-        return
-      }
-      data.forEach(d => {
-        this.setCacheData(d)
-        this.fileList.push(d)
-      })
-      this.uploaderSelectorVisible = false
-    },
-    getImageUrl(id) {
-      return previewFile(id)
+        getRemoteData (id) {
+            remoteRequest('attachment' + this.valueKey, id, () => {
+                return this.getRemoteByIdFunc(id)
+            }).then(response => {
+                const data = response.data
+                this.setRemoteData(data)
+            }).catch(() => {
+            })
+        },
+        getRemoteByIdFunc (id) {
+            return new Promise((resolve, reject) => {
+                get({
+                    attachmentId: id
+                }).then(response => {
+                    resolve(response)
+                }).catch(() => {
+                })
+            })
+        },
+        setRemoteData (data) {
+            if (this.$utils.isNotEmpty(data)) {
+                this.cacheData[data[this.valueKey]] = data
+                this.setSelectorValue(data[this.valueKey])
+            }
+        },
+        /**
+         * 获得数组数据
+         */
+        getArrayValue (value) {
+            if (this.$utils.isEmpty(value)) {
+                return []
+            }
+            if (this.store === 'json') { // json
+                try {
+                    return this.$utils.parseData(value)
+                } catch (error) {
+                    console.error(error)
+                    return []
+                }
+            } else if (this.store === 'id') { // id
+                return this.$utils.isString(value) ? value.split(this.storeSeparator) : []
+            } else { // array
+                return value.map((d) => {
+                    return d[this.valueKey]
+                })
+            }
+        },
+        getStoreValue (value) {
+            const res = []
+            if (this.store === 'json') { // json
+                if (this.$utils.isEmpty(value)) {
+                    return ''
+                }
+                value.forEach(v => {
+                    const o = {}
+                    o[this.valueKey] = v[this.valueKey]
+                    o[this.labelKey] = v[this.labelKey]
+                    res.push(o)
+                })
+                return JSON.stringify(res)
+            } else if (this.store === 'id') { // id
+                if (this.$utils.isEmpty(value)) {
+                    return ''
+                }
+                value.forEach(v => {
+                    res.push(v[this.valueKey])
+                })
+                return res.join(this.storeSeparator)
+            } else { // 数组 array
+                return value || []
+            }
+        },
+        getValue () {
+            return this.getStoreValue(this.fileList)
+        },
+        showTips (item, index) {
+            this.uid = item.uid
+            // item.isActive = true
+        },
+        hideTips (item, index) {
+            this.uid = ''
+        },
+        /**
+         * 文件上传
+         */
+        httpRequest (options) {
+            return uploadFile(options.file, {}).then((response) => {
+                const data = response.data
+                this.setCacheData(data)
+                this.fileList.push(data)
+            })
+        },
+        /**
+         * 上传方式为ibps附件上传时
+         */
+        clickAttachmentUpload () {
+            this.uploaderSelectorVisible = true
+        },
+        handleSuccess (response, file, fileList) {
+            if (!this.disabled) {
+                this.fileList = fileList.map(item => {
+                    item.isActive = false
+                    return item
+                })
+            }
+        },
+        // handleChange(file, fileList) {
+        //   this.fileList = fileList
+        // },
+        // handleRemove(file, fileList) {
+        //   this.fileList = fileList
+        // },
+        // 预览
+        clickHandler (file, index) {
+            this.zIndex = this.fixZIndex()
+            this.initialIndex = index
+            this.showViewer = true
+        },
+        closeViewer () {
+            this.showViewer = false
+        },
+        /**
+         *  删除图片
+         */
+        onDeleteImage (index) {
+            // if (this.uploadType === 'default') {
+            // TODD:删除同时删除数据库的
+            // } else {
+            this.fileList.splice(index, 1)
+            // }
+        },
+        // 下载
+        onDownloadImage (index) {
+            this.setRealFileList(this.fileList[index][this.valueKey])
+            this.$nextTick(() => {
+                downloadFile(this.realFileList[index])
+            })
+        },
+        // 图片上传数量限制
+        handlePicAmount (files, fileList) {
+            if (this.multiple && this.limit) {
+                this.$message.closeAll()
+                this.$message({
+                    message: `图片上传上限${this.limit}张`,
+                    type: 'warning'
+                })
+            }
+        },
+        // 格式、大小限制
+        beforeUpload (file) {
+            let isType = true
+            if (this.$utils.isNotEmpty(this.accept) && this.accept !== '*') {
+                const acceptType = this.converFileAccept(this.accept)
+                isType = this.accept ? acceptType.includes(file.type) : true
+                if (!isType) {
+                    this.$message.closeAll()
+                    this.$message.error(`上传图片的格式必须为【${this.accept}】`)
+                    return false
+                }
+            }
+
+            const isLimitSize = this.size ? (file.size / 1024 / 1024 < this.size) : true
+            if (!isLimitSize) {
+                this.$message.closeAll()
+                this.$message.error(`上传图片的大小不能超过 ${this.size}M!`)
+                return false
+            }
+            return isLimitSize && isType
+        },
+        handleUpload (buttonKey, data) {
+            const limit = parseInt(this.limit)
+            if (this.$utils.isNotEmpty(this.limit) && data.length > limit) {
+                this.$message.closeAll()
+                this.$message.error(`图片上传上限${this.limit}张`)
+                return
+            }
+            if (this.$utils.isNotEmpty(this.fileList) && (this.fileList.length >= limit || this.fileList.length + data.length > limit)) {
+                this.$message.closeAll()
+                this.$message.error(`图片数量上限为${this.limit}张`)
+                return
+            }
+            data.forEach(d => {
+                this.setCacheData(d)
+                this.fileList.push(d)
+            })
+            this.uploaderSelectorVisible = false
+        },
+        getImageUrl (id) {
+            return previewFile(id)
+        }
     }
-  }
 }
 </script>
 <style lang="scss">
-.ibps-image {
-  .el-upload-list--picture-card {
-    display: none;
-  }
-  .el-upload--picture-card{
-    width: inherit;
-    height: inherit;
-    line-height: inherit;
-  }
-  .image-reader-item {
-    position: relative;
-    float: left;
-    width: 23.5%;
-    margin-bottom: 2%;
-    margin-right: 2%;
-    background: #FFF;
-    box-shadow: 0 5px 20px rgba(197, 202, 213, .25);
-    box-sizing: border-box;
-    list-style: none;
-    border-radius: 4px;
-    background-size: cover;
-    overflow: hidden;
-    .image-reader-item-tag{
-      background: #111A34;
-      color: #fff;
-      float: right;
-      border-radius: 0;
-      padding: 0 10px;
-      border: 0;
-    }
-    .image-tip-visible {
-      display: none
-    }
-    .image-tip {
-      position: absolute;
-      bottom: 0;
-      color: #fff;
-      background: #111A34;
-      font-size: 12px;
-      width: 100%;
+    .ibps-image {
+        font-size: 28px;
+        .el-upload-list--picture-card {
+            display: none;
+        }
+        .el-upload--picture-card {
+            width: inherit;
+            height: inherit;
+            line-height: inherit;
+        }
+        .image-reader-item {
+            position: relative;
+            float: left;
+            width: 23.5%;
+            margin-bottom: 2%;
+            margin-right: 2%;
+            background: #FFF;
+            box-shadow: 0 5px 20px rgba(197, 202, 213, .25);
+            box-sizing: border-box;
+            list-style: none;
+            border-radius: 4px;
+            background-size: cover;
+            overflow: hidden;
+            .image-reader-item-tag {
+                background: #111A34;
+                color: #fff;
+                float: right;
+                border-radius: 0;
+                padding: 0 10px;
+                border: 0;
+                cursor: pointer;
+            }
+            .draggable {
+                cursor: move;
+            }
+            .image-tip-visible {
+                display: none
+            }
+            .image-tip {
+                position: absolute;
+                bottom: 0;
+                color: #fff;
+                background: #111A34;
+                font-size: 12px;
+                width: 100%;
+            }
+        }
     }
-  }
-}
 </style>

+ 10 - 5
src/business/platform/file/uploader/online.vue

@@ -2,7 +2,10 @@
     <div :style="{ height: height }">
         <el-form :model="form" :inline="true" @keyup.enter.native="onSearch" @submit.native.prevent>
             <el-form-item label="文件名" prop="name">
-                <el-input v-model="form.name" placeholder="文件名" @keyup.enter.native="onSearch" />
+                <el-input v-model="form.name" placeholder="请输入文件名" clearable @keyup.enter.native="onSearch" />
+            </el-form-item>
+            <el-form-item label="扩展名" prop="ext">
+                <el-input v-model="form.ext" placeholder="请输入扩展名" clearable @keyup.enter.native="onSearch" />
             </el-form-item>
             <el-form-item>
                 <el-button type="primary" @click="onSearch">查询</el-button>
@@ -40,7 +43,7 @@
                 </template>
             </el-table-column>
             <el-table-column label="文件名" prop="fileName" />
-            <el-table-column label="扩展名" prop="ext" />
+            <el-table-column label="扩展名" prop="ext" width="100px" />
         </el-table>
         <el-pagination
             :current-page="currentPage"
@@ -82,14 +85,15 @@
                 pkKey: 'id',
                 currentPage: 0,
                 pageSizes: [10, 20, 50, 100],
-                pageSize: 20,
+                pageSize: 10,
                 totalKey: 'totalCount',
                 pageKey: 'page',
                 pageCountKey: 'totalPages',
                 selectionRow: true,
                 format: true,
                 form: {
-                    name: ''
+                    name: '',
+                    ext: ''
                 },
                 fileList: [],
                 multipleSelection: [],
@@ -262,7 +266,8 @@
             getSearcFormData() {
                 return ActionUtils.formatParams(
                     {
-                        'Q^FILE_NAME_^SL': this.form.name
+                        'Q^FILE_NAME_^SL': this.form.name,
+                        'Q^EXT_^SL': this.form.ext
                     },
                     this.pagination,
                     this.sorts

+ 2 - 0
src/utils/common.js

@@ -6,6 +6,7 @@ import pinyin4js from 'pinyin4js'
 import { snapshoot } from '@/api/platform/file/attachment'
 import { getNextIdByAlias } from '@/api/platform/system/identity'
 import { save as sendMsg } from '@/api/platform/message/innerMessage'
+import { save as saveNews } from '@/api/platform/system/news'
 import { bpmTaskSave } from '@/api/platform/bpmn/bpmTask'
 import { onlyOfficeToPdf } from '@/api/platform/form/seal'
 import { downloadFile as download } from '@/business/platform/file/utils'
@@ -55,6 +56,7 @@ export default {
     encryptByAes,
     downloadByBlob,
     sendMsg,
+    saveNews,
     bpmTaskSave,
     getNow,
     onlyOfficeToPdf,

+ 5 - 0
src/views/platform/file/attachment/detail.vue

@@ -59,6 +59,7 @@
     import { get } from '@/api/platform/file/attachment'
     import { downloadFile } from '@/business/platform/file/utils'
     import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
+    import { fileTypes } from '@/business/platform/file/constants/fileTypes'
 
     export default {
         props: {
@@ -157,6 +158,10 @@
             },
             filePreview () {
                 const { id, fileName, ext } = this.data
+                if (fileTypes.images.includes(ext)) {
+                    this.$message.warning('图片附件请直接在列表预览!')
+                    return
+                }
                 this.fileOption.user.id = this.$store.getters.userId
                 this.fileOption.user.name = this.$store.getters.name
                 this.fileOption.url = BASE_API() + SYSTEM_URL() + `/file/download?attachmentId=${id}`

+ 2 - 1
src/views/platform/file/attachment/list.vue

@@ -62,6 +62,7 @@
     import FixHeight from '@/mixins/height'
     import IbpsUploader from '@/business/platform/file/uploader'
     import FilePreview from '@/business/platform/file/file-preview'
+    import { fileTypes } from '@/business/platform/file/constants/fileTypes'
     import Detail from './detail'
     import ModifyName from './modify-name'
     import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
@@ -263,7 +264,7 @@
                         break
                     case 'preview': // 预览
                         console.log('ext:', data.ext)
-                        if (['png', 'jpeg', 'jpg'].includes(data.ext)) {
+                        if (fileTypes.images.includes(data.ext)) {
                             this.file = data
                             this.filePreviewVisible2 = false
                             this.filePreviewVisible = true

+ 5 - 5
src/views/platform/message/inner/detail/dialog.vue

@@ -126,11 +126,11 @@ export default {
                 this.handleCallback(true)
             })
         },
-        getId(arr){
-            let idArrs=[]
-            for(var i of arr){
-                idArrs.push(i.id)
+        getId (arr) {
+            if (!arr.length) {
+                return ''
             }
+            const idArrs = arr.map(item => item.id)
             return idArrs.join(',')
         },
         // 消息确认,受控文件用
@@ -143,7 +143,7 @@ export default {
                 showClose: false,
                 closeOnClickModal: false
             }).then(() => {
-                console.log('userInfo',this.$store.getters.userInfo)
+                console.log('userInfo', this.$store.getters.userInfo)
                 // TODO 受控文件逻辑处理
                 const perInfosId = this.$store.getters.userInfo.user.id
                 const perInfosName = this.$store.getters.userInfo.user.name

Разница между файлами не показана из-за своего большого размера
+ 562 - 563
src/views/system/dashboard/components/new-home.vue


Некоторые файлы не были показаны из-за большого количества измененных файлов