From 0b3436dfe135d4110b197188f8d22ed935c868d4 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 04 九月 2024 15:20:37 +0800
Subject: [PATCH] 1.考勤模块路由创建

---
 src/views/attendanceModule/attendanceClockIn.vue  |   15 +
 src/views/attendanceModule/attendanceMonth.vue    |   13 +
 vue.config.js                                     |    2 
 src/views/attendanceModule/attendanceDay.vue      |   13 +
 src/views/attendanceModule/attendanceRecord.vue   |   13 +
 src/views/attendanceModule/attendanceSettings.vue |  370 ++++++++++++++++++++++++++++++++++++++++++++++
 src/icons/svg/kqmk.svg                            |    1 
 src/router/index.js                               |   49 ++++++
 8 files changed, 475 insertions(+), 1 deletions(-)

diff --git a/src/icons/svg/kqmk.svg b/src/icons/svg/kqmk.svg
new file mode 100644
index 0000000..1e47169
--- /dev/null
+++ b/src/icons/svg/kqmk.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1725433286413" class="icon" viewBox="0 0 1065 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4335" data-spm-anchor-id="a313x.search_index.0.i2.3dfd3a81X6eGiQ" xmlns:xlink="http://www.w3.org/1999/xlink" width="66.5625" height="64"><path d="M971.352337 546.055573V198.349529a76.184497 76.184497 0 0 0-76.184497-76.184497h-115.800435v36.301913a19.046124 19.046124 0 0 1-38.092249 0V122.165032H284.491958v36.549512a19.046124 19.046124 0 1 1-38.092249 0V122.165032H133.32287a76.184497 76.184497 0 0 0-76.184497 76.184497v685.660473a76.184497 76.184497 0 0 0 76.184497 76.184497h482.381189c8.513618 13.446564 18.112864 26.09319 28.683463 37.882741H132.332471a114.276746 114.276746 0 0 1-114.276745-114.276745v-685.660474a114.276746 114.276746 0 0 1 114.276745-114.276745h114.067238v-39.425477a19.046124 19.046124 0 0 1 38.092249 0v39.425477H741.275156V44.190199a19.046124 19.046124 0 1 1 38.092249 0v39.673077h116.390865a114.276746 114.276746 0 0 1 114.276745 114.276745v368.675828A282.301654 282.301654 0 0 0 971.352337 546.055573z" fill="#00A79D" p-id="4336"></path><path d="M533.291479 312.626274h342.830237a19.046124 19.046124 0 1 1 0 38.092249H533.291479a19.046124 19.046124 0 0 1 0-38.092249zM533.291479 464.995268h342.830237a19.046124 19.046124 0 1 1 0 38.092249H533.291479a19.046124 19.046124 0 0 1 0-38.092249z" fill="#00A79D" p-id="4337"></path><path d="M1012.606242 723.62259v68.642231l-59.957199 12.284751a177.052771 177.052771 0 0 1-17.731942 43.310886l33.864009 51.329305-0.09523 0.095231-48.11051 48.434294-0.095231 0.09523-50.986475-34.092562a174.081576 174.081576 0 0 1-42.834733 17.846218l-12.189519 60.357168h-68.185125l-12.18952-60.357168a175.871911 175.871911 0 0 1-42.834733-17.846218l-51.081706 34.092562-48.300971-48.624755 33.883055-51.329305a179.623998 179.623998 0 0 1-17.731941-43.310886l-59.957199-12.284751v-68.642231l59.957199-12.265704a172.081733 172.081733 0 0 1 17.827172-43.310887l-33.883055-51.329305 48.300971-48.624755 50.986475 34.016378a175.490989 175.490989 0 0 1 42.834733-17.865265l12.18952-60.280983h68.204171l12.170473 60.376214a174.805328 174.805328 0 0 1 42.834733 17.846218l50.986475-34.092562 0.095231 0.076184 48.129556 48.453341 0.171415 0.09523-33.883055 51.329305c7.808911 13.579887 13.770348 28.150172 17.750988 43.310887l59.861968 12.265704z m-231.962747-88.335925c-67.251865-0.076184-121.819011 54.738561-121.895195 122.428487-0.076184 67.708972 54.376685 122.65704 121.609503 122.733225 67.251865 0.076184 121.819011-54.757607 121.895195-122.447533 0.076184-67.689926-54.376685-122.637994-121.609503-122.714179z m-371.970807 97.059049c-40.111138 40.415876-80.29846 80.774613-120.314367 121.304766-3.333072 3.371164-5.275776 3.656856-8.475525 0.68566l-0.685661-0.647568-0.057138-0.057138a13764.253076 13764.253076 0 0 0-43.710855-44.167962c-13.294195-13.389425-26.607436-26.740758-39.920677-40.111138-1.352275-1.371321-2.952149-2.495042-3.847317-3.256887l0.323784-0.323784-0.609475-0.628523 28.416817-28.626324 0.609476 0.628522 0.114277-0.095231 62.566518 63.023625 102.639563-103.382362c8.094603 8.170787 15.560684 15.67496 22.969626 23.198179 3.580671 3.63781 5.294823 4.951992 5.180546 6.361406l0.228554 0.228553-0.438061 0.476153c-0.571384 1.161814-2.190304 2.571227-4.990085 5.390053z m-129.532691 121.28572z m0 0z m-0.818983-0.761845c-12.018104-12.265704-24.112393-24.455224-36.206682-36.663789a13764.253076 13764.253076 0 0 1 37.025665 37.425634c-0.266646-0.2476-0.533291-0.457107-0.818983-0.761845z m68.032756-468.534657l-62.147504 62.566518-90.888105-91.497581 26.835989-27.007404 62.947441 64.147347 102.791933-103.515686 27.350234 27.750203c-0.476153 0.761845-1.218952 1.466552-1.980797 2.247443a69878.249093 69878.249093 0 0 0-64.909191 65.30916z m-127.056695 118.181201l0.228553 0.228554c-0.152369-0.019046-0.285692-0.038092-0.438061-0.019047l0.209508-0.209507z m62.814117 93.040317l0.571384-0.571384 1.409413 1.314183 102.144365-102.963348 26.474112 26.969312c-0.019046 0.476153-0.095231 0.990398-0.152369 1.504644l-128.84703 129.723152-91.440443-92.068964 26.816943-26.988358h0.438061l62.585564 63.080763z" fill="#00A79D" p-id="4338"></path></svg>
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index c2f9b6b..0d8c277 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -642,7 +642,56 @@
         meta: { code: '0804', title: '娴佽浆璁剧疆', icon: '', keepAlive: true }
       }
     ]
