报表模块 #13

已合并
juzi 2023-03-23 15:40:58 +08:00 将 1 次代码提交从 zjl 合并至 master
共有 40 个文件被更改,包括 279 次插入140 次删除

1
dist/css/3366.7459e497.css vendored 普通文件
查看文件

@@ -0,0 +1 @@
.reportView[data-v-710dfb7b]{margin:0 16px 0 16px;width:98.5%;height:calc(100vh - 205px)}.reportView .mainIframe[data-v-710dfb7b]{width:100%;height:100%}

查看文件

@@ -1 +0,0 @@
.reportView[data-v-2fcfb7ac]{margin:0 16px 0 16px;width:98.5%;height:calc(100vh - 205px)}.reportView .mainIframe[data-v-2fcfb7ac]{width:100%;height:100%}

1
dist/css/4238.05a640eb.css vendored 普通文件
查看文件

@@ -0,0 +1 @@
.reportDesign[data-v-1c79afe0]{margin:0 16px 0 16px;width:98.5%;height:calc(100vh - 205px)}.reportDesign .mainIframe[data-v-1c79afe0]{width:100%;height:100%}

查看文件

@@ -1 +0,0 @@
.reportDesign[data-v-00a9937e]{margin:0 16px 0 16px;width:98.5%;height:calc(100vh - 205px)}.reportDesign .mainIframe[data-v-00a9937e]{width:100%;height:100%}

2
dist/index.html vendored
查看文件

@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>tft-mes</title><script defer="defer" src="/js/chunk-vendors.a42f8636.js"></script><script defer="defer" src="/js/app.4f3f8fe2.js"></script><link href="/css/app.68cbc19b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but tft-mes doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>tft-mes</title><script defer="defer" src="/js/chunk-vendors.a42f8636.js"></script><script defer="defer" src="/js/app.f942c170.js"></script><link href="/css/app.68cbc19b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but tft-mes doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

文件差异因一行或多行过长而隐藏

1
dist/js/1456.ae21a94b.js vendored 普通文件

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

1
dist/js/2033.e713058b.js vendored 普通文件

文件差异因一行或多行过长而隐藏

1
dist/js/2049.6e4ab670.js vendored 普通文件

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

查看文件

