提交 b4a716f1 authored 作者: 林国禄's avatar 林国禄

更新项目

上级 4c4e534c
import request from '@/utils/request'
// 查询地图区间设置列表
export function listInterval(query) {
return request({
url: '/backstage/interval/list',
method: 'get',
params: query
})
}
// 查询地图区间设置详细
export function getInterval(id) {
return request({
url: '/backstage/interval/' + id,
method: 'get'
})
}
// 新增地图区间设置
export function addInterval(data) {
return request({
url: '/backstage/interval',
method: 'post',
data: data
})
}
// 修改地图区间设置
export function updateInterval(data) {
return request({
url: '/backstage/interval',
method: 'put',
data: data
})
}
// 删除地图区间设置
export function delInterval(id) {
return request({
url: '/backstage/interval/' + id,
method: 'delete'
})
}
// 导出地图区间设置
export function exportInterval(query) {
return request({
url: '/backstage/interval/export',
method: 'get',
params: query
})
}
\ No newline at end of file
import request from '@/utils/request'
// 查询原因库列表
export function listReason(query) {
return request({
url: '/backstage/reason/list',
method: 'get',
params: query
})
}
// 查询原因库详细
export function getReason(id) {
return request({
url: '/backstage/reason/' + id,
method: 'get'
})
}
// 新增原因库
export function addReason(data) {
return request({
url: '/backstage/reason',
method: 'post',
data: data
})
}
// 修改原因库
export function updateReason(data) {
return request({
url: '/backstage/reason',
method: 'put',
data: data
})
}
// 删除原因库
export function delReason(id) {
return request({
url: '/backstage/reason/' + id,
method: 'delete'
})
}
// 导出原因库
export function exportReason(query) {
return request({
url: '/backstage/reason/export',
method: 'get',
params: query
})
}
\ No newline at end of file
差异被折叠。
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="原因" prop="reasonContent">
<el-input
v-model="queryParams.reasonContent"
placeholder="请输入原因"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['backstage:reason:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['backstage:reason:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['backstage:reason:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['backstage:reason:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="reasonList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="原因" align="center" prop="reasonContent" />
<el-table-column label="次数" align="center" prop="count" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['backstage:reason:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['backstage:reason: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-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="原因" prop="reasonContent">
<el-input v-model="form.reasonContent" placeholder="请输入原因" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="repeatSubmit">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listReason, getReason, delReason, addReason, updateReason, exportReason } from "@/api/backstage/reason";
import Editor from '@/components/Editor';
export default {
name: "Reason",
components: { Editor },
data() {
return {
// 不可重复提交
repeatSubmit: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 原因库表格数据
reasonList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
reasonContent: null,
count: null,
status: null
},
// 表单参数
form: {},
// 表单校验
rules: {
reasonContent: [
{ required: true, trigger: "blur", message: "原因不能为空" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询原因库列表 */
getList() {
this.loading = true;
listReason(this.queryParams).then(response => {
this.reasonList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
reasonContent: null,
count: null,
createTime: null,
updateTime: null,
createBy: null,
updateBy: null,
status: "1"
};
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
getReason(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改原因库";
});
},
/** 提交按钮 */
submitForm() {
this.repeatSubmit=true
setTimeout(()=>{
this.repeatSubmit = false //点击一次时隔两秒后才能再次点击
},2000)
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateReason(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addReason(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除原因库编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delReason(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有原因库数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportReason(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>
<template>
<div class="dashboard-editor-container">
<!-- <div class="dashboard-editor-container">-->
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<div>
<H5 style="font-size: 50px;text-align: center;background-color: #97a8be;margin-top: 300px">欢迎登录社调管理系统</H5>
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" />
</el-row>
<!-- <panel-group @handleSetLineChartData="handleSetLineChartData" />-->
<!-- <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">-->
<!-- <line-chart :chart-data="lineChartData" />-->
<!-- </el-row>-->
<!-- <el-row :gutter="32">-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <raddar-chart />-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <pie-chart />-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <bar-chart />-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<raddar-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<bar-chart />
</div>
</el-col>
</el-row>
</div>
</template>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论