添加学生数据
This commit is contained in:
parent
5cbf6bb3b4
commit
fbbbe3d52e
|
@ -0,0 +1,168 @@
|
|||
<template>
|
||||
<div style="margin-top: 10px;">
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<span style="font-size: 16px;font-weight: bold;">检测情况查询</span>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{ text }">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<!--省市区字段回显插槽-->
|
||||
<template #pcaSlot="{ text }">
|
||||
{{ getAreaTextByCode(text) }}
|
||||
</template>
|
||||
<template #fileSlot="{ text }">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<KcDetectionMainModal @register="registerModal" @success="handleSuccess"></KcDetectionMainModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="detection-kcDetectionMain" setup>
|
||||
import { ref, computed, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import KcDetectionMainModal from './components/KcDetectionMainModal.vue'
|
||||
import { columns, searchFormSchema } from './KcDetectionMain.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcDetectionMain.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const queryParam = ref<any>({});
|
||||
//注册model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '教室人数检测-主表',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
//params.column = '',params.order = '';//新生成的默认不带排序
|
||||
params.isSelectKcDetailed = true;
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "教室人数检测-主表",
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
// {
|
||||
// label: '编辑',
|
||||
// onClick: handleEdit.bind(null, record),
|
||||
// }
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
// {
|
||||
// label: '详情',
|
||||
// onClick: handleDetail.bind(null, record),
|
||||
// },
|
||||
// {
|
||||
// label: '删除',
|
||||
// popConfirm: {
|
||||
// title: '是否确认删除',
|
||||
// confirm: handleDelete.bind(null, record),
|
||||
// }
|
||||
// }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
|
@ -0,0 +1,202 @@
|
|||
<template>
|
||||
<div style="margin-top:10px;background:#fff;height:642px;overflow:auto;">
|
||||
<a-card>
|
||||
<div>
|
||||
<a-row>
|
||||
<a-col :span="3" style="font-size: 18px;font-weight: bold;">课程介绍:</a-col>
|
||||
<a-col :span="20">{{jxdgInfo.kcjs}}</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-card>
|
||||
<a-card>
|
||||
<div>
|
||||
<span style="float: left;line-height: 30px; font-size: 18px; font-weight: bold;">教学大纲:</span>
|
||||
<span style="width:300px;float: left;margin-top: 3px;">
|
||||
<span v-if="jxdgInfo.filePath">
|
||||
<a-button :ghost="true" type="primary" preIcon="ant-design:download" size="small" @click="downloadFile(jxdgInfo.filePath)"> 下载 </a-button>
|
||||
</span>
|
||||
<span v-else>暂无内容</span>
|
||||
</span>
|
||||
<span style="float: right;" v-if="jxdgInfo.filePath">
|
||||
<a-button type="primary" style="margin-left:10px;" @click="openPdf(jxdgInfo)">预览</a-button>
|
||||
</span>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<JeecgPdfView/>
|
||||
</div> -->
|
||||
</a-card>
|
||||
<a-card>
|
||||
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
|
||||
<span style="float: left;">常见问题</span>
|
||||
</div>
|
||||
<a-row style="margin-top: 50px;width:100%;display: block;">
|
||||
<a-col :span="24" v-for="(item,index) in cjwtSource" :key="index">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<span style="float: left;">{{index+1}}.{{item.question}}</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-divider />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="cjwtSource.length>0">
|
||||
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="cjwtSource.length==0">
|
||||
<a-empty/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
<a-card>
|
||||
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
|
||||
<span style="float: left;">往届学生评价</span>
|
||||
</div>
|
||||
<studentPjjgTeaList :queryParam="{ pageSize: 3, ...tkzjParam,kcbh:'' }" style="max-height: 106px;"/>
|
||||
</a-card>
|
||||
<ZyCjwtModal ref="ZyCjwtModalPage" @success="handleCjwtOk" />
|
||||
<ZyJxdgListModal ref="ZyJxdgListModalPage" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, unref } from 'vue';
|
||||
import { getUserSf,getSysConfig } from '/@/views/site/utils/index';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Icon } from '/@/components/Icon';
|
||||
import { Pagination, Empty } from 'ant-design-vue';
|
||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||
import { deleteOne } from '/@/views/zy/zyCjwt/ZyCjwt.api';
|
||||
import headerPage from '/@/views/site/common/header.vue';
|
||||
import footerPage from '/@/views/site/common/footer.vue';
|
||||
import studentPjjgTeaList from '/@/views/site/pjjgPage/studentPjjgTeaList.vue';
|
||||
import ZyCjwtModal from '/@/views/zy/zyCjwt/components/ZyCjwtModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import ZyJxdgListModal from '/@/views/zy/zyJxdg/ZyJxdgListModal.vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import JeecgPdfView from '/@/views/demo/jeecg/JeecgPdfView.vue';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
|
||||
const globSetting = useGlobSetting();
|
||||
const baseApiUrl = globSetting.domainUrl;
|
||||
|
||||
//当前路由信息
|
||||
const { currentRoute } = useRouter();
|
||||
const { query } = unref(currentRoute);
|
||||
const { rwbh,xqxn } = query;//获取传递参数
|
||||
const APagination = Pagination;
|
||||
const current = ref<number>(0);
|
||||
const total = ref<number>(0);
|
||||
const pageNo = ref<number>(0);
|
||||
const pageSize = ref<number>(3);
|
||||
const tkzjParam = ref({rwbh:rwbh});
|
||||
const ZyCjwtModalPage = ref();
|
||||
const ZyJxdgListModalPage = ref();
|
||||
const cjwtSource = ref([]);
|
||||
let router = useRouter();
|
||||
const { createMessage } = useMessage();
|
||||
const jxdgInfo = ref({
|
||||
id:'',
|
||||
filePath:'',
|
||||
kcjs:''
|
||||
});
|
||||
|
||||
//引用功能
|
||||
function handleYinyong(){
|
||||
var record = {xqxn,rwbh}
|
||||
ZyJxdgListModalPage.value.disableSubmit = true;
|
||||
ZyJxdgListModalPage.value.init(record);
|
||||
}
|
||||
//常见问题新增
|
||||
function addCjwtHanle(){
|
||||
var params = { rwbh:rwbh,xqxn:xqxn };
|
||||
ZyCjwtModalPage.value.disableSubmit = false;
|
||||
ZyCjwtModalPage.value.add(params);
|
||||
}
|
||||
/**
|
||||
* 常见问题编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
ZyCjwtModalPage.value.disableSubmit = false;
|
||||
ZyCjwtModalPage.value.edit(record);
|
||||
}
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleCjwtOk);
|
||||
}
|
||||
|
||||
function openPdf(record){
|
||||
var url2 = getFileAccessHttpUrl(record.filePath)
|
||||
console.log(`🚀 ~ openPdf ~ url2:`, url2)
|
||||
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
|
||||
window.open(url,"_blank")
|
||||
}
|
||||
|
||||
|
||||
//常见问题回调刷新
|
||||
function handleCjwtOk() {
|
||||
console.log('--------cjwt ok -----------')
|
||||
cjwtData(1);
|
||||
}
|
||||
|
||||
//常见问题新增翻页
|
||||
function handlePageChange(page: number) {
|
||||
cjwtData(page);
|
||||
}
|
||||
|
||||
function cjwtData(arg){
|
||||
defHttp.get({ url: '/zyCjwt/zyCjwt/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn } }).then((res) => {
|
||||
console.log(`🚀 ~ defHttp.get ~ res:`, res)
|
||||
cjwtSource.value = res.records;
|
||||
console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource)
|
||||
});
|
||||
}
|
||||
//获取课程介绍和教学大纲内容
|
||||
function getKcjsJxdg(){
|
||||
defHttp.get({ url: '/zyJxdg/zyJxdg/getKcjsJxdg', params: { rwbh:rwbh} }).then((res) => {
|
||||
console.log(`🚀 1111111111111~ getKcjsJxdg ~ res:`, res)
|
||||
if(res){
|
||||
jxdgInfo.value = res;
|
||||
}
|
||||
});
|
||||
}
|
||||
function addKcjsHandle(type){
|
||||
const isUpdate = true;
|
||||
var model = jxdgInfo.value;
|
||||
model.rwbh = rwbh;
|
||||
model.xqxn = xqxn;
|
||||
console.log(`🚀 ~ addKcjsHandle ~ model:`, model)
|
||||
if(model.id){
|
||||
if(type=='1'){
|
||||
model.filePath = '';
|
||||
}
|
||||
defHttp.post({ url: '/zyJxdg/zyJxdg/edit', params: model }).then((res) => {
|
||||
console.log(`🚀 ~ defHttp.post 111~ res:`, res)
|
||||
getKcjsJxdg();
|
||||
});
|
||||
}else{
|
||||
if(type=='1'){
|
||||
model.filePath = '';
|
||||
}
|
||||
defHttp.post({ url: '/zyJxdg/zyJxdg/add', params: model }).then((res) => {
|
||||
console.log(`🚀 ~ defHttp.post 222~ res:`, res)
|
||||
getKcjsJxdg();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
//进入就加载
|
||||
onMounted(() => {
|
||||
getKcjsJxdg();
|
||||
cjwtData(1);
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
</style>
|
|
@ -0,0 +1,144 @@
|
|||
<template>
|
||||
<div style="background: #fff;height:642px;margin-top:10px;">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24" style="margin-top: 10px;">
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="标题">
|
||||
<j-input placeholder="请输入标题" v-model:value="queryParam.title"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<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>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<a-row>
|
||||
<a-col :span="24" v-for="(item,index) in dataSource" style="padding: 5px 10px;">
|
||||
<a-collapse expand-icon-position="right">
|
||||
<a-collapse-panel :key="index" >
|
||||
<template #header>
|
||||
<sapn style="font-size: 16px; font-weight: bold;">{{index+1}}.{{item.title}}</sapn>
|
||||
|
||||
</template>
|
||||
<div v-html="item.content"></div>
|
||||
<!-- <setting-outlined /> -->
|
||||
<template #extra>
|
||||
<sapn>【{{item.createTime}}】</sapn>
|
||||
<sapn style="margin-left: 30px;">详情</sapn>
|
||||
</template>
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="dataSource.length>0" style="margin-top:10px;">
|
||||
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="dataSource.length==0" style="margin-top:10px;">
|
||||
<a-empty/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="zyGonggao-zyGonggao" setup>
|
||||
import { ref, reactive, unref, onMounted } from 'vue';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { JInput } from '/@/components/Form';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
const APagination = Pagination;
|
||||
const { currentRoute } = useRouter();
|
||||
const { query } = unref(currentRoute);
|
||||
const { rwbh,xqxn } = query;//获取传递参数
|
||||
const queryParam = ref<any>({rwbh, xqxn ,ggStatus:'1'});
|
||||
const current = ref<number>(0);
|
||||
const total = ref<number>(0);
|
||||
const pageNo = ref<number>(0);
|
||||
const pageSize = ref<number>(10);
|
||||
const dataSource = ref([]);
|
||||
//注册table数据
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 },
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
queryParam.value = {};
|
||||
queryParam.value.rwbh = rwbh;
|
||||
queryParam.value.xqxn = xqxn;
|
||||
queryParam.value.ggStatus='1';
|
||||
//刷新数据
|
||||
reload(1);
|
||||
}
|
||||
|
||||
//翻页
|
||||
function handlePageChange(page: number) {
|
||||
reload(page);
|
||||
}
|
||||
//进入就加载
|
||||
onMounted(() => {
|
||||
reload(1);
|
||||
});
|
||||
|
||||
function reload(arg){
|
||||
queryParam.pageNo = arg;
|
||||
console.log(`🚀 ~ reload ~ queryParam:`, queryParam)
|
||||
defHttp.get({ url: '/zyGonggao/zyGonggao/list', params: queryParam.value }).then((res) => {
|
||||
console.log(res);
|
||||
dataSource.value = res.records;
|
||||
total.value = res.total;
|
||||
pageNo.value = res.pages;
|
||||
current.value = res.current;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
width: calc(50% - 15px);
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,215 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{text}">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<!--省市区字段回显插槽-->
|
||||
<!--<template #pcaSlot="{text}">
|
||||
{{ getAreaTextByCode(text) }}
|
||||
</template>-->
|
||||
<template #fileSlot="{text}">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<ZyJxdgModal ref="registerModal" @success="handleSuccess"></ZyJxdgModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="zyJxdg-zyJxdg" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './ZyJxdg.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyJxdg.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ZyJxdgModal from './components/ZyJxdgModal.vue'
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '教学大纲',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "教学大纲",
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 },
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
queryParam.value = {};
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
width: calc(50% - 15px);
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,64 @@
|
|||
ZyJxdgList<template>
|
||||
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<ZyJxdgList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyJxdgList>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ZyJxdgList from './ZyJxdgList.vue'
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<string>('80%');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function init(record) {
|
||||
title.value = '引用';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.init(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue