修改bug

This commit is contained in:
yangjun 2024-08-30 10:12:55 +08:00
parent 55937d47d7
commit f456795b3c
5 changed files with 281 additions and 122 deletions

View File

@ -18,16 +18,16 @@
<span class="title">{{jxdgInfo.fbName}}{{jxdgInfo.xqxn}}季学期执行教学大纲</span>
<a-divider />
</a-col>
<a-col
:span="23"
v-for="(item, index) in zyJxdgMainTable.dataSource"
:key="index"
class="borderstyle"
>
<a-col :span="23" v-for="(item, index) in zyJxdgMainTable.dataSource" :key="index" class="borderstyle">
<a-row>
<a-col :span="24" style="height: 40px; line-height: 40px; background-color: #f7fbfa">
<a-col :span="24" style="height: 40px; line-height: 40px; background-color: #f7fbfa; border-radius: 6px">
<span class="title">{{ item.title }}</span>
</a-col>
<a-col :span="24" v-if="item.tsy">
<span class="tishi">
<span>{{ item.tsy }}</span>
</span>
</a-col>
<!-- 单行文本 1 -->
<a-col v-if="item.type === '1'" :span="24" style="margin: 10px">
<span class="Text-Content" v-text="item.content"></span>
@ -41,12 +41,12 @@
<div class="Text-Content" v-html="item.content"></div>
</a-col>
<!-- 固定表单基础信息 4 -->
<a-col v-else-if="item.type === '4'" v-model:value="item.content" :span="24" >
<a-form v-bind="formItemLayout" style="color:#999">
<a-col v-else-if="item.type === '4'" v-model:value="item.content" :span="24">
<a-form v-bind="formItemLayout">
<a-row>
<a-col v-for="(item2, index2) in item.zyJxdgPzxxList" :key="index2" :span="12">
<a-form-item :label="item2.title">
<span v-text="item2.content"></span>
<span class="Text-Content" v-text="item2.content"></span>
</a-form-item>
</a-col>
</a-row>
@ -54,7 +54,7 @@
</a-col>
<!-- 自增表格 5 -->
<a-col v-else-if="item.type === '5'" :span="24">
<a-table :columns="getTableColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false" class="Text-Content">
<a-table :columns="getTableColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false">
<!-- <template #bodyCell="{ column, record }">
<a-input placeholder="请输入内容" v-model:value="record[column.key]" style="width: 80%"></a-input>
</template> -->
@ -87,15 +87,15 @@
<!-- 自增表格 9 -->
<a-col v-else-if="item.type === '9' || item.type === '15'" :span="24">
<a-table :columns="getTableZzColumns2(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false" class="Text-Content"> </a-table>
<a-table :columns="getTableZzColumns2(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false"> </a-table>
</a-col>
<!-- 自增表格两列关联 10 -->
<a-col v-else-if="item.type === '10'" :span="24">
<a-table :columns="getTableZzColumns2(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false" class="Text-Content"> </a-table>
<a-table :columns="getTableZzColumns333(item.zyJxdgPzxxList, item.list)" :dataSource="item.list" :pagination="false"> </a-table>
</a-col>
<!-- 自增表格两列关联 11 -->
<a-col v-else-if="item.type === '11'" :span="24">
<a-table :columns="getTableZzColumns2(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false" class="Text-Content"> </a-table>
<a-table :columns="getTableZzColumns2(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false"> </a-table>
</a-col>
<!-- --------------------------------------20240824------------------------------------------------------ -->
@ -107,8 +107,8 @@
<a-row>
<a-col v-for="(item3, index3) in item2" :span="index3 == 0 ? '5' : '16'" :key="index3">
<!-- -{{ item3 }}- -->
<span style="line-height: 40px; margin-left: 15px;color:#999;" v-if="index3 == 0"> {{ item3.title }} </span>
<span style="line-height: 40px;color:#999;" v-else>
<span style="line-height: 40px; margin-left: 15px" v-if="index3 == 0"> {{ item3.title }}: </span>
<span style="line-height: 40px" v-else>
{{ item3.title }}
</span>
</a-col>
@ -123,10 +123,20 @@
<a-col>
<a-row v-for="(item2, index2) in item.list" :key="index2" class="dhxg">
<a-col v-for="(item3, index3) in item2.list" :key="index3" style="line-height: 40px">
<a-row style="padding: 10px;color:#999;">
<a-col style="text-align: left" :span="7"> {{ item3.title }} </a-col>
<a-col :span="15">
{{ item3.content }}
<a-row style="padding: 5px">
<a-col v-if="index3 == 0 || index3 == 1">
<a-row>
<a-col style="text-align: left" :span="4"> {{ item3.title }}: </a-col>
<a-col :span="15">
{{ item3.content }}
</a-col>
</a-row>
</a-col>
<a-col v-else style="text-align: left" :span="24">
<div> {{ item3.title }}: </div>
<div style="padding: 0 0 0 15px">
{{ item3.content }}
</div>
</a-col>
</a-row>
</a-col>
@ -140,20 +150,15 @@
<a-col v-else-if="item.type === '14'" :span="24">
<a-row>
<a-col>
<a-table :columns="getTableZzColumns2(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false" >
<!-- <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<button @click="handleZzbgDel(item.list, record.sort)" class="ant-btn">删除</button>
</template>
<template v-else>
<a-input
placeholder="请输入内容"
v-model:value="record[column.key]"
@blur="handleTwoGlxm(item)"
style="width: 100%"
></a-input>
</template>
</template> -->
<a-table :columns="getTableZzColumns222(item.zyJxdgPzxxList, item.list)" :dataSource="item.list" :pagination="false">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<div v-for="(item3,index3) in getCglist(record,column.dataIndex,item.zyJxdgPzxxList)" :key="index3">
<span>{{item3.title}}</span>
<span>{{item3.content}}</span>
</div>
</template>
</template>
</a-table>
</a-col>
</a-row>
@ -162,7 +167,6 @@
<!-- --------------------------------------20240824------------------------------------------------------ -->
<a-col v-else> </a-col>
</a-row>
</a-col>
</a-row>
@ -280,6 +284,129 @@ function handleFabu(sffb) {
}
}
//
function getTableZzColumns333(list, datalist) {
const data = datalist;
let columns = reactive<any>([]);
let namePar = '';
for (var i = 0; i < list.length; i++) {
var par = list[i];
var inePar = {
title: par.title,
dataIndex: par.id,
key: par.id,
width: 100,
customCell: (record, index, bhdata) => {
if (bhdata.title == '课程教学目标') {
let nextRecord = data[index + 1];
let rowSpan = 0;
while (nextRecord && nextRecord[bhdata.key] === record[bhdata.key]) {
namePar = nextRecord[bhdata.key];
rowSpan += 1;
nextRecord = data[index + rowSpan];
}
let sizeNum = 0;
for (var i = 0; i < data.length; i++) {
let beforeRecord = data[i];
if (beforeRecord[bhdata.key] === record[bhdata.key]) {
sizeNum += 1;
}
}
if (sizeNum != rowSpan) {
rowSpan = 0;
}
if (sizeNum == 1) {
rowSpan = 1;
}
return {
rowSpan,
};
}
},
};
columns.push(inePar);
}
return columns;
}
function getCglist(record,type,zyJxdgPzxxList){
var nerList: { title: string; content: string; }[] = [];
for (var i = 0; i < zyJxdgPzxxList.length; i++) {
var par = zyJxdgPzxxList[i];
var newType = par.type;
if(newType == type){
var initPar = {title:par.title,content:record[par.id]}
nerList.push(initPar);
}
}
return nerList;
}
//
function getTableZzColumns222(list, datalist) {
const data = datalist;
let columns = reactive<any>([]);
let namePar = '';
var parid3 = '';
for(var j=2;j<list.length;j++){
parid3 = parid3 + list[j].id+",";
}
for (var i = 0; i < 3; i++) {
var par = list[i];
var title = par.title;
var parid = par.id;
if(i==2){
title = '课程评价标准';
var inePar = {
title: title,
dataIndex: "3",
key: 'action',
};
columns.push(inePar);
}else{
var inePar2 = {
title: title,
dataIndex: parid,
key: parid,
width: 150,
customCell: (record, index, bhdata) => {
if (bhdata.title == '课程目标') {
let nextRecord = data[index + 1];
let rowSpan = 0;
while (nextRecord && nextRecord[bhdata.key] === record[bhdata.key]) {
namePar = nextRecord[bhdata.key];
rowSpan += 1;
nextRecord = data[index + rowSpan];
}
let sizeNum = 0;
for (var i = 0; i < data.length; i++) {
let beforeRecord = data[i];
if (beforeRecord[bhdata.key] === record[bhdata.key]) {
sizeNum += 1;
}
}
if (sizeNum != rowSpan) {
rowSpan = 0;
}
if (sizeNum == 1) {
rowSpan = 1;
}
return {
rowSpan,
};
}
},
};
columns.push(inePar2);
}
}
return columns;
}
//
function handleTwoGlxm(item) {
var sfsglxm = item.sfsglxm;
@ -388,6 +515,7 @@ function getTableColumns(list) {
title: par.title,
dataIndex: par.id,
key: par.id,
width: 100,
};
columns.push(inePar);
}
@ -423,6 +551,7 @@ function getTableZzColumns2(list) {
title: par.title,
dataIndex: par.id,
key: par.id,
width: 100,
};
columns.push(inePar);
}

View File

@ -408,7 +408,7 @@
</a-col>
<!-- 自增表格两列关联 10 -->
<a-col v-else-if="item.type === '10'" :span="24">
<a-table :columns="getTableZzColumns2(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false"> </a-table>
<a-table :columns="getTableZzColumns333(item.zyJxdgPzxxList, item.list)" :dataSource="item.list" :pagination="false"> </a-table>
</a-col>
<!-- 自增表格两列关联 11 -->
<a-col v-else-if="item.type === '11'" :span="24">
@ -467,21 +467,15 @@
<a-col v-else-if="item.type === '14'" :span="24">
<a-row>
<a-col>
<!-- -{{ getTableZzColumns222(item.zyJxdgPzxxList, item.list) }}- -->
<a-table :columns="getTableZzColumns222(item.zyJxdgPzxxList, item.list)" :dataSource="item.list" :pagination="false">
<!-- <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<button @click="handleZzbgDel(item.list, record.sort)" class="ant-btn">删除</button>
</template>
<template v-else>
<a-input
placeholder="请输入内容"
v-model:value="record[column.key]"
@blur="handleTwoGlxm(item)"
style="width: 100%"
></a-input>
</template>
</template> -->
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<div v-for="(item3,index3) in getCglist(record,column.dataIndex,item.zyJxdgPzxxList)" :key="index3">
<span>{{item3.title}}</span>
<span>{{item3.content}}</span>
</div>
</template>
</template>
</a-table>
</a-col>
</a-row>
@ -717,6 +711,7 @@ function getTableColumns(list) {
title: par.title,
dataIndex: par.id,
key: par.id,
width: 100,
};
columns.push(inePar);
}
@ -731,6 +726,7 @@ function getTableZzColumns(list) {
title: par.title,
dataIndex: par.id,
key: par.id,
width: 100,
};
columns.push(inePar);
}
@ -752,6 +748,7 @@ function getTableZzColumns2(list) {
title: par.title,
dataIndex: par.id,
key: par.id,
width: 150,
customCell: (_, index) => {
if (index === 2) {
return { rowSpan: 2 };
@ -769,12 +766,86 @@ function getTableZzColumns2(list) {
}
return columns;
}
function getCglist(record,type,zyJxdgPzxxList){
var nerList: { title: string; content: string; }[] = [];
for (var i = 0; i < zyJxdgPzxxList.length; i++) {
var par = zyJxdgPzxxList[i];
var newType = par.type;
if(newType == type){
var initPar = {title:par.title,content:record[par.id]}
nerList.push(initPar);
}
}
return nerList;
}
//
function getTableZzColumns222(list, datalist) {
console.log('🙎datalist-->', datalist);
const data = datalist;
// console.log('😊', data);
let columns = reactive<any>([]);
let namePar = '';
var parid3 = '';
for(var j=2;j<list.length;j++){
parid3 = parid3 + list[j].id+",";
}
for (var i = 0; i < 3; i++) {
var par = list[i];
var title = par.title;
var parid = par.id;
if(i==2){
title = '课程评价标准';
var inePar = {
title: title,
dataIndex: "3",
key: 'action',
};
columns.push(inePar);
}else{
var inePar2 = {
title: title,
dataIndex: parid,
key: parid,
width: 150,
customCell: (record, index, bhdata) => {
if (bhdata.title == '课程目标') {
let nextRecord = data[index + 1];
let rowSpan = 0;
while (nextRecord && nextRecord[bhdata.key] === record[bhdata.key]) {
namePar = nextRecord[bhdata.key];
rowSpan += 1;
nextRecord = data[index + rowSpan];
}
let sizeNum = 0;
for (var i = 0; i < data.length; i++) {
let beforeRecord = data[i];
if (beforeRecord[bhdata.key] === record[bhdata.key]) {
sizeNum += 1;
}
}
if (sizeNum != rowSpan) {
rowSpan = 0;
}
if (sizeNum == 1) {
rowSpan = 1;
}
return {
rowSpan,
};
}
},
};
columns.push(inePar2);
}
}
return columns;
}
//
function getTableZzColumns333(list, datalist) {
const data = datalist;
let columns = reactive<any>([]);
let namePar = '';
for (var i = 0; i < list.length; i++) {
@ -783,28 +854,9 @@ function getTableZzColumns222(list, datalist) {
title: par.title,
dataIndex: par.id,
key: par.id,
width: 100,
customCell: (record, index, bhdata) => {
// if (bhdata.title == '' && (index == 0 || index == 1)) {
// let nextRecord = data[index + 1];
// if (nextRecord && nextRecord[bhdata.key] === record[bhdata.key]) {
// let rowSpan = 1;
// while (nextRecord && nextRecord[bhdata.key] === record[bhdata.key]) {
// nextRecord = data[index + rowSpan];
// rowSpan += 1;
// }
// rowSpan -= 1;
// console.log(rowSpan);
// return {
// rowSpan,
// };
// } else {
// return {
// rowSpan: 0,
// };
// }
// }
if (bhdata.title == '课程目标') {
if (bhdata.title == '课程教学目标') {
let nextRecord = data[index + 1];
let rowSpan = 0;
while (nextRecord && nextRecord[bhdata.key] === record[bhdata.key]) {
@ -819,11 +871,10 @@ function getTableZzColumns222(list, datalist) {
sizeNum += 1;
}
}
console.log('👨‍🦳', sizeNum);
if (sizeNum != rowSpan ) {
if (sizeNum != rowSpan) {
rowSpan = 0;
}
if(sizeNum == 1){
if (sizeNum == 1) {
rowSpan = 1;
}
return {
@ -834,21 +885,6 @@ function getTableZzColumns222(list, datalist) {
};
columns.push(inePar);
}
// columns[0].customCell = (text, index,record ) => {
// if (index === 0) {
// return {
// rowSpan: 2,
// };
// }
// if (index === 1) {
// return {
// rowSpan: 0,
// };
// }
// };
// console.log('columns-->', columns);
return columns;
}
@ -857,8 +893,6 @@ async function handleCheckBanben(record) {
jxdgInfo.value.banbenId = record.id;
jxdgInfo.value.rwbh = rwbh;
jxdgInfo.value.teacherNo = teano;
console.log('👨‍👧', jxdgInfo.value);
//
var id = record.id;
@ -871,14 +905,11 @@ async function handleCheckBanben(record) {
let zyJxdgMainDataList = await queryZyJxdgMainListByMainId3(params);
await defHttp.get({ url: '/ktgl/kcKechengbiao/getKcxxByRwbhXqxn', params: { rwbh, xqxn } }).then((res) => {
console.log('🙅‍♀️', res);
kechengInfo.value = res;
});
var list = zyJxdgMainDataList;
console.log('👯‍♀️', list);
for (var i = 0; i < list.length; i++) {
var par = list[i];
console.log('👕', par);
if (par.type == '4') {
var list1 = par.zyJxdgPzxxList;
for (var j = 0; j < list1.length; j++) {
@ -917,7 +948,6 @@ async function submitForm() {
}
//
function handleShowType(type) {
console.log('🤛', type);
if (type == 1) {
jxdgInfo.value = {};
zyJxdgMainTable.dataSource = [];
@ -937,18 +967,14 @@ function handleShowType(type) {
zyJxdgMainTable.dataSource = [];
defHttp.get({ url: '/zyJxdgTeacherMain/zyJxdgTeacherMain/queryByRwbhList', params: { rwbh, teacherNo } }).then((res) => {
zyJxdgMainTable.dataSource = [...res];
console.log('👩‍💼', zyJxdgMainTable.dataSource);
for (var i = 0; i < zyJxdgMainTable.dataSource.length; i++) {
var par = zyJxdgMainTable.dataSource[i];
console.log('👅', par);
if (par.type == '12') {
var list = par.list2Map;
console.log('🧔', list);
var list1 = ref<{ title: any }[]>([]);
for (var j = 0; j < list.length; j++) {
var ppa = list[j][0].title;
console.log('👧', ppa);
list1.value.push({ title: ppa });
}
kcmbDataSource.value = list1.value;
@ -961,7 +987,6 @@ function handleShowType(type) {
//
async function init() {
console.log('rwbh--->', rwbh);
defHttp.get({ url: '/zyJxdgTeacherMain/zyJxdgTeacherMain/queryByRwbh', params: { rwbh, xqxn, teacherNo: teano } }).then((res) => {
if (res) {
jxdgInfo.value = res;
@ -1000,7 +1025,6 @@ function handleKcmbZzbg(item) {
item.list2Map = item.list2Map || [];
var item3 = item.zyJxdgPzxxList;
console.log('😁', item3);
var oneId = '';
var twoId = '';
for (var i = 0; i < item3.length; i++) {
@ -1052,13 +1076,10 @@ function handle2Glxm(item) {
}
kcmbDataSource.value = listtt.value;
console.log('👳‍♀️', item);
var sfsglxm = item.sfsglxm;
console.log('👱‍♀️', sfsglxm);
if (sfsglxm == '1') {
//
var list1 = item.list2Map; //
console.log('👑', list1);
if (list1 != null) {
//
var sort = item.sort; //
@ -1077,7 +1098,6 @@ function handle2Glxm(item) {
}
//
var item3 = item2.zyJxdgPzxxList;
console.log('👶', item3);
if (item3 != null && item3.length > 0) {
if (item2.type == '11') {
item2.list.push({ [item3[0].id]: '', [item3[1].id]: title });
@ -1094,7 +1114,6 @@ function handle2Glxm(item) {
}
function handle13Zzbg(record) {
console.log('👎', record);
var list2 = record.zyJxdgPzxxList; //
var list3: { title: any; type: string; content: string; key: string }[] = [];
for (var i = 0; i < list2.length; i++) {
@ -1110,9 +1129,7 @@ function handle13Zzbg(record) {
key: par.id,
});
}
console.log('🦹', list3);
record.list.push({ list: list3 });
console.log('👩‍🔧', record);
}
//
@ -1121,27 +1138,20 @@ function handle13DelZzbg(item, index) {
}
function handle14Zzbg(item) {
console.log('🤧item', item);
kcmbShow.value = true;
khmbDataSource.value = [];
var guanlian = item.guanlian.split(',');
var khmbSort = guanlian[1];
console.log('👱khmbSort', khmbSort);
var alllist = zyJxdgMainTable.dataSource[khmbSort - 1]; //
var item2 = alllist.list;
var item3 = alllist.zyJxdgPzxxList[0];
console.log('item2', item2);
console.log('item3', item3);
for (var i = 0; i < item2.length; i++) {
var item1 = item2[i];
console.log('👩👩👦item1', item1[item3.id]);
khmbDataSource.value.push({ title: item1[item3.id] });
}
console.log('😒khmbDataSource', khmbDataSource.value);
}
function handleKhmbqueren(record) {
console.log('👩👦record', record);
var a1 = checkKcmb.value; //
var a2 = checkKhfs.value; //
let columns = reactive<any>([]);

View File

@ -73,7 +73,7 @@
教学内容重难点和课时安排 13
课程目标的评价方式 14
-->
<a-col v-if="item.type==='4' || item.type==='5' || item.type==='9'|| item.type==='10'|| item.type==='11'|| item.type==='12'|| item.type==='13'|| item.type==='14'|| item.type==='15'">
<a-col v-if="item.type==='4' || item.type==='5' || item.type==='9'|| item.type==='10'|| item.type==='11'|| item.type==='12'|| item.type==='13'|| item.type==='15'">
<a-row>
<a-col :span="24" style="text-align:right; margin-left:9px;">
<a-button type="primary" @click="handleTwoType(item)" class="margin10" preIcon="ant-design:plus-outlined">新增字段</a-button>
@ -90,6 +90,26 @@
</a-col>
</a-row>
</a-col>
<a-col v-if=" item.type==='14'">
<a-row>
<a-col :span="24" style="text-align:right; margin-left:9px;">
<a-button type="primary" @click="handleTwoType(item)" class="margin10" preIcon="ant-design:plus-outlined">新增字段</a-button>
</a-col>
<a-col :span="24" v-for="(twoItem,index2) in item.zyJxdgPzxxList" :key="index2">
<a-row>
<a-col :span="16">
<a-input v-model:value="twoItem.title" placeholder="请输入选项" :disabled="disabled" class="fields-add"/>
</a-col>
<a-col :span="4">
<a-input-number v-model:value="twoItem.type" placeholder="请输入第几列" :disabled="disabled" class="fields-add"/>
</a-col>
<a-col :span="2"><close-outlined />
<button @click="handleTwoDel(item,index2)" class="ant-btn" type="button" style="margin-left:10px; width:100%">删除</button>
</a-col>
</a-row>
</a-col>
</a-row>
</a-col>
</a-row>
</a-col>

View File

@ -21,12 +21,12 @@
</template>
<span @click="getGzt('kcjs')">课程简介</span>
</a-menu-item>
<!-- <a-menu-item key="sub3">
<a-menu-item key="sub3">
<template #icon>
<SettingOutlined />
</template>
<span @click="getGzt('jxdg')">教学大纲</span>
</a-menu-item> -->
</a-menu-item>
<a-menu-item key="sub4">
<template #icon>
<SnippetsOutlined />

View File

@ -108,7 +108,7 @@
</a-card>
</a-col>
<a-col :xs="{ span: 9 }" :sm="{ span: 1 }" :lg="{ span: 2 }" v-if="sfxx =='1'">
<div style="margin: 0 auto;width: fit-content;font-size: 6rem;font-weight: 700;color: #cccccc8c;padding: 29px 0;">
<div style="margin: 0 auto;width: fit-content;font-size: 6rem;font-weight: 700;color: #cccccc8c;padding: 29px 0;line-height:90%">
<!-- <RouterLink class="plusButton" to="/dashboard/analysis"><PlusOutlined/></RouterLink> -->
<RouterLink class="plusButton" to="/dashboard/analysis" target="_blank" >+</RouterLink>
</div>