diff --git a/src/utils/download.js b/src/utils/download.js new file mode 100644 index 0000000..8760449 --- /dev/null +++ b/src/utils/download.js @@ -0,0 +1,70 @@ +function myBrowser() { + var userAgent = navigator.userAgent; // 取得浏览器的userAgent字符串 + var isOpera = userAgent.indexOf('Opera') > -1; + if (isOpera) { + return 'Opera'; + } // 判断是否Opera浏览器 + if (userAgent.indexOf('Firefox') > -1) { + return 'FF'; + } // 判断是否Firefox浏览器 + if (userAgent.indexOf('Chrome') > -1) { + return 'Chrome'; + } + if (userAgent.indexOf('Safari') > -1) { + return 'Safari'; + } // 判断是否Safari浏览器 + if (userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1 && !isOpera) { + return 'IE'; + } // 判断是否IE浏览器 + if (userAgent.indexOf('Trident') > -1) { + return 'Edge'; + } // 判断是否Edge浏览器 +} +function SaveAs5(imgURL) { + var oPop = window.open(imgURL, '', 'width=1, height=1, top=5000, left=5000'); + for (; oPop.document.readyState !== 'complete'; ) { + if (oPop.document.readyState === 'complete') break; + } + oPop.document.execCommand('SaveAs'); + oPop.close(); +} +function download(src, fileName) { + // 创建隐藏的可下载链接 + var eleLink = document.createElement('a'); + if (fileName) { + eleLink.setAttribute('download', fileName); + } else { + eleLink.download = src; + } + eleLink.style.display = 'none'; + // // 字符内容转变成blob地址 + eleLink.href = src; + // // 触发点击 + document.body.appendChild(eleLink); + eleLink.click(); + // // 然后移除 + document.body.removeChild(eleLink); +} +function downLoadFile(url, fileName = '') { + if (myBrowser() === 'IE' || myBrowser() === 'Edge') { + SaveAs5(url); + } else { + download(url, fileName); + } +} +function conversionFileDownload(res) { + const a = document.createElement('a'); + const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }); + const temp = res.headers['content-disposition'].split(';')[1].split('filename=')[1]; + // 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码 + const iconv = require('iconv-lite'); + iconv.skipDecodeWarning = true; // 忽略警告 + const fileName = iconv.decode(temp, 'utf-8'); + console.log(fileName); + a.setAttribute('download', fileName); + const objectUrl = URL.createObjectURL(blob); + a.setAttribute('href', objectUrl); + a.click(); +} + +export { downLoadFile, conversionFileDownload }; diff --git a/src/views/cet/cet-ana-1.vue b/src/views/cet/cet-ana-1.vue index cd8e35d..9457ace 100644 --- a/src/views/cet/cet-ana-1.vue +++ b/src/views/cet/cet-ana-1.vue @@ -1,286 +1,461 @@ diff --git a/src/views/cet/cet-ana-2.vue b/src/views/cet/cet-ana-2.vue index 4b33473..0d1f6ef 100644 --- a/src/views/cet/cet-ana-2.vue +++ b/src/views/cet/cet-ana-2.vue @@ -6,217 +6,420 @@ 查询 -
- - -
-
- 学院 / 专业四级通过率变化 -
- 该数据为 - {{ topCollege}} - / {{ topMajor}} - 的四级通过率变化趋势 -
+ + + + + +
+
+ 该数据为 + {{ topCollege }} + / {{ topMajor }} + 的四级通过率变化趋势
-
-
-
-
+ + + +
+
+
+
+ + + + +
+
+ + +
+
+
+
diff --git a/src/views/cet/cet-ana-3.vue b/src/views/cet/cet-ana-3.vue index 0670cee..195427f 100644 --- a/src/views/cet/cet-ana-3.vue +++ b/src/views/cet/cet-ana-3.vue @@ -1,244 +1,448 @@ \ No newline at end of file + .title { + font-size: 20px; + color: rgb(8, 8, 8); + font-weight: bold; + } + .tip { + margin-bottom: 10px; + background-color: #d0e5fe; + opacity: 0.9; + } + diff --git a/src/views/cet/cet-ana-college.vue b/src/views/cet/cet-ana-college.vue index e4a4be3..788193a 100644 --- a/src/views/cet/cet-ana-college.vue +++ b/src/views/cet/cet-ana-college.vue @@ -1,801 +1,448 @@ diff --git a/src/views/cet/cet-ana-major.vue b/src/views/cet/cet-ana-major.vue index 6d0d60a..db9eecd 100644 --- a/src/views/cet/cet-ana-major.vue +++ b/src/views/cet/cet-ana-major.vue @@ -59,10 +59,15 @@ :options="entrydateOptions"> 查询 --> - - + +
-
+
+
+
+ +
+
@@ -71,732 +76,369 @@ diff --git a/src/views/cet/cet-location/CetLocation.data.ts b/src/views/cet/cet-location/CetLocation.data.ts index 8ae7cd9..9320f36 100644 --- a/src/views/cet/cet-location/CetLocation.data.ts +++ b/src/views/cet/cet-location/CetLocation.data.ts @@ -1,24 +1,24 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; +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: 'locationName' - }, + align: 'center', + dataIndex: 'locationName', + }, // { // title: '父节点id', // align:"center", // dataIndex: 'parentLocationId' // }, - { + { title: '考场人数', - align:"center", - dataIndex: 'personNumber' - }, + align: 'center', + dataIndex: 'personNumber', + }, // { // title: '排序号', // align:"center", @@ -47,37 +47,36 @@ export const formSchema: FormSchema[] = [ }, { label: '考场人数', - field: 'personNumber', - component: 'Input', - + field: 'personNumber', + component: 'Input', }, { label: '排序号', field: 'sortNumber', component: 'InputNumber', - show: false + show: false, + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, }, - // TODO 主键隐藏字段,目前写死为ID - { - label: '', - field: 'id', - component: 'Input', - show: false - }, ]; // 高级查询数据 export const superQuerySchema = { - locationName: {title: '存放地名称',order: 0,view: 'text', type: 'string',}, - parentLocationId: {title: '父节点id',order: 1,view: 'text', type: 'string',}, - sortNumber: {title: '排序号',order: 2,view: 'number', type: 'number',}, + locationName: { title: '存放地名称', order: 0, view: 'text', type: 'string' }, + parentLocationId: { title: '父节点id', order: 1, view: 'text', type: 'string' }, + sortNumber: { title: '排序号', order: 2, view: 'number', type: 'number' }, }; /** -* 流程表单调用这个方法获取formSchema -* @param param -*/ -export function getBpmFormSchema(_formData): FormSchema[]{ + * 流程表单调用这个方法获取formSchema + * @param param + */ +export function getBpmFormSchema(_formData): FormSchema[] { // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema return formSchema; -} \ No newline at end of file +} diff --git a/src/views/cet/cet-location/CetLocationList.vue b/src/views/cet/cet-location/CetLocationList.vue index cd012b1..95749a3 100644 --- a/src/views/cet/cet-location/CetLocationList.vue +++ b/src/views/cet/cet-location/CetLocationList.vue @@ -1,206 +1,203 @@ - \ No newline at end of file + diff --git a/src/views/cet/cet-location/components/CetLocationForm.vue b/src/views/cet/cet-location/components/CetLocationForm.vue index a715383..ccd1637 100644 --- a/src/views/cet/cet-location/components/CetLocationForm.vue +++ b/src/views/cet/cet-location/components/CetLocationForm.vue @@ -1,70 +1,70 @@ \ No newline at end of file + return true; + }); + + let formData = {}; + const queryByIdUrl = '/CET/cetLocation/queryById'; + async function initFormData() { + let params = { code: props.formData.dataId }; + const data = await defHttp.get({ url: queryByIdUrl, params }); + formData = { ...data }; + //设置表单的值 + await setFieldsValue(formData); + //默认是禁用 + await setProps({ disabled: formDisabled.value }); + } + + async function submitForm() { + let data = getFieldsValue(); + let params = Object.assign({}, formData, data); + console.log('表单数据', params); + await saveOrUpdate(params, true); + } + + initFormData(); + + return { + registerForm, + formDisabled, + submitForm, + }; + }, + }); + diff --git a/src/views/cet/cet-student-query.vue b/src/views/cet/cet-student-query.vue index ef222fb..6c77eba 100644 --- a/src/views/cet/cet-student-query.vue +++ b/src/views/cet/cet-student-query.vue @@ -6,8 +6,8 @@ - - + + 查询 @@ -23,7 +23,7 @@ 学生姓名:{{ tableData[tableData.length - 1]?.name }}
- 学生学号:{{ tableData[tableData.length - 1]?.id }} + 学生学号:{{ tableData[tableData.length - 1]?.code }} 所在学院:{{ tableData[tableData.length - 1]?.college }} @@ -46,12 +46,12 @@ import type { Rule } from 'ant-design-vue/es/form'; interface FormState { name: string; - id: string; + code: string; } const search: UnwrapRef = reactive({ name: '', - id: '', + code: '', }); const isShow = ref(false); const loading = ref(false); @@ -90,7 +90,7 @@ ]); const rules: Record = { name: [{ required: true, message: '请输入学生姓名', trigger: 'change' }], - id: [{ required: true, message: '请输入学生学号', trigger: 'change' }], + code: [{ required: true, message: '请输入学生学号', trigger: 'change' }], }; const url = ref({ getData: '/cet_4/getDataByStudent', @@ -116,7 +116,7 @@ }; const handleClear = () => { search.name = ''; - search.id = ''; + search.code = ''; isShow.value = false; tableData.value = []; }; diff --git a/src/views/cet/cet-student/Cet4Major.api.ts b/src/views/cet/cet-student/Cet4Major.api.ts new file mode 100644 index 0000000..aff90b2 --- /dev/null +++ b/src/views/cet/cet-student/Cet4Major.api.ts @@ -0,0 +1,72 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/com/cet4Major/list', + save='/com/cet4Major/add', + edit='/com/cet4Major/edit', + deleteOne = '/com/cet4Major/delete', + deleteBatch = '/com/cet4Major/deleteBatch', + importExcel = '/com/cet4Major/importExcel', + exportXls = '/com/cet4Major/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/cet/cet-student/Cet4Major.data.ts b/src/views/cet/cet-student/Cet4Major.data.ts new file mode 100644 index 0000000..f2805ca --- /dev/null +++ b/src/views/cet/cet-student/Cet4Major.data.ts @@ -0,0 +1,103 @@ +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: '年级', + dataIndex: 'entrydate', + key: 'entrydate', + align: 'center', + }, + { + title: '学生人数', + dataIndex: 'studentNumber', + key: 'studentNumber', + align: 'center', + }, +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = []; + +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: 'name', + field: 'name', + component: 'Input', + }, + { + label: 'college', + field: 'college', + component: 'Input', + }, + { + label: 'majorId', + field: 'majorId', + component: 'Input', + }, + { + label: 'majorname', + field: 'majorname', + component: 'Input', + }, + { + label: 'className', + field: 'className', + component: 'Input', + }, + { + label: 'educate', + field: 'educate', + component: 'Input', + }, + { + label: 'entrydate', + field: 'entrydate', + component: 'Input', + }, + { + label: 'campus', + field: 'campus', + component: 'Input', + }, + { + label: 'state', + field: 'state', + component: 'Input', + }, + { + label: 'level', + field: 'level', + component: 'Input', + }, + { + label: 'category', + field: 'category', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + name: { title: 'name', order: 0, view: 'text', type: 'string' }, + college: { title: 'college', order: 1, view: 'text', type: 'string' }, + majorId: { title: 'majorId', order: 2, view: 'text', type: 'string' }, + majorname: { title: 'majorname', order: 3, view: 'text', type: 'string' }, + className: { title: 'className', order: 4, view: 'text', type: 'string' }, + educate: { title: 'educate', order: 5, view: 'text', type: 'string' }, + entrydate: { title: 'entrydate', order: 6, view: 'text', type: 'string' }, + campus: { title: 'campus', order: 7, view: 'text', type: 'string' }, + state: { title: 'state', order: 8, view: 'text', type: 'string' }, + level: { title: 'level', order: 9, view: 'text', type: 'string' }, + category: { title: 'category', order: 10, view: 'text', type: 'string' }, +}; diff --git a/src/views/cet/cet-student/Cet4MajorList.vue b/src/views/cet/cet-student/Cet4MajorList.vue new file mode 100644 index 0000000..bac8fd6 --- /dev/null +++ b/src/views/cet/cet-student/Cet4MajorList.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/src/views/cet/cet-student/components/Cet4MajorForm.vue b/src/views/cet/cet-student/components/Cet4MajorForm.vue new file mode 100644 index 0000000..31f15f1 --- /dev/null +++ b/src/views/cet/cet-student/components/Cet4MajorForm.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/src/views/cet/cet-student/components/Cet4MajorModal.vue b/src/views/cet/cet-student/components/Cet4MajorModal.vue new file mode 100644 index 0000000..1abe807 --- /dev/null +++ b/src/views/cet/cet-student/components/Cet4MajorModal.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/src/views/cet/data-import/cet4-data-import.vue b/src/views/cet/data-import/cet4-data-import.vue new file mode 100644 index 0000000..cd0efa0 --- /dev/null +++ b/src/views/cet/data-import/cet4-data-import.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/src/views/cet/data-import/cet6-data-import.vue b/src/views/cet/data-import/cet6-data-import.vue new file mode 100644 index 0000000..044f9b6 --- /dev/null +++ b/src/views/cet/data-import/cet6-data-import.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/src/views/cet/data-import/dataImportApi.ts b/src/views/cet/data-import/dataImportApi.ts new file mode 100644 index 0000000..7f66485 --- /dev/null +++ b/src/views/cet/data-import/dataImportApi.ts @@ -0,0 +1,9 @@ +import { defHttp } from '/@/utils/http/axios'; + +export function downloadTemplateExcel() { + return defHttp.request({ + url: '/cetDataImport/downloadTemplate', + method: 'post', + responseType: 'blob', + }); +} diff --git a/src/views/dashboard/Analysis/index.vue b/src/views/dashboard/Analysis/index.vue index a4d993f..f391cbe 100644 --- a/src/views/dashboard/Analysis/index.vue +++ b/src/views/dashboard/Analysis/index.vue @@ -3,42 +3,43 @@ - + -
-
- 当前数据为 - {{ topCollege }} - / {{ topMajor }} - - {{ topEntrydate }} - 级数据 +
+
+ 当前数据为 + {{ topCollege }} + / {{ topMajor }} + + {{ topEntrydate }} + 级数据
- -