Bläddra i källkod

feat: 图片选取设置

zhangjie 4 dagar sedan
förälder
incheckning
71b75db2c3

+ 2 - 2
src/components/select-img-area/index.vue

@@ -103,7 +103,7 @@
     splitUrl: string;
   }
 
-  const emit = defineEmits(['update:modelValue', 'save', 'close']);
+  const emit = defineEmits(['update:modelValue', 'change', 'close']);
 
   // 弹窗控制
   const visible = ref(false);
@@ -260,7 +260,7 @@
       };
     });
     emit('update:modelValue', areas);
-    emit('save', areas);
+    emit('change', areas);
     close();
   };
 

+ 20 - 2
src/views/mark/group-edit/GroupRuleForm.vue

@@ -180,6 +180,14 @@
       </template>
     </template>
   </el-form>
+
+  <!-- 添加遮盖区域弹窗 -->
+  <SelectImgArea
+    ref="imgAreaRef"
+    v-model="selectedAreas"
+    :img-list="imgList"
+    @change="onImgAreaChange"
+  />
 </template>
 
 <script setup lang="ts">
@@ -192,6 +200,9 @@
     THREE_EVALUATION_RULE,
   } from '@/constants/enumerate';
   import { deepCopy } from '@/utils/utils';
+  import { CoverArea } from '@/api/types/common';
+
+  import SelectImgArea from '@/components/select-img-area/index.vue';
 
   defineOptions({
     name: 'GroupParamEdit',
@@ -245,9 +256,16 @@
     }
   }
 
+  const imgAreaRef = ref();
+  const selectedAreas = ref<CoverArea[]>([]);
+  // TODO:获取imgList
+  const imgList = ref([]);
   function onSetMarkingArea() {
-    // TODO: 实现图片显示设置
-    console.log('onSetMarkingArea');
+    selectedAreas.value = formModel.value.markingArea || [];
+    imgAreaRef.value.open();
+  }
+  function onImgAreaChange(areas: CoverArea[]) {
+    formModel.value.markingArea = areas;
   }
 
   // 监听表单数据变化,同步到父组件

+ 14 - 2
src/views/subject/components/SubjectSettingDialog.vue

@@ -98,7 +98,8 @@
     </template>
   </el-dialog>
 
-  <!-- TODO: 添加遮盖区域弹窗 -->
+  <!-- 添加遮盖区域弹窗 -->
+  <SelectImgArea ref="imgAreaRef" v-model="selectedAreas" :img-list="imgList" />
 </template>
 
 <script setup lang="ts">
@@ -112,6 +113,9 @@
   import useLoading from '@/hooks/loading';
   import { objAssign, objModifyAssign } from '@/utils/utils';
 
+  import SelectImgArea from '@/components/select-img-area/index.vue';
+  import { CoverArea } from '@/api/types/common';
+
   defineOptions({
     name: 'SubjectSettingDialog',
   });
@@ -176,7 +180,14 @@
   };
 
   // 添加遮盖区域
-  const addCoverArea = () => {};
+  const imgAreaRef = ref();
+  const selectedAreas = ref<CoverArea[]>([]);
+  // TODO:获取imgList
+  const imgList = ref([]);
+  const addCoverArea = () => {
+    selectedAreas.value = formModel.sheetConfig || [];
+    imgAreaRef.value.open();
+  };
 
   // 提交
   const { loading, setLoading } = useLoading();
@@ -186,6 +197,7 @@
 
     setLoading(true);
     const datas = objAssign(formModel, {});
+    datas.sheetConfig = selectedAreas.value;
     let res = true;
     await saveSubjectSetting(datas).catch(() => {
       res = false;

+ 30 - 1
src/views/system/comp-test/svg-view.vue

@@ -8,7 +8,7 @@
         class="icon-card"
         @click="copyToClipboard(icon)"
       >
-        <SvgIcon :name="icon" class="svg-display" />
+        <SvgIcon :name="icon" class="svg-display" :inherit-color="false" />
         <span class="icon-name">{{ icon }}</span>
       </div>
     </div>
@@ -26,20 +26,49 @@
 
   const svgFileNames = [
     'icon-add',
+    'icon-ai',
     'icon-apply',
+    'icon-arrow-right',
+    'icon-arrow',
     'icon-assign',
     'icon-base',
+    'icon-data-check',
     'icon-delete',
     'icon-error',
+    'icon-exam-manage',
     'icon-file',
     'icon-home',
     'icon-import',
+    'icon-system-init-s',
+    'icon-issue-paper',
+    'icon-jump',
+    'icon-log',
+    'icon-logo',
     'icon-logout',
+    'icon-mark-manage-s',
+    'icon-mark-manage',
+    'icon-menu',
+    'icon-notice',
     'icon-org',
     'icon-print',
+    'icon-reject-manage',
+    'icon-review-s',
+    'icon-scan-progress',
+    'icon-score-export-s',
+    'icon-score-query',
+    'icon-score-review',
+    'icon-score-view-s',
+    'icon-score',
+    'icon-setting',
+    'icon-student-manage',
+    'icon-subject-analysis',
+    'icon-subject-manage',
     'icon-success',
     'icon-system',
+    'icon-user-manage',
     'icon-user',
+    'icon-view',
+    'icon-warning-s',
   ];
 
   const svgIcons = ref(svgFileNames);