Compare commits

..

No commits in common. "76b88ed75af56e79ee5587ad32e5d6c0d8484ddc" and "a7b39f3ce144cb77dfb5972f27b596cb826ce9f4" have entirely different histories.

40 changed files with 140 additions and 279 deletions

View File

@ -1 +0,0 @@
.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
dist/css/3759.bca3f817.css vendored Normal file
View File

@ -0,0 +1 @@
.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%}

View File

@ -1 +0,0 @@
.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
dist/css/6582.f8d52ac0.css vendored Normal file
View File

@ -0,0 +1 @@
.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.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> <!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>

1
dist/js/1456.89cd5723.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.322f76fa.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

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/2674.9dfc2bce.js vendored Normal file
View File

@ -0,0 +1 @@
"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

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([[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
dist/js/3759.74440c51.js vendored Normal file
View File

@ -0,0 +1 @@
"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}}]);

View File

@ -1 +0,0 @@
"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

1
dist/js/4341.a606fa40.js vendored Normal file
View File

@ -0,0 +1 @@
"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
dist/js/6582.b7dd2a16.js vendored Normal file
View File

@ -0,0 +1 @@
"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/6684.ef1e5b36.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

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,14 +223,6 @@ 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',
@ -262,43 +254,3 @@ 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

@ -1,56 +0,0 @@
<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,11 +6,6 @@
</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() {
@ -30,11 +25,16 @@ export default {
if (id) { if (id) {
this.isEdit = true this.isEdit = true
this.form.id = id this.form.id = id
getReportCategoryById({ id }).then((res) => { // getAccount({ id }).then((res) => {
if (res.code === 0) { // if (res.code === 0) {
this.form.name = res.data.name // 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
// }
// })
} else { } else {
this.isEdit = false this.isEdit = false
this.form.id = '' this.form.id = ''
@ -45,29 +45,28 @@ export default {
if (valid) { if (valid) {
if (this.isEdit) { if (this.isEdit) {
// //
reportCategoryUpdate({ ...this.form }).then((res) => { // accountUpdate({ ...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 {
console.log(this.form) // addAccount({ ...this.form }).then((res) => {
reportCategoryAdd({ ...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 {

View File

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

View File

@ -42,7 +42,6 @@
<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',
@ -96,8 +95,7 @@ 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
@ -111,17 +109,18 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
getReportCategory({ ...this.listQuery }).then((res) => { let arr = []
if (res.code === 0 && res.data) { for (let i = 0; i < 30; i++) {
this.tableData = res.data.records let obj = {}
this.total = res.data.total obj.name = '分类名' + i
} else { obj.id = i + 1
this.tableData = [] arr.push(obj)
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(() => {
@ -133,16 +132,17 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
reportCategoryDelete({ id: val.data.id }).then(() => { // maintainManageDelete({ id: val.data.id }).then((res) => {
this.$message({ // console.log(res)
message: '工单删除成功', // this.$message({
type: 'success', // message: '',
duration: 1500, // type: 'success',
onClose: () => {} // duration: 1500,
}) // onClose: () => {}
this.listQuery.current = 1 // })
this.getList() // this.listQuery.current = 1
}) // this.getList()
// })
}) })
.catch(() => {}) .catch(() => {})
} }

View File

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

View File

@ -12,63 +12,57 @@
<div class="numBox"> <div class="numBox">
<div> <div>
<div class="reportNum"> <div class="reportNum">
<div class="num">{{ totalReports }}</div> <div class="num">6</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="toDetail()">了解详情</div> <div class="detail" @click="toAll">了解详情</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.quantity }}</div> <div class="num">{{ item.num }}</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(item.id)">了解详情</div> <div class="detail" @click="toDetail">了解详情</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: 0, totalReports: 6,
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: {
getList() { toAll() {
getReportCategorylist({}).then((res) => { this.$router.push({
if (res.code === 0 && res.data.length > 0) { path: '/basicConfig/reportManagement/reportListDetail'
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(id) { toDetail(name) {
// this.$router.push({ path: '/basicConfig/reportManagement/reportDesign' })
this.$router.push({ this.$router.push({
// path: '/basicConfig/reportManagement/reportListDetail', path: '/basicConfig/reportManagement/reportListDetail',
name: 'reportListDetail', params: { category: name }
params: { categoryId: id ? id : '' }
}) })
} }
} }

View File

@ -11,7 +11,6 @@
: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"
@ -42,23 +41,16 @@
</template> </template>
<script> <script>
import ReportNameEdit from './../components/reportNameEdit.vue' import ReportNameEdit from './../components/reportNameEdit.vue'
import { import { getReportlist, delReportlist } from '@/api/basicConfig'
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: 'fileName', prop: 'name',
label: '报表名称' label: '报表名称'
}, },
{ {
prop: 'category', prop: 'category',
label: '报表分类', label: '报表分类'
subcomponent: categorySelect
}, },
{ {
prop: 'createTime', prop: 'createTime',
@ -95,17 +87,7 @@ export default {
label: '关键字', label: '关键字',
placeholder: '报表名称', placeholder: '报表名称',
param: 'name', param: 'name',
width: 200 width: 300
},
{
type: 'select',
label: '报表分类',
selectOptions: [],
param: 'category',
labelField: 'name',
valueField: 'id',
defaultSelect: '',
width: 200
}, },
{ {
type: 'button', type: 'button',
@ -131,29 +113,22 @@ 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
@ -163,30 +138,19 @@ 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',
name: 'reportView', query: { name: val.data.name }
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',
name: 'reportDesign', query: { name: val.data.name }
params: { name: val.data.name }
}) })
break break
case 'edit': case 'edit':
@ -201,7 +165,8 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
delReportlist({ id: val.data.id }).then(() => { delReportlist({ id: val.data.id }).then((res) => {
console.log(res)
this.$message({ this.$message({
message: '报表删除成功', message: '报表删除成功',
type: 'success', type: 'success',
@ -219,7 +184,6 @@ 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
@ -240,22 +204,6 @@ 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,13 +8,16 @@ 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.params const { name } = this.$route.query
this.url += name ? '?_u=db:' + this.$route.params.name : '' console.log(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('加载完成')