소스 검색

antdv a-switch 无法@.stop

CzRger 1 개월 전
부모
커밋
f930c835e4
3개의 변경된 파일12개의 추가작업 그리고 10개의 파일을 삭제
  1. 2 2
      src/style/antdv.scss
  2. 8 5
      src/views/manage/knowledge/documents/document/stage-index.vue
  3. 2 3
      src/views/manage/model/index.vue

+ 2 - 2
src/style/antdv.scss

@@ -1,10 +1,10 @@
 .ant-switch-small {
   .ant-switch-inner {
     .ant-switch-inner-checked {
-      margin-top: 2px;
+      margin-top: 2px !important;
     }
     .ant-switch-inner-unchecked {
-      margin-top: -12px;
+      margin-top: -12px !important;
     }
   }
 }

+ 8 - 5
src/views/manage/knowledge/documents/document/stage-index.vue

@@ -84,17 +84,19 @@
                 : 'transparent',
             }"
             @click="
-              state.query.selectedMap.has(row.id)
-                ? state.query.selectedMap.delete(row.id)
-                : state.query.selectedMap.set(row.id, row)
+              state.isSelect
+                ? state.query.selectedMap.has(row.id)
+                  ? state.query.selectedMap.delete(row.id)
+                  : state.query.selectedMap.set(row.id, row)
+                : undefined
             "
           >
             <div class="flex items-center gap-[0.5rem]">
               <div class="text-[#303133] text-[1.13rem] font-bold" v-title>
                 {{ row.name }}
               </div>
-              <div class="ml-auto">
-                <el-switch v-model="row.enable" size="small" />
+              <div class="ml-auto" @click.stop="onSwitch(row)">
+                <a-switch v-model:checked="row.enable" size="small" />
               </div>
             </div>
             <div
@@ -295,6 +297,7 @@ const onKnowledge = (row: any = null) => {
     state.knowledgeSelect.show = true
   }
 }
+const onSwitch = (row) => {}
 onMounted(() => {
   onReset()
 })

+ 2 - 3
src/views/manage/model/index.vue

@@ -112,13 +112,12 @@
               class="flex items-center text-[0.75rem] text-[#6F7889] gap-[var(--czr-gap)] mt-[0.5rem]"
             >
               <div>URL:74.10.28.118:8080</div>
-              <div class="ml-auto">
+              <div class="ml-auto" @click.stop="onSwitch(row)">
                 <a-switch
                   v-model:checked="row.enable"
                   checked-children="启用"
                   un-checked-children="停用"
                   size="small"
-                  @click.stop="onSwitch(row)"
                 />
               </div>
               <el-tooltip content="编辑" effect="light" placement="top">
@@ -229,7 +228,7 @@ const onPage = (pageNum, pageSize) => {
         p6: n % 4,
         p7: n % 2,
         tags: n % 2 ? '1,2,3,41,2,3,41,2,3,41,2,3,41,2,3,4' : '',
-        enable: true,
+        enable: n % 2 == 0,
       })
     }
     state.query.result.data = arr