课程简介引用,列表展现调整
This commit is contained in:
parent
e7be1efbb7
commit
fdeaa26782
|
@ -1,76 +1,52 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!--查询区域-->
|
<a-row>
|
||||||
<!--引用表格-->
|
<a-col :span="24" v-for="(item, index) in tableData" :key="index" style="padding:10px;overflow:hidden;border-bottom: 1px solid #f0f0f0;">
|
||||||
<BasicTable @register="registerTable">
|
<div>
|
||||||
<!--插槽:table标题-->
|
<a-row style="padding:10px;line-height: 30px;">
|
||||||
<template #tableTitle>
|
<a-col :span="22">
|
||||||
</template>
|
<span style="font-size: 16px;color: #515151 ;font-weight: bold;">{{item.xqxn}}</span>
|
||||||
<!--操作栏-->
|
</a-col>
|
||||||
<template #action="{ record }">
|
<a-col :span="2">
|
||||||
<TableAction :actions="getTableAction(record)"/>
|
<a-button type="primary" @click="handleEdit(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);">引用</a-button>
|
||||||
</template>
|
</a-col>
|
||||||
<!--字段回显插槽-->
|
</a-row>
|
||||||
<template #htmlSlot="{text}">
|
<a-row style="padding:10px;">
|
||||||
<div v-html="text"></div>
|
<a-col :span="24">
|
||||||
</template>
|
<div style="color: #515151" v-html="item.kcjs"></div>
|
||||||
<!--省市区字段回显插槽-->
|
</a-col>
|
||||||
<!--<template #pcaSlot="{text}">
|
</a-row>
|
||||||
{{ getAreaTextByCode(text) }}
|
</div>
|
||||||
</template>-->
|
</a-col>
|
||||||
<template #fileSlot="{text}">
|
<a-col :span="24" style="padding:10px;">
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<div v-show="tableData.length>0">
|
||||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
|
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
|
||||||
</template>
|
</div>
|
||||||
</BasicTable>
|
<div v-show="tableData.length==0">
|
||||||
<!-- 表单区域 -->
|
<a-empty/>
|
||||||
<ZyJxdgModal ref="registerModal" @success="handleSuccess"></ZyJxdgModal>
|
</div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="zyJxdg-zyJxdg" setup>
|
<script lang="ts" name="zyJxdg-zyJxdg" setup>
|
||||||
import { ref, reactive,unref } from 'vue';
|
import { ref, reactive,unref } from 'vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
|
||||||
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'
|
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const APagination = Pagination;
|
||||||
const registerModal = ref();
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const { query } = unref(currentRoute);
|
const { query } = unref(currentRoute);
|
||||||
const { rwbh,xqxn } = query;//获取传递参数
|
const { rwbh,xqxn } = query;//获取传递参数
|
||||||
const queryParam = ref<any>({ rwbh,xqxn });
|
const queryParam = ref<any>({ rwbh,xqxn });
|
||||||
//注册table数据
|
const current = ref<number>(1);
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const total = ref<number>(0);
|
||||||
tableProps: {
|
const pageNo = ref<number>(0);
|
||||||
title: '教学大纲',
|
const pageSize = ref<number>(5);
|
||||||
api: list,
|
const tableData = ref<any>([]);
|
||||||
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({
|
const labelCol = reactive({
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 7 },
|
sm: { span: 7 },
|
||||||
|
@ -80,90 +56,32 @@
|
||||||
sm: { span: 16 },
|
sm: { span: 16 },
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增事件
|
|
||||||
*/
|
|
||||||
function handleAdd() {
|
|
||||||
registerModal.value.disableSubmit = false;
|
|
||||||
registerModal.value.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑事件
|
* 编辑事件
|
||||||
*/
|
*/
|
||||||
function handleEdit(record: Recordable) {
|
function handleEdit(record: Recordable) {
|
||||||
// registerModal.value.disableSubmit = false;
|
defHttp.post({url: '/zyJxdg/zyJxdg/editJxdgyy', params: {kcjs:record.kcjs,rwbh,xqxn }}).then(res => { });
|
||||||
// registerModal.value.edit(record);
|
}
|
||||||
defHttp.post({url: '/zyJxdg/zyJxdg/editJxdgyy', params: {kcjs:record.kcjs,rwbh,xqxn }}).then(res => {
|
|
||||||
console.log(`🚀 ~ defHttp.post ~ res:`, res)
|
|
||||||
|
|
||||||
|
function reload(){
|
||||||
|
queryParam.value.pageNo = current.value;
|
||||||
|
queryParam.value.pageSize = pageSize.value;
|
||||||
|
queryParam.value.rwbh = rwbh;
|
||||||
|
queryParam.value.xqxn = xqxn;
|
||||||
|
defHttp.get({ url: '/zyJxdg/zyJxdg/list', params: queryParam.value }).then(res => {
|
||||||
|
total.value = res.total;
|
||||||
|
pageNo.value = res.pages;
|
||||||
|
current.value = res.current;
|
||||||
|
tableData.value = res.records;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
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() {
|
function searchQuery() {
|
||||||
reload();
|
total.value = 1;
|
||||||
|
handlePageChange(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,15 +89,20 @@
|
||||||
*/
|
*/
|
||||||
function searchReset() {
|
function searchReset() {
|
||||||
queryParam.value = {};
|
queryParam.value = {};
|
||||||
selectedRowKeys.value = [];
|
queryParam.value.rwbh = rwbh;
|
||||||
//刷新数据
|
queryParam.value.xqxn = xqxn;
|
||||||
reload();
|
total.value = 1;
|
||||||
|
handlePageChange(1);
|
||||||
}
|
}
|
||||||
function init(record){
|
|
||||||
console.log(`🚀 ~ init ~ record:`, record)
|
function handlePageChange(record){
|
||||||
|
current.value = record;
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function init(record){
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
init,
|
init,
|
||||||
|
@ -190,6 +113,7 @@
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.jeecg-basic-table-form-container {
|
.jeecg-basic-table-form-container {
|
||||||
|
padding: 0;
|
||||||
.table-page-search-submitButtons {
|
.table-page-search-submitButtons {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
|
|
|
@ -9,19 +9,18 @@ ZyJxdgList<template>
|
||||||
import ZyJxdgList from './ZyJxdgList.vue'
|
import ZyJxdgList from './ZyJxdgList.vue'
|
||||||
|
|
||||||
const title = ref<string>('');
|
const title = ref<string>('');
|
||||||
const width = ref<string>('80%');
|
const width = ref<string>('50%');
|
||||||
const visible = ref<boolean>(false);
|
const visible = ref<boolean>(false);
|
||||||
const disableSubmit = ref<boolean>(false);
|
const disableSubmit = ref<boolean>(false);
|
||||||
const registerForm = ref();
|
const registerForm = ref();
|
||||||
const emit = defineEmits(['register', 'success']);
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
* @param record
|
* @param record
|
||||||
*/
|
*/
|
||||||
function init(record) {
|
function init(record) {
|
||||||
title.value = '引用';
|
title.value = '课程简介引用';
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
registerForm.value.init(record);
|
registerForm.value.init(record);
|
||||||
|
|
Loading…
Reference in New Issue