@@ -1 +0,0 @@
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[2674],{2674:function(t,e,i){i.r(e),i.d(e,{default:function(){return g}});var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"report-classification"},[e("search-bar",{ref:"searchBarForm",attrs:{formConfigs:t.formConfig},on:{headBtnClick:t.buttonClick}}),e("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH}},[t.tableBtn.length?e("method-btn",{attrs:{slot:"handleBtn",width:80,label:"操作","method-list":t.tableBtn},on:{clickBtn:t.handleClick},slot:"handleBtn"}):t._e()],1),e("pagination",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,total:t.total},on:{"update:page":function(e){return t.$set(t.listQuery,"current",e)},"update:limit":function(e){return t.$set(t.listQuery,"size",e)},pagination:function(e){return t.getList()}}}),e("base-dialog",{attrs:{dialogTitle:t.addOrEditTitle,dialogVisible:t.centervisible,"before-close":t.handleCancel},on:{cancel:t.handleCancel,confirm:t.handleConfirm}},[e("report-class-add",{ref:"reportClass",on:{successSubmit:t.successSubmit}})],1)],1)},a=[],r=i(475),l=function(){var t=this,e=t._self._c;return e("el-form",{ref:"form",attrs:{rules:t.rules,"label-width":"100px",model:t.form}},[e("el-form-item",{attrs:{label:"报表分类名",prop:"name"}},[e("el-input",{model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1)],1)},n=[],o={name:"ReportClassAdd",data(){return{form:{id:"",name:""},isEdit:!1,rules:{name:[{required:!0,message:"请输入报表分类名",trigger:"blur"}]}}},methods:{init(t){t?(this.isEdit=!0,this.form.id=t):(this.isEdit=!1,this.form.id="")},submitForm(){this.$refs["form"].validate((t=>{if(!t)return!1;this.isEdit,this.$emit("successSubmit")}))},formClear(){this.$refs.form.resetFields(),this.isEdit=!1}}},d=o,c=i(1001),m=(0,c.Z)(d,l,n,!1,null,null,null),u=m.exports;const h=[{prop:"name",label:"报表分类名"}],f=[{type:"edit",btnName:"编辑"},{type:"delete",btnName:"删除"}];var b={name:"ReportClassification",components:{ReportClassAdd:u},data(){return{formConfig:[{type:"input",label:"关键字",placeholder:"报表分类名",param:"name",width:300},{type:"button",btnName:"查询",name:"search",color:"primary"},{type:"separate"},{type:"button",btnName:"新增",name:"add",color:"success",plain:!0}],tableProps:h,tableData:[],tableBtn:f,tableH:(0,r.NC)(330),total:0,listQuery:{current:1,size:20},centervisible:!1,addOrEditTitle:""}},mounted(){window.addEventListener("resize",(()=>{this.tableH=(0,r.NC)(265)})),this.getList()},methods:{getList(){let t=[];for(let e=0;e<30;e++){let i={};i.name="分类名"+e,i.id=e+1,t.push(i)}this.tableData=t,this.total=30},handleClick(t){console.log(t),"edit"===t.type?(this.addOrEditTitle="编辑",this.$nextTick((()=>{this.$refs.reportClass.init(t.data.id)})),this.centervisible=!0):this.$confirm('确认删除报表分类名"'+t.data.name+'"吗?',{type:"warning"}).then((()=>{})).catch((()=>{}))},buttonClick(t){switch(t.btnName){case"search":this.listQuery.name=t.name,this.listQuery.current=1,this.getList();break;default:this.addOrEditTitle="新增",this.centervisible=!0,this.$nextTick((()=>{this.$refs.reportClass.init()}))}},handleCancel(){this.$refs.reportClass.formClear(),this.centervisible=!1,this.addOrEditTitle=""},handleConfirm(){this.$refs.reportClass.submitForm()},successSubmit(){this.handleCancel(),this.getList()}}},p=b,C=(0,c.Z)(p,s,a,!1,null,null,null),g=C.exports}}]);

文件差异因一行或多行过长而隐藏

1
dist/js/2949.2b4c9508.js vendored 普通文件

文件差异因一行或多行过长而隐藏

1
dist/js/3366.fddfab50.js vendored 普通文件
查看文件

@@ -0,0 +1 @@
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[3366],{3366:function(t,e,r){r.r(e),r.d(e,{default:function(){return l}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"reportView",attrs:{id:"reportView"}},[e("iframe",{attrs:{src:t.url,width:"100%",height:"100%"}})])},s=[],i={name:"ReportView",data(){return{url:"http://tft.mes.picaiba.com/ureport/preview"}},mounted(){const t=this,{name:e}=this.$route.params;this.url+=e?"?_u=db:"+this.$route.params.name:"";const r=document.getElementById("reportView");r.onload=function(){console.log("加载完成"),t.loading=!1}}},a=i,o=r(1001),u=(0,o.Z)(a,n,s,!1,null,"710dfb7b",null),l=u.exports}}]);

查看文件

@@ -1 +0,0 @@
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[3759],{3759:function(t,e,r){r.r(e),r.d(e,{default:function(){return l}});var o=function(){var t=this,e=t._self._c;return e("div",{staticClass:"reportView",attrs:{id:"reportView"}},[e("iframe",{attrs:{src:t.url,width:"100%",height:"100%"}})])},n=[],s={name:"ReportView",data(){return{url:"http://tft.mes.picaiba.com/ureport/preview",aa:"111"}},mounted(){const t=this,{name:e}=this.$route.query;console.log(e),this.url+=e?"?_u=db:"+this.$route.query.name:"",console.log(this.url);const r=document.getElementById("reportView");r.onload=function(){console.log("加载完成"),t.loading=!1}}},u=s,i=r(1001),a=(0,i.Z)(u,o,n,!1,null,"2fcfb7ac",null),l=a.exports}}]);

1
dist/js/4238.ef96ed59.js vendored 普通文件
查看文件

