浏览代码

新主题

ZaiZai 1 年之前
父节点
当前提交
eeb3741034

+ 1 - 1
src/global/components/hc-new-card/hc-new-card.vue

@@ -70,7 +70,7 @@ const props = defineProps({
     },
     padding: {
         type: Boolean,
-        default: false,
+        default: true,
     },
 })
 

+ 1 - 1
src/global/components/hc-tab-card/hc-tab-card.vue

@@ -1,5 +1,5 @@
 <template>
-    <HcNewCard :scrollbar="scrollbar" class="hc-tab-card-box">
+    <HcNewCard :padding="false" :scrollbar="scrollbar" class="hc-tab-card-box">
         <template #header>
             <div class="tab-card-header-tabs">
                 <template v-for="item in tabsData" :key="item.key">

+ 11 - 17
src/views/tentative/detect/test.vue

@@ -42,8 +42,8 @@
                 <HcIcon v-show="isWbsTreeShow" name="arrow-left-s" />
                 <HcIcon v-show="!isWbsTreeShow" name="arrow-right-s" />
             </div>
-            <HcNewCard padding>
-                <template #header>
+            <HcTabCard :tabs="authBtnTabdata" :tab-key="authBtnTabKey" @change="authBtnTabClick">
+                <template #extra>
                     <HcTooltip keys="tentative_detect_test_add">
                         <el-button :disabled="!primaryKeyId" hc-btn color="#37c0fe" style="color: white;" @click="addFormModalClick">
                             <HcIcon name="add-circle" />
@@ -105,16 +105,6 @@
                         </el-button>
                     </HcTooltip>
                 </template>
-                <template #extra>
-                    <el-button :type="authBtnTabKey === '1' ? 'primary' : ''" hc-btn @click="authBtnTabClick('1')">
-                        <HcIcon name="folder-user" />
-                        <span>施工自检</span>
-                    </el-button>
-                    <el-button :type="authBtnTabKey === '2' ? 'primary' : ''" hc-btn @click="authBtnTabClick('2')">
-                        <HcIcon name="folder-shield" />
-                        <span>监理质检</span>
-                    </el-button>
-                </template>
                 <template #search>
                     <div class="w-40">
                         <el-input
@@ -196,7 +186,7 @@
                 <template #action>
                     <HcPages :pages="searchForm" @change="pageChange" />
                 </template>
-            </HcNewCard>
+            </HcTabCard>
         </div>
 
         <!-- 查看附件 -->
@@ -384,10 +374,14 @@ const wbsElTreeClick = ({ data, keys }) => {
 
 //身份按钮切换数据
 const authBtnTabKey = ref('1')
-const authBtnTabClick = (val) => {
-    if (val !== authBtnTabKey.value) {
-        authBtnTabKey.value = val
-        searchForm.value.type = val
+const authBtnTabdata = ref([
+    { key: '1', name: '施工质检' },
+    { key: '2', name: '监理质检' },
+])
+const authBtnTabClick = (item) => {
+    if (item.key !== authBtnTabKey.value) {
+        authBtnTabKey.value = item.key
+        searchForm.value.type = item.key
         searchForm.value.current = 1
         getTableData()
     }