新增脚本,修改模式

This commit is contained in:
bai 2024-07-10 22:30:50 +08:00
parent 66aba75f64
commit cb1acfcde9
13 changed files with 404 additions and 5 deletions

7
jeecgboot-vue3/build.bat Normal file
View File

@ -0,0 +1,7 @@
::@echo off & chcp 65001
call ./changePath.bat
npm run build
echo 压缩
cd dist
tar -zcvf ../dist.tar.gz *
cd ..

View File

@ -0,0 +1,7 @@
::@echo off & chcp 65001
call ./changePath.bat
npm run build --mode development
echo 压缩
cd dist
tar -zcvf ../dist.tar.gz *
cd ..

View File

@ -0,0 +1,25 @@
@echo off & chcp 65001
echo 原node版本
node -v
echo 如果运行错误请设置node版本
if not exist nodePath.txt (
echo 请在项目根目录创建【nodePath.txt】文件并填写jdk路径,文件内容大致为【D:\ProgramGreeFile\nodejs\node-21.2.0】
pause
exit
)
set /P nodePath=<nodePath.txt
if not defined nodePath (
echo 请在项目根目录创建【nodePath.txt】文件并填写jdk路径,文件内容大致为【D:\ProgramGreeFile\nodejs\node-21.2.0】
pause
exit
)
::还原
::if pathBak == '' ( ) else ( set path=%pathBak% )
if "%pathBak%"=="" (echo '跳过重置环境变量') else set path=%pathBak%
set pathBak=%path%
set path2=%nodePath%;%path%
set path=%path2%
echo 现node版本
node -v
echo 开始执行

3
jeecgboot-vue3/clean.bat Normal file
View File

@ -0,0 +1,3 @@
:: @echo off & chcp 65001
call ./changePath.bat
npm run clean

7
jeecgboot-vue3/gxdm.bat Normal file
View File

@ -0,0 +1,7 @@
@echo off
echo 更新前台代码中...
::git.exe pull -v --progress "核心库"
git.exe pull -v --progress "origin"
echo 更新成功
PAUSE
exit

View File

@ -1 +1,3 @@
pnpm install
:: @echo off & chcp 65001
call ./changePath.bat
npm run pinstall

View File

@ -0,0 +1 @@
D:\ProgramGreeFile\nodejs\node-21.2.0

View File

@ -1 +1,3 @@
pnpm dev --mode development
::@echo off & chcp 65001
call ./changePath.bat
npm run dev

View File

