Aris流程数据迁移日志记录处理

This commit is contained in:
446052889@qq.com 2022-07-04 12:44:59 +08:00
parent ff48acac1b
commit 69a05b8ee4
2 changed files with 52 additions and 31 deletions

View File

@ -40,14 +40,21 @@
</div>
</div>
<el-dialog
title="提示"
title="日志"
v-model="dlg.visible"
width="800px"
height="500px"
height="520px"
destroy-on-close
@close="dlgClose">
<div style="width: 100%;height: 500px;">
<log-codemirror ref="dataCodemirrorRef" :width="logCodemirror.width" :height="logCodemirror.height" :log-str="logCodemirror.logStr" ></log-codemirror>
<div style="width: 100%;height: 10px;">
<el-progress :percentage="result.totalCount == 0 ? 0 : (Math.floor(result.importingCount / result.totalCount * 100))" color="#287ff4" />
</div>
<div style="width: 100%;height: 10px;text-align: left;">
<span>正在导入第[{{result.importingCount}}]总共[{{result.totalCount}}]</span>
</div>
</div>
<template #footer>
<span class="dialog-footer">
@ -145,7 +152,7 @@ export default defineComponent({
data: {
cmd: 'com.actionsoft.apps.coe.pal.datamigration_data_migrate',
sid: settingParam.sessionId,
wsId: settingParam.wsId ? settingParam.wsId : 'd2f7c8d3-d5c6-4867-9dc8-bbaef5c11ce7',
wsId: settingParam.wsId ? settingParam.wsId : '1b19ab87-5727-4621-bc3f-117183b06e59',
groupValue: info.groupValue,
fileValue: info.fileValue,
fileName: info.fileName
@ -196,6 +203,9 @@ export default defineComponent({
result.resultStatus = ro.data.resultStatus;
if (result.resultStatus != 0) {
removeInterval();
result.importingCount = result.totalCount;// 100%
} else {
result.importingCount = ro.data.importingCount;
}
}
} else {

View File

@ -1,29 +1,37 @@
<template>
<codemirror
ref="codeMirror"
v-model="logStr"
placeholder="正在导入,请稍等"
:style="{ height: height, width: width }"
:autofocus="true"
:indent-with-tab="true"
:tab-size="2"
:extensions="extensions"
@ready="log('ready', $event)"
@change="log('change', $event)"
@focus="log('focus', $event)"
@blur="log('blur', $event)"
/>
<!-- <codemirror-->
<!-- ref="codeMirror"-->
<!-- v-model="logStr"-->
<!-- placeholder="正在导入,请稍等"-->
<!-- :style="{ height: height, width: width }"-->
<!-- :autofocus="true"-->
<!-- :indent-with-tab="true"-->
<!-- :tab-size="2"-->
<!-- :extensions="extensions"-->
<!-- @ready="log('ready', $event)"-->
<!-- @change="log('change', $event)"-->
<!-- @focus="log('focus', $event)"-->
<!-- @blur="log('blur', $event)"-->
<!-- />-->
<!--先用div实现不用codemirror-->
<div
id="codeMirrorDiv"
:style="{ height: height, width: width, overflow: 'auto', 'background-color':'#2c2c2c', color: '#287ff4'}"
v-html="logStr"
>
</div>
</template>
<script>
import {defineComponent, getCurrentInstance, reactive, ref} from 'vue';
import { Codemirror } from 'vue-codemirror'
import { javascript } from '@codemirror/lang-javascript'
import { oneDark } from '@codemirror/theme-one-dark'
// import { Codemirror } from 'vue-codemirror'
// import { javascript } from '@codemirror/lang-javascript'
// import { oneDark } from '@codemirror/theme-one-dark'
export default {
components: {
Codemirror
},
// components: {
// Codemirror
// },
name: "logcodemirror",
props: {
width: {
@ -40,18 +48,21 @@ export default {
}
},
setup() {
const codeMirror = ref()
const code = ref()
const extensions = [javascript(), oneDark]
// const codeMirror = ref()
// const code = ref()
// const extensions = [javascript(), oneDark]
const moveTextToEnd = () => {
debugger;
codeMirror.value.scrollIntoView(codeMirror.value.lineCount() - 1);
// debugger;
// codeMirror.value.scrollIntoView(codeMirror.value.lineCount() - 1);
// that.$refs.mycode.codemirror.scrollIntoView(that.$refs.mycode.codemirror.lineCount() - 1);
var div = document.getElementById('codeMirrorDiv');
div.scrollTop = div.scrollHeight;
}
return {
codeMirror,
code,
extensions,
// codeMirror,
// code,
// extensions,
log: console.log,
moveTextToEnd
}