Browse Source

修改按钮样式

plg 4 months ago
parent
commit
c0e338221e
1 changed files with 26 additions and 2 deletions
  1. 26 2
      src/components/CpdmLeave.vue

+ 26 - 2
src/components/CpdmLeave.vue

@@ -279,6 +279,7 @@ const leaveStatus = (val: string) => {
 
 //类型方法
 const typeFun = (val: string) => {
+    type.value = val;
     if (val == '1') {
         //清空表单
         ruleFormRef.value.clearValidate()
@@ -374,10 +375,18 @@ defineExpose({ open })
             <template #header="{ close, titleId, titleClass }">
                 <!-- <img src="../assets/zs/top_leave.png" alt="" > -->
                 <div class="leave_title"></div>
-                <el-radio-group v-model="type" size="large" @change="typeFun" style="margin-left:20px">
+                <div
+                    style="display: inline-flex;background-color: #EDEDED ;padding: 4px;border-radius: 40px;margin-left: 20px;">
+
+                    <span :class="{ button_leave_active: type == '1', button_leave_default: type == '2' }"
+                        @click="typeFun('1')">我要请假</span>
+                    <span :class="{ button_leave_active: type == '2', button_leave_default: type == '1' }"
+                        @click="typeFun('2')">请假记录</span>
+                </div>
+                <!-- <el-radio-group v-model="type" size="large" @change="typeFun" style="margin-left:20px">
                     <el-radio-button label="我要请假" value="1" />
                     <el-radio-button label="请假记录" value="2" />
-                </el-radio-group>
+                </el-radio-group> -->
                 <div v-show="type == '1'" class="leave">
                     <el-form ref="ruleFormRef" style="display: flex;flex-wrap: wrap;" :model="ruleForm" :rules="rules"
                         :validate-on-rule-change=false label-width="auto" class="demo-ruleForm" :size="formSize"
@@ -487,6 +496,21 @@ defineExpose({ open })
 </template>
 
 <style lang="scss" scoped>
+.button_leave_active {
+    background-color: #ffffff;
+    padding: 6px 12px;
+    border-radius: 40px;
+    font-size: 16px;
+    color: #222222;
+}
+
+.button_leave_default {
+    padding: 6px 12px;
+    border-radius: 40px;
+    font-size: 16px;
+    color: #999999;
+}
+
 .outt {
     :deep(.el-dialog) {
         padding: 0px !important;