Explorar o código

工时管家——管理系统修改

ZhouRuiTing %!s(int64=5) %!d(string=hai) anos
pai
achega
6036cbcfb9

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/routes.js

@@ -37,11 +37,11 @@ let routes = [
         name: '',
         name: '',
         hidden: true
         hidden: true
     },
     },
-    //今日桌面
+    //工作桌面
     {
     {
         path: '/',
         path: '/',
         component: Home,
         component: Home,
-        name: '今日桌面',
+        name: '工作桌面',
         iconCls: 'fa fa-desktop',
         iconCls: 'fa fa-desktop',
         children: [
         children: [
             { path: '/desktop', component: desktop, name: '桌面查看' },
             { path: '/desktop', component: desktop, name: '桌面查看' },

+ 233 - 196
fhKeeper/formulahousekeeper/timesheet/src/views/desktop/index.vue

@@ -1,215 +1,252 @@
 <template>
 <template>
-  <section>
-    <!--工具条-->
-    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-      <div class="nowTime">
-        <i class="fa fa-clock-o"></i>
-        {{currentTime}}
-      </div>
-    </el-col>
+    <section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+            <!-- <div class="nowTime">
+                <i class="fa fa-clock-o"></i>
+                {{currentTime}}
+            </div> -->
+            <el-form :inline="true">
+                <el-form-item>
+                    <el-date-picker
+                        v-model="date"
+                        :editable="false"
+                        format="yyyy-MM-dd"
+                        value-format="yyyy-MM-dd"
+                        @change="getDesktopList"
+                        :clearable="false"
+                        type="date"
+                        placeholder="选择日期"
+                    ></el-date-picker>
+                </el-form-item>
+            </el-form>
+        </el-col>
 
 
-    <!-- 卡片列表 -->
-    <div>
-      <el-col :span="24" v-if="desktopList.length == 0" style="padding: 20px">今日暂无截图</el-col>
-      <el-col :span="6" v-for="(item, index) in desktopList" :key="index" class="one_div">
-        <el-card :body-style="{ padding: '0px' }" shadow="hover" class="one_card">
-          <div class="one_card_img">
-            <el-image :src="item.pic_url" class="image" lazy>
-              <div slot="error" class="image-slot">
-                <el-image :src="require('../../assets/image/noPic.png')" class="image" lazy></el-image>
-              </div>
-            </el-image>
-            <div :id="'over'+index" class="over">
-              <el-button type="primary" plain @click.native="jumpTo(item.id)">
-                <i class="fa fa-link"></i> 所有截图
-              </el-button>
-            </div>
-          </div>
-          <div class="one_card_txt">
-            <!-- -1-未知 null 0-研发,1-查资料,2-看文档,3-做设计,4-美工,5-运营,6-看小说,7-打游戏,8-听音乐 9-聊天 -->
-            <span>{{converType(item.pic_type == null ? 0 : item.pic_type+1)}}</span>
-            <div class="bottom clearfix">
-              <el-link>
-                <i class="fa fa-circle"></i>
-                {{item.name}}
-              </el-link>
-              <time class="time">{{item.time}}</time>
-            </div>
-          </div>
-        </el-card>
-      </el-col>
-    </div>
-  </section>
+        <!-- 卡片列表 -->
+        <div>
+            <el-col :span="24" v-if="desktopList.length == 0" style="padding: 200px 0;text-align:center;color:#20a0ff" @click="getHavePic()">今日暂无截图,点击查看近期</el-col>
+            <el-col :span="6" v-for="(item, index) in desktopList" :key="index" class="one_div">
+                <el-card :body-style="{ padding: '0px' }" shadow="hover" class="one_card">
+                <div class="one_card_img">
+                    <el-image :src="item.pic_url" class="image" lazy>
+                    <div slot="error" class="image-slot">
+                        <el-image :src="require('../../assets/image/noPic.png')" class="image" lazy></el-image>
+                    </div>
+                    </el-image>
+                    <div :id="'over'+index" class="over">
+                    <el-button type="primary" plain @click.native="jumpTo(item.id)">
+                        <i class="fa fa-link"></i> 所有截图
+                    </el-button>
+                    </div>
+                </div>
+                <div class="one_card_txt">
+                    <!-- -1-未知 null 0-研发,1-查资料,2-看文档,3-做设计,4-美工,5-运营,6-看小说,7-打游戏,8-听音乐 9-聊天 -->
+                    <span>{{converType(item.pic_type == null ? 0 : item.pic_type+1)}}</span>
+                    <div class="bottom clearfix">
+                    <el-link>
+                        <i class="fa fa-circle"></i>
+                        {{item.name}}
+                    </el-link>
+                    <time class="time">{{item.time}}</time>
+                    </div>
+                </div>
+                </el-card>
+            </el-col>
+        </div>
+    </section>
 </template>
 </template>
 
 
 <script>
 <script>
-import util from "../../common/js/util";
-export default {
-  data() {
-    return {
-      filters: {
-        keyName: ""
-      },
-      user: JSON.parse(sessionStorage.getItem("user")),
-      timer: "",
-      currentTime: util.formatDate.format(
-        new Date(new Date()),
-        "yyyy-MM-dd hh:mm:ss"
-      ),
-      desktopList: []
-    };
-  },
-  methods: {
-    getTime() {
-      var _this = this; //声明一个变量指向Vue实例this,保证作用域一致
-      this.timer = setInterval(function() {
-        _this.currentTime = util.formatDate.format(
-          new Date(new Date()),
-          "yyyy-MM-dd hh:mm:ss"
-        );
-      }, 1000);
-    },
-    //获取项目列表
-    getDesktopList() {
-      this.listLoading = true;
-      this.http.post(
-        this.port.desktop.list,
-        {},
-        res => {
-          this.listLoading = false;
-          if (res.code == "ok") {
-            this.desktopList = res.data;
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
+    import util from "../../common/js/util";
+
+    export default {
+        data() {
+            return {
+                filters: {
+                    keyName: ""
+                },
+                user: JSON.parse(sessionStorage.getItem("user")),
+                date: new Date(),
+                timer: "",
+                currentTime: util.formatDate.format(
+                    new Date(new Date()),
+                    "yyyy-MM-dd hh:mm:ss"
+                ),
+                desktopList: []
+            };
+        },
+        methods: {
+            getTime() {
+                var _this = this; //声明一个变量指向Vue实例this,保证作用域一致
+                this.timer = setInterval(function() {
+                    _this.currentTime = util.formatDate.format(
+                    new Date(new Date()),
+                    "yyyy-MM-dd hh:mm:ss"
+                    );
+                }, 1000);
+            },
+            //获取项目列表
+            getDesktopList() {
+                this.listLoading = true;
+                this.http.post(
+                    this.port.desktop.list,
+                    {date: this.date},
+                    res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.desktopList = res.data;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                    },
+                    error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            // 获取最近有数据的日期
+            getHavePic() {
+                this.http.post(
+                    this.port.desktop.list,
+                    {date: this.date},
+                    res => {
+                    if (res.code == "ok") {
+                        this.desktopList = res.data.data;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                    },
+                    error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            jumpTo(id) {
+                this.$router.push("/desktop/" + id);
+            },
+            //类型枚举转换
+            converType(type) {
+                switch (type) {
+                    case 0:
+                    return "其他工作";
+                    case 1:
+                    return "研发";
+                    case 2:
+                    return "上网";
+                    case 3:
+                    return "文档";
+                    case 4:
+                    return "设计";
+                    case 5:
+                    return "美工";
+                    case 6:
+                    return "运营";
+                    case 7:
+                    return "看小说";
+                    case 8:
+                    return "影视娱乐";
+                    case 9:
+                    return "听音乐";
+                    case 10:
+                    return "聊天";
+                    default:
+                    return "未知";
+                }
+            }
+        },
+        created() {
+            this.getTime();
+        },
+        mounted() {
+            this.getDesktopList();
         },
         },
-        error => {
-          this.listLoading = false;
-          this.$message({
-            message: error,
-            type: "error"
-          });
+        beforeDestroy() {
+            if (this.timer) {
+                clearInterval(this.timer);
+            }
         }
         }
-      );
-    },
-    jumpTo(id) {
-      this.$router.push("/desktop/" + id);
-    },
-    //类型枚举转换
-    converType(type) {
-      switch (type) {
-        case 0:
-          return "其他";
-        case 1:
-          return "研发";
-        case 2:
-          return "上网";
-        case 3:
-          return "文档";
-        case 4:
-          return "设计";
-        case 5:
-          return "美工";
-        case 6:
-          return "运营";
-        case 7:
-          return "看小说";
-        case 8:
-          return "影视娱乐";
-        case 9:
-          return "听音乐";
-        case 10:
-          return "聊天";
-        default:
-          return "未知";
-      }
-    }
-  },
-  created() {
-    this.getTime();
-  },
-  mounted() {
-    this.getDesktopList();
-  },
-  beforeDestroy() {
-    if (this.timer) {
-      clearInterval(this.timer);
-    }
-  }
-};
+    };
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-.nowTime {
-  height: 35px;
-  line-height: 28px;
-  font-size: 18px;
-  color: #20a0ff;
-  margin-left: 10px;
-  i {
-    margin-right: 10px;
-  }
-}
-
-.one_div {
-  padding: 15px;
-  .one_card {
-    .one_card_img {
-      position: relative;
-      .image {
-        width: 100%;
-      }
-      .over {
-        display: none;
-        width: 100%;
-        height: 98%;
-        background: rgba(0, 0, 0, 0.2);
-        position: absolute;
-        top: 0;
-        text-align: center;
-      }
+    .nowTime {
+        height: 35px;
+        line-height: 28px;
+        font-size: 18px;
+        color: #20a0ff;
+        margin-left: 10px;
+            i {
+                margin-right: 10px;
+            }
     }
     }
-    .one_card_txt {
-      padding: 13px;
-      .bottom {
-        margin-top: 13px;
-        line-height: 12px;
-        i {
-          color: #9ed0ff;
-          margin-right: 5px;
+
+    .one_div {
+        padding: 15px;
+        .one_card {
+            .one_card_img {
+            position: relative;
+            .image {
+                width: 100%;
+            }
+            .over {
+                display: none;
+                width: 100%;
+                height: 98%;
+                background: rgba(0, 0, 0, 0.2);
+                position: absolute;
+                top: 0;
+                text-align: center;
+            }
+            }
+            .one_card_txt {
+            padding: 13px;
+            .bottom {
+                margin-top: 13px;
+                line-height: 12px;
+                i {
+                color: #9ed0ff;
+                margin-right: 5px;
+                }
+                .time {
+                float: right;
+                margin-top: 2px;
+                color: #999;
+                }
+            }
+            }
         }
         }
-        .time {
-          float: right;
-          margin-top: 2px;
-          color: #999;
+        .one_card:hover {
+            .one_card_img {
+            .over {
+                display: block !important;
+            }
+            }
         }
         }
-      }
-    }
-  }
-  .one_card:hover {
-    .one_card_img {
-      .over {
-        display: block !important;
-      }
     }
     }
-  }
-}
 </style>
 </style>
 <style lang="scss">
 <style lang="scss">
-.image {
-  .el-image__inner {
-    height: 11.6vw !important;
-  }
-}
+    .image {
+        .el-image__inner {
+            height: 11.6vw !important;
+        }
+    }
 
 
-.one_card_img {
-  .over {
-    .el-button {
-      margin-top: 25%;
+    .one_card_img {
+        .over {
+            .el-button {
+            margin-top: 25%;
+            }
+        }
     }
     }
-  }
-}
 </style>
 </style>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/desktop/unusual.vue

@@ -109,7 +109,7 @@ export default {
     converType(type) {
     converType(type) {
       switch (type) {
       switch (type) {
         case 0:
         case 0:
-          return "其他";
+          return "其他工作";
         case 1:
         case 1:
           return "研发";
           return "研发";
         case 2:
         case 2: