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