批处理前端
This commit is contained in:
parent
d7f7c5445e
commit
d0700a293f
@ -1,177 +1,207 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<!-- 校验结果 -->
|
<!--上传的清单内容预览-->
|
||||||
<div v-if="checkResult.checkTemplateResult == 'ok'">
|
<div v-if="checkResult.checkTemplateResult == 'ok'">
|
||||||
<awsui-tabs v-model="activeName">
|
<div :style="{height: msgHeight}" v-html="checkResult.resultMsg"></div>
|
||||||
<awsui-tab-pane v-for="(tabItem, index) in tabData" :key="tabItem.id" :name="tabItem.id">
|
<div>
|
||||||
<span slot="label"><span :style="{color: tabItem.isOk ? '' : 'red'}">{{tabItem.sheetName}}</span></span>
|
<el-table
|
||||||
<div :style="{height: msgHeight}" v-html="checkResult.resultMsg[index]"></div>
|
id='table'
|
||||||
<div>
|
:height="tableHeight"
|
||||||
<el-table
|
:data="tableData"
|
||||||
id='table'
|
border
|
||||||
:height="tableHeight"
|
size="medium"
|
||||||
:data="tabItem.data"
|
style="width: 100%">
|
||||||
border
|
<!-- ExcelNo -->
|
||||||
size="medium"
|
<el-table-column
|
||||||
style="width: 100%">
|
prop='excelNo'
|
||||||
<el-table-column
|
label=' '
|
||||||
prop='index'
|
align='center'
|
||||||
label=''
|
width=100px
|
||||||
align='center'
|
>
|
||||||
width=50px
|
<template slot-scope="scope">
|
||||||
>
|
{{scope.row.excelNo}}
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column
|
</el-table-column>
|
||||||
v-for="(item) in tabItem.titleRow"
|
<!-- 策略 -->
|
||||||
:key=item
|
<el-table-column
|
||||||
:prop=item
|
prop='result'
|
||||||
:label="item">
|
label='策略'
|
||||||
<template slot-scope="scope">
|
align='center'
|
||||||
<template v-if="scope.row[item] != undefined">
|
width=100px
|
||||||
{{scope.row[item].value}}
|
fiexd="left"
|
||||||
<!--警告类提示,上传可忽略-->
|
>
|
||||||
<span v-if="!scope.row[item].isRowOk && item == '名称'" style="color: #E6A23C">
|
<template slot-scope="scope">
|
||||||
<br/><b>{{scope.row[item].rowMsg}}</b>
|
<p :style="{color: scope.row.isRowOk ? '#009688' : '#ff0000'}">
|
||||||
</span>
|
<span v-if="scope.row.result == 'add'">新增</span>
|
||||||
<!--错误类提示,不能上传-->
|
<span v-else-if="scope.row.result == 'update'">更新</span>
|
||||||
<span v-if="!scope.row[item].isOk" style="color: #ff0000">
|
<span v-else-if="(scope.row.result == 'repeat' || scope.row.result == 'blank' || scope.row.result == 'noMatch')">忽略</span>
|
||||||
<br/><b>{{scope.row[item].msg}}</b>
|
<span v-else>————</span>
|
||||||
</span>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column
|
||||||
</el-table>
|
v-for="(item, index) in tableTitle"
|
||||||
</div>
|
:key=item
|
||||||
</awsui-tab-pane>
|
:prop=item
|
||||||
</awsui-tabs>
|
:label="item"
|
||||||
</div>
|
min-width="150">
|
||||||
<!-- excel错误提示 -->
|
<template slot-scope="scope">
|
||||||
<div v-if="checkResult.checkTemplateResult != 'ok'">
|
<template v-if="scope.row.row[index] != undefined">
|
||||||
<div style="background-color:#F56C6C;padding: 10px;" v-html="checkResult.checkTemplateResultMsg"></div>
|
{{ scope.row.row[index].value }}
|
||||||
</div>
|
<span v-if="!scope.row.row[index].isOk" style="color: #ff0000">
|
||||||
|
<br/>{{ scope.row.row[index].msg }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!--上传的清单校验失败时显示内容-->
|
||||||
|
<div v-if="checkResult.checkTemplateResult != 'ok'">
|
||||||
|
<div style="background-color:#F56C6C;padding: 10px;" v-html="checkResult.checkTemplateResultMsg"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import awsuiAxios from "../../awsuiAxios";
|
import awsuiAxios from "../../awsuiAxios";
|
||||||
export default {
|
|
||||||
name: "check-shape",
|
|
||||||
props: {
|
|
||||||
fileName: {// 文件名称
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
totalHeight: {
|
|
||||||
type: String,
|
|
||||||
default: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
wsId: wsId,
|
|
||||||
teamId: teamId,
|
|
||||||
shapeFileValue: shapeFileValue,
|
|
||||||
msgHeight: '20px',
|
|
||||||
tableHeight: parseInt(this.totalHeight) - 20 - 45 + 'px',
|
|
||||||
activeName: 'first',
|
|
||||||
tabData: [],
|
|
||||||
checkResult: {
|
|
||||||
isOk: true,
|
|
||||||
okData: [],
|
|
||||||
resultMsg: [],
|
|
||||||
chheckDone: false,
|
|
||||||
checkTemplateResult: 'ok',
|
|
||||||
checkTemplateResultMsg: [],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
initData() {
|
|
||||||
const that = this;
|
|
||||||
that.loading = true;
|
|
||||||
const params = {
|
|
||||||
url:'jd',
|
|
||||||
data:{
|
|
||||||
cmd : "com.actionsoft.apps.coe.pal.batch_create_process_data_check",
|
|
||||||
wsId: that.wsId,
|
|
||||||
teamId: that.teamId,
|
|
||||||
type: 'shapeList',
|
|
||||||
fileValue: that.shapeFileValue,
|
|
||||||
fileName: that.fileName
|
|
||||||
}
|
|
||||||
};
|
|
||||||
awsuiAxios.post(params).then(function (ro) {
|
|
||||||
that.loading = false;
|
|
||||||
if (ro.result == 'ok') {
|
|
||||||
const data = ro.data;
|
|
||||||
that.checkResult.okData = JSON.parse(JSON.stringify(data));
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
if (i == 0) {
|
|
||||||
that.activeName = data[i].id;
|
|
||||||
}
|
|
||||||
const tableDataTemp = [];
|
|
||||||
const tableData = data[i].data;
|
|
||||||
let msg = '清单共<span style="font-weight:bold;">' + tableData.length + '</span>条记录';
|
|
||||||
let okCount = 0;
|
|
||||||
let errCount = 0;
|
|
||||||
for (let j = 0; j < tableData.length; j++) {
|
|
||||||
const row = {};
|
|
||||||
const rowArr = tableData[j];
|
|
||||||
let isRowOk = true;// 每行结果
|
|
||||||
for (let m = 0; m < rowArr.length; m++) {
|
|
||||||
if (!rowArr[m].isOk) {
|
|
||||||
isRowOk = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let m = 0; m < rowArr.length; m++) {
|
|
||||||
row[rowArr[m].name2] = rowArr[m];
|
|
||||||
}
|
|
||||||
row.index = j + 1;// 序号列,方便用户识别
|
|
||||||
tableDataTemp.push(row);
|
|
||||||
if (isRowOk) {
|
|
||||||
okCount++;
|
|
||||||
} else {
|
|
||||||
errCount++;
|
|
||||||
that.checkResult.isOk = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (okCount == tableData.length) {
|
|
||||||
msg += ',全部校验通过';
|
|
||||||
} else if (errCount == tableData.length) {
|
|
||||||
msg += ',全部校验失败';
|
|
||||||
} else {
|
|
||||||
msg += ',校验通过<span style="font-weight:bold;">' + okCount + '</span>条';
|
|
||||||
msg += ',校验失败<span style="color:red;font-weight:bold;">' + errCount + '</span>条';
|
|
||||||
}
|
|
||||||
that.checkResult.resultMsg.push(msg);
|
|
||||||
data[i].data = tableDataTemp;
|
|
||||||
|
|
||||||
}
|
|
||||||
that.tabData = ro.data;
|
|
||||||
that.checkResult.chheckDone = true;
|
|
||||||
} else if (ro.result == 'warning') {
|
|
||||||
that.$message({message: ro.msg, type: 'warning'});
|
|
||||||
} else {// 校验excel失败或其他错误类信息
|
|
||||||
// that.$message.error(ro.msg);
|
|
||||||
that.checkResult.checkTemplateResult = 'error';
|
|
||||||
that.checkResult.checkTemplateResultMsg = ro.msg;
|
|
||||||
}
|
|
||||||
}).catch(error=>{
|
|
||||||
console.log(error);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleClick() {
|
|
||||||
alert(this.activeName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "check-shape",
|
||||||
|
props: {
|
||||||
|
fileName: {// 文件名称
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
totalHeight: {
|
||||||
|
type: String,
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
wsId: wsId,
|
||||||
|
teamId: teamId,
|
||||||
|
shapeFileValue: shapeFileValue,
|
||||||
|
methodCategory: methodCategory,
|
||||||
|
msgHeight: '20px',
|
||||||
|
tableHeight: parseInt(this.totalHeight) - 20 + 'px',
|
||||||
|
tableTitle: [],
|
||||||
|
tableData: [],
|
||||||
|
checkResult: {
|
||||||
|
okData: [],
|
||||||
|
errData: [],
|
||||||
|
existData: [],
|
||||||
|
excelExistData: [],
|
||||||
|
resultMsg: '正在校验...',
|
||||||
|
chheckDone: false,
|
||||||
|
checkTemplateResult: 'ok',
|
||||||
|
checkTemplateResultMsg: '',
|
||||||
|
totalCount: 0,
|
||||||
|
okCount: 0,
|
||||||
|
repeatCount: 0,
|
||||||
|
blankCount: 0,
|
||||||
|
errCount: 0,
|
||||||
|
noMatchCount: 0,
|
||||||
|
noPermCount: 0,
|
||||||
|
moreMatchCount: 0,
|
||||||
|
readonlyCount: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initData() {
|
||||||
|
const that = this;
|
||||||
|
that.loading = true;
|
||||||
|
const params = {
|
||||||
|
url: 'jd',
|
||||||
|
data: {
|
||||||
|
cmd: "com.actionsoft.apps.coe.pal.batch_create_process_data_check",
|
||||||
|
wsId: that.wsId,
|
||||||
|
teamId: that.teamId,
|
||||||
|
type: 'shapeList',
|
||||||
|
fileValue: that.shapeFileValue,
|
||||||
|
fileName: that.fileName,
|
||||||
|
methodCategory: methodCategory
|
||||||
|
}
|
||||||
|
};
|
||||||
|
awsuiAxios.post(params).then(function (ro) {
|
||||||
|
that.loading = false;
|
||||||
|
if (ro.result == 'ok') {
|
||||||
|
// 标题
|
||||||
|
that.tableTitle = ro.data.data.titleRow;
|
||||||
|
// 内容
|
||||||
|
const data = ro.data.data.data;
|
||||||
|
let totalCount = data.totalCount;// 总数
|
||||||
|
that.checkResult.totalCount = totalCount;
|
||||||
|
let okCount = data.okCount;// 校验成功数
|
||||||
|
that.checkResult.okCount = okCount;
|
||||||
|
let repeatCount = data.repeatCount;// Excel数据重复数
|
||||||
|
that.checkResult.repeatCount = repeatCount;
|
||||||
|
let blankCount = data.blankCount;// 关键信息空白数
|
||||||
|
that.checkResult.blankCount = blankCount;
|
||||||
|
let errCount = data.errCount;// 校验失败数
|
||||||
|
that.checkResult.errCount = errCount;
|
||||||
|
let noMatchCount = data.noMatchCount;// 校验不匹配数
|
||||||
|
that.checkResult.noMatchCount = noMatchCount;
|
||||||
|
let noPermCount = data.noPermCount;// 没有写权限数
|
||||||
|
that.checkResult.noPermCount = noPermCount;
|
||||||
|
let moreMatchCount = data.moreMatchCount;// 匹配大于一个数
|
||||||
|
that.checkResult.moreMatchCount = moreMatchCount;
|
||||||
|
let readonlyCount = data.readonlyCount;// 只读数
|
||||||
|
that.checkResult.readonlyCount = readonlyCount;
|
||||||
|
let result = '共<span style="font-weight:bold;">' + totalCount + '</span>条';
|
||||||
|
if (okCount > 0) {
|
||||||
|
if (totalCount == okCount) {
|
||||||
|
result += ',全部校验通过';
|
||||||
|
} else {
|
||||||
|
result += ',通过<span style="font-weight:bold;">' + okCount + '</span>条';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (errCount > 0) {
|
||||||
|
result += ',失败<span style="color:red;font-weight:bold;">' + errCount + '</span>条';
|
||||||
|
}
|
||||||
|
if (blankCount > 0) {
|
||||||
|
result += ',模型名称、模型类型、形状名称、形状类型缺失<span style="color:red;font-weight:bold;">' + blankCount + '</span>条';
|
||||||
|
}
|
||||||
|
if (repeatCount > 0) {
|
||||||
|
result += ',重复<span style="color:red;font-weight:bold;">' + repeatCount + '</span>条';
|
||||||
|
}
|
||||||
|
if (noMatchCount > 0) {
|
||||||
|
result += ',不匹配<span style="color:red;font-weight:bold;">' + noMatchCount + '</span>条';
|
||||||
|
}
|
||||||
|
if (noPermCount > 0) {
|
||||||
|
result += ',没权限<span style="color:red;font-weight:bold;">' + noPermCount + '</span>条';
|
||||||
|
}
|
||||||
|
if (moreMatchCount > 0) {
|
||||||
|
result += ',匹配出多个<span style="color:red;font-weight:bold;">' + moreMatchCount + '</span>条';
|
||||||
|
}
|
||||||
|
if (readonlyCount > 0) {
|
||||||
|
result += ',只读<span style="color:red;font-weight:bold;">' + readonlyCount + '</span>条';
|
||||||
|
}
|
||||||
|
|
||||||
|
that.checkResult.resultMsg = result;
|
||||||
|
that.tableData = data.result;
|
||||||
|
that.checkResult.okData = that.tableData;
|
||||||
|
that.checkResult.chheckDone = true;
|
||||||
|
} else if (ro.result == 'warning') {
|
||||||
|
that.$message({message: ro.msg, type: 'warning'});
|
||||||
|
} else {// 校验excel失败或其他错误类信息
|
||||||
|
// that.$message.error(ro.msg);
|
||||||
|
that.checkResult.checkTemplateResult = 'error';
|
||||||
|
that.checkResult.checkTemplateResultMsg = ro.msg;
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -73,7 +73,7 @@
|
|||||||
</awsui-button>
|
</awsui-button>
|
||||||
<div style="padding-top: 30px;">
|
<div style="padding-top: 30px;">
|
||||||
<span class="text-linker-color" style="cursor: pointer;"
|
<span class="text-linker-color" style="cursor: pointer;"
|
||||||
@click="openRepositoryTreeDlg">下载Excel模板</span>
|
@click="downloadTemplate('shapeList')">下载Excel模板</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 已上传文件删除 -->
|
<!-- 已上传文件删除 -->
|
||||||
@ -116,18 +116,6 @@
|
|||||||
</pal-upload>
|
</pal-upload>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<create-tree
|
|
||||||
ref="createTree"
|
|
||||||
:visible.sync="uploadStep.shapeUpload.createTree.visible"
|
|
||||||
:wsId="wsId"
|
|
||||||
:teamId="teamId"
|
|
||||||
:categorys="methodCategory"
|
|
||||||
:multiple=true
|
|
||||||
v-on:cancel="uploadStep.shapeUpload.createTree.visible = false"
|
|
||||||
v-on:getResult="saveCreateTreeResult"
|
|
||||||
:title="uploadStep.shapeUpload.createTree.title"
|
|
||||||
></create-tree>
|
|
||||||
|
|
||||||
</awsui-tab-pane>
|
</awsui-tab-pane>
|
||||||
</awsui-tabs>
|
</awsui-tabs>
|
||||||
</div>
|
</div>
|
||||||
@ -163,15 +151,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import palUpload from '../components/upload/index';
|
import palUpload from '../components/upload/index';
|
||||||
import awsuiAxios from "../../awsuiAxios";
|
import awsuiAxios from "../../awsuiAxios";
|
||||||
import createTree from './components/createTree/index';
|
|
||||||
import checkProcess from './check-process';
|
import checkProcess from './check-process';
|
||||||
import checkShape from './check-shape';
|
import checkShape from './check-shape';
|
||||||
import save from './save';
|
import save from './save';
|
||||||
import Save from './save.vue';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "create",
|
name: "create",
|
||||||
components: {palUpload, createTree, checkProcess, checkShape, save},
|
components: {palUpload, checkProcess, checkShape, save},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
active: 1,
|
active: 1,
|
||||||
@ -196,10 +182,6 @@ export default {
|
|||||||
status: 0,
|
status: 0,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
data: {},
|
data: {},
|
||||||
createTree: {
|
|
||||||
visible: false,
|
|
||||||
title: '请选择流程'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkStep: {
|
checkStep: {
|
||||||
@ -261,7 +243,7 @@ export default {
|
|||||||
this.$message({message: '正在校验或校验未通过,不支持此操作', type: 'warning'});
|
this.$message({message: '正在校验或校验未通过,不支持此操作', type: 'warning'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!result.isOk) {
|
if (result.okCount != result.totalCount) {
|
||||||
this.$message({message: '校验未通过', type: 'warning'});
|
this.$message({message: '校验未通过', type: 'warning'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -300,7 +282,7 @@ export default {
|
|||||||
document.getElementById("selectShapeFileButton").click();
|
document.getElementById("selectShapeFileButton").click();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
downloadTemplate(type, versionIds) { // 下载模板
|
downloadTemplate(type) { // 下载模板
|
||||||
const that = this;
|
const that = this;
|
||||||
that.uploadStep.loading = true;
|
that.uploadStep.loading = true;
|
||||||
const data = {
|
const data = {
|
||||||
@ -309,7 +291,6 @@ export default {
|
|||||||
cmd: "com.actionsoft.apps.coe.pal.batch_create_download_template",
|
cmd: "com.actionsoft.apps.coe.pal.batch_create_download_template",
|
||||||
wsId: that.wsId,
|
wsId: that.wsId,
|
||||||
type: type,
|
type: type,
|
||||||
versionIds: versionIds,
|
|
||||||
methodCategory: methodCategory
|
methodCategory: methodCategory
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -383,18 +364,6 @@ export default {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/******模型结构模板下载start*******/
|
|
||||||
openRepositoryTreeDlg() {// 打开模型选择框
|
|
||||||
this.uploadStep.shapeUpload.createTree.visible = true;
|
|
||||||
},
|
|
||||||
saveCreateTreeResult(data) {// 模型选择完成后,获取选中的数据
|
|
||||||
if (data.length == 0) {
|
|
||||||
this.$message({message: '未选择任何模型,下载模板被取消', type: 'warning'});
|
|
||||||
} else {
|
|
||||||
this.downloadTemplate('shapeList', data.join(','));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/******模型结构模板下载end*******/
|
|
||||||
/******模型清单模板上传start*********/
|
/******模型清单模板上传start*********/
|
||||||
handleProcessRemove(file, fileList) {
|
handleProcessRemove(file, fileList) {
|
||||||
this.uploadStep.processUpload.status = 0;
|
this.uploadStep.processUpload.status = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user