1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- Vue.component('header-prompt', {
- template: '<div class="cb-ebebf5 height-30 lheight-30 pl20 c-f12">\
- <span class="c-666">{{areaName}}</span> (\
- </div>',
- props: [],
- data: function() {
- return {
- areaName:"",
- jieZhiTime:"",
- selectDate:"",
- dimensionVal:"",
- dimensionVal2: ""
- }
- },
- mounted: function() {
- var vm = this;
- getJieZhiTime(vm);
-
- //更新区域名称
- EventBus.$on('update-area-name', function(arg) {
- vm.areaName = arg.areaName;
- });
-
- //更新统计时间
- EventBus.$on('update-statistics-time', function(arg) {
- getJieZhiTime(vm);
- });
-
- //更新年份
- EventBus.$on('update-statistics-year', function(arg) {
- vm.selectDate = arg.selectDate;
- });
-
- //更新维度名称
- EventBus.$on('update-dimension-name', function(arg) {
- vm.dimensionVal = arg.dimensionVal;
- });
-
- //更新维度2名称
- EventBus.$on('update-dimension2-name', function(arg){
- vm.dimensionVal2 = arg.dimensionVal2;
- });
-
- //更新所有信息
- EventBus.$on('update-all-prompt-info', function(arg) {
- vm.areaName = arg.areaName;
- getJieZhiTime(vm);
- vm.selectDate = arg.selectDate;
- vm.dimensionVal = arg.dimensionVal;
- });
- },
- methods: {
-
- }
- })
- //获取统计时间
- function getJieZhiTime(vm){
- statisticAPI.statisticsTime({}).then(function(res) {
- if(res.status=="200"){
- var date = (res.data && res.data.substring(11,16)) || "";
- vm.jieZhiTime = date;
- }
- })
- }
|