|
|
@@ -37,54 +37,37 @@
|
|
|
</div>
|
|
|
<div class="list-page">
|
|
|
<el-table
|
|
|
- v-loading="loading"
|
|
|
class="center-align-table"
|
|
|
:data="tableData"
|
|
|
border
|
|
|
:cell-style="rowStyle"
|
|
|
>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
fixed
|
|
|
- prop="fieldName"
|
|
|
- label="风场名称"
|
|
|
- min-width="200"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
align="center"
|
|
|
- label="分析名称"
|
|
|
+ label="分析主题"
|
|
|
prop="analysisName"
|
|
|
min-width="200"
|
|
|
>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ :content="scope.row.sketch ? scope.row.sketch : '暂无简述内容'"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <span style="color: #4caf50">{{ scope.row.analysisName }}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- label="数据类型名称"
|
|
|
- prop="dataTypeName"
|
|
|
+ prop="fieldName"
|
|
|
+ label="风场名称"
|
|
|
min-width="200"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="loginName"
|
|
|
- align="center"
|
|
|
- label="进度"
|
|
|
- min-width="150"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-progress
|
|
|
- v-if="scope.row.analysisState == 20"
|
|
|
- :text-inside="true"
|
|
|
- :stroke-width="20"
|
|
|
- :percentage="scope.row.analysisProgress"
|
|
|
- :class="{
|
|
|
- 'indeterminate-progress': scope.row.analysisProgress < 100,
|
|
|
- 'animated-progress': true,
|
|
|
- }"
|
|
|
- ></el-progress>
|
|
|
- <span v-else>/</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
prop="loginName"
|
|
|
align="center"
|
|
|
@@ -103,6 +86,7 @@
|
|
|
<span v-else-if="scope.row.errState == 1" style="color: #f00"
|
|
|
>分析异常</span
|
|
|
>
|
|
|
+
|
|
|
<span
|
|
|
v-else-if="scope.row.analysisState == 30"
|
|
|
style="color: #4caf50"
|
|
|
@@ -117,6 +101,43 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ prop="loginName"
|
|
|
+ align="center"
|
|
|
+ label="进度"
|
|
|
+ min-width="150"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-progress
|
|
|
+ v-if="scope.row.analysisState == 20"
|
|
|
+ :text-inside="true"
|
|
|
+ :stroke-width="20"
|
|
|
+ :percentage="scope.row.analysisProgress"
|
|
|
+ :class="{
|
|
|
+ 'indeterminate-progress': scope.row.analysisProgress < 100,
|
|
|
+ 'animated-progress': true,
|
|
|
+ }"
|
|
|
+ ></el-progress>
|
|
|
+ <span v-else>/</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="待分析排位"
|
|
|
+ prop="dataTypeName"
|
|
|
+ min-width="200"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span> {{ scope.row.dataTypeName }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="数据类型名称"
|
|
|
+ prop="dataTypeName"
|
|
|
+ min-width="200"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
prop="errState"
|
|
|
align="center"
|
|
|
label="异常状态"
|
|
|
@@ -133,7 +154,7 @@
|
|
|
}}</span
|
|
|
>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column
|
|
|
prop="roleName"
|
|
|
align="center"
|
|
|
@@ -259,6 +280,10 @@
|
|
|
<el-button
|
|
|
@click="handleAssetss(scope.row)"
|
|
|
type="text"
|
|
|
+ :disabled="
|
|
|
+ (scope.row.analysisState == 20 && scope.row.errState == 0) ||
|
|
|
+ scope.row.analysisState == 10
|
|
|
+ "
|
|
|
size="small"
|
|
|
>分析</el-button
|
|
|
>
|
|
|
@@ -269,13 +294,19 @@
|
|
|
>异常描述</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
+ @click="insertQueue(scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ >{{ scope.row.onOffCall === 0 ? "插队" : "取消插队" }}</el-button
|
|
|
+ >
|
|
|
+ <!-- <el-button
|
|
|
@click="HandleOnOffAuto(scope.row)"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
>{{
|
|
|
scope.row.onOffCall === 0 ? "开启自动分析" : "关闭自动分析"
|
|
|
}}</el-button
|
|
|
- >
|
|
|
+ > -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -297,7 +328,7 @@
|
|
|
:title="title"
|
|
|
:rowInfo="rowInfo"
|
|
|
@confirm="handleConfirm"
|
|
|
- @getTableList="fetchData"
|
|
|
+ @getTableList="getTableList"
|
|
|
>
|
|
|
<div slot="tableEl">
|
|
|
<el-empty description="暂无数据"></el-empty>
|
|
|
@@ -368,11 +399,10 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="" prop="analysisName">
|
|
|
<b style="color: #f00; font-size: 12px"
|
|
|
- >不填写分析名称自动采用系统生成的名称!</b
|
|
|
+ >不填写分析主题,自动采用系统生成的主题!</b
|
|
|
>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="分析名称" prop="analysisName">
|
|
|
+ <el-form-item label="分析主题" prop="analysisName">
|
|
|
<el-input v-model="addRuleForm.analysisName"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="分析简述" prop="sketch">
|
|
|
@@ -398,6 +428,7 @@ import {
|
|
|
queryCodeNum,
|
|
|
} from "@/api/performance";
|
|
|
import { from } from "plotly.js-dist";
|
|
|
+import { disable } from "ol/rotationconstraint";
|
|
|
export default {
|
|
|
components: {
|
|
|
MyDialog,
|
|
|
@@ -446,7 +477,6 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
window.addEventListener("message", this.handleMessage); //江
|
|
|
- this.getTableList();
|
|
|
},
|
|
|
|
|
|
beforeDestroy() {
|
|
|
@@ -467,7 +497,17 @@ export default {
|
|
|
message: "创建成功",
|
|
|
});
|
|
|
this.addDialogVisible = false;
|
|
|
- this.getTableList();
|
|
|
+ this.loading = false;
|
|
|
+ this.isPolling = false;
|
|
|
+ await this.getTableList();
|
|
|
+ this.$router.push({
|
|
|
+ path: "/home/performance/editAssets",
|
|
|
+ query: {
|
|
|
+ batchCode: this.tableData[0].batchCode,
|
|
|
+ analysisTypeCode: this.tableData[0].analysisTypeCode,
|
|
|
+ fieldEngineCode: this.tableData[0].fieldCode,
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
} catch (err) {
|
|
|
console.error(err);
|
|
|
@@ -479,6 +519,7 @@ export default {
|
|
|
AddHandleCloses(done) {
|
|
|
this.$confirm("确认关闭?")
|
|
|
.then((_) => {
|
|
|
+ this.addDialogVisible = false;
|
|
|
done();
|
|
|
})
|
|
|
.catch((_) => {});
|
|
|
@@ -530,6 +571,22 @@ export default {
|
|
|
console.error(err);
|
|
|
}
|
|
|
},
|
|
|
+ //插队接口
|
|
|
+ async insertQueue(row) {
|
|
|
+ this.$confirm(
|
|
|
+ `确认${row.onOffCall === 0 ? "开启" : "关闭"}插队?`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ navigateToDetails();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
//分析
|
|
|
handleAssetss(row) {
|
|
|
this.$router.push({
|
|
|
@@ -593,6 +650,7 @@ export default {
|
|
|
// 修改 getTableList 方法,避免重复请求
|
|
|
async getTableList() {
|
|
|
// 如果正在请求中,跳过此次调用
|
|
|
+ console.log(this.loading, this.isPolling);
|
|
|
if (this.loading || this.isPolling) return;
|
|
|
|
|
|
this.loading = true;
|
|
|
@@ -609,6 +667,7 @@ export default {
|
|
|
|
|
|
const result = await analysisResultList(params);
|
|
|
this.tableData = result.data.list;
|
|
|
+ console.log(this.tableData, "result this.tableData");
|
|
|
this.formInline.totalSize = result.data.totalSize;
|
|
|
} catch (error) {
|
|
|
this.$message({
|
|
|
@@ -622,13 +681,12 @@ export default {
|
|
|
|
|
|
// 改进 handleMessage,避免频繁请求
|
|
|
handleMessage(event) {
|
|
|
+ // console.log(event, "请求分析页面");
|
|
|
// 确保消息来自当前域
|
|
|
if (event.origin !== window.location.origin) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
const { fieldName, analysisState, errState } = event.data;
|
|
|
-
|
|
|
// 更新表单字段
|
|
|
if (fieldName !== undefined) {
|
|
|
this.formInline.fieldName = fieldName;
|
|
|
@@ -644,8 +702,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
// 如果当前没有请求中,才调用 getTableList
|
|
|
- if (!this.loading) {
|
|
|
+ if (!this.loading && fieldName && analysisState) {
|
|
|
this.getTableList();
|
|
|
+ // this.startPolling();
|
|
|
}
|
|
|
},
|
|
|
rowStyle() {
|
|
|
@@ -701,7 +760,7 @@ export default {
|
|
|
this.fetchData();
|
|
|
}
|
|
|
}
|
|
|
- }, 3000); // 每10秒检查一次
|
|
|
+ }, 10000); // 每10秒检查一次
|
|
|
},
|
|
|
|
|
|
//创建分析
|
|
|
@@ -716,9 +775,10 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.getTableList();
|
|
|
setTimeout(() => {
|
|
|
this.startPolling();
|
|
|
- }, 5000);
|
|
|
+ }, 10000);
|
|
|
},
|
|
|
};
|
|
|
</script>
|