yangys
2025-08-23 ac13062b358196b4c11ca6b4fc553bf9187d3f83
导出工控网增加相同程序的验证
已修改1个文件
25 ■■■■■ 文件已修改
src/views/flowmgr/programexport.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowmgr/programexport.vue
@@ -294,13 +294,36 @@
                this.loading = false;
            });
        },
        findDuplicates(arr) {
            const seen = new Set();
            const duplicates = new Set();
            arr.forEach(item => {
                if (seen.has(item)) {
                duplicates.add(item);
                } else {
                seen.add(item);
                }
            });
            return Array.from(duplicates);
        },
        exportExcel() {
            this.$confirm('是否导出?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
            }).then(() => {
                console.log(this.selection)
                //console.log(this.selection)
                let selectArray = [];
                for(var i=0;i<this.selection.length;i++){
                    selectArray.push(this.selection[i].name+"-"+this.selection[i].processEdition)
                }
                let dupData = this.findDuplicates(selectArray);
                if(dupData.length > 0){
                    this.$message.error('不能在一次导出中选择一个程序的不同版本:['+dupData.join()+"]");
                    return;
                }
                if(this.selection == null || this.selection.length == 0){
                    this.$message.error('请至少选择一条导出');
                    return;