报表模块 #13

Merged
juzi merged 1 commits from zjl into master 2023-03-23 15:40:58 +08:00
40 changed files with 279 additions and 140 deletions

1
dist/css/3366.7459e497.css vendored Normal file
View File

@ -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%}

View File

@ -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 Normal file
View File

@ -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%}

View File

@ -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
View File

@ -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>

File diff suppressed because one or more lines are too long

1
dist/js/1456.ae21a94b.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/js/2033.e713058b.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/js/2049.6e4ab670.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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}}]);

File diff suppressed because one or more lines are too long

1
dist/js/2949.2b4c9508.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/js/3366.fddfab50.js vendored Normal file
View File

@ -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}}]);

View File

@ -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 Normal file
View File

@ -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}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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"}}]);

View File

@ -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}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/js/8311.a2fa96fb.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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) { export function getReportlist(data) {
return request({ return request({
url: '/report/report-sheet/page', url: '/report/report-sheet/page',
@ -254,3 +262,43 @@ export function getReport(data) {
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
})
}

View File

@ -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>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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