@@ -0,0 +1 @@
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[4238],{4238:function(t,e,r){r.r(e),r.d(e,{default:function(){return c}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"reportDesign",attrs:{id:"reportDesign"}},[e("iframe",{attrs:{src:t.url,width:"100%",height:"100%"}})])},s=[],a={name:"ReportDesign",data(){return{url:"http://tft.mes.picaiba.com/ureport/designer"}},mounted(){const t=this,{name:e}=this.$route.params;this.url+=e?"?_u=db:"+this.$route.params.name:"";const r=document.getElementById("reportDesign");r.onload=function(){console.log("加载完成"),t.loading=!1}}},i=a,o=r(1001),u=(0,o.Z)(i,n,s,!1,null,"1c79afe0",null),c=u.exports}}]);

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

查看文件

@@ -1 +0,0 @@
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[4341],{4341:function(t,s,a){a.r(s),a.d(s,{default:function(){return c}});var e=function(){var t=this,s=t._self._c;return s("div",{staticClass:"reoprtManager"},[s("div",{staticClass:"report"},[t._m(0),s("div",{staticClass:"numBox"},[s("div",[t._m(1),s("div",{staticClass:"detail",on:{click:t.toAll}},[t._v("了解详情")])])])]),t._l(t.reportList,(function(a,e){return s("div",{key:e,staticClass:"reportDesc"},[s("div",[s("div",{staticClass:"reportNum"},[s("div",{staticClass:"num"},[t._v(t._s(a.num))]),s("div",{staticClass:"text"},[s("p",{staticClass:"font"},[t._v(t._s(a.name))]),s("p",{staticClass:"letter"},[t._v("Reports")])])]),s("div",{staticClass:"detail",on:{click:t.toDetail}},[t._v("了解详情")])])])}))],2)},i=[function(){var t=this,s=t._self._c;return s("div",{staticClass:"imgBox"},[s("img",{attrs:{src:a(2070),alt:"",width:"355px",height:"314px"}})])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"reportNum"},[s("div",{staticClass:"num"},[t._v("6")]),s("div",{staticClass:"text"},[s("p",{staticClass:"font"},[t._v("全部报表")]),s("p",{staticClass:"letter"},[t._v("Reports")])])])}],r={name:"ReportList",data(){return{totalReports:6,reportList:[{num:2,name:"能源报表"},{num:2,name:"订单报表"},{num:1,name:"设备报表"},{num:1,name:"人员报表"},{num:1,name:"质量报表"},{num:0,name:"产线报表"}]}},methods:{toAll(){this.$router.push({path:"/basicConfig/reportManagement/reportListDetail"})},toDetail(t){this.$router.push({path:"/basicConfig/reportManagement/reportListDetail",params:{category:t}})}}},n=r,l=a(1001),o=(0,l.Z)(n,e,i,!1,null,null,null),c=o.exports},2070:function(t,s,a){t.exports=a.p+"img/report.b2b3c253.png"}}]);

查看文件

@@ -1 +0,0 @@
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[6582],{6582:function(t,e,r){r.r(e),r.d(e,{default:function(){return l}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"reportDesign",attrs:{id:"reportDesign"}},[e("iframe",{attrs:{src:t.url,width:"100%",height:"100%"}})])},s=[],u={name:"ReportDesign",data(){return{url:"http://tft.mes.picaiba.com/ureport/designer"}},mounted(){const t=this,{name:e}=this.$route.query;this.url+=e?"?_u=db:"+this.$route.query.name:"";const r=document.getElementById("reportDesign");r.onload=function(){console.log("加载完成"),t.loading=!1}}},i=u,o=r(1001),a=(0,o.Z)(i,n,s,!1,null,"00a9937e",null),l=a.exports}}]);

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

1
dist/js/8311.a2fa96fb.js vendored 普通文件

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

查看文件