@ -0,0 +1,267 @@
<template>
<a-spin :spinning="confirmLoading">
<div style="padding: 20px;">
<a-steps :current="current" size="small">
<a-step title="基本信息" :key="1" />
<a-step title="导入数据" :key="2" />
<a-step title="生成报告" :key="3" />
</a-steps>
<div v-if="current == 0" style="padding: 20px;">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24" class="shuoming">
<span>请注意点击后不可返回修改信息请仔细填写</span>
</a-col>
<a-col :span="24">
<a-form-item label="学校名称" v-bind="validateInfos.schoolName">
<a-input v-model:value="formData.schoolName" placeholder="请输入学校名称" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="评估单位" v-bind="validateInfos.pgdw">
<a-input v-model:value="formData.pgdw" placeholder="请输入评估单位" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="评估日期" v-bind="validateInfos.pgrq">
<a-input v-model:value="formData.pgrq" placeholder="请输入评估日期" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学年" v-bind="validateInfos.xuenian">
<a-input v-model:value="formData.xuenian" placeholder="请输入学年" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="调查时点" v-bind="validateInfos.dysd">
<a-input v-model:value="formData.dysd" placeholder="请输入调查时点" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学生总人数" v-bind="validateInfos.teacherSumno">
<a-input-number
v-model:value="formData.teacherSumno"
placeholder="请输入学生总人数"
style="width: 100%"
></a-input-number>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="最小有效样本数" v-bind="validateInfos.minNum">
<a-input-number
v-model:value="formData.minNum"
placeholder="请输入最小有效样本数"
style="width: 100%"
></a-input-number>
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<div v-if="current == 1" style="padding: 20px;">
<a-col :span="24" class="shuoming">
<span>温馨提示点击导入后选择数据模板进行导入</span>
</a-col>
<span style="text-align: center;">
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls($event, { id: formData.id})">导入</j-upload-button>
</span>
</div>
<div v-if="current == 2" style="padding: 20px;text-align: center;line-height: 100px;">
<div>
<a-spin tip="报告生成中,请等待,生成完成后自动关闭页面...">
</a-spin>
</div>
<span>生成时间预计1分钟</span>
</div>
<div class="steps-action" style="text-align: center;">
<a-button v-if="current == 0" type="primary" @click="submitForm">下一页</a-button>
<!-- <a-button v-if="current > 0" style="margin-left: 8px" @click="prev">返回</a-button> -->
<!-- <a-button v-if="current == 2" type="primary" style="margin-left: 8px" @click="handleWancheng"> 完成 </a-button> -->
</div>
</div>
</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,getImportUrl } from '../BlStuInfo.api';
import { Form } from 'ant-design-vue';
import { useListPage } from '/@/hooks/system/useListPage';
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: '',
schoolName: '',
pgdw: '',
pgrq: '',
xuenian: '',
dysd: '',
teacherSumno: '',
minNum: '',
});
//table
const { onImportXls } = useListPage({
importConfig: {
url: getImportUrl,
success: handleSuccess
},
tableProps: {
title: '学生调研报告',
},
});
const current = ref<number>(0);
const next = () => {
current.value++;
};
const prev = () => {
current.value--;
};
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 = {
schoolName: [{ required: true, message: '请输入学校名称!' }],
pgdw: [{ required: true, message: '请输入评估单位!' }],
pgrq: [{ required: true, message: '请输入评估日期!' }],
xuenian: [{ required: true, message: '请输入学年!' }],
dysd: [{ required: true, message: '请输入调查时点!' }],
teacherSumno: [{ required: true, message: '请输入学生总人数!' }],
minNum: [{ required: true, message: '请输入最小有效样本数!' }],
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
function handleSuccess(){
current.value++;
console.log("参数--------》",{id:formData.id})
defHttp.get({url:'/blStuAnswer/blStuAnswer/createWord',params:{id:formData.id}}).then(res=>{
console.log('---生成报告--->',res);
if(res.code==200||res=='生成成功'){
handleWancheng();
}
})
}
//
function handleWancheng() {
emit('ok');
}
//
const disabled = computed(() => {
if (props.formBpm === true) {
if (props.formData.disabled === false) {
return false;
} else {
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
current.value = 0;
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if (record.hasOwnProperty(key)) {
tmpData[key] = record[key];
}
});
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
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) => {
console.log('------------>',res);
if (res.success) {
createMessage.success("数据保存成功");
current.value++;
formData.value = res.result;
//
Object.assign(formData, res.result);
console.log('-------formData----->',formData);
console.log('-------value----->',formData.value);
// emit('ok');
} else {
createMessage.warning("操作失败");
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
height: 490px !important;
overflow-y: auto;
padding: 14px;
}
.shuoming{
text-align: center;
padding: 20px;
color: red;
font-weight: bold;
font-size: 16px;
}
</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="关闭">
<BlStuInfoV2Form ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></BlStuInfoV2Form>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import BlStuInfoV2Form from './BlStuInfoV2Form.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

@ -26,7 +26,7 @@
<template #tableTitle>
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> -->
<a-button type="primary" @click="handleV2Add" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 下载导入模板</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-switch hidden v-model:checked="reloadCreateBtn" checked-children="显示" un-checked-children="不显示"/>
</template>

View File

@ -9,9 +9,9 @@
<div v-if="current == 0" style="padding: 20px;">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24" class="shuoming">
<!-- <a-col :span="24" class="shuoming">
<span>请注意点击后不可返回修改信息请仔细填写</span>
</a-col>
</a-col> -->
<a-col :span="24">
<a-form-item label="学校名称" v-bind="validateInfos.schoolName">
<a-input v-model:value="formData.schoolName" placeholder="请输入学校名称" ></a-input>

3
jeecgboot-vue3/tbdm.bat Normal file
View File

@ -0,0 +1,3 @@
@echo off
TortoiseGitProc /command:sync /path:"./" /seq:0 /hwnd:0000000000390AF0 x64 TortoiseGitProc.exe
exit