Ver código fonte

资料库模块

huangguoce 6 meses atrás
pai
commit
6bb81b4b95

+ 10 - 0
src/api/sys/dictService.js

@@ -78,4 +78,14 @@ export default {
 			params: { ids: ids },
 		});
 	},
+
+	getDictListMapByDict: function (dictName) {
+		return request({
+			url: prefix + "/sys/dict/queryDictListByName",
+			params: {
+				dictName: dictName,
+			},
+			method: "get",
+		});
+	},
 };

+ 69 - 0
src/api/workCollectAccessory/index.js

@@ -0,0 +1,69 @@
+import request from "@/utils/httpRequest";
+import { PUBLIC_MODULES_PATH as prefix } from "../AppPath";
+
+export default {
+	collection(data) {
+		return request({
+			url: prefix + "/workCollectAccessory/collection",
+			method: "post",
+			data: data,
+		});
+	},
+
+	share(data) {
+		return request({
+			url: prefix + "/workCollectAccessory/share",
+			method: "post",
+			data: data,
+		});
+	},
+
+	list(param) {
+		return request({
+			url: prefix + "/workCollectAccessory/list",
+			method: "get",
+			params: param,
+		});
+	},
+
+	del(data) {
+		return request({
+			url: prefix + "/workCollectAccessory/del",
+			method: "post",
+			data: data,
+		});
+	},
+
+	saveForm(data) {
+		return request({
+			url: prefix + "/workCollectAccessory/saveForm",
+			method: "post",
+			data: data,
+		});
+	},
+
+	downloadAndUploadToOSS(data) {
+		return request({
+			url: prefix + "/oss/file/downloadAndUploadToOSS",
+			method: "post",
+			data: data,
+		});
+	},
+	updateById(data) {
+		return request({
+			url: prefix + "/workCollectAccessory/updateById",
+			method: "post",
+			data: data,
+		});
+	},
+
+	queryById(id) {
+		return request({
+			url: prefix + "/workCollectAccessory/queryById",
+			method: "get",
+			params: {
+				id: id,
+			},
+		});
+	},
+};

+ 215 - 0
src/views/attachment/Form.vue

@@ -0,0 +1,215 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-dialog :title="title" :close-on-click-modal="false" draggable width="50%" @close="close"
+			@keyup.enter.native="" v-model="visible" @open="handleOpen">
+			<el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method === 'view' ? 'readonly' : ''"
+				:disabled="status === 'audit' || status === 'taskFormDetail' || method === 'view'" label-width="100px"
+				@submit.native.prevent>
+				<el-divider content-position="left"><i class="el-icon-document"></i>
+					上传附件
+				</el-divider>
+				<el-row :gutter="15">
+					<el-col :span="24">
+						<el-form-item label="收藏分类" prop="classification">
+							<el-select v-model="inputForm.classification" clearable filterable @blur="selectMethod">
+								<el-option v-for="(item, index) in dictList" :key="index" :label="item.label"
+									:value="item.value" />
+							</el-select>
+						</el-form-item>
+					</el-col>
+
+					<el-col :span="24">
+						<el-form-item label="文件描述" prop="fileDescription">
+							<el-input maxlength="500" type="textarea" placeholder="请填写文件描述"
+								v-model="inputForm.fileDescription" show-word-limit></el-input>
+						</el-form-item>
+					</el-col>
+
+
+					<el-col :span="24">
+						<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+					</el-col>
+				</el-row>
+
+
+			</el-form>
+			<template #footer>
+				<span class="dialog-footer">
+					<el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
+					<el-button type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check"
+						v-noMoreClick>确定</el-button>
+				</span>
+			</template>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+import workCollectAccessoryService from "@/api/workCollectAccessory/index"
+import UpLoadComponent from '@/views/common/UpLoadComponentWorkCollect'
+import { ElDatePicker } from 'element-plus';
+// eslint-disable-next-line no-unused-vars
+import OSSSerivce from '@/api/sys/OSSService'
+import moment from 'moment'
+export default {
+	props: {
+		formReadOnly: {
+			type: Boolean,
+			default: false
+		},
+		status: {
+			type: String,
+			default: ''
+		}
+	},
+	data() {
+		return {
+			title: '',
+			method: '',
+			loading: false,
+			visible: false,
+			inputForm: {
+				classification: "",
+				fileDescription: "",
+				workAttachments: []
+			},
+			baseKey: '',
+			keyWatch: '',
+			dateList: [],
+			dictList: [],
+			ossService: null
+		}
+	},
+	created() {
+		this.ossService = new OSSSerivce()
+
+	},
+	mounted() {
+	},
+	activated() {
+	},
+	components: {
+		ElDatePicker,
+		UpLoadComponent
+	},
+	methods: {
+		selectMethod(e) {
+			if (e.target.value !== '') {
+				this.inputForm.classification = e.target.value;
+				this.$forceUpdate(); // 强制更新 
+			}
+		},
+		init(method, id) {
+			this.method = method
+			this.visible = true
+			this.inputForm = {
+				classification: "",
+				fileDescription: "",
+				workAttachments: []
+			}
+			if (method === 'add') {
+				this.title = `上传附件`
+			} else if (method === 'edit') {
+				this.inputForm.id = id
+				this.title = '修改附件'
+			}
+			this.loading = false
+			this.visible = true
+			this.$nextTick(() => {
+				this.$refs.inputForm.resetFields()
+				this.loading = true
+				this.loading = false
+				if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					workCollectAccessoryService.queryById(this.inputForm.id).then((res) => {
+						this.ossService.getFileSizeByUrl(res.url).then((data) => {
+							let file = {
+								lsUrl: data.url,
+								size: data.size,
+								createBy: {
+									id: this.$store.state.user.id,
+									name: this.$store.state.user.name,
+								},
+								createTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
+								name: res.fileName,
+								url: res.url
+							}
+							this.inputForm.workAttachments.push(file)
+							this.inputForm.classification = res.classification
+							this.inputForm.fileDescription = res.fileDescription
+							console.log(this.inputForm.workAttachments);
+
+							this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachments, 'workCollect')
+
+						})
+					})
+				}
+			})
+		},
+		// 表单提交
+		async doSubmit() {
+			let files = this.$refs.uploadComponent.getDataList()
+			console.log(files);
+			if (files.length <= 0) {
+				this.loading = false
+				this.$message.error(`请上传附件后提交`);
+				return
+			}
+			if (this.$refs.uploadComponent.checkProgress()) {
+				this.loading = false
+				this.$message.error(`待附件上传完毕后提交`);
+				return
+			}
+			this.loading = true
+			this.$refs['inputForm'].validate((valid) => {
+				if (valid) {
+					this.inputForm.workAttachments = this.$refs.uploadComponent.getDataList()
+					this.loading = true
+					if (this.inputForm.id) {
+						workCollectAccessoryService.updateById(this.inputForm).then((data) => {
+							this.visible = false
+							this.$emit('refreshList')
+						}).catch(() => {
+							this.$refs.inputForm.resetFields()
+							this.loading = false
+						})
+					} else {
+						workCollectAccessoryService.saveForm(this.inputForm).then((data) => {
+							this.visible = false
+							this.$emit('refreshList')
+						}).catch(() => {
+							this.$refs.inputForm.resetFields()
+							this.loading = false
+						})
+					}
+				} else {
+					this.loading = false
+				}
+			})
+		},
+		close() {
+			this.inputForm = {
+				id: '',
+			}
+			this.visible = false
+			this.$refs.uploadComponent.clearUpload()
+		},
+		async updateStatusById(type, callback) {
+			this.loading = true
+			workCollectAccessoryService.updateStatusById(param).then(() => {
+				this.loading = false
+				callback()
+			})
+		},
+	}
+
+}
+</script>
+<style scoped>
+/deep/ .el-input-number .el-input__inner {
+	text-align: left;
+}
+
+/deep/ .vxe-footer--row .vxe-footer--column:nth-child(1) .vxe-cell--item {
+	font-weight: 700;
+}
+</style>