@@ -223,6 +223,14 @@ export function getEqCode(data) {
}
// 报表管理
export function getReportCategorylist(data) {
return request({
url: '/report/report-sheet-category/list',
method: 'post',
data
})
}
export function getReportlist(data) {
return request({
url: '/report/report-sheet/page',
@@ -254,3 +262,43 @@ export function getReport(data) {
data
})
}
// 报表管理--报表分类
export function getReportCategory(data) {
return request({
url: '/report/report-sheet-category/page',
method: 'post',
data
})
}
export function reportCategoryAdd(data) {
return request({
url: '/report/report-sheet-category/add',
method: 'post',
data
})
}
export function reportCategoryUpdate(data) {
return request({
url: '/report/report-sheet-category/update',
method: 'post',
data
})
}
export function getReportCategoryById(data) {
return request({
url: '/report/report-sheet-category/get',
method: 'post',
data
})
}
export function reportCategoryDelete(data) {
return request({
url: '/report/report-sheet-category/delete',
method: 'post',
data
})
}

查看文件

@@ -0,0 +1,56 @@
<template>
<div>
<el-select
v-model="categoryId"
placeholder="请选择"
@change="changeCategory"
style="width: 100%"
>
<el-option
v-for="item in list"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'categorySelect',
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
categoryId: '',
list: JSON.parse(localStorage.getItem('reportCategory'))
}
},
mounted() {
this.init()
},
methods: {
init() {
this.categoryId = this.injectData.category
},
changeCategory() {
this.$emit('emitData', {
categoryId: this.categoryId,
injectData: this.injectData
})
}
},
watch: {
injectData(newVal, oldVal) {
if (oldVal.enabled !== newVal.enabled) {
this.init()
}
}
}
}
</script>

查看文件

