|
@@ -77,18 +77,6 @@ const dialogVisible = ref(false)
|
|
const bid = ref(0)
|
|
const bid = ref(0)
|
|
const selectedItems = ref({})
|
|
const selectedItems = ref({})
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
- for (let i = 0; i < 7; i++) {
|
|
|
|
- selectedItems.value[i] = []
|
|
|
|
- const tmp = []
|
|
|
|
- for (let j = 0; j < 24; j++) {
|
|
|
|
- tmp.push({ value: bidData.value.length === 0 ? 0 : bidData.value[i][j], selected: false })
|
|
|
|
- }
|
|
|
|
- items.value.push(tmp)
|
|
|
|
- }
|
|
|
|
- // console.log(99, items.value)
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
const getTdStyle = (info: any) => {
|
|
const getTdStyle = (info: any) => {
|
|
if (props.disabled) {
|
|
if (props.disabled) {
|
|
return { cursor: 'not-allowed', background: '#fff' }
|
|
return { cursor: 'not-allowed', background: '#fff' }
|
|
@@ -96,10 +84,19 @@ const getTdStyle = (info: any) => {
|
|
return { background: info.selected ? '#ccdbff' : '' }
|
|
return { background: info.selected ? '#ccdbff' : '' }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+for (let i = 0; i < 7; i++) {
|
|
|
|
+ selectedItems.value[i] = []
|
|
|
|
+ const tmp = []
|
|
|
|
+ for (let j = 0; j < 24; j++) {
|
|
|
|
+ tmp.push({ value: bidData.value.length === 0 ? 0 : bidData.value[i][j], selected: false })
|
|
|
|
+ }
|
|
|
|
+ items.value.push(tmp)
|
|
|
|
+}
|
|
|
|
+
|
|
watch(
|
|
watch(
|
|
() => props.data,
|
|
() => props.data,
|
|
() => {
|
|
() => {
|
|
- // console.log(102, 'watch', props.data)
|
|
|
|
|
|
+ // console.log(100, 'watch', props.data)
|
|
if (props.data.length === 0) {
|
|
if (props.data.length === 0) {
|
|
for (let i = 0; i < 7; i++) {
|
|
for (let i = 0; i < 7; i++) {
|
|
const tmp = []
|
|
const tmp = []
|
|
@@ -115,7 +112,8 @@ watch(
|
|
}
|
|
}
|
|
}
|
|
}
|
|
bidData.value = props.data
|
|
bidData.value = props.data
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ { immediate: true }
|
|
)
|
|
)
|
|
|
|
|
|
const handleMouseDown = (rowIndex: number, colIndex: number, event: any) => {
|
|
const handleMouseDown = (rowIndex: number, colIndex: number, event: any) => {
|