diff --git a/src/components/BigData/TimeButtons.vue b/src/components/BigData/TimeButtons.vue index 1b5e4bd..3b99c37 100644 --- a/src/components/BigData/TimeButtons.vue +++ b/src/components/BigData/TimeButtons.vue @@ -24,7 +24,7 @@ return ['3month', 'month', 'week'] } }, // 支持的按钮 - checked: { + defaultChecked: { type: String, default: 'week' } // 默认选中 @@ -32,6 +32,7 @@ data() { return { timeRange: [], // 时间范围 + checked: '', buttonDict: [ { label: '近1年', value: 'year' }, { label: '近6月', value: 'halfyear' }, @@ -46,8 +47,16 @@ return this.buttonDict.filter(item => this.buttons.indexOf(item.value) > -1) } }, + created() { + this.checked = this.defaultChecked + }, + mounted() { + this.initTime() + }, methods: { + // 时间发生切换 changeTime(type) { + this.checked = type let timeRange = [] switch (type) { case 'year': @@ -68,6 +77,10 @@ } console.log(timeRange) this.$emit('change', timeRange) + }, + // 强制触发 + initTime() { + this.changeTime(this.defaultChecked) } } } diff --git a/src/components/BigData/TimeButtons.vue b/src/components/BigData/TimeButtons.vue index 1b5e4bd..3b99c37 100644 --- a/src/components/BigData/TimeButtons.vue +++ b/src/components/BigData/TimeButtons.vue @@ -24,7 +24,7 @@ return ['3month', 'month', 'week'] } }, // 支持的按钮 - checked: { + defaultChecked: { type: String, default: 'week' } // 默认选中 @@ -32,6 +32,7 @@ data() { return { timeRange: [], // 时间范围 + checked: '', buttonDict: [ { label: '近1年', value: 'year' }, { label: '近6月', value: 'halfyear' }, @@ -46,8 +47,16 @@ return this.buttonDict.filter(item => this.buttons.indexOf(item.value) > -1) } }, + created() { + this.checked = this.defaultChecked + }, + mounted() { + this.initTime() + }, methods: { + // 时间发生切换 changeTime(type) { + this.checked = type let timeRange = [] switch (type) { case 'year': @@ -68,6 +77,10 @@ } console.log(timeRange) this.$emit('change', timeRange) + }, + // 强制触发 + initTime() { + this.changeTime(this.defaultChecked) } } } diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 6e2afc3..fc9a60e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -1,102 +1,94 @@ diff --git a/src/components/BigData/TimeButtons.vue b/src/components/BigData/TimeButtons.vue index 1b5e4bd..3b99c37 100644 --- a/src/components/BigData/TimeButtons.vue +++ b/src/components/BigData/TimeButtons.vue @@ -24,7 +24,7 @@ return ['3month', 'month', 'week'] } }, // 支持的按钮 - checked: { + defaultChecked: { type: String, default: 'week' } // 默认选中 @@ -32,6 +32,7 @@ data() { return { timeRange: [], // 时间范围 + checked: '', buttonDict: [ { label: '近1年', value: 'year' }, { label: '近6月', value: 'halfyear' }, @@ -46,8 +47,16 @@ return this.buttonDict.filter(item => this.buttons.indexOf(item.value) > -1) } }, + created() { + this.checked = this.defaultChecked + }, + mounted() { + this.initTime() + }, methods: { + // 时间发生切换 changeTime(type) { + this.checked = type let timeRange = [] switch (type) { case 'year': @@ -68,6 +77,10 @@ } console.log(timeRange) this.$emit('change', timeRange) + }, + // 强制触发 + initTime() { + this.changeTime(this.defaultChecked) } } } diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 6e2afc3..fc9a60e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -1,102 +1,94 @@ diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index 2caa551..ee21894 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -1,75 +1,45 @@ @@ -103,7 +73,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail - showData: false, // 是否显示近期数据 + showData: true, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -116,11 +86,6 @@ concenCode: '', installHeight: '' }, // 表单 - textMap: { - update: '编辑', - create: '新增', - detail: '详情' - }, // 表头显示标题 compDict: { '1': 'list-wellcover-data', '2': 'list-liquid-data', diff --git a/src/components/BigData/TimeButtons.vue b/src/components/BigData/TimeButtons.vue index 1b5e4bd..3b99c37 100644 --- a/src/components/BigData/TimeButtons.vue +++ b/src/components/BigData/TimeButtons.vue @@ -24,7 +24,7 @@ return ['3month', 'month', 'week'] } }, // 支持的按钮 - checked: { + defaultChecked: { type: String, default: 'week' } // 默认选中 @@ -32,6 +32,7 @@ data() { return { timeRange: [], // 时间范围 + checked: '', buttonDict: [ { label: '近1年', value: 'year' }, { label: '近6月', value: 'halfyear' }, @@ -46,8 +47,16 @@ return this.buttonDict.filter(item => this.buttons.indexOf(item.value) > -1) } }, + created() { + this.checked = this.defaultChecked + }, + mounted() { + this.initTime() + }, methods: { + // 时间发生切换 changeTime(type) { + this.checked = type let timeRange = [] switch (type) { case 'year': @@ -68,6 +77,10 @@ } console.log(timeRange) this.$emit('change', timeRange) + }, + // 强制触发 + initTime() { + this.changeTime(this.defaultChecked) } } } diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 6e2afc3..fc9a60e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -1,102 +1,94 @@ diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index 2caa551..ee21894 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -1,75 +1,45 @@ @@ -103,7 +73,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail - showData: false, // 是否显示近期数据 + showData: true, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -116,11 +86,6 @@ concenCode: '', installHeight: '' }, // 表单 - textMap: { - update: '编辑', - create: '新增', - detail: '详情' - }, // 表头显示标题 compDict: { '1': 'list-wellcover-data', '2': 'list-liquid-data', diff --git a/src/views/wellManage/detailWell.vue b/src/views/wellManage/detailWell.vue index 6db57b1..82c3334 100644 --- a/src/views/wellManage/detailWell.vue +++ b/src/views/wellManage/detailWell.vue @@ -126,7 +126,6 @@ }, computed: { areaName() { - debugger if (this.wellForm.quName) { return this.wellForm.quName + this.wellForm.areaName } else {