فهرست منبع

【选择用户】样式更改完毕

liangyan0105 3 سال پیش
والد
کامیت
ece276ca25

+ 7 - 5
src/assets/less/overwrite.css

@@ -59,7 +59,7 @@ img {
   width: 100%;
   border-radius: 14px;
   text-align: left;
-  margin-bottom: 30px;
+  margin-bottom: 16px;
   border: none;
   background-color: white;
   border: 1px solid rgba(70, 130, 180, 0.1);
@@ -71,7 +71,7 @@ img {
   font-weight: 700;
   color: #092834;
   border-radius: 10px;
-  padding-left: 10px;
+  padding-left: 2px;
 }
 .content .main .cardTask .pTitle span {
   display: inline-block;
@@ -86,7 +86,7 @@ img {
   display: block !important;
 }
 .content .main .cardTask .operation .operationImg {
-  display: inline-block;
+  display: none;
   height: 28px;
   width: 28px;
   vertical-align: text-bottom;
@@ -99,7 +99,6 @@ img {
 .content .main .operation /deep/ .ant-btn {
   border-radius: 999em;
   border: 1px solid #f2f2f6;
-  margin-bottom: 30px;
   margin-right: 20px;
 }
 .content .main /deep/ .ant-card-head {
@@ -129,7 +128,7 @@ img {
 .content .main /deep/ .ant-tabs-tab-active {
   font-weight: 700;
   color: white;
-  background: #4169e1;
+  background: rgba(26, 133, 229, 0.9);
   border: none;
 }
 .content .main /deep/ .ant-tabs-bar {
@@ -156,3 +155,6 @@ img {
 .content /deep/ .ant-empty-image {
   margin-top: 120px;
 }
+.content /deep/ .ant-modal-footer {
+  display: none;
+}

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

@@ -73,7 +73,7 @@ img {
       width: 100%;
       border-radius: 14px;
       text-align: left;
-      margin-bottom: 30px;
+      margin-bottom: 16px;
       border: none;
       background-color: white;
       border: 1px solid rgba(70, 130, 180, 0.1);
@@ -85,7 +85,7 @@ img {
         font-weight: 700;
         color: #092834;
         border-radius: 10px;
-        padding-left: 10px;
+        padding-left: 2px;
         // 图 外盒子
         span {
           display: inline-block;
@@ -104,7 +104,7 @@ img {
       //操作 样式
       .operation {
         .operationImg {
-          display: inline-block;
+          display: none; //inline-block;
           height: 28px;
           width: 28px;
           vertical-align: text-bottom;
@@ -118,13 +118,8 @@ img {
     }
     // 操作 按钮样式
     .operation /deep/.ant-btn {
-      // padding: 0;
-      // line-height: 0;
-      // border: none !important;
       border-radius: 999em;
-      // padding: 18px 10px;
       border: 1px solid #f2f2f6;
-      margin-bottom: 30px;
       margin-right: 20px;
     }
 
@@ -158,7 +153,7 @@ img {
     /deep/.ant-tabs-tab-active {
       font-weight: 700;
       color: white;
-      background: #4169e1;
+      background: rgba(26, 133, 229, 0.9);
       border: none;
     }
     /deep/.ant-tabs-bar {
@@ -197,6 +192,7 @@ img {
   /deep/.ant-empty-image {
     margin-top: 120px;
   }
+  /deep/.ant-modal-footer {
+    display: none;
+  }
 }
-
-

+ 26 - 26
src/utils/dingding.js

@@ -1,27 +1,27 @@
-import * as dd from 'dingtalk-jsapi';
+import * as dd from 'dingtalk-jsapi'
 
-export function getCode(callback) {
-  // let corpId = 'ding1d8bd510f1f4eada35c2f4657eb6378f';
-  let corpId = 'dingf62dd071b5bb59a035c2f4657eb6378f';
-  if (dd.env.platform !== "notInDingTalk") {
-    dd.ready(() => {
-        
-      //使用SDK 获取免登授权码
-      dd.runtime.permission.requestAuthCode({
-        corpId: corpId,
-        onSuccess: (info) => {
-          // 根据钉钉提供的api 获得code后,再次调用这个callback方法
-          // 由于是钉钉获取code是异步操作,不知道什么时候执行完毕
-          // callback 函数会等他执行完毕后在自己调用自己
-          callback(info.code)
-        },
-        onFail: (err) => {
-          alert('fail');
-          alert(JSON.stringify(err));
-        },
-      });
-    });
-  }else{
-    callback("非钉钉登录")
-  }
-}
+export function getCode (callback) {
+    // let corpId = 'ding1d8bd510f1f4eada35c2f4657eb6378f';
+    let corpId = 'dingf62dd071b5bb59a035c2f4657eb6378f'
+    if (dd.env.platform !== 'notInDingTalk') {
+        dd.ready(() => {
+            // 使用SDK 获取免登授权码
+            dd.runtime.permission.requestAuthCode({
+                corpId: corpId,
+                onSuccess: info => {
+                    // 根据钉钉提供的api 获得code后,再次调用这个callback方法
+                    // 由于是钉钉获取code是异步操作,不知道什么时候执行完毕
+                    // callback 函数会等他执行完毕后在自己调用自己
+                    callback(info.code)
+                },
+                onFail: err => {
+                    alert('fail')
+                    alert(JSON.stringify(err))
+                }
+            })
+        })
+    } else {
+        // eslint-disable-next-line standard/no-callback-literal
+        callback('非钉钉登录')
+    }
+}

+ 1 - 0
src/views/activiti/doneManage.vue

@@ -71,6 +71,7 @@
               <span v-else style="color: #999;"> 无 </span>
             </template>
           </a-table-column>
+          
           <a-table-column title="审批操作" dataIndex="deleteReason"  :width="100" align="center">
             <template slot-scope="t">
               <span> {{t}} </span>

+ 14 - 9
src/views/user/Login.vue

@@ -13,7 +13,7 @@
         </div>
 
         <!-- 右边 -->
-        <a href="#" @click.stop.prevent="todo()" class="more right fr clearfix">
+        <a  @click.stop.prevent="todo()" class="more right fr clearfix">
           <a-icon type="more" class="moreIcon" />
           <a-divider type="vertical" />
           <span>更多</span>
@@ -21,7 +21,11 @@
       </a-layout-header>
 
       <!-- OA工作台 -->
-      <a-card title="OA工作台" :bordered="true" style="background-color: white; padding:20px;">
+      <a-card
+        title="OA工作台"
+        :bordered="true"
+        style="margin:10px; borderRadius: 8px;paddingTop:20px;"
+      >
         <div class="oa">
           <a class="oaItem" v-for="(item, index) in activeKeyAll" :key="index.id" @click.prevent="aClick(item)">
             <span>
@@ -120,11 +124,11 @@ export default {
     //   this.getDataList()
     // },
     // 映射store/user.js 中 actions的方法
-    ...mapActions(['Login','dingLogin']),
+    ...mapActions(['Login', 'dingLogin']),
 
     // 自动登录
     async autoLogin() {
-       var that = this
+      var that = this
       let loginParams = {}
       loginParams.username = 'fenghf'
       loginParams.password = 'fenghf`123456'
@@ -254,8 +258,8 @@ export default {
       background-color: rgba(26, 133, 229, 0.9);
       box-shadow: 0 4px 8px 1px rgba(0, 0, 0, 0.1), 0 6px 20px 1px rgba(0, 0, 0, 0.19);
       margin-bottom: 30px;
-      border-bottom-right-radius: 30px;
-      border-bottom-left-radius: 30px;
+      // border-bottom-right-radius: 30px;
+      // border-bottom-left-radius: 30px;
       // 待办小黑板
       .left {
         height: 100%;
@@ -317,15 +321,16 @@ export default {
       flex-flow: row wrap;
       justify-content: space-between;
       text-align: center;
+      // background-color: rgb(216, 154, 154);
       // padding: 40px;
       //四个按钮
       .oaItem {
-        width: calc((100% - 220px) / 2);
+        width: calc((100% - 20px) / 2);
         color: #092834;
         border-radius: 10px;
-        margin-bottom: 70px;
+        margin: 40px 0;
         background-color: white;
-        // box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2);
+        box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2);
 
         // 图
         span {

+ 10 - 54
src/views/user/tabs/ApplyTab.vue

@@ -70,21 +70,21 @@
           </span>
         </p>
 
-        <p style="float:right;">
+        <!-- <p style="float:right;">
           发起人:
           <span style="color:black;">
             {{ item.createBy }}
           </span>
-        </p>
+        </p> -->
 
         <a-divider style="background:rgba(70, 130, 180,.2);"></a-divider>
 
         <!-- 操作 -->
         <div class="operation">
-          <p>
+          <!-- <p>
             <span class="operationImg"><img src="@assets/set.png"/></span>
             操作
-          </p>
+          </p> -->
 
           <div class="btns">
             <!-- 结果 0 -->
@@ -121,7 +121,7 @@
                 class="itemBtn"
                 ghost
                 @click="cancel(item)"
-                style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.9);
+                style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
                       color:red;"
               >
                 撤回
@@ -130,9 +130,7 @@
                 class="itemBtn"
                 ghost
                 @click="history(item)"
-                style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
-                      color:orange;"
-              >
+                style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);color:#4e73b9;">
                 查看进度
               </a-button>
 
@@ -140,9 +138,7 @@
                 class="itemBtn"
                 ghost
                 @click="detail(item)"
-                style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
-                      color:#4e73b9;"
-              >
+                style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);color:#4e73b9;">
                 表单数据
               </a-button>
             </span>
@@ -509,46 +505,6 @@ export default {
       console.log(value)
     },
 
-    // 状态
-    // getStatus(status) {
-    //   let text = '未知',
-    //     color = ''
-    //   if (status == 0) {
-    //     text = '草稿'
-    //     color = 'default'
-    //   } else if (status == 1) {
-    //     text = '处理中'
-    //     color = 'orange'
-    //   } else if (status == 2) {
-    //     text = '已结束'
-    //     color = 'blue'
-    //   } else if (status == 3) {
-    //     text = '已撤回'
-    //     color = 'magenta'
-    //   }
-    //   return { text: text, color: color }
-    // },
-
-    // // 结果
-    // getResult(result) {
-    //   let text = '未知',
-    //     color = ''
-    //   if (result == 0) {
-    //     text = '未提交'
-    //     color = 'default'
-    //   } else if (result == 1) {
-    //     text = '处理中'
-    //     color = 'orange'
-    //   } else if (result == 2) {
-    //     text = '已通过'
-    //     color = 'green'
-    //   } else if (result == 3) {
-    //     text = '已驳回'
-    //     color = 'red'
-    //   }
-    //   return { text: text, color: color }
-    // },
-
     // 申请
     apply(v) {
       if (!v.procDefId || v.procDefId == 'null') {
@@ -591,7 +547,7 @@ export default {
             return
           }
           this.modalVisible = true
-          this.getDataList()
+          this.loadData()
         } else {
           this.$message.error(res.message)
         }
@@ -617,12 +573,12 @@ export default {
             this.loadData()
             this.modalVisible = false
             console.log('重新申请的提交 走这没')
-            this.getDataList()
+            this.loadData()
           } else {
             this.$message.error(res.message)
           }
           console.log('这是哪 走这没')
-          this.getDataList()
+          this.loadData()
         })
         .finally(() => (this.submitLoading = false))
     },

+ 18 - 16
src/views/user/tabs/DoneTab.vue

@@ -29,26 +29,28 @@
         </p>
 
         <!-- 审批操作 -->
-        <p style="float:left;">
+        <!-- <p style="float:left;">
           审批操作:
-          <span v-if="item.deleteReason == '审批通过'" class="doneDeleteReason" style="background:rgba(68, 141, 118);">
-            {{ item.deleteReason }}</span
-          >
+          <span v-if="item.deleteReason == '审批通过'" 
+          class="doneDeleteReason" 
+          style="background:rgba(68, 141, 118);">
+            {{ item.deleteReason }}</span>
+
           <span
-            v-if="item.deleteReason == '审批驳回'"
+            v-if="item.deleteReason == '发起人撤回 - 原因未填写'"
             class="doneDeleteReason"
-            style="background:rgba(235, 77, 50,.7);"
-          >
+            style="background:rgba(235, 77, 50,.7);">
             {{ item.deleteReason }}
           </span>
-          <span
-            v-if="item.deleteReason == '发起人撤回-原因未填写'"
-            class="doneDeleteReason"
-            style="background:rgba(52, 123, 152,.9);"
-          >
+          
+          <span 
+            v-if="item.deleteReason" 
+            class="doneDeleteReason" 
+            style="background:rgba(52, 123, 152,.9);">
             {{ item.deleteReason }}
           </span>
-        </p>
+        </p> -->
+        <p style="flooat:left;">审批操作:{{ item.deleteReason }}</p>
         <p style="float:right;">
           发起人:
           <span style="color:black;">
@@ -60,17 +62,17 @@
 
         <!-- 操作 -->
         <div class="operation">
-          <p>
+          <!-- <p>
             <span class="operationImg"><img src="@assets/set.png"/></span>
             操作
-          </p>
+          </p> -->
 
           <div class="btns">
             <a-button
               class="itemBtn"
               ghost
               @click="detail(item)"
-              style="box-shadow: 8px 8px 8px rgba(128, 128, 128);color:#4e73b9;"
+              style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);color:#4e73b9;"
             >
               表单数据
             </a-button>

+ 371 - 318
src/views/user/tabs/SelectModal.vue

@@ -1,29 +1,22 @@
 <template>
-  <!-- -----------------------------------
-    此页面是 点击 “选择用户的 modal 弹框”
-    及 传参
-  ---------------------------------------->
   <a-modal
     :width="modalWidth"
     :visible="visible"
     :title="title"
-    @ok="handleSubmit"
-    @cancel="close"
-    cancelText="关闭"
+    :footer="null"
+    @cancel="handleCancel"
     style="margin-top: -70px"
     wrapClassName="ant-modal-cust-warp"
   >
     <!-- 树形控件 -->
     <div class="tree">
       <a-card :bordered="true" title="请选择分支">
-        <!--组织机构-->
         <a-directory-tree
           selectable
           :selectedKeys="selectedDepIds"
           :checkStrictly="true"
           :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
           :treeData="departTree"
-          :expandAction="false"
           :expandedKeys.sync="expandedKeys"
           @select="onDepSelect"
         />
@@ -31,37 +24,51 @@
     </div>
 
     <!-- 搜索 -->
-    <div class="line" style="margin:30px 0; padding:13px 0 0 10px;border:1px solid #e8e8e8;">
-      用户账号:
+    <div class="line">
+      搜索:
       <a-input-search
-        :style="{ width: '150px', marginBottom: '15px' }"
+        :style="{ width: '160px', marginBottom: '15px' }"
         placeholder="请输入账号"
         v-model="queryParam.username"
-        @search="onSearch"
       >
       </a-input-search>
 
-      <!-- 重置按钮内 -->
-      <a-button @click="searchReset(1)" style="margin-left: 30px" icon="redo">重置</a-button>
+      <a @click.stop.prevent="onSearch" class="search">查询</a>
+      <a-divider type="vertical" style="background:blue;" />
+      <a @click.stop.prevent="searchReset(1)" class="reset">重置</a>
     </div>
 
-    <!--用户列表-->
-    <div class="cardList">
-      <div
-        class="cardTask"
-        v-for="(item, index) in dataSource"
-        :key="item.id"
-        style="marginBottom:10px;"
-        :class="{ on: index % 2 == 0, off: index % 2 != 0 }"
-      >
-        <a-checkbox @change="select(item)" class="" />
+    <!-- 勾选用户区域 -->
+    <div class="selectContain">
+      <div class="userHead">
+        请勾选用户
+      </div>
+      <!-- 用户 按钮 -->
+      <div class="submit fr">
+        <button @click="close" class="ant-btn" style="marginRight:10px;">取消</button>
+        <button @click="handleSubmit" class="ant-btn" style="margin:10px 10px 0 0 ;">确定</button>
+      </div>
 
-        <span v-if="item.username" class="">
-          用户账号:<span class="black">{{ item.username }}</span>
-        </span>
-        <span v-if="item.realname" class="fr">
-          用户姓名:<span class="black">{{ item.realname }}</span>
-        </span>
+      <!--用户列表-->
+      <div class="cardList">
+        <a-radio-group style="width:100%;marginTop:20px;">
+          <div
+            class="cardTask"
+            v-for="(item, index) in dataSource"
+            :key="item.id"
+            style="marginBottom:10px;"
+            :class="{ on: index % 2 == 0, off: index % 2 != 0 }"
+          >
+            <a-radio :value="index" @change="select(item)" />
+
+            <span v-if="item.username">
+              用户账号:<span class="black">{{ item.username }}</span>
+            </span>
+            <span v-if="item.realname" class="fr">
+              用户姓名:<span class="black">{{ item.realname }}</span>
+            </span>
+          </div>
+        </a-radio-group>
       </div>
     </div>
   </a-modal>
@@ -72,279 +79,288 @@ import { filterObj } from '@/utils/util'
 import { queryDepartTreeList, getUserList, queryUserByDepId } from '@/api/api'
 
 export default {
-    name: 'SelectModal',
-    components: {},
-    data () {
-        return {
-            queryParam: {
-                username: ''
-            },
-            columns: [
-                {
-                    title: '用户账号',
-                    align: 'center',
-                    dataIndex: 'username'
-                },
-                {
-                    title: '用户姓名',
-                    align: 'center',
-                    dataIndex: 'realname'
-                },
-                {
-                    title: '性别',
-                    align: 'center',
-                    dataIndex: 'sex',
-                    customRender: function (text) {
-                        if (text === 1) {
-                            return '男'
-                        } else if (text === 2) {
-                            return '女'
-                        } else {
-                            return text
-                        }
-                    }
-                },
-                {
-                    title: '手机',
-                    align: 'center',
-                    dataIndex: 'phone'
-                },
-                {
-                    title: '部门',
-                    align: 'center',
-                    dataIndex: 'orgCode'
-                }
-            ],
-            scrollTrigger: {},
-            dataSource: [],
-            selectedRowKeys: [],
-            selectUserRows: [],
-            selectUserIds: [],
-            title: '根据部门选择用户',
-            ipagination: {
-                current: 1,
-                pageSize: 1000,
-                pageSizeOptions: ['10', '20', '30'],
-                showTotal: (total, range) => {
-                    return range[0] + '-' + range[1] + ' 共' + total + '条'
-                },
-                showQuickJumper: true,
-                showSizeChanger: true,
-                total: 0
-            },
-            isorter: {
-                column: 'createTime',
-                order: 'desc'
-            },
-            selectedDepIds: [],
-            departTree: [],
-            visible: false,
-            form: this.$form.createForm(this),
-            loading: false,
-            expandedKeys: []
-        }
-    },
-    props: ['modalWidth', 'multi', 'userIds', 'customReturnField'],
-    computed: {
-    // 计算属性的 getter
-        getType: function () {
-            return this.multi == true ? 'checkbox' : 'radio'
-        }
-    },
-    watch: {
-        userIds: {
-            immediate: true,
-            handler () {
-                this.initUserNames()
-            }
-        }
-    },
-    created () {
-    // 该方法触发屏幕自适应
-        this.resetScreenSize()
-        this.loadData()
-    },
-    methods: {
-        select (item) {
-            console.log(item)
-            this.selectUserRows = []
-            this.selectUserRows.push(item)
-            this.selectUserIds = []
-            this.selectUserIds = item.username
+  name: 'SelectModal',
+  components: {},
+  data() {
+    return {
+      queryParam: {
+        username: ''
+      },
+      columns: [
+        {
+          title: '用户账号',
+          align: 'center',
+          dataIndex: 'username'
         },
-        initUserNames () {
-            if (this.userIds) {
-                // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
-                let values = this.userIds.split(',') + ','
-                var param = {
-                    // username: values,
-                    pageNo: 1,
-                    pageSize: values.length
-                }
-                param[this.customReturnField] = values
-                console.log('回显用户参数', param)
-                getUserList(param).then(res => {
-                    if (res.success) {
-                        let selectedRowKeys = []
-                        let realNames = []
-                        res.result.records.forEach(user => {
-                            realNames.push(user['realname'])
-                            selectedRowKeys.push(user['id'])
-                        })
-                        this.selectedRowKeys = selectedRowKeys
-                        console.log('回显用户', selectedRowKeys)
-                        this.$emit('initComp', realNames.join(','))
-                    }
-                })
-            } else {
-                // JSelectUserByDep组件bug issues/I16634
-                this.$emit('initComp', '')
-            }
+        {
+          title: '用户姓名',
+          align: 'center',
+          dataIndex: 'realname'
         },
-        async loadData (arg) {
-            if (arg === 1) {
-                this.ipagination.current = 1
-            }
-            if (this.selectedDepIds && this.selectedDepIds.length > 0) {
-                await this.initQueryUserByDepId(this.selectedDepIds)
+        {
+          title: '性别',
+          align: 'center',
+          dataIndex: 'sex',
+          customRender: function(text) {
+            if (text === 1) {
+              return '男'
+            } else if (text === 2) {
+              return '女'
             } else {
-                this.loading = true
-                let params = this.getQueryParams() // 查询条件
-                if (params.username) params.username = `*${params.username}*`
-                await getUserList(params)
-                    .then(res => {
-                        if (res.success) {
-                            this.dataSource = res.result.records
-                            console.log(this.dataSource)
-                            console.log('这才是table内容')
-                            this.ipagination.total = res.result.total
-                        }
-                    })
-                    .finally(() => {
-                        this.loading = false
-                    })
+              return text
             }
+          }
         },
-        // 触发屏幕自适应
-        resetScreenSize () {
-            let screenWidth = document.body.clientWidth
-            if (screenWidth < 500) {
-                this.scrollTrigger = { x: 800 }
-            } else {
-                this.scrollTrigger = {}
-            }
-        },
-        showModal () {
-            this.visible = true
-            this.queryDepartTree()
-            this.initUserNames()
-            this.loadData()
-            this.form.resetFields()
+        {
+          title: '手机',
+          align: 'center',
+          dataIndex: 'phone'
         },
-        getQueryParams () {
-            let param = Object.assign({}, this.queryParam, this.isorter)
-            param.field = this.getQueryField()
-            param.pageNo = this.ipagination.current
-            param.pageSize = this.ipagination.pageSize
-            return filterObj(param)
-        },
-        getQueryField () {
-            let str = 'id,'
-            for (let a = 0; a < this.columns.length; a++) {
-                str += ',' + this.columns[a].dataIndex
-            }
-            return str
-        },
-        searchReset (num) {
-            let that = this
-            if (num !== 0) {
-                that.queryParam = {}
-                that.loadData(1)
-            }
-            that.selectedRowKeys = []
-            that.selectUserIds = []
-            that.selectedDepIds = []
-        },
-        close () {
-            this.searchReset(0)
-            this.visible = false
-        },
-        handleTableChange (pagination, filters, sorter) {
-            // TODO 筛选
-            if (Object.keys(sorter).length > 0) {
-                this.isorter.column = sorter.field
-                this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
-            }
-            this.ipagination = pagination
-            this.loadData()
-        },
-        handleSubmit () {
-            let that = this
-            // this.getSelectUserRows()
-            that.$emit('ok', that.selectUserRows, that.selectUserIds)
-            that.searchReset(0)
-            that.close()
-        },
-        // 获取选择用户信息
-        getSelectUserRows (rowId) {
-            let dataSource = this.dataSource
-            let userIds = ''
-            this.selectUserRows = []
-            for (let i = 0, len = dataSource.length; i < len; i++) {
-                if (this.selectedRowKeys.includes(dataSource[i].id)) {
-                    this.selectUserRows.push(dataSource[i])
-                    // userIds = userIds + "," + dataSource[i].username
-                    userIds = userIds + ',' + dataSource[i][this.customReturnField]
-                }
-            }
-            this.selectUserIds = userIds.substring(1)
-        },
-        // 点击树节点,筛选出对应的用户
-        onDepSelect (selectedDepIds) {
-            if (selectedDepIds[0] != null) {
-                this.initQueryUserByDepId(selectedDepIds) // 调用方法根据选选择的id查询用户信息
-                if (this.selectedDepIds[0] !== selectedDepIds[0]) {
-                    this.selectedDepIds = [selectedDepIds[0]]
-                }
-            }
-        },
-        onSelectChange (selectedRowKeys, selectionRows) {
-            this.selectedRowKeys = selectedRowKeys
-            this.selectionRows = selectionRows
-        },
-        onSearch () {
-            this.loadData(1)
-        },
-        // 根据选择的id来查询用户信息
-        initQueryUserByDepId (selectedDepIds) {
-            this.loading = true
-            let params = this.getQueryParams() // 查询条件
-            let username = params.username || ''
-            return queryUserByDepId({ id: selectedDepIds.toString(), username: username })
-                .then(res => {
-                    if (res.success) {
-                        this.dataSource = res.result
-                        this.ipagination.total = res.result.length
-                    }
-                })
-                .finally(() => {
-                    this.loading = false
-                })
+        {
+          title: '部门',
+          align: 'center',
+          dataIndex: 'orgCode'
+        }
+      ],
+      scrollTrigger: {},
+      dataSource: [],
+      selectedRowKeys: [],
+      selectUserRows: [],
+      selectUserIds: [],
+      title: '根据部门选择用户',
+      ipagination: {
+        current: 1,
+        pageSize: 1000,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
         },
-        queryDepartTree () {
-            queryDepartTreeList().then(res => {
-                if (res.success) {
-                    this.departTree = res.result
-                    // console.log('我想看到这')
-                    // 默认展开父节点
-                    this.expandedKeys = this.departTree.map(item => item.id)
-                }
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      isorter: {
+        column: 'createTime',
+        order: 'desc'
+      },
+      selectedDepIds: [],
+      departTree: [],
+      visible: false,
+      form: this.$form.createForm(this),
+      loading: false,
+      expandedKeys: []
+    }
+  },
+  props: ['modalWidth', 'multi', 'userIds', 'customReturnField'],
+  computed: {
+    // 计算属性的 getter
+    getType: function() {
+      return this.multi == true ? 'checkbox' : 'radio'
+    }
+  },
+  watch: {
+    userIds: {
+      immediate: true,
+      handler() {
+        this.initUserNames()
+      }
+    }
+  },
+  created() {
+    // 该方法触发屏幕自适应
+    this.resetScreenSize()
+    this.loadData()
+  },
+  methods: {
+    select(item) {
+      console.log(item)
+      this.selectUserRows = []
+      this.selectUserRows.push(item)
+      this.selectUserIds = []
+      this.selectUserIds = item.username
+    },
+    initUserNames() {
+      if (this.userIds) {
+        // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
+        let values = this.userIds.split(',') + ','
+        var param = {
+          // username: values,
+          pageNo: 1,
+          pageSize: values.length
+        }
+        param[this.customReturnField] = values
+        console.log('回显用户参数', param)
+        getUserList(param).then(res => {
+          if (res.success) {
+            let selectedRowKeys = []
+            let realNames = []
+            res.result.records.forEach(user => {
+              realNames.push(user['realname'])
+              selectedRowKeys.push(user['id'])
             })
-        },
-        modalFormOk () {
-            this.loadData()
+            this.selectedRowKeys = selectedRowKeys
+            console.log('回显用户', selectedRowKeys)
+            this.$emit('initComp', realNames.join(','))
+          }
+        })
+      } else {
+        // JSelectUserByDep组件bug issues/I16634
+        this.$emit('initComp', '')
+      }
+    },
+    async loadData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      if (this.selectedDepIds && this.selectedDepIds.length > 0) {
+        await this.initQueryUserByDepId(this.selectedDepIds)
+      } else {
+        this.loading = true
+        let params = this.getQueryParams() // 查询条件
+        if (params.username) params.username = `*${params.username}*`
+        await getUserList(params)
+          .then(res => {
+            if (res.success) {
+              this.dataSource = res.result.records
+              console.log(this.dataSource)
+              console.log('这是原本table的内容转化')
+              this.ipagination.total = res.result.total
+            }
+          })
+          .finally(() => {
+            this.loading = false
+          })
+      }
+    },
+    // 触发屏幕自适应
+    resetScreenSize() {
+      let screenWidth = document.body.clientWidth
+      if (screenWidth < 500) {
+        this.scrollTrigger = { x: 800 }
+      } else {
+        this.scrollTrigger = {}
+      }
+    },
+    showModal() {
+      this.visible = true
+      this.queryDepartTree()
+      this.initUserNames()
+      this.loadData()
+      this.form.resetFields()
+    },
+    // 点击大弹框右上角关闭
+    handleCancel(e) {
+      console.log('Clicked cancel button')
+      this.visible = false
+    },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.field = this.getQueryField()
+      param.pageNo = this.ipagination.current
+      param.pageSize = this.ipagination.pageSize
+      return filterObj(param)
+    },
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    searchReset(num) {
+      let that = this
+      if (num !== 0) {
+        that.queryParam = {}
+        that.loadData(1)
+      }
+      that.selectedRowKeys = []
+      that.selectUserIds = []
+      that.selectedDepIds = []
+    },
+
+    // 用户列表的取消
+    close() {
+      this.searchReset(0)
+      this.visible = false
+    },
+    // 用户列表的提交
+    handleSubmit() {
+      let that = this
+      // this.getSelectUserRows()
+      that.$emit('ok', that.selectUserRows, that.selectUserIds)
+      that.searchReset(0)
+      that.close()
+    },
+    // handleTableChange(pagination, filters, sorter) {
+    //   // TODO 筛选
+    //   if (Object.keys(sorter).length > 0) {
+    //     this.isorter.column = sorter.field
+    //     this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
+    //   }
+    //   this.ipagination = pagination
+    //   this.loadData()
+    // },
+
+    // 获取选择用户信息
+    getSelectUserRows(rowId) {
+      let dataSource = this.dataSource
+      let userIds = ''
+      this.selectUserRows = []
+      for (let i = 0, len = dataSource.length; i < len; i++) {
+        if (this.selectedRowKeys.includes(dataSource[i].id)) {
+          this.selectUserRows.push(dataSource[i])
+          // userIds = userIds + "," + dataSource[i].username
+          userIds = userIds + ',' + dataSource[i][this.customReturnField]
+        }
+      }
+      this.selectUserIds = userIds.substring(1)
+    },
+    // 点击树节点,筛选出对应的用户
+    onDepSelect(selectedDepIds) {
+      if (selectedDepIds[0] != null) {
+        this.initQueryUserByDepId(selectedDepIds) // 调用方法根据选选择的id查询用户信息
+        if (this.selectedDepIds[0] !== selectedDepIds[0]) {
+          this.selectedDepIds = [selectedDepIds[0]]
+        }
+      }
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+    },
+    onSearch() {
+      this.loadData(1)
+    },
+    // 根据选择的id来查询用户信息
+    initQueryUserByDepId(selectedDepIds) {
+      this.loading = true
+      let params = this.getQueryParams() // 查询条件
+      let username = params.username || ''
+      return queryUserByDepId({ id: selectedDepIds.toString(), username: username })
+        .then(res => {
+          if (res.success) {
+            this.dataSource = res.result
+            this.ipagination.total = res.result.length
+          }
+        })
+        .finally(() => {
+          this.loading = false
+        })
+    },
+    queryDepartTree() {
+      queryDepartTreeList().then(res => {
+        if (res.success) {
+          this.departTree = res.result
+          // console.log('我想看到这')
+          // 默认展开父节点
+          this.expandedKeys = this.departTree.map(item => item.id)
         }
+      })
+    },
+    modalFormOk() {
+      this.loadData()
     }
+  }
 }
 </script>
 
@@ -353,11 +369,6 @@ export default {
 @import '~@assets/less/common.less';
 </style>
 <style lang="less" scoped>
-.ant-table-tbody .ant-table-row td {
-  padding-top: 10px;
-  padding-bottom: 10px;
-}
-
 #components-layout-demo-custom-trigger .trigger {
   font-size: 18px;
   line-height: 64px;
@@ -365,31 +376,73 @@ export default {
   cursor: pointer;
   transition: color 0.3s;
 }
-.tree {
-  background-color: pink;
-}
-/deep/.ant-modal-cust-warp {
-  background-color: red;
-}
+
 .black {
   color: black;
 }
-.on {
-  background: #F0F8FF;
-  border-radius: 10px;
+
+// 请选择分支
+/deep/.ant-card-head {
+  background-color: rgba(26, 133, 229, 0.5);
+  border-bottom-left-radius: 20px;
+  border-bottom-right-radius: 20px;
+  font-weight: 700;
 }
-.off {
-  background: rgba(210, 180, 140, 0.1);
-  border-radius: 10px;
-  border: none;
+
+/deep/.ant-card-body {
+  padding: 10px;
+}
+// 搜索
+.line {
+  margin: 30px 0;
+  padding: 20px 0 0 10px;
+  border-radius: 4px;
+  .search {
+    margin: 0 5px 0 20px;
+    border: none;
+    color: blue;
+  }
+  .reset {
+    border: none;
+    color: blue;
+    margin-left: 5px;
+  }
+}
+
+// 用户确定按钮
+.submit {
+  .button {
+    border: none !important;
+    background-color: #fff;
+  }
 }
 
-.cardTask {
-  padding: 0;
-  margin: 20px;
-  // padding: 8px 0 0 10px 10px;
-  span {
-    display: inline-block;
+//用户勾选区域
+.selectContain {
+  border: 1px solid #e8e8e8;
+  .userHead {
+    padding: 16px 0 16px 12px;
+    background-color: rgba(26, 133, 229, 0.5);
+    border-bottom-left-radius: 20px;
+    border-bottom-right-radius: 20px;
+    font-weight: 700;
+    font-size: 16px;
+    color: #000000d9;
+    margin-bottom: 10px;
+  }
+  .cardList {
+    //每个任务
+    .cardTask {
+      padding: 6px;
+    }
+    .on {
+      background: rgba(47, 144, 231, 0.2);
+      border: none;
+    }
+    .off {
+      background: rgba(210, 180, 140, 0.2);
+      border: none;
+    }
   }
 }
 </style>

+ 0 - 1
src/views/user/tabs/SelectPerson.vue

@@ -1,7 +1,6 @@
 <template>
   <!-- -----------------------------------
     此页面是 选择委托人 及 选择框的大结构
-
     及 传参
   ---------------------------------------->
   <div class="selectPerson">

+ 9 - 10
src/views/user/tabs/WaitTab.vue

@@ -28,14 +28,14 @@
         <!-- 优先级 -->
         <p>
           优先级:
-          <span class="priorityComm" v-if="item.priority == 0" style="background:rgba(252, 96, 10,.4);color:#092834;">
+          <span class="priorityComm" v-if="item.priority == 0" style="background:rgba(252, 96, 10,.6);color:#092834;">
             普通
           </span>
-          <span class="priorityComm" v-else-if="item.priority == 1" style="background:#FC600A;color:white;">
+          <span class="priorityComm" v-else-if="item.priority == 1" style="background:rgba(255, 0, 0,.6);color:white;">
             重要
           </span>
 
-          <span class="priorityComm" v-else-if="item.priority == 2" style="background:red;color:white;">
+          <span class="priorityComm" v-else-if="item.priority == 2" style="background:rgba(255, 0, 0,.8);color:white;">
             紧急
           </span>
           <span class="priorityComm" v-else style="background:#999;">
@@ -46,10 +46,10 @@
         <!-- 状态 -->
         <p style="float:left;marginBottom:30px;">
           状态:
-          <span v-if="item.isSuspended == false" style="background:rgba(252, 96, 10,.7)" class="resultComm">
+          <span v-if="item.isSuspended == false" style="background:rgba(252, 96, 10,.6)" class="resultComm">
             已激活
           </span>
-          <span v-if="item.isSuspended == true" style="background:rgba(20, 137, 184,.8)" class="resultComm">
+          <span v-if="item.isSuspended == true" style="background:rgba(20, 137, 184,.6)" class="resultComm">
             已挂起
           </span>
           {{ item.status }}
@@ -67,11 +67,10 @@
 
         <!-- 操作 -->
         <div class="operation">
-          <p>
+          <!-- <p>
             <span class="operationImg"><img src="@assets/set.png"/></span>
             操作
-          </p>
-
+          </p> -->
           <div class="btns">
             <i class="itemBtn">
               <a-button ghost @click="detail(item)" style="box-shadow: 8px 8px 8px rgba(128, 128, 128);color:#4e73b9;">
@@ -204,8 +203,6 @@
 
             <!-- 选择委托人 -->
             <a-form-item label="选择委托人" prop="userId" :error="error" v-show="form.type == 2">
-              <!-- <JSelectUserByDep v-model="form.userId" :multi="false"></JSelectUserByDep> -->
-
               <selectPerson v-model="form.userId" :multi="false"></selectPerson>
             </a-form-item>
 
@@ -667,10 +664,12 @@ export default {
 </style>
 <style lang="less" scoped>
 .btns {
+  // 两行按钮样式
   .itemBtn {
     display: inline-block;
     padding: 0 12px;
     font-weight: 700 !important;
+    margin-bottom: 30px;
   }
 }
 </style>