| | |
| | | `${$t('dataManage.templateManage')}`, |
| | | ]"></My-bread> |
| | | <el-divider /> |
| | | <div class="searchComp subpage_Div"> |
| | | <div class="searchComp subpage_Div" ref="container"> |
| | | <el-form |
| | | ref="ruleForm" |
| | | :model="ruleForm" |
| | | :inline="true" |
| | | > |
| | | <el-form-item> |
| | | <div class="flex_box"> |
| | | <div style="margin-right: auto"> |
| | | <el-form-item :label="$t('userManage.authorityM.name')"> |
| | | <el-input |
| | | style="width:200px" |
| | | v-model="ruleForm.name" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item style="float:right"> |
| | | <el-button |
| | | icon="el-icon-refresh" |
| | | @click="restRefreshTable" |
| | | type="info" |
| | | size="small" |
| | | >{{ $t('common.empty') }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item style="float:right"> |
| | | <el-button |
| | | icon="el-icon-search" |
| | | @click="setRefreshTable" |
| | | type="primary" |
| | | size="small" |
| | | >{{ $t('common.iquery') }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item style="float:right"> |
| | | <el-button |
| | | v-if="btnStatus.delete" |
| | | icon="el-icon-delete" |
| | | @click="delTableData" |
| | | type="danger" |
| | | size="small" |
| | | >{{ $t('common.delete') }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item style="float:right"> |
| | | <el-button |
| | | v-if="btnStatus.insert" |
| | | @click="setTableInsert" |
| | | icon="el-icon-edit" |
| | | type="success" |
| | | size="small" |
| | | >{{ $t('common.append') }}</el-button> |
| | | </el-form-item> |
| | | size="small" |
| | | v-model="ruleForm.name" |
| | | :placeholder="$t('userManage.authorityM.nameHolder')" |
| | | > |
| | | <i slot="suffix" class="el-icon-search" @click="setRefreshTable"></i> |
| | | </el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div> |
| | | |
| | | <!-- <el-form-item>--> |
| | | <!-- <el-button--> |
| | | <!-- icon="el-icon-search"--> |
| | | <!-- @click="setRefreshTable"--> |
| | | <!-- type="primary"--> |
| | | <!-- size="small"--> |
| | | <!-- >{{ $t('common.iquery') }}</el-button>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item> |
| | | <el-button |
| | | v-if="btnStatus.insert" |
| | | @click="setTableInsert" |
| | | icon="el-icon-edit" |
| | | type="success" |
| | | size="small" |
| | | >{{ $t('common.append') }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | v-if="btnStatus.delete" |
| | | icon="el-icon-delete" |
| | | @click="delTableData" |
| | | type="danger" |
| | | size="small" |
| | | >{{ $t('common.delete') }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | icon="el-icon-refresh" |
| | | @click="restRefreshTable" |
| | | type="info" |
| | | size="small" |
| | | >{{ $t('common.empty') }}</el-button> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <div class="dividing-line"></div> |
| | | <div class="table_box" :style="styleVar"> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | border |
| | | @selection-change="handleSelectionChange" |
| | | height="calc(100% - 45px)" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | |
| | | : `${$t('common.update')}` |
| | | " |
| | | :visible.sync="dialogVisible" |
| | | width="50%" |
| | | :before-close="handleClose" |
| | | :show-close="false" |
| | | > |
| | | <div> |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form |
| | | ref="form" |
| | | :model="editForm" |
| | | label-width="100px" |
| | | label-position="top" |
| | | > |
| | | <el-form-item :label="$t('dataManage.styleObj.name')"> |
| | | <el-input |
| | | style="width:100%" |
| | | style="width:85%" |
| | | v-model=" editForm.name" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | v-model="editForm.type" |
| | | @change="selFileTypeChange" |
| | | placeholder="请选择活动区域" |
| | | style="width:100%" |
| | | style="width:85%" |
| | | > |
| | | <el-option |
| | | label="World模板" |
| | |
| | | ></el-input> --> |
| | | <el-select |
| | | :popper-append-to-body="false" |
| | | style="width:100%" |
| | | style="width:85%" |
| | | v-model="editForm.code" |
| | | placeholder="请选择" |
| | | > |
| | |
| | | style="width:100%" |
| | | ></el-input> |
| | | </div> |
| | | <div> |
| | | <div class="BoxFlexbutton"> |
| | | <input |
| | | name="file1" |
| | | type="file" |
| | |
| | | </el-form-item> |
| | | <el-form-item :label="$t('common.bak')"> |
| | | <el-input |
| | | style="width:100%" |
| | | style="width:85%" |
| | | v-model="editForm.bak" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | >确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <div class="infoBox_box" v-show="showinfoBox"> |
| | | <div |
| | | class="infoBox subpage_Div box_div" |
| | | v-show="showinfoBox" |
| | | |
| | | > |
| | | |
| | | <div |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <iframe |
| | | id="downFrame" |
| | | src="" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | import { |
| | | report_selectByPageAndCount, |
| | | report_upload, |
| | | report_insert, |
| | | report_deletes, |
| | | report_update |
| | | } from '../../api/api.js' |
| | | import { getToken } from '@/utils/auth'; |
| | | report_update, |
| | | } from "../../api/api.js"; |
| | | import { getToken } from "@/utils/auth"; |
| | | export default { |
| | | name: "templateManage", |
| | | components: { MyBread, }, |
| | | components: { MyBread }, |
| | | data() { |
| | | return { |
| | | options: [{ |
| | | value: 'countSizes', |
| | | label: '数据量统计' |
| | | }, { |
| | | value: 'countServices', |
| | | label: '服务调用量统计' |
| | | }, { |
| | | value: 'countOperates ', |
| | | label: '用户流量统计' |
| | | }], |
| | | options: [ |
| | | { |
| | | value: "countSizes", |
| | | label: "数据量统计", |
| | | }, |
| | | { |
| | | value: "countServices", |
| | | label: "服务调用量统计", |
| | | }, |
| | | { |
| | | value: "countOperates ", |
| | | label: "用户流量统计", |
| | | }, |
| | | ], |
| | | itemdetail: {}, |
| | | showinfoBox: false, |
| | | behavior: '新增', |
| | | selectFileType: '*.*', |
| | | behavior: "新增", |
| | | selectFileType: "*.*", |
| | | editForm: { |
| | | fname: '', |
| | | guid: '', |
| | | name: '', |
| | | code: '', |
| | | type: '', |
| | | bak: '', |
| | | fname: "", |
| | | guid: "", |
| | | name: "", |
| | | code: "", |
| | | type: "", |
| | | bak: "", |
| | | }, |
| | | multipleSelection: [], |
| | | dialogVisible: false, |
| | | tableData: [], |
| | | ruleForm: { |
| | | name: '' |
| | | name: "", |
| | | }, |
| | | listData: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | name: '', |
| | | name: "", |
| | | count: 0, |
| | | }, |
| | | btnStatus: { |
| | |
| | | insert: false, |
| | | update: false, |
| | | }, |
| | | } |
| | | tableHeight: 0, |
| | | timer: 0, |
| | | styleVar: { |
| | | height: "calc(100% - 109px)", |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.showPermsBtn(); |
| | | this.showTableData(); |
| | | |
| | | }, |
| | | beforeDestroy() { |
| | | this.timer && clearTimeout(this.timer); |
| | | window.removeEventListener("resize", this.onResize); |
| | | }, |
| | | mounted() { |
| | | window.addEventListener("resize", this.onResize); |
| | | this.calHeight(); |
| | | }, |
| | | methods: { |
| | | onResize() { |
| | | this.timer && clearTimeout(this.timer); |
| | | this.timer = setTimeout(() => { |
| | | this.calHeight(); |
| | | }, 500); |
| | | }, |
| | | calHeight() { |
| | | this.$nextTick(() => { |
| | | const rect = this.$refs.container.getBoundingClientRect(); |
| | | this.tableHeight = `${rect.height + 97}px`; |
| | | this.styleVar["height"] = `calc(100% - ${rect.height + 30}px)`; |
| | | // this.styleVar["height"] = `calc(100% - ${rect.height + 97}px)`; |
| | | }); |
| | | }, |
| | | //修改取消 |
| | | closeEditData() { |
| | | this.closeInsertData(); |
| | |
| | | var blackTheme; |
| | | if (this.$store.state.themeflag == true) { |
| | | blackTheme = { |
| | | customClass: "Black_theme" |
| | | } |
| | | customClass: "Black_theme", |
| | | }; |
| | | } |
| | | |
| | | this.$confirm('确认关闭?', blackTheme) |
| | | this.$confirm("确认关闭?", blackTheme) |
| | | .then((_) => { |
| | | this.closeInsertData(); |
| | | |
| | | }) |
| | | .catch((_) => { }); |
| | | .catch((_) => {}); |
| | | }, |
| | | codeData(row, column) { |
| | | let data = row[column.property]; |
| | |
| | | return data; |
| | | } |
| | | var val; |
| | | if (row.code.indexOf('countSizes') != -1) { |
| | | val = "数据量统计" |
| | | } else if (row.code.indexOf('countServices') != -1) { |
| | | val = "服务调用量统计" |
| | | } else if (row.code.indexOf('countOperates') != -1) { |
| | | val = "用户流量统计" |
| | | if (row.code.indexOf("countSizes") != -1) { |
| | | val = "数据量统计"; |
| | | } else if (row.code.indexOf("countServices") != -1) { |
| | | val = "服务调用量统计"; |
| | | } else if (row.code.indexOf("countOperates") != -1) { |
| | | val = "用户流量统计"; |
| | | } |
| | | return val; |
| | | }, |
| | | //查看 |
| | | showDetail(index, row) { |
| | | |
| | | this.itemdetail = row; |
| | | |
| | | if (parseInt(row.type) == 1) { |
| | | this.itemdetail.fileType = "World模板" |
| | | this.itemdetail.fileType = "World模板"; |
| | | } else if (parseInt(row.type) == 2) { |
| | | this.itemdetail.fileType = "Excel模板" |
| | | this.itemdetail.fileType = "Excel模板"; |
| | | } |
| | | if (row.code.indexOf('countSizes') != -1) { |
| | | this.itemdetail.code = "数据量统计" |
| | | } else if (row.code.indexOf('countServices') != -1) { |
| | | this.itemdetail.code = "服务调用量统计" |
| | | } else if (row.code.indexOf('countOperates') != -1) { |
| | | this.itemdetail.code = "用户流量统计" |
| | | if (row.code.indexOf("countSizes") != -1) { |
| | | this.itemdetail.code = "数据量统计"; |
| | | } else if (row.code.indexOf("countServices") != -1) { |
| | | this.itemdetail.code = "服务调用量统计"; |
| | | } else if (row.code.indexOf("countOperates") != -1) { |
| | | this.itemdetail.code = "用户流量统计"; |
| | | } |
| | | |
| | | this.itemdetail.uTime = this.format(row.updateTime); |
| | | this.showinfoBox = true |
| | | this.showinfoBox = true; |
| | | }, |
| | | //关闭查看 |
| | | closeDetial() { |
| | | this.showinfoBox = false |
| | | this.showinfoBox = false; |
| | | }, |
| | | //下载 |
| | | handleDownload(index, row) { |
| | | var token = getToken(); |
| | | var url = BASE_URL + "/report/download?token=" + token + "&guid=" + row.guid; |
| | | var url = |
| | | BASE_URL + "/report/download?token=" + token + "&guid=" + row.guid; |
| | | $("#downFrame").attr("src", url).click(); |
| | | }, |
| | | //修改提交 |
| | |
| | | return this.$message.error("修改失败"); |
| | | } |
| | | this.$message({ |
| | | message: '修改成功', |
| | | type: 'success' |
| | | message: "修改成功", |
| | | type: "success", |
| | | }); |
| | | this.closeInsertData(); |
| | | }, |
| | | //文件类型切换 |
| | | selFileTypeChange(val) { |
| | | if (parseInt(val) == 1) { |
| | | this.selectFileType = ".docx" |
| | | this.selectFileType = ".docx"; |
| | | } else if (parseInt(val) == 2) { |
| | | this.selectFileType = ".xlsx" |
| | | this.selectFileType = ".xlsx"; |
| | | } |
| | | }, |
| | | //修改 |
| | | handleEdit(index, row) { |
| | | this.behavior = "修改" |
| | | this.behavior = "修改"; |
| | | this.editForm = row; |
| | | if (parseInt(row.type) == 1) { |
| | | this.selectFileType = ".docx" |
| | | this.selectFileType = ".docx"; |
| | | } else if (parseInt(row.type) == 2) { |
| | | this.selectFileType = ".xlsx" |
| | | this.selectFileType = ".xlsx"; |
| | | } |
| | | this.dialogVisible = true; |
| | | }, |
| | | //删除 |
| | | async delTableData() { |
| | | if (this.multipleSelection.length == 0) { |
| | | return this.$message('请选择要删除的数据'); |
| | | return this.$message("请选择要删除的数据"); |
| | | } |
| | | var std = []; |
| | | for (var i in this.multipleSelection) { |
| | | std.push(this.multipleSelection[i].id) |
| | | std.push(this.multipleSelection[i].id); |
| | | } |
| | | this.$confirm('此操作将永久删除该模块, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | const data = await report_deletes({ ids: std.toString() }) |
| | | if (data.code == 200) { |
| | | this.InsertFormdialog = false; |
| | | this.$confirm("此操作将永久删除该模块, 是否继续?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | const data = await report_deletes({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.InsertFormdialog = false; |
| | | this.$message({ |
| | | message: "删除成功!", |
| | | type: "success", |
| | | }); |
| | | this.setRefreshTable(); |
| | | } else { |
| | | this.$message({ |
| | | message: "删除失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.$message({ |
| | | message: '删除成功!', |
| | | type: 'success', |
| | | type: "info", |
| | | message: "已取消删除", |
| | | }); |
| | | this.setRefreshTable(); |
| | | } else { |
| | | this.$message({ |
| | | message: '删除失败!', |
| | | type: 'warning', |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | // const data = await report_deletes({ ids: std.toString() }) |
| | | // if (data.code != 200) { |
| | | // return this.$message.error("删除失败"); |
| | |
| | | // }); |
| | | // this.setRefreshTable(); |
| | | }, |
| | | |
| | | |
| | | //重置查询 |
| | | restRefreshTable() { |
| | |
| | | return this.$message.error("新增失败"); |
| | | } |
| | | this.$message({ |
| | | message: '新增成功', |
| | | type: 'success' |
| | | message: "新增成功", |
| | | type: "success", |
| | | }); |
| | | this.closeInsertData(); |
| | | }, |
| | |
| | | closeInsertData() { |
| | | this.dialogVisible = false; |
| | | this.editForm = { |
| | | fname: '', |
| | | guid: '', |
| | | name: '', |
| | | code: '', |
| | | type: '', |
| | | bak: '', |
| | | } |
| | | fname: "", |
| | | guid: "", |
| | | name: "", |
| | | code: "", |
| | | type: "", |
| | | bak: "", |
| | | }; |
| | | this.setRefreshTable(); |
| | | document.getElementById("editFile").value = ""; |
| | | }, |
| | | //文件上传 |
| | | async geteditFile(res) { |
| | | if (res == 0) { |
| | | if (this.editForm.type == '') { |
| | | return this.$message('请选择上传文件类型'); |
| | | if (this.editForm.type == "") { |
| | | return this.$message("请选择上传文件类型"); |
| | | } |
| | | |
| | | $("#editFile").click(); |
| | |
| | | formData.append("file", fs.files[0]); |
| | | var val_data = await report_upload(formData); |
| | | if (val_data.code == 200) { |
| | | |
| | | this.editForm.guid = val_data.result; |
| | | this.$message({ |
| | | message: "上传成功!", |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | //格式化列表 |
| | | formatData(row, column) { |
| | |
| | | var h = time.getHours(); |
| | | var mm = time.getMinutes(); |
| | | var s = time.getSeconds(); |
| | | return y + '-' + this.add0(m) + '-' + this.add0(d); |
| | | return y + "-" + this.add0(m) + "-" + this.add0(d); |
| | | }, |
| | | //格式化时间 |
| | | add0(m) { |
| | | return m < 10 ? '0' + m : m; |
| | | return m < 10 ? "0" + m : m; |
| | | }, |
| | | //Table选择事件 |
| | | handleSelectionChange(val) { |
| | |
| | | }, |
| | | //新增弹窗 |
| | | setTableInsert() { |
| | | this.behavior = "新增" |
| | | this.dialogVisible = true |
| | | this.behavior = "新增"; |
| | | this.dialogVisible = true; |
| | | }, |
| | | //分页切换 |
| | | handleSizeChange(val) { |
| | |
| | | return this.$message.error("列表调用失败"); |
| | | } |
| | | this.tableData = data.result; |
| | | this.listData.count = data.count |
| | | this.listData.count = data.count; |
| | | }, |
| | | //权限配置 |
| | | showPermsBtn() { |
| | |
| | | .authorityManagement_box { |
| | | height: 98%; |
| | | width: 98%; |
| | | padding: 1%; |
| | | padding: 0.5%; |
| | | |
| | | .el-input { |
| | | width: 730px; |
| | | } |
| | | |
| | | .searchComp { |
| | | margin: 10px auto; |
| | | //padding: 8px; |
| | | //margin-top: 20px; |
| | | |
| | | border-radius: 5px; |
| | | |
| | | //margin-bottom: 20px; |
| | | |
| | | .el-form-item { |
| | | margin: 5px; |
| | |
| | | } |
| | | } |
| | | } |
| | | .BoxFlex { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | width: 100%; |
| | | .BoxFlexinput { |
| | | flex: 1; |
| | | } |
| | | } |
| | | |
| | | } |
| | | </style> |
| | | |