Merge branch 'master' of http://47.115.223.229:8888/yangjun/dbsd_kczx
This commit is contained in:
commit
6b77b63d76
|
@ -113,6 +113,20 @@
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<!-- 自增表格(两列关联) 10 -->
|
||||||
|
<a-col v-else-if="item.type === '10'" :span="24">
|
||||||
|
<div><a-button type="primary" @click="handleZzbg(item)">新增</a-button> </div>
|
||||||
|
<a-table :columns="getTableZzColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false">
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-button type="danger" @click="handleZzbgDel(item.list, record.sort)">删除</a-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>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
<a-col v-else> </a-col>
|
<a-col v-else> </a-col>
|
||||||
|
|
||||||
|
@ -131,7 +145,7 @@
|
||||||
import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
|
import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
||||||
import { queryZyJxdgMainListByMainId, queryZyJxdgMainListByMainId2, saveOrUpdate2,queryDataById2 } from '../ZyJxdgBanben.api';
|
import { queryZyJxdgMainListByMainId, queryZyJxdgMainListByMainId2, saveOrUpdate2, queryDataById2 } from '../ZyJxdgBanben.api';
|
||||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
||||||
import { zyJxdgMainColumns } from '../ZyJxdgBanben.data';
|
import { zyJxdgMainColumns } from '../ZyJxdgBanben.data';
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
@ -368,11 +382,11 @@ export default defineComponent({
|
||||||
key: 'action',
|
key: 'action',
|
||||||
};
|
};
|
||||||
columns.push(inePar2);
|
columns.push(inePar2);
|
||||||
|
console.log('👺11111111', columns);
|
||||||
return columns;
|
return columns;
|
||||||
}
|
}
|
||||||
//关联项目计算方法
|
//关联项目计算方法
|
||||||
function handleGlxm(item) {
|
function handleGlxm(item) {
|
||||||
console.log('👩🍳', item);
|
|
||||||
var sfsglxm = item.sfsglxm;
|
var sfsglxm = item.sfsglxm;
|
||||||
if (sfsglxm == '1') {
|
if (sfsglxm == '1') {
|
||||||
//判断是否是关联项目
|
//判断是否是关联项目
|
||||||
|
@ -395,6 +409,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
//判断当前项是否等于关联项
|
//判断当前项是否等于关联项
|
||||||
var item3 = item2.zyJxdgPzxxList;
|
var item3 = item2.zyJxdgPzxxList;
|
||||||
|
console.log('👶', 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 });
|
||||||
}
|
}
|
||||||
|
@ -404,6 +419,47 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//两列关联项目计算方法
|
||||||
|
function handleTwoGlxm(item) {
|
||||||
|
var sfsglxm = item.sfsglxm;
|
||||||
|
if (sfsglxm == '1') {
|
||||||
|
//判断是否是关联项目
|
||||||
|
var list1 = item.list; //课程目标集合
|
||||||
|
if (list1 != null) {
|
||||||
|
//关联项目是否有值
|
||||||
|
var sort = item.sort; //第几个关联项目
|
||||||
|
var alllist = zyJxdgMainTable.dataSource; //获取全部的数据
|
||||||
|
for (var j = 0; j < alllist.length; j++) {
|
||||||
|
for (var i = 0; i < list1.length; i++) {
|
||||||
|
var item1 = list1[i];
|
||||||
|
var item2 = alllist[j]; //具体数据
|
||||||
|
item2.list = item2.list || [];
|
||||||
|
|
||||||
|
if (item2.guanlian == sort) {
|
||||||
|
//判断当前项是否等于关联项
|
||||||
|
var item3 = item.zyJxdgPzxxList;
|
||||||
|
var item4 = item2.zyJxdgPzxxList;
|
||||||
|
console.log('🤐', item2);
|
||||||
|
console.log('🕵️♀️', item3);
|
||||||
|
|
||||||
|
var title1 = item1[item3[0].id];
|
||||||
|
var title2 = item1[item3[1].id];
|
||||||
|
console.log('🧜title', title1, title2);
|
||||||
|
//关联项目等于当前数据
|
||||||
|
if (i == 0) {
|
||||||
|
//判断第一回将原来的清空重新赋值
|
||||||
|
item2.list = [];
|
||||||
|
}
|
||||||
|
console.log('👶', item3);
|
||||||
|
if (item3 != null && item3.length > 0) {
|
||||||
|
item2.list.push({ [item4[0].id]: title1, [item4[1].id]: title2 });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
zyJxdgMainTableRef,
|
zyJxdgMainTableRef,
|
||||||
|
@ -434,6 +490,7 @@ export default defineComponent({
|
||||||
handleGlxm,
|
handleGlxm,
|
||||||
handleZzbg,
|
handleZzbg,
|
||||||
handleZzbgDel,
|
handleZzbgDel,
|
||||||
|
handleTwoGlxm,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
自增富文本 7
|
自增富文本 7
|
||||||
自增多行文本 8
|
自增多行文本 8
|
||||||
自增表格 9
|
自增表格 9
|
||||||
|
自增表格(两列关联)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">
|
||||||
|
@ -46,7 +47,7 @@
|
||||||
<a-form v-bind="formItemLayout">
|
<a-form v-bind="formItemLayout">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col v-for="(item2, index2) in item.zyJxdgPzxxList" :key="index2" :span="12">
|
<a-col v-for="(item2, index2) in item.zyJxdgPzxxList" :key="index2" :span="12">
|
||||||
<a-form-item :label="item2.title"><a-input :placeholder="`请输入` + item2.title" v-model:value="item2.content"/></a-form-item>
|
<a-form-item :label="item2.title"><a-input :placeholder="`请输入` + item2.title" v-model:value="item2.content" /></a-form-item>
|
||||||
<!-- {{ item2.title }}:<a-input placeholder="请输入内容" style="width:60%;"></a-input> -->
|
<!-- {{ item2.title }}:<a-input placeholder="请输入内容" style="width:60%;"></a-input> -->
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
@ -113,6 +114,21 @@
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<!-- 自增表格(两列关联) 10 -->
|
||||||
|
<a-col v-else-if="item.type === '10'" :span="24">
|
||||||
|
<div><a-button type="primary" @click="handleZzbg(item)">新增</a-button> </div>
|
||||||
|
-{{ getTableZzColumns(item.zyJxdgPzxxList) }}-
|
||||||
|
<a-table :columns="getTableZzColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false">
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-button type="danger" @click="handleZzbgDel(item.list, record.sort)">删除</a-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>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
<a-col v-else> </a-col>
|
<a-col v-else> </a-col>
|
||||||
|
|
||||||
|
@ -230,13 +246,13 @@ export default defineComponent({
|
||||||
console.log('✋', alllist);
|
console.log('✋', alllist);
|
||||||
|
|
||||||
var values = {
|
var values = {
|
||||||
id:'',
|
id: '',
|
||||||
rwbh:'202320242000629',
|
rwbh: '202320242000629',
|
||||||
banbenId:oldInfo.value.id,
|
banbenId: oldInfo.value.id,
|
||||||
teacherNo:'2002900106',
|
teacherNo: '2002900106',
|
||||||
sffb:'0',
|
sffb: '0',
|
||||||
list:alllist,
|
list: alllist,
|
||||||
}
|
};
|
||||||
// const mainData = await getFormData();
|
// const mainData = await getFormData();
|
||||||
// const subData = zyJxdgMainTable.dataSource;
|
// const subData = zyJxdgMainTable.dataSource;
|
||||||
// const values = Object.assign({}, dbData, mainData);
|
// const values = Object.assign({}, dbData, mainData);
|
||||||
|
@ -367,15 +383,18 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
//关联项目计算方法
|
//关联项目计算方法
|
||||||
function handleGlxm(item) {
|
function handleGlxm(item) {
|
||||||
console.log('👩🍳', item);
|
console.log('👩🍳item', item);
|
||||||
var sfsglxm = item.sfsglxm;
|
var sfsglxm = item.sfsglxm;
|
||||||
if (sfsglxm == '1') {
|
if (sfsglxm == '1') {
|
||||||
//判断是否是关联项目
|
//判断是否是关联项目
|
||||||
var list1 = item.list; //课程目标集合
|
var list1 = item.list; //课程目标集合
|
||||||
|
console.log('👨🔧list1', list1);
|
||||||
if (list1 != null) {
|
if (list1 != null) {
|
||||||
//关联项目是否有值
|
//关联项目是否有值
|
||||||
var sort = item.sort; //第几个关联项目
|
var sort = item.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];
|
||||||
|
@ -400,6 +419,48 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//两列关联项目计算方法
|
||||||
|
function handleTwoGlxm(item) {
|
||||||
|
var sfsglxm = item.sfsglxm;
|
||||||
|
if (sfsglxm == '1') {
|
||||||
|
//判断是否是关联项目
|
||||||
|
var list1 = item.list; //课程目标集合
|
||||||
|
if (list1 != null) {
|
||||||
|
//关联项目是否有值
|
||||||
|
var sort = item.sort; //第几个关联项目
|
||||||
|
var alllist = zyJxdgMainTable.dataSource; //获取全部的数据
|
||||||
|
for (var j = 0; j < alllist.length; j++) {
|
||||||
|
for (var i = 0; i < list1.length; i++) {
|
||||||
|
var item1 = list1[i];
|
||||||
|
var item2 = alllist[j]; //具体数据
|
||||||
|
item2.list = item2.list || [];
|
||||||
|
|
||||||
|
if (item2.guanlian == sort) {
|
||||||
|
//判断当前项是否等于关联项
|
||||||
|
var item3 = item.zyJxdgPzxxList;
|
||||||
|
var item4 = item2.zyJxdgPzxxList;
|
||||||
|
console.log('🤐', item2);
|
||||||
|
console.log('🕵️♀️', item3);
|
||||||
|
|
||||||
|
var title1 = item1[item3[0].id];
|
||||||
|
var title2 = item1[item3[1].id];
|
||||||
|
console.log('🧜title', title1, title2);
|
||||||
|
//关联项目等于当前数据
|
||||||
|
if (i == 0) {
|
||||||
|
//判断第一回将原来的清空重新赋值
|
||||||
|
item2.list = [];
|
||||||
|
}
|
||||||
|
console.log('👶', item3);
|
||||||
|
if (item3 != null && item3.length > 0) {
|
||||||
|
item2.list.push({ [item4[0].id]: title1, [item4[1].id]: title2 });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
zyJxdgMainTableRef,
|
zyJxdgMainTableRef,
|
||||||
zyJxdgMainTable,
|
zyJxdgMainTable,
|
||||||
|
@ -429,6 +490,7 @@ export default defineComponent({
|
||||||
handleGlxm,
|
handleGlxm,
|
||||||
handleZzbg,
|
handleZzbg,
|
||||||
handleZzbgDel,
|
handleZzbgDel,
|
||||||
|
handleTwoGlxm,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
富文本 3
|
富文本 3
|
||||||
表单 4
|
表单 4
|
||||||
表格 5 -->
|
表格 5 -->
|
||||||
<a-col v-if="item.type==='4' || item.type==='5' || item.type==='9'">
|
<a-col v-if="item.type==='4' || item.type==='5' || item.type==='9'|| item.type==='10'">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-button type="primary" @click="handleTwoType(item)" class="margin10" preIcon="ant-design:plus-outlined">新增字段</a-button>
|
<a-button type="primary" @click="handleTwoType(item)" class="margin10" preIcon="ant-design:plus-outlined">新增字段</a-button>
|
||||||
|
|
Loading…
Reference in New Issue