1. 将场景图片的分类修改为从服务端动态获取;
2. 问题整改节目中的问题复现功能修改为可拖动对话框且移除背景模态框;
已修改6个文件
126 ■■■■■ 文件已修改
src/api/fysp/domainApi.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/CompGenericWrapper.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/enum/mediaFile.js 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/components/ArbitraryPhoto.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/components/CompProRecent.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/domainApi.js
@@ -14,5 +14,12 @@
  // 获取巡查任务层次类型
  fetchLevelType() {
    return $fysp.get(`domainitem/level`).then((res) => res.data);
  },
  // 获取场景图片(任意拍)类型
  fetchMediaFileType(sceneType) {
    return $fysp
      .get(`domainitem/mediaFileType`, { params: { sceneType } })
      .then((res) => res.data);
  }
};
src/api/index.js
@@ -3,10 +3,10 @@
const debug = false;
let ip1 = 'http://47.100.191.150:9005/';
let ip1_file = 'http://47.100.191.150:9005/';
// let ip1 = 'https://fyami.com.cn:447/';
// let ip1_file = 'https://fyami.com.cn:447/';
// let ip1 = 'http://47.100.191.150:9005/';
// let ip1_file = 'http://47.100.191.150:9005/';
let ip1 = 'https://fyami.com.cn:447/';
let ip1_file = 'https://fyami.com.cn:447/';
let ip2 = 'https://fyami.com.cn/';
let ip2_file = 'https://fyami.com.cn/';
src/components/CompGenericWrapper.vue
@@ -7,6 +7,8 @@
    @opened="$emit('update:visible', true)"
    @closed="$emit('update:visible', false)"
    destroy-on-close
    :draggable="draggable"
    :modal="modal"
  >
    <div v-if="visible">
      <slot name="content"></slot>
@@ -38,6 +40,11 @@
  type: {
    type: String,
    default: 'normal'
  },
  draggable: Boolean,
  modal: {
    type: Boolean,
    default: true
  }
});
const typeOptions = ref([
src/enum/mediaFile.js
@@ -1,19 +1,36 @@
import domainApi from '@/api/fysp/domainApi.js';
// 飞羽监管系统
function enumMediaFile(sceneType, allOption = true) {
  let l;
  switch (parseInt(sceneType)) {
    case 5:
      l = _enumMediaFile_restaurant();
      break;
    default:
      l = _enumMediaFile_common();
      break;
  }
  if (!allOption) {
    l.shift();
  }
  return domainApi.fetchMediaFileType(sceneType).then((res) => {
    let l = [
      {
        label: '全部',
        value: null
      }
    ];
    for (const key in res) {
      const value = res[key];
      l.push({
        label: value,
        value: parseInt(key)
      });
    }
  return l;
    // switch (parseInt(sceneType)) {
    //   case 5:
    //     l = _enumMediaFile_restaurant();
    //     break;
    //   default:
    //     l = _enumMediaFile_common();
    //     break;
    // }
    if (!allOption) {
      l.shift();
    }
    return l;
  });
}
function _enumMediaFile_common() {
src/views/fysp/check/components/ArbitraryPhoto.vue
@@ -14,7 +14,12 @@
    @contextmenu="closeContextMenu"
    class="container"
  > -->
  <div v-if="showMenu" ref="menu" :style="menuStyle" class="context-menu">
  <div
    v-if="showMenu && !menuLoading"
    ref="menu"
    :style="menuStyle"
    class="context-menu"
  >
    <template v-for="(item, index) in menuItems" :key="index">
      <el-popover v-if="item.children" placement="right-start" trigger="hover">
        <template #reference>
@@ -58,20 +63,9 @@
      loading: true,
      // 右键图片弹出菜单控制
      showMenu: false,
      menuLoading: true,
      menuStyle: undefined,
      // menuItems: [
      //   { label: '复制图片', action: 'copy' },
      //   {
      //     label: '移动到',
      //     children: [
      //       {
      //         action: 'move',
      //         label: v.typeName,
      //         value: v.typeId
      //       }
      //     ]
      //   }
      // ],
      allMoveActions: [],
      closeContextMenuListenr: undefined,
      // 右键选中的图片
      selectedFileElement: undefined,
@@ -82,21 +76,14 @@
  },
  computed: {
    menuItems() {
      const sceneTypeId = this.subtask.sceneTypeId;
      const items = enumMediaFile(sceneTypeId, false)
        .filter((v) => {
          return v.value != this.selectedTypeId;
        })
        .map((v) => {
          return {
            action: 'move',
            label: v.label,
            value: v.value
          };
        });
      return [
        // { label: '复制到剪贴板', action: 'copy' },
        { label: '移动到', children: items }
        {
          label: '移动到',
          children: this.allMoveActions.filter((v) => {
            return v.value != this.selectedTypeId;
          })
        }
      ];
    }
  },
@@ -113,6 +100,8 @@
      }
    };
    document.addEventListener('click', this.closeContextMenuListenr);
    this.initMenuItems();
  },
  unmounted() {
    document.removeEventListener('click', this.closeContextMenuListenr);
@@ -251,6 +240,22 @@
          }
        );
      }, 'image/png'); // 同样,这里也可以指定其他格式,如 'image/jpeg'
    },
    // 初始化场景图片的类型菜单
    initMenuItems() {
      this.menuLoading = true;
      const sceneTypeId = this.subtask.sceneTypeId;
      enumMediaFile(sceneTypeId, false)
        .then((res) => {
          this.allMoveActions = res.map((v) => {
            return {
              action: 'move',
              label: v.label,
              value: v.value
            };
          });
        })
        .finally(() => (this.menuLoading = false));
    }
  }
};
src/views/fysp/check/components/CompProRecent.vue
@@ -1,5 +1,5 @@
<template>
  <CompGenericWrapper type="dialog">
  <CompGenericWrapper type="dialog" draggable :modal="false">
    <template #content>
      <el-tabs v-model="activeName" type="card">
        <el-tab-pane