modifyNotice.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <template>
  2. <normal-dialog
  3. :show-dialog.sync="show"
  4. :title="title"
  5. :is-default-close="false"
  6. width="60%"
  7. :show-footer="!disabled"
  8. @confirm="confirmForm()"
  9. @cancel="cancel()"
  10. >
  11. <article>
  12. <h2 v-show="type==='require'" class="form-title">需求范围</h2>
  13. <h2 v-show="type==='task'" class="form-title">任务范围</h2>
  14. <el-form ref="form" :model="formData" label-width="100px" label-position="left">
  15. <el-form-item v-if="type === 'require'" label="需求方向">
  16. <el-cascader
  17. v-model="formData.requireOrientIdList"
  18. size="small"
  19. collapse-tags
  20. :props="requireProps"
  21. :options="directionList"
  22. placeholder="请选择"
  23. clearable
  24. :disabled="disabled"
  25. />
  26. </el-form-item>
  27. <el-form-item v-if="type === 'task'" label="技术模块">
  28. <el-cascader
  29. v-model="formData.techModuleIdList"
  30. size="small"
  31. collapse-tags
  32. :props="requireProps"
  33. :options="directionList"
  34. placeholder="请选择"
  35. clearable
  36. :disabled="disabled"
  37. />
  38. </el-form-item>
  39. </el-form>
  40. <el-form ref="form" :model="formData" label-width="100px" label-position="left" :inline="true">
  41. <el-form-item label="跟版客户端">
  42. <el-select v-model="formData.clientId" placeholder="请选择" size="small" :disabled="disabled">
  43. <el-option v-for="item in appClientList" :key="'app'+item.code" :label="item.msg" :value="item.code" />
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <el-select v-model="formData.clientVersionId" placeholder="请选择" size="small" :disabled="disabled">
  48. <el-option v-for="item in clientList" :key="'client'+item.code" :label="item.msg" :value="item.code" />
  49. </el-select>
  50. </el-form-item>
  51. </el-form>
  52. <h2 class="form-title">通知条件(必选)</h2>
  53. <el-form ref="form" :model="formData" label-width="100px" label-position="left">
  54. <el-form-item v-for="(item,index) in formData.noticeConditionList" :key="'condition'+index" label="条件">
  55. <el-select v-model="item.type" placeholder="请选择类型" size="small" class="condition-select" :disabled="disabled" @change="changeNoticeItem(item)">
  56. <el-option v-for="key in typeList" :key="key.label" :label="key.label" :value="key.value" />
  57. </el-select>
  58. <el-select v-show="item.type === 1 || item.type === 3" v-model="item.status" placeholder="请选择状态" size="small" class="condition-select" :disabled="disabled">
  59. <el-option v-for="key in statusList" :key="'status'+key.code" :label="key.msg" :value="key.code" />
  60. </el-select>
  61. <el-select v-show="item.type === 1 || item.type === 3" v-model="item.triggerEvent" placeholder="请选择" size="small" class="condition-select" :disabled="disabled">
  62. <el-option v-for="key in triggerList" :key="'trigger'+key.code" :label="key.name" :value="key.code" />
  63. </el-select>
  64. <el-select v-show="item.type === 2 || item.type === 4" v-model="item.triggerEvent" placeholder="请选择" size="small" class="condition-select" :disabled="disabled">
  65. <el-option v-for="key in noticeEventList" :key="'event'+key.code" :label="key.name" :value="key.code" />
  66. </el-select>
  67. <el-select v-show="item.type === 1 || item.type === 3" v-model="item.greaterTime" placeholder="请选择" size="small" class="condition-select" :disabled="disabled">
  68. <el-option v-for="key in rangDaysList" :key="'greaterTime'+key.value" :label="key.label" :value="key.value" />
  69. </el-select>
  70. <el-select v-show="item.type === 2 || item.type === 4" v-model="item.lessTime" placeholder="请选择" size="small" class="condition-select" :disabled="disabled">
  71. <el-option v-for="key in aheadDaysList" :key="'lessTime'+key.value" :label="key.label" :value="key.value" />
  72. </el-select>
  73. <i v-show="!disabled" class="el-icon-remove-outline" @click="removeItem(index)" />
  74. </el-form-item>
  75. <div v-show="!disabled" class="add-condition" @click="addCondition()"><i class="el-icon-circle-plus-outline" /> 添加条件</div>
  76. </el-form>
  77. <h2 class="form-title">通知方式(必选)</h2>
  78. <el-form ref="form" :model="formData" label-width="100px" label-position="left">
  79. <!-- 邮件方式 -->
  80. <el-checkbox v-model="noticeList.Email" class="notice-check" :disabled="disabled">邮件</el-checkbox>
  81. <el-form-item v-for="(item,index) in EmailList" :key="'email'+index" :label="index===0?'通知人群':''">
  82. <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select" :disabled="disabled" @change="changeNoticeType(item)">
  83. <el-option v-for="key in noticeGroupList" :key="'email-type'+key.label" :label="key.label" :value="key.value" />
  84. </el-select>
  85. <el-select v-show="item.type===1" v-model="item.teams" placeholder="请选择" size="small" :multiple="true" :disabled="disabled">
  86. <el-option v-for="key in teamList" :key="'email-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
  87. </el-select>
  88. <search-people v-show="item.type===2" :value.sync="item.customStaffs" :clearable="false" :multiple="true" :disabled="disabled" />
  89. <i v-if="index!==0 && !disabled" class="el-icon-remove-outline" @click="removeMembers(EmailList,index)" />
  90. </el-form-item>
  91. <div v-show="noticeList.Email && !disabled" class="add-notice" @click="addMembers(EmailList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
  92. <!-- DChart系统方式 -->
  93. <el-checkbox v-model="noticeList.DChart" class="notice-check" :disabled="disabled">DChart系统通知</el-checkbox>
  94. <el-form-item v-for="(item,index) in DChartList" :key="'DChart'+index" :label="index===0?'通知人群':''">
  95. <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select" :disabled="disabled" @change="changeNoticeType(item)">
  96. <el-option v-for="key in noticeGroupList" :key="'DChart-type'+key.label" :label="key.label" :value="key.value" />
  97. </el-select>
  98. <el-select v-show="item.type===1" v-model="item.teams" placeholder="请选择" size="small" :multiple="true" :disabled="disabled">
  99. <el-option v-for="key in teamList" :key="'DChart-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
  100. </el-select>
  101. <search-people v-show="item.type===2" :value.sync="item.customStaffs" :clearable="false" :multiple="true" :disabled="disabled" />
  102. <i v-if="index!==0 && !disabled" class="el-icon-remove-outline" @click="removeMembers(DChartList,index)" />
  103. </el-form-item>
  104. <div v-show="noticeList.DChart && !disabled" class="add-notice" @click="addMembers(DChartList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
  105. <!-- DChart群方式 -->
  106. <el-checkbox v-model="noticeList.Group" class="notice-check" :disabled="disabled">DChart群通知</el-checkbox>
  107. <div v-show="noticeList.Group && !disabled" class="add-condition">
  108. <ul v-show="GroupList.length>0" class="group-list">
  109. <li v-for="(item,index) in GroupList" :key="'gourp-item'+ index" class="group-item">
  110. <div>{{ item.name }}</div>
  111. <div>{{ item.url }}</div>
  112. <span><i class="el-icon-delete" @click.stop="removeGroup(index)" /></span>
  113. </li>
  114. </ul>
  115. <span @click="showGroupForm = true"><i class="el-icon-circle-plus-outline" /> 添加DChart群</span>
  116. <section v-if="showGroupForm" class="group-form">
  117. <el-form ref="groupForm" :model="GroupItem" :rules="groupRules" label-width="200px" label-position="left">
  118. <el-form-item prop="name" label="群名称或群ID">
  119. <el-input
  120. v-model="GroupItem.name"
  121. type="textarea"
  122. maxlength="150"
  123. show-word-limit
  124. :autosize="{ minRows: 1, maxRows: 5 }"
  125. />
  126. </el-form-item>
  127. <el-form-item prop="url" label="机器人webhook地址">
  128. <el-input
  129. v-model="GroupItem.url"
  130. type="textarea"
  131. maxlength="200"
  132. show-word-limit
  133. :autosize="{ minRows: 3, maxRows: 6 }"
  134. />
  135. </el-form-item>
  136. </el-form>
  137. <div class="group-confirm">
  138. <el-button size="small" @click.stop="showGroupForm = false">取消</el-button>
  139. <el-button type="primary" size="small" @click.stop="addGroup()">确认</el-button>
  140. </div>
  141. </section>
  142. </div>
  143. </el-form>
  144. <h2 class="form-title">通知时刻</h2>
  145. <div class="notice-time">
  146. <el-time-select
  147. v-model="formData.noticeTime"
  148. placeholder="任意时间点"
  149. size="small"
  150. value-format="HH:mm"
  151. :picker-options="{
  152. start: '00:00',
  153. step: '00:15',
  154. end: '23:45',
  155. }"
  156. :disabled="disabled"
  157. />
  158. </div>
  159. </article>
  160. </normal-dialog>
  161. </template>
  162. <script>
  163. const _ = require('lodash')
  164. import {
  165. showRequireStatusEnum,
  166. showTaskStatusEnum,
  167. getBizNoticeSettingEnum,
  168. addBizNoticeSetting,
  169. updateBizNoticeSetting
  170. } from '@/api/configure'
  171. import { settingQueryBizRqmtOrntList } from '@/api/requirement.js'
  172. import { settingQueryBizModuleList } from '@/api/defectManage'
  173. import { queryTeamInfoList } from '@/api/workSchedule'
  174. import { showAppClientEnum } from '@/api/version.js'
  175. import normalDialog from '@/components/dialog/normalDialog'
  176. import searchPeople from '@/components/select/searchPeople'
  177. export default {
  178. components: { normalDialog, searchPeople },
  179. props: {
  180. data: {
  181. type: Object,
  182. default: () => null,
  183. required: false
  184. },
  185. visible: {
  186. type: Boolean,
  187. default: false,
  188. required: true
  189. },
  190. type: {
  191. type: String,
  192. default: 'require', // 需求:require,任务:task
  193. required: false
  194. },
  195. disabled: {// 查看状态,不可修改
  196. type: Boolean,
  197. default: false,
  198. required: false
  199. },
  200. copy: {// 复制
  201. type: Boolean,
  202. default: false,
  203. required: false
  204. }
  205. },
  206. data() {
  207. return {
  208. bizId: Number(localStorage.getItem('bizId')),
  209. title: this.type === 'require' ? '新建需求定时通知' : '新建任务定时通知',
  210. requireProps: {
  211. value: 'id',
  212. label: 'rqmtOrntName',
  213. children: 'childRqmtOrnts',
  214. multiple: true
  215. },
  216. directionList: [], // 需求方面列表
  217. modulesList: [], // 任务模块列表
  218. formData: {
  219. bizId: Number(localStorage.getItem('bizId')),
  220. requireOrientIdList: [], // 需求方向
  221. techModuleIdList: [], // 技术模块
  222. clientId: null, // 客户端
  223. clientVersionId: null, // 版本
  224. noticeConditionList: [], // 条件列表
  225. noticeSetting: {}, // 通知方式
  226. noticeTime: null // 通知时刻
  227. },
  228. EmailList: [], // Email通知列表
  229. DChartList: [], // DChart系统通知列表
  230. GroupList: [], // DChart群通知列表
  231. GroupItem: { name: null, url: null }, // 当前群添加对象
  232. showGroupForm: false,
  233. groupRules: {// 群填写规则
  234. name: [{ required: true, message: '请填写群名称或群ID', trigger: 'change' }],
  235. url: [{ required: true, message: '请填写机器人webhook地址', trigger: 'change' }]
  236. },
  237. noticeList: {// 通知方式列表
  238. Email: false, // 邮件通知
  239. DChart: false, // DChart系统通知
  240. Group: false // DChart群通知
  241. },
  242. noticeGroupList: [], // 通知人群类型选择列表
  243. teamList: [], // 团队选择列表
  244. show: this.visible, // 显示弹框
  245. appClientList: [], // 客户端选择列表
  246. typeList: [], // 条件类型选择列表
  247. statusList: [], // 状态选择列表
  248. noticeEventList: [], // 事件列表
  249. triggerList: [], // 触发事件: 0 停留 1 交付 2 提测
  250. aheadDaysList: [
  251. { label: '3天前开始提醒', value: 3 },
  252. { label: '2天前开始提醒', value: 2 },
  253. { label: '1天前开始提醒', value: 1 },
  254. { label: '过期提醒', value: 0 }
  255. ], // 提前几天提醒
  256. rangDaysList: [] // 条件中大于天数列表
  257. }
  258. },
  259. computed: {
  260. clientList: { // 版本列表
  261. get() {
  262. if (this.formData.clientId !== null) {
  263. const obj = this.appClientList.find(item => item.code === this.formData.clientId)
  264. return (obj && obj.childEnumInfos) || []
  265. } else {
  266. return []
  267. }
  268. }
  269. }
  270. },
  271. watch: {
  272. data: {
  273. handler(newV) {
  274. if (newV) {
  275. this.initData(_.cloneDeep(newV))
  276. }
  277. },
  278. deep: true,
  279. immediate: true
  280. },
  281. type: {
  282. handler(newV) {
  283. this.type = newV
  284. },
  285. immediate: true
  286. },
  287. visible: {
  288. handler(newV) {
  289. this.show = newV
  290. },
  291. immediate: true
  292. },
  293. copy: {
  294. handler(newV) {
  295. this.copy = newV
  296. },
  297. immediate: true
  298. },
  299. disabled: {
  300. handler(newV) {
  301. this.disabled = newV
  302. },
  303. immediate: true
  304. },
  305. // 'formData.clientId': { // 客户端改变,版本默认取第一个版本
  306. // handler(newV) {
  307. // this.formData.clientVersionId = (this.clientList[0] && this.clientList[0].code) || null
  308. // }
  309. // },
  310. 'noticeList.Email': {
  311. handler(newV, oldV) {
  312. if (newV) {
  313. if (this.EmailList.length === 0) this.EmailList.push({ type: 0, member: false, teams: [], customStaffs: [] })
  314. } else {
  315. this.EmailList = []
  316. }
  317. }
  318. },
  319. 'noticeList.DChart': {
  320. handler(newV, oldV) {
  321. if (newV) {
  322. if (this.DChartList.length === 0) this.DChartList.push({ type: 0, member: false, teams: [], customStaffs: [] })
  323. } else {
  324. this.DChartList = []
  325. }
  326. }
  327. }
  328. },
  329. created() {
  330. this.getBizNoticeSettingEnum()
  331. this.getRequireDirection()
  332. this.settingQueryBizModuleList()
  333. this.showAppClientEnum()
  334. this.queryTeamInfoList()
  335. this.init()
  336. },
  337. methods: {
  338. initData(data) {
  339. this.formData = {
  340. id: data.id,
  341. bizId: data.bizId,
  342. requireOrientIdList: data.requireOrientIdList, // 需求方向
  343. techModuleIdList: data.techModuleIdList, // 技术模块
  344. clientId: data.clientId || null, // 客户端
  345. clientVersionId: data.clientVersionId, // 版本
  346. noticeConditionList: data.noticeConditionList || [], // 条件列表
  347. noticeSetting: {}, // 通知方式
  348. noticeTime: data.noticeTime // 通知时刻
  349. }
  350. if (data.noticeSetting.email && data.noticeSetting.email.length > 0) {
  351. this.EmailList = Array(data.noticeSetting.email.length).fill({ type: 0, member: false, teams: [], customStaffs: [] })
  352. this.$nextTick(() => {
  353. this.EmailList = data.noticeSetting.email
  354. })
  355. this.noticeList.Email = true
  356. }
  357. if (data.noticeSetting.dChat && data.noticeSetting.dChat.length > 0) {
  358. this.DChartList = Array(data.noticeSetting.dChat.length).fill({ type: 0, member: false, teams: [], customStaffs: [] })
  359. this.$nextTick(() => {
  360. this.DChartList = data.noticeSetting.dChat
  361. })
  362. this.noticeList.DChart = true
  363. }
  364. if (data.noticeSetting.dChatGroup && data.noticeSetting.dChatGroup.length > 0) {
  365. this.GroupList = data.noticeSetting.dChatGroup || []
  366. this.noticeList.Group = true
  367. }
  368. },
  369. async getBizNoticeSettingEnum() { // 任务需求事件列表
  370. const res = await getBizNoticeSettingEnum(this.bizId)
  371. if (res.code === 200) {
  372. this.triggerList = res.data.noticeConditionOpList
  373. this.type === 'require'
  374. ? this.noticeEventList = res.data.noticeEventRequireOpList
  375. : this.noticeEventList = res.data.noticeEventTaskOpList
  376. }
  377. },
  378. async getRequireDirection() { // 需求方向列表
  379. const res = await settingQueryBizRqmtOrntList(this.bizId)
  380. if (res.code === 200) {
  381. this.directionList = this.getRequireData(res.data)
  382. }
  383. },
  384. async settingQueryBizModuleList() { // 任务模块列表
  385. const res = await settingQueryBizModuleList(this.bizId)
  386. if (res.code === 200) {
  387. this.modulesList = this.getTaskData(res.data)
  388. }
  389. },
  390. getRequireData(data) {
  391. for (var i = 0; i < data.length; i++) {
  392. data[i].childRqmtOrnts.length < 1 ? delete data[i].childRqmtOrnts : this.getRequireData(data[i].childRqmtOrnts)
  393. }
  394. return data
  395. },
  396. getTaskData(data) {
  397. for (var i = 0; i < data.length; i++) {
  398. data[i].childModules.length < 1 ? delete data[i].childModules : this.getTaskData(data[i].childModules)
  399. }
  400. return data
  401. },
  402. async showAppClientEnum() { // 获取客户端列表
  403. const res = await showAppClientEnum()
  404. if (res.code === 200) {
  405. this.appClientList = res.data.appClient
  406. }
  407. },
  408. async showRequireStatusEnum() { // 获取需求状态列表
  409. const res = await showRequireStatusEnum(this.bizId)
  410. if (res.code === 200) {
  411. this.statusList = res.data.requirementStatus || []
  412. }
  413. },
  414. async showTaskStatusEnum() { // 获取任务状态列表
  415. const res = await showTaskStatusEnum(this.bizId)
  416. if (res.code === 200) {
  417. this.statusList = res.data.taskStatus || []
  418. }
  419. },
  420. async queryTeamInfoList() { // 获取用户团队列表
  421. const res = await queryTeamInfoList({ curIndex: 1, pageSize: 9999 })
  422. if (res.code === 200 && res.data) {
  423. this.teamList = res.data.list
  424. }
  425. },
  426. init() {
  427. if (this.type === 'require') {
  428. this.typeList = [{ label: '需求状态', value: 1 }, { label: '需求事件', value: 2 }]
  429. this.noticeGroupList = [{ label: '需求成员', value: 0 }, { label: '团队', value: 1 }, { label: '自定义人员', value: 2 }]
  430. this.showRequireStatusEnum()
  431. } else {
  432. this.typeList = [{ label: '任务状态', value: 3 }, { label: '任务事件', value: 4 }]
  433. this.noticeGroupList = [{ label: '任务成员', value: 0 }, { label: '团队', value: 1 }, { label: '自定义人员', value: 2 }]
  434. this.showTaskStatusEnum()
  435. }
  436. let i = 1
  437. while (i <= 100) {
  438. this.rangDaysList.push({ label: `大于${i}天`, value: i })
  439. i++
  440. }
  441. },
  442. changeNoticeItem(item) { // 修改条件
  443. if (item.type === 0) {
  444. item.triggerEvent = this.triggerList[0].code
  445. } else if (item.type === 1) {
  446. item.triggerEvent = this.noticeEventList[0].code
  447. }
  448. },
  449. addCondition() { // 添加条件
  450. this.formData.noticeConditionList.push({
  451. type: this.typeList[0].value, // 1 需求状态 2 需求事件 3 任务状态 4 任务事件
  452. status: 0,
  453. triggerEvent: 0, // 触发事件: 0 停留 1 交付 2 提测
  454. greaterTime: 1, // 大于的时间
  455. lessTime: 3 // 提前提醒的时间
  456. })
  457. },
  458. removeItem(index) { // 移除条件
  459. this.formData.noticeConditionList.splice(index, 1)
  460. },
  461. addMembers(list) { // 添加成员
  462. list.push({ type: 0, member: false, teams: [], customStaffs: [] })
  463. },
  464. removeMembers(list, index) { // 移除成员
  465. list.splice(index, 1)
  466. },
  467. changeNoticeType(item) { // 修改通知
  468. switch (item.type) {
  469. case 0:
  470. item.member = true
  471. item.teamList = []
  472. item.customStaffList = []
  473. break
  474. case 1:
  475. item.member = false
  476. item.customStaffList = []
  477. break
  478. case 2:
  479. item.member = false
  480. item.teamList = []
  481. break
  482. }
  483. },
  484. addGroup() { // 添加DChart群
  485. this.$refs['groupForm'].validate((valid) => {
  486. if (valid) {
  487. this.GroupList.push({
  488. type: 3,
  489. ...this.GroupItem
  490. })
  491. this.GroupItem = { name: null, url: null }
  492. this.showGroupForm = false
  493. }
  494. })
  495. },
  496. removeGroup(index) { // 移除DChart群
  497. this.GroupList.splice(index, 1)
  498. },
  499. validate() { // 校验入参
  500. if (this.formData.techModuleIdList.length < 1 && this.type === 'task') {
  501. this.$message({ message: '请选择技术方向', type: 'error', duration: 1000, offset: 150 })
  502. return false
  503. }
  504. if (!this.formData.clientId) {
  505. this.$message({ message: '请选择客户端', type: 'error', duration: 1000, offset: 150 })
  506. return false
  507. }
  508. if (this.formData.noticeConditionList.length < 1) {
  509. this.$message({ message: '请添加通知条件', type: 'error', duration: 1000, offset: 150 })
  510. return false
  511. }
  512. if (this.EmailList.length === 0 && this.DChartList.length === 0 && this.GroupList.length === 0) {
  513. this.$message({ message: '请选择一种通知方式', type: 'error', duration: 1000, offset: 150 })
  514. return false
  515. }
  516. if (!this.formData.noticeTime) {
  517. this.$message({ message: '请选择通知时刻', type: 'error', duration: 1000, offset: 150 })
  518. return false
  519. }
  520. this.formData.noticeSetting = {
  521. email: this.noticeList.Email ? this.EmailList : [],
  522. dChat: this.noticeList.DChart ? this.DChartList : [],
  523. dChatGroup: this.noticeList.Group ? this.GroupList : []
  524. }
  525. this.data && !this.copy ? this.updateBizNoticeSetting() : this.addBizNoticeSetting()
  526. },
  527. async addBizNoticeSetting() { // 新增通知
  528. if (this.formData.id) {
  529. delete this.formData.id
  530. }
  531. const res = await addBizNoticeSetting(this.formData)
  532. if (res.code === 200) {
  533. this.$message({ message: '添加成功', type: 'success', duration: 1000, offset: 150 })
  534. this.$emit('confirm')
  535. }
  536. },
  537. async updateBizNoticeSetting() { // 更新通知
  538. const res = await updateBizNoticeSetting(this.formData)
  539. if (res.code === 200) {
  540. this.$message({ message: '修改成功', type: 'success', duration: 1000, offset: 150 })
  541. this.$emit('confirm')
  542. }
  543. },
  544. confirmForm() {
  545. this.validate()
  546. },
  547. cancel() {
  548. this.show = false
  549. this.$emit('update:visible', this.show)
  550. this.$emit('cancel')
  551. }
  552. }
  553. }
  554. </script>
  555. <style lang="scss" scoped>
  556. article::-webkit-scrollbar{
  557. display: none;
  558. }
  559. article{
  560. max-height: 500px;
  561. overflow: scroll;
  562. padding: 0 45px;
  563. .form-title {
  564. margin: 0;
  565. padding: 0;
  566. font-size: 18px;
  567. color: #333333;
  568. margin: 20px 0;
  569. }
  570. .form-title:nth-child(1){
  571. margin-top: 0;
  572. }
  573. /deep/.el-form-item {
  574. font-size: 14px;
  575. margin-bottom: 10px;
  576. label {
  577. color: #666666;
  578. font-weight: 400;
  579. }
  580. }
  581. .condition-select {
  582. width: 22%;
  583. }
  584. .add-condition,.add-notice {
  585. cursor: pointer;
  586. color: #409EFF;
  587. position: relative;
  588. }
  589. .add-notice {
  590. margin-left: 100px;
  591. width: 150px;
  592. }
  593. .notice-check{
  594. margin: 15px 0;
  595. display: block;
  596. width: 150px;
  597. }
  598. .notice-check:nth-child(1){
  599. margin-top: 0;
  600. }
  601. .el-icon-remove-outline {
  602. cursor: pointer;
  603. color: #409EFF;
  604. font-size: 14px;
  605. margin-left: 5px;
  606. }
  607. }
  608. .group-form {
  609. width: 280px;
  610. position: absolute;
  611. bottom: 30px;
  612. left: 0;
  613. padding: 10px;
  614. z-index: 99;
  615. background:rgba(255,255,255,1);
  616. box-shadow:0px 0px 12px rgba(0,0,0,0.1);
  617. /deep/.el-form-item{
  618. display: flex;
  619. flex-direction: column;
  620. margin-bottom: 10px;
  621. .el-form-item__content {
  622. margin: 0 !important;
  623. width: 100%;
  624. line-height: 10px;
  625. }
  626. }
  627. .group-confirm {
  628. display: flex;
  629. justify-content: center;
  630. margin-top: 20px;
  631. button:nth-child(1) {
  632. margin-right: 10px;
  633. }
  634. }
  635. }
  636. .group-list{
  637. margin: 0;
  638. padding: 0;
  639. list-style: none;
  640. width: 100%;
  641. color: #333333;
  642. font-size: 14px;
  643. .group-item {
  644. margin: 0;
  645. padding: 0;
  646. list-style: none;
  647. width: 100%;
  648. display: grid;
  649. grid-template-columns: 30% 60% 10%;
  650. border:1px solid rgba(209,208,208,1);
  651. height:37px;
  652. border-radius: 4px;
  653. margin-bottom: 10px;
  654. align-items: center;
  655. div{
  656. border-right:1px solid rgba(209,208,208,1);
  657. overflow: hidden;
  658. text-overflow: ellipsis;
  659. white-space: nowrap;
  660. text-align: center;
  661. line-height: 37px;
  662. padding: 0 5px;
  663. }
  664. span {
  665. height: 100%;
  666. display: flex;
  667. align-items: center;
  668. justify-content: center;
  669. font-size: 18px;
  670. }
  671. }
  672. }
  673. </style>