156 288
    }
157 289
  },
158 290
  methods: {
291
    checkAllGroupChange () {
292
      if (this.activePanel === 'tab-1') {
293
        if (this.social0.length === 4) {
294
          this.indeterminate0 = false
295
          this.checkAll0 = true
296
        } else if (this.social0.length > 0) {
297
          this.indeterminate0 = true
298
          this.checkAll0 = false
299
        } else {
300
          this.indeterminate0 = false
301
          this.checkAll0 = false
302
        }
303
      } else {
304
        if (this.social1.length === 10) {
305
          this.indeterminate1 = false
306
          this.checkAll1 = true
307
        } else if (this.social1.length > 0) {
308
          this.indeterminate1 = true
309
          this.checkAll1 = false
310
        } else {
311
          this.indeterminate1 = false
312
          this.checkAll1 = false
313
        }
314
      }
315
    },
316
    handleCheckAll () {
317
      if (this.activePanel === 'tab-1') {
318
        if (this.indeterminate0) {
319
          this.checkAll0 = false
320
        } else {
321
          this.checkAll0 = !this.checkAll0
322
        }
323
        this.indeterminate0 = false
324
        if (this.checkAll0) {
325
          this.social0 = ['姓名', '员工编号', '职务', '考勤状态']
326
        } else {
327
          this.social0 = []
328
        }
329
      } else {
330
        if (this.indeterminate1) {
331
          this.checkAll1 = false
332
        } else {
333
          this.checkAll1 = !this.checkAll1
334
        }
335
        this.indeterminate1 = false
336
        if (this.checkAll1) {
337
          this.social1 = ['姓名', '员工编号', '职务', '出勤天数(天)', '迟到次数(次)', '迟到时长(h)', '早退次数(次)', '早退时长(h)', '旷工次数(次)', '旷工时长(天)']
338
        } else {
339
          this.social1 = []
340
        }
341
      }
342
    },
343
    onTriggerClick () {
344
      if (this.activePanel === 'tab-1') {
345
        this.customVisibled0 = true
346
      } else {
347
        this.customVisibled1 = true
348
        // 我加了一个这个事件 避免点击事件时对话框不显示
349
        window.scrollTo(0, 1)
350
      }
351
    },
352
    onCloseClick () {
353
      if (this.activePanel === 'tab-1') {
354
        this.columns0.forEach(e => {
355
          e.show = this.social0.indexOf(e.label) >= 0
356
        })
357
        this.customVisibled0 = false
358
      } else {
359
        this.columns1.forEach(e => {
360
          e.show = this.social1.indexOf(e.label) >= 0
361
        })
362
        this.customVisibled1 = false
363
      }
364
    },
159 365
    getDailyOrgId (id) {
160 366
      this.dailyForm.orgId = id
161 367
    },
@ -187,9 +393,6 @@ export default {
187 393
    handleDailyInited () {
188 394
      // this.getDailyTable()
189 395
    },
190
    changeTabs (tabName) {
191
      this.tabName = tabName
192
    },
193 396
    // 搜索
194 397
    handSearchDay () {
195 398
      if (this.dailyForm.workDay && this.dailyForm.orgId) {
@ -356,28 +559,62 @@ export default {
356 559
}
357 560
</script>
358 561
<style lang="scss" scoped>
359
.page-main {
562
.page-main1 {
360 563
  margin: 20px 20px 16px 20px;
361 564
  .abnormalState {
362 565
    color: #eda30f;
363 566
    font-size: 14px;
364 567
  }
365
  .keep-row {
366
    display: flex;
367
    align-items: center;
368
    margin-left: 24px;
369
  }
370
  .search-btn {
371
    margin-left: auto;
372
    margin-right: 15px;
373
  }
374
  .icon-txt {
375
    margin-right: 8px;
376
  }
377
  .export-excel {
378
    margin-top: 24px;
379
    display: flex;
380
    align-items: center;
568
  .track-container {
569
    width: 100%;
570
    margin: 24px 0;
571
    // padding: 20px;
572
    box-sizing: border-box;
573
    .search-container {
574
      width: 100%;
575
      .search-ctn {
576
        width: 100%;
577
        overflow: hidden;
578
        margin: 0;
579
        padding: 0;
580
        display: flex;
581
        position: relative;
582
        > div {
583
          // margin: 0 20px 16px 0;
584
          line-height: 2;
585
        }
586
        .btns {
587
          margin-left: auto;
588
          display: block;
589
          button {
590
            margin: 0 2px;
591
          }
592
        }
593
      }
594
    }
595
    .table-pager {
596
      margin: 20px auto;
597
    }
598
    .allCondition {
599
      display: flex;
600
      justify-content: space-between;
601
      border: 1px solid rgba(0, 0, 0, 0.09);
602
      background-color: #f8f9fa;
603
      flex-wrap: wrap;
604
      padding: 20px;
605
      margin: 5px auto;
606
      .input-rule {
607
        display: flex;
608
        flex: 1;
609
        width: 80%;
610
        min-width: 80%;
611
        max-width: 80%;
612
        padding: 10px 0 10px 20px;
613
        > span {
614
          line-height: 32px;
615
        }
616
      }
617
    }
381 618
  }
382 619
  .table-detail {
383 620
    margin-top: 20px;

common-ui - Nuosi Git Service

AIoT前端公共UI

Header.vue 5.6KB

    <!-- * @Author: Devin * @Date: 2023-01-11 17:15:27 * @LastEditors: Devin * @LastEditTime: 2023-02-22 14:50:55 * @Description: 公共页头 --> <template> <div class="common-panel-header"> <div class="h-l"> <!-- logo --> <img class="__header-info-logo" :src="headerInfo?.logo || ''" alt="" /> <!-- title --> <span class="__header-info-title">{{ headerInfo?.title }}</span> </div> <!-- menu --> <div v-if="headerInfo?.menus" class="h-m"> <slot name="menu"></slot> </div> <div class="h-r"> <!-- fnction icon --> <el-input v-if="showSearch" size="small" placeholder="请输入关键词搜索" class="__header-search" ></el-input> <span v-if="showMore" class="__header-text m-r-16" @click.stop="handelShowMore" > 更多 </span> <span v-if="showLang" class="__header-text m-r-16" @click.stop="changeLanguage" > 简体中文 </span> <span v-if="showSearch || showMore || showLang" class="__header-line m-r-16" ></span> <!-- 说明 --> <common-icon v-if="showInformation" class="m-r-16" name="common-gongnengshuoming" ></common-icon> <common-icon v-if="showMessage" class="m-r-16" name="common-liuyan" @click.stop="handelShowMessage" ></common-icon> <span v-if="showInformation || showMessage" class="__header-line m-r-16" ></span> <!-- user info --> <div class="__header-user-info"> <el-avatar :size="24" :src="userInfo?.src"></el-avatar> <el-dropdown class="user-name" trigger="click" @visible-change="changeType" @command="handleCommand" > <h5 class="__header-user"> <span class="__header-user-account"> {{ userInfo?.userAccount }} </span> <common-icon v-if="isDropDown" name="common-shangjiantou" ></common-icon> <common-icon v-else name="common-xiajiantou"></common-icon> </h5> <template #dropdown> <el-dropdown-menu> <template v-for="(commond, index) in commonds" :key="index"> <el-dropdown-item :command="commond['commond']"> {{ commond['label'] }} </el-dropdown-item> </template> </el-dropdown-menu> </template> </el-dropdown> </div> </div> </div> </template> <script setup lang="ts"> import { ref } from 'vue'; defineProps({ headerInfo: { type: Object, default: () => {} }, userInfo: { type: Object, default: () => {} }, commonds: { type: Array<any>, default: () => [] }, showMore: { type: Boolean, default: () => true }, showLang: { type: Boolean, default: () => true }, showInformation: { type: Boolean, default: () => true }, showMessage: { type: Boolean, default: () => true }, showSearch: { type: Boolean, default: () => true } }); const isDropDown = ref<any>(true); const emits = defineEmits([ 'handelCommond', 'handelShowMessage', 'handelShowMore' ]); // 加载更多 // 国际化 function changeLanguage() {} const handleCommand = (command: any) => { emits('handelCommond', command); }; // 展示信息 const handelShowMessage = () => { emits('handelShowMessage'); }; // 显示更多 const handelShowMore = () => { emits('handelShowMore'); }; const changeType = (val: any) => { isDropDown.value = val; }; </script> <script lang="ts"> export default { name: 'CommonHeader' }; </script> <style scoped lang="scss"> .common-panel-header { width: 100%; height: 60px; background: #2a2b3c; display: flex; padding: 0 10px; box-sizing: border-box; justify-content: space-between; align-items: center; .h-l { min-width: 240px; color: #fff; display: flex; .__header-info-logo { max-height: 60px; width: auto; } .__header-info-title { color: #fff; font-size: 16px; font-weight: 500; } } .h-m { flex: 1; } .h-r { display: flex; align-items: center; color: #fff; flex-shrink: 0; min-width: 300px; justify-content: flex-end; font-size: 12px; .__header-search { margin-right: 16px; background-color: #2d3e53; color: #fff; } :deep(.el-input) { --el-input-focus-border: transparent; --el-input-transparent-border: 0 0 0 0px; --el-input-border-color: transparent; --el-input-hover-border: 0px !important; --el-input-hover-border-color: transparent; --el-input-focus-border-color: transparent; --el-input-clear-hover-color: transparent; box-shadow: 0 0 0 0px !important; --el-input-border: 0px; background-color: #2d3e53; color: #fff; } :deep(.el-input__wrapper) { background-color: #2d3e53; color: #fff; } .__header-search { width: 120px; } .__header-text { color: #fff; cursor: pointer; } .__header-line { width: 1px; height: 12px; background-color: #b3bcc5; } .__header-user-info { display: flex; align-items: center; cursor: pointer; user-select: none; color: #fff; .__header-user { display: flex; align-items: center; } .__header-user-account { color: #fff; font-size: 14px; margin-left: 6px; line-height: 24px; } } } } </style>