|
@@ -48,7 +48,7 @@
|
|
</el-form>
|
|
</el-form>
|
|
<h2 class="form-title">通知条件</h2>
|
|
<h2 class="form-title">通知条件</h2>
|
|
<el-form ref="form" :model="formData" label-width="100px" label-position="left">
|
|
<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-form-item v-for="(item,index) in formData.noticeConditionList" :key="'condition'+index" label="条件">
|
|
<el-select v-model="item.type" placeholder="请选择类型" size="small" class="condition-select" @change="changeNoticeItem(item)">
|
|
<el-select v-model="item.type" placeholder="请选择类型" size="small" class="condition-select" @change="changeNoticeItem(item)">
|
|
<el-option v-for="key in typeList" :key="key.label" :label="key.label" :value="key.value" />
|
|
<el-option v-for="key in typeList" :key="key.label" :label="key.label" :value="key.value" />
|
|
</el-select>
|
|
</el-select>
|
|
@@ -62,7 +62,10 @@
|
|
<el-option v-for="key in noticeEventList" :key="'event'+key.code" :label="key.name" :value="key.code" />
|
|
<el-option v-for="key in noticeEventList" :key="'event'+key.code" :label="key.name" :value="key.code" />
|
|
</el-select>
|
|
</el-select>
|
|
<el-select v-show="item.type === 0" v-model="item.greaterTime" placeholder="请选择" size="small" class="condition-select">
|
|
<el-select v-show="item.type === 0" v-model="item.greaterTime" placeholder="请选择" size="small" class="condition-select">
|
|
- <el-option v-for="key in rangDaysList" :key="key.label" :label="key.label" :value="key.value" />
|
|
|
|
|
|
+ <el-option v-for="key in rangDaysList" :key="'greaterTime'+key.value" :label="key.label" :value="key.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-select v-show="item.type === 1" v-model="item.lessTime" placeholder="请选择" size="small" class="condition-select">
|
|
|
|
+ <el-option v-for="key in aheadDaysList" :key="'lessTime'+key.value" :label="key.label" :value="key.value" />
|
|
</el-select>
|
|
</el-select>
|
|
<i class="el-icon-remove-outline" @click="removeItem(index)" />
|
|
<i class="el-icon-remove-outline" @click="removeItem(index)" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -73,26 +76,26 @@
|
|
<!-- 邮件方式 -->
|
|
<!-- 邮件方式 -->
|
|
<el-checkbox v-model="noticeList.Email" class="notice-check">邮件</el-checkbox>
|
|
<el-checkbox v-model="noticeList.Email" class="notice-check">邮件</el-checkbox>
|
|
<el-form-item v-for="(item,index) in EmailList" :key="'email'+index" :label="index===0?'通知人群':''">
|
|
<el-form-item v-for="(item,index) in EmailList" :key="'email'+index" :label="index===0?'通知人群':''">
|
|
- <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select">
|
|
|
|
|
|
+ <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select" @change="changeNoticeType(item)">
|
|
<el-option v-for="key in noticeGroupList" :key="'email-type'+key.label" :label="key.label" :value="key.value" />
|
|
<el-option v-for="key in noticeGroupList" :key="'email-type'+key.label" :label="key.label" :value="key.value" />
|
|
</el-select>
|
|
</el-select>
|
|
- <el-select v-show="item.type===1" v-model="item.team" placeholder="请选择" size="small">
|
|
|
|
|
|
+ <el-select v-show="item.type===1" v-model="item.teamList" placeholder="请选择" size="small" :multiple="true">
|
|
<el-option v-for="key in teamList" :key="'email-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
|
|
<el-option v-for="key in teamList" :key="'email-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
|
|
</el-select>
|
|
</el-select>
|
|
- <search-people v-show="item.type===2" :value.sync="item.people" :clearable="false" />
|
|
|
|
|
|
+ <search-people v-show="item.type===2" :value.sync="item.customStaffList" :clearable="false" :multiple="true" />
|
|
<i v-if="index!==0" class="el-icon-remove-outline" @click="removeMembers(EmailList,index)" />
|
|
<i v-if="index!==0" class="el-icon-remove-outline" @click="removeMembers(EmailList,index)" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div v-show="noticeList.Email" class="add-notice" @click="addMembers(EmailList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
|
|
<div v-show="noticeList.Email" class="add-notice" @click="addMembers(EmailList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
|
|
<!-- DChart系统方式 -->
|
|
<!-- DChart系统方式 -->
|
|
<el-checkbox v-model="noticeList.DChart" class="notice-check">DChart系统通知</el-checkbox>
|
|
<el-checkbox v-model="noticeList.DChart" class="notice-check">DChart系统通知</el-checkbox>
|
|
<el-form-item v-for="(item,index) in DChartList" :key="'DChart'+index" :label="index===0?'通知人群':''">
|
|
<el-form-item v-for="(item,index) in DChartList" :key="'DChart'+index" :label="index===0?'通知人群':''">
|
|
- <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select">
|
|
|
|
|
|
+ <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select" @change="changeNoticeType(item)">
|
|
<el-option v-for="key in noticeGroupList" :key="'DChart-type'+key.label" :label="key.label" :value="key.value" />
|
|
<el-option v-for="key in noticeGroupList" :key="'DChart-type'+key.label" :label="key.label" :value="key.value" />
|
|
</el-select>
|
|
</el-select>
|
|
- <el-select v-show="item.type===1" v-model="item.team" placeholder="请选择" size="small">
|
|
|
|
|
|
+ <el-select v-show="item.type===1" v-model="item.teamList" placeholder="请选择" size="small" :multiple="true">
|
|
<el-option v-for="key in teamList" :key="'DChart-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
|
|
<el-option v-for="key in teamList" :key="'DChart-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
|
|
</el-select>
|
|
</el-select>
|
|
- <search-people v-show="item.type===2" :value.sync="item.people" :clearable="false" />
|
|
|
|
|
|
+ <search-people v-show="item.type===2" :value.sync="item.customStaffList" :clearable="false" :multiple="true" />
|
|
<i v-if="index!==0" class="el-icon-remove-outline" @click="removeMembers(DChartList,index)" />
|
|
<i v-if="index!==0" class="el-icon-remove-outline" @click="removeMembers(DChartList,index)" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div v-show="noticeList.DChart" class="add-notice" @click="addMembers(DChartList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
|
|
<div v-show="noticeList.DChart" class="add-notice" @click="addMembers(DChartList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
|
|
@@ -102,7 +105,7 @@
|
|
<ul v-show="GroupList.length>0" class="group-list">
|
|
<ul v-show="GroupList.length>0" class="group-list">
|
|
<li v-for="(item,index) in GroupList" :key="'gourp-item'+ index" class="group-item">
|
|
<li v-for="(item,index) in GroupList" :key="'gourp-item'+ index" class="group-item">
|
|
<div>{{ item.name }}</div>
|
|
<div>{{ item.name }}</div>
|
|
- <div>{{ item.link }}</div>
|
|
|
|
|
|
+ <div>{{ item.url }}</div>
|
|
<span><i class="el-icon-delete" @click.stop="removeGroup(index)" /></span>
|
|
<span><i class="el-icon-delete" @click.stop="removeGroup(index)" /></span>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
@@ -118,9 +121,9 @@
|
|
:autosize="{ minRows: 1, maxRows: 5 }"
|
|
:autosize="{ minRows: 1, maxRows: 5 }"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item prop="link" label="机器人webhook地址">
|
|
|
|
|
|
+ <el-form-item prop="url" label="机器人webhook地址">
|
|
<el-input
|
|
<el-input
|
|
- v-model="GroupItem.link"
|
|
|
|
|
|
+ v-model="GroupItem.url"
|
|
type="textarea"
|
|
type="textarea"
|
|
maxlength="200"
|
|
maxlength="200"
|
|
show-word-limit
|
|
show-word-limit
|
|
@@ -135,6 +138,15 @@
|
|
</section>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
+ <h2 class="form-title">通知方式</h2>
|
|
|
|
+ <div class="notice-time">
|
|
|
|
+ <el-time-picker
|
|
|
|
+ v-model="formData.noticeTime"
|
|
|
|
+ placeholder="任意时间点"
|
|
|
|
+ size="small"
|
|
|
|
+ value-format="HH:mm:ss"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
</article>
|
|
</article>
|
|
</normal-dialog>
|
|
</normal-dialog>
|
|
</template>
|
|
</template>
|
|
@@ -186,17 +198,18 @@ export default {
|
|
techModuleId: [], // 技术模块
|
|
techModuleId: [], // 技术模块
|
|
clientId: null, // 客户端
|
|
clientId: null, // 客户端
|
|
clientVersionId: null, // 版本
|
|
clientVersionId: null, // 版本
|
|
- conditionList: [], // 条件列表
|
|
|
|
- noticeType: [] // 通知方式
|
|
|
|
|
|
+ noticeConditionList: [], // 条件列表
|
|
|
|
+ noticeSetting: [], // 通知方式
|
|
|
|
+ noticeTime: null // 通知时刻
|
|
},
|
|
},
|
|
EmailList: [], // Email通知列表
|
|
EmailList: [], // Email通知列表
|
|
DChartList: [], // DChart系统通知列表
|
|
DChartList: [], // DChart系统通知列表
|
|
GroupList: [], // DChart群通知列表
|
|
GroupList: [], // DChart群通知列表
|
|
- GroupItem: { name: null, link: null }, // 当前群添加对象
|
|
|
|
|
|
+ GroupItem: { name: null, url: null }, // 当前群添加对象
|
|
showGroupForm: false,
|
|
showGroupForm: false,
|
|
groupRules: {// 群填写规则
|
|
groupRules: {// 群填写规则
|
|
name: [{ required: true, message: '请填写群名称或群ID', trigger: 'change' }],
|
|
name: [{ required: true, message: '请填写群名称或群ID', trigger: 'change' }],
|
|
- link: [{ required: true, message: '请填写机器人webhook地址', trigger: 'change' }]
|
|
|
|
|
|
+ url: [{ required: true, message: '请填写机器人webhook地址', trigger: 'change' }]
|
|
},
|
|
},
|
|
noticeList: {// 通知方式列表
|
|
noticeList: {// 通知方式列表
|
|
Email: false, // 邮件通知
|
|
Email: false, // 邮件通知
|
|
@@ -251,24 +264,20 @@ export default {
|
|
},
|
|
},
|
|
'formData.clientId': { // 客户端改变,版本默认取第一个版本
|
|
'formData.clientId': { // 客户端改变,版本默认取第一个版本
|
|
handler(newV) {
|
|
handler(newV) {
|
|
- this.formData.clientVersionId = this.clientList[0] || null
|
|
|
|
|
|
+ this.formData.clientVersionId = (this.clientList[0] && this.clientList[0].code) || null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
'noticeList.Email': {
|
|
'noticeList.Email': {
|
|
handler(newV, oldV) {
|
|
handler(newV, oldV) {
|
|
if (newV) {
|
|
if (newV) {
|
|
- if (this.EmailList.length === 0) this.EmailList.push({ type: 0, team: null, people: null })
|
|
|
|
- } else {
|
|
|
|
- this.EmailList = []
|
|
|
|
|
|
+ if (this.EmailList.length === 0) this.EmailList.push({ type: 0, member: false, teamList: [], customStaffList: [] })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
'noticeList.DChart': {
|
|
'noticeList.DChart': {
|
|
handler(newV, oldV) {
|
|
handler(newV, oldV) {
|
|
if (newV) {
|
|
if (newV) {
|
|
- if (this.DChartList.length === 0) this.DChartList.push({ type: 0, team: null, people: null })
|
|
|
|
- } else {
|
|
|
|
- this.DChartList = []
|
|
|
|
|
|
+ if (this.DChartList.length === 0) this.DChartList.push({ type: 0, member: false, teamList: [], customStaffList: [] })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -286,7 +295,6 @@ export default {
|
|
const res = await getBizNoticeSettingEnum(this.bizId)
|
|
const res = await getBizNoticeSettingEnum(this.bizId)
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.triggerList = res.data.noticeConditionOpList
|
|
this.triggerList = res.data.noticeConditionOpList
|
|
- console.log(this.triggerList)
|
|
|
|
this.type === 'require'
|
|
this.type === 'require'
|
|
? this.noticeEventList = res.data.noticeEventRequireOpList
|
|
? this.noticeEventList = res.data.noticeEventRequireOpList
|
|
: this.noticeEventList = res.data.noticeEventTaskOpList
|
|
: this.noticeEventList = res.data.noticeEventTaskOpList
|
|
@@ -364,7 +372,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
addCondition() { // 添加条件
|
|
addCondition() { // 添加条件
|
|
- this.formData.conditionList.push({
|
|
|
|
|
|
+ this.formData.noticeConditionList.push({
|
|
type: 0, // 1 需求状态 2 需求事件 3 任务状态 4 任务事件
|
|
type: 0, // 1 需求状态 2 需求事件 3 任务状态 4 任务事件
|
|
status: 0,
|
|
status: 0,
|
|
triggerEvent: 0, // 触发事件: 0 停留 1 交付 2 提测
|
|
triggerEvent: 0, // 触发事件: 0 停留 1 交付 2 提测
|
|
@@ -373,25 +381,48 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
removeItem(index) { // 移除条件
|
|
removeItem(index) { // 移除条件
|
|
- this.formData.conditionList.splice(index, 1)
|
|
|
|
|
|
+ this.formData.noticeConditionList.splice(index, 1)
|
|
},
|
|
},
|
|
addMembers(list) { // 添加成员
|
|
addMembers(list) { // 添加成员
|
|
- list.push({ type: 0, team: null, people: null })
|
|
|
|
|
|
+ list.push({ type: 0, member: false, teamList: [], customStaffList: [] })
|
|
},
|
|
},
|
|
removeMembers(list, index) { // 移除成员
|
|
removeMembers(list, index) { // 移除成员
|
|
list.splice(index, 1)
|
|
list.splice(index, 1)
|
|
},
|
|
},
|
|
|
|
+ changeNoticeType(item) { // 修改通知
|
|
|
|
+ switch (item.type) {
|
|
|
|
+ case 0:
|
|
|
|
+ item.member = true
|
|
|
|
+ item.teamList = []
|
|
|
|
+ item.customStaffList = []
|
|
|
|
+ break
|
|
|
|
+ case 1:
|
|
|
|
+ item.member = false
|
|
|
|
+ item.customStaffList = []
|
|
|
|
+ break
|
|
|
|
+ case 2:
|
|
|
|
+ item.member = false
|
|
|
|
+ item.teamList = []
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ },
|
|
addGroup() { // 添加DChart群
|
|
addGroup() { // 添加DChart群
|
|
this.GroupList.push({
|
|
this.GroupList.push({
|
|
...this.GroupItem
|
|
...this.GroupItem
|
|
})
|
|
})
|
|
- this.GroupItem = { name: null, link: null }
|
|
|
|
|
|
+ this.GroupItem = { name: null, url: null }
|
|
this.showGroupForm = false
|
|
this.showGroupForm = false
|
|
},
|
|
},
|
|
removeGroup(index) { // 移除DChart群
|
|
removeGroup(index) { // 移除DChart群
|
|
this.GroupList.splice(index, 1)
|
|
this.GroupList.splice(index, 1)
|
|
},
|
|
},
|
|
confirmForm() {
|
|
confirmForm() {
|
|
|
|
+ this.formData.noticeSetting = {
|
|
|
|
+ email: this.noticeList.Email ? this.EmailList : [],
|
|
|
|
+ dChart: this.noticeList.DChart ? this.DChartList : [],
|
|
|
|
+ dchartGroup: this.noticeList.Group ? this.GroupList : []
|
|
|
|
+ }
|
|
|
|
+ console.log(this.formData)
|
|
this.$emit('confirm')
|
|
this.$emit('confirm')
|
|
},
|
|
},
|
|
cancel() {
|
|
cancel() {
|