+  },
+
+  {
+    path: '/attendanceModule',
+    component: Layout,
+    redirect: '/attendanceModule/attendanceSettings',
+    name: '鑰冨嫟妯″潡',
+    code: '11',
+    meta: { code: '11', title: '鑰冨嫟妯″潡', icon: 'kqmk' },
+    alwaysShow: true, // 褰揷hildren鍙湁涓�涓椂锛屼篃鏄剧ず鐖惰彍鍗�
+    children: [
+      {
+        path: 'attendanceSettings',
+        name: 'attendanceSettings',
+        code: '1101',
+        component: () => import('@/views/attendanceModule/attendanceSettings'),
+        meta: { code: '1101', title: '鑰冨嫟璁剧疆', icon: '', keepAlive: true }
+      },
+      {
+        path: 'attendanceClockIn',
+        name: 'attendanceClockIn',
+        code: '1102',
+        component: () => import('@/views/attendanceModule/attendanceClockIn'),
+        meta: { code: '1102', title: '鑰冨嫟鎵撳崱', icon: '', keepAlive: true }
+      },
+      {
+        path: 'attendanceRecord',
+        name: 'attendanceRecord',
+        code: '1103',
+        component: () => import('@/views/attendanceModule/attendanceRecord'),
+        meta: { code: '1103', title: '鑰冨嫟璁板綍', icon: '', keepAlive: true }
+      },
+      {
+        path: 'attendanceDay',
+        name: 'attendanceDay',
+        code: '1104',
+        component: () => import('@/views/attendanceModule/attendanceDay'),
+        meta: { code: '1104', title: '鏃ヨ鏃跺伐璧�', icon: '', keepAlive: true }
+      },
+      {
+        path: 'attendanceMonth',
+        name: 'attendanceMonth',
+        code: '1105',
+        component: () => import('@/views/attendanceModule/attendanceMonth'),
+        meta: { code: '1105', title: '鏈堣鏃跺伐璧�', icon: '', keepAlive: true }
+      }
+
+    ]
   }
