|
@@ -2,34 +2,16 @@
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form-item label="部件名称" prop="unitName">
|
|
<el-form-item label="部件名称" prop="unitName">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.unitName"
|
|
|
|
- placeholder="请输入部件名称"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-input v-model="queryParams.unitName" placeholder="请输入部件名称" clearable @keyup.enter.native="handleQuery" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="研究对象" prop="studyObject">
|
|
<el-form-item label="研究对象" prop="studyObject">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.studyObject"
|
|
|
|
- placeholder="请输入研究对象"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-input v-model="queryParams.studyObject" placeholder="请输入研究对象" clearable @keyup.enter.native="handleQuery" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="SNS 编码" prop="snsCode">
|
|
<el-form-item label="SNS 编码" prop="snsCode">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.snsCode"
|
|
|
|
- placeholder="请输入SNS 编码"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-input v-model="queryParams.snsCode" placeholder="请输入SNS 编码" clearable @keyup.enter.native="handleQuery" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="分析时间" prop="analysisTime">
|
|
<el-form-item label="分析时间" prop="analysisTime">
|
|
- <el-date-picker clearable
|
|
|
|
- v-model="queryParams.analysisTime"
|
|
|
|
- type="date"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
|
|
+ <el-date-picker clearable v-model="queryParams.analysisTime" type="date" value-format="yyyy-MM-dd"
|
|
placeholder="请选择分析时间">
|
|
placeholder="请选择分析时间">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -41,63 +23,37 @@
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleAdd"
|
|
|
|
- v-hasPermi="['manage:forecastResult:add']"
|
|
|
|
- >新增</el-button>
|
|
|
|
|
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
|
|
|
+ v-hasPermi="['manage:forecastResult:add']">新增</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-button
|
|
|
|
- type="success"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="single"
|
|
|
|
- @click="handleUpdate"
|
|
|
|
- v-hasPermi="['manage:forecastResult:edit']"
|
|
|
|
- >修改</el-button>
|
|
|
|
|
|
+ <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
|
|
|
+ v-hasPermi="['manage:forecastResult:edit']">修改</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-button
|
|
|
|
- type="danger"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="multiple"
|
|
|
|
- @click="handleDelete"
|
|
|
|
- v-hasPermi="['manage:forecastResult:remove']"
|
|
|
|
- >删除</el-button>
|
|
|
|
|
|
+ <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
|
|
|
+ v-hasPermi="['manage:forecastResult:remove']">删除</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-button
|
|
|
|
- type="warning"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-download"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleExport"
|
|
|
|
- v-hasPermi="['manage:forecastResult:export']"
|
|
|
|
- >导出</el-button>
|
|
|
|
|
|
+ <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
|
|
+ v-hasPermi="['manage:forecastResult:export']">导出</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="forecastResultList" @selection-change="handleSelectionChange">
|
|
|
|
|
|
+ <el-table v-loading="loading" :data="forecastResultList" @selection-change="handleSelectionChange"
|
|
|
|
+ height="calc(100vh - 277px)">
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
-
|
|
|
|
- <el-table-column label="部件名称" align="center" prop="unitName" />
|
|
|
|
|
|
+ <el-table-column fixed label="部件名称" align="center" prop="unitName" />
|
|
<el-table-column label="研究对象" align="center" prop="studyObject" />
|
|
<el-table-column label="研究对象" align="center" prop="studyObject" />
|
|
<el-table-column label="SNS 编码" align="center" prop="snsCode" />
|
|
<el-table-column label="SNS 编码" align="center" prop="snsCode" />
|
|
- <el-table-column label="预测故障" align="center" prop="forecastFault" />
|
|
|
|
|
|
+ <el-table-column label="预测故障" align="center" prop="forecastFault" width="280" />
|
|
<el-table-column label="分析时间" align="center" prop="analysisTime" width="180">
|
|
<el-table-column label="分析时间" align="center" prop="analysisTime" width="180">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ parseTime(scope.row.analysisTime, '{y}-{m}-{d}') }}</span>
|
|
<span>{{ parseTime(scope.row.analysisTime, '{y}-{m}-{d}') }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="批注注解" align="center" prop="comment" />
|
|
|
|
|
|
+ <el-table-column label="批注注解" align="center" prop="comment" width="280" />
|
|
<el-table-column label="创建人" align="center" prop="createBy" />
|
|
<el-table-column label="创建人" align="center" prop="createBy" />
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -110,33 +66,18 @@
|
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
|
+ <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
|
- v-hasPermi="['manage:forecastResult:edit']"
|
|
|
|
- >修改</el-button>
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
|
- v-hasPermi="['manage:forecastResult:remove']"
|
|
|
|
- >删除</el-button>
|
|
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
|
+ v-hasPermi="['manage:forecastResult:edit']">修改</el-button>
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
|
+ v-hasPermi="['manage:forecastResult:remove']">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
-
|
|
|
|
- <pagination
|
|
|
|
- v-show="total>0"
|
|
|
|
- :total="total"
|
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
|
- @pagination="getList"
|
|
|
|
- />
|
|
|
|
|
|
+
|
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
|
+ @pagination="getList" />
|
|
|
|
|
|
<!-- 添加或修改预测结果对话框 -->
|
|
<!-- 添加或修改预测结果对话框 -->
|
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
|
|
@@ -154,10 +95,7 @@
|
|
<el-input v-model="form.forecastFault" type="textarea" placeholder="请输入内容" />
|
|
<el-input v-model="form.forecastFault" type="textarea" placeholder="请输入内容" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="分析时间" prop="analysisTime">
|
|
<el-form-item label="分析时间" prop="analysisTime">
|
|
- <el-date-picker clearable
|
|
|
|
- v-model="form.analysisTime"
|
|
|
|
- type="date"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
|
|
+ <el-date-picker clearable v-model="form.analysisTime" type="date" value-format="yyyy-MM-dd"
|
|
placeholder="请选择分析时间">
|
|
placeholder="请选择分析时间">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -174,10 +112,16 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { listForecastResult, getForecastResult, delForecastResult, addForecastResult, updateForecastResult } from "@/api/manage/forecastResult";
|
|
|
|
|
|
+import {
|
|
|
|
+ listForecastResult,
|
|
|
|
+ getForecastResult,
|
|
|
|
+ delForecastResult,
|
|
|
|
+ addForecastResult,
|
|
|
|
+ updateForecastResult,
|
|
|
|
+} from '@/api/manage/forecastResult'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: "ForecastResult",
|
|
|
|
|
|
+ name: 'ForecastResult',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
// 遮罩层
|
|
// 遮罩层
|
|
@@ -195,7 +139,7 @@ export default {
|
|
// 预测结果表格数据
|
|
// 预测结果表格数据
|
|
forecastResultList: [],
|
|
forecastResultList: [],
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
- title: "",
|
|
|
|
|
|
+ title: '',
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
open: false,
|
|
open: false,
|
|
// 查询参数
|
|
// 查询参数
|
|
@@ -211,27 +155,26 @@ export default {
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
- rules: {
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
|
|
+ rules: {},
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.getList();
|
|
|
|
|
|
+ this.getList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
/** 查询预测结果列表 */
|
|
/** 查询预测结果列表 */
|
|
getList() {
|
|
getList() {
|
|
- this.loading = true;
|
|
|
|
|
|
+ this.loading = true
|
|
listForecastResult(this.queryParams).then(response => {
|
|
listForecastResult(this.queryParams).then(response => {
|
|
- this.forecastResultList = response.rows;
|
|
|
|
- this.total = response.total;
|
|
|
|
- this.loading = false;
|
|
|
|
- });
|
|
|
|
|
|
+ this.forecastResultList = response.rows
|
|
|
|
+ this.total = response.total
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 取消按钮
|
|
// 取消按钮
|
|
cancel() {
|
|
cancel() {
|
|
- this.open = false;
|
|
|
|
- this.reset();
|
|
|
|
|
|
+ this.open = false
|
|
|
|
+ this.reset()
|
|
},
|
|
},
|
|
// 表单重置
|
|
// 表单重置
|
|
reset() {
|
|
reset() {
|
|
@@ -247,78 +190,93 @@ export default {
|
|
createBy: null,
|
|
createBy: null,
|
|
createTime: null,
|
|
createTime: null,
|
|
updateBy: null,
|
|
updateBy: null,
|
|
- updateTime: null
|
|
|
|
- };
|
|
|
|
- this.resetForm("form");
|
|
|
|
|
|
+ updateTime: null,
|
|
|
|
+ }
|
|
|
|
+ this.resetForm('form')
|
|
},
|
|
},
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
handleQuery() {
|
|
- this.queryParams.pageNum = 1;
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
|
+ this.getList()
|
|
},
|
|
},
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
resetQuery() {
|
|
- this.resetForm("queryForm");
|
|
|
|
- this.handleQuery();
|
|
|
|
|
|
+ this.resetForm('queryForm')
|
|
|
|
+ this.handleQuery()
|
|
},
|
|
},
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
this.ids = selection.map(item => item.id)
|
|
this.ids = selection.map(item => item.id)
|
|
- this.single = selection.length!==1
|
|
|
|
|
|
+ this.single = selection.length !== 1
|
|
this.multiple = !selection.length
|
|
this.multiple = !selection.length
|
|
},
|
|
},
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
- this.reset();
|
|
|
|
- this.open = true;
|
|
|
|
- this.title = "添加预测结果";
|
|
|
|
|
|
+ this.reset()
|
|
|
|
+ this.open = true
|
|
|
|
+ this.title = '添加预测结果'
|
|
},
|
|
},
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
- this.reset();
|
|
|
|
|
|
+ this.reset()
|
|
const id = row.id || this.ids
|
|
const id = row.id || this.ids
|
|
getForecastResult(id).then(response => {
|
|
getForecastResult(id).then(response => {
|
|
- this.form = response.data;
|
|
|
|
- this.open = true;
|
|
|
|
- this.title = "修改预测结果";
|
|
|
|
- });
|
|
|
|
|
|
+ this.form = response.data
|
|
|
|
+ this.open = true
|
|
|
|
+ this.title = '修改预测结果'
|
|
|
|
+ })
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
submitForm() {
|
|
- this.$refs["form"].validate(valid => {
|
|
|
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
if (this.form.id != null) {
|
|
|
|
+ this.form.updateBy = this.$store.state.user.name
|
|
updateForecastResult(this.form).then(response => {
|
|
updateForecastResult(this.form).then(response => {
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
|
- this.open = false;
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
|
|
+ this.$modal.msgSuccess('修改成功')
|
|
|
|
+ this.open = false
|
|
|
|
+ this.getList()
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
|
|
+ this.form.createBy = this.$store.state.user.name
|
|
addForecastResult(this.form).then(response => {
|
|
addForecastResult(this.form).then(response => {
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
|
- this.open = false;
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
|
+ this.open = false
|
|
|
|
+ this.getList()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
- const ids = row.id || this.ids;
|
|
|
|
- this.$modal.confirm('是否确认删除预测结果编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
- return delForecastResult(ids);
|
|
|
|
- }).then(() => {
|
|
|
|
- this.getList();
|
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
- }).catch(() => {});
|
|
|
|
|
|
+ const ids = row.id || this.ids
|
|
|
|
+ this.$modal
|
|
|
|
+ .confirm('是否确认删除预测结果编号为"' + ids + '"的数据项?')
|
|
|
|
+ .then(function () {
|
|
|
|
+ return delForecastResult(ids)
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.getList()
|
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {})
|
|
},
|
|
},
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
handleExport() {
|
|
- this.download('manage/forecastResult/export', {
|
|
|
|
- ...this.queryParams
|
|
|
|
- }, `forecastResult_${new Date().getTime()}.xlsx`)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
+ this.download(
|
|
|
|
+ 'manage/forecastResult/export',
|
|
|
|
+ {
|
|
|
|
+ ...this.queryParams,
|
|
|
|
+ },
|
|
|
|
+ `forecastResult_${new Date().getTime()}.xlsx`
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
+<style scoped>
|
|
|
|
+/* .el-table{
|
|
|
|
+ height: calc(100vh - 277px);
|
|
|
|
+} */
|
|
|
|
+</style>
|