课程介绍中的常见问题,学生端调整分页,序号连续行

This commit is contained in:
曹磊 2024-05-23 14:15:31 +08:00
parent 1aa18e9b97
commit 6593aa7e93
2 changed files with 36 additions and 33 deletions

View File

@ -42,7 +42,7 @@
<a-col :span="24" v-for="(item,index) in cjwtSource" :key="index"> <a-col :span="24" v-for="(item,index) in cjwtSource" :key="index">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<span style="float: left;">{{index+1}}.{{item.question}}</span> <span style="float: left;">{{(pageNo-1)*pageSize+index+1}}.{{item.question}}</span>
<span style="float: right;"> <span style="float: right;">
<a title="修改" @click="handleEdit(item)"><Icon icon="ant-design:form-outlined" /></a> <a title="修改" @click="handleEdit(item)"><Icon icon="ant-design:form-outlined" /></a>
<a-divider type="vertical" style="height: 30px; background-color: #7cb305" /> <a-divider type="vertical" style="height: 30px; background-color: #7cb305" />
@ -95,7 +95,7 @@
const globSetting = useGlobSetting(); const globSetting = useGlobSetting();
const baseApiUrl = globSetting.domainUrl; const baseApiUrl = globSetting.domainUrl;
// //
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
@ -117,7 +117,7 @@ const baseApiUrl = globSetting.domainUrl;
jxrlFilePath:null, jxrlFilePath:null,
kcjs:'' kcjs:''
}); });
// //
function handleYinyong(){ function handleYinyong(){
var record = {xqxn,rwbh} var record = {xqxn,rwbh}
@ -146,37 +146,38 @@ const baseApiUrl = globSetting.domainUrl;
function openPdf(record){ function openPdf(record){
var url2 = getFileAccessHttpUrl(record.pdfPath) var url2 = getFileAccessHttpUrl(record.pdfPath)
console.log(`🚀 ~ openPdf ~ url2:`, url2) // console.log(`🚀 ~ openPdf ~ url2:`, url2)
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2); let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
window.open(url,"_blank") window.open(url,"_blank")
} }
function openJxrlPdf(record){ function openJxrlPdf(record){
var url2 = getFileAccessHttpUrl(record.jxrlPdfPath) var url2 = getFileAccessHttpUrl(record.jxrlPdfPath)
console.log(`🚀 ~ openPdf ~ url2:`, url2) // console.log(`🚀 ~ openPdf ~ url2:`, url2)
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2); let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
window.open(url,"_blank") window.open(url,"_blank")
} }
// //
function handleCjwtOk() { function handleCjwtOk() {
console.log('--------cjwt ok -----------') // console.log('--------cjwt ok -----------')
cjwtData(1); cjwtData(1);
} }
// //
function handlePageChange(page: number) { function handlePageChange(page: number) {
cjwtData(page); cjwtData(page);
} }
function cjwtData(arg){ function cjwtData(arg){
pageNo.value = arg;
defHttp.get({ url: '/zyCjwt/zyCjwt/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn,column:'createTime',order:'desc' } }).then((res) => { defHttp.get({ url: '/zyCjwt/zyCjwt/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn,column:'createTime',order:'desc' } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res) // console.log(`🚀 ~ defHttp.get ~ res:`, res)
cjwtSource.value = res.records; cjwtSource.value = res.records;
total.value = res.total; total.value = res.total;
console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource) // console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource)
}); });
} }
// //
@ -192,13 +193,13 @@ const baseApiUrl = globSetting.domainUrl;
var model = jxdgInfo.value; var model = jxdgInfo.value;
model.rwbh = rwbh; model.rwbh = rwbh;
model.xqxn = xqxn; model.xqxn = xqxn;
console.log(`🚀 ~ addKcjsHandle ~ model:`, model) // console.log(`🚀 ~ addKcjsHandle ~ model:`, model)
if(model.id){ if(model.id){
if(type=='1'){ if(type=='1'){
model.filePath = ''; model.filePath = '';
} }
defHttp.post({ url: '/zyJxdg/zyJxdg/edit', params: model }).then((res) => { defHttp.post({ url: '/zyJxdg/zyJxdg/edit', params: model }).then((res) => {
console.log(`🚀 ~ defHttp.post 111~ res:`, res) // console.log(`🚀 ~ defHttp.post 111~ res:`, res)
getKcjsJxdg(); getKcjsJxdg();
}); });
}else{ }else{
@ -206,7 +207,7 @@ const baseApiUrl = globSetting.domainUrl;
model.filePath = ''; model.filePath = '';
} }
defHttp.post({ url: '/zyJxdg/zyJxdg/add', params: model }).then((res) => { defHttp.post({ url: '/zyJxdg/zyJxdg/add', params: model }).then((res) => {
console.log(`🚀 ~ defHttp.post 222~ res:`, res) // console.log(`🚀 ~ defHttp.post 222~ res:`, res)
getKcjsJxdg(); getKcjsJxdg();
}); });
} }
@ -218,7 +219,7 @@ const baseApiUrl = globSetting.domainUrl;
cjwtData(1); cjwtData(1);
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>

View File

