修改bug

This commit is contained in:
yangjun 2024-08-23 13:43:21 +08:00
parent 880ffa2f5f
commit eb3c8300fe
1 changed files with 88 additions and 33 deletions

View File

@ -1,16 +1,15 @@
<template>
<a-spin :spinning="loading" >
<a-spin :spinning="loading">
<a-form v-bind="formItemLayout">
<a-row>
<a-col :span="12">
<a-form-item label="版本" v-bind="validateInfos.title" >
<a-form-item label="版本" v-bind="validateInfos.title">
{{ formData.title }}
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="课程类型" v-bind="validateInfos.twoTitle"> {{ oldInfo.twoTitle_dictText }} </a-form-item>
</a-col>
</a-row>
</a-form>
<!--
@ -28,7 +27,7 @@
<a-row>
<a-col :span="24" v-for="(item, index) in zyJxdgMainTable.dataSource" :key="index">
<a-row>
<a-col :span="24" style="margin-bottom:15px;height:40px; margin-top:15px; background-color:rgba(1, 156, 136, 0.1);">
<a-col :span="24" style="margin-bottom: 15px; height: 40px; margin-top: 15px; background-color: rgba(1, 156, 136, 0.1)">
<span class="title">{{ item.title }}</span>
</a-col>
<!-- 单行文本 1 -->
@ -71,7 +70,12 @@
<a-button type="primary" @click="handleDhwb(item)" class="increase">添加</a-button>
</a-col>
<a-col v-for="(item2, index2) in item.list" :key="index2">
<a-input placeholder="请输入内容" v-model:value="item2.title" style="width: 80%; margin: 0 10px 10px 0px;" @blur="handleGlxm(item)"></a-input>
<a-input
placeholder="请输入内容"
v-model:value="item2.title"
style="width: 80%; margin: 0 10px 10px 0px"
@blur="handleGlxm(item)"
></a-input>
<a-button type="danger" @click="handleDhwbDel(item, index2)">删除</a-button>
</a-col>
</a-row>
@ -80,11 +84,11 @@
<a-col v-else-if="item.type === '7'" :span="24">
<a-row>
<a-col>
<a-button type="primary" @click="handleDhfwb(item)" class="increase" >添加</a-button>
<a-button type="primary" @click="handleDhfwb(item)" class="increase">添加</a-button>
</a-col>
<a-col v-for="(item2, index2) in item.list" :key="index2">
<j-editor placeholder="请输入内容" v-model:value="item2.title" :disabled="disabled" style="width: 500px; height: 200px" />
<a-button type="danger" @click="handleDhfwbDel(item, index2)" style="margin-top:10px"></a-button>
<a-button type="danger" @click="handleDhfwbDel(item, index2)" style="margin-top: 10px"></a-button>
</a-col>
</a-row>
</a-col>
@ -94,7 +98,7 @@
<a-col>
<a-button type="primary" @click="handleDhwbArea(item)" class="increase">添加</a-button>
</a-col>
<a-col v-for="(item2, index2) in item.list" :key="index2" style="text-align:right;" >
<a-col v-for="(item2, index2) in item.list" :key="index2" style="text-align: right">
<a-textarea placeholder="请输入内容" v-model:value="item2.title" :disabled="disabled" />
<a-button type="danger" @click="handleDhwbAreaDel(item, index2)" class="place-dele">删除</a-button>
</a-col>
@ -258,10 +262,10 @@ export default defineComponent({
// const values = Object.assign({}, dbData, mainData);
// values.zyJxdgMainList = subData;
console.log('表单提交数据', values);
const isUpdate = values.id ? true : false;
await saveOrUpdate2(values, isUpdate);
//
emit('success');
// const isUpdate = values.id ? true : false;
// await saveOrUpdate2(values, isUpdate);
// //
// emit('success');
}
function setFieldsValue(values) {
@ -394,25 +398,76 @@ export default defineComponent({
var sort = item.sort; //
console.log('💆sort', sort);
var alllist = zyJxdgMainTable.dataSource; //
console.log('🧜alllist', alllist);
for (var j = 0; j < alllist.length; j++) {
for (var i = 0; i < list1.length; i++) {
var item1 = list1[i];
var title = item1.title; //
var item2 = alllist[j]; //
item2.list = item2.list || [];
if (item2.guanlian == sort) {
//
if (i == 0) {
//
item2.list = [];
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
// 10
if(item2.type == '5' || item2.type == '9' || item2.type == '10'){
item2.list = item2.list || [];
if (item2.guanlian == sort) {
console.log('🤣item2', item2);
//
if (i == 0) {
//
item2.list = [];
}
//
var item3 = item2.zyJxdgPzxxList;
console.log('🤨item3', item3);
if (item3 != null && item3.length > 0) {
item2.list.push({ [item3[0].id]: title });
}
}
//
var item3 = item2.zyJxdgPzxxList;
if (item3 != null && item3.length > 0) {
item2.list.push({ [item3[0].id]: title });
}else if(item2.type == '7'){
item2.list = item2.list || [];
if (item2.guanlian == sort) {
console.log('🤣item2', item2);
//
if (i == 0) {
//
item2.list = [];
}
title = (i+1)+"、"+title + "<br/>"
// title = title + "1<br/>"
// title = title + "2<br/>"
// title = title + "3<br/>"
// title = title + "4<br/>"
// title = title + "5<br/>"
// title = title + "6<br/>"
// title = title + "7<br/>"
// title = title + "1-7<br/>"
item2.list.push({ title: title });
}
}else if(item2.type == '6' || item2.type == '8'){
item2.list = item2.list || [];
if (item2.guanlian == sort) {
console.log('🤣item2', item2);
//
if (i == 0) {
//
item2.list = [];
}
title = (i+1)+"、"+title
item2.list.push({ title: title });
}
}
}
}
}
@ -434,7 +489,7 @@ export default defineComponent({
var item1 = list1[i];
var item2 = alllist[j]; //
item2.list = item2.list || [];
if (item2.guanlian == sort) {
//
var item3 = item.zyJxdgPzxxList;
@ -503,25 +558,25 @@ export default defineComponent({
padding-left: 10px;
position: relative;
color: #333333;
line-height:40px;
line-height: 40px;
}
.tishi {
width: 100%;
display: flex;
flex-direction: column;
flex-direction: column;
text-align: left;
margin: 5px;
}
.tishi span{
.tishi span {
font-size: 12px;
color: #fd8f02;
}
.increase{
.increase {
position: absolute;
right:6px;
top:-51px;
right: 6px;
top: -51px;
}
.place-dele {
margin: 10px 0;
}
.place-dele{
margin:10px 0;
}
</style>