瀏覽代碼

业务线通知

wangziqian 5 年之前
父節點
當前提交
092102a97d

+ 2 - 2
src/api/configure.js

@@ -181,7 +181,7 @@ export function settingUpdateBizRqmtOrnt(data) {
 // 需求状态列表
 export function showRequireStatusEnum(id) {
   return request({
-    url: TeamManagement + `config/showRequireStatusEnum?bizId=` + id,
+    url: TeamManagement + `/config/showRequireStatusEnum?bizId=` + id,
     method: 'get'
   })
 }
@@ -189,7 +189,7 @@ export function showRequireStatusEnum(id) {
 // 任务状态列表
 export function showTaskStatusEnum(id) {
   return request({
-    url: TeamManagement + `config/showTaskStatusEnum?bizId=` + id,
+    url: TeamManagement + `/config/showTaskStatusEnum?bizId=` + id,
     method: 'get'
   })
 }

+ 96 - 33
src/views/ToConfigure/components/modifyNotice.vue

@@ -8,7 +8,8 @@
     @cancel="cancel()"
   >
     <article>
-      <h2 class="form-title">需求范围</h2>
+      <h2 v-show="type==='require'" class="form-title">需求范围</h2>
+      <h2 v-show="type==='task'" class="form-title">任务范围</h2>
       <el-form ref="form" :model="formData" label-width="100px" label-position="left">
         <el-form-item :label="type === 'require'?'需求方向':'任务方向'">
           <el-select v-model="formData.direction" placeholder="请选择" size="small">
@@ -32,11 +33,11 @@
       <h2 class="form-title">通知条件</h2>
       <el-form ref="form" :model="formData" label-width="100px" label-position="left">
         <el-form-item v-for="(item,index) in formData.conditionList" :key="'condition'+index" label="条件">
-          <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select">
+          <el-select v-model="item.type" placeholder="请选择类型" size="small" class="condition-select">
             <el-option v-for="key in typeList" :key="key.label" :label="key.label" :value="key.value" />
           </el-select>
-          <el-select v-model="item.status" placeholder="请选择" size="small" class="condition-select">
-            <el-option v-for="key in typeList" :key="key.label" :label="key.label" :value="key.value" />
+          <el-select v-model="item.status" placeholder="请选择状态" size="small" class="condition-select">
+            <el-option v-for="key in statusList" :key="'status'+key.code" :label="key.msg" :value="key.code" />
           </el-select>
           <el-select v-model="item.delay" placeholder="请选择" size="small" class="condition-select">
             <el-option v-for="key in typeList" :key="key.label" :label="key.label" :value="key.value" />
@@ -78,14 +79,18 @@
         <div v-show="noticeList.DChart" class="add-notice" @click="addMembers(DChartList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
         <!-- DChart群方式 -->
         <el-checkbox v-model="noticeList.Group" class="notice-check">DChart群通知</el-checkbox>
-        <el-popover
-          placement="bottom-start"
-          width="280"
-          trigger="click"
-        >
-          <section class="group-form">
-            <el-form ref="groupForm" :model="GroupItem" :rules="groupRules" label-width="0" label-position="left">
-              <el-form-item prop="name">
+        <div v-show="noticeList.Group" class="add-condition">
+          <ul v-show="GroupList.length>0" class="group-list">
+            <li v-for="(item,index) in GroupList" :key="'gourp-item'+ index" class="group-item">
+              <div>{{ item.name }}</div>
+              <div>{{ item.link }}</div>
+              <span><i class="el-icon-delete" @click.stop="removeGroup(index)" /></span>
+            </li>
+          </ul>
+          <span @click="showGroupForm = true"><i class="el-icon-circle-plus-outline" /> 添加DChart群</span>
+          <section v-if="showGroupForm" class="group-form">
+            <el-form ref="groupForm" :model="GroupItem" :rules="groupRules" label-width="200px" label-position="left">
+              <el-form-item prop="name" label="群名称或群ID">
                 <el-input
                   v-model="GroupItem.name"
                   type="textarea"
@@ -94,7 +99,7 @@
                   :autosize="{ minRows: 1, maxRows: 5 }"
                 />
               </el-form-item>
-              <el-form-item prop="link">
+              <el-form-item prop="link" label="机器人webhook地址">
                 <el-input
                   v-model="GroupItem.link"
                   type="textarea"
@@ -104,11 +109,12 @@
                 />
               </el-form-item>
             </el-form>
+            <div class="group-confirm">
+              <el-button size="small" @click.stop="showGroupForm = false">取消</el-button>
+              <el-button type="primary" size="small" @click.stop="addGroup()">确认</el-button>
+            </div>
           </section>
-          <div v-show="noticeList.Group" slot="reference" class="add-condition" @click="addGroup()">
-            <i class="el-icon-circle-plus-outline" /> 添加DChart群
-          </div>
-        </el-popover>
+        </div>
       </el-form>
     </article>
   </normal-dialog>
@@ -144,7 +150,7 @@ export default {
   data() {
     return {
       bizId: localStorage.getItem('bizId'),
-      title: '新建需求定时通知',
+      title: this.type === 'require' ? '新建需求定时通知' : '新建任务定时通知',
       formData: {
         direction: null, // 方向
         app: null, // 客户端
@@ -156,6 +162,7 @@ export default {
       DChartList: [], // DChart系统通知列表
       GroupList: [], // DChart群通知列表
       GroupItem: { name: null, link: null }, // 当前群添加对象
+      showGroupForm: false,
       groupRules: {// 群填写规则
         name: [{ required: true, message: '请填写群名称或群ID', trigger: 'change' }],
         link: [{ required: true, message: '请填写机器人webhook地址', trigger: 'change' }]
@@ -224,15 +231,6 @@ export default {
           this.DChartList = []
         }
       }
-    },
-    'noticeList.Group': {
-      handler(newV, oldV) {
-        if (newV) {
-          if (this.GroupList.length === 0) this.GroupList.push({ name: null, link: null })
-        } else {
-          this.GroupList = []
-        }
-      }
     }
   },
   created() {
@@ -250,13 +248,13 @@ export default {
     async showRequireStatusEnum() { // 获取需求状态列表
       const res = await showRequireStatusEnum(this.bizId)
       if (res.code === 200) {
-        this.statusList = res.data || []
+        this.statusList = res.data.requirementStatus || []
       }
     },
     async showTaskStatusEnum() { // 获取任务状态列表
       const res = await showTaskStatusEnum(this.bizId)
       if (res.code === 200) {
-        this.statusList = res.data || []
+        this.statusList = res.data.taskStatus || []
       }
     },
     async queryTeamInfoList() { // 获取用户团队列表
@@ -269,11 +267,11 @@ export default {
       if (this.type === 'require') {
         this.typeList = [{ label: '需求状态', value: 0 }, { label: '需求事件', value: 1 }]
         this.noticeGroupList = [{ label: '需求成员', value: 0 }, { label: '团队', value: 1 }, { label: '自定义人员', value: 2 }]
-        // this.showRequireStatusEnum()
+        this.showRequireStatusEnum()
       } else {
         this.typeList = [{ label: '任务状态', value: 0 }, { label: '任务事件', value: 1 }]
         this.noticeGroupList = [{ label: '任务成员', value: 0 }, { label: '团队', value: 1 }, { label: '自定义人员', value: 2 }]
-        // this.showTaskStatusEnum()
+        this.showTaskStatusEnum()
       }
     },
     addCondition() { // 添加条件
@@ -289,7 +287,11 @@ export default {
       list.splice(index, 1)
     },
     addGroup() { // 添加DChart群
-      this.GroupList.push({ name: null, link: null })
+      this.GroupList.push({
+        ...this.GroupItem
+      })
+      this.GroupItem = { name: null, link: null }
+      this.showGroupForm = false
     },
     removeGroup(index) { // 移除DChart群
       this.GroupList.splice(index, 1)
@@ -306,7 +308,12 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
+article::-webkit-scrollbar{
+  display: none;
+}
 article{
+  max-height: 500px;
+  overflow: scroll;
   padding: 0 45px;
   .form-title {
     margin: 0;
@@ -332,6 +339,7 @@ article{
   .add-condition,.add-notice {
     cursor: pointer;
     color: #409EFF;
+    position: relative;
   }
   .add-notice {
     margin-left: 100px;
@@ -353,13 +361,68 @@ article{
   }
 }
 .group-form {
+  width: 280px;
+  position: absolute;
+  bottom: 30px;
+  left: 0;
+  padding: 10px;
+  z-index: 99;
+  background:rgba(255,255,255,1);
+  box-shadow:0px 0px 12px rgba(0,0,0,0.1);
   /deep/.el-form-item{
     display: flex;
+    flex-direction: column;
+    margin-bottom: 10px;
     .el-form-item__content {
-      margin: 0;
+      margin: 0 !important;
       width: 100%;
       line-height: 10px;
     }
   }
+  .group-confirm {
+    display: flex;
+    justify-content: center;
+    margin-top: 20px;
+    button:nth-child(1) {
+      margin-right: 10px;
+    }
+  }
+}
+.group-list{
+  margin: 0;
+  padding: 0;
+  list-style: none;
+  width: 100%;
+  color: #333333;
+  font-size: 14px;
+  .group-item {
+    margin: 0;
+    padding: 0;
+    list-style: none;
+    width: 100%;
+    display: grid;
+    grid-template-columns: 30% 60% 10%;
+    border:1px solid rgba(209,208,208,1);
+    height:37px;
+    border-radius: 4px;
+    margin-bottom: 10px;
+    align-items: center;
+    div{
+      border-right:1px solid rgba(209,208,208,1);
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      text-align: center;
+      line-height: 37px;
+      padding: 0 5px;
+    }
+    span {
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-size: 18px;
+    }
+  }
 }
 </style>

+ 6 - 2
src/views/ToConfigure/components/noticeConfig.vue

@@ -14,8 +14,8 @@
         popper-class="notice-config-popper"
       >
         <ul class="add-require-task">
-          <li @click="visibleModify = true">需求定时通知</li>
-          <li @click="visibleModify = true">任务定时通知</li>
+          <li @click="addNotice('require')">需求定时通知</li>
+          <li @click="addNotice('task')">任务定时通知</li>
         </ul>
         <el-button slot="reference" type="primary" size="medium" class="control-add">
           <i class="el-icon-plus" />新建<i class="el-icon-arrow-down" />
@@ -117,6 +117,10 @@ export default {
   methods: {
     confirmModify() {
       this.visibleModify = false
+    },
+    addNotice(type) {
+      this.modifyType = type
+      this.visibleModify = true
     }
   }
 }