0324
This commit is contained in:
parent
7426a33282
commit
9761ce29ab
@ -377,19 +377,79 @@ const baseUrl = window.settings.apis + '/gantt'
|
|||||||
// data,
|
// data,
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
const SimpList = {
|
||||||
|
|
||||||
|
data: {
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
id: 31834,
|
||||||
|
name: "事件1",
|
||||||
|
color: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
export function getSimpList() {
|
export function getSimpList() {
|
||||||
return request({
|
return new Promise((resolve, reject) => {
|
||||||
url: `${baseUrl}/gantt/target-info/simp-list`,
|
setTimeout(() => {
|
||||||
method: 'get',
|
resolve(SimpList)
|
||||||
|
}, 200)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSimpTreeList(data) {
|
// export function getSimpList() {
|
||||||
return request({
|
// return request({
|
||||||
url: `${baseUrl}/gantt/target-activity/tree-list`,
|
// url: `${baseUrl}/gantt/target-info/simp-list`,
|
||||||
method: 'post',
|
// method: 'get',
|
||||||
data,
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
const SimpTreeList =
|
||||||
|
{
|
||||||
|
data: {
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
childList: [
|
||||||
|
{
|
||||||
|
childList: [
|
||||||
|
{
|
||||||
|
endTime: "2025-02-28T09:02:19.195Z",
|
||||||
|
fileUrl: "https://www.iocoder.cn",
|
||||||
|
id: 31834,
|
||||||
|
name: "事件1",
|
||||||
|
startTime: "2025-02-28T09:02:19.195Z",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
id: 0,
|
||||||
|
name: "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
describe: "string",
|
||||||
|
endTime: "2025-02-28T09:02:19.195Z",
|
||||||
|
fileUrl: "https://www.iocoder.cn",
|
||||||
|
id: 2734,
|
||||||
|
name: "事件2",
|
||||||
|
startTime: "2025-02-28T09:02:19.195Z"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// export function getSimpTreeList(data) {
|
||||||
|
// return request({
|
||||||
|
// url: `${baseUrl}/gantt/target-activity/tree-list`,
|
||||||
|
// method: 'post',
|
||||||
|
// data,
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
export function getSimpTreeList() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve(SimpTreeList)
|
||||||
|
}, 200)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,11 +90,12 @@ const oneClassData = ref(null)
|
|||||||
async function searchTreeList() {
|
async function searchTreeList() {
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
|
|
||||||
const res = await getSimpTreeList({
|
// const res = await getSimpTreeList({
|
||||||
targetId: targetId.value,
|
// targetId: targetId.value,
|
||||||
startTime: range.value ? range.value[0] : null,
|
// startTime: range.value ? range.value[0] : null,
|
||||||
endTime: range.value ? range.value[1] : null,
|
// endTime: range.value ? range.value[1] : null,
|
||||||
})
|
// })
|
||||||
|
const res = await getSimpTreeList()
|
||||||
tableData.value = res.data.list
|
tableData.value = res.data.list
|
||||||
// console.log('searchTreeList', tableData)
|
// console.log('searchTreeList', tableData)
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ const useGantt = ({ router, route }: GanttParams) => {
|
|||||||
const records = ref([])
|
const records = ref([])
|
||||||
|
|
||||||
const timeRange = ref([])
|
const timeRange = ref([])
|
||||||
|
const plans = ref()
|
||||||
// onMounted(() => {
|
// onMounted(() => {
|
||||||
// getGanttData()
|
// getGanttData()
|
||||||
// })
|
// })
|
||||||
@ -82,10 +83,12 @@ const useGantt = ({ router, route }: GanttParams) => {
|
|||||||
const date = new Date(mainEvent.startTime)
|
const date = new Date(mainEvent.startTime)
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
const month = date.getMonth()
|
const month = date.getMonth()
|
||||||
const startOfMonth = new Date(year, month, 1)
|
//const startOfMonth = new Date(year, month, 1)
|
||||||
|
const startOfMonth = new Date(year, month, mainEvent.startTime)
|
||||||
startOfMonth.setHours(0, 0, 0, 0)
|
startOfMonth.setHours(0, 0, 0, 0)
|
||||||
|
|
||||||
const lastDayOfMonth = new Date(year, month + 1, 0)
|
// const lastDayOfMonth = new Date(year, month + 1, 0)
|
||||||
|
const lastDayOfMonth = new Date(year, month ,mainEvent.startTime)
|
||||||
const endOfMonth = new Date(
|
const endOfMonth = new Date(
|
||||||
year,
|
year,
|
||||||
month,
|
month,
|
||||||
@ -287,13 +290,13 @@ const useGantt = ({ router, route }: GanttParams) => {
|
|||||||
width: '120',
|
width: '120',
|
||||||
mergeCell: true,
|
mergeCell: true,
|
||||||
})
|
})
|
||||||
columns.unshift({
|
// columns.unshift({
|
||||||
field: 'isChecked',
|
// field: 'isChecked',
|
||||||
title: '',
|
// title: '',
|
||||||
width: '60',
|
// width: '60',
|
||||||
headerType: 'checkbox',
|
// headerType: 'checkbox',
|
||||||
cellType: 'checkbox',
|
// cellType: 'checkbox',
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
return columns
|
return columns
|
||||||
}
|
}
|
||||||
@ -534,30 +537,34 @@ const useGantt = ({ router, route }: GanttParams) => {
|
|||||||
opacity: taskRecord.status === 2 ? 0.3 : 1,
|
opacity: taskRecord.status === 2 ? 0.3 : 1,
|
||||||
})
|
})
|
||||||
container.add(end)
|
container.add(end)
|
||||||
const rect = new Rect({
|
// 事件条
|
||||||
width: width,
|
if (plans.value == 'hour') {
|
||||||
height: 7,
|
const rect = new Rect({
|
||||||
fill: {
|
width: width,
|
||||||
gradient: 'linear',
|
height: 7,
|
||||||
x0: 0,
|
fill: {
|
||||||
y0: 0,
|
gradient: 'linear',
|
||||||
x1: 1,
|
x0: 0,
|
||||||
y1: 0,
|
y0: 0,
|
||||||
stops: [
|
x1: 1,
|
||||||
{
|
y1: 0,
|
||||||
offset: 0,
|
stops: [
|
||||||
color: textColor,
|
{
|
||||||
},
|
offset: 0,
|
||||||
{
|
color: textColor,
|
||||||
offset: 1,
|
},
|
||||||
color: textColorWithOp,
|
{
|
||||||
},
|
offset: 1,
|
||||||
],
|
// color: textColorWithOp,
|
||||||
},
|
color: textColor,
|
||||||
boundsPadding: [10, 0, 0, 0],
|
},
|
||||||
opacity: taskRecord.status === 2 ? 0.3 : 1,
|
],
|
||||||
})
|
},
|
||||||
container.add(rect)
|
boundsPadding: [10, 0, 0, 0],
|
||||||
|
opacity: taskRecord.status === 2 ? 0.3 : 1,
|
||||||
|
})
|
||||||
|
container.add(rect)
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
rootContainer: container,
|
rootContainer: container,
|
||||||
@ -603,6 +610,7 @@ const useGantt = ({ router, route }: GanttParams) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function changeTimeScales(scale: TYPES.ITimelineScale['unit']) {
|
function changeTimeScales(scale: TYPES.ITimelineScale['unit']) {
|
||||||
|
plans.value = scale
|
||||||
const scales = getTimeScales(scale)
|
const scales = getTimeScales(scale)
|
||||||
ganttInstance && ganttInstance.updateScales(scales)
|
ganttInstance && ganttInstance.updateScales(scales)
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,8 @@ import { onBeforeMount } from 'vue'
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const range = ref([new Date('2000-01-01 00:00:00').getTime(), Date.now()])
|
const range = ref([new Date('2000-01-01 00:00:00').getTime(), Date.now()])
|
||||||
const value = ref('year')
|
//const value = ref('year')
|
||||||
|
const value = ref('day')
|
||||||
const types = ref([])
|
const types = ref([])
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -53,6 +54,10 @@ export default defineComponent({
|
|||||||
<NRadioButton value="hour" label="日" />
|
<NRadioButton value="hour" label="日" />
|
||||||
<NRadioButton value="day" label="月" />
|
<NRadioButton value="day" label="月" />
|
||||||
</NRadioGroup> */}
|
</NRadioGroup> */}
|
||||||
|
<NRadioGroup v-model:value={value.value} name="radiobuttongroup">
|
||||||
|
<NRadioButton value="hour" label="已发生" />
|
||||||
|
<NRadioButton value="day" label="未来计划" />
|
||||||
|
</NRadioGroup>
|
||||||
<NSelect
|
<NSelect
|
||||||
v-model:value={types.value}
|
v-model:value={types.value}
|
||||||
multiple
|
multiple
|
||||||
|
@ -17,7 +17,7 @@ export default defineComponent({
|
|||||||
return () => (
|
return () => (
|
||||||
<>
|
<>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<NButton onClick={showView}>态势展示</NButton>
|
{/* <NButton onClick={showView}>态势展示</NButton> */}
|
||||||
<NButton
|
<NButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.go(-1)
|
router.go(-1)
|
||||||
|
Loading…
Reference in New Issue
Block a user