|
@@ -23,7 +23,12 @@
|
|
|
>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="marginbottom: 0px">
|
|
|
- <el-button size="mini" @click="handleAllTest">所有规则测试</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ @click="handleAllTest"
|
|
|
+ :disabled="!runningStatus"
|
|
|
+ >所有规则测试</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</crumbs>
|
|
@@ -76,8 +81,16 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" size="small" @click="handleTest(scope.row)"
|
|
|
- >执行测试</el-button
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handleTest(scope.row, scope.$index)"
|
|
|
+ :disabled="!runningStatus"
|
|
|
+ >{{
|
|
|
+ runningStatusArr[scope.$index] === 1
|
|
|
+ ? '执行测试中...'
|
|
|
+ : '执行测试'
|
|
|
+ }}</el-button
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -97,11 +110,23 @@ export default {
|
|
|
list: [],
|
|
|
hospitalData: [],
|
|
|
hospitalId: '', //选中医院
|
|
|
+ runningStatusArr: [0, 0, 0, 0, 0, 0, 0, 0, 0], //知识图谱规则 测试状态
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ runningStatus() {
|
|
|
+ return this.runningStatusArr.every((item) => {
|
|
|
+ return item === 0;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
created() {
|
|
|
this._getHospitalInfoCDSS();
|
|
|
- // this.getDataList();
|
|
|
+ // this._getRunningStatus() // 进入页面立即确认状态
|
|
|
+ this.timer = setInterval(this._getRunningStatus, 20 * 1000);
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearInterval(this.timer);
|
|
|
},
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
next((vm) => {
|
|
@@ -112,11 +137,28 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ _getRunningStatus() {
|
|
|
+ const { hospitalId } = this;
|
|
|
+ if (this.hospitalId === '') return;
|
|
|
+ api.getRunningStatusByHospitalId({ hospitalId }).then((res) => {
|
|
|
+ if (res.data.code === '0' && res.data.data) {
|
|
|
+ this.runningStatusArr = Object.values(res.data.data).slice(0, 9);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
indexMethod(index) {
|
|
|
return index + 1;
|
|
|
},
|
|
|
// 执行测试
|
|
|
- handleTest(row) {
|
|
|
+ handleTest(row, index) {
|
|
|
+ this.runningStatusArr = this.runningStatusArr.map((item, idx) => {
|
|
|
+ if (idx === index) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
const { caseName, caseId } = row;
|
|
|
let params = {
|
|
|
caseId,
|
|
@@ -176,6 +218,7 @@ export default {
|
|
|
this.$message.error('测试失败');
|
|
|
this.getDataList(this.hospitalId);
|
|
|
}
|
|
|
+ this.runningStatusArr = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
|
});
|
|
|
},
|
|
|
// 所有规则测试
|
|
@@ -187,7 +230,9 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ this.runningStatusArr = [1, 1, 1, 1, 1, 1, 1, 1, 1];
|
|
|
api.ruleAllTest({ hospitalId: this.hospitalId }).then((res) => {
|
|
|
+ this.runningStatusArr = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
|
if (res.data.code === '0' && res.data.data) {
|
|
|
this.getDataList(this.hospitalId);
|
|
|
this.$message({
|
|
@@ -257,6 +302,7 @@ export default {
|
|
|
handleChange(val) {
|
|
|
if (val === '') return;
|
|
|
this.getDataList(val);
|
|
|
+ this._getRunningStatus(); // 选中后立即请求状态
|
|
|
},
|
|
|
|
|
|
// 获取列表数据
|