@@ -6,6 +6,11 @@
</el-form>
</template>
<script>
import {
reportCategoryAdd,
reportCategoryUpdate,
getReportCategoryById
} from '@/api/basicConfig'
export default {
name: 'ReportClassAdd',
data() {
@@ -25,16 +30,11 @@ export default {
if (id) {
this.isEdit = true
this.form.id = id
// getAccount({ id }).then((res) => {
// if (res.code === 0) {
// this.form.account = res.data.account
// this.form.password = res.data.password
// this.form.name = res.data.name
// this.form.proLineId = res.data.proLineId
// this.form.role = res.data.role
// this.form.enabled = res.data.enabled
// }
// })
getReportCategoryById({ id }).then((res) => {
if (res.code === 0) {
this.form.name = res.data.name
}
})
} else {
this.isEdit = false
this.form.id = ''
@@ -45,28 +45,29 @@ export default {
if (valid) {
if (this.isEdit) {
//编辑
// accountUpdate({ ...this.form }).then((res) => {
// if (res.code === 0) {
// this.$message({
// message: '操作成功',
// type: 'success',
// duration: 1500
// })
// this.$emit('successSubmit')
// }
// })
reportCategoryUpdate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
this.$emit('successSubmit')
}
})
this.$emit('successSubmit')
} else {
// addAccount({ ...this.form }).then((res) => {
// if (res.code === 0) {
// this.$message({
// message: '操作成功',
// type: 'success',
// duration: 1500
// })
// this.$emit('successSubmit')
// }
// })
console.log(this.form)
reportCategoryAdd({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
this.$emit('successSubmit')
}
})
this.$emit('successSubmit')
}
} else {

查看文件

@@ -1,21 +1,7 @@
<template>
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-form-item label="报表名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="报表分类" prop="category">
<el-select
v-model="form.category"
placeholder="报表分类"
style="width: 100%"
>
<el-option
v-for="(item, i) in typeList"
:key="i"
:label="item.dataName"
:value="item.dataName"
></el-option>
</el-select>
<el-form-item label="报表名称" prop="fileName">
<el-input v-model="form.fileName"></el-input>
</el-form-item>
</el-form>
</template>
@@ -27,18 +13,12 @@ export default {
return {
form: {
id: '',
name: '',
category: ''
fileName: ''
},
typeList: [
{ dataName: '能源', id: 1 },
{ dataName: '订单', id: 2 },
{ dataName: '设备', id: 3 },
{ dataName: '人员', id: 4 }
],
rules: {
name: [{ required: true, message: '请输入报表分类名', trigger: 'blur' }]
// category: [{ required: true, message: '请选择分类', trigger: 'change' }]
fileName: [
{ required: true, message: '请输入报表分类名', trigger: 'blur' }
]
}
}
},
@@ -48,8 +28,7 @@ export default {
this.form.id = id
getReport({ id }).then((res) => {
if (res.code === 0) {
this.form.category = res.data.category
this.form.name = res.data.name
this.form.fileName = res.data.fileName
}
})
}

查看文件

@@ -42,6 +42,7 @@
<script>
import { tableHeight } from '@/utils/index'
import ReportClassAdd from './../components/reportClassAdd.vue'
import { getReportCategory, reportCategoryDelete } from '@/api/basicConfig'
const tableProps = [
{
prop: 'name',
@@ -95,7 +96,8 @@ export default {
total: 0,
listQuery: {
current: 1,
size: 20
size: 20,
name: ''
},
centervisible: false,
addOrEditTitle: '' //新增编辑弹出框的title
@@ -109,18 +111,17 @@ export default {
},
methods: {
getList() {
let arr = []
for (let i = 0; i < 30; i++) {
let obj = {}
obj.name = '分类名' + i
obj.id = i + 1
arr.push(obj)
getReportCategory({ ...this.listQuery }).then((res) => {
if (res.code === 0 && res.data) {
this.tableData = res.data.records
this.total = res.data.total
} else {
this.tableData = []
this.total = 0
}
this.tableData = arr
this.total = 30
})
},
handleClick(val) {
console.log(val)
if (val.type === 'edit') {
this.addOrEditTitle = '编辑'
this.$nextTick(() => {
@@ -132,17 +133,16 @@ export default {
type: 'warning'
})
.then(() => {
// maintainManageDelete({ id: val.data.id }).then((res) => {
// console.log(res)
// this.$message({
// message: '工单删除成功',
// type: 'success',
// duration: 1500,
// onClose: () => {}
// })
// this.listQuery.current = 1
// this.getList()
// })
reportCategoryDelete({ id: val.data.id }).then(() => {
this.$message({
message: '工单删除成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
this.listQuery.current = 1
this.getList()
})
})
.catch(() => {})
}

查看文件

@@ -13,8 +13,8 @@ export default {
},
mounted() {
const vm = this
const { name } = this.$route.query
this.url += name ? '?_u=db:' + this.$route.query.name : ''
const { name } = this.$route.params
this.url += name ? '?_u=db:' + this.$route.params.name : ''
const ifream = document.getElementById('reportDesign')
ifream.onload = function () {
console.log('加载完成')

查看文件

@@ -12,57 +12,63 @@
<div class="numBox">
<div>
<div class="reportNum">
<div class="num">6</div>
<div class="num">{{ totalReports }}</div>
<div class="text">
<p class="font">全部报表</p>
<p class="letter">Reports</p>
</div>
</div>
<div class="detail" @click="toAll">了解详情</div>
<div class="detail" @click="toDetail()">了解详情</div>
</div>
</div>
</div>
<div class="reportDesc" v-for="(item, i) in reportList" :key="i">
<div>
<div class="reportNum">
<div class="num">{{ item.num }}</div>
<div class="num">{{ item.quantity }}</div>
<div class="text">
<p class="font">{{ item.name }}</p>
<p class="letter">Reports</p>
</div>
</div>
<div class="detail" @click="toDetail">了解详情</div>
<div class="detail" @click="toDetail(item.id)">了解详情</div>
</div>
</div>
</div>
</template>
<script>
import { getReportCategorylist } from '@/api/basicConfig'
export default {
name: 'ReportList',
data() {
return {
totalReports: 6,
reportList: [
{ num: 2, name: '能源报表' },
{ num: 2, name: '订单报表' },
{ num: 1, name: '设备报表' },
{ num: 1, name: '人员报表' },
{ num: 1, name: '质量报表' },
{ num: 0, name: '产线报表' }
]
totalReports: 0,
reportList: []
}
},
mounted() {
this.getList()
},
methods: {
toAll() {
this.$router.push({
path: '/basicConfig/reportManagement/reportListDetail'
getList() {
getReportCategorylist({}).then((res) => {
if (res.code === 0 && res.data.length > 0) {
this.totalReports = 0
for (let i = 0; i < res.data.length; i++) {
this.totalReports += res.data[i].quantity
}
this.reportList = res.data
} else {
this.totalReports = 0
this.reportList = []
}
})
},
toDetail(name) {
// this.$router.push({ path: '/basicConfig/reportManagement/reportDesign' })
toDetail(id) {
this.$router.push({
path: '/basicConfig/reportManagement/reportListDetail',
params: { category: name }
// path: '/basicConfig/reportManagement/reportListDetail',
name: 'reportListDetail',
params: { categoryId: id ? id : '' }
})
}
}

查看文件

@@ -11,6 +11,7 @@
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
@emitFun="categoryChange"
>
<method-btn
v-if="tableBtn.length"
@@ -41,16 +42,23 @@
</template>
<script>
import ReportNameEdit from './../components/reportNameEdit.vue'
import { getReportlist, delReportlist } from '@/api/basicConfig'
import {
getReportlist,
delReportlist,
getReportCategorylist,
updateReportlist
} from '@/api/basicConfig'
import { tableHeight, timeFormatter } from '@/utils'
import categorySelect from './../components/categorySelect.vue'
const tableProps = [
{
prop: 'name',
prop: 'fileName',
label: '报表名称'
},
{
prop: 'category',
label: '报表分类'
label: '报表分类',
subcomponent: categorySelect
},
{
prop: 'createTime',
@@ -87,7 +95,17 @@ export default {
label: '关键字',
placeholder: '报表名称',
param: 'name',
width: 300
width: 200
},
{
type: 'select',
label: '报表分类',
selectOptions: [],
param: 'category',
labelField: 'name',
valueField: 'id',
defaultSelect: '',
width: 200
},
{
type: 'button',
@@ -113,22 +131,29 @@ export default {
total: 0,
listQuery: {
current: 1,
size: 20
size: 20,
name: '',
category: ''
},
typeList: [],
centervisible: false,
addOrEditTitle: '' //新增编辑弹出框的title
}
},
created() {
this.getCategorylist()
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = tableHeight(265)
})
this.formConfig[1].defaultSelect = this.$route.params.categoryId || ''
this.listQuery.category = this.$route.params.categoryId || ''
this.getList()
},
methods: {
getList() {
getReportlist({ ...this.listQuery }).then((res) => {
console.log(res)
if (res.code === 0 && res.data) {
this.tableData = res.data.records
this.total = res.data.total
@@ -138,19 +163,30 @@ export default {
}
})
},
getCategorylist() {
getReportCategorylist({}).then((res) => {
if (res.code === 0 && res.data.length > 0) {
localStorage.setItem('reportCategory', JSON.stringify(res.data))
this.formConfig[1].selectOptions = res.data
} else {
localStorage.setItem('reportCategory', '')
}
})
},
handleClick(val) {
console.log(val.data.name)
switch (val.type) {
case 'view':
this.$router.push({
path: '/basicConfig/reportManagement/reportView',
query: { name: val.data.name }
// path: '/basicConfig/reportManagement/reportView',
name: 'reportView',
params: { name: val.data.name }
})
break
case 'design':
this.$router.push({
path: '/basicConfig/reportManagement/reportDesign',
query: { name: val.data.name }
// path: '/basicConfig/reportManagement/reportDesign',
name: 'reportDesign',
params: { name: val.data.name }
})
break
case 'edit':
@@ -165,8 +201,7 @@ export default {
type: 'warning'
})
.then(() => {
delReportlist({ id: val.data.id }).then((res) => {
console.log(res)
delReportlist({ id: val.data.id }).then(() => {
this.$message({
message: '报表删除成功',
type: 'success',
@@ -184,6 +219,7 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.name = val.name
this.listQuery.category = val.category
this.listQuery.current = 1
this.getList()
break
@@ -204,6 +240,22 @@ export default {
successSubmit() {
this.handleCancel()
this.getList()
},
categoryChange(val) {
updateReportlist({
fileName: val.injectData.fileName,
id: val.injectData.id,
category: val.categoryId
}).then((res) => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
this.getList()
}
})
}
}
}

查看文件

@@ -8,16 +8,13 @@ export default {
name: 'ReportView',
data() {
return {
url: process.env.VUE_APP_REPORT_VIEW_URL,
aa: '111'
url: process.env.VUE_APP_REPORT_VIEW_URL
}
},
mounted() {
const vm = this
const { name } = this.$route.query
console.log(name)
this.url += name ? '?_u=db:' + this.$route.query.name : ''
console.log(this.url)
const { name } = this.$route.params
this.url += name ? '?_u=db:' + this.$route.params.name : ''
const ifream = document.getElementById('reportView')
ifream.onload = function () {
console.log('加载完成')