Bläddra i källkod

4个按钮渲染+颜色确定

liangyan0105 3 år sedan
förälder
incheckning
d237421728
4 ändrade filer med 324 tillägg och 136 borttagningar
  1. 51 0
      src/assets/less/overwrite.css
  2. 66 7
      src/assets/less/overwrite.less
  3. 93 54
      src/views/user/Login.vue
  4. 114 75
      src/views/user/Todo.vue

+ 51 - 0
src/assets/less/overwrite.css

@@ -1,3 +1,12 @@
+.main {
+  min-height: 750px;
+}
+.footer {
+  text-align: right;
+  background-color: #092834;
+  color: #fc600a;
+  letter-spacing: 1px;
+}
 a {
   color: #858282;
 }
@@ -14,3 +23,45 @@ a {
  /deep/ .ant-tabs-nav .ant-tabs-tab-active {
   font-weight: 700;
 }
+ /deep/ .ant-tabs-nav .ant-tabs-tab-active {
+  color: #fc600a;
+  font-weight: 700;
+}
+ /deep/ .ant-tabs-ink-bar {
+  background-color: #fc600a;
+}
+.hearderLetter {
+  letter-spacing: 1px;
+}
+.bellStyle {
+  color: #1489b8;
+}
+.dividerBgcB {
+  background-color: rgba(71, 168, 206);
+  font-size: 20px;
+  margin-right: 10px;
+}
+.dividerBgcO {
+  background-color: rgba(252, 96, 10, 0.1);
+  font-size: 20px;
+  margin-right: 10px;
+}
+.cardIcon {
+  font-size: 18px;
+  margin-right: 10px;
+  color: #1489b8;
+  background-color: rgba(79, 92, 82, 0.1);
+  padding: 8px;
+  border-radius: 50%;
+}
+ /deep/ .ant-card-head {
+  color: #092834;
+  font-weight: 700;
+  position: relative;
+  letter-spacing: 1px;
+}
+ /deep/ .ant-layout-header {
+  padding: 0;
+  margin: 0;
+  padding: 0 24px;
+}

+ 66 - 7
src/assets/less/overwrite.less

@@ -1,19 +1,28 @@
-// 覆盖 ant-design 库默认样式
+// 覆盖 ant-design 库默认样式  公共样式
 
+//所有内容
+.main {
+  min-height: 750px;
+}
+
+//todo页面底部 logo定位
+.footer {
+  text-align: right;
+  background-color: #092834;
+  color: #fc600a;
+  letter-spacing: 1px;
+  // width: 100%;
+  // bottom: 0;
+}
 a {
   color: rgb(133, 130, 130);
 }
 
-/deep/.ant.tabs {
-}
 /deep/.ant-tabs-nav {
   color: #616161;
 }
-/deep/.ant-tabs-nav .ant-tabs-tab-active {
-  // color: red;
-}
+
 /deep/.ant-tabs-bar {
-  // background-color: rgba(206, 113, 113, 0.2);
   border: none;
   padding: -10px;
 }
@@ -23,3 +32,53 @@ a {
 /deep/.ant-tabs-nav .ant-tabs-tab-active {
   font-weight: 700;
 }
+/deep/.ant-tabs-nav .ant-tabs-tab-active {
+  color: #fc600a;
+  font-weight: 700;
+}
+/deep/.ant-tabs-ink-bar {
+  background-color: #fc600a;
+}
+//页面头部字间距
+.hearderLetter {
+  letter-spacing: 1px;
+}
+
+//铃铛
+.bellStyle {
+  color: #1489b8;
+}
+//竖分隔
+.dividerBgcB {
+  background-color:rgba(71, 168, 206);
+  font-size: 20px;
+  margin-right: 10px;
+}
+// 横分隔
+.dividerBgcO {
+  background-color:rgba(252, 96, 10,.1);
+  font-size: 20px;
+  margin-right: 10px;
+}
+
+//card 的小图标
+.cardIcon {
+  font-size: 18px;
+  margin-right: 10px;
+  color: #1489b8;
+  background-color: rgba(79, 92, 82, 0.1);
+  padding: 8px;
+  border-radius: 50%;
+}
+
+/deep/.ant-card-head {
+  color: #092834;
+  font-weight: 700;
+  position: relative;
+  letter-spacing: 1px;
+}
+/deep/.ant-layout-header {
+  padding: 0;
+  margin: 0;
+  padding: 0 24px;
+}

+ 93 - 54
src/views/user/Login.vue

@@ -1,35 +1,30 @@
 <template>
-  <div class="main">
-    <!-- 待办卡片    :loading="loading" -->
-    <a-card title="我的待办" :bordered="false" style="width: 100%; border-radius:6px;margin-bottom: 24px;">
-      <a-badge class="numTips">{{ data.length }}</a-badge>
-      <!-- 卡片右上角的操作区域 -->
-      <a slot="extra" @click.stop.prevent="todo()">更多</a>
-    </a-card>
+  <div class="content">
+    <div class="main">
+      <!-- 待办 头部  -->
+      <a-layout-header class="todoBox">
+        <span style="fontSize:16px;color:#092834;">我的待办</span>
+        <a-badge class="numTips">{{ data.length }}</a-badge>
+        <!-- 右边 -->
+        <a href="#" @click.stop.prevent="todo()" class="more">
+          <a-icon type="bell" class="bellStyle" />
+          <a-divider type="vertical" class="dividerBgcB" />更多</a
+        >
+      </a-layout-header>
 
-    <!-- OA工作台-->
-    <a-card title="OA工作台" :bordered="false" style="width: 100%; border-radius:6px;">
-      <div class="oa">
-        <a href="" class="oaItem">
-          <img src="../../assets/apply.png" width="64" />
-          <p>报销流程</p>
-        </a>
-        <a href="" class="oaItem">
-          <img src="../../assets/leave.png" width="64" />
-          <p>请假申请</p>
-        </a>
-        <a href="" class="oaItem">
-          <img src="../../assets/proForm.png" width="64" />
-          <p>项目开工表</p>
-        </a>
-        <a href="" class="oaItem">
-          <img src="../../assets/turn.png" width="64" />
-          <p>转正流程</p>
-        </a>
-      </div>
-    </a-card>
+      <!-- OA工作台 F7E0D4-->
+      <a-card title="OA工作台" :bordered="false" style="width: 100%; background:#F7E0D4;">
+        <div class="oa">
+          <a href="" class="oaItem" v-for="item in activeKeyAll" :key="item.id">
+            <img :src="item.iconAddress" width="64" class="activeIcon" />
+            <p>{{ item.name }}</p>
+          </a>
+        </div>
+      </a-card>
+    </div>
 
-    <a-layout-footer style="text-align: center;color:rgba(0,0,0,.45)">
+    <!-- 底部 -->
+    <a-layout-footer class="footer">
       上海萃颠信息科技有限公司出品
     </a-layout-footer>
   </div>
@@ -53,16 +48,21 @@ export default {
             data: [],
             url: {
                 todoList: '/actTask/todoList'
-            }
+            },
+            activeKeyAll: []
         }
     },
     // 页面打开时,默认已登录
     created () {
         Vue.ls.remove(ACCESS_TOKEN)
         // 进入页面自动登录
-        this.autoLogin().then(res => {
-            this.getDataList() //
-        })
+        this.autoLogin()
+            .then(res => {
+                this.getDataList() // 待办数量
+            })
+            .then(res => {
+                this.getActiveKeyAll() // OA 4个按钮
+            })
     },
     methods: {
     // 映射store/user.js 中 actions的方法
@@ -93,15 +93,25 @@ export default {
             console.log(this.$router)
         },
 
-        // 拿到
+        // 拿到 消息数量
         getDataList () {
             this.postFormAction(this.url.todoList, {}).then(res => {
                 if (res.success) {
                     this.data = res.result || []
-                    // this.total = this.data.leading
-                    // console.log('this.total:', this.total)
                     console.log('消息数量:', this.data.length)
-                    // console.log(this.data[0].createTime)
+                }
+            })
+        },
+        // 获取 OA 按钮
+        getActiveKeyAll () {
+            this.postFormAction('/activiti_process/listData', { status: 1, roles: true }).then(res => {
+                this.activeKeyAll = []
+                if (res.success) {
+                    var result = res.result || []
+                    if (result.length > 0) {
+                        this.activeKeyAll = result
+                        console.log('OA 4个按钮', result)
+                    }
                 }
             })
         }
@@ -111,41 +121,70 @@ export default {
 
 <style src="@assets/less/overwrite.less" lang="less" scoped></style>
 <style lang="less" scoped>
-.main {
+.content {
   width: 100%;
   height: 100%;
-  padding: 10px;
-  background: #ececec;
+  background-color: rgba(#f7e0d4);
+}
+// 待办
+.todoBox {
+  padding-top: 30px;
+  height: 180px;
+  width: 100%;
+  background-color: #347b98;
+  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
+  margin-bottom: 20px;
+}
+.todoBox span {
+  color: #092834;
+  font-weight: 700;
+  position: relative;
+  letter-spacing: 1px;
 }
-
 // 待办 数量
 .numTips {
   position: absolute;
-  top: 6px;
-  left: 88px;
-  background-color: red;
+  top: -10px;
+  left: 0px;
+  background-color: #fc600a;
   padding: 4px 6px;
   border-radius: 50%;
-  color: white;
+  color: white !important;
+}
+
+// 更多
+.more {
+  height: 46px;
+  line-height: 46px;
+  margin-top: 20px;
+  padding: 0 30px;
+  color: #474b4d;
+  background-color: rgba(#f7e0d4);
+  border-radius: 4px;
+  float: right;
+  letter-spacing: 2px;
+  // box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2);
 }
 
 // OA 工作台
 .oa {
-  // background-color: rgba(255, 110, 110, 0.1);
   display: flex;
   flex-flow: row wrap;
   justify-content: space-between;
   text-align: center;
 }
+
+//四个按钮
 .oa .oaItem {
-  width: calc((100% - 60px) / 2);
-  margin: 20px 0;
-  justify-content: center;
-  align-items: center;
-  line-height: 66px;
+  width: calc((100% - 40px) / 2);
+  padding: 40px 0 20px 0;
+  margin-bottom: 40px;
+  color: #092834;
+  border-radius: 10px;
+  box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.1);
 }
-
-:global(.ant-badge-count) {
-  background-color: pink;
+.oa p {
+  color: #092834;
+  margin-top: 20px;
 }
 </style>

+ 114 - 75
src/views/user/Todo.vue

@@ -1,66 +1,97 @@
 <template>
-  <div class="main">
-    <a-layout-header style="background:none;padding:0;">
-      <a-icon type="left" @click="$router.go(-1)" style="fontSize:24px;color:#595959;" />
-      <span
-        style="fontSize:20px;fontWeight:700;text-align:center;marginLeft:124px;color:rgb(43, 41, 41);"
-      >待办事项</span
-      >
-    </a-layout-header>
-
-    <!-- tabs 部分 -->
-    <a-layout-content>
-      <a-tabs default-active-key="wait" @change="callback" style="text-align: center;" className="todoTabs">
-        <!-- 我的申请 -->
-        <a-tab-pane key="apply" tab="我的申请">
-          <div v-for="item in applyList" :key="item.id">
-            <a-card style="width: 100%;border-radius:20px;text-align:left;marginBottom:30px;border:none;">
-              <p>所属流程:{{ item.processName }}</p>
-              <p>标题:{{ item.title }}</p>
-              <p>状态:{{ item.status }}</p>
-              <p>结果:{{ item.result }}</p>
-
-              <a-divider></a-divider>
-
-              <p>创建时间:{{ item.createTime }}</p>
-              <p>发起人:{{ item.createBy }}</p>
-            </a-card>
-          </div>
-        </a-tab-pane>
-
-        <!-- 我的待办 -->
-        <a-tab-pane key="wait" tab="我的待办" force-render>
-          <div v-for="item in todoList" :key="item.id">
-            <a-card style="width: 100%;border-radius:20px;text-align:left;marginBottom:30px;border:none;">
-              <p>所属流程:{{ item.processName }}</p>
-              <p>任务名称:{{ item.name }}</p>
-              <p>优先级:{{ item.priority }}</p>
-
-              <a-divider></a-divider>
-              <p>创建时间:{{ item.createTime }}</p>
-              <p>发起人:{{ item.applyer }}</p>
-            </a-card>
-          </div>
-        </a-tab-pane>
-        <!-- 我的已办 -->
-        <a-tab-pane key="done" tab="我的已办">
-          <div v-for="item in doneList" :key="item.id">
-            <a-card style="width: 100%;border-radius:20px;text-align:left;marginBottom:30px;border:none;">
-              <p>任务名称:{{ item.name }}</p>
-              <p>所属流程:{{ item.processName }}</p>
-              <p>创建时间:{{ item.createTime }}</p>
-
-              <a-divider></a-divider>
-
-              <p>发起人:{{ item.applyer }}</p>
-              <p>审批操作:{{ item.deleteReason }}</p>
-            </a-card>
-          </div>
-        </a-tab-pane>
-      </a-tabs>
-    </a-layout-content>
-
-    <a-layout-footer style="text-align: center;color:rgba(0,0,0,.45)">
+  <div class="content">
+    <div class="main">
+      <a-layout-header style="padding:0;color:white;background:#347b98;">
+        <a-icon type="left" @click="$router.go(-1)" style="fontSize:24px;color:white;marginLeft:2%;" />
+        <span style="fontSize:20px;fontWeight:700;marginLeft:34%;marginTop:4px;color:white;">待办事项</span>
+      </a-layout-header>
+
+      <!-- tabs 部分 -->
+
+      <a-layout-content>
+        <a-tabs default-active-key="wait" @change="callback" style="text-align: center;" className="todoTabs">
+          <!-- 我的申请 -->
+          <a-tab-pane key="apply" tab="我的申请">
+            <div v-for="item in applyList" :key="item.id">
+              <a-card
+                style="width: 100%;border-radius:20px;text-align:left;marginBottom:20px;border:none;background-color:rgba(247, 224, 212,.8);"
+              >
+                <p style="fontSize:16px;fontWeight:700;color092834;">
+                  <a-icon type="highlight" class="cardIcon" />所属流程:{{ item.processName }}
+                </p>
+                <p>标题:{{ item.title }}</p>
+                <p>创建时间:{{ item.createTime }}</p>
+                <p>状态:{{ item.status }}</p>
+
+                <a-divider class="dividerBgcO"></a-divider>
+                <p style="float:left;">
+                  结果:
+                  <span style="background:#fc600a;padding:4px 10px;borderRadius:6px;color:white;">{{
+                    item.result
+                  }}</span>
+                </p>
+                <p style="float:right;">发起人:{{ item.createBy }}</p>
+              </a-card>
+            </div>
+          </a-tab-pane>
+
+          <!-- 我的待办 -->
+          <a-tab-pane key="wait" tab="我的待办" force-render>
+            <div v-for="item in todoList" :key="item.id">
+              <a-card
+                style="width: 100%;borderRadius:20px;text-align:left;marginBottom:20px;border:none;color:#092834;
+                background-color:rgba(247, 224, 212,.8);
+            "
+              >
+                <p style="fontSize:16px;fontWeight:700;color:#092834;">
+                  <a-icon type="bell" class="cardIcon" />
+                  所属流程:{{ item.processName }}
+                </p>
+                <p>任务名称:{{ item.name }}</p>
+                <p>创建时间:{{ item.createTime }}</p>
+
+                <a-divider class="dividerBgcO"></a-divider>
+
+                <p style="float:left;">
+                  优先级:
+                  <span style="background:#fc600a;padding:4px 10px;borderRadius:6px;color:white;">{{
+                    item.priority
+                  }}</span>
+                </p>
+                <p style="float:right;">发起人:{{ item.applyer }}</p>
+              </a-card>
+            </div>
+          </a-tab-pane>
+
+          <!-- 我的已办 -->
+          <a-tab-pane key="done" tab="我的已办">
+            <div v-for="item in doneList" :key="item.id">
+              <a-card
+                style="width: 100%;border-radius:20px;text-align:left;marginBottom:20px;border:none;background-color:rgba(247, 224, 212,.8);"
+              >
+                <p style="fontSize:16px;fontWeight:700;color:092834;">
+                  <a-icon type="check" class="cardIcon" />
+                  任务名称:{{ item.name }}
+                </p>
+                <p>所属流程:{{ item.processName }}</p>
+                <p>创建时间:{{ item.createTime }}</p>
+
+                <a-divider class="dividerBgcO"></a-divider>
+
+                <p style="float:left;">
+                  审批操作:<span style="background:#fc600a;padding:4px 4px;borderRadius:6px;color:white;">{{
+                    item.deleteReason
+                  }}</span>
+                </p>
+                <p style="float:right;">发起人:{{ item.applyer }}</p>
+              </a-card>
+            </div>
+          </a-tab-pane>
+        </a-tabs>
+      </a-layout-content>
+    </div>
+
+    <a-layout-footer class="footer">
       上海萃颠信息科技有限公司出品
     </a-layout-footer>
   </div>
@@ -73,14 +104,14 @@ export default {
     components: {},
     data () {
         return {
+            todoList: [], // 待办列表
+            applyList: [], // 申请列表
+            doneList: [], // 已办列表
             url: {
                 todoList: '/actTask/todoList', // 待办
                 list: '/actBusiness/listData', // 申请
                 doneList: '/actTask/doneList' // 已办
-            },
-            todoList: [], // 待办列表
-            applyList: [], // 我的申请列表
-            doneList: [] // 已办列表
+            }
         }
     },
     computed: {},
@@ -94,42 +125,44 @@ export default {
         callback (key) {
             console.log(key)
             if (key === 'apply') {
-                console.log('拿到我的申请列表')
                 getAction(this.url.list).then(res => {
                     if (res.success) {
                         this.applyList = res.result || []
-                        console.log('我的申请列表', this.applyList)
+                        console.log('申请列表', this.applyList)
                     }
                 })
             }
             if (key === 'done') {
-                console.log('拿到我的已办列表')
                 getAction(this.url.doneList).then(res => {
                     if (res.success) {
                         this.doneList = res.result || []
+                        console.log('已办列表', this.doneList)
                     }
                 })
             }
         },
-        // 拿到todoList
+        // 拿到 todoList
         getDataList () {
-            this.postFormAction(this.url.todoList, {}).then(res => {
+            getAction(this.url.todoList, {}).then(res => {
                 if (res.success) {
                     this.todoList = res.result || []
-                    console.log('todo页面打印出data结果是:', this.todoList)
+                    console.log('待办列表', this.todoList)
                 }
             })
         }
     }
 }
 </script>
+
 <style src="@assets/less/overwrite.less" lang="less" scoped></style>
 <style lang="less" scoped>
-.main {
+.content {
   width: 100%;
   height: 100%;
-  padding: 10px;
-  background: rgba(202, 205, 209, 0.2);
+  background-color: rgba(247, 224, 212, 0.4);
+}
+.main {
+  padding: 14px;
 }
 // 单个事项卡片  最后一行
 .dividerDown {
@@ -166,4 +199,10 @@ export default {
   background-color: rgb(200, 245, 221);
   color: rgb(22, 139, 85);
 }
+.contain {
+  height: 100%;
+  position: relative;
+  min-height: 100%;
+  padding: 14px;
+}
 </style>