+ 348 - 0
src/views/attachment/List.vue

@@ -0,0 +1,348 @@
+<template>
+    <div class="page">
+        <el-form :inline="true" class="query-form m-b-10" v-if="searchVisible" ref="searchForm" :model="searchForm"
+            @keyup.enter="refreshList()" @submit.prevent>
+            <!-- 搜索框-->
+            <el-form-item prop="fileName" label="附件名称">
+                <el-input style="width: 200px;" v-model="searchForm.fileName" placeholder="请输入附件名称"
+                    clearable></el-input>
+            </el-form-item>
+            <el-form-item prop="userName" label="上传人">
+                <el-input style="width: 200px;" v-model="searchForm.userName" placeholder="请输入上传人" clearable></el-input>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" @click="refreshList()" icon="search">查询</el-button>
+                <el-button type="default" @click="resetSearch()" icon="refresh-right">重置</el-button>
+            </el-form-item>
+        </el-form>
+
+        <div class="jp-table">
+            <vxe-toolbar ref="dataSetToolbar" :refresh="{ query: refreshList }" export print custom>
+                <template #buttons>
+                    <el-button v-if="hasPermission('database:datamodel:dataSet:add')" type="primary" icon="plus"
+                        @click="add()">上传附件</el-button>
+                </template>
+                <template #tools>
+                    <vxe-button type="text" :title="searchVisible ? '收起检索' : '展开检索'" icon="vxe-icon-search"
+                        class="tool-btn" @click="searchVisible = !searchVisible"></vxe-button>
+                </template>
+            </vxe-toolbar>
+            <el-tabs v-model="activeName" @tab-click="handleClick">
+                <el-tab-pane label="个人附件表" :name="0"></el-tab-pane>
+                <el-tab-pane label="部门附件表" :name="1"></el-tab-pane>
+                <el-tab-pane label="公司附件表" :name="2"></el-tab-pane>
+            </el-tabs>
+            <div class="jp-table-body">
+                <vxe-table border="inner" auto-resize resizable height="auto" :loading="loading" size="small"
+                    ref="dataSetTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
+                    :print-config="{}" :import-config="{}" :export-config="{}" @sort-change="sortChangeHandle"
+                    :sort-config="{ remote: true }" :data="dataList" :checkbox-config="{}">
+                    <vxe-column type="seq" width="40"></vxe-column>
+                    <vxe-column field="fileName" sortable title="附件名称">
+                    </vxe-column>
+                    <vxe-column field="classification" sortable title="收藏分类">
+                    </vxe-column>
+                    <vxe-column field="fileDescription" sortable title="文件描述">
+                    </vxe-column>
+                    <vxe-column field="userName" sortable title="上传人">
+                    </vxe-column>
+                    <vxe-column v-if="activeName == '0'" field="collectUserName" sortable title="收藏人">
+                    </vxe-column>
+                    <vxe-column field="createTime" sortable title="上传/收藏时间">
+                    </vxe-column>
+                    <vxe-column fixed="right" align="center" width="320" title="操作">
+                        <template #default="scope">
+                            <el-button v-if="
+                                activeName == '0' && scope.row.createById == userInfo.id
+                            " type="success" text @click="edit(scope.row.id)">编辑</el-button>
+                            <el-button v-if="activeName == '0' && !scope.row.officeId && scope.row.collectType != 1"
+                                type="primary" text @click="share(scope.row.id, '1')">部门共享</el-button>
+                            <el-button v-if="activeName == '0' && scope.row.officeId && scope.row.collectType != 1"
+                                type="primary" text @click="cancelShare(scope.row.id, '1')">取消部门共享</el-button>
+                            <el-button v-if="activeName == '0' && !scope.row.companyId && scope.row.collectType != 1"
+                                type="primary" text @click="share(scope.row.id, '2')">公司共享</el-button>
+                            <el-button v-if="activeName == '0' && scope.row.companyId && scope.row.collectType != 1"
+                                type="primary" text @click="cancelShare(scope.row.id, '2')">取消公司共享</el-button>
+                            <el-button v-if="activeName == '0'" type="danger" text
+                                @click="del(scope.row.id)">删除</el-button>
+                            <el-button v-if="handleIsCollect(scope.row)" type="success" text
+                                @click="handleCollection(scope.row)">收藏</el-button>
+                        </template>
+                    </vxe-column>
+                </vxe-table>
+                <vxe-pager background size="small" :current-page="tablePage.currentPage" :page-size="tablePage.pageSize"
+                    :total="tablePage.total" :page-sizes="[
+                        10,
+                        20,
+                        100,
+                        1000,
+                        { label: '全量数据', value: 1000000 },
+                    ]" :layouts="[
+                        'PrevPage',
+                        'JumpNumber',
+                        'NextPage',
+                        'FullJump',
+                        'Sizes',
+                        'Total',
+                    ]" @page-change="currentChangeHandle">
+                </vxe-pager>
+            </div>
+        </div>
+        <v-dialog title="数据接口" :close-on-click-modal="false" v-model="dialogInterfaceVisible">
+            <el-table :data="interfaceTable">
+                <el-table-column property="type" width="120px" title="接口格式"></el-table-column>
+                <el-table-column property="url" title="接口地址"></el-table-column>
+                <el-table-column width="40px">
+                    <template #default="scope">
+                        <el-button text icon="copy-document" v-copy="scope.row.url"
+                            style="padding-left: 10px"></el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <el-alert type="success" title="接口传递参数说明:/接口url?参数名=参数值, 如果不传递参数,则使用默认值"
+                style="margin-top: 20px"></el-alert>
+        </v-dialog>
+        <workCollectAccessoryForm @refreshList="refreshList" ref="workCollectAccessoryRef"></workCollectAccessoryForm>
+    </div>
+</template>
+
+<script>
+import workCollectAccessoryService from "@/api/workCollectAccessory/index"
+import workCollectAccessoryForm from './Form.vue'
+import dictService from "@/api/sys/dictService"
+export default {
+    components: {
+        workCollectAccessoryForm
+    },
+    data() {
+        return {
+            activeName: 0,
+            searchVisible: true,
+            searchForm: {
+                companyId: '',
+                officeId: '',
+                createById: '',
+            },
+            dataList: [],
+            dataListBak: [],
+            tablePage: {
+                total: 0,
+                currentPage: 1,
+                pageSize: 10,
+                orders: [],
+            },
+            isImportCollapse: false,
+            dialogInterfaceVisible: false,
+            interfaceTable: [],
+            loading: false,
+            userInfo: {}
+        };
+    },
+    activated() {
+        this.userInfo = this.$TOOL.data.get("USER_INFO");
+        this.searchForm.createById = this.userInfo.id
+        this.$nextTick(() => {
+            // 将表格和工具栏进行关联
+            const $table = this.$refs.dataSetTable;
+            const $toolbar = this.$refs.dataSetToolbar;
+            $table.connect($toolbar);
+        });
+        this.refreshList();
+    },
+    methods: {
+        //获取字典值
+        handleGetDict() {
+            dictService.getDictListMapByDict("classification").then((data) => {
+                this.$refs.workCollectAccessoryRef.dictList = data
+            });
+        },
+        // 判断用户是否已经收藏此文件
+        handleIsCollect(row) {
+            if (this.activeName != '0' && row.createById != this.userInfo.id) {
+                const index = this.dataListBak.findIndex(item => {
+                    return item.url == row.url
+                })
+                if (index == -1) {
+                    return true
+                } else {
+                    return false
+                }
+            }
+            return false
+        },
+        // 取消共享
+        cancelShare(id, type) {
+            this.$confirm(`确定取消共享此文件吗?`, "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.loading = true;
+                workCollectAccessoryService
+                    .share({
+                        attachmentId: id,
+                        companyId: "",
+                        shareType: type
+                    }).then(res => {
+                        this.$message.success(res);
+                        this.loading = false;
+                        this.refreshList();
+                    })
+            });
+        },
+        // 共享附件
+        share(id, type) {
+            let companyId = ""
+            if (type == 1) {
+                companyId = this.userInfo.officeDTO.id
+            } else {
+                companyId = this.userInfo.companyDTO.id
+            }
+            this.$confirm(`确定共享此文件吗?`, "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.loading = true;
+                workCollectAccessoryService
+                    .share({
+                        attachmentId: id,
+                        companyId: companyId,
+                        shareType: type
+                    }).then(res => {
+                        this.$message.success(res);
+                        this.loading = false;
+                        this.refreshList();
+                    })
+            });
+
+        },
+        handleCollection(row) {
+            this.loading = true;
+            workCollectAccessoryService
+                .collection({
+                    attachmentId: row.id
+                }).then(res => {
+                    this.$message.success(res);
+                    this.loading = false;
+                    // this.refreshList();
+
+                    workCollectAccessoryService
+                        .list({
+                            current: this.tablePage.currentPage,
+                            size: this.tablePage.pageSize,
+                            orders: this.tablePage.orders,
+                            createById: this.userInfo.id
+                        })
+                        .then((data) => {
+                            this.dataListBak = [...data.records]
+                        });
+                })
+        },
+        // tab切换
+        handleClick(tab, event) {
+            let index = tab.index
+            this.searchForm = {
+                companyId: '',
+                officeId: '',
+                createById: '',
+            }
+
+            if (index == 0) {
+                this.searchForm.createById = this.userInfo.id
+            }
+            if (index == 1) {
+                this.searchForm.officeId = this.userInfo.officeDTO.id
+            }
+            if (index == 2) {
+                this.searchForm.companyId = this.userInfo.companyDTO.id
+            }
+            this.refreshList();
+        },
+        // 获取数据列表
+        refreshList() {
+            this.loading = true;
+            workCollectAccessoryService
+                .list({
+                    current: this.tablePage.currentPage,
+                    size: this.tablePage.pageSize,
+                    orders: this.tablePage.orders,
+                    ...this.searchForm,
+                })
+                .then((data) => {
+                    if (this.searchForm.createById) {
+                        this.dataListBak = [...data.records]
+                    }
+                    this.dataList = data.records;
+                    this.tablePage.total = data.total;
+                    this.loading = false;
+                });
+        },
+        // 当前页
+        currentChangeHandle({ currentPage, pageSize }) {
+            this.tablePage.currentPage = currentPage;
+            this.tablePage.pageSize = pageSize;
+            this.refreshList();
+        },
+        // 排序
+        sortChangeHandle(column) {
+            this.tablePage.orders = [];
+            if (column.order != null) {
+                this.tablePage.orders.push({
+                    column: this.$utils.toLine(column.property),
+                    asc: column.order === "asc",
+                });
+            }
+            this.refreshList();
+        },
+        // 新增
+        add() {
+            this.$refs.workCollectAccessoryRef.init("add")
+            this.handleGetDict()
+        },
+        // 编辑
+        edit(id) {
+            console.log(id);
+            this.$refs.workCollectAccessoryRef.init("edit", id)
+            this.handleGetDict()
+        },
+        // 查看
+        view(id) {
+            id =
+                id ||
+                this.$refs.dataSetTable.getCheckboxRecords().map((item) => {
+                    return item.id;
+                })[0];
+            this.$router.push({
+                path: `/database/datamodel/DataSetForm`,
+                query: { method: "view", id: id, title: "数据模型配置" },
+            });
+        },
+        // 删除
+        del(id) {
+            this.$confirm(`确定删除所选项吗?`, "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.loading = true;
+                workCollectAccessoryService
+                    .del({
+                        attachmentId: id
+                    }).then(res => {
+                        this.$message.success(res);
+                        this.loading = false;
+                        this.refreshList();
+                    })
+
+
+            });
+        },
+
+        resetSearch() {
+            this.$refs.searchForm.resetFields();
+            this.refreshList();
+        },
+    },
+};
+</script>

+ 253 - 0
src/views/common/AttachmentLib.vue

@@ -0,0 +1,253 @@
+<!--文件上传组件-->
+<template>
+  <div style="display: inline-block;">
+    <el-button style="margin-top: -4px;margin-left: 5px;" type="primary" size="default" @click="handleOpen"> 从资料库中选择
+    </el-button>
+
+    <el-dialog append-to-body title="个人资料库" @open="handleOpenDialog" :close-on-click-modal="false" draggable
+      width="900px" @close="close" @keyup.enter.native="" v-model="visible">
+      <el-form :inline="true" class="query-form m-b-10" ref="searchForm" :model="searchForm"
+        @keyup.enter="refreshList()" @submit.prevent>
+        <!-- 搜索框-->
+        <el-form-item prop="fileName" label="附件名称">
+          <el-input style="width: 200px;" v-model="searchForm.fileName" placeholder="请输入附件名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button :loading="loading" type="primary" @click="refreshList()" icon="search">查询</el-button>
+          <el-button :loading="loading" type="default" @click="resetSearch()" icon="refresh-right">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <div class="jp-table">
+        <div class="jp-table-body">
+          <vxe-table border="inner" auto-resize resizable :loading="loading" size="small" ref="dataSetTable"
+            show-header-overflow show-overflow highlight-hover-row :menu-config="{}" :print-config="{}"
+            :import-config="{}" :export-config="{}" @sort-change="sortChangeHandle" :sort-config="{ remote: true }"
+            :data="dataList" :checkbox-config="{}" @checkbox-all="selectAllChangeEvent"
+            @checkbox-change="selectChangeEvent">
+            <vxe-column type="checkbox" width="60"></vxe-column>
+            <vxe-column type="seq" width="40"></vxe-column>
+
+            <vxe-column field="fileName" sortable title="附件名称">
+              <template #default="scope">
+                <div>
+                  <el-link type="primary" :underline="false" @click="showFile(scope.row)">{{ scope.row.fileName
+                    }}</el-link>
+                </div>
+              </template>
+            </vxe-column>
+            <vxe-column field="classification" sortable title="收藏分类">
+            </vxe-column>
+            <vxe-column field="fileDescription" sortable title="文件描述">
+            </vxe-column>
+            <vxe-column field="userName" sortable title="上传人">
+            </vxe-column>
+            <vxe-column field="collectUserId" sortable title="收藏人">
+            </vxe-column>
+            <vxe-column field="createTime" sortable title="上传/收藏时间">
+            </vxe-column>
+          </vxe-table>
+          <vxe-pager background size="small" :current-page="tablePage.currentPage" :page-size="tablePage.pageSize"
+            :total="tablePage.total" :page-sizes="[
+              10,
+              20,
+              100,
+              1000,
+              { label: '全量数据', value: 1000000 },
+            ]" :layouts="[
+              'PrevPage',
+              'JumpNumber',
+              'NextPage',
+              'FullJump',
+              'Sizes',
+              'Total',
+            ]" @page-change="currentChangeHandle">
+          </vxe-pager>
+        </div>
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
+          <el-button type="primary" :loading="loading" v-if="method != 'view'" @click="doSubmit()"
+            icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+        </span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import OSSSerivce, {
+  openWindowOnUrl,
+} from '@/api/sys/OSSService'
+import workCollectAccessoryService from "@/api/workCollectAccessory/index"
+export default {
+  props: {
+    directory: {
+      required: true, // 表示该属性是必传的
+      type: String    // 数据类型为字符串
+    },
+    formatList: {
+      type: Array,     // 数据类型为数组
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      ossService: null,
+      visible: false,
+      inputForm: {
+
+      },
+      searchForm: {
+        createById: '',
+      },
+      dataList: [],
+      tablePage: {
+        total: 0,
+        currentPage: 1,
+        pageSize: 10,
+        orders: [],
+      },
+      loading: false,
+      userInfo: {},
+      selectRow: null,
+      selectList: []
+    }
+  },
+  watch: {
+  },
+  created() {
+    this.ossService = new OSSSerivce()
+
+  },
+  components: {
+  },
+  mounted() {
+  },
+  methods: {
+    showFile(row) {
+      let obj = {
+        name: row.fileName,
+        url: row.url
+      }
+      openWindowOnUrl(obj)
+    },
+    hasDuplicateName(arr) {
+      const names = new Set();
+      for (const obj of arr) {
+        if (names.has(obj.fileName)) {
+          return true; // 有重复的 name
+        }
+        names.add(obj.fileName);
+      }
+      return false; // 没有重复的 name
+    },
+    doSubmit() {
+      let flag = this.hasDuplicateName(this.selectList)
+      if (flag) {
+        this.$message.error(`请勿选择相同名称文件进行上传`);
+        return
+      }
+      console.log(this.selectList);
+      if (this.selectList.length == 0) {
+        this.$message.error(`请选择文件后上传`);
+        return
+      }
+      this.selectList.forEach(selectRow => {
+        let fileName = selectRow.fileName;
+        let fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(); // 获取后缀并转小写
+        if (this.formatList.length && !this.formatList.includes(fileType)) {
+          this.$message.error(`只能上传 ${this.formatList.join(", ")} 格式的文件`);
+          return;
+        }
+        this.ossService.getTemporaryUrl(selectRow.url).then((data) => {
+          workCollectAccessoryService
+            .downloadAndUploadToOSS({
+              url: data,
+              fileName: selectRow.fileName,
+              dir: this.directory
+            }).then(res => {
+              this.$emit("onDownToOss", selectRow, res)
+              this.visible = false
+            })
+        })
+      })
+
+    },
+    resetSearch() {
+      this.$refs.searchForm.resetFields();
+      this.refreshList();
+    },
+    selectAllChangeEvent({ checked }) {
+      if (this.$refs.dataSetTable) {
+        const records = this.$refs.dataSetTable.getCheckboxRecords()
+        console.log(records);
+        this.selectList = [...records]
+
+      }
+    },
+    selectChangeEvent({ checked }) {
+      if (this.$refs.dataSetTable) {
+        const records = this.$refs.dataSetTable.getCheckboxRecords()
+        console.log(records);
+        this.selectList = [...records]
+      }
+    },
+    radioChangeEvent({ row }) {
+      this.selectRow = row
+    },
+    clearRadioRowEevnt() {
+      if (this.$refs.dataSetTable) {
+        this.selectRow = null
+        this.$refs.dataSetTable.clearRadioRow()
+      }
+    },
+    handleOpen() {
+      this.visible = true
+    },
+    handleOpenDialog() {
+      this.userInfo = this.$TOOL.data.get("USER_INFO");
+      this.searchForm.createById = this.userInfo.id
+      this.refreshList();
+    },
+    close() {
+      this.clearRadioRowEevnt()
+      this.visible = false
+    },
+    // 当前页
+    currentChangeHandle({ currentPage, pageSize }) {
+      this.tablePage.currentPage = currentPage;
+      this.tablePage.pageSize = pageSize;
+      this.refreshList();
+    },
+    // 获取数据列表
+    refreshList() {
+      this.loading = true;
+      workCollectAccessoryService
+        .list({
+          current: this.tablePage.currentPage,
+          size: this.tablePage.pageSize,
+          orders: this.tablePage.orders,
+          ...this.searchForm,
+        })
+        .then((data) => {
+          this.dataList = data.records;
+          this.tablePage.total = data.total;
+          this.loading = false;
+        });
+    },
+    // 排序
+    sortChangeHandle(column) {
+      this.tablePage.orders = [];
+      if (column.order != null) {
+        this.tablePage.orders.push({
+          column: this.$utils.toLine(column.property),
+          asc: column.order === "asc",
+        });
+      }
+      this.refreshList();
+    },
+  }
+}
+</script>
+<style></style>

