dialog_vue.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <template>
  2. <div class="copy-task">
  3. <el-dialog :title="tit_Name" :visible.sync="dialogFormVisible" width="70%" :close-on-click-modal="false" :destroy-on-close="true">
  4. <div class="blueStripe" />
  5. <el-form ref="task_form" :model="task_form" :rules="task_rulesForm" label-position="left" label-width="130px">
  6. <el-form-item label="任务名称" prop="name" style="width: 100%">
  7. <el-input v-model="task_form.name" autocomplete="off" placeholder="请输入任务名称" />
  8. </el-form-item>
  9. <div style="display:flex;align-items: center;justify-content: space-between;">
  10. <el-form-item label="直接归属" prop="source">
  11. <el-radio-group v-model="task_form.source" @change="get_source(task_form.source)">
  12. <el-radio :label="1">不归属</el-radio>
  13. <el-radio :label="2">需求</el-radio>
  14. <el-radio :label="3">项目</el-radio>
  15. </el-radio-group>
  16. </el-form-item>
  17. <el-form-item v-if="ascription_demand" label="归属需求" prop="requireId">
  18. <el-select v-model="task_form.requireId" filterable clearable placeholder="请选择" style="width:20vw">
  19. <el-option v-for="item in demandList" :key="item.id" :label="item.name" :value="item.id" @click.native="tit_Name === '编辑任务' ? taskUpdateRequire(item.id, requirementIdList.taskId) : getRequireItem(item), $set(task_form, 'taskIdFromDpm', '')" />
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item v-if="ascription_project" label="归属项目" prop="projectId">
  23. <el-select v-model="task_form.projectId" filterable clearable placeholder="请选择" style="width:20vw">
  24. <el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id" />
  25. </el-select>
  26. </el-form-item>
  27. </div>
  28. <div style="display:flex;align-items: center;justify-content: space-between;">
  29. <div>
  30. <el-form-item label="优先级" prop="priority">
  31. <el-select v-model="task_form.priority" filterable placeholder="请选择" style="width:20vw">
  32. <el-option v-for="item in arr_priority" :key="item.value" :label="item.name" :value="item.value" />
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item label="业务线" prop="bizId">
  36. <el-select v-model="task_form.bizId" :disabled="tit_Name === '编辑任务' || task_form.source !== 2" placeholder="请选择" style="width:100%" filterable @change="task_change_bizId(task_form.bizId)">
  37. <el-option-group v-for="group in bizList" :key="group.code" :label="group.name">
  38. <el-option v-for="item in group.options" :key="item.code" :label="item.name" :value="item.code" />
  39. </el-option-group>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="开发负责人" class="form-item-normal-lable">
  43. <el-select v-model="task_form.rdOwner" filterable clearable remote placeholder="请输入姓名或邮箱前缀" :remote-method="remoteMethod" :loading="loading" style="width: 100%">
  44. <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="test2(item, 0)">
  45. <div style="display: flex;justify-content: start;">
  46. <div style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden">{{ item.deptName }}</div>
  47. <div style="min-width:80px">{{ item.name }}</div>
  48. <div style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden">{{ item.idap }}</div>
  49. </div>
  50. </el-option>
  51. </el-select>
  52. </el-form-item>
  53. </div>
  54. <div>
  55. <el-form-item label="是否免测" prop="notest">
  56. <el-radio-group v-model="task_form.notest">
  57. <el-radio :label="0">否</el-radio>
  58. <el-radio :label="1">是</el-radio>
  59. </el-radio-group>
  60. </el-form-item>
  61. <el-form-item label="模块" prop="moduleIds" class="form-item-normal-lable">
  62. <el-cascader v-model="task_form.moduleIds" clearable collapse-tags :props="props" :options="business_platform_Modular" placeholder="请选择" style="width: 20vw" />
  63. </el-form-item>
  64. <el-form-item label="测试负责人" class="form-item-normal-lable">
  65. <el-select v-model="task_form.qaOwner" filterable clearable remote placeholder="请输入姓名或邮箱前缀" :remote-method="remoteMethod1" :loading="loading" style="width: 20vw">
  66. <el-option v-for="item in options1" :key="item.idap" :label="item.name" :value="test2(item, 0)">
  67. <div style="display: flex;justify-content: start;">
  68. <div style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden">{{ item.deptName }}</div>
  69. <div style="min-width:80px">{{ item.name }}</div>
  70. <div style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden">{{ item.idap }}</div>
  71. </div>
  72. </el-option>
  73. </el-select>
  74. </el-form-item>
  75. </div>
  76. </div>
  77. <el-form-item label="技术文档链接" class="form-item-normal-lable">
  78. <el-input v-model="task_form.devUrl" placeholder="请粘贴链接" />
  79. </el-form-item>
  80. <div style="display:flex;align-items: center;justify-content: space-between;">
  81. <el-form-item label="是否跟版" prop="followVersion">
  82. <el-radio-group v-model="task_form.followVersion" @change="get_followVersion(task_form.followVersion)">
  83. <el-radio :label="2">否</el-radio>
  84. <el-radio :label="1">是</el-radio>
  85. </el-radio-group>
  86. </el-form-item>
  87. <el-form-item v-if="show_Client" label="涉及的客户端" prop="involveApp">
  88. <el-select v-model="task_form.involveApp" filterable remote :loading="loading" clearable placeholder="请选择" style="width: 20vw">
  89. <el-option v-for="item in appClient" :key="item.code" :label="item.msg" :value="item.code" />
  90. </el-select>
  91. </el-form-item>
  92. </div>
  93. <div v-if="ascription_demand && show_schedule" style="color: #E81C1C; font-size: 12px; margin: 0 20px 10px;">
  94. <i class="el-icon-warning-outline" /> {{ tit_Name === '编辑任务' ? '您选择的任务归属需求来自望岳,该任务未设置关联的望岳任务,请进行设置,以便于后续排期的同步!' : '您选择的任务归属需求来自望岳,请设置该任务关联的望岳任务,以便于后期排期的同步!' }}
  95. </div>
  96. <el-form-item v-if="ascription_demand && show_schedule" clearable label="关联望岳的任务" prop="taskIdFromDpm">
  97. <el-select v-model="task_form.taskIdFromDpm" filterable placeholder="请选择" style="width: 100%">
  98. <el-option v-for="item in arr_schedule" :key="item.id" :label="item.name" :value="item.id" />
  99. </el-select>
  100. </el-form-item>
  101. </el-form>
  102. <div slot="footer">
  103. <el-button @click="dialogFormVisible = false">取 消</el-button>
  104. <el-button v-if="tit_Name === '新建任务'" type="primary" @click="tit_Name === '新建任务'?throttleTask(task_form):uptate_task(task_form)">创 建</el-button>
  105. <el-button v-else type="primary" @click="tit_Name === '新建任务'?throttleTask(task_form):uptate_task(task_form)">保 存</el-button>
  106. </div>
  107. </el-dialog>
  108. </div>
  109. </template>
  110. <script>
  111. import { mapGetters } from 'vuex'
  112. import { analysisBizId_id, EncryptId } from '@/utils/crypto-js.js'
  113. const _ = require('lodash')
  114. import { taskCreate, memberQueryMemberInfoByIDAPorName, configShowTaskEnum, configShowRequirementVersionEnum, taskGet, taskUpdate, projectListProject, getRelDpmTask } from '@/api/taskIndex' // ajax
  115. import { projectList, settingGetBizList, settingGetMyAndOtherBizList } from '@/api/projectIndex'
  116. import { settingQueryBizModuleList } from '@/api/defectManage'
  117. export default {
  118. props: {
  119. noJump: {
  120. type: Boolean,
  121. default: false,
  122. required: false
  123. }
  124. },
  125. data() {
  126. return {
  127. arr_priority: [{ value: 0, name: 'P0' }, { value: 1, name: 'P1' }, { value: 2, name: 'P2' }, { value: 3, name: 'P3' }],
  128. dialogFormVisible: false,
  129. task_form: {},
  130. props: { multiple: true },
  131. ascription_project: false, // 归属项目(隐藏)
  132. ascription_demand: false, // 归属需求(隐藏)
  133. test: {},
  134. bizList: [],
  135. loading: false,
  136. tit: '', // 跳转
  137. tit_Name: '', // 新建(编辑)
  138. projectId: -1, // 项目id
  139. requireId: -1, // 需求id
  140. options: [], // 员工信息
  141. options1: [],
  142. noTest: [], // 是否免测
  143. all_bizId: [], // 业务线
  144. appClient: [], // 涉及业务线
  145. arr_Modular: [], // 模块数据‘
  146. business_platform_Modular: [], // 模块
  147. show_Client: false, // 涉及的客户端(显示)
  148. projectList: [], // 归属项目数据
  149. demandList: [], // 需求list
  150. arr_schedule: [], // 关联望岳的任务list
  151. show_schedule: false,
  152. userInformation: localStorage.getItem('username'),
  153. userNames: localStorage.getItem('realname'),
  154. requirementIdList: {},
  155. task_rulesForm: {
  156. name: [{ required: true, message: '请输入任务名称', trigger: 'change' }],
  157. priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
  158. bizId: [{ required: true, message: '请选择业务线', trigger: 'change' }],
  159. source: [{ required: true, message: '请输入直接归属', trigger: 'change' }],
  160. requireId: [{ required: true, message: '请选择归属需求', trigger: 'change' }],
  161. projectId: [{ required: true, message: '请选择归属项目', trigger: 'change' }],
  162. followVersion: [{ required: true, message: '请选择是否跟版', trigger: 'blur' }],
  163. notest: [{ required: true, message: '请选择是否免测', trigger: 'blur' }],
  164. cliType: [{ required: true, message: '请选择业务/平台/模块', trigger: 'blur' }],
  165. involveApp: [{ required: true, message: '请选择涉及的客户端', trigger: 'blur' }],
  166. taskIdFromDpm: [{ required: true, message: '请选择关联望岳的任务', trigger: 'change' }]
  167. }
  168. }
  169. },
  170. computed: {
  171. ...mapGetters(['bizId'])
  172. },
  173. created() {
  174. this.analysisBizId_id()
  175. this.settingGetBizList()
  176. },
  177. mounted() {
  178. this.get_taskSelect()
  179. this.bugDataGet(this.bizId)
  180. },
  181. methods: {
  182. analysisBizId_id() { // 解析路由中的bizId_id
  183. if (!this.$route.query.bizId_id) return
  184. const bizId_id = analysisBizId_id(this.$route.query.bizId_id)
  185. this.projectId = bizId_id[1]
  186. this.requireId = bizId_id[1]
  187. },
  188. async init(e, id, data = null) {
  189. this.tit_Name = '新建任务'
  190. switch (e) {
  191. case 1: // 新建任务(任务主页)
  192. this.dialogFormVisible = true
  193. this.ascription_demand = false
  194. this.ascription_project = false
  195. this.task_form = { 'notest': 0, 'followVersion': 2, 'source': 1, 'bizId': this.bizId }
  196. this.requirementIdList = { 'name': '主页', 'data': null }
  197. this.show_Client = false
  198. this.$nextTick(() => {
  199. this.$refs['task_form'].clearValidate()
  200. })
  201. this.task_change_bizId(this.bizId)
  202. break
  203. case 2: // 新建任务(项目详情)
  204. this.tit = '新建任务'
  205. projectList({ id: this.projectId, curIndex: 1, pageSize: 15 }).then(res => {
  206. this.dialogFormVisible = true
  207. this.task_form = { 'followVersion': 2, 'notest': 0, 'source': 3, 'projectId': res.data[0].id, 'requireId': res.data[0].id, 'bizId': this.bizId }
  208. this.requirementIdList = { 'name': '项目', 'data': res.data[0].id }
  209. this.ascription_demand = false
  210. this.ascription_project = true
  211. this.show_Client = false
  212. this.task_change_bizId(this.bizId)
  213. })
  214. break
  215. case 3: // 编辑任务(任务详情)
  216. if (id[0].type === 'copy') {
  217. this.tit_Name = '新建任务'
  218. } else {
  219. this.tit_Name = '编辑任务'
  220. }
  221. taskGet(id[1]).then(res => {
  222. this.requirementIdList = { 'name': '需求', 'data': res.data.requireId, taskId: res.data.id }
  223. this.dialogFormVisible = true
  224. var that = this
  225. setTimeout(function() {
  226. that.task_form = {}
  227. that.task_form = res.data
  228. that.task_form.source === 3 ? that.ascription_project = true : that.ascription_project = false
  229. that.task_form.source === 2 ? that.ascription_demand = true : that.ascription_demand = false
  230. that.task_form.source === 1 ? that.ascription_demand = false : ''
  231. that.task_form.source === 1 ? that.ascription_project = false : ''
  232. that.task_form.followVersion === 2 ? that.show_Client = false : that.show_Client = true
  233. that.task_form.followVersion === 1 ? that.show_Client = true : that.show_Client = false
  234. that.task_form.cliType = [res.data.bizId, res.data.type, res.data.clientType]
  235. that.task_form.involveApp = Number(res.data.involveApp)
  236. if (id[0].type === 'copy') { that.$set(that.task_form, 'name', `复制从 ${id[0].name} `) }
  237. const arr_object = []
  238. arr_object.push(res.data.rdObject)
  239. arr_object.push(res.data.qaObject)
  240. var hash = {}
  241. that.options = arr_object.reduce(function(item, next) {
  242. hash[next.idap] ? '' : hash[next.idap] = true && item.push(next)
  243. return item
  244. }, [])
  245. that.options1 = arr_object.reduce(function(item, next) {
  246. hash[next.idap] ? '' : hash[next.idap] = true && item.push(next)
  247. return item
  248. }, [])
  249. }, 100)
  250. this.task_change_bizId(res.data.bizId, res.data.id)
  251. this.taskUpdateRequire(res.data.requireId, res.data.id)
  252. })
  253. break
  254. case 4: // 新建任务(需求详情)
  255. this.tit = '新建任务'
  256. var ss = {}
  257. configShowRequirementVersionEnum({ bizId: this.bizId }).then(res => {
  258. res.data.map(item => {
  259. item.id === this.requireId ? ss = item : ''
  260. })
  261. this.dialogFormVisible = true
  262. this.ascription_demand = true
  263. this.ascription_project = false
  264. this.task_form = { 'followVersion': 2, 'notest': 0, 'source': 2, 'projectId': '', 'requireId': ss.id, 'bizId': this.bizId }
  265. this.show_Client = false
  266. if (data) {
  267. this.task_form = { ...this.task_form, 'requireId': data.requirementId, 'name': data.name, 'priority': data.priority }
  268. this.requirementIdList = { 'name': '需求', 'data': data.requirementId }
  269. }
  270. this.task_change_bizId(this.bizId)
  271. this.taskUpdateRequire(ss.id)
  272. })
  273. break
  274. }
  275. projectListProject({ bizId: this.bizId }).then(res => { // 获取项目(查询)
  276. this.projectList = res.data.filter(item => item.id !== -1)
  277. })
  278. },
  279. test2(item, e) { // 获取团队人员信息
  280. if (typeof this.test[item.idap] === 'undefined') {
  281. item.role = e
  282. this.test[item.idap] = item
  283. }
  284. return item.idap
  285. },
  286. throttleTask: _.throttle(function() {
  287. this.create_task(...arguments)
  288. }, 5000, {
  289. leading: true,
  290. trailing: false
  291. }),
  292. async settingGetBizList() { // 获取业务线列表
  293. const res = await settingGetMyAndOtherBizList()
  294. if (res.code === 200) {
  295. this.bizList = [{
  296. name: '我的业务线',
  297. options: res.data[0] || []
  298. }, {
  299. name: '其他业务线',
  300. options: res.data[1] ? res.data[1].filter(item => item.isSecret !== 1) : []
  301. }]
  302. }
  303. },
  304. async task_change_bizId(biz, id) { // 获取业务线需求
  305. const data = { bizId: biz }
  306. id ? data.taskId = id : ''
  307. const res = await configShowRequirementVersionEnum(data) // 获取需求(查询)
  308. if (res.code === 200) {
  309. this.demandList = res.data.filter(item => item.id !== -1)
  310. }
  311. this.bugDataGet(biz)
  312. },
  313. create_task(e) { // 创建任务(保存)
  314. this.$refs['task_form'].validate((valid) => {
  315. if (valid) {
  316. var taskInfoDO = e
  317. taskInfoDO.followVersion = e.followVersion
  318. taskInfoDO.notest = e.notest
  319. taskInfoDO.source = e.source
  320. switch (taskInfoDO.source) {
  321. case 1: // 无归属
  322. taskInfoDO.requireId = '-1'
  323. taskInfoDO.projectId = '-1'
  324. break
  325. case 2: // 需求
  326. taskInfoDO.requireId = e.requireId
  327. taskInfoDO.projectId = ''
  328. break
  329. case 3: // 项目
  330. taskInfoDO.requireId = '-1'
  331. taskInfoDO.projectId = e.projectId
  332. break
  333. }
  334. if (e.cliType) {
  335. e.cliType !== '' ? taskInfoDO.bizId = e.cliType[0] : taskInfoDO.bizId = null
  336. e.cliType !== '' ? taskInfoDO.type = e.cliType[1] : taskInfoDO.type = null
  337. e.cliType !== '' ? taskInfoDO.clientType = e.cliType[2] : taskInfoDO.clientType = null
  338. }
  339. var user = { name: this.userNames, ename: this.userInformation, id: '' }
  340. taskCreate({ taskInfoDO, user }).then(res => {
  341. this.dialogFormVisible = false
  342. this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
  343. if (!this.noJump) {
  344. const bizId_id = EncryptId(`${this.bizId}_${res.data.id}`)
  345. this.$router.push({ name: '任务详情', query: { bizId_id: bizId_id }})
  346. } else {
  347. this.$emit('change')
  348. }
  349. })
  350. }
  351. })
  352. },
  353. uptate_task(e) { // 编辑任务(编辑)
  354. this.$refs['task_form'].validate((valid) => {
  355. if (valid) {
  356. var taskInfoDO = e
  357. taskInfoDO.followVersion = e.followVersion
  358. taskInfoDO.source = e.source
  359. taskInfoDO.notest = e.notest
  360. taskInfoDO.bizId = e.cliType[0]
  361. taskInfoDO.type = e.cliType[1]
  362. taskInfoDO.clientType = e.cliType[2]
  363. var user = { name: this.userNames, ename: this.userInformation, id: '' }
  364. taskUpdate({ taskInfoDO, user }).then(res => {
  365. if (res.code === 200) {
  366. this.dialogFormVisible = false
  367. this.$emit('updateIteration')
  368. this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
  369. location.reload()
  370. }
  371. })
  372. }
  373. })
  374. },
  375. remoteMethod(query) { // 人员查询
  376. if (query !== '') {
  377. this.loading = true
  378. setTimeout(() => {
  379. this.loading = false
  380. memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
  381. const obj = {}
  382. this.options = res.data.reduce((cur, next) => {
  383. obj[next.idap] ? '' : obj[next.idap] = true && cur.push(next)
  384. return cur
  385. }, [])
  386. })
  387. }, 200)
  388. } else {
  389. this.options = []
  390. }
  391. },
  392. remoteMethod1(query) { // 人员查询
  393. if (query !== '') {
  394. this.loading = true
  395. setTimeout(() => {
  396. this.loading = false
  397. memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
  398. const obj = {}
  399. this.options1 = res.data.reduce((cur, next) => {
  400. obj[next.idap] ? '' : obj[next.idap] = true && cur.push(next)
  401. return cur
  402. }, [])
  403. })
  404. }, 200)
  405. } else {
  406. this.options1 = []
  407. }
  408. },
  409. get_source(e) {
  410. switch (e) {
  411. case 1:
  412. this.ascription_demand = false
  413. this.ascription_project = false
  414. this.$set(this.task_form, 'bizId', this.bizId)
  415. this.$set(this.task_form, 'requireId', '')
  416. this.$set(this.task_form, 'projectId', '')
  417. this.$set(this.task_form, 'taskIdFromDpm', '')
  418. this.bugDataGet(this.bizId)
  419. break
  420. case 2:
  421. this.show_schedule = false
  422. this.ascription_demand = true
  423. this.ascription_project = false
  424. this.requirementIdList.name === '需求' ? this.$set(this.task_form, 'requireId', this.requirementIdList.data) : this.$set(this.task_form, 'requireId', '')
  425. this.$set(this.task_form, 'projectId', '')
  426. this.tit_Name === '编辑任务' ? this.taskUpdateRequire(this.requirementIdList.data, this.requirementIdList.taskId) : this.getRequireItem({ id: this.requirementIdList.data })
  427. break
  428. case 3:
  429. this.ascription_demand = false
  430. this.ascription_project = true
  431. this.$set(this.task_form, 'bizId', this.bizId)
  432. this.requirementIdList.name === '项目' ? this.$set(this.task_form, 'projectId', this.requirementIdList.data) : this.$set(this.task_form, 'projectId', '')
  433. this.$set(this.task_form, 'requireId', '')
  434. this.$set(this.task_form, 'taskIdFromDpm', '')
  435. this.bugDataGet(this.bizId)
  436. break
  437. }
  438. },
  439. get_taskSelect() { // 下拉菜单数据
  440. configShowTaskEnum().then(res => {
  441. this.noTest = res.data.noTest // 是否免测
  442. this.taskSource = res.data.taskSource // 归属需求
  443. this.appClient = res.data.appClient // 涉及客户端
  444. })
  445. settingGetBizList({}).then(res => {
  446. this.all_bizId = res.data
  447. })
  448. },
  449. get_followVersion(e) { // 涉及的客户端(显示/隐藏)
  450. this.$set(this.task_form, 'involveApp', '')
  451. e === 1 ? this.show_Client = true : ''
  452. e === 2 ? this.show_Client = false : ''
  453. },
  454. async taskUpdateRequire(requireId, id) {
  455. const res = await getRelDpmTask({ requireId: requireId, taskId: id })
  456. if (res.code === 200) {
  457. const show = res.data.relDpm
  458. show ? this.show_schedule = show : this.show_schedule = show
  459. this.arr_schedule = res.data.tasks
  460. }
  461. },
  462. async getRequireItem(val) {
  463. if (val.id) {
  464. const res = await getRelDpmTask({ requireId: val.id })
  465. if (res.code === 200) {
  466. this.show_schedule = res.data.relDpm
  467. this.arr_schedule = res.data.tasks
  468. }
  469. }
  470. },
  471. bugDataGet(bizId) { // 所属模块
  472. settingQueryBizModuleList(bizId).then(res => {
  473. this.business_platform_Modular = res.data.map(item => ({
  474. ...item,
  475. value: item.id,
  476. label: item.moduleName,
  477. children: item.childModules.length === 0 ? null : item.childModules.map(item1 => ({
  478. ...item1,
  479. value: item1.id,
  480. label: item1.moduleName,
  481. children: item1.childModules.length === 0 ? null : item1.childModules.map(item2 => ({
  482. ...item2,
  483. value: item2.id,
  484. label: item2.moduleName
  485. }))
  486. }))
  487. }))
  488. })
  489. }
  490. }
  491. }
  492. </script>
  493. <style lang="scss">
  494. .copy-task {
  495. .el-select {
  496. width: 20vw;
  497. }
  498. .el-dialog__body {
  499. padding: 20px 40px;
  500. }
  501. label {
  502. font-weight: 400;
  503. }
  504. .form-item-normal-lable {
  505. .el-form-item__label:before {
  506. content: "";
  507. color: #333333;
  508. margin-right: 12px;
  509. font-weight: 400;
  510. }
  511. }
  512. /deep/ .el-dialog__title {
  513. line-height: 24px;
  514. font-size: 18px;
  515. color: #303133;
  516. padding-left: 10px;
  517. }
  518. .blueStripe {
  519. width:4px;
  520. height:17px;
  521. background:#409EFF;
  522. border-radius:1px;
  523. position: absolute;
  524. top: 23px;
  525. left: 20px;
  526. }
  527. }
  528. </style>