1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
  <el-button icon="Download" type="success" @click="dialogVisible = true"
    >导出报告</el-button
  >
  <el-dialog v-model="dialogVisible" :title="name" width="500">
    <el-text tag="b" size="large">数据范围确认</el-text>
    <el-text tag="div">区域:{{ locationText }}</el-text>
    <el-text tag="div">类型:{{ scenetype.label }}</el-text>
    <el-text tag="div">时间:{{ timeText }}</el-text>
    <template #footer>
      <div class="dialog-footer">
        <el-row align="middle">
          <el-checkbox v-model="forceUpdate" label="强制生成新报告" />
          <el-tooltip placement="bottom-start" effect="light">
            <template #content>
              <el-text tag="b" size="small">不勾选:</el-text><br />
              <el-text size="small"
                >不勾选时,如果已生成过相同区域的报告,则直接获取该份报告记录</el-text
              ><br />
              <el-text tag="b" size="small">勾选:</el-text><br />
              <el-text size="small"
                >勾选时,无论是否有历史记录,都会启动报告生成任务覆盖旧记录,可在后台任务界面查看任务进度</el-text
              ><br />
            </template>
            <el-icon
              class="m-l-8 cursor-p"
              :size="16"
              color="var(--el-color-warning)"
              ><QuestionFilled
            /></el-icon>
          </el-tooltip>
        </el-row>
        <div>
          <el-button @click="dialogVisible = false">取消</el-button>
          <el-button type="primary" @click="handleSubmit">确定</el-button>
        </div>
      </div>
    </template>
  </el-dialog>
</template>
 
<script>
import dayjs from 'dayjs';
 
export default {
  props: ['name', 'locations', 'time', 'scenetype'],
  emits: ['submit'],
  data() {
    return {
      dialogVisible: false,
      forceUpdate: false
    };
  },
  computed: {
    locationText() {
      const loc = this.locations;
      let text = '';
      text = loc.pName == loc.cName ? loc.pName : loc.pName + loc.cName;
      text += loc.dName;
      return text;
    },
    timeText() {
      return dayjs(this.time).format('YYYY年MM月');
    }
  },
  methods: {
    handleSubmit() {
      this.$emit('submit', this.forceUpdate);
    }
  }
};
</script>
<style scoped>
.dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2px;
}
</style>