|
@@ -7,7 +7,7 @@
|
|
|
<el-checkbox v-for="item in memberList" :key="item.idap" :label="item.idap">
|
|
|
<div class="check-point">
|
|
|
{{ item.name }}
|
|
|
- <div v-if="workbench === '团队'" class="point" :style="{'background-color': mapMemberColor.get(item.idap).bgColor}" />
|
|
|
+ <div v-if="workbench === '团队'" class="point" :style="{'background-color': mapMemberColor[item.idap].bgColor}" />
|
|
|
</div>
|
|
|
</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
@@ -29,6 +29,7 @@
|
|
|
<el-checkbox v-for="item in taskScheduleEvent" :key="item.code" :label="item.code">
|
|
|
<div class="check-point">
|
|
|
{{ item.msg }}
|
|
|
+ <div class="point" :style="{'background-color': mapTypeColor[item.code].bgColor}" />
|
|
|
</div>
|
|
|
</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
@@ -48,6 +49,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { queryTeamMember, showWorkbenchEnum } from '@/api/workSchedule'
|
|
|
+import { colorList } from '../mixins/utils'
|
|
|
export default {
|
|
|
props: {
|
|
|
value: {
|
|
@@ -61,8 +63,13 @@ export default {
|
|
|
required: false
|
|
|
},
|
|
|
memberColor: {
|
|
|
- type: Map,
|
|
|
- default: () => new Map(),
|
|
|
+ type: Object,
|
|
|
+ default: () => {},
|
|
|
+ required: false
|
|
|
+ },
|
|
|
+ typeColor: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {},
|
|
|
required: false
|
|
|
},
|
|
|
type: {
|
|
@@ -85,13 +92,14 @@ export default {
|
|
|
isIndeterminate: false,
|
|
|
isIndeterminate_1: false,
|
|
|
isIndeterminate_2: false,
|
|
|
- colorList: [
|
|
|
- 'rgba(64,127,232,1)', 'rgba(11,160,188,1)', 'rgba(28,188,126,1)', 'rgba(235,172,0,1)', 'rgba(132,100,247,1)',
|
|
|
- 'rgba(73,92,197,1)', 'rgba(193,67,96,1)', 'rgba(211,87,35,1)', 'rgba(40,28,149,1)', 'rgba(85,138,43,1)',
|
|
|
- 'rgba(67,17,59,1)', 'rgba(221,57,222,1)', 'rgba(149,114,109,1)', 'rgba(202,50,31,1)', 'rgba(226,119,141,1)',
|
|
|
- 'rgba(240,164,126,1)', 'rgba(59,64,72,1)', 'rgba(115,159,158,1)', 'rgba(122,209,67,1)', 'rgba(152,40,49,1)'
|
|
|
- ],
|
|
|
+ // colorList: [
|
|
|
+ // 'rgba(64,127,232,1)', 'rgba(11,160,188,1)', 'rgba(28,188,126,1)', 'rgba(235,172,0,1)', 'rgba(132,100,247,1)',
|
|
|
+ // 'rgba(73,92,197,1)', 'rgba(193,67,96,1)', 'rgba(211,87,35,1)', 'rgba(40,28,149,1)', 'rgba(85,138,43,1)',
|
|
|
+ // 'rgba(67,17,59,1)', 'rgba(221,57,222,1)', 'rgba(149,114,109,1)', 'rgba(202,50,31,1)', 'rgba(226,119,141,1)',
|
|
|
+ // 'rgba(240,164,126,1)', 'rgba(59,64,72,1)', 'rgba(115,159,158,1)', 'rgba(122,209,67,1)', 'rgba(152,40,49,1)'
|
|
|
+ // ],
|
|
|
mapMemberColor: this.memberColor, // 人员对应颜色表
|
|
|
+ mapTypeColor: this.typeColor,
|
|
|
checkList: [0, 1], // 类型默认全部选择
|
|
|
ScheduleAndSchedule: [0, 1],
|
|
|
selfScheduleType: [], // 日程类型
|
|
@@ -130,13 +138,14 @@ export default {
|
|
|
this.memberList = this.handleMember(res.data)
|
|
|
this.filtrate.checkedMembers = this.memberList.map(item => item.idap)
|
|
|
this.checkAllMember = true
|
|
|
- this.colorHandler(this.memberList)
|
|
|
+ this.colorHandler(this.memberList, 'mapMemberColor', 'idap')
|
|
|
}
|
|
|
}
|
|
|
const res_1 = await showWorkbenchEnum()
|
|
|
if (res_1.code === 200) {
|
|
|
this.selfScheduleType = res_1.data.selfScheduleType // 日程类型
|
|
|
this.taskScheduleEvent = res_1.data.taskScheduleEvent // 排期类型
|
|
|
+ this.colorHandler(this.taskScheduleEvent, 'mapTypeColor', 'code')
|
|
|
this.selfScheduleType.unshift({ code: -1, msg: '未分类' })
|
|
|
this.schedule = this.selfScheduleType.map(item => item.code)
|
|
|
this.scheduling = this.taskScheduleEvent.map(item => item.code)
|
|
@@ -151,15 +160,17 @@ export default {
|
|
|
this.$emit('change')
|
|
|
this.$emit('update:value', this.filtrate)
|
|
|
this.$emit('update:memberColor', this.mapMemberColor)
|
|
|
+ this.$emit('update:typeColor', this.mapTypeColor)
|
|
|
})
|
|
|
},
|
|
|
- colorHandler(arr) { // 成员对应颜色处理
|
|
|
- this.mapMemberColor.clear()
|
|
|
+ colorHandler(arr, type, key) { // 成员对应颜色处理
|
|
|
+ // this.mapMemberColor.clear()
|
|
|
+ this[type] = {}
|
|
|
arr.map((item, index) => {
|
|
|
- this.mapMemberColor.set(item.idap, {
|
|
|
+ this[type][item[key]] = {
|
|
|
color: '#FFFFFF',
|
|
|
- bgColor: this.colorList[index % 20]
|
|
|
- })
|
|
|
+ bgColor: colorList[index]
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
handleMember(arr) { // 人员和颜色的映射处理
|