Commit e9c5a534 authored by “yiyousong”'s avatar “yiyousong”

feat:新增报表配置

parent 82b85ea9
<template>
<div>
<a-drawer
title="报表管理"
:visible="Visible"
@close="onClose"
:maskClosable="false"
:destroyOnClose="true"
width="850"
>
<div class="search-box flex aic jcb mb20">
<div>
<a-space>
<a-button type="primary" @click="handleAdd"> 新增 </a-button>
<a-button type="danger" @click="handleDelAll"> 批量删除 </a-button>
</a-space>
</div>
<a-input-search
style="width: 300px"
placeholder="请输入报表名称搜索"
enter-button="搜索"
v-model="censusName"
allowClear
@search="onSearch"
/>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:loading="loading"
bordered
:scroll="{ y: 460 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 统计类型 -->
<template slot="censusType" slot-scope="text">
{{ filterDict(text.censusType) }}
</template>
<!-- 是否开放 -->
<template slot="status" slot-scope="text">
<a-tag color="blue" v-if="text.status === 1"></a-tag>
<a-tag color="red" v-else></a-tag>
</template>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space>
<a href="javascript:;" class="edit" @click="handleEdit(text)"
>编辑</a
>
<a href="javascript:;" class="delete" @click="handleDel(text.id)"
>删除</a
>
</a-space>
</template>
</a-table>
</div>
<!-- 新增报表 -->
<AddStatement
:addStatementVisile.sync="addStatementVisile"
:title="title"
:dict="dict"
ref="AddStatement"
@addSuccess="getStatementList"
></AddStatement>
</a-drawer>
</div>
</template>
<script>
import { getStatementList, delStatement } from "@/services/basicsetFun";
import AddStatement from "../modal/AddStatement.vue";
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "报表名称",
dataIndex: "censusName",
},
{
title: "统计类型",
scopedSlots: { customRender: "censusType" },
},
{
title: "访问路由",
dataIndex: "censusUrl",
},
{
title: "是否开放",
scopedSlots: { customRender: "status" },
},
{
title: "操作",
width: "100px",
scopedSlots: { customRender: "action" },
},
];
export default {
props: {
StatementVisible: {
type: Boolean,
require: true,
default: false,
},
},
components: {
AddStatement,
},
data() {
return {
columns,
modelInfo: {}, // 模块信息
loading: false,
total: 0,
size: 10,
current: 1,
pageSizeOptions: ["10", "30", "50", "100"],
selectedRowKeys: [],
tableData: [],
addStatementVisile: false,
title: "新增",
censusName: "",
dict: {}, // 字典
};
},
computed: {
Visible: {
get() {
return this.StatementVisible;
},
set(val) {
this.$emit("update:StatementVisible", val);
},
},
},
methods: {
// 获取模块信息
getModelInfo(modelInfo) {
this.modelInfo = modelInfo;
this.getStatementList();
},
// 获取报表列表
async getStatementList() {
this.loading = true;
let res = await getStatementList({
page: this.current,
size: this.size,
modelId: this.modelInfo.id,
censusName: `%${this.censusName}%`,
});
let { code, dict, data } = res.data;
this.dict = dict;
this.loading = false;
if (code == 1) {
if (!data.length && this.current > 1) {
this.current -= 1;
this.getStatementList();
}
this.tableData = data.data;
}
},
handleAdd() {
this.title = "新增报表";
this.addStatementVisile = true;
this.$refs.AddStatement.onAdd(this.modelInfo);
},
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 关闭抽屉
onClose() {
this.censusName = "";
this.selectedRowKeys = [];
this.Visible = false;
},
// 搜索
onSearch() {
this.current = 1;
this.getStatementList();
},
// 编辑
handleEdit(row) {
this.title = "编辑报表";
this.addStatementVisile = true;
this.$refs.AddStatement.onEdit(row, this.modelInfo);
},
// 翻页
handleChange(cur) {
this.current = cur;
this.getStatementList();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
this.getStatementList();
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delStatement({ id });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getStatementList();
}
},
});
},
// 选中
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 过滤列表数据
filterDict(dict) {
let str = "";
Object.keys(this.dict.censusType).forEach((keys) => {
if (dict == keys) {
str = this.dict.censusType[keys];
}
});
return str;
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
...@@ -77,12 +77,20 @@ ...@@ -77,12 +77,20 @@
</template> </template>
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="text"> <template slot="action" slot-scope="text">
<a-space>
<a
href="javascript:;"
class="primary"
@click="statementManage(text)"
>配置报表</a
>
<a href="javascript:;" class="edit" @click="handleEdit(text)" <a href="javascript:;" class="edit" @click="handleEdit(text)"
>编辑</a >编辑</a
> >
<a href="javascript:;" class="delete" @click="handleDel(text.id)" <a href="javascript:;" class="delete" @click="handleDel(text.id)"
>删除</a >删除</a
> >
</a-space>
</template> </template>
</a-table> </a-table>
</div> </div>
...@@ -212,12 +220,18 @@ ...@@ -212,12 +220,18 @@
:previewVisible.sync="previewVisible" :previewVisible.sync="previewVisible"
></PrevieModal> ></PrevieModal>
</a-modal> </a-modal>
<!-- 表别管理 -->
<StatementManage
ref="StatementManage"
:StatementVisible.sync="StatementVisible"
></StatementManage>
</div> </div>
</template> </template>
<script> <script>
import { modelList, addMode, delMode } from "@/services/basicsetFun"; import { modelList, addMode, delMode } from "@/services/basicsetFun";
import PrevieModal from "@/components/PrevieModal.vue"; import PrevieModal from "@/components/PrevieModal.vue";
import StatementManage from "./components/StatementManage.vue";
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
...@@ -262,13 +276,14 @@ const columns = [ ...@@ -262,13 +276,14 @@ const columns = [
}, },
{ {
title: "操作", title: "操作",
width: "120px", width: "180px",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
}, },
]; ];
export default { export default {
components: { components: {
PrevieModal, PrevieModal,
StatementManage,
}, },
data() { data() {
return { return {
...@@ -311,6 +326,8 @@ export default { ...@@ -311,6 +326,8 @@ export default {
{ required: true, message: "模块图标不能为空", trigger: "change" }, { required: true, message: "模块图标不能为空", trigger: "change" },
], ],
}, },
StatementVisible: false,
modelInfo: {},
}; };
}, },
created() { created() {
...@@ -485,6 +502,14 @@ export default { ...@@ -485,6 +502,14 @@ export default {
// return false; // return false;
// } // }
// }, // },
statementManage(row) {
let obj = {
id: row.id,
modelName: row.modelName,
};
this.StatementVisible = true;
this.$refs.StatementManage.getModelInfo(obj);
},
}, },
}; };
</script> </script>
...@@ -508,7 +533,6 @@ export default { ...@@ -508,7 +533,6 @@ export default {
// } // }
.edit { .edit {
color: #03d76f; color: #03d76f;
margin-right: 15px;
} }
.delete { .delete {
color: #f94545; color: #f94545;
......
<template>
<div>
<a-modal
v-model="Visible"
:maskClosable="false"
:title="title"
@cancel="handleClose"
:zIndex="1001"
destroyOnClose
>
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
<a-form-model
ref="ruleForm"
:model="formData"
:rules="rules"
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<a-form-model-item label="所属模块">
<a-input disabled :value="modelInfo.modelName" />
</a-form-model-item>
<a-form-model-item label="报表名称" prop="censusName">
<a-input v-model="formData.censusName" placeholder="请输入报表名称" />
</a-form-model-item>
<a-form-model-item label="报表路由" prop="censusUrl">
<a-input
v-model="formData.censusUrl"
placeholder="请输入报表访问路由"
/>
</a-form-model-item>
<a-form-model-item label="统计类型" prop="censusType">
<a-select v-model="formData.censusType" placeholder="请选择统计类型">
<a-select-option
v-for="(v, key) in dict.censusType"
:key="key"
:value="Number(key)"
>
{{ v }}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="是否开放" prop="status">
<YSwitch v-model="formData.status"></YSwitch>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { addStatement } from "@/services/basicsetFun";
import YSwitch from "@/components/yswitch/YSwitch.vue";
export default {
props: {
title: {
require: true,
type: String,
default: "",
},
addStatementVisile: {
type: Boolean,
require: true,
default: false,
},
dict: {
type: Object,
require: true,
default: () => {
return {};
},
},
},
components: {
YSwitch,
},
data() {
return {
modelInfo: {},
formData: {
modelId: "", // 模块id
censusName: "", // 报表名称
censusUrl: "", // 报表访问路由
censusType: undefined, // 统计类型
status: 1, // 状态(0:为开通,1:开通)
},
rules: {
censusName: [
{ required: true, message: "请输入报表名称", trigger: "blur" },
],
censusUrl: [
{ required: true, message: "请输入报表访问路由", trigger: "blur" },
],
censusType: [
{ required: true, message: "请选择统计类型", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.addStatementVisile;
},
set(val) {
this.$emit("update:addStatementVisile", val);
},
},
},
methods: {
// 新增
onAdd(modelInfo) {
Object.assign(this.formData, this.$options.data().formData);
this.formData.id && this.$delete(this.formData, "id");
this.modelInfo = modelInfo;
this.formData.modelId = modelInfo.id;
},
// 编辑
onEdit(data, modelInfo) {
this.modelInfo = modelInfo;
this.formData = { ...data };
},
// 关闭弹窗
handleClose() {
this.$refs.ruleForm.resetFields();
this.Visible = false;
},
// 保存
handleOk() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
let res = await addStatement(this.formData);
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleClose();
}
}
});
},
// 重置
handleReset() {
this.$refs.ruleForm.resetFields();
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
...@@ -17,6 +17,9 @@ module.exports = { ...@@ -17,6 +17,9 @@ module.exports = {
info: `${BASE_URL}/base/model/info`, info: `${BASE_URL}/base/model/info`,
save: `${BASE_URL}/base/model/save`, save: `${BASE_URL}/base/model/save`,
delete: `${BASE_URL}/base/model/delete`, delete: `${BASE_URL}/base/model/delete`,
saveStatement: `${BASE_URL}/base/model/census/save`,
statementList: `${BASE_URL}/base/model/census/list`,
delStatement: `${BASE_URL}/base/model/census/delete`,
}, },
// 区域 // 区域
area: { area: {
......
...@@ -59,3 +59,15 @@ export async function addMode(data) { ...@@ -59,3 +59,15 @@ export async function addMode(data) {
export async function delMode(data) { export async function delMode(data) {
return request(model.delete, METHOD.GET, data); return request(model.delete, METHOD.GET, data);
} }
// 保存模块报表
export async function addStatement(data) {
return request(model.saveStatement, METHOD.POST, data);
}
// 模块报表列表
export async function getStatementList(data) {
return request(model.statementList, METHOD.POST, data);
}
// 删除报表
export async function delStatement(data) {
return request(model.delStatement, METHOD.GET, data);
}
...@@ -55,26 +55,6 @@ ...@@ -55,26 +55,6 @@
{{ itm.censusName }} {{ itm.censusName }}
</li> </li>
</template> </template>
<li class="content_list" @click="pushRouter1">易政秀报表</li>
<li class="content_list" @click="pushRouter2">排队叫号报表</li>
<li class="content_list" @click="pushRouter3">预约记录报表</li>
<li class="content_list" @click="pushRouter4">服务类数据分析</li>
<li class="content_list" @click="pushRouter5">
无感一码通实时数据报表
</li>
<li class="content_list" @click="pushRouter6">
AI效能监察异常行为数据报表
</li>
<li class="content_list" @click="pushRouter7">
智能边缘物联网异常告警报表
</li>
<li class="content_list" @click="pushRouter8">取件记录报表</li>
<li class="content_list" @click="pushRouter9">短信记录报表</li>
<li class="content_list" @click="pushRouter10">评价记录报表</li>
<li class="content_list" @click="pushRouter11">样表记录报表</li>
<li class="content_list" @click="pushRouter12">填单记录样表</li>
<li class="content_list" @click="pushRouter13">微官网注册报表</li>
<li class="content_list" @click="pushRouter14">网络理政报表</li>
</ul> </ul>
<p class="bottom">协同类数据分析<a-icon type="swap-right" /></p> <p class="bottom">协同类数据分析<a-icon type="swap-right" /></p>
</li> </li>
...@@ -197,99 +177,93 @@ export default { ...@@ -197,99 +177,93 @@ export default {
if (CensusType_5 && CensusType_5.length) this.CensusType_5 = CensusType_5; if (CensusType_5 && CensusType_5.length) this.CensusType_5 = CensusType_5;
}, },
// 查看数据 // 查看数据
handleCkeck(url) { handleCkeck(path) {
let a = document.createElement("a"); this.$router.push(path);
a.style.display = "none";
a.href = url;
a.target = "_blank";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
},
pushRouter1() {
// 易政秀报表
this.$router.push({
path: "/home/dataManagement/easyPoliticsShow/PoliticsShow",
});
},
pushRouter2() {
// 排队叫号
this.$router.push({
path: "/home/dataManagement/queueCall/queueRecord",
});
},
pushRouter3() {
// 预约记录
this.$router.push({
path: "/home/dataManagement/makeRecordReport/RecordReport",
});
},
pushRouter4() {
// 服务类数据分析
this.$router.push({
path: "/home/dataManagement/serviceDataAnalyse/makeTrendResearch",
});
},
pushRouter5() {
// 无感一码通实时数据报表
this.$router.push({
path: "/home/dataManagement/oneYardPass/reportForm",
});
},
pushRouter6() {
// AI效能监察异常行为数据报表
this.$router.push({
path: "/home/dataManagement/AIEfficiency/abnormalReportForm",
});
},
pushRouter7() {
// 智能边缘物联网异常告警报表
this.$router.push({
path: "/home/dataManagement/IOT/alerting",
});
},
pushRouter8() {
// 取件记录报表
this.$router.push({
path: "/home/dataManagement/pickUp/pickUpRecord",
});
},
pushRouter9() {
// 短信记录报表
this.$router.push({
path: "/home/dataManagement/SMS/SMSRecord",
});
},
pushRouter10() {
// 评价记录报表
this.$router.push({
path: "/home/dataManagement/evaluationRecordReport/windowsEvaluation",
});
},
pushRouter11() {
// 样记录报表
this.$router.push({
path: "/home/dataManagement/sampleRecordReport/sampleForm",
});
},
pushRouter12() {
// 填单记录样表
this.$router.push({
path: "/home/dataManagement/fillRecordReport/fillForm",
});
},
pushRouter13() {
// 微官网注册报表
this.$router.push({
path: "/home/dataManagement/microOfficialWebsite/microForm",
});
},
pushRouter14() {
// 网络理政报表
this.$router.push({
path: "/home/dataManagement/networkGovernance/networkForm",
});
}, },
// pushRouter1() {
// // 易政秀报表
// this.$router.push({
// path: "/home/dataManagement/easyPoliticsShow/PoliticsShow",
// });
// },
// pushRouter2() {
// // 排队叫号
// this.$router.push({
// path: "/home/dataManagement/queueCall/queueRecord",
// });
// },
// pushRouter3() {
// // 预约记录
// this.$router.push({
// path: "/home/dataManagement/makeRecordReport/RecordReport",
// });
// },
// pushRouter4() {
// // 服务类数据分析
// this.$router.push({
// path: "/home/dataManagement/serviceDataAnalyse/makeTrendResearch",
// });
// },
// pushRouter5() {
// // 无感一码通实时数据报表
// this.$router.push({
// path: "/home/dataManagement/oneYardPass/reportForm",
// });
// },
// pushRouter6() {
// // AI效能监察异常行为数据报表
// this.$router.push({
// path: "/home/dataManagement/AIEfficiency/abnormalReportForm",
// });
// },
// pushRouter7() {
// // 智能边缘物联网异常告警报表
// this.$router.push({
// path: "/home/dataManagement/IOT/alerting",
// });
// },
// pushRouter8() {
// // 取件记录报表
// this.$router.push({
// path: "/home/dataManagement/pickUp/pickUpRecord",
// });
// },
// pushRouter9() {
// // 短信记录报表
// this.$router.push({
// path: "/home/dataManagement/SMS/SMSRecord",
// });
// },
// pushRouter10() {
// // 评价记录报表
// this.$router.push({
// path: "/home/dataManagement/evaluationRecordReport/windowsEvaluation",
// });
// },
// pushRouter11() {
// // 样记录报表
// this.$router.push({
// path: "/home/dataManagement/sampleRecordReport/sampleForm",
// });
// },
// pushRouter12() {
// // 填单记录样表
// this.$router.push({
// path: "/home/dataManagement/fillRecordReport/fillForm",
// });
// },
// pushRouter13() {
// // 微官网注册报表
// this.$router.push({
// path: "/home/dataManagement/microOfficialWebsite/microForm",
// });
// },
// pushRouter14() {
// // 网络理政报表
// this.$router.push({
// path: "/home/dataManagement/networkGovernance/networkForm",
// });
// },
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment