修改路由

This commit is contained in:
yangjun 2024-05-07 09:57:47 +08:00
parent 426450f48f
commit bfe20c4cb7
13 changed files with 1005 additions and 198 deletions

View File

@ -23,16 +23,6 @@
const { rwbh } = query;//
let router = useRouter();
function getGzt(type){
console.log(`🚀 ~ getGzt ~ type:`, type)
// var href = "/site/dqkcDetail";
var href = "/site/dqkcDqzy";
if(type=='dqzy'){
href = "/site/dqkcDqzy";
}
router.push(href);
}
//
onMounted(() => {

View File

@ -38,16 +38,6 @@
const { rwbh } = query;//
let router = useRouter();
function getGzt(type){
console.log(`🚀 ~ getGzt ~ type:`, type)
// var href = "/site/dqkcDetail";
var href = "/site/dqkcDqzy";
if(type=='dqzy'){
href = "/site/dqkcDqzy";
}
router.push(href);
}
//
onMounted(() => {

View File

@ -4,7 +4,7 @@
<a-col :span="24">
<a-menu
v-model:selectedKeys="selectedKeys"
style="width: 200px;min-height: calc(100vh - 150px);"
style="width: 98%;min-height: calc(100vh - 130px);margin: 10px 0;"
mode="inline"
>
<a-sub-menu key="sub1">
@ -62,7 +62,7 @@
if(type=='dqzy'){
href = "/zy/dqkcDqzy";
}
router.push(href);
router.push({path:href,query: {rwbh}});
}
//

View File

@ -41,9 +41,6 @@
<a-button type="primary" @click="handleNeiwang">上传并查重</a-button>
<a-button type="primary" @click="handleNwcxjcjg" style="margin-left: 8px;">查询检测结果</a-button>
<!-- <a-button type="primary" @click="handleNeiwang" style="margin-left: 8px;">内网保存</a-button>
<a-button type="primary" @click="handleNwtj" style="margin-left: 8px;">内网提交</a-button>
<a-button type="primary" @click="handleNwcxjcjg" style="margin-left: 8px;">内网查询检测结果</a-button> -->
</a-col>
<a-col :span="24">
<a-form-item label="检测文章" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
@ -71,9 +68,6 @@
<a-col :span="12">
<a-button type="primary" @click="handleAigc">上传并查重</a-button>
<a-button type="primary" @click="handleAigccxjcjg" style="margin-left: 8px;">查询检测结果</a-button>
<!-- <a-button type="primary" @click="handleAigc" style="margin-left: 8px;">aigc保存</a-button>
<a-button type="primary" @click="handleAigcTj" style="margin-left: 8px;">aigc提交</a-button>
<a-button type="primary" @click="handleAigccxjcjg" style="margin-left: 8px;">AIGC查询检测结果</a-button> -->
</a-col>
<a-col :span="24">
<a-form-item label="检测文章" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
@ -99,16 +93,7 @@
</a-col>
<a-col :span="12">
<a-button type="primary" @click="handleImagePic">上传并检测</a-button>
<!-- <a-button type="primary" @click="handleAigccxjcjg" style="margin-left: 8px;">查询检测结果</a-button> -->
<!-- <a-button type="primary" @click="handleAigc" style="margin-left: 8px;">aigc保存</a-button>
<a-button type="primary" @click="handleAigcTj" style="margin-left: 8px;">aigc提交</a-button>
<a-button type="primary" @click="handleAigccxjcjg" style="margin-left: 8px;">AIGC查询检测结果</a-button> -->
</a-col>
<!-- <a-col :span="24">
<a-form-item label="检测文章" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-input v-model:value="formData.aigcpaperid" style="width:200px;"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="24">
<a-form-item label="返回结果" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<div v-html="formData.facecontent"></div>
@ -138,20 +123,6 @@
</a-row>
</a-card>
</a-col>
<!-- <a-col :span="24">
<a-card title="外网检测">
<a-button type="primary" @click="handleNeiwang" style="margin-left: 8px;">内网保存</a-button>
<a-button type="primary" @click="handleNwtj" style="margin-left: 8px;">内网提交</a-button>
<a-button type="primary" @click="handleNwcxjcjg" style="margin-left: 8px;">内网查询检测结果</a-button>
</a-card>
</a-col>
<a-col :span="24">
<a-card title="AIGC 检测">
<a-button type="primary" @click="handleAigc" style="margin-left: 8px;">aigc保存</a-button>
<a-button type="primary" @click="handleAigcTj" style="margin-left: 8px;">aigc提交</a-button>
<a-button type="primary" @click="handleAigccxjcjg" style="margin-left: 8px;">AIGC查询检测结果</a-button>
</a-card>
</a-col> -->
</a-row>
</a-form>
</a-spin>
@ -192,7 +163,6 @@
confirmLoading.value = true;
console.log('sub--->',formData);
defHttp.post({ url: '/blZycc/blZycc/zyccUpload', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
formData.paperid = res.paperid;
formData.content = res.message;
confirmLoading.value = false;
@ -201,14 +171,12 @@
//
function handleWwtj(){
defHttp.post({ url: '/blZycc/blZycc/wwKsjc', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
});
}
//
function handleWwcxjcjg(){
confirmLoading.value = true;
defHttp.post({ url: '/blZycc/blZycc/wwCxjcjg', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
var resHtml = "";
if(res.filestateid=='0'){
resHtml = resHtml+"检测状态:未检测<br/>";
@ -244,7 +212,6 @@
function handleNeiwang() {
confirmLoading.value = true;
defHttp.post({ url: '/blZycc/blZycc/xfwbdUpload', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
formData.xnpaperid = res.paperid;
formData.xncontent = res.message;
confirmLoading.value = false;
@ -253,14 +220,12 @@
//
function handleNwtj(){
defHttp.post({ url: '/blZycc/blZycc/xfwbdKsjc', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
});
}
//
function handleNwcxjcjg(){
confirmLoading.value = true;
defHttp.post({ url: '/blZycc/blZycc/xfwbdCxjcjg', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
var resHtml = "";
if(res.filestateid=='0'){
resHtml = resHtml+"检测状态:未检测<br/>";
@ -297,7 +262,6 @@
function handleAigc() {
confirmLoading.value = true;
defHttp.post({ url: '/blZycc/blZycc/aigcUpload', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
formData.aigcpaperid = res.paperid;
formData.aigccontent = res.message;
confirmLoading.value = false;
@ -306,14 +270,12 @@
//AIGC
function handleAigcTj(){
defHttp.post({ url: '/blZycc/blZycc/aigcKsjc', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
});
}
//AIGC
function handleAigccxjcjg(){
confirmLoading.value = true;
defHttp.post({ url: '/blZycc/blZycc/aigcCxjcjg', params: formData, }).then((res) => {
console.log(`🚀 ~ saveOrUpdate ~ res:`, res)
var resHtml = "";
if(res.filestateid=='0'){
resHtml = resHtml+"检测状态:未检测<br/>";

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/zyCcjg/zyCcjg/list',
save='/zyCcjg/zyCcjg/add',
edit='/zyCcjg/zyCcjg/edit',
deleteOne = '/zyCcjg/zyCcjg/delete',
deleteBatch = '/zyCcjg/zyCcjg/deleteBatch',
importExcel = '/zyCcjg/zyCcjg/importExcel',
exportXls = '/zyCcjg/zyCcjg/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 });
}

View File

@ -0,0 +1,187 @@
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: 'zyStuId'
},
{
title: '报告编号',
align: "center",
dataIndex: 'paperguid'
},
{
title: '文件名',
align: "center",
dataIndex: 'papertitle'
},
{
title: '检测状态(1:检测中,2:检测完成,3:检测失败,0:未检测)',
align: "center",
dataIndex: 'filestateid'
},
{
title: '检测进度',
align: "center",
dataIndex: 'detectprogress'
},
{
title: '相似率',
align: "center",
dataIndex: 'percentage'
},
{
title: '引用率',
align: "center",
dataIndex: 'quotepercentage'
},
{
title: '复写率',
align: "center",
dataIndex: 'duplicatepercentage'
},
{
title: '自写率',
align: "center",
dataIndex: 'ownpercentage'
},
{
title: '文档检测完成时间',
align: "center",
dataIndex: 'checkdate'
},
{
title: '论文字数',
align: "center",
dataIndex: 'paperword'
},
{
title: '在线报告查看地址',
align: "center",
dataIndex: 'paperviewurl'
},
{
title: '报告下载地址',
align: "center",
dataIndex: 'paperdownurl'
},
{
title: '他引率',
align: "center",
dataIndex: 'otherquoterate'
},
{
title: '自引率',
align: "center",
dataIndex: 'selfquoterate'
},
{
title: '专业术语率',
align: "center",
dataIndex: 'proWordRate'
},
{
title: '查重类型0外网 1内网 2aigc',
align: "center",
dataIndex: 'ccType'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '报告编号',
field: 'paperguid',
component: 'Input',
},
{
label: '文件名',
field: 'papertitle',
component: 'Input',
},
{
label: '检测状态(1:检测中,2:检测完成,3:检测失败,0:未检测)',
field: 'filestateid',
component: 'Input',
},
{
label: '检测进度',
field: 'detectprogress',
component: 'Input',
},
{
label: '相似率',
field: 'percentage',
component: 'Input',
},
{
label: '引用率',
field: 'quotepercentage',
component: 'Input',
},
{
label: '复写率',
field: 'duplicatepercentage',
component: 'Input',
},
{
label: '自写率',
field: 'ownpercentage',
component: 'Input',
},
{
label: '文档检测完成时间',
field: 'checkdate',
component: 'Input',
},
{
label: '论文字数',
field: 'paperword',
component: 'Input',
},
{
label: '在线报告查看地址',
field: 'paperviewurl',
component: 'Input',
},
{
label: '报告下载地址',
field: 'paperdownurl',
component: 'Input',
},
{
label: '他引率',
field: 'otherquoterate',
component: 'Input',
},
{
label: '自引率',
field: 'selfquoterate',
component: 'Input',
},
{
label: '专业术语率',
field: 'proWordRate',
component: 'Input',
},
{
label: '查重类型0外网 1内网 2aigc',
field: 'ccType',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -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>
<!-- 表单区域 -->
<ZyCcjgModal ref="registerModal" @success="handleSuccess"></ZyCcjgModal>
</div>
</template>
<script lang="ts" name="zyCcjg-zyCcjg" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyCcjg.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyCcjg.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyCcjgModal from './components/ZyCcjgModal.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>

View File

@ -0,0 +1,235 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="报告编号" v-bind="validateInfos.paperguid">
<a-input v-model:value="formData.paperguid" placeholder="请输入报告编号" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="文件名
" v-bind="validateInfos.papertitle">
<a-input v-model:value="formData.papertitle" placeholder="请输入文件名
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="检测状态(1:检测中,2:检测完成,3:检测失败,0:未检测)
" v-bind="validateInfos.filestateid">
<a-input v-model:value="formData.filestateid" placeholder="请输入检测状态(1:检测中,2:检测完成,3:检测失败,0:未检测)
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="检测进度" v-bind="validateInfos.detectprogress">
<a-input v-model:value="formData.detectprogress" placeholder="请输入检测进度" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="相似率
" v-bind="validateInfos.percentage">
<a-input v-model:value="formData.percentage" placeholder="请输入相似率
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="引用率" v-bind="validateInfos.quotepercentage">
<a-input v-model:value="formData.quotepercentage" placeholder="请输入引用率" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="复写率" v-bind="validateInfos.duplicatepercentage">
<a-input v-model:value="formData.duplicatepercentage" placeholder="请输入复写率" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="自写率" v-bind="validateInfos.ownpercentage">
<a-input v-model:value="formData.ownpercentage" placeholder="请输入自写率" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="文档检测完成时间
" v-bind="validateInfos.checkdate">
<a-input v-model:value="formData.checkdate" placeholder="请输入文档检测完成时间
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="论文字数
" v-bind="validateInfos.paperword">
<a-input v-model:value="formData.paperword" placeholder="请输入论文字数
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="在线报告查看地址" v-bind="validateInfos.paperviewurl">
<a-input v-model:value="formData.paperviewurl" placeholder="请输入在线报告查看地址" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="报告下载地址
" v-bind="validateInfos.paperdownurl">
<a-input v-model:value="formData.paperdownurl" placeholder="请输入报告下载地址
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="他引率
" v-bind="validateInfos.otherquoterate">
<a-input v-model:value="formData.otherquoterate" placeholder="请输入他引率
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="自引率
" v-bind="validateInfos.selfquoterate">
<a-input v-model:value="formData.selfquoterate" placeholder="请输入自引率
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="专业术语率
" v-bind="validateInfos.proWordRate">
<a-input v-model:value="formData.proWordRate" placeholder="请输入专业术语率
" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="查重类型0外网 1内网 2aigc" v-bind="validateInfos.ccType">
<a-input v-model:value="formData.ccType" placeholder="请输入查重类型0外网 1内网 2aigc" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyCcjg.api';
import { Form } from 'ant-design-vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
paperguid: '',
papertitle: '',
filestateid: '',
detectprogress: '',
percentage: '',
quotepercentage: '',
duplicatepercentage: '',
ownpercentage: '',
checkdate: '',
paperword: '',
paperviewurl: '',
paperdownurl: '',
otherquoterate: '',
selfquoterate: '',
proWordRate: '',
ccType: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<ZyCcjgForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyCcjgForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyCcjgForm from './ZyCcjgForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
@ -14,116 +14,96 @@
<j-dict-select-tag placeholder="请选择类型" v-model:value="queryParam.zyType" dictCode="zy_type"/>
</a-form-item>
</a-col>
<!--<template v-if="toggleSearchStatus">-->
<a-col :lg="8">
<a-form-item label="状态">
<a-input placeholder="请输入状态" v-model:value="queryParam.zyStatus"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="学年学期">
<a-input placeholder="请输入学年学期" v-model:value="queryParam.xnxq"></a-input>
</a-form-item>
</a-col>
<!--</template>-->
<a-col :lg="8">
<a-form-item label="状态">
<j-dict-select-tag placeholder="请选择状态" v-model:value="queryParam.zyStatus" dictCode="zy_status"/>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="学年学期">
<a-input placeholder="请输入学年学期" v-model:value="queryParam.xnxq"></a-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 @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>-->
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd" style="margin-left: 8px"> 新增</a-button>
</a-col>
</span>
</a-col>
</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>
<!-- 表单区域 -->
<a-row>
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 10px 5px ;">
<a-card >
<a-row>
<a-col :span="24" style="font-size: 18px;font-weight: bold;" class="ellipsis" :title="item.title">{{item.title}}</a-col>
<a-col :span="24">类型:{{item.zyType_dictText}}</a-col>
<a-col :span="24">开始时间:{{item.startTime}}</a-col>
<a-col :span="24">结束时间:{{item.endTime}}</a-col>
<a-col :span="24">状态:{{item.zyStatus_dictText}}</a-col>
<a-col :span="24">学年学期:{{item.xnxq}}</a-col>
<a-col :span="24" style="text-align:center;">
<a-button type="primary" @click="handleEdit(item)" style="margin-left:5px;" v-if="item.zyStatus==0">编辑</a-button>
<a-button type="primary" @click="handleFabu(item)" style="margin-left:5px;" v-if="item.zyStatus==0">发布</a-button>
<a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;">详情</a-button>
<a-button type="primary" @click="handleZyxx(item)" style="margin-left:5px;" v-if="item.zyStatus==1||item.zyStatus==2||item.zyStatus==3">作业信息</a-button>
<a-button type="primary" @click="handleShangchuan(item)" style="margin-left:5px;" v-if="item.zyStatus==1||item.zyStatus==2||item.zyStatus==3">上传</a-button>
</a-col>
</a-row>
</a-card>
</a-col>
<a-col :span="24">
<div v-show="tableData.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</div>
<div v-show="tableData.length==0">
<a-empty/>
</div>
</a-col>
</a-row>
<ZyInfoModal ref="registerModal" @success="handleSuccess"></ZyInfoModal>
<ZyInfoStudentListModal ref="ZyInfoStudentListModalPage"></ZyInfoStudentListModal>
<ZyInfoStudentModal ref="ZyInfoStudentModalPage"></ZyInfoStudentModal>
</div>
</template>
<script lang="ts" name="zyInfo-zyInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyInfoModal from './components/ZyInfoModal.vue'
import { ref, reactive, onMounted,unref } from 'vue';
import { list, deleteOne } from './ZyInfo.api';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { useRouter } from 'vue-router';
import ZyInfoModal from './components/ZyInfoModal.vue'
import ZyInfoStudentListModal from '/@/views/zy/zyInfoStudent/ZyInfoStudentListModal.vue'
import ZyInfoStudentModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentModal.vue'
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh } = query;//
const APagination = Pagination;
const { createConfirm,createMessage } = useMessage();
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 ZyInfoStudentListModalPage = ref();
const ZyInfoStudentModalPage = ref();
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(6);
const tableData = ref<any>([]);
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
@ -156,6 +136,18 @@
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
function handleZyxx(record){
ZyInfoStudentListModalPage.value.disableSubmit = true;
ZyInfoStudentListModalPage.value.init(record);
}
function handleShangchuan(record){
ZyInfoStudentModalPage.value.disableSubmit = false;
var param = {mainId:record.id}
ZyInfoStudentModalPage.value.edit(param);
}
/**
* 删除事件
@ -163,50 +155,32 @@
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
async function handleFabu(record){
createConfirm({
iconType: 'warning',
title: '确认发布',
content: '是否发布作业数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
var url = "/zyInfo/zyInfo/edit";
var params = {id:record.id,zyStatus:'1'};
defHttp.post({ url: url, params }).then((res) => {
handleSuccess();
});
}
});
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
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),
}
}
]
}
/**
* 查询
@ -220,13 +194,32 @@
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
//
reload();
}
function reload(){
queryParam.value.pageNo = pageNo;
queryParam.value.pageSize = pageSize;
queryParam.value.rwbh = rwbh;
defHttp.get({ url: '/zyInfo/zyInfo/list', params: queryParam.value }).then(res => {
console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total;
pageNo.value = res.pages;
current.value = res.current;
tableData.value = res.records;
});
}
function handlePageChange(record){
pageNo.value = record;
searchQuery();
}
onMounted(() => {
searchQuery();
});
</script>
@ -247,4 +240,9 @@
text-align: center
}
}
.ellipsis {
overflow: hidden; /* 确保超出容器的内容被裁剪 */
white-space: nowrap; /* 确保文本在一行内显示 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
</style>

View File

@ -14,7 +14,7 @@
</a-col>
<a-col :span="24">
<a-form-item label="描述" v-bind="validateInfos.content" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-input v-model:value="formData.content" placeholder="请输入描述" :disabled="disabled"></a-input>
<a-textarea v-model:value="formData.content" placeholder="请输入描述" :disabled="disabled"></a-textarea>
</a-form-item>
</a-col>
<a-col :span="12">
@ -63,14 +63,19 @@
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted,unref } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyInfo.api';
import { Form } from 'ant-design-vue';
import { useRouter } from 'vue-router';
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh } = query;//
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
@ -82,22 +87,23 @@
const formData = reactive<Record<string, any>>({
id: '',
title: '',
zyType: undefined,
zyType: '0',
content: '',
startTime: '',
endTime: '',
wwcc: undefined,
wwcc: '0',
wwtgl: undefined,
nwcc: undefined,
nwcc: '0',
nwtgl: undefined,
aigccc: undefined,
aigccc: '0',
aigctgl: undefined,
rwbh: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
@ -112,7 +118,7 @@
aigccc: [{ required: true, message: '请输入aigc查重!'},],
aigctgl: [{ required: false}, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},],
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(()=>{
@ -131,7 +137,7 @@
* 新增
*/
function add() {
edit({});
edit({rwbh});
}
/**

View File

@ -68,7 +68,7 @@
</template>
<script lang="ts" name="zyInfoStudent-zyInfoStudent" setup>
import { ref, reactive } from 'vue';
import { ref, reactive,defineExpose } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyInfoStudent.data';
@ -78,6 +78,8 @@
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const queryParam = ref<any>({});
const mainId = ref<string>('');
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
@ -204,10 +206,21 @@
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
queryParam.mainId = mainId;
//
reload();
}
function init(record){
queryParam.value.mainId = record.id;
mainId = record.id;
searchQuery();
}
defineExpose({
init,
});

View File

@ -0,0 +1,64 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<ZyInfoStudentList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyInfoStudentList>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyInfoStudentList from './ZyInfoStudentList.vue'
const title = ref<string>('');
const width = ref<number>(800);
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>