riku
2025-09-20 0796eebe3520fafb0ac5d36ee584af81506d7e9c
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
  <BaseProdProcess
    v-model:active="active"
    @onStep1="onStep1"
    @onStep2="onStep2"
    @onStep3="onStep3"
    :loading="loading"
  >
    <template #step2="{ contentHeight }">
      <el-table
        id="prod-scene-table"
        :data="tableData"
        v-loading="loading"
        :height="contentHeight + 'px'"
        table-layout="fixed"
        :show-overflow-tooltip="true"
        size="small"
        border
      >
        <el-table-column fixed="left" prop="index" label="编号" width="50">
        </el-table-column>
        <el-table-column
          fixed="left"
          prop="name"
          label="名称"
          :show-overflow-tooltip="true"
          min-width="200"
        >
        </el-table-column>
        <el-table-column prop="type" label="类型" width="50" />
        <el-table-column prop="status" label="状态" width="60" />
        <el-table-column prop="stage" label="阶段" width="90" />
        <!-- <el-table-column prop="provincename" label="省" width="90" />
        <el-table-column prop="cityname" label="市" width="90" />
        <el-table-column prop="districtname" label="区县" width="90" /> -->
        <el-table-column prop="townname" label="街道" width="110" />
        <el-table-column prop="location" label="地址" width="200" />
        <el-table-column prop="contacts" label="联系人" width="70" />
        <el-table-column prop="contactst" label="电话" width="96" />
        <!-- <el-table-column prop="longitude" label="经度" width="110" />
        <el-table-column prop="latitude" label="纬度" width="110" /> -->
        <!-- <el-table-column
          prop="updatedate"
          label="更新时间"
          width="140"
          :formatter="timeFormat"
        /> -->
      </el-table>
    </template>
  </BaseProdProcess>
</template>
<script setup>
import { ref, inject } from 'vue';
import dayjs from 'dayjs';
import BaseProdProcess from '@/views/fysp/data-product/components/BaseProdProcess.vue';
import dataprodbaseApi from '@/api/fysp/dataprodbaseApi.js';
import { conversionFromTable } from '@/utils/excel';
import { useProdStepChange } from '@/views/fysp/data-product/prod-step-change.js';
 
const { active, changeActive } = useProdStepChange();
const loading = ref(false);
const tableData = ref([]);
 
function onStep1(opt) {
  loading.value = true;
  dataprodbaseApi
    .fetchProdSceneInfo(opt)
    .then((res) => {
      if (res.success) {
        tableData.value = res.data.map((item) => ({
          status: item.status,
          stage: item.stage,
          ...item.scene
        }));
      }
      changeActive();
    })
    .finally(() => {
      loading.value = false;
    });
}
 
function onStep2() {
  changeActive();
}
 
function onStep3(val) {
  if (val.downloadType == '1') {
    loading.value = true;
    conversionFromTable('prod-scene-table', '巡查场景清单');
    loading.value = false;
  }
}
 
function timeFormat(row, column, cellValue, index) {
  return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss');
}
</script>