+
 ]
 
 const createRouter = () => new Router({
diff --git a/src/views/attendanceModule/attendanceClockIn.vue b/src/views/attendanceModule/attendanceClockIn.vue
new file mode 100644
index 0000000..0a6c083
--- /dev/null
+++ b/src/views/attendanceModule/attendanceClockIn.vue
@@ -0,0 +1,15 @@
+<template>
+  <div>
+    123
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'AttendanceClockIn'
+}
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/views/attendanceModule/attendanceDay.vue b/src/views/attendanceModule/attendanceDay.vue
new file mode 100644
index 0000000..1ba3a7f
--- /dev/null
+++ b/src/views/attendanceModule/attendanceDay.vue
@@ -0,0 +1,13 @@
+<template>
+  <div>322222</div>
+</template>
+
+<script>
+export default {
+  name: 'AttendanceDay'
+}
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/views/attendanceModule/attendanceMonth.vue b/src/views/attendanceModule/attendanceMonth.vue
new file mode 100644
index 0000000..e33c05d
--- /dev/null
+++ b/src/views/attendanceModule/attendanceMonth.vue
@@ -0,0 +1,13 @@
+<template>
+  <div>3212</div>
+</template>
+
+<script>
+export default {
+  name: 'AttendanceMonth'
+}
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/views/attendanceModule/attendanceRecord.vue b/src/views/attendanceModule/attendanceRecord.vue
new file mode 100644
index 0000000..5176e3e
--- /dev/null
+++ b/src/views/attendanceModule/attendanceRecord.vue
@@ -0,0 +1,13 @@
+<template>
+  <div>123123</div>
+</template>
+
+<script>
+export default {
+  name: 'AttendanceRecord'
+}
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/views/attendanceModule/attendanceSettings.vue b/src/views/attendanceModule/attendanceSettings.vue
new file mode 100644
index 0000000..8c27fe2
--- /dev/null
+++ b/src/views/attendanceModule/attendanceSettings.vue
@@ -0,0 +1,370 @@
+<template>
+  <div>
+    <div class="body" :style="{height:mainHeight+'px'}">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
+        <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+        <!--        <el-button-->
+        <!--          v-waves-->
+        <!--          type="success"-->
+        <!--          icon="el-icon-download"-->
+        <!--          @click="$router.push('./../systemSetting/dataImport?fileCode=1')"-->
+        <!--        >瀵煎叆-->
+        <!--        </el-button>-->
+      </div>
+
+      <div class="bodyTopFormGroup">
+        <el-form
+          ref="form"
+          :model="form"
+          label-width="100px"
+          inline
+          style="display: flex;"
+        >
+          <div class="elForm">
+            <el-form-item label="杞﹂棿鍚嶇О" style=" display: flex;">
+              <el-input v-model="form.postcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="鍙傚姞浜哄憳" style=" display: flex;">
+              <el-input v-model="form.postname" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="鍒涘缓鏃堕棿" style=" display: flex;">
+              <el-input v-model="form.postname" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+          </div>
+          <div
+            class="bodySearchReset"
+            :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+          >
+            <el-button v-waves type="primary" icon="el-icon-search" @click="getPostData">鏌ヨ</el-button>
+            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+          </div>
+        </el-form>
+        <div
+          class="bodyTopFormExpand"
+          style="height:5px"
+        >
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseout'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
+          <!--            @mouseenter="mouseHoverType=$event.type"-->
+          <!--          />-->
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseenter'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
+          <!--            @click="isExpandForm=!isExpandForm"-->
+          <!--            @mouseout="mouseHoverType=$event.type"-->
+          <!--          />-->
+        </div>
+      </div>
+
+      <div class="elTableDiv">
+        <el-table
+          ref="tableDataRef"
+          class="tableFixed"
+          :data="tableData"
+          :height="tableHeight+'px'"
+          border
+          row-class-name="custom-row"
+          :style="{width: 100+'%',height:tableHeight+'px',}"
+          highlight-current-row
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+          @sort-change="sortChange"
+        >
+          <el-table-column
+            prop="rowNum"
+            width="50"
+            fixed
+            label="搴忓彿"
+          />
+          <el-table-column
+            prop="postcode"
+            label="宀椾綅缂栫爜"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="postname"
+            label="宀椾綅鍚嶇О"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="status"
+            label="鐘舵��"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <el-tag v-if="row.status==='Y'" size="small" type="success">姝e父</el-tag>
+              <el-tag v-if="row.status==='N'" size="small" type="danger">鍋滅敤</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="description"
+            label="鎻忚堪"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              {{ row.description ? row.description : '/' }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="username"
+            label="鍒涘缓浜哄憳"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="lm_date"
+            label="鍒涘缓鏃堕棿"
+            width="160"
+            sortable="custom"
+          />
+          <el-table-column
+            label="鎿嶄綔"
+            width="120"
+            fixed="right"
+          >
+            <template slot-scope="{row}">
+              <div class="operationClass">
+                <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+                  <i
+                    v-if="row.leve!==0"
+                    class="el-icon-edit-outline"
+                    :style="{color:$store.state.settings.theme}"
+                    @click="edit('edit',row)"
+                  />
+                </el-tooltip>
+                <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+                  <i
+                    v-if="row.leve!==0"
+                    class="el-icon-delete"
+                    :style="{color:$store.state.settings.theme}"
+                    @click="del(row)"
+                  />
+                </el-tooltip>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <!--鍒嗛〉-->
+      <pagination
+        :total="total"
+        :page.sync="form.page"
+        :limit.sync="form.rows"
+        align="right"
+        layout="total,prev, pager, next,sizes,jumper"
+        popper-class="select_bottom"
+        @pagination="getPostData"
+      />
+    </div>
+
+    <el-dialog
+      v-el-drag-dialog
+      :title="operation==='add'?'鏂板':'缂栬緫'"
+      :visible.sync="dialogVisible"
+      width="800px"
+      :close-on-click-modal="false"
+      top="15vh"
+      @closed="handleClose"
+      @close="handleClose"
+    >
+      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
+        <el-form-item label="宀椾綅缂栫爜" prop="postcode">
+          <el-input v-model="dialogForm.postcode" :disabled="operation!=='add'" style="width: 200px" />
+        </el-form-item>
+        <el-form-item label="宀椾綅鍚嶇О" prop="postname">
+          <el-input v-model="dialogForm.postname" style="width: 200px" />
+        </el-form-item>
+        <el-form-item label="鎻忚堪">
+          <el-input
+            v-model="dialogForm.description"
+            type="textarea"
+            style="width: 200px"
+          />
+        </el-form-item>
+        <el-form-item required label="宀椾綅鐘舵��">
+          <el-radio-group v-model="dialogForm.status">
+            <el-radio label="Y">姝e父</el-radio>
+            <el-radio label="N">鍋滅敤</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
+          <el-button
+            v-waves
+            type="primary"
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            @click="dialogVisibleConfirm"
+          >纭� 瀹�</el-button>
+        </div>
+      </span>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import { AddUpdatePost, DeletePost, PostData } from '@/api/basicSettings'
+import { validateCode } from '@/utils/global'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
+
+export default {
+  name: 'AttendanceSettings',
+  components: {
+    Pagination
+  },
+  directives: { elDragDialog, waves },
+  data() {
+    return {
+      mainHeight: 0,
+      tableHeight: 0,
+      form: {
+        postcode: '', // 缁勭粐鏋舵瀯缂栫爜
+        postname: '', // 缁勭粐鏋舵瀯鍚嶇О
+        prop: 'lm_date', // 鎺掑簭瀛楁
+        order: 'desc', // 鎺掑簭瀛楁
+        page: 1, // 绗嚑椤�
+        rows: 20 // 姣忛〉澶氬皯鏉�
+      },
+      total: 10,
+      tableData: [],
+      dialogVisible: false,
+      dialogForm: {
+        postcode: '', // 缁勭粐缂栫爜
+        postname: '', // 缁勭粐鍚嶇О
+        description: '', // 鎻忚堪
+        status: 'Y'// 鐘舵��
+      },
+      operation: '',
+      dialogFormRules: {
+        postcode: [
+          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
+        ],
+        postname: [
+          { required: true, message: '璇疯緭鍏ュ矖浣嶅悕绉�', trigger: ['blur', 'change'] }
+        ]
+      }
+
+    }
+  },
+  created() {
+    this.getPostData()
+  },
+  mounted() {
+    window.addEventListener('resize', this.getHeight)
+    this.getHeight()
+  },
+  methods: {
+    // 缁勭粐鏋舵瀯澶у垪琛ㄦ煡璇�
+    async getPostData() {
+      const res = await PostData(this.form)
+      this.tableData = res.data
+      this.total = res.count
+    },
+
+    // 鎺掑簭鏀瑰彉鏃�
+    sortChange({ column, prop, order }) {
+      if (order === 'descending') {
+        order = 'desc'
+      } else if (order === 'ascending') {
+        order = 'asc'
+      } else {
+        order = 'desc'
+      }
+      this.form.order = order
+      this.form.prop = prop
+      this.getPostData()
+    },
+    // 閲嶇疆
+    reset() {
+      this.form.postcode = ''
+      this.form.postname = ''
+      this.getPostData()
+    },
+    // 鏂板鎸夐挳
+    add(operation) {
+      this.operation = operation
+      this.dialogVisible = true
+      this.dialogForm.OperType = 'Add'
+    },
+    // 淇敼鎸夐挳
+    async edit(operation, row) {
+      this.operation = operation
+      this.dialogVisible = true
+      this.dialogForm.OperType = 'Update'
+
+      this.$nextTick(() => {
+        this.dialogForm.postcode = row.postcode
+        this.dialogForm.postname = row.postname
+        this.dialogForm.description = row.description
+        this.dialogForm.status = row.status
+      })
+    },
+    // 鍒犻櫎鎸夐挳
+    async del(row) {
+      this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        DeletePost({ postcode: row.postcode }).then(res => {
+          if (res.code === '200') {
+            this.$notify.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
+            this.getPostData()
+          }
+        })
+      }).catch(() => {
+        this.$notify.info('宸插彇娑堝垹闄�')
+      })
+    },
+    // 瀵硅瘽妗嗗叧闂簨浠�
+    handleClose() {
+      this.dialogForm.postcode = ''
+      this.dialogForm.postname = ''
+      this.dialogForm.status = 'Y'
+      this.dialogForm.description = ''
+      this.$refs.dialogForm.clearValidate()
+    },
+    // 瀵硅瘽妗嗗彇娑�
+    dialogVisibleCancel() {
+      this.dialogVisible = false
+    },
+    // 瀵硅瘽妗嗙‘璁�
+    dialogVisibleConfirm() {
+      this.$refs.dialogForm.validate(valid => {
+        if (valid) {
+          this.$store.state.app.buttonIsDisabled = true
+          AddUpdatePost(this.dialogForm).then(res => {
+            if (res.code === '200') {
+              this.$notify.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+              this.dialogVisible = false
+              this.$store.state.app.buttonIsDisabled = false
+              this.getPostData()
+            } else {
+              this.$store.state.app.buttonIsDisabled = false
+              this.$notify.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+            }
+          })
+        }
+      })
+    },
+    // 鑾峰彇椤甸潰楂樺害
+    getHeight() {
+      this.$nextTick(() => {
+        this.mainHeight = window.innerHeight - 85
+        this.tableHeight = this.mainHeight - 200
+        this.$refs.tableDataRef.doLayout()
+      })
+    }
+  }
+}
+</script>
diff --git a/vue.config.js b/vue.config.js
index d8fd5ac..5e2cb2a 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -52,7 +52,7 @@
     },
     proxy: {
       [process.env.VUE_APP_BASE_API]: {
-        target: 'http://121.196.36.24:8033', // 鏈湴
+        target: 'http://121.196.36.24:8034', // 鏈湴
         // target: 'http://192.168.0.147:8000', // 浼樺厠
         changeOrigin: true, // 璇锋眰璺ㄥ煙鏃讹紝闇� 閰嶇疆姝ら」
         pathRewrite: { // 璺緞閲嶅啓,鏇挎崲target涓殑璇锋眰鍦板潃

--
Gitblit v1.9.3