Commit 1d2810ba authored by 吴春's avatar 吴春
parents fff615b3 023f32aa
......@@ -277,6 +277,13 @@ export function queryChapterTree(data) {
})
}
export function queryScheduleCourseStu(data) {
return request({
url: "/ScheduleCourse/GetScheduleCourseStu ",
method: 'post',
data
})
}
/**
* 保存课程章节
* @param {JSON参数} data
......
<template>
<div class="col"></div>
<div class="col scroll-box" id="scrollBox" @scroll="(e)=>scrollHandle(e)">
<div :style="{width: innerW}" id="scrollInnerTemplate"></div>
</div>
</template>
<script>
......@@ -15,26 +17,45 @@ export default {
}
},
data() {
return {};
return {
innerW:'0px',
ratio:0,
boxRatio:0
};
},
methods: {
createResizeObserver() {
this.resizeObserver = new ResizeObserver(entries => {
for (let entry of entries) {
console.log("Element size changed:", entry.contentRect);
// 你可以在这里处理大小变化的逻辑
}
this.calcHandle()
});
this.resizeObserver.observe(this.$refs.resizeElement);
this.resizeObserver.observe(document.querySelector(`#${this.targetBox}`));
this.resizeObserver.observe(document.querySelector(`#${this.targetWrap}`));
},
destroyResizeObserver() {
if (this.resizeObserver) {
this.resizeObserver.disconnect();
}
},
calcHandle(){
const box = document.querySelector('#scrollBox')
const tb = document.querySelector(`#${this.targetBox}`)
const tw = document.querySelector(`#${this.targetWrap}`)
const zoom = tw.style.zoom?tw.style.zoom:1
if(box && tb && tw){
this.ratio = (tw.offsetWidth*zoom)/tb.offsetWidth
this.innerW = `${this.ratio * box.offsetWidth}px`
this.boxRatio = tb.offsetWidth/box.offsetWidth
}
},
scrollHandle(e){
const box = document.querySelector('#scrollBox')
const sl = box.scrollLeft*this.boxRatio
this.$emit("scrollChange", sl);
}
},
mounted() {
this.createResizeObserver();
},
beforeDestroy() {
this.destroyResizeObserver();
......@@ -43,6 +64,11 @@ export default {
</script>
<style>
.scroll-box{
overflow-x: auto;
overflow-y: hidden;
height: 15px;
}
.scroll-box::-webkit-scrollbar {
width: 6px;
height: 6px;
......
......@@ -381,7 +381,7 @@
{
name: "SellPrice",
required: true,
label: "直客价",
label: "价",
align: "left",
field: row => row.SellPrice.toFixed(2)
},
......
This diff is collapsed.
......@@ -97,7 +97,7 @@
},
data() {
return {
ActionStr: "/CustomerStudent/TestPush",
ActionStr: "/ScheduleCourse/GetScheduleCourseStu",
parameterList: [{
Name: "",
Value: ""
......@@ -157,7 +157,7 @@
data = JSON.parse(tempStr);
}
data = {
CourseRate: 2
};
var tempMsg = {
Msg: data
......@@ -170,6 +170,7 @@
}
},
};
</script>
<style scoped>
......@@ -213,4 +214,5 @@
border: none;
border-collapse: collapse;
}
</style>
\ No newline at end of file
</style>
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