| | |
| | | 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-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-button> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | |
| | | <el-table-column align="center" prop="createTime" :label="$t('dataManage.vmobj.createontime')" |
| | | :formatter="formatData" /> |
| | | <el-table-column min-width="100" :label="$t('dataManage.dictionaryManageObj.operation')"> |
| | | |
| | | <template slot-scope="scope"> |
| | | <el-button v-if="btnStatus.select" @click="showDetail(scope.$index, scope.row)" type="primary" plain |
| | | size="small">{{ $t('dataManage.dictionaryManageObj.lookOver') }}</el-button> |
| | |
| | | </div> |
| | | <!-- 新增 --> |
| | | <el-dialog :title="behavior == '新增' |
| | | ? `${$t('common.append')}` |
| | | : `${$t('common.update')}` |
| | | ? `${$t('common.append')}` |
| | | : `${$t('common.update')}` |
| | | " :visible.sync="dialogVisible" :before-close="handleClose"> |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form ref="form" :model="editForm" label-width="100px" label-position="top"> |
| | |
| | | report_deletes, |
| | | report_update, |
| | | } from "../../api/api.js"; |
| | | import dataStatistics from '../../components/js/dataStatistics.js' |
| | | import { getToken } from "@/utils/auth"; |
| | | export default { |
| | | name: "templateManage", |
| | | components: { MyBread }, |
| | | data() { |
| | | return { |
| | | options: [ |
| | | { |
| | | value: "countSizes", |
| | | label: "数据量统计", |
| | | }, |
| | | { |
| | | value: "countServices", |
| | | label: "服务调用量统计", |
| | | }, |
| | | { |
| | | value: "countOperates", |
| | | label: "用户流量统计", |
| | | }, |
| | | { |
| | | value: "dataTable", |
| | | label: "上传数据表格模板", |
| | | }, |
| | | { |
| | | value: "uploadDir", |
| | | label: "上传目录结构模板", |
| | | }, |
| | | { |
| | | value: "dirFolder", |
| | | label: "目录结构文件夹模板", |
| | | }, { |
| | | value: "countExplorationPoints", |
| | | label: "钻孔数据统计", |
| | | }, |
| | | ], |
| | | options: [], |
| | | itemdetail: {}, |
| | | showinfoBox: false, |
| | | behavior: "新增", |
| | |
| | | window.removeEventListener("resize", this.onResize); |
| | | }, |
| | | mounted() { |
| | | |
| | | var obj = dataStatistics.statistics.filter(res => { |
| | | if (res.isMenu != false) |
| | | return res; |
| | | }) |
| | | this.options = obj |
| | | window.addEventListener("resize", this.onResize); |
| | | this.calHeight(); |
| | | }, |
| | |
| | | return res |
| | | } |
| | | }) |
| | | this.itemdetail.code = val[0].label; |
| | | if (val.length > 0 && val[0].label) { |
| | | this.itemdetail.code = val[0].label; |
| | | } |
| | | |
| | | // if (row.code.indexOf("countSizes") != -1) { |
| | | // this.itemdetail.code = "数据量统计"; |
| | | // } else if (row.code.indexOf("countServices") != -1) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | console.log(name) |
| | | if (name.indexOf('统计') > -1) { |
| | | this.typeOption = [{ |
| | | label: "World模板", |
| | |
| | | handleEdit(index, row) { |
| | | this.behavior = "修改"; |
| | | this.editForm = row; |
| | | |
| | | if (row.name.indexOf('统计') > -1) { |
| | | this.typeOption = [{ |
| | | label: "World模板", |
| | | value: "1" |
| | | }, { |
| | | label: "Excel模板", |
| | | value: "2" |
| | | }] |
| | | |
| | | } else { |
| | | this.typeOption = [{ |
| | | label: "World模板", |
| | | value: "1" |
| | | }, { |
| | | label: "Excel模板", |
| | | value: "2" |
| | | }, { |
| | | label: "Zip模板", |
| | | value: "3" |
| | | }] |
| | | } |
| | | if (parseInt(row.type) == 1) { |
| | | this.selectFileType = ".docx"; |
| | | } else if (parseInt(row.type) == 2) { |
| | | this.selectFileType = ".xlsx"; |
| | | } |
| | | this.rowGuid = row.guid; |
| | | |
| | | |
| | | |
| | | |
| | | this.dialogVisible = true; |
| | | }, |
| | | //删除 |
| | |
| | | }, |
| | | //新增一条数据 |
| | | async addInsertData() { |
| | | this.editForm.guid = this.rowGuid; |
| | | const data = await report_insert(this.editForm); |
| | | if (data.code != 200) { |
| | | return this.$message.error("新增失败"); |
| | |
| | | }, |
| | | //文件上传 |
| | | async geteditFile(res) { |
| | | |
| | | if (parseInt(this.editForm.type) == 1) { |
| | | this.selectFileType = ".docx"; |
| | | } else if (parseInt(this.editForm.type) == 2) { |
| | | this.selectFileType = ".xlsx"; |
| | | } |
| | | this.$nextTick(() => { |
| | | this.setEditFile(res) |
| | | }) |
| | | |
| | | }, |
| | | async setEditFile(res) { |
| | | if (res == 0) { |
| | | if (this.editForm.type == "") { |
| | | return this.$message("请选择上传文件类型"); |
| | | } |
| | | |
| | | |
| | | |
| | | $("#editFile").click(); |
| | | } else if (res == 1) { |
| | |
| | | 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.editForm.guid = val_data.result; |
| | | this.rowGuid = val_data.result; |
| | | this.$message({ |
| | | message: "上传成功!", |
| | |
| | | }, |
| | | |
| | | editFormStart() { |
| | | this.editForm.code = "countSizes"; |
| | | this.editForm.code = "dataTable"; |
| | | var name; |
| | | for (var i in this.options) { |
| | | if (this.options[i].value == this.editForm.code) { |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | //@import url(); 引入公共css类 |
| | | .authorityManagement_box { |
| | |
| | | } |
| | | } |
| | | </style> |
| | | |