Commit 81746952 by 杨子

优化

parent 472d2f46
......@@ -10,7 +10,8 @@
:placeholder="['开始时间', '结束时间']" allowClear @change="onRangeChange" />
</div>
<div style="padding: 0 24px;">
<el-slider v-model="sliderValue" :min="minSliderValue" :max="maxSliderValue" :format-tooltip="formatTooltip" range @change="onSliderChange"></el-slider>
<el-slider v-model="sliderValue" :min="minSliderValue" :max="maxSliderValue" :format-tooltip="formatTooltip" range
@change="onSliderChange"></el-slider>
</div>
<g-gantt-chart :chart-start="chartStart" :chart-end="chartEnd" precision="minute" :minuteInterval="interval"
......@@ -35,7 +36,7 @@ import { ElSelect, ElMessage, ElSelectV2, ElButton, ElSlider } from "element-plu
import httpRequest from '@/utils/httpRequest.js'
import dayjs, { Dayjs } from 'dayjs';
import { computed } from "@vue/reactivity";
const sliderValue = ref<[number, number]>([0,100])
const sliderValue = ref<[number, number]>([0, 100])
const minSliderValue = ref()
const maxSliderValue = ref()
......@@ -46,7 +47,7 @@ const onSliderChange = () => {
}
const formatTooltip=(value:number)=>{
const formatTooltip = (value: number) => {
return dayjs(value).format('YYYY-MM-DD HH:mm')
}
const optionList = [
......@@ -84,10 +85,10 @@ const onRangeChange = (value: [Dayjs, Dayjs], dateString: [string, string]) => {
}
};
const getRandomColor = function () {
return '#' + (function (color) {
return (color += '0123456789abcdef'[Math.floor(Math.random() * 16)])
&& (color.length == 6) ? color : arguments.callee(color);
})('');
const r = Math.floor(Math.random() * 255);
const g = Math.floor(Math.random() * 255);
const b = Math.floor(Math.random() * 255);
return 'rgba(' + r + ',' + g + ',' + b + ', 1)';
}
const baseUrl = '/task/helicopterTask/getGanttInfo?id=' + sessionStorage.getItem('taskResultId') + "&token=" + sessionStorage.getItem('token')
......@@ -158,8 +159,8 @@ const formatter = (processesList: any[]) => {
const filterValues = processesList.filter((v, i) => i != index)
for (const value of filterValues) {
if ( current.begin >= value.begin && current.begin < value.end) {
if(!value.ganttBarConfig.isCover){
if (current.begin >= value.begin && current.begin < value.end) {
if (!value.ganttBarConfig.isCover) {
top = 0
}
top++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment