From 51067e07dcde2b618383603dc807fdbf1544a777 Mon Sep 17 00:00:00 2001
From: yangjun <1173114630@qq.com>
Date: Mon, 19 Jun 2023 17:12:45 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/kc/kcTingke/KcTingke.api.ts | 72 +++++
src/views/kc/kcTingke/KcTingke.data.ts | 152 +++++++++++
src/views/kc/kcTingke/KcTingkeList.vue | 254 ++++++++++++++++++
.../kc/kcTingke/components/KcTingkeForm.vue | 181 +++++++++++++
.../kc/kcTingke/components/KcTingkeModal.vue | 75 ++++++
src/views/site/index.vue | 8 +-
src/views/site/jingCaiGongKaiKe/index.vue | 13 +-
.../site/tingKeZuJi/components/viewForm.vue | 1 +
src/views/site/tingKeZuJi/list.vue | 36 ++-
src/views/site/tingKeZuJi/more.vue | 4 +-
10 files changed, 780 insertions(+), 16 deletions(-)
create mode 100644 src/views/kc/kcTingke/KcTingke.api.ts
create mode 100644 src/views/kc/kcTingke/KcTingke.data.ts
create mode 100644 src/views/kc/kcTingke/KcTingkeList.vue
create mode 100644 src/views/kc/kcTingke/components/KcTingkeForm.vue
create mode 100644 src/views/kc/kcTingke/components/KcTingkeModal.vue
diff --git a/src/views/kc/kcTingke/KcTingke.api.ts b/src/views/kc/kcTingke/KcTingke.api.ts
new file mode 100644
index 0000000..c55155e
--- /dev/null
+++ b/src/views/kc/kcTingke/KcTingke.api.ts
@@ -0,0 +1,72 @@
+import { defHttp } from '/@/utils/http/axios';
+import { useMessage } from "/@/hooks/web/useMessage";
+
+const { createConfirm } = useMessage();
+
+enum Api {
+ list = '/kcTingke/kcTingke/list',
+ save='/kcTingke/kcTingke/add',
+ edit='/kcTingke/kcTingke/edit',
+ deleteOne = '/kcTingke/kcTingke/delete',
+ deleteBatch = '/kcTingke/kcTingke/deleteBatch',
+ importExcel = '/kcTingke/kcTingke/importExcel',
+ exportXls = '/kcTingke/kcTingke/exportXls',
+}
+
+/**
+ * 导出api
+ * @param params
+ */
+export const getExportUrl = Api.exportXls;
+
+/**
+ * 导入api
+ */
+export const getImportUrl = Api.importExcel;
+
+/**
+ * 列表接口
+ * @param params
+ */
+export const list = (params) => defHttp.get({ url: Api.list, params });
+
+/**
+ * 删除单个
+ * @param params
+ * @param handleSuccess
+ */
+export const deleteOne = (params,handleSuccess) => {
+ return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
+ handleSuccess();
+ });
+}
+
+/**
+ * 批量删除
+ * @param params
+ * @param handleSuccess
+ */
+export const batchDelete = (params, handleSuccess) => {
+ createConfirm({
+ iconType: 'warning',
+ title: '确认删除',
+ content: '是否删除选中数据',
+ okText: '确认',
+ cancelText: '取消',
+ onOk: () => {
+ return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
+ handleSuccess();
+ });
+ }
+ });
+}
+
+/**
+ * 保存或者更新
+ * @param params
+ * @param isUpdate
+ */
+export const saveOrUpdate = (params, isUpdate) => {
+ let url = isUpdate ? Api.edit : Api.save;
+ return defHttp.post({ url: url, params }, { isTransformResponse: false });
+}
diff --git a/src/views/kc/kcTingke/KcTingke.data.ts b/src/views/kc/kcTingke/KcTingke.data.ts
new file mode 100644
index 0000000..70cebe1
--- /dev/null
+++ b/src/views/kc/kcTingke/KcTingke.data.ts
@@ -0,0 +1,152 @@
+import {BasicColumn} from '/@/components/Table';
+import {FormSchema} from '/@/components/Table';
+import { rules} from '/@/utils/helper/validator';
+import { render } from '/@/utils/common/renderUtils';
+//列表数据
+export const columns: BasicColumn[] = [
+ {
+ title: '停课时间',
+ align: "center",
+ dataIndex: 'tingketime'
+ },
+ {
+ title: '检查时间',
+ align: "center",
+ dataIndex: 'jianchatime'
+ },
+ {
+ title: '课堂表ID(不是课程表ID)',
+ align: "center",
+ dataIndex: 'kechengbiaoid'
+ },
+ {
+ title: '账户',
+ align: "center",
+ dataIndex: 'userid'
+ },
+ {
+ title: '用户名',
+ align: "center",
+ dataIndex: 'username'
+ },
+ {
+ title: '用户单位名称',
+ align: "center",
+ dataIndex: 'userdwmc'
+ },
+ {
+ title: '用户听课身份1',
+ align: "center",
+ dataIndex: 'usertksf1'
+ },
+ {
+ title: '用户听课身份2',
+ align: "center",
+ dataIndex: 'usertksf2'
+ },
+ {
+ title: '用户听课身份编码',
+ align: "center",
+ dataIndex: 'usertksfcode'
+ },
+ {
+ title: '用户听课要求',
+ align: "center",
+ dataIndex: 'usertkyq'
+ },
+];
+
+//查询数据
+export const searchFormSchema: FormSchema[] = [
+ {
+ label: "停课时间",
+ field: 'tingketime',
+ component: 'Input',
+ colProps: {span: 6},
+ },
+ {
+ label: "检查时间",
+ field: 'jianchatime',
+ component: 'Input',
+ colProps: {span: 6},
+ },
+ {
+ label: "课堂表ID(不是课程表ID)",
+ field: 'kechengbiaoid',
+ component: 'Input',
+ colProps: {span: 6},
+ },
+ {
+ label: "账户",
+ field: 'userid',
+ component: 'Input',
+ colProps: {span: 6},
+ },
+ {
+ label: "用户名",
+ field: 'username',
+ component: 'Input',
+ colProps: {span: 6},
+ },
+];
+
+//表单数据
+export const formSchema: FormSchema[] = [
+ {
+ label: '停课时间',
+ field: 'tingketime',
+ component: 'Input',
+ },
+ {
+ label: '检查时间',
+ field: 'jianchatime',
+ component: 'Input',
+ },
+ {
+ label: '课堂表ID(不是课程表ID)',
+ field: 'kechengbiaoid',
+ component: 'Input',
+ },
+ {
+ label: '账户',
+ field: 'userid',
+ component: 'Input',
+ },
+ {
+ label: '用户名',
+ field: 'username',
+ component: 'Input',
+ },
+ {
+ label: '用户单位名称',
+ field: 'userdwmc',
+ component: 'Input',
+ },
+ {
+ label: '用户听课身份1',
+ field: 'usertksf1',
+ component: 'Input',
+ },
+ {
+ label: '用户听课身份2',
+ field: 'usertksf2',
+ component: 'Input',
+ },
+ {
+ label: '用户听课身份编码',
+ field: 'usertksfcode',
+ component: 'Input',
+ },
+ {
+ label: '用户听课要求',
+ field: 'usertkyq',
+ component: 'InputNumber',
+ },
+ // TODO 主键隐藏字段,目前写死为ID
+ {
+ label: '',
+ field: 'id',
+ component: 'Input',
+ show: false,
+ },
+];
diff --git a/src/views/kc/kcTingke/KcTingkeList.vue b/src/views/kc/kcTingke/KcTingkeList.vue
new file mode 100644
index 0000000..517f2b6
--- /dev/null
+++ b/src/views/kc/kcTingke/KcTingkeList.vue
@@ -0,0 +1,254 @@
+
+
+
+
+
+
+
+
+ 新增
+ 导出
+ 导入
+
+
+
+
+
+ 删除
+
+
+
+ 批量操作
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 无文件
+ 下载
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/kc/kcTingke/components/KcTingkeForm.vue b/src/views/kc/kcTingke/components/KcTingkeForm.vue
new file mode 100644
index 0000000..d45352e
--- /dev/null
+++ b/src/views/kc/kcTingke/components/KcTingkeForm.vue
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/kc/kcTingke/components/KcTingkeModal.vue b/src/views/kc/kcTingke/components/KcTingkeModal.vue
new file mode 100644
index 0000000..ddde086
--- /dev/null
+++ b/src/views/kc/kcTingke/components/KcTingkeModal.vue
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/views/site/index.vue b/src/views/site/index.vue
index c3be7b9..a663b0b 100644
--- a/src/views/site/index.vue
+++ b/src/views/site/index.vue
@@ -103,11 +103,11 @@
let width = fullWidth; // 宽
if(width<600){
maxClassName.value = {width:"100%"}
- }else if(width>=500&&width<1370){
+ }else if(width>=500&&width<1070){
width = width-300
maxClassName.value = {width:width+"px"}
}else{
- width = 1370
+ width = 1070
maxClassName.value = {width:width+"px"}
}
})()
@@ -117,11 +117,11 @@
onMounted(() => {
var width = window.screen.width * window.devicePixelRatio;
console.log(`🚀 ~ file: index.vue:104 ~ onMounted ~ width:`, width)
- if(width<1370){
+ if(width<1070){
width = width-200
maxClassName.value = {width:width+"px"}
}else{
- width = 1370
+ width = 1070
maxClassName.value = {width:width+"px"}
}
diff --git a/src/views/site/jingCaiGongKaiKe/index.vue b/src/views/site/jingCaiGongKaiKe/index.vue
index 7685c09..bb73f52 100644
--- a/src/views/site/jingCaiGongKaiKe/index.vue
+++ b/src/views/site/jingCaiGongKaiKe/index.vue
@@ -106,9 +106,16 @@ function classFun(index){
return stylecss;
}
function jrkt(item){
- const format = 'yyyy-MM-dd hh:mm:ss';
- var par = {usercode:userStore?.getUserInfo?.username,username:userStore?.getUserInfo?.realname,shijian: dateFormat(new Date(), format),gkkid:item.id}
- saveOrUpdate(par, false) .then((res) => { })
+ console.log(`🚀 ~ file: index.vue:109 ~ jrkt ~ item:`, item)
+ const format = 'yyyy-MM-dd hh:mm:ss';
+ let kssj = Date.parse(item.rq+" "+item.kssj+":00");
+ let jssj = Date.parse(item.rq+" "+item.jssj+":00");
+ let dqsj = Date.parse(dateFormat(new Date(), format));
+ console.log(`🚀 ~ file: index.vue:114 ~ jrkt ~ dqsj:`, kssj,dqsj,jssj)
+ if(kssj<=dqsj && jssj>= dqsj){
+ var par = {usercode:userStore?.getUserInfo?.username,username:userStore?.getUserInfo?.realname,shijian: dateFormat(new Date(), format),gkkid:item.id}
+ saveOrUpdate(par, false) .then((res) => { })
+ }
}
const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
diff --git a/src/views/site/tingKeZuJi/components/viewForm.vue b/src/views/site/tingKeZuJi/components/viewForm.vue
index 8021f51..3717452 100644
--- a/src/views/site/tingKeZuJi/components/viewForm.vue
+++ b/src/views/site/tingKeZuJi/components/viewForm.vue
@@ -69,6 +69,7 @@ const { createMessage } = useMessage();
const route = useRoute();
function view(record){
+ console.log(`🚀 ~ file: viewForm.vue:72 ~ view ~ record:`, record)
console.log(route.query);
let params = { pageSize: -1, status: 0, column: 'ordernum', order: 'asc' }
diff --git a/src/views/site/tingKeZuJi/list.vue b/src/views/site/tingKeZuJi/list.vue
index d0826b9..f3e4bee 100644
--- a/src/views/site/tingKeZuJi/list.vue
+++ b/src/views/site/tingKeZuJi/list.vue
@@ -1,6 +1,6 @@
-
+
@@ -50,6 +50,7 @@
+
@@ -58,6 +59,7 @@
import { ref, onMounted, watch, createVNode,h } from 'vue';
import { TeamOutlined, FormOutlined } from '@ant-design/icons-vue';
import { getUserId,getSysConfig } from '/@/views/site/utils/index';
+ import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import addModalPage from '/@/views/site/tingKeZuJi/components/addModal.vue';
import viewModalPage from '/@/views/site/tingKeZuJi/components/viewModal.vue';
@@ -66,17 +68,22 @@ import { defHttp } from '/@/utils/http/axios';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined,CheckOutlined,CloseOutlined } from '@ant-design/icons-vue';
enum Api {
- list = '/kcTingke/kcTingke/findTingKeZuJiBytingketimeAndUserId',
-
+ list = '/kcTingke/kcTingke/indexListPage',
listTkjl = '/kcTingke/kcTingke/findTingKeZuJiBytingketimeAndUserId'
}
const tingKeZuJiAddModal = ref();
const viewModal = ref();
const fwdtModal = ref();
+const current = ref(0);
+const total = ref(2);
+const loadingList = ref(false);
+
+const APagination = Pagination;
const props = defineProps({
queryParam: { type: Object, default: () => ({}) },
+ flagPage: { type:Boolean,default:false}
});
/**
@@ -130,14 +137,29 @@ function txpjFun(item){
}
function init() {
- console.log('init');
- listApi({ userid: getUserId(), tingketime: getSysConfig().bxqkssj, ...props.queryParam }).then(res => {
- list.value = res ?? [];
+ loadData()
+}
+function loadData(){
+ loadingList.value = true
+ console.log(`🚀 ~ file: list.vue:139 ~ listApi ~ props.queryParam:`, props.queryParam)
+ listApi({ userid: getUserId(), ...props.queryParam }).then(res => {
+ total.value = res.total;
+ current.value = res.current;
+ list.value = res.records
+ loadingList.value = false
+ // props.queryParam.value = res.total;
});
}
+function handlePageChange(record){
+ console.log(`🚀 ~ file: list.vue:150 ~ handlePageChange ~ record:`, record)
+ props.queryParam.pageNo=record
+ loadData();
+}
+
+
function onSearch() {
- init();
+ loadData();
}
defineExpose({
diff --git a/src/views/site/tingKeZuJi/more.vue b/src/views/site/tingKeZuJi/more.vue
index 6f1eeb5..c864891 100644
--- a/src/views/site/tingKeZuJi/more.vue
+++ b/src/views/site/tingKeZuJi/more.vue
@@ -40,7 +40,7 @@
-
+
@@ -60,7 +60,7 @@ import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectT
import { getSysConfig } from '/@/views/site/utils/index';
import { dateFormat } from '/@/utils/common/compUtils';
-const queryParam = ref({ startDate: getSysConfig().bxqkssj, endDate: '', pj: '', pageSize: -1 });
+const queryParam = ref({ startDate: getSysConfig().bxqkssj, endDate: '', pj: '', pageSize: 10,pageNo:1 });
//进入就加载
onMounted(() => {