|
@@ -0,0 +1,348 @@
|
|
|
+<template>
|
|
|
+ <div class="page-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px" class="search-form_container">
|
|
|
+ <el-form-item label="预测时间" prop="daterange">
|
|
|
+ <el-date-picker
|
|
|
+ :editable="false"
|
|
|
+ value-format="YYYY/MM/DD HH:mm:ss"
|
|
|
+ v-model="queryParams.daterange"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="To"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="预测类型" prop="category">
|
|
|
+ <el-select v-model="queryParams.category">
|
|
|
+ <el-option value="" label="全部"></el-option>
|
|
|
+ <el-option
|
|
|
+ :key="item"
|
|
|
+ :value="item"
|
|
|
+ :label="item"
|
|
|
+ v-for="item in category"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="search" size="small" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="refresh" size="small" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-card shadow="never" body-class="card-table_container">
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="download"
|
|
|
+ size="small"
|
|
|
+ @click="handleExport"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar @update:showSearch="(v) => showSearch = v" @queryTable="getList" :showSearch="showSearch"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="comparisonList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="时间" align="center" prop="remark" />
|
|
|
+ <el-table-column label="预测类型" align="center" prop="category" />
|
|
|
+ <el-table-column label="预测时间1" align="center" prop="forecastTimeOne" />
|
|
|
+ <el-table-column label="实际值1" align="center" prop="realOne" />
|
|
|
+ <el-table-column label="红杉预测值1" align="center" prop="hsForecastOne" />
|
|
|
+ <el-table-column label="红杉值1误差率" align="center" prop="hsErrorRateOne" />
|
|
|
+ <el-table-column label="跃渊预测值1" align="center" prop="yyForecastOne" />
|
|
|
+ <el-table-column label="跃渊值1误差率" align="center" prop="yyErrorRateOne" />
|
|
|
+ <el-table-column label="预测时间2" align="center" prop="forecastTimeTwo" />
|
|
|
+ <el-table-column label="实际值2" align="center" prop="realTwo" />
|
|
|
+ <el-table-column label="红杉预测值2" align="center" prop="hsForecastTwo" />
|
|
|
+ <el-table-column label="红杉值2误差率" align="center" prop="hsErrorRateTwo" />
|
|
|
+ <el-table-column label="跃渊预测值2" align="center" prop="yyForecastTwo" />
|
|
|
+ <el-table-column label="跃渊值2误差率" align="center" prop="yyErrorRateTwo" />
|
|
|
+ <el-table-column label="预测时间3" align="center" prop="forecastTimeThree" />
|
|
|
+ <el-table-column label="实际值3" align="center" prop="realThree" />
|
|
|
+ <el-table-column label="红杉预测值3" align="center" prop="hsForecastThree" />
|
|
|
+ <el-table-column label="红杉值3误差率" align="center" prop="hsErrorRateThree" />
|
|
|
+ <el-table-column label="跃渊预测值3" align="center" prop="yyForecastThree" />
|
|
|
+ <el-table-column label="跃渊值3误差率" align="center" prop="yyErrorRateThree" />
|
|
|
+ <el-table-column label="乐观锁" align="center" prop="revision" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" />
|
|
|
+ <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ text
|
|
|
+ icon="edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['business:comparison:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ text
|
|
|
+ icon="delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['business:comparison:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ </el-card>
|
|
|
+ <!-- 添加或修改信义预测对比对话框 -->
|
|
|
+ <el-dialog :title="title" v-model="open" width="900px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+ <el-form-item label="预测类型" prop="category">
|
|
|
+ <el-input v-model="form.category" placeholder="请输入预测类型" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="预测时间1" prop="forecastTimeOne">
|
|
|
+ <el-input v-model="form.forecastTimeOne" placeholder="请输入预测时间1" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="实际值1" prop="realOne">
|
|
|
+ <el-input v-model="form.realOne" placeholder="请输入实际值1" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="红杉预测值1" prop="hsForecastOne">
|
|
|
+ <el-input v-model="form.hsForecastOne" placeholder="请输入红杉预测值1" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="红杉值1误差率" prop="hsErrorRateOne">
|
|
|
+ <el-input v-model="form.hsErrorRateOne" placeholder="请输入红杉值1误差率" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跃渊预测值1" prop="yyForecastOne">
|
|
|
+ <el-input v-model="form.yyForecastOne" placeholder="请输入跃渊预测值1" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跃渊值1误差率" prop="yyErrorRateOne">
|
|
|
+ <el-input v-model="form.yyErrorRateOne" placeholder="请输入跃渊值1误差率" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="预测时间2" prop="forecastTimeTwo">
|
|
|
+ <el-input v-model="form.forecastTimeTwo" placeholder="请输入预测时间2" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="实际值2" prop="realTwo">
|
|
|
+ <el-input v-model="form.realTwo" placeholder="请输入实际值2" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="红杉预测值2" prop="hsForecastTwo">
|
|
|
+ <el-input v-model="form.hsForecastTwo" placeholder="请输入红杉预测值2" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="红杉值2误差率" prop="hsErrorRateTwo">
|
|
|
+ <el-input v-model="form.hsErrorRateTwo" placeholder="请输入红杉值2误差率" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跃渊预测值2" prop="yyForecastTwo">
|
|
|
+ <el-input v-model="form.yyForecastTwo" placeholder="请输入跃渊预测值2" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跃渊值2误差率" prop="yyErrorRateTwo">
|
|
|
+ <el-input v-model="form.yyErrorRateTwo" placeholder="请输入跃渊值2误差率" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="预测时间3" prop="forecastTimeThree">
|
|
|
+ <el-input v-model="form.forecastTimeThree" placeholder="请输入预测时间3" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="实际值3" prop="realThree">
|
|
|
+ <el-input v-model="form.realThree" placeholder="请输入实际值3" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="红杉预测值3" prop="hsForecastThree">
|
|
|
+ <el-input v-model="form.hsForecastThree" placeholder="请输入红杉预测值3" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="红杉值3误差率" prop="hsErrorRateThree">
|
|
|
+ <el-input v-model="form.hsErrorRateThree" placeholder="请输入红杉值3误差率" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跃渊预测值3" prop="yyForecastThree">
|
|
|
+ <el-input v-model="form.yyForecastThree" placeholder="请输入跃渊预测值3" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跃渊值3误差率" prop="yyErrorRateThree">
|
|
|
+ <el-input v-model="form.yyErrorRateThree" placeholder="请输入跃渊值3误差率" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="删除标志" prop="delFlag">
|
|
|
+ <el-input v-model="form.delFlag" placeholder="请输入删除标志" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="乐观锁" prop="revision">
|
|
|
+ <el-input v-model="form.revision" placeholder="请输入乐观锁" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { listComparison, getComparison, delComparison, addComparison, updateComparison } from "@/api/business/comparison";
|
|
|
+import dayjs from "dayjs";
|
|
|
+export default {
|
|
|
+ name: "Comparison",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 信义预测对比表格数据
|
|
|
+ comparisonList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 预测类型
|
|
|
+ category: ['cod', 'ss', 'tn', 'tp', 'nh3'],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ daterange: [],
|
|
|
+ category: null,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询信义预测对比列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ const [ begin, end ] = this.queryParams.daterange || [];
|
|
|
+ let timeBegin = '';
|
|
|
+ let timeEnd = '';
|
|
|
+ console.log( begin, end );
|
|
|
+ if ( begin ) {
|
|
|
+ timeBegin = dayjs(begin).format('YYYY/MM/DD H');
|
|
|
+ timeEnd = dayjs(end).format('YYYY/MM/DD H');
|
|
|
+ }
|
|
|
+ const params = { ...this.queryParams, timeBegin, timeEnd };
|
|
|
+ delete params.daterange;
|
|
|
+ listComparison(params).then(response => {
|
|
|
+ this.comparisonList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ category: null,
|
|
|
+ forecastTimeOne: null,
|
|
|
+ realOne: null,
|
|
|
+ hsForecastOne: null,
|
|
|
+ hsErrorRateOne: null,
|
|
|
+ yyForecastOne: null,
|
|
|
+ yyErrorRateOne: null,
|
|
|
+ forecastTimeTwo: null,
|
|
|
+ realTwo: null,
|
|
|
+ hsForecastTwo: null,
|
|
|
+ hsErrorRateTwo: null,
|
|
|
+ yyForecastTwo: null,
|
|
|
+ yyErrorRateTwo: null,
|
|
|
+ forecastTimeThree: null,
|
|
|
+ realThree: null,
|
|
|
+ hsForecastThree: null,
|
|
|
+ hsErrorRateThree: null,
|
|
|
+ yyForecastThree: null,
|
|
|
+ yyErrorRateThree: null,
|
|
|
+ delFlag: null,
|
|
|
+ revision: null,
|
|
|
+ createBy: null,
|
|
|
+ createTime: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ remark: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length!==1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加信义预测对比";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getComparison(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改信义预测对比";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateComparison(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addComparison(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除信义预测对比编号为"' + ids + '"的数据项?').then(function() {
|
|
|
+ return delComparison(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('business/comparison/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `comparison_${new Date().getTime()}.xlsx`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|