|
@@ -8,10 +8,10 @@
|
|
|
class="demo-form-inline"
|
|
|
:rules="rules"
|
|
|
>
|
|
|
- <el-form-item label="风场名称:" prop="userName">
|
|
|
+ <el-form-item label="风场名称:" prop="fieldName">
|
|
|
<el-input
|
|
|
size="small"
|
|
|
- v-model="formInline.userName"
|
|
|
+ v-model="formInline.fieldName"
|
|
|
placeholder="请输入风场名称"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
@@ -34,17 +34,30 @@
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
fixed
|
|
|
- prop="userId"
|
|
|
+ prop="fieldName"
|
|
|
label="风场名称"
|
|
|
width="100"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="批次编号" prop="userName">
|
|
|
+ <el-table-column align="center" label="批次编号" prop="batchCode">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="loginName" align="center" label="分析状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>
|
|
|
+ {{
|
|
|
+ scope.row.analysisState == 0
|
|
|
+ ? "分析中"
|
|
|
+ : scope.row.analysisState == -1
|
|
|
+ ? "未分析"
|
|
|
+ : scope.row.analysisState == 1
|
|
|
+ ? "分析完成"
|
|
|
+ : "/"
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="state"
|
|
|
+ prop="errState"
|
|
|
align="center"
|
|
|
label="异常状态"
|
|
|
width="100"
|
|
@@ -52,11 +65,11 @@
|
|
|
<template slot-scope="scope">
|
|
|
<span>
|
|
|
{{
|
|
|
- scope.row.state == 0
|
|
|
- ? "未启用"
|
|
|
- : scope.row.state == 1
|
|
|
- ? "启用"
|
|
|
- : "禁用"
|
|
|
+ scope.row.errState == 0
|
|
|
+ ? "未异常"
|
|
|
+ : scope.row.errState == 1
|
|
|
+ ? "异常"
|
|
|
+ : "/"
|
|
|
}}</span
|
|
|
>
|
|
|
</template>
|
|
@@ -64,11 +77,13 @@
|
|
|
<el-table-column prop="roleName" align="center" label="异常信息">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
+ v-if="scope.row.errState == 1"
|
|
|
@click="abnormalDialog(scope.row, '异常详情')"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
>异常详情</el-button
|
|
|
>
|
|
|
+ <span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="roleName" align="center" label="分析记录">
|
|
@@ -81,7 +96,7 @@
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="roleName" align="center" label="创建时间">
|
|
|
+ <el-table-column prop="createTime" align="center" label="创建时间">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="transition"
|
|
@@ -119,7 +134,13 @@
|
|
|
</div>
|
|
|
<!-- 弹出层 -->
|
|
|
<!-- 异常信息 /异常描述-->
|
|
|
- <my-dialog :visible="dialogVisible" :title="title" @confirm="handleConfirm">
|
|
|
+ <my-dialog
|
|
|
+ :visible="dialogVisible"
|
|
|
+ :errorInfo="errorInfo"
|
|
|
+ :title="title"
|
|
|
+ :rowInfo="rowInfo"
|
|
|
+ @confirm="handleConfirm"
|
|
|
+ >
|
|
|
<div slot="tableEl">
|
|
|
<el-empty description="暂无数据"></el-empty>
|
|
|
</div>
|
|
@@ -129,77 +150,35 @@
|
|
|
|
|
|
<script>
|
|
|
import MyDialog from "./components/dialogCom.vue";
|
|
|
-
|
|
|
+import { getAnalysisResultList } from "@/api/performance";
|
|
|
export default {
|
|
|
components: {
|
|
|
MyDialog,
|
|
|
},
|
|
|
data() {
|
|
|
- const validateUserName = (rule, value, callback) => {
|
|
|
- const regex = /^[^\u4e00-\u9fa5\W]+$/;
|
|
|
- if (!value) {
|
|
|
- callback(new Error("账号名称不能为空"));
|
|
|
- } else if (!regex.test(value)) {
|
|
|
- callback(new Error("账号名称不能包含中文及特殊字符"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- };
|
|
|
- const validatePhone = (rule, value, callback) => {
|
|
|
- const phoneRegex = /^[1][3-9][0-9]{9}$/;
|
|
|
- if (!value) {
|
|
|
- return callback(new Error("手机号不能为空"));
|
|
|
- }
|
|
|
- if (!phoneRegex.test(value)) {
|
|
|
- return callback(new Error("请输入正确的手机号"));
|
|
|
- }
|
|
|
- callback();
|
|
|
- };
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
loadingView: false,
|
|
|
loading: false, //数据加载中
|
|
|
+ errorInfo: "",
|
|
|
rules: {
|
|
|
- roleId: { trigger: "change" },
|
|
|
- userName: { trigger: "blur" },
|
|
|
+ fieldName: { trigger: "blur" },
|
|
|
},
|
|
|
roleList: [],
|
|
|
formInline: {
|
|
|
- userName: undefined,
|
|
|
- roleId: undefined,
|
|
|
+ fieldName: undefined,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- // sort: "desc",
|
|
|
totalSize: 0,
|
|
|
},
|
|
|
- tableData: [{}],
|
|
|
- // 新增编辑表单
|
|
|
- ruleForm: {
|
|
|
- phone: null,
|
|
|
- pwd: null,
|
|
|
- roleId: null,
|
|
|
- userName: null,
|
|
|
- loginName: null,
|
|
|
- },
|
|
|
- addUserRules: {
|
|
|
- phone: [
|
|
|
- { required: true, message: "请输入手机号", trigger: "blur" },
|
|
|
- { validator: validatePhone, trigger: "blur" },
|
|
|
- ],
|
|
|
- loginName: [
|
|
|
- { required: true, message: "请输入账号名称", trigger: "blur" },
|
|
|
- { validator: validateUserName, trigger: "blur" },
|
|
|
- ],
|
|
|
- pwd: { required: true, message: "请输入密码", trigger: "blur" },
|
|
|
- roleId: { required: true, message: "请选择角色", trigger: "change" },
|
|
|
- userName: [
|
|
|
- { required: true, message: "请输入员工姓名", trigger: "blur" },
|
|
|
- ],
|
|
|
- },
|
|
|
+ tableData: [],
|
|
|
+ rowInfo: {},
|
|
|
title: "",
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ this.getTableList();
|
|
|
+ },
|
|
|
|
|
|
methods: {
|
|
|
//分析
|
|
@@ -217,32 +196,34 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
abnormalDialog(row, title) {
|
|
|
- console.log("dialog 调起");
|
|
|
this.dialogVisible = true;
|
|
|
+ if (title === "异常详情") {
|
|
|
+ this.errorInfo = row.errInfo;
|
|
|
+ this.rowInfo = {};
|
|
|
+ } else if (title === "异常描述") {
|
|
|
+ this.errorInfo = "";
|
|
|
+ this.rowInfo = row;
|
|
|
+ }
|
|
|
this.title = title;
|
|
|
},
|
|
|
handleConfirm(slotContent) {
|
|
|
- console.log("确认按钮点击");
|
|
|
- console.log("插槽内容:", slotContent);
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
//分页数据切换
|
|
|
handleCurrentChange(val) {
|
|
|
this.formInline.pageNum = val;
|
|
|
- // this.getTableList();
|
|
|
+ this.getTableList();
|
|
|
},
|
|
|
- //修改状态
|
|
|
- setState(state, userId) {},
|
|
|
async getTableList() {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
- // const result = await getUserTableList({
|
|
|
- // ...this.formInline,
|
|
|
- // totalSize: undefined,
|
|
|
- // });
|
|
|
- // this.tableData = result.data.list;
|
|
|
- // this.formInline.totalSize = result.data.totalSize;
|
|
|
- // this.loading = false;
|
|
|
+ const result = await getAnalysisResultList({
|
|
|
+ ...this.formInline,
|
|
|
+ totalSize: undefined,
|
|
|
+ });
|
|
|
+ this.tableData = result.data.list;
|
|
|
+ this.formInline.totalSize = result.data.totalSize;
|
|
|
+ this.loading = false;
|
|
|
} catch (error) {
|
|
|
this.$message({
|
|
|
type: "error",
|
|
@@ -262,97 +243,6 @@ export default {
|
|
|
this.$refs[formName].resetFields();
|
|
|
this.getTableList();
|
|
|
},
|
|
|
-
|
|
|
- // 新增,编辑确定
|
|
|
- // submitForm(formName) {
|
|
|
- // this.$refs[formName].validate((valid) => {
|
|
|
- // if (valid) {
|
|
|
- // this.loadingView = true;
|
|
|
- // switch (this.title) {
|
|
|
- // case "新增":
|
|
|
- // addUser({ ...this.ruleForm, userId: undefined })
|
|
|
- // .then((res) => {
|
|
|
- // this.$message({
|
|
|
- // type: "success",
|
|
|
- // message: res.msg,
|
|
|
- // });
|
|
|
- // this.getTableList();
|
|
|
- // this.nuedialog = false;
|
|
|
- // this.loadingView = false;
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // this.loadingView = false;
|
|
|
- // });
|
|
|
-
|
|
|
- // break;
|
|
|
- // case "编辑":
|
|
|
- // editUser({ ...this.ruleForm })
|
|
|
- // .then((res) => {
|
|
|
- // this.$message({
|
|
|
- // type: "success",
|
|
|
- // message: res.msg,
|
|
|
- // });
|
|
|
- // this.getTableList();
|
|
|
- // this.nuedialog = false;
|
|
|
- // this.loadingView = false;
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // this.loadingView = false;
|
|
|
- // });
|
|
|
-
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // // this.nuedialog = false;
|
|
|
- // } else {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
- //点击取消
|
|
|
- // cancel(formName) {
|
|
|
- // this.$refs[formName] && this.$refs[formName].resetFields();
|
|
|
- // this.ruleForm = {
|
|
|
- // phone: null,
|
|
|
- // pwd: null,
|
|
|
- // roleId: null,
|
|
|
- // userName: null,
|
|
|
- // userId: null,
|
|
|
- // loginName: null,
|
|
|
- // };
|
|
|
- // this.nuedialog = false;
|
|
|
- // this.loadingView = false;
|
|
|
- // },
|
|
|
- // 编辑 回显数据
|
|
|
- async compile(row) {
|
|
|
- try {
|
|
|
- // const result = await getUserInfoByUserId({ userId: row.userId });
|
|
|
- const userInfo = result.data;
|
|
|
- // 直接替换整个对象,以确保 Vue 的响应式系统能够检测到变化
|
|
|
- this.ruleForm = {
|
|
|
- phone: userInfo.userPhone,
|
|
|
- pwd: undefined, // 如果需要重置密码字段
|
|
|
- roleId: userInfo.roleId.toString(),
|
|
|
- userName: userInfo.userName,
|
|
|
- userId: userInfo.userId, // 如果需要用户ID
|
|
|
- loginName: userInfo.loginName,
|
|
|
- };
|
|
|
- this.nuedialog = true;
|
|
|
- this.title = "编辑";
|
|
|
- } catch (error) {
|
|
|
- this.$message.error("获取用户信息失败");
|
|
|
- }
|
|
|
- },
|
|
|
- // 新增
|
|
|
- newnuedialog() {
|
|
|
- this.cancel("addUserForm");
|
|
|
- this.ruleForm = {
|
|
|
- loginName: "",
|
|
|
- pwd: "",
|
|
|
- userName: "",
|
|
|
- };
|
|
|
- this.nuedialog = true;
|
|
|
- this.title = "新增";
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|