分页优化,删除刷新分页,新增、修改、发布、撤回不刷新分页

This commit is contained in:
曹磊 2024-05-23 20:59:35 +08:00
parent b340db4e4a
commit cbed9edac0
18 changed files with 329 additions and 184 deletions

View File

@ -101,12 +101,13 @@
import WjxWjxxTmlbDjjgsModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsModal.vue' import WjxWjxxTmlbDjjgsModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsModal.vue'
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue'; import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
import {useMessage} from "/@/hooks/web/useMessage";
// //
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
const { rwbh,xqxn,typa } = query;// const { rwbh,xqxn,typa } = query;//
const { createConfirm } = useMessage();
const APagination = Pagination; const APagination = Pagination;
const queryParam = ref<any>({}); const queryParam = ref<any>({});
const current = ref<number>(0); const current = ref<number>(0);
@ -209,20 +210,28 @@
*/ */
function handleFabu(record: Recordable) { function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "6" } }).then(res => { defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "6" } }).then(res => {
total.value = 1; handleSuccess();
handlePageChange(1);
}); });
} }
/** /**
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); createConfirm({
iconType: 'warning',
title: '删除',
content: '是否删除此测验?',
okText: '确认',
cancelText: '取消',
onOk: () => {
deleteOne({ id: record.id }, handleSuccess2);
}
});
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.atype = "6"; queryParam.value.atype = "6";
@ -236,13 +245,20 @@
} }
/** /**
* 成功回调 * 成功回调,用于删除
*/ */
function handleSuccess() { function handleSuccess2() {
total.value = 1; total.value = 1;
handlePageChange(1); handlePageChange(1);
} }
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
/** /**
* 查询 * 查询
*/ */
@ -261,7 +277,7 @@
} }
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -111,13 +111,14 @@
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue' import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgsModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsModal.vue' import WjxWjxxTmlbDjjgsModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsModal.vue'
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue'; import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import {useMessage} from "/@/hooks/web/useMessage";
import TikuListModal from '/@/views/kc/wjxWjxxTmlb/TikuListModal.vue'; import TikuListModal from '/@/views/kc/wjxWjxxTmlb/TikuListModal.vue';
// //
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
const { rwbh,xqxn,typa } = query;// const { rwbh,xqxn,typa } = query;//
const { createConfirm } = useMessage();
const APagination = Pagination; const APagination = Pagination;
const queryParam = ref<any>({}); const queryParam = ref<any>({});
const current = ref<number>(0); const current = ref<number>(0);
@ -229,19 +230,27 @@
*/ */
function handleFabu(record: Recordable) { function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "6" } }).then(res => { defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "6" } }).then(res => {
total.value = 1; handleSuccess();
handlePageChange(1);
}); });
} }
/** /**
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); createConfirm({
iconType: 'warning',
title: '删除',
content: '是否删除此测验?',
okText: '确认',
cancelText: '取消',
onOk: () => {
deleteOne({ id: record.id }, handleSuccess2);
}
});
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo.value; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize.value; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
@ -256,13 +265,20 @@
} }
/** /**
* 成功回调 * 成功回调,用于删除
*/ */
function handleSuccess() { function handleSuccess2() {
total.value = 1; total.value = 1;
handlePageChange(1); handlePageChange(1);
} }
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
/** /**
* 查询 * 查询
*/ */
@ -281,7 +297,7 @@
} }
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -133,8 +133,8 @@
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.atype = "6"; queryParam.value.atype = "6";
@ -151,8 +151,7 @@
* 成功回调 * 成功回调
*/ */
function handleSuccess() { function handleSuccess() {
total.value = 1; reload();
handlePageChange(1);
} }
/** /**
@ -173,7 +172,7 @@
} }
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -99,12 +99,13 @@
import WjxWjxxTmlbDjjgsDcModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsDcModal.vue' import WjxWjxxTmlbDjjgsDcModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsDcModal.vue'
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue'; import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
import {useMessage} from "/@/hooks/web/useMessage";
// //
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
const { rwbh,xqxn,typa} = query;// const { rwbh,xqxn,typa} = query;//
const { createConfirm } = useMessage();
const APagination = Pagination; const APagination = Pagination;
const queryParam = ref<any>({}); const queryParam = ref<any>({});
const current = ref<number>(0); const current = ref<number>(0);
@ -206,20 +207,28 @@
*/ */
function handleFabu(record: Recordable) { function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "1" } }).then(res => { defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "1" } }).then(res => {
total.value = 1; handleSuccess();
handlePageChange(1);
}); });
} }
/** /**
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); createConfirm({
iconType: 'warning',
title: '删除',
content: '是否删除此问卷?',
okText: '确认',
cancelText: '取消',
onOk: () => {
deleteOne({ id: record.id }, handleSuccess2);
}
});
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.atype = "1"; queryParam.value.atype = "1";
@ -233,13 +242,20 @@
} }
/** /**
* 成功回调 * 成功回调,用于删除
*/ */
function handleSuccess() { function handleSuccess2() {
total.value = 1; total.value = 1;
handlePageChange(1); handlePageChange(1);
} }
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
/** /**
* 查询 * 查询
*/ */
@ -258,7 +274,7 @@
} }
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -111,12 +111,13 @@
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
import { JInput } from '/@/components/Form'; import { JInput } from '/@/components/Form';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import {useMessage} from "/@/hooks/web/useMessage";
// //
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
const { rwbh,xqxn,typa} = query;// const { rwbh,xqxn,typa} = query;//
const { createConfirm } = useMessage();
const APagination = Pagination; const APagination = Pagination;
const queryParam = ref<any>({}); const queryParam = ref<any>({});
const current = ref<number>(0); const current = ref<number>(0);
@ -218,19 +219,27 @@
*/ */
function handleFabu(record: Recordable) { function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "1" } }).then(res => { defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "1" } }).then(res => {
total.value = 1; handleSuccess();
handlePageChange(1);
}); });
} }
/** /**
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); createConfirm({
iconType: 'warning',
title: '删除',
content: '是否删除此问卷?',
okText: '确认',
cancelText: '取消',
onOk: () => {
deleteOne({ id: record.id }, handleSuccess2);
}
});
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo.value; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize.value; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
@ -247,13 +256,20 @@
} }
/** /**
* 成功回调 * 成功回调,用于删除
*/ */
function handleSuccess() { function handleSuccess2() {
total.value = 1; total.value = 1;
handlePageChange(1); handlePageChange(1);
} }
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
/** /**
* 查询 * 查询
*/ */
@ -272,7 +288,7 @@
} }
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -133,8 +133,8 @@
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.atype = "1"; queryParam.value.atype = "1";
@ -151,8 +151,7 @@
* 成功回调 * 成功回调
*/ */
function handleSuccess() { function handleSuccess() {
total.value = 1; reload();
handlePageChange(1);
} }
/** /**
@ -173,7 +172,7 @@
} }
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

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;">{{(pageNo-1)*pageSize+index+1}}.{{item.question}}</span> <span style="float: left;">{{(current-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" />
@ -101,7 +101,7 @@ const baseApiUrl = globSetting.domainUrl;
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;// const { rwbh,xqxn } = query;//
const APagination = Pagination; const APagination = Pagination;
const current = ref<number>(0); const current = ref<number>(1);
const total = ref<number>(0); const total = ref<number>(0);
const pageNo = ref<number>(0); const pageNo = ref<number>(0);
const pageSize = ref<number>(3); const pageSize = ref<number>(3);
@ -141,7 +141,7 @@ const baseApiUrl = globSetting.domainUrl;
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleCjwtOk); await deleteOne({ id: record.id }, handleCjwtOk2);
} }
function openPdf(record){ function openPdf(record){
@ -158,25 +158,31 @@ const baseApiUrl = globSetting.domainUrl;
window.open(url,"_blank") window.open(url,"_blank")
} }
// //
function handleCjwtOk() { function handleCjwtOk() {
// console.log('--------cjwt ok -----------') // console.log('--------cjwt ok -----------')
cjwtData(1); cjwtData();
}
//
function handleCjwtOk2() {
total.value = 1;
handlePageChange(1);
} }
// //
function handlePageChange(page: number) { function handlePageChange(page: number) {
cjwtData(page); current.value = page;
cjwtData();
} }
function cjwtData(arg){ function cjwtData(){
pageNo.value = arg; defHttp.get({ url: '/zyCjwt/zyCjwt/list', params: { pageSize: 3,pageNo:current.value, 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;
pageNo.value = res.pages;
current.value = res.current;
// console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource) // console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource)
}); });
} }
@ -216,7 +222,7 @@ const baseApiUrl = globSetting.domainUrl;
// //
onMounted(() => { onMounted(() => {
getKcjsJxdg(); getKcjsJxdg();
cjwtData(1); cjwtData();
}); });

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;">{{(pageNo-1)*pageSize+index+1}}.{{item.question}}</span> <span style="float: left;">{{(current-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">
@ -99,7 +99,7 @@ const baseApiUrl = globSetting.domainUrl;
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;// const { rwbh,xqxn } = query;//
const APagination = Pagination; const APagination = Pagination;
const current = ref<number>(0); const current = ref<number>(1);
const total = ref<number>(0); const total = ref<number>(0);
const pageNo = ref<number>(0); const pageNo = ref<number>(0);
const pageSize = ref<number>(3); const pageSize = ref<number>(3);
@ -138,7 +138,7 @@ const baseApiUrl = globSetting.domainUrl;
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleCjwtOk); await deleteOne({ id: record.id }, handleCjwtOk2);
} }
function openPdf(record){ function openPdf(record){
@ -155,24 +155,25 @@ function openJxrlPdf(record){
window.open(url,"_blank") window.open(url,"_blank")
} }
// //
function handleCjwtOk() { function handleCjwtOk2() {
// console.log('--------cjwt ok -----------') total.value = 1;
cjwtData(1); handlePageChange(1);
} }
// //
function handlePageChange(page: number) { function handlePageChange(page: number) {
cjwtData(page); current.value = page;
cjwtData();
} }
function cjwtData(arg){ function cjwtData(){
pageNo.value = arg; defHttp.get({ url: '/zyCjwt/zyCjwt/list', params: { pageSize: 3,pageNo:current.value, 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;
pageNo.value = res.pages;
current.value = res.current;
// console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource) // console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource)
}); });
} }
@ -213,7 +214,7 @@ function openJxrlPdf(record){
// //
onMounted(() => { onMounted(() => {
getKcjsJxdg(); getKcjsJxdg();
cjwtData(1); cjwtData();
}); });

View File

@ -101,15 +101,17 @@
// //
function handlePageChange(page: number) { function handlePageChange(page: number) {
pageNo.value = page; current.value = page;
reload(); reload();
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.column="createTime";
queryParam.value.order="desc";
console.log(`🚀 ~ reload ~ queryParam:`, queryParam) console.log(`🚀 ~ reload ~ queryParam:`, queryParam)
defHttp.get({ url: '/zyGonggao/zyGonggao/list', params: queryParam.value }).then((res) => { defHttp.get({ url: '/zyGonggao/zyGonggao/list', params: queryParam.value }).then((res) => {
console.log(res); console.log(res);

View File

@ -44,7 +44,8 @@
<a-button type="primary" @click="handleDelete(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.ggStatus==0">删除</a-button> <a-button type="primary" @click="handleDelete(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.ggStatus==0">删除</a-button>
<a-button type="primary" @click="handleCh(item)" style="margin-left:5px;padding: 0px 8px;background:#a7a6a6;" v-if="item.ggStatus==1">撤回</a-button> <a-button type="primary" @click="handleCh(item)" style="margin-left:5px;padding: 0px 8px;background:#a7a6a6;" v-if="item.ggStatus==1">撤回</a-button>
<a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;padding: 0px 8px;background:#18a689;">预览</a-button> <a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;padding: 0px 8px;background:#18a689;">预览</a-button>
<a-button type="primary" @click="handleHistory(item)" style="margin-left:5px;padding: 0px 8px;background:#18a689;">历史</a-button> <a-button type="primary" @click="handleFabu(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.ggStatus==0">发布</a-button>
<!-- <a-button type="primary" @click="handleHistory(item)" style="margin-left:5px;padding: 0px 8px;background:#18a689;">历史</a-button>-->
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<div style="text-align: right;color:#9e9e9e;font-weight: bold;">{{item.createTime}}</div> <div style="text-align: right;color:#9e9e9e;font-weight: bold;">{{item.createTime}}</div>
@ -63,7 +64,7 @@
</a-row> </a-row>
<ZyGonggaoModal ref="registerModal" @success="handleSuccess"></ZyGonggaoModal> <ZyGonggaoModal ref="registerModal" @success="handleSuccess"></ZyGonggaoModal>
<ZyGonggaoYlModal ref="registerYlModal" @success="handleSuccess"></ZyGonggaoYlModal> <ZyGonggaoYlModal ref="registerYlModal" @success="handleSuccess"></ZyGonggaoYlModal>
<ZyGonggaoHistoryModal ref="registerHistoryModal" @success="handleSuccess"></ZyGonggaoHistoryModal> <!-- <ZyGonggaoHistoryModal ref="registerHistoryModal" @success="handleSuccess"></ZyGonggaoHistoryModal>-->
</div> </div>
</template> </template>
@ -73,7 +74,7 @@
import { deleteOne } from './ZyGonggao.api'; import { deleteOne } from './ZyGonggao.api';
import ZyGonggaoModal from './components/ZyGonggaoModal.vue'; import ZyGonggaoModal from './components/ZyGonggaoModal.vue';
import ZyGonggaoYlModal from './components/ZyGonggaoYlModal.vue'; import ZyGonggaoYlModal from './components/ZyGonggaoYlModal.vue';
import ZyGonggaoHistoryModal from './components/ZyGonggaoHistoryModal.vue'; // import ZyGonggaoHistoryModal from './components/ZyGonggaoHistoryModal.vue';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage"; import { useMessage } from "/@/hooks/web/useMessage";
import { JInput } from '/@/components/Form'; import { JInput } from '/@/components/Form';
@ -90,7 +91,7 @@
const queryParam = ref<any>({rwbh, xqxn,"createBy":userName}); const queryParam = ref<any>({rwbh, xqxn,"createBy":userName});
const registerModal = ref(); const registerModal = ref();
const registerYlModal = ref(); const registerYlModal = ref();
const registerHistoryModal = ref(); // const registerHistoryModal = ref();
const current = ref<number>(0); const current = ref<number>(0);
const total = ref<number>(0); const total = ref<number>(0);
const pageNo = ref<number>(0); const pageNo = ref<number>(0);
@ -137,10 +138,10 @@
/** /**
* 历史通知 * 历史通知
*/ */
function handleHistory(record: Recordable) { // function handleHistory(record: Recordable) {
registerHistoryModal.value.disableSubmit = true; // registerHistoryModal.value.disableSubmit = true;
registerHistoryModal.value.edit(record); // registerHistoryModal.value.edit(record);
} // }
/** /**
* 删除事件 * 删除事件
@ -153,7 +154,7 @@
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
deleteOne({ id: record.id }, handleSuccess); deleteOne({ id: record.id }, handleSuccess2);
} }
}); });
} }
@ -191,13 +192,20 @@
} }
/** /**
* 成功回调 * 成功回调,用于删除
*/ */
function handleSuccess() { function handleSuccess2() {
total.value = 1; total.value = 1;
handlePageChange(1); handlePageChange(1);
} }
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
/** /**
* 查询 * 查询
*/ */
@ -218,13 +226,13 @@
} }
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.column="createTime"; queryParam.value.column="createTime";

