Vue.component('comD',{ template:'
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ ', data: function () { return { currentPage: 1, //初始页 pageSize: 10, // 每页的数据 tableData: [], pageSizeArr: [10, 20, 30, 50], total: 0, event_type: [{ "code": '0', "name": '门急诊' }, { "code": '1', "name": '住院' }], value1: new Date(getLastMonthStartDate()), value2:new Date(getLastMonthEndDate()), drugName:'', eventType: '0', } }, mounted: function () { this.getData() console.log() }, methods: { handleCurrentChange: function (val) { this.currentPage = val; this.getData() }, handleSizeChange: function (val) { this.pageSize = val; this.initData() }, initData: function () { //初始化 this.currentPage = 1; this.getData() }, searchClick: function () { console.log(this.eventType) console.log(this.drugName) this.initData() }, getData: function () { var vm = this; var params = { start:this.value1.format('yyyy-MM-dd'), end:this.value2.format('yyyy-MM-dd'), drugName:this.drugName, eventType:this.eventType, size:15, page:1, } GlobalEventBus.$emit('setLoading', { loading: true }); //缓存效果 bigDataOutApi.drugAnalysis(params).then(function (res) { console.log(res) GlobalEventBus.$emit('setLoading'); vm.tableData = res.detailModelList; vm.total = res.totalCount; debugger vm.tableData = vm.tableData.map(function(item){ item.event_date = new Date(item.event_date).format('yyyy-MM-dd-hh-mm-ss') return item; }) }).catch(function (err) { console.log(err) GlobalEventBus.$emit('setLoading'); }) }, handleClick:function(row) { console.log(row) demographic_id=row.demographic_id, medication=row.HDSD00_04_023, eventdate=row.event_date var url = httpRequest.server+'/app-ehr-browser/app/medication/html/medication.html?'+ 'healthProblemName='+'&demographic_id='+demographic_id+'&medication='+medication+'&eventdate='+eventdate console.log(url) var width=(0.5212*window.screen.width)+'px'; var height=(0.7878*window.screen.height)+'px'; top.layer.open({ id:'Lay_xiangqingD', type:2, title:false, closeBtn:0, shade:0.5, shadeClose:true, area:[width,height], content:url }) } } })