riku
2025-09-20 0796eebe3520fafb0ac5d36ee584af81506d7e9c
src/views/fysp/data-product/ProdSceneReport.vue
@@ -5,6 +5,7 @@
    </template>
    <template #aside>
      <SideList
        legend
        :items="subtasks"
        :loading="sideLoading"
        @item-click="chooseSubtask"
@@ -12,6 +13,7 @@
    </template>
    <template #main>
      <el-scrollbar class="el-scrollbar" v-loading="mainLoading">
        <div></div>
        <CompSceneConstructionInfo
          title="A、基本信息"
          :scene="formScene"
@@ -71,22 +73,24 @@
      </el-scrollbar>
    </template>
  </BaseContentLayout>
  <el-dialog
    v-model="anyPhotoDialog"
    width="66%"
    title="任意图片"
    destroy-on-close
  >
    <ArbitraryPhoto
      :max-select="1"
      :readonly="false"
      :subtask="curSubtask.data"
      @selectByAnyPhonoEvent="handleSelectAnyPhoto"
      :defaultFile="[sceneImg]"
    >
    </ArbitraryPhoto>
  </el-dialog>
  <el-dialog
  <ArbitraryPhoto
    v-if="anyPhotoDialog"
    v-model:dialog-visible="anyPhotoDialog"
    :max-select="1"
    :readonly="false"
    :subtask="curSubtask.data"
    @submit="handleSelectAnyPhoto"
    :defaultFile="[sceneImg]"
  ></ArbitraryPhoto>
  <FYImageSelectDialog
    v-model:dialog-visible="deiveceImgDialog"
    title="设备图片"
    :max-select="1"
    :typeList="showDeviceTypeList"
    :typeImgMap="showDeviceImgMap"
    @submit="handleSelectDevicePhoto"
  ></FYImageSelectDialog>
  <!-- <el-dialog
    title="设备图片"
    width="66%"
    v-model="deiveceImgDialog"
@@ -94,15 +98,16 @@
  >
    <CompDevicePhono
      @selectPhonoEvent="handleSelectDevicePhoto"
      :imgPathsDataSource="showDeviceImgList"
      :imgPathsDataSource="showDeviceImgMap"
    >
    </CompDevicePhono>
  </el-dialog>
  </el-dialog> -->
</template>
<script setup>
import { ref, computed } from 'vue';
import { $fysp } from '@/api/index';
import problemApi from '@/api/fysp/problemApi';
import taskApi from '@/api/fysp/taskApi';
import sceneApi from '@/api/fysp/sceneApi';
import deviceApi from '@/api/fysp/deviceApi';
@@ -111,10 +116,10 @@
import { enumDevice, toLabel } from '@/enum/device/device';
import { exportDocx } from '@/utils/doc';
import right_triangle from '@/assets/image/right_triangle.png';
import ProCheckProxy from '@/views/fysp/check/ProCheckProxy';
import CompSceneConstructionInfo from '@/views/fysp/scene/CompSceneConstructionInfo.vue';
import ArbitraryPhoto from '@/views/fysp/check/components/ArbitraryPhoto.vue';
import CompDevicePhono from '@/views/fysp/check/components/CompDevicePhono.vue';
import CompImgInfo from '@/views/fysp/data-product/components/CompImgInfo.vue';
import CompProblemTable from './components/CompProblemTable.vue';
import dayjs from 'dayjs';
@@ -152,8 +157,9 @@
  taskApi.getSubtaskSummary(param).then((res) => {
    const list = [];
    res.forEach((s) => {
      const t = getSubtaskType(s);
      const t = ProCheckProxy.getSubtaskType(s);
      list.push({
        status: s.subtask.status,
        type: t,
        title: s.stName,
        categoly: s.stPlanTime.split('T')[0],
@@ -216,36 +222,37 @@
// 设备图片选择对话框
const deiveceImgDialog = ref(false);
const showDeviceIndex = ref(0);
const showDeviceImgList = ref([]);
const showDeviceTypeList = ref([]);
const showDeviceImgMap = ref(new Map());
// 设备图片列表
const deviceList = ref([]);
function showDevicePhotoDialog(device, index) {
  showDeviceIndex.value = index;
  deiveceImgDialog.value = true;
  showDeviceImgList.value = [];
  showDeviceTypeList.value = [
    { typeId: device.topTypeId, typeName: device._deviceTypeName }
  ];
  showDeviceImgMap.value.clear();
  let imgList = [];
  device._status
    .map((s) => s._picUrls)
    .forEach((pics) => {
      imgList = imgList.concat(
        pics.map((p) => {
          return {
            topTypeId: device.topTypeId,
            _picUrl: p
          };
          return { url: p };
        })
      );
    });
  // console.log(imgList);
  showDeviceImgList.value = imgList;
  showDeviceImgMap.value.set(device.topTypeId, imgList);
}
function handleSelectDevicePhoto(data) {
  deiveceImgDialog.value = false;
  if (data.length > 0) {
    deviceList.value[showDeviceIndex.value]._showStatusPic = data[0]._picUrl;
    deviceList.value[showDeviceIndex.value]._showStatusPic = data[0].url;
  }
}
@@ -311,7 +318,7 @@
function fetchProblems(s) {
  curProList.value = [];
  taskApi.getProBySubtask(s.data.stGuid).then((res) => {
  problemApi.getProBySubtask(s.data.stGuid).then((res) => {
    curProList.value = res;
    // 生成巡查描述文本
@@ -357,10 +364,14 @@
    const d2 =
      i + 1 < deviceList.value.length ? deviceList.value[i + 1] : undefined;
    _deviceList.push({
      _showStatusPic_1: d1._showStatusPic,
      _showStatusPic_1: d1._showStatusPic ? d1._showStatusPic : right_triangle,
      _deviceTypeName_1: d1._deviceTypeName,
      // hasPic2: d2 ? true : false,
      _showStatusPic_2: d2 ? d2._showStatusPic : right_triangle,
      _showStatusPic_2: d2
        ? d2._showStatusPic
          ? d2._showStatusPic
          : right_triangle
        : right_triangle,
      _deviceTypeName_2: d2 ? d2._deviceTypeName : ''
    });
  }
@@ -404,16 +415,16 @@
    }
  }
  const date = dayjs(curSubtask.value.data.stPlanTime).format('MM月DD日');
  console.log(param);
  docLoading.value = true;
  exportDocx(
    '/单体模版.docx',
    '/单体模版-v1.0.docx',
    param,
    `${param.sceneName}单体(${date}).docx`,
    {
      horizontalHeight: 368,
      verticalWidth: 266
      verticalWidth: 266,
      scale: 1.367
    }
  ).finally(() => (docLoading.value = false));
}