View File

@ -98,11 +98,9 @@
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
createMessage.success(res.message); createMessage.success(res.message);
console.log("111111111");
emit('ok'); emit('ok');
} else { } else {
createMessage.warning(res.message); createMessage.warning(res.message);
console.log("222222");
} }
}) })
.finally(() => { .finally(() => {

View File

@ -172,13 +172,11 @@
XxhbbksListModalPage.value.init(record); XxhbbksListModalPage.value.init(record);
} }
/** /**
* 成功回调 * 成功回调用于增加修改发布和撤回
*/ */
function handleSuccess() { function handleSuccess() {
total.value = 1; reload();
handlePageChange(1);
} }
@ -201,15 +199,15 @@
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.zyStatus = '1,2,3,4'; queryParam.value.zyStatus = '1,2,3,4';
queryParam.value.column="createTime"; queryParam.value.column="createTime";
queryParam.value.order="desc"; queryParam.value.order="desc";
defHttp.get({ url: '/zyInfo/zyInfo/stuList', params: queryParam.value }).then(res => { defHttp.get({ url: '/zyInfo/zyInfo/stuList', params: queryParam.value }).then(res => {
console.log(`🚀 ~ defHttp.get ~ res:`, res) // console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total; total.value = res.total;
pageNo.value = res.pages; pageNo.value = res.pages;
current.value = res.current; current.value = res.current;
@ -219,7 +217,7 @@
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -165,7 +165,7 @@
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); await deleteOne({ id: record.id }, handleSuccess2);
} }
async function handleFabu(record){ async function handleFabu(record){
@ -187,13 +187,19 @@
/** /**
* 成功回调 * 成功回调,用于删除
*/ */
function handleSuccess() { function handleSuccess2() {
total.value = 1; total.value = 1;
handlePageChange(1); handlePageChange(1);
} }
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
/** /**
* 查询 * 查询
@ -214,8 +220,8 @@
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.sflssj = '1'; queryParam.value.sflssj = '1';
@ -232,7 +238,7 @@
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -161,7 +161,7 @@
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); await deleteOne({ id: record.id }, handleSuccess2);
} }
// //
@ -184,13 +184,20 @@
/** /**
* 成功回调 * 成功回调,用于删除
*/ */
function handleSuccess() { function handleSuccess2() {
total.value = 1; total.value = 1;
handlePageChange(1); handlePageChange(1);
} }
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
function handleZySuccess(zyid){ function handleZySuccess(zyid){
setTimeout(()=>{handleSuccess()}, 1500); setTimeout(()=>{handleSuccess()}, 1500);
@ -219,8 +226,8 @@
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
// queryParam.value.sflssj = '0'; // queryParam.value.sflssj = '0';
@ -237,7 +244,7 @@
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -165,7 +165,7 @@
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); await deleteOne({ id: record.id }, handleSuccess2);
} }
async function handleFabu(record){ async function handleFabu(record){
@ -187,10 +187,18 @@
/** /**
* 成功回调 * 成功回调,用于删除
*/
function handleSuccess2() {
total.value = 1;
handlePageChange(1);
}
/**
* 成功回调用于增加修改发布和撤回
*/ */
function handleSuccess() { function handleSuccess() {
reload() reload();
} }
@ -198,7 +206,8 @@
* 查询 * 查询
*/ */
function searchQuery() { function searchQuery() {
reload(); total.value = 1;
handlePageChange(1);
} }
/** /**
@ -206,20 +215,20 @@
*/ */
function searchReset() { function searchReset() {
queryParam.value = {}; queryParam.value = {};
// total.value = 1;
reload(); handlePageChange(1);
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
queryParam.value.sflssj = '1'; queryParam.value.sflssj = '1';
queryParam.value.column="startTime"; queryParam.value.column="startTime";
queryParam.value.order="desc"; queryParam.value.order="desc";
defHttp.get({ url: '/zyInfo/zyInfo/list', params: queryParam.value }).then(res => { defHttp.get({ url: '/zyInfo/zyInfo/list', params: queryParam.value }).then(res => {
console.log(`🚀 ~ defHttp.get ~ res:`, res) // console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total; total.value = res.total;
pageNo.value = res.pages; pageNo.value = res.pages;
current.value = res.current; current.value = res.current;
@ -229,7 +238,7 @@
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
searchQuery(); searchQuery();
} }

View File

@ -181,7 +181,16 @@ import dayjs from 'dayjs';
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); createConfirm({
iconType: 'warning',
title: '删除',
content: '是否删除此作业?',
okText: '确认',
cancelText: '取消',
onOk: () => {
deleteOne({ id: record.id }, handleSuccess2);
}
});
} }
// //
@ -204,13 +213,20 @@ import dayjs from 'dayjs';
/** /**
* 成功回调 * 成功回调,用于删除
*/ */
function handleSuccess() { function handleSuccess2() {
total.value = 1; total.value = 1;
handlePageChange(1); handlePageChange(1);
} }
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
function handleZySuccess(zyid){ function handleZySuccess(zyid){
setTimeout(()=>{handleSuccess()}, 1500); setTimeout(()=>{handleSuccess()}, 1500);
var url = "/zyInfo/zyInfo/editStudent"; var url = "/zyInfo/zyInfo/editStudent";
@ -238,7 +254,7 @@ import dayjs from 'dayjs';
} }
function reload(){ function reload(){
queryParam.value.pageNo = pageNo.value; queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize.value; queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh; queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn; queryParam.value.xqxn = xqxn;
@ -249,14 +265,14 @@ import dayjs from 'dayjs';
console.log(`🚀 ~ defHttp.get ~ res:`, res) console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total; total.value = res.total;
pageNo.value = res.pages; pageNo.value = res.pages;
current.value = res.total; current.value = res.current;
tableData.value = res.records; tableData.value = res.records;
}); });
} }
function handlePageChange(record){ function handlePageChange(record){
pageNo.value = record; current.value = record;
reload(); reload();
} }

View File

@ -13,6 +13,7 @@
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6"> <a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button> <a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
</a-col> </a-col>
</span> </span>
</a-col> </a-col>
@ -25,7 +26,7 @@
<!-- <a-card> --> <!-- <a-card> -->
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<span style="float: left;">{{index+1}}.{{item.title}}</span> <span style="float: left;">{{(current-1)*pageSize+index+1}}.{{item.title}}</span>
<span style="float: right;"> <span style="float: right;">
<a title="详情" @click="handleDetail(item)"><Icon icon="ant-design:snippets-outlined" /></a> <a title="详情" @click="handleDetail(item)"><Icon icon="ant-design:snippets-outlined" /></a>
</span> </span>
@ -68,7 +69,7 @@
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref(); const registerModal = ref();
const dataSource = ref<any>([]); const dataSource = ref<any>([]);
const current = ref<number>(0); const current = ref<number>(1);
const total = ref<number>(0); const total = ref<number>(0);
const pageNo = ref<number>(0); const pageNo = ref<number>(0);
const pageSize = ref<number>(3); const pageSize = ref<number>(3);
@ -85,20 +86,6 @@
sm: { span: 16 }, sm: { span: 16 },
}); });
/**
* 发布
*/
function handleFabu(record) {
defHttp.post({ url: '/zyTlq/zyTlq/edit', params: { id: record.id,sffb: "6" } }).then(res => {
total.value = 1;
pageNo.value = 0;
loadData(1);
});
}
//
function handlePageChange(page: number) {
loadData(page);
}
/** /**
* 新增事件 * 新增事件
*/ */
@ -130,19 +117,40 @@
await deleteOne({ id: record.id }, handleSuccess); await deleteOne({ id: record.id }, handleSuccess);
} }
/**
* 发布
*/
function handleFabu(record) {
defHttp.post({ url: '/zyTlq/zyTlq/edit', params: { id: record.id,sffb: "6" } }).then(res => {
handleSuccess();
});
}
//
function handlePageChange(page: number) {
current.value = page;
loadData();
}
/** /**
* 成功回调 * 成功回调
*/ */
function handleSuccess() { function handleSuccess() {
loadData(1); loadData();
} }
/**
* 成功回调
*/
function handleSuccess2() {
total.value = 1;
handlePageChange(1);
}
/** /**
* 查询 * 查询
*/ */
function searchQuery() { function searchQuery() {
loadData(1); total.value = 1;
handlePageChange(1);
} }
/** /**
@ -151,22 +159,24 @@
function searchReset() { function searchReset() {
queryParam.value = {}; queryParam.value = {};
// //
loadData(1); total.value = 1;
handlePageChange(1);
} }
function loadData(arg){
defHttp.get({ url: '/zyTlq/zyTlq/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn,sffb:'1',column:'createTime',order:'desc' } }).then((res) => { function loadData(){
defHttp.get({ url: '/zyTlq/zyTlq/list', params: { pageSize: 3,pageNo:current.value, rwbh:rwbh,xqxn:xqxn,sffb:'1',column:'createTime',order:'desc' } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res) console.log(`🚀 ~ defHttp.get ~ res:`, res)
dataSource.value = res.records; dataSource.value = res.records;
total.value = res.total; total.value = res.total;
pageNo.value = res.pages;
current.value = res.current;
}); });
} }
// //
onMounted(() => { onMounted(() => {
loadData(1); loadData();
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -13,6 +13,7 @@
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6"> <a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button> <a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd" style="margin-left: 8px"> 新增</a-button> <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd" style="margin-left: 8px"> 新增</a-button>
</a-col> </a-col>
</span> </span>
@ -26,7 +27,7 @@
<!-- <a-card> --> <!-- <a-card> -->
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<span style="float: left;">{{index+1}}.{{item.title}}</span> <span style="float: left;">{{(current-1)*pageSize+index+1}}.{{item.title}}</span>
<span style="float: right;"> <span style="float: right;">
<span v-if="item.sffb=='0'">未发布</span> <span v-if="item.sffb=='0'">未发布</span>
<span v-else>已发布</span> <span v-else>已发布</span>
@ -72,12 +73,14 @@
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { JInput } from '/@/components/Form'; import { JInput } from '/@/components/Form';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import {useMessage} from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
const queryParam = ref<any>({}); const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref(); const registerModal = ref();
const dataSource = ref<any>([]); const dataSource = ref<any>([]);
const current = ref<number>(0); const current = ref<number>(1);
const total = ref<number>(0); const total = ref<number>(0);
const pageNo = ref<number>(0); const pageNo = ref<number>(0);
const pageSize = ref<number>(3); const pageSize = ref<number>(3);
@ -94,20 +97,6 @@
sm: { span: 16 }, sm: { span: 16 },
}); });
/**
* 发布
*/
function handleFabu(record) {
defHttp.post({ url: '/zyTlq/zyTlq/edit', params: { id: record.id,sffb: "1" } }).then(res => {
total.value = 1;
pageNo.value = 0;
loadData(1);
});
}
//
function handlePageChange(page: number) {
loadData(page);
}
/** /**
* 新增事件 * 新增事件
*/ */
@ -136,22 +125,53 @@
* 删除事件 * 删除事件
*/ */
async function handleDelete(record) { async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess); createConfirm({
iconType: 'warning',
title: '删除',
content: '是否删除此讨论?',
okText: '确认',
cancelText: '取消',
onOk: () => {
deleteOne({ id: record.id }, handleSuccess2);
}
});
}
/**
* 发布
*/
function handleFabu(record) {
defHttp.post({ url: '/zyTlq/zyTlq/edit', params: { id: record.id,sffb: "1" } }).then(res => {
handleSuccess();
});
}
//
function handlePageChange(page: number) {
current.value = page;
loadData();
} }
/** /**
* 成功回调 * 成功回调
*/ */
function handleSuccess() { function handleSuccess() {
loadData(1); loadData();
} }
/**
* 成功回调
*/
function handleSuccess2() {
total.value = 1;
handlePageChange(1);
}
/** /**
* 查询 * 查询
*/ */
function searchQuery() { function searchQuery() {
loadData(1); total.value = 1;
handlePageChange(1);
} }
/** /**
@ -160,22 +180,24 @@
function searchReset() { function searchReset() {
queryParam.value = {}; queryParam.value = {};
// //
loadData(1); total.value = 1;
handlePageChange(1);
} }
function loadData(arg){
defHttp.get({ url: '/zyTlq/zyTlq/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn,column:'createTime',order:'desc' } }).then((res) => { function loadData(){
defHttp.get({ url: '/zyTlq/zyTlq/list', params: { pageSize: 3,pageNo:current.value, rwbh:rwbh,xqxn:xqxn,column:'createTime',order:'desc' } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res) console.log(`🚀 ~ defHttp.get ~ res:`, res)
dataSource.value = res.records; dataSource.value = res.records;
total.value = res.total; total.value = res.total;
pageNo.value = res.pages;
current.value = res.current;
}); });
} }
// //
onMounted(() => { onMounted(() => {
loadData(1); loadData();
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>