@ -44,7 +44,7 @@
<a-col :span="24" v-for="(item,index) in cjwtSource" :key="index"> <a-col :span="24" v-for="(item,index) in cjwtSource" :key="index">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<span style="float: left;">{{index+1}}.{{item.question}}</span> <span style="float: left;">{{(pageNo-1)*pageSize+index+1}}.{{item.question}}</span>
</a-col> </a-col>
<a-col :span="24"><span><Icon icon="ant-design:caret-right-outlined" />{{item.answer}}</span></a-col> <a-col :span="24"><span><Icon icon="ant-design:caret-right-outlined" />{{item.answer}}</span></a-col>
<a-col :span="24"> <a-col :span="24">
@ -93,7 +93,7 @@
const globSetting = useGlobSetting(); const globSetting = useGlobSetting();
const baseApiUrl = globSetting.domainUrl; const baseApiUrl = globSetting.domainUrl;
// //
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
@ -114,7 +114,7 @@ const baseApiUrl = globSetting.domainUrl;
filePath:'', filePath:'',
kcjs:'' kcjs:''
}); });
// //
function handleYinyong(){ function handleYinyong(){
var record = {xqxn,rwbh} var record = {xqxn,rwbh}
@ -143,41 +143,43 @@ const baseApiUrl = globSetting.domainUrl;
function openPdf(record){ function openPdf(record){
var url2 = getFileAccessHttpUrl(record.pdfPath) var url2 = getFileAccessHttpUrl(record.pdfPath)
console.log(`🚀 ~ openPdf ~ url2:`, url2) // console.log(`🚀 ~ openPdf ~ url2:`, url2)
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2); let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
window.open(url,"_blank") window.open(url,"_blank")
} }
function openJxrlPdf(record){ function openJxrlPdf(record){
var url2 = getFileAccessHttpUrl(record.jxrlPdfPath) var url2 = getFileAccessHttpUrl(record.jxrlPdfPath)
console.log(`🚀 ~ openPdf ~ url2:`, url2) // console.log(`🚀 ~ openPdf ~ url2:`, url2)
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2); let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
window.open(url,"_blank") window.open(url,"_blank")
} }
// //
function handleCjwtOk() { function handleCjwtOk() {
console.log('--------cjwt ok -----------') // console.log('--------cjwt ok -----------')
cjwtData(1); cjwtData(1);
} }
// //
function handlePageChange(page: number) { function handlePageChange(page: number) {
cjwtData(page); cjwtData(page);
} }
function cjwtData(arg){ function cjwtData(arg){
defHttp.get({ url: '/zyCjwt/zyCjwt/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn } }).then((res) => { pageNo.value = arg;
console.log(`🚀 ~ defHttp.get ~ res:`, res) defHttp.get({ url: '/zyCjwt/zyCjwt/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn,column:'createTime',order:'desc' } }).then((res) => {
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
cjwtSource.value = res.records; cjwtSource.value = res.records;
console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource) total.value = res.total;
// console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource)
}); });
} }
// //
function getKcjsJxdg(){ function getKcjsJxdg(){
defHttp.get({ url: '/zyJxdg/zyJxdg/getKcjsJxdg', params: { rwbh:rwbh} }).then((res) => { defHttp.get({ url: '/zyJxdg/zyJxdg/getKcjsJxdg', params: { rwbh:rwbh} }).then((res) => {
console.log(`🚀 1111111111111~ getKcjsJxdg ~ res:`, res) // console.log(`🚀 1111111111111~ getKcjsJxdg ~ res:`, res)
if(res){ if(res){
jxdgInfo.value = res; jxdgInfo.value = res;
} }
@ -188,13 +190,13 @@ function openJxrlPdf(record){
var model = jxdgInfo.value; var model = jxdgInfo.value;
model.rwbh = rwbh; model.rwbh = rwbh;
model.xqxn = xqxn; model.xqxn = xqxn;
console.log(`🚀 ~ addKcjsHandle ~ model:`, model) // console.log(`🚀 ~ addKcjsHandle ~ model:`, model)
if(model.id){ if(model.id){
if(type=='1'){ if(type=='1'){
model.filePath = ''; model.filePath = '';
} }
defHttp.post({ url: '/zyJxdg/zyJxdg/edit', params: model }).then((res) => { defHttp.post({ url: '/zyJxdg/zyJxdg/edit', params: model }).then((res) => {
console.log(`🚀 ~ defHttp.post 111~ res:`, res) // console.log(`🚀 ~ defHttp.post 111~ res:`, res)
getKcjsJxdg(); getKcjsJxdg();
}); });
}else{ }else{
@ -202,7 +204,7 @@ function openJxrlPdf(record){
model.filePath = ''; model.filePath = '';
} }
defHttp.post({ url: '/zyJxdg/zyJxdg/add', params: model }).then((res) => { defHttp.post({ url: '/zyJxdg/zyJxdg/add', params: model }).then((res) => {
console.log(`🚀 ~ defHttp.post 222~ res:`, res) // console.log(`🚀 ~ defHttp.post 222~ res:`, res)
getKcjsJxdg(); getKcjsJxdg();
}); });
} }
@ -214,7 +216,7 @@ function openJxrlPdf(record){
cjwtData(1); cjwtData(1);
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>