# Conflicts:
#	src/views/kc/zyJxdgBanben/components/ZyJxdgBanbenDetailForm.vue
This commit is contained in:
yangjun 2024-08-23 19:43:34 +08:00
commit f0da014566
1 changed files with 46 additions and 99 deletions

View File

@ -10,6 +10,7 @@
<a-col :span="12"> <a-col :span="12">
<a-form-item label="课程类型" v-bind="validateInfos.twoTitle"> {{ oldInfo.twoTitle_dictText }} </a-form-item> <a-form-item label="课程类型" v-bind="validateInfos.twoTitle"> {{ oldInfo.twoTitle_dictText }} </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
<!-- <!--
@ -25,9 +26,9 @@
自增表格两列关联10 自增表格两列关联10
--> -->
<a-row> <a-row>
<a-col :span="24" v-for="(item, index) in zyJxdgMainTable.dataSource" :key="index"> <a-col :span="24" v-for="(item, index) in zyJxdgMainTable.dataSource" :key="index" style="border:1px solid #f5f5f5;margin:5px 0; background:#fbfbfb;border-radius:5px;" >
<a-row> <a-row>
<a-col :span="24" style="margin-bottom:15px;height:40px; margin-top:15px; background-color:#f3faf9;"> <a-col :span="24" style="height:40px;line-height:40px;border-bottom:1px solid #edf0f6; margin-bottom:10px;">
<span class="title">{{ item.title }}</span> <span class="title">{{ item.title }}</span>
</a-col> </a-col>
<!-- 单行文本 1 --> <!-- 单行文本 1 -->
@ -70,13 +71,8 @@
<a-button type="primary" @click="handleDhwb(item)" class="increase">添加</a-button> <a-button type="primary" @click="handleDhwb(item)" class="increase">添加</a-button>
</a-col> </a-col>
<a-col v-for="(item2, index2) in item.list" :key="index2"> <a-col v-for="(item2, index2) in item.list" :key="index2">
<a-input <a-input placeholder="请输入内容" v-model:value="item2.title" style="width: 80%; margin:0px 10px 10px 15px;color:#666" @blur="handleGlxm(item)"></a-input>
placeholder="请输入内容" <button type="danger" @click="handleDhwbDel(item, index2)" class="ant-btn">删除</button>
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-col>
</a-row> </a-row>
</a-col> </a-col>
@ -86,9 +82,9 @@
<a-col> <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>
<a-col v-for="(item2, index2) in item.list" :key="index2"> <a-col v-for="(item2, index2) in item.list" :key="index2" style="text-align:right;">
<j-editor placeholder="请输入内容" v-model:value="item2.title" :disabled="disabled" style="width: 500px; height: 200px" /> <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> <button type="danger" @click="handleDhfwbDel(item, index2)" class="ant-btn" style="margin:8px 0" >删除</button>
</a-col> </a-col>
</a-row> </a-row>
</a-col> </a-col>
@ -98,9 +94,9 @@
<a-col> <a-col>
<a-button type="primary" @click="handleDhwbArea(item)" class="increase">添加</a-button> <a-button type="primary" @click="handleDhwbArea(item)" class="increase">添加</a-button>
</a-col> </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-textarea placeholder="请输入内容" v-model:value="item2.title" :disabled="disabled" />
<a-button type="danger" @click="handleDhwbAreaDel(item, index2)" class="place-dele">删除</a-button> <button type="danger" @click="handleDhwbAreaDel(item, index2)" class="ant-btn" style="margin:8px 0">删除</button>
</a-col> </a-col>
</a-row> </a-row>
</a-col> </a-col>
@ -111,10 +107,10 @@
<a-table :columns="getTableZzColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false"> <a-table :columns="getTableZzColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-button type="danger" @click="handleZzbgDel(item.list, record.sort)">删除</a-button> <button type="danger" @click="handleZzbgDel(item.list, record.sort)" class="ant-btn">删除</button>
</template> </template>
<template v-else> <template v-else>
<a-input placeholder="请输入内容" v-model:value="record[column.key]" style="width: 100%"></a-input> <a-input placeholder="请输入内容" v-model:value="record[column.key]" style="width: 100%;color:#666"></a-input>
</template> </template>
</template> </template>
</a-table> </a-table>
@ -125,10 +121,10 @@
<a-table :columns="getTableZzColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false"> <a-table :columns="getTableZzColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-button type="danger" @click="handleZzbgDel(item.list, record.sort)">删除</a-button> <button type="danger" @click="handleZzbgDel(item.list, record.sort)" class="ant-btn">删除</button>
</template> </template>
<template v-else> <template v-else>
<a-input placeholder="请输入内容" v-model:value="record[column.key]" @blur="handleTwoGlxm(item)" style="width: 100%"></a-input> <a-input placeholder="请输入内容" v-model:value="record[column.key]" @blur="handleTwoGlxm(item)" style="width: 100%; color:#666"></a-input>
</template> </template>
</template> </template>
</a-table> </a-table>
@ -262,10 +258,10 @@ export default defineComponent({
// const values = Object.assign({}, dbData, mainData); // const values = Object.assign({}, dbData, mainData);
// values.zyJxdgMainList = subData; // values.zyJxdgMainList = subData;
console.log('表单提交数据', values); console.log('表单提交数据', values);
// const isUpdate = values.id ? true : false; const isUpdate = values.id ? true : false;
// await saveOrUpdate2(values, isUpdate); await saveOrUpdate2(values, isUpdate);
// // //
// emit('success'); emit('success');
} }
function setFieldsValue(values) { function setFieldsValue(values) {
@ -398,26 +394,14 @@ export default defineComponent({
var sort = item.sort; // var sort = item.sort; //
console.log('💆sort', sort); console.log('💆sort', sort);
var alllist = zyJxdgMainTable.dataSource; // var alllist = zyJxdgMainTable.dataSource; //
console.log('🧜alllist', alllist);
for (var j = 0; j < alllist.length; j++) { for (var j = 0; j < alllist.length; j++) {
for (var i = 0; i < list1.length; i++) { for (var i = 0; i < list1.length; i++) {
var item1 = list1[i]; var item1 = list1[i];
var title = item1.title; // var title = item1.title; //
var item2 = alllist[j]; // var item2 = alllist[j]; //
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
// 10
if(item2.type == '5' || item2.type == '9' || item2.type == '10'){
item2.list = item2.list || []; item2.list = item2.list || [];
if (item2.guanlian == sort) { if (item2.guanlian == sort) {
console.log('🤣item2', item2);
// //
if (i == 0) { if (i == 0) {
// //
@ -425,49 +409,10 @@ export default defineComponent({
} }
// //
var item3 = item2.zyJxdgPzxxList; var item3 = item2.zyJxdgPzxxList;
console.log('🤨item3', item3);
if (item3 != null && item3.length > 0) { if (item3 != null && item3.length > 0) {
item2.list.push({ [item3[0].id]: title }); 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 });
}
}
} }
} }
} }
@ -553,12 +498,10 @@ export default defineComponent({
<style scoped lang="less" > <style scoped lang="less" >
.title { .title {
width: 80%; width: 80%;
font-size: 18px; font-size:16px;
font-weight: bold; padding-left:20px;
padding-left: 10px;
position: relative; position: relative;
color: #333333; color: #333333;
line-height: 40px;
} }
.tishi { .tishi {
width: 100%; width: 100%;
@ -571,13 +514,17 @@ export default defineComponent({
.tishi span{ .tishi span{
font-size: 12px; font-size: 12px;
color: #ff9924; color: #ff9924;
margin:0 20px;
} }
.increase{ .increase{
position: absolute; position: absolute;
right:6px; right:6px;
top: -51px; top:-46px;
} }
.place-dele{ .place-dele{
margin:10px 0; margin:10px 0;
} }
.ant-btn{
color: #666;
}
</style> </style>