Diferenças do arquivo suprimidas por serem muito extensas
+ 565 - 549
src/views/common/InvoiceReimbursementUpLoadComponent.vue


+ 38 - 0
src/views/common/UpLoadComponent.vue

@@ -13,7 +13,10 @@
       <template v-else #trigger>
         <el-button :loading="loading" type="primary" size="default"> 点击上传 </el-button>
       </template>
+      <AttachmentLib :directory="directory" @onDownToOss="handleOnDownToOss"></AttachmentLib>
+
     </el-upload>
+
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
       <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
@@ -69,6 +72,7 @@ import OSSSerivce, {
 } from '@/api/sys/OSSService'
 // import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
 import moment from 'moment'
+import AttachmentLib from './AttachmentLib.vue'
 export default {
   data() {
     return {
@@ -101,6 +105,7 @@ export default {
     this.ossService = new OSSSerivce()
   },
   components: {
+    AttachmentLib
     // ElImageViewer
   },
   mounted() {
@@ -152,6 +157,7 @@ export default {
      *    showDivider=false时 ‘附件‘Divider隐藏
      */
     async newUpload(auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider) {
+
       await this.fileLoadingFalse()
       if (this.commonJS.isEmpty(fileList)) {
         this.fileLoading = true
@@ -200,6 +206,7 @@ export default {
           this.dataList.push(item)
           this.dataListNew.push(item)
           this.fileList.push(item)
+          console.log(item);
           if (this.dataListNew.length === fileList.length) {
             this.fileLoading = true
           }
@@ -220,6 +227,36 @@ export default {
     async httpRequest(file) {
       await httpRequest(file, fileName(file), this.directory, this.maxValue)
     },
+    handleOnDownToOss(row, url) {
+      let flag = false
+      this.fileList.forEach(item => {
+        if (row.fileName == item.name) {
+          flag = true
+        }
+      })
+      if (flag) {
+        this.$message.error(`${row.fileName}已存在,无法重复上传`);
+        return
+      }
+      this.ossService.getFileSizeByUrl(url).then((data) => {
+        let file = {
+          lsUrl: data.url,
+          size: data.size,
+          createBy: {
+            id: this.$store.state.user.id,
+            name: this.$store.state.user.name,
+          },
+          createTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
+          name: row.fileName,
+          percentage: 100,
+          status: "success",
+          url: url
+        }
+        this.dataList.push(file)
+        this.dataListNew.push(file)
+        this.fileList.push(file)
+      })
+    },
     uploadVideoProcess(event, file, fileList) {
       this.progressFlag = true // 显示进度条
       this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
@@ -315,6 +352,7 @@ export default {
           }
         }
       }
+
     },
     showFile(row) {
       console.log('row', row)

+ 25 - 1
src/views/common/UpLoadComponentCcpm.vue

@@ -8,11 +8,13 @@
         $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
       }" :show-file-list="false" :on-change="changes" :on-progress="uploadVideoProcess" :file-list="fileList">
       <template v-if="auth === 'view' && uploadFlag === false" #tip>
-        <el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
+        <el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传</el-button>
       </template>
       <template v-else #trigger>
         <el-button :loading="loading" type="primary" size="default"> 点击上传 </el-button>
       </template>
+      <AttachmentLib :directory="directory" @onDownToOss="handleOnDownToOss"></AttachmentLib>
+
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -68,6 +70,7 @@ import OSSSerivce, {
   toHref
 } from '@/api/sys/OSSService'
 // import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
+import AttachmentLib from './AttachmentLib.vue'
 import moment from 'moment'
 export default {
   data() {
@@ -100,6 +103,7 @@ export default {
     this.ossService = new OSSSerivce()
   },
   components: {
+    AttachmentLib
     // ElImageViewer
   },
   mounted() {
@@ -230,6 +234,26 @@ export default {
         }, 1000) // 一秒后关闭进度条
       }
     },
+    handleOnDownToOss(row, url) {
+      this.ossService.getFileSizeByUrl(url).then((data) => {
+        let file = {
+          lsUrl: data.url,
+          size: data.size,
+          createBy: {
+            id: this.$store.state.user.id,
+            name: this.$store.state.user.name,
+          },
+          createTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
+          name: row.fileName,
+          percentage: 100,
+          status: "success",
+          url: url
+        }
+        this.dataList.push(file)
+        this.dataListNew.push(file)
+        this.fileList.push(file)
+      })
+    },
     getSize(value) {
       if (this.commonJS.isEmpty(value)) {
         return '0 B'

+ 24 - 0
src/views/common/UpLoadComponentV2.1.vue

@@ -13,6 +13,8 @@
       <template v-else #trigger>
         <el-button :loading="loading" type="primary" size="default"> 点击上传 </el-button>
       </template>
+      <AttachmentLib :directory="directory" @onDownToOss="handleOnDownToOss"></AttachmentLib>
+
     </el-upload>
     <el-button v-if="showSign" :loading="loading" type="info" style="float: right;" @click="clickSign">签章</el-button>
     <div style="height: calc(100% - 80px);margin-top: 10px">
@@ -112,6 +114,7 @@ import OSSSerivce, {
   toHref
 } from '@/api/sys/OSSService'
 // import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
+import AttachmentLib from './AttachmentLib.vue'
 import moment from 'moment'
 export default {
   data() {
@@ -149,6 +152,7 @@ export default {
     this.ossService = new OSSSerivce()
   },
   components: {
+    AttachmentLib,
     // ElImageViewer,
     fileTypeComponentA: {
       render: function (h) {
@@ -520,6 +524,26 @@ export default {
         }
       }
     },
+    handleOnDownToOss(row, url) {
+      this.ossService.getFileSizeByUrl(url).then((data) => {
+        let file = {
+          lsUrl: data.url,
+          size: data.size,
+          createBy: {
+            id: this.$store.state.user.id,
+            name: this.$store.state.user.name,
+          },
+          createTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
+          name: row.fileName,
+          percentage: 100,
+          status: "success",
+          url: url
+        }
+        this.dataList.push(file)
+        this.dataListNew.push(file)
+        this.fileList.push(file)
+      })
+    },
     showFile(row) {
       openWindowOnUrl(row)
     },

+ 24 - 0
src/views/common/UpLoadComponentV2.vue

@@ -13,6 +13,8 @@
       <template v-else #trigger>
         <el-button :loading="loading" type="primary" size="default"> 点击上传 </el-button>
       </template>
+      <AttachmentLib :directory="directory" @onDownToOss="handleOnDownToOss"></AttachmentLib>
+
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -93,6 +95,7 @@ import OSSSerivce, {
 } from '@/api/sys/OSSService'
 // import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
 import moment from 'moment'
+import AttachmentLib from './AttachmentLib.vue'
 export default {
   data() {
     return {
@@ -126,6 +129,7 @@ export default {
     this.ossService = new OSSSerivce()
   },
   components: {
+    AttachmentLib,
     // ElImageViewer,
     fileTypeComponentA: {
       render: function (h) {
@@ -480,6 +484,26 @@ export default {
         }
       }
     },
+    handleOnDownToOss(row, url) {
+      this.ossService.getFileSizeByUrl(url).then((data) => {
+        let file = {
+          lsUrl: data.url,
+          size: data.size,
+          createBy: {
+            id: this.$store.state.user.id,
+            name: this.$store.state.user.name,
+          },
+          createTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
+          name: row.fileName,
+          percentage: 100,
+          status: "success",
+          url: url
+        }
+        this.dataList.push(file)
+        this.dataListNew.push(file)
+        this.fileList.push(file)
+      })
+    },
     showFile(row) {
       openWindowOnUrl(row)
     },

+ 24 - 0
src/views/common/UpLoadComponentV3.1.vue

@@ -13,6 +13,8 @@
       <template v-else #trigger>
         <el-button :loading="loading" type="primary" size="default"> 点击上传 </el-button>
       </template>
+      <AttachmentLib :directory="directory" @onDownToOss="handleOnDownToOss"></AttachmentLib>
+
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -95,6 +97,7 @@ import OSSSerivce, {
 } from '@/api/sys/OSSService'
 // import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
 import moment from 'moment'
+import AttachmentLib from './AttachmentLib.vue'
 export default {
   data() {
     return {
@@ -128,6 +131,7 @@ export default {
     this.ossService = new OSSSerivce()
   },
   components: {
+    AttachmentLib,
     // ElImageViewer,
     fileTypeComponentA: {
       render: function (h) {
@@ -345,6 +349,26 @@ export default {
         }, 1000) // 一秒后关闭进度条
       }
     },
+    handleOnDownToOss(row, url) {
+      this.ossService.getFileSizeByUrl(url).then((data) => {
+        let file = {
+          lsUrl: data.url,
+          size: data.size,
+          createBy: {
+            id: this.$store.state.user.id,
+            name: this.$store.state.user.name,
+          },
+          createTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
+          name: row.fileName,
+          percentage: 100,
+          status: "success",
+          url: url
+        }
+        this.dataList.push(file)
+        this.dataListNew.push(file)
+        this.fileList.push(file)
+      })
+    },
     getSize(value) {
       if (this.commonJS.isEmpty(value)) {
         return '0 B'

+ 24 - 0
src/views/common/UpLoadComponentV3.vue

@@ -13,6 +13,8 @@
       <template v-else #trigger>
         <el-button :loading="loading" type="primary" size="default"> 点击上传 </el-button>
       </template>
+      <AttachmentLib :directory="directory" @onDownToOss="handleOnDownToOss"></AttachmentLib>
+
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -86,6 +88,7 @@ import OSSSerivce, {
 } from '@/api/sys/OSSService'
 // import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
 import moment from 'moment'
+import AttachmentLib from './AttachmentLib.vue'
 export default {
   data() {
     return {
@@ -118,6 +121,7 @@ export default {
     this.ossService = new OSSSerivce()
   },
   components: {
+    AttachmentLib,
     // ElImageViewer,
     fileTypeComponentA: {
       render: function (h) {
@@ -335,6 +339,26 @@ export default {
         }, 1000) // 一秒后关闭进度条
       }
     },
+    handleOnDownToOss(row, url) {
+      this.ossService.getFileSizeByUrl(url).then((data) => {
+        let file = {
+          lsUrl: data.url,
+          size: data.size,
+          createBy: {
+            id: this.$store.state.user.id,
+            name: this.$store.state.user.name,
+          },
+          createTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
+          name: row.fileName,
+          percentage: 100,
+          status: "success",
+          url: url
+        }
+        this.dataList.push(file)
+        this.dataListNew.push(file)
+        this.fileList.push(file)
+      })
+    },
     getSize(value) {
       if (this.commonJS.isEmpty(value)) {
         return '0 B'

+ 418 - 0
src/views/common/UpLoadComponentWorkCollect.vue

@@ -0,0 +1,418 @@
+<!--文件上传组件-->
+<template>
+  <div :key="uploadKey">
+    <el-divider v-if="showDivider" content-position="left"><i class="el-icon-document"></i> {{ dividerName
+      }}</el-divider>
+    <el-upload ref="upload" style="display: inline-block;" :show-header="'status'" action="" :limit="1"
+      :http-request="httpRequest" :on-exceed="(files, fileList) => {
+        $message.warning(`一次仅限上传1份文件`)
+      }" :show-file-list="false" :on-change="changes" :on-progress="uploadVideoProcess" :file-list="fileList">
+      <template v-if="auth === 'view' && uploadFlag === false" #tip>
+        <el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
+      </template>
+      <template v-else #trigger>
+        <el-button :loading="loading" type="primary" size="default"> 点击上传 </el-button>
+        <span style="margin-left: 20px;color: red;">提示:一次仅限上传1份文件</span>
+      </template>
+
+    </el-upload>
+    <div style="height: calc(100% - 80px);margin-top: 10px">
+      <!-- 进度条 -->
+      <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
+      <el-table ref="uploadTable" v-loading="loading" :key="tableKey" :data="dataListNew">
+        <el-table-column type="seq" width="40"></el-table-column>
+        <el-table-column label="文件名称" prop="name" align="center">
+          <template #default="scope">
+            <div v-if="ifName(scope.row) === true">
+              <el-image style="width: 30px; height: 30px;padding-top: 4px;" :src="scope.row.lsUrl"
+                :preview-src-list="[scope.row.lsUrl]" :preview-teleported="true"></el-image>
+            </div>
+            <div v-else>
+              <el-link type="primary" :underline="false" @click="showFile(scope.row)">{{ scope.row.name }}</el-link>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="创建人" prop="createBy.name" align="center"></el-table-column>
+        <el-table-column label="创建时间" prop="createTime" align="center"></el-table-column>
+        <el-table-column label="文件大小" prop="size" align="center">
+          <template #default="scope">
+            {{ getSize(scope.row.size) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="200px" fixed="right" align="center">
+          <template #default="scope">
+            <el-button text type="primary" key="01" icon="el-icon-download" size="small"
+              @click="toHref(scope.row)">下载</el-button>
+            <el-button text type="primary" key="02" icon="el-icon-delete" size="small"
+              @click="deleteById(scope.row, scope.$index, fileList)"
+              :disabled="auth === 'view' && delFlag === false && createBy !== scope.row.createBy.name">删除</el-button>
+            <!--            <el-button v-if="createBy===scope.row.createBy.name" type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false">删除2</el-button>-->
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <!--    <el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="[url]" :zIndex=9999></el-image-viewer>-->
+  </div>
+</template>
+
+<script>
+// eslint-disable-next-line no-unused-vars
+import OSSSerivce, {
+  httpRequest,
+  // eslint-disable-next-line no-unused-vars
+  handleRemove,
+  fileName,
+  // eslint-disable-next-line no-unused-vars
+  beforeAvatarUpload,
+  // eslint-disable-next-line no-unused-vars
+  openWindowOnUrl,
+  // eslint-disable-next-line no-unused-vars
+  toHref
+} from '@/api/sys/OSSService'
+// import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
+import moment from 'moment'
+export default {
+  data() {
+    return {
+      uploadKey: '',
+      progressFlag: false,
+      loadProgress: 0,
+      fileList: [],
+      dataList: [],
+      dataListNew: [],
+      url: '',
+      showViewer: false,
+      ossService: null,
+      auth: '',
+      directory: 'public',
+      maxValue: 300,
+      tableKey: '',
+      fileLoading: true,
+      dividerName: '',
+      uploadFlag: false,
+      delFlag: false,
+      createBy: '',
+      showDivider: true,
+      loading: false,
+      dataListLength: ''
+    }
+  },
+  watch: {
+  },
+  created() {
+    this.ossService = new OSSSerivce()
+  },
+  components: {
+    // ElImageViewer
+  },
+  mounted() {
+    window.onPreview = this.onPreview
+  },
+  methods: {
+    /**
+     * dividerName: 组件中divider的名称赋值
+     * showDivider: ‘附件‘Divider是否展示
+     *     注:值为空时,默认值为true
+     *    showDivider=false时 ‘附件‘Divider隐藏
+     **/
+    setDividerName(dividerName, showDivider) {
+      if (this.commonJS.isNotEmpty(dividerName)) {
+        this.dividerName = dividerName
+      }
+      if (this.commonJS.isNotEmpty(showDivider)) {
+        if (showDivider === false) {
+          this.showDivider = false
+        } else {
+          this.showDivider = true
+        }
+      } else {
+        this.showDivider = true
+      }
+    },
+    /**
+     * 文件上传组件初始化
+     * @param auth
+     *    auth的值为"view"时,不可上传/编辑文件
+     *    auth为其他值时,可上传/编辑文件
+     * @param fileList  要显示到文件上传列表中的文件。
+     *    注:文件必须要有url属性并且文件的url属性值必须是在oss中的路径值
+     *    例:'/attachment-file/xxx/xxx/2022/9/08/xxx.jpg'
+     * @param directory  要存放到oss的哪个文件夹下。
+     *    注:值为空时,默认存放到"public"文件夹
+     * @param maxValue  上传文件允许的最大值,单位:MB
+     *    注:值为空时,默认值为300MB
+     * @param dividerName  组件中divider的名称
+     *    注:值为空时,默认值为‘附件’
+     * @param uploadFlag  ‘上传文件’按钮是否禁用
+     *    注:值为空时,默认值为false
+     *    auth=view&&uploadFlag=false时 ‘上传文件’按钮禁用
+     * @param delFlag  ‘删除’按钮是否禁用
+     *    注:值为空时,默认值为false
+     *    auth=view&&delFlag=false时 ‘删除’按钮禁用
+     * @param showDivider  ‘附件‘Divider是否展示
+     *    注:值为空时,默认值为true
+     *    showDivider=false时 ‘附件‘Divider隐藏
+     */
+    async newUpload(auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider) {
+      await this.fileLoadingFalse()
+      if (this.commonJS.isEmpty(fileList)) {
+        this.fileLoading = true
+      } else {
+        this.dataListLength = fileList.length
+      }
+      if (this.commonJS.isEmpty(dividerName)) {
+        this.dividerName = '附件'
+      } else {
+        this.dividerName = dividerName
+      }
+      if (directory !== undefined && directory !== null && directory !== '' && directory !== {}) {
+        this.directory = directory
+      } else {
+        this.directory = 'public'
+      }
+      if (maxValue !== undefined && maxValue !== null && maxValue !== '' && maxValue !== 0) {
+        this.maxValue = maxValue
+      } else {
+        this.maxValue = 300
+      }
+      this.auth = auth
+      if (this.commonJS.isEmpty(uploadFlag)) {
+        this.uploadFlag = false
+      } else {
+        if (uploadFlag !== true && uploadFlag !== false) {
+          this.uploadFlag = false
+        } else {
+          this.uploadFlag = uploadFlag
+        }
+      }
+      if (this.commonJS.isEmpty(delFlag)) {
+        this.delFlag = false
+      } else {
+        if (delFlag !== true && delFlag !== false) {
+          this.delFlag = false
+          this.createBy = delFlag
+        } else {
+          this.delFlag = delFlag
+        }
+      }
+      for await (let item of fileList) {
+        await this.ossService.getFileSizeByUrl(item.url).then((data) => {
+          item.lsUrl = data.url
+          item.size = data.size
+          this.dataList.push(item)
+          this.dataListNew.push(item)
+          this.fileList.push(item)
+          if (this.dataListNew.length === fileList.length) {
+            this.fileLoading = true
+          }
+        })
+      }
+      // this.dataList = JSON.parse(JSON.stringify(fileList))
+      // this.dataListNew = JSON.parse(JSON.stringify(fileList))
+      if (this.commonJS.isEmpty(showDivider)) {
+        this.showDivider = true
+      } else {
+        if (showDivider === false) {
+          this.showDivider = false
+        } else {
+          this.showDivider = true
+        }
+      }
+    },
+    async httpRequest(file) {
+      await httpRequest(file, fileName(file), this.directory, this.maxValue)
+    },
+    uploadVideoProcess(event, file, fileList) {
+      this.progressFlag = true // 显示进度条
+      this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
+      if (this.loadProgress >= 100) {
+        this.loadProgress = 100
+        setTimeout(() => {
+          this.progressFlag = false
+        }, 1000) // 一秒后关闭进度条
+      }
+    },
+    getSize(value) {
+      if (this.commonJS.isEmpty(value)) {
+        return '0 B'
+      } else {
+        let val = parseInt(value)
+        if (this.commonJS.isEmpty(val)) {
+          return '0 B'
+        }
+        if (isNaN(val)) {
+          return '0 B'
+        }
+        if (val === 0) {
+          return '0 B'
+        }
+        let k = 1024
+        let sizes = ['B', 'KB', 'MB', 'GB', 'PB', 'TB', 'EB', 'ZB', 'YB']
+        let i = Math.floor(Math.log(val) / Math.log(k))
+        let result = val / Math.pow(k, i);
+        let kb = parseFloat(result.toPrecision(3));
+        return kb + '' + sizes[i]
+      }
+    },
+    async changes(file, fileList) {
+      // if (file.status !== 'ready') {
+      //   return
+      // }
+
+
+      if (file.status !== 'ready') {
+        let fileListNamesList = []
+        console.log(JSON.stringify(this.fileList));
+        this.fileList.forEach(fileItem => {
+          fileListNamesList.push(fileItem.name)
+        })
+
+        if (fileListNamesList.indexOf(file.name) != -1) {
+          console.log(this.fileList);
+
+          this.$message.error(`${file.name}已存在,无法重复上传`)
+
+          return
+        } else {
+
+          if (!beforeAvatarUpload(file, fileList, this.maxValue)) {
+            this.$message.error('文件大小不能超过 ' + this.maxValue + ' MB!')
+            return
+          }
+          // this.dataListNew = []
+          // this.dataList.forEach((item) => {
+          //   this.dataListNew.push(item)
+          // })
+          var fileListNames = []
+          for (let fileItem of this.fileList) {
+            fileListNames.push(fileItem.name)
+          }
+          // for (let item of fileList) {
+
+
+          let item1 = JSON.parse(JSON.stringify(file))
+          // if (fileListNames.length === 0 || fileListNames.indexOf(item1.name) === -1) {
+          this.fileList.push(item1)
+          // }
+          item1.createTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          item1.createBy = {
+            id: '',
+            name: ''
+          }
+          item1.createBy.id = this.$store.state.user.id
+          item1.createBy.name = this.$store.state.user.name
+          this.dataListNew.push(item1)
+          this.dataList.push(item1)
+          // }
+          for (let item of this.dataListNew) {
+            if (item.raw !== undefined && item.raw !== null && item.raw !== {}) {
+              item.url = item.raw.url
+              if (item.raw.url !== undefined && item.raw.url !== null && item.raw.url !== {}) {
+                this.ossService.getTemporaryUrl(item.raw.url).then((data) => {
+                  item.lsUrl = data
+                })
+              }
+            }
+
+          }
+        }
+      }
+    },
+
+    showFile(row) {
+      console.log('row', row)
+      openWindowOnUrl(row)
+    },
+    onPreview(url) {
+      this.url = url
+      this.showViewer = true
+    },
+    // 关闭查看器
+    closeViewer() {
+      this.url = ''
+      this.showViewer = false
+    },
+    toHref(row) {
+      toHref(row)
+    },
+    async deleteById(row, index, fileList) {
+      // this.$refs.upload.handleRemove(this.dataListNew[index])
+      await this.dataListNew.splice(index, 1)
+      await this.dataList.splice(index, 1)
+      if (this.commonJS.isNotEmpty(row.id)) {
+        this.ossService.deleteMsgById(row.id)
+      }
+      var newFileList = [];
+      for (var i = 0; i < fileList.length; i++) {
+        if (fileList[i].name !== row.name) {
+          newFileList.push(fileList[i])
+        }
+      }
+      this.fileList = newFileList;
+    },
+    /**
+     * 关闭dialog时使用  清除el-upload中上传的文件
+     */
+    clearUpload() {
+      this.$refs.upload.clearFiles()
+      this.dataList = []
+      this.dataListNew = []
+      this.fileList = []
+      this.createBy = ''
+    },
+    /**
+     * 获取当前文件列表中的文件数据
+     */
+    getDataList() {
+      return this.dataListNew
+    },
+    /**
+     * 判断进度条是否结束,附件是否加载完成
+     * @returns {boolean}
+     */
+    checkProgress() {
+      if (this.progressFlag === true) {
+        this.$message.warning('请等待附件上传完成再进行操作')
+        return true
+      }
+      if (this.fileLoading === false) {
+        this.$message.warning('请等待附件加载完成再进行操作')
+        if (this.dataListLength === this.dataListNew.length) {
+          this.fileLoading = true
+        }
+        return true
+      }
+      return false
+    },
+    ifName(row) {
+      if (this.commonJS.isEmpty(row.name)) {
+        row.name = '---'
+        return false
+      }
+      let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
+      if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
+        return true
+      } else {
+        return false
+      }
+    },
+    fileLoadingFalse() {
+      this.fileLoading = false
+    },
+    // 开启/关闭页面的加载中状态
+    changeLoading(loading) {
+      if (this.commonJS.isNotEmpty(loading)) {
+        this.loading = loading
+      } else {
+        this.loading = false
+      }
+    }
+  }
+}
+</script>
+<style>
+.el-divider__text {
+  font-size: 16px;
+  font-weight: bold;
+}
+</style>