hcong
2024-11-15 18eee6f8818b864d1f8d8fb56298620921f909e4
src/views/fysp/check/ProCheck.vue
@@ -8,7 +8,11 @@
      </SearchBar>
    </template>
    <template #aside>
      <SideList :items="subtasks" :loading="sideLoading" @item-click="chooseSubtask"></SideList>
      <SideList
        :items="subtasks"
        :loading="sideLoading"
        @item-click="chooseSubtask"
      ></SideList>
    </template>
    <template #main>
      <ToolBar
@@ -17,18 +21,23 @@
        :buttons="buttons"
        :loading="mainLoading"
      ></ToolBar>
      <el-scrollbar v-if="curProList.length > 0" class="el-scrollbar" v-loading="mainLoading">
        <CompProblemCard
          v-if="compProblemCardVisible"
          :key="i"
          v-for="(p, i) in curProList"
          :index="i + 1"
          :problem="p"
          :subtask="curSubtask.data"
          :topTask="topTask"
          @updated="onProSubmited"
          @submit="updateSubtask"
        ></CompProblemCard>
      <el-scrollbar
        v-if="curProList.length > 0"
        class="el-scrollbar"
        v-loading="mainLoading"
      >
        <template v-if="compProblemCardVisible">
          <CompProblemCard
            :key="i"
            v-for="(p, i) in curProList"
            :index="i + 1"
            :problem="p"
            :subtask="curSubtask.data"
            :topTask="topTask"
            @updated="onProSubmited"
            @submit="updateSubtask"
          ></CompProblemCard>
        </template>
      </el-scrollbar>
      <el-empty v-else description="暂无记录" v-loading="mainLoading" />
    </template>
@@ -36,7 +45,7 @@
  <el-dialog
    v-model="proAddOrUpdDialogVisible"
    :before-close="proAddOrUpdDialogClose"
    width="80%"
    width="50%"
    title="新增问题"
  >
    <CompProblemAddOrUpd
@@ -47,29 +56,22 @@
      @submited="newProSubmit"
    />
  </el-dialog>
  <el-dialog
    v-model="anyPhotoDialog"
    :before-close="beforeAnyPhotoDialogclose"
    width="80%"
    title="任意图片"
  >
    <ArbitraryPhoto
      v-if="anyPhotoDialog"
      :readonly="true"
      :subtask="curSubtask.data"
      ref="arbitraryPhotoRef"
      @selectByAnyPhonoEvent="handleCloseCheckAnyPhono"
    >
    </ArbitraryPhoto>
  </el-dialog>
  <ArbitraryPhoto
    v-if="anyPhotoDialog"
    v-model:dialog-visible="anyPhotoDialog"
    :readonly="true"
    :subtask="curSubtask.data"
    ref="arbitraryPhotoRef"
  ></ArbitraryPhoto>
  <el-drawer
    :direction="rtl"
    direction="ltr"
    v-model="deviceShowDialog"
    :before-close="beforeDeviceShowDialogclose"
    title="设施设备"
    size="65%"
    size="45%"
  >
    <CompDeviceShowTest v-if="deviceShowDialog" ref="deviceShowRef"> </CompDeviceShowTest>
    <CompDeviceShowTest v-if="deviceShowDialog" ref="deviceShowRef">
    </CompDeviceShowTest>
  </el-drawer>
</template>
@@ -77,14 +79,9 @@
import ArbitraryPhoto from './components/ArbitraryPhoto.vue';
import taskApi from '@/api/fysp/taskApi';
import ProCheckProxy from './ProCheckProxy';
import { ElMessageBox, ElNotification, ElMessage } from 'element-plus';
import CompProblemAddOrUpd from './components/CompProblemAddOrUpd.vue';
import CompDeviceShow from './components/CompDeviceShow.vue';
import CompProblemCard from './components/CompProblemCard.vue';
import CompSubTaskStatistic from './components/CompSubTaskStatistic.vue';
import CompProRecent from './components/CompProRecent.vue';
import CompDeviceShowTest from './components/CompDeviceShowTest.vue';
export default {
  components: {
@@ -92,8 +89,7 @@
    CompSubTaskStatistic,
    CompProblemAddOrUpd,
    ArbitraryPhoto,
    CompDeviceShowTest,
    CompProRecent
    CompDeviceShowTest
  },
  data() {
    return {
@@ -126,7 +122,7 @@
          }
        },
        {
          name: '任意图片',
          name: '场景图片',
          color: 'warning',
          click: () => {
            this.anyPhotoDialog = true;
@@ -138,12 +134,12 @@
          click: () => {
            this.openDeviceShowDialog();
          }
        },
        {
          name: '批量审核',
          color: 'primary',
          click: () => {}
        }
        // {
        //   name: '批量审核',
        //   color: 'primary',
        //   click: () => {}
        // }
      ]
    };
  },
@@ -239,7 +235,7 @@
    // 关闭设备图弹窗
    beforeDeviceShowDialogclose(done) {
      // this.deviceShowDialog = false;
      done()
      done();
    },
    // 关闭任意图片弹窗
    beforeAnyPhotoDialogclose() {
@@ -253,12 +249,16 @@
    },
    //查询子任务统计信息
    search(formSearch) {
      this.topTask = formSearch.obj;
      this.topTask = formSearch.topTask;
      this.sideLoading = true;
      this.mainLoading = true;
      this.curProList = [];
      this.curSubtask = {};
      taskApi.getSubtaskSummary(formSearch).then((res) => {
      const param = {
        topTaskId: formSearch.topTask.tguid,
        sceneTypeId: formSearch.sceneTypeId
      };
      taskApi.getSubtaskSummary(param).then((res) => {
        const list = [];
        res.forEach((s) => {
          const t = this.getSubtaskType(s);
@@ -307,20 +307,19 @@
        });
    },
    // 问题卡片组件主动发起刷新父组件数据
    updateSubtask(isOk) {
    updateSubtask(refresh = true) {
      this.curSubtask.data.proCheckedNum++;
      this.curSubtask.type = this.getSubtaskType(this.curSubtask.data);
      if (!isOk) {
        return;
      if (refresh) {
        this.refreshCurrSubtask();
      }
      this.refreshCurrSubtask();
    },
    onProSubmited(isOk) {
      this.proAddOrUpdDialogClose();
      if (!isOk) {
        return;
      }
      this.updateSubtask(isOk);
      this.updateSubtask();
    },
    newProSubmit(isOk) {
      this.proAddOrUpdDialogVisible = false;