@@ -475,6 +473,7 @@ export default {
this.anewPosttingDatas(list)
this.tableData.forEach(async (item, index) => {
// 勾选树节点
+ item.operationIds = item.id
// console.log(item)
if (item.id) {
this.$nextTick(() => {
@@ -491,9 +490,15 @@ export default {
let obj = {
...item,
isSubject: true,
- isDisabled: true, // 已禁用
- isSave: true // 已保存
+ isDisabled: false, // 已禁用
+ isSave: false // 已保存
};
+ console.log(item)
+
+ if(item.type == undefined){
+ item.operationIds = item.id
+ item.type = null
+ }
//题目类型(1选择 2判断 3填空 4问答 5指标结果)
if (item.type == 1 || item.type == 2) {
obj.subjectId = Number(item.emptyOne);
@@ -586,19 +591,15 @@ export default {
});
},
handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选
- // this.changeArr.push(checked)
- // if(this.changeArr.length === 4) {
- // this.checkChange.splice(index, 1, this.changeArr[2])
- // this.changeArr.splice(0, this.changeArr.length)
- // }else if(this.changeArr.length === 2) {
- // this.checkChange.splice(index, 1, true)
+ // console.log(checked)
+ // if (checked){
+ // }else{
+ // this.tableData[index].operationIds= null
+ // this.tableData[index].operationIds= null
// }
- if (checked){
- }else{
- row.operationIds = null
- row.type = null
- }
+ // console.log(this.tableData[index].operationIds)
if (checked && data.isNode === 1) {
+ console.log('123')
this.tableData[index].operationIds = data.id; // 操作id串
row.value1 = "";
row.value2 = "";
@@ -836,6 +837,11 @@ export default {
},
handleSave(row, index) { // 处理保存规则
let keys = this.$refs[`tree-${index}`].getCheckedKeys();
+ console.log(keys)
+ console.log(row)
+ if(!row.operationIds){
+ row.operationIds = keys[0]
+ }
if (!keys.length || !row.operationIds) {
this.$message.warning(`请选择操作点`);
return;
@@ -971,7 +977,10 @@ export default {
margin-left: 20px;
}
}
-
+ .cell div{
+ margin: auto;
+ text-align: center;
+ }
// 表单容器
.form-con {
padding-bottom: 24px;
From e09cd40788cff5cd517a40ac95de540020b82433 Mon Sep 17 00:00:00 2001
From: e <2432808546@qq.com>
Date: Tue, 21 Dec 2021 14:32:50 +0800
Subject: [PATCH 2/7] =?UTF-8?q?py=E9=A1=B9=E7=9B=AE=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E4=B8=8A=E4=B8=8B=E4=B8=94=E6=88=96=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Program.vue | 4 ----
src/views/Transaction.vue | 14 +++++++++++---
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/views/Program.vue b/src/views/Program.vue
index d7a4cf4..07b0792 100644
--- a/src/views/Program.vue
+++ b/src/views/Program.vue
@@ -409,15 +409,11 @@ export default {
type: "warning",
center: true,
}).then(() => {
- // this.tableData.splice(index, 1);
- console.log(index)
- console.log(this.tableData.length)
if (index+1 == this.tableData.length){
this.tableData.splice(index - 1, 2)
}else{
this.tableData.splice(index,2);
}
-
this.itemkey = Math.random()
this.isAddRule = false;
}).catch(() => {})
diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue
index 0a81b91..3ab97f6 100644
--- a/src/views/Transaction.vue
+++ b/src/views/Transaction.vue
@@ -894,7 +894,12 @@ export default {
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]);
}
} else {
- this.tableData.splice(index-1, 2);
+ if (index+1 == this.tableData.length){
+ this.tableData.splice(index - 1, 2)
+ }else{
+ this.tableData.splice(index,2);
+ }
+ // this.tableData.splice(index-1, 2);
// index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
this.isAddRule = false;
}
@@ -909,8 +914,11 @@ export default {
// if(index+1 == this.tableData.length){
// index = index-1
// }
- this.tableData.splice(index,2);
- index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
+ if (index+1 == this.tableData.length){
+ this.tableData.splice(index - 1, 2)
+ }else{
+ this.tableData.splice(index,2);
+ }
this.itemkey = Math.random()
this.tableData.forEach(async (item, index) => {
// 勾选树节点
From 0bcbf95952c5b2b304b290d0694cc817bbb9182f Mon Sep 17 00:00:00 2001
From: e <2432808546@qq.com>
Date: Tue, 21 Dec 2021 15:26:44 +0800
Subject: [PATCH 3/7] =?UTF-8?q?py=E9=A1=B9=E7=9B=AE=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E4=B8=8A=E4=B8=8B=E4=B8=94=E6=88=96=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Program.vue | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/views/Program.vue b/src/views/Program.vue
index 07b0792..7d78fa0 100644
--- a/src/views/Program.vue
+++ b/src/views/Program.vue
@@ -84,13 +84,14 @@
- {{ scope.row.withOr === 0 ? '且' : '或' }}
+ {{ scope.row.resultOperation === 0 ? '且' : '或' }}
{{ scope.row.ruleOperation === 0 ? "且" : "或" }}
@@ -299,7 +300,7 @@ export default {
bcId: i.bcId,
required: i.required,
result: i.result,
- withOr: i.withOr
+ resultOperation: i.resultOperation
};
tempArr.push(obj)
});
@@ -370,7 +371,7 @@ export default {
}
},
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0)
- row.withOr = row.withOr === 0 ? 1 : 0;
+ row.resultOperation = row.resultOperation === 0 ? 1 : 0;
},
changeRule(row, index) { // (上下)规则运算符(0:且 1:或 默认0)
row.ruleOperation = row.ruleOperation === 0 ? 1 : 0;
From 3fb67521fb06e85d14b9ff20a92e032278b7ecc3 Mon Sep 17 00:00:00 2001
From: e <2432808546@qq.com>
Date: Tue, 21 Dec 2021 17:13:00 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=AD=97=E6=AE=B5?=
=?UTF-8?q?=E4=B8=BA=E7=A9=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Program.vue | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/src/views/Program.vue b/src/views/Program.vue
index 7d78fa0..3dcff48 100644
--- a/src/views/Program.vue
+++ b/src/views/Program.vue
@@ -281,13 +281,13 @@ export default {
return;
} else {
for (let i = 0; i < this.tableData.length; i++) {
- if (!this.tableData[i].required) {
+ if (this.tableData[i].isSubject && !this.tableData[i].required) {
this.$message.warning(`第${i + 1}项,规则要求不能为空`);
return;
- } else if (!this.tableData[i].result) {
+ } else if (this.tableData[i].isSubject && !this.tableData[i].result) {
this.$message.warning(`第${i + 1}项,规则结果不能为空`);
return;
- } else if (!this.tableData[i].isSave) {
+ } else if (this.tableData[i].isSubject && !this.tableData[i].isSave) {
this.$message.warning(`第${i + 1}项,未保存`);
return;
}
@@ -295,14 +295,17 @@ export default {
}
let tempArr = [];
this.tableData.forEach(i => {
- let obj = {
- id: i.id ? i.id : "",
- bcId: i.bcId,
- required: i.required,
- result: i.result,
- resultOperation: i.resultOperation
- };
- tempArr.push(obj)
+ if (i.isSubject) {
+ let obj = {
+ id: i.id ? i.id : "",
+ bcId: i.bcId,
+ required: i.required,
+ result: i.result,
+ resultOperation: i.resultOperation,
+ ruleOperation: i.ruleOperation
+ };
+ tempArr.push(obj)
+ }
});
this.formData.bcJudgmentRuleList = tempArr;
if (this.isAdd) { // 新增判分点
From 7b22f927763db946ae4dae732ba665406d278baf Mon Sep 17 00:00:00 2001
From: e <2432808546@qq.com>
Date: Thu, 23 Dec 2021 14:37:45 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=AD=97=E6=AE=B5?=
=?UTF-8?q?=E4=B8=BA=E7=A9=BA=E9=97=AE=E9=A2=98=20=E8=A7=84=E5=88=99?=
=?UTF-8?q?=E4=B8=8E=E5=8F=82=E8=80=83=E7=AD=94=E6=A1=88=E5=85=B6=E4=B8=AD?=
=?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=AD=98=E5=9C=A8=E6=95=B0=E6=8D=AE=E5=B0=B1?=
=?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=BF=9D=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Program.vue | 89 +++++++++++++++++++--------------------
src/views/Transaction.vue | 36 ----------------
2 files changed, 43 insertions(+), 82 deletions(-)
diff --git a/src/views/Program.vue b/src/views/Program.vue
index 3dcff48..723e01d 100644
--- a/src/views/Program.vue
+++ b/src/views/Program.vue
@@ -260,10 +260,6 @@ export default {
}
},
saveAll() { // 保存判分点
- if (!this.formData.points.name) {
- this.$message.warning(`判分点名称不能为空`);
- return;
- }
if (this.isNameRepeat) {
this.$message.warning(`当前判分点名称已存在`);
return;
@@ -272,20 +268,13 @@ export default {
this.$message.warning(`实验要求不能为空`);
return;
}
- if (!this.formData.points.experimentCode) {
- this.$message.warning(`实验代码不能为空`);
- return;
- }
if (!this.tableData.length) {
this.$message.warning(`请添加判分规则`);
return;
} else {
for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].isSubject && !this.tableData[i].required) {
- this.$message.warning(`第${i + 1}项,规则要求不能为空`);
- return;
- } else if (this.tableData[i].isSubject && !this.tableData[i].result) {
- this.$message.warning(`第${i + 1}项,规则结果不能为空`);
+ if ((this.tableData[i].isSubject && !this.tableData[i].required) && (this.tableData[i].isSubject && !this.tableData[i].result)) {
+ this.$message.warning(`第${i + 1}项,规则与结果至少填写一个`);
return;
} else if (this.tableData[i].isSubject && !this.tableData[i].isSave) {
this.$message.warning(`第${i + 1}项,未保存`);
@@ -293,9 +282,10 @@ export default {
}
}
}
- let tempArr = [];
- this.tableData.forEach(i => {
- if (i.isSubject) {
+ if (this.formData.points.name || this.formData.points.experimentCode){
+ let tempArr = [];
+ this.tableData.forEach(i => {
+ if (i.isSubject) {
let obj = {
id: i.id ? i.id : "",
bcId: i.bcId,
@@ -305,31 +295,42 @@ export default {
ruleOperation: i.ruleOperation
};
tempArr.push(obj)
- }
- });
- this.formData.bcJudgmentRuleList = tempArr;
- if (this.isAdd) { // 新增判分点
- this.$post(this.api.addBcJudgmentPoint, this.formData).then(res => {
- if (res.status === 200) {
- this.$message.success("新增判分点成功");
- this.Back();
- } else {
- this.$message.warning(res.message);
}
- }).catch(err => {
- console.log(err)
- })
- } else if (this.isEdit) { // 编辑判分点
- this.$post(this.api.updateBcJudgmentPoint, this.formData).then(res => {
- if (res.status === 200) {
- this.$message.success("更新判分点成功");
- this.Back();
- } else {
- this.$message.warning(res.message);
- }
- }).catch(err => {
- console.log(err)
- })
+ });
+ this.formData.bcJudgmentRuleList = tempArr;
+ if (this.isAdd) { // 新增判分点
+ this.$post(this.api.addBcJudgmentPoint, this.formData).then(res => {
+ if (res.status === 200) {
+ this.$message.success("新增判分点成功");
+ this.Back();
+ } else {
+ this.$message.warning(res.message);
+ }
+ }).catch(err => {
+ console.log(err)
+ })
+ } else if (this.isEdit) { // 编辑判分点
+ this.$post(this.api.updateBcJudgmentPoint, this.formData).then(res => {
+ if (res.status === 200) {
+ this.$message.success("更新判分点成功");
+ this.Back();
+ } else {
+ this.$message.warning(res.message);
+ }
+ }).catch(err => {
+ console.log(err)
+ })
+ }
+ }else{
+ this.$message.warning(`实验代码与判分点名称至少填写一个`);
+ // if (!this.formData.points.name) {
+ // this.$message.warning(`判分点名称不能为空`);
+ // return;
+ // }
+ // if (!this.formData.points.experimentCode) {
+ //
+ // return;
+ // }
}
},
addRule() { // 新增规则
@@ -385,12 +386,8 @@ export default {
row.isDisabled = false;
},
handleSave(row) { // 处理保存规则
- if (!row.required) {
- this.$message.warning(`规则要求不能为空`);
- return;
- }
- if (!row.result) {
- this.$message.warning(`规则结果不能为空`);
+ if (!row.required && !row.result) {
+ this.$message.warning(`规则与结果至少填写一个`);
return;
}
row.isSave = true;
diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue
index 3ab97f6..009c705 100644
--- a/src/views/Transaction.vue
+++ b/src/views/Transaction.vue
@@ -393,9 +393,7 @@ export default {
token: atob(decodeURI(this.$route.query.token))
});
this.checkChange.push(false)
- console.log('remounted')
this.getTreeData();
- console.log(this.treeData)
if (this.$route.query.systemId) {
this.formData.lcJudgmentPoint.systemId = this.$route.query.systemId;
}
@@ -415,16 +413,6 @@ export default {
if (item.operationIds) {
this.$nextTick(() => {
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
- // let currentNode = this.$refs[`tree-${index}`].getNode([item]);
- // while ( parentLevel>0)//包含一级节点,因为一级节点有多个,如果是一级节点有一个,那这个判断就是while ( 1!=parentLevel)
- // let dom = document.querySelector("#divTree")
- // let dom1 = document.querySelector("#depTree")
- // //一个节点的高度是26px,这个值能否从对象中获取,等我把这个功能做好再考虑吧
- // let nodeHight =26
- // dom1.style.height = (nodeCount * nodeHight) + "px"
- // let contHeight=(nodeIndex * nodeHight)+topHeight-300//总高度,盒子高度的一半
- // dom.scrollTo(0, contHeight)
- // this.scrollToDepTree(item.operationIds)
})
}
// 根据题目id,获取题目信息
@@ -445,7 +433,6 @@ export default {
},
currentChecked (nodeObj, SelectedObj) {
this.SelectedObj = SelectedObj
-
},
handleConfirm(){
let list = []
@@ -474,7 +461,6 @@ export default {
this.tableData.forEach(async (item, index) => {
// 勾选树节点
item.operationIds = item.id
- // console.log(item)
if (item.id) {
this.$nextTick(() => {
this.$refs[`tree-${index}`].setCheckedKeys([item.id]);
@@ -493,8 +479,6 @@ export default {
isDisabled: false, // 已禁用
isSave: false // 已保存
};
- console.log(item)
-
if(item.type == undefined){
item.operationIds = item.id
item.type = null
@@ -591,29 +575,19 @@ export default {
});
},
handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选
- // console.log(checked)
- // if (checked){
- // }else{
- // this.tableData[index].operationIds= null
- // this.tableData[index].operationIds= null
- // }
- // console.log(this.tableData[index].operationIds)
if (checked && data.isNode === 1) {
- console.log('123')
this.tableData[index].operationIds = data.id; // 操作id串
row.value1 = "";
row.value2 = "";
row.value3 = "";
row.value4 = "";
row.value5 = "";
- // console.log(data)
if (data.subjectId) { // 是否有题目id
this.currentNodeData = data;
this.$refs[`tree-${index}`].setCheckedNodes([data]);
this.getSubjectData(data.subjectId, index);
} else {
row.type = null;
- // console.log(row.type)
this.currentNodeData = {};
this.$refs[`tree-${index}`].setCheckedNodes([data]);
}
@@ -649,7 +623,6 @@ export default {
let result = [];
data.forEach(item => {
if (item.isNode === 0) {
- // item.disabled = true;
item.showCheckbox = false;
} else {
item.showCheckbox = true;
@@ -781,7 +754,6 @@ export default {
this.checkChange.push(false)
if(!this.isAddRule) {
this.isAddRule = true;
- // this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""});
if (this.tableData.length > 0){
this.tableData.push({
ruleOperation: 0
@@ -820,7 +792,6 @@ export default {
}else {
this.$message('请保存当前判分规则再新增!');
}
- // anewPosttingData(judgmentRuleList)
},
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0)
row.resultOperation = row.resultOperation === 0 ? 1 : 0;
@@ -837,8 +808,6 @@ export default {
},
handleSave(row, index) { // 处理保存规则
let keys = this.$refs[`tree-${index}`].getCheckedKeys();
- console.log(keys)
- console.log(row)
if(!row.operationIds){
row.operationIds = keys[0]
}
@@ -899,8 +868,6 @@ export default {
}else{
this.tableData.splice(index,2);
}
- // this.tableData.splice(index-1, 2);
- // index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
this.isAddRule = false;
}
},
@@ -911,9 +878,6 @@ export default {
type: "warning",
center: true
}).then(() => {
- // if(index+1 == this.tableData.length){
- // index = index-1
- // }
if (index+1 == this.tableData.length){
this.tableData.splice(index - 1, 2)
}else{
From 198e8be2e861d5cddceffe4382573ed65356c355 Mon Sep 17 00:00:00 2001
From: e <2432808546@qq.com>
Date: Thu, 23 Dec 2021 16:15:33 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E5=88=A4=E5=88=86=E7=82=B9=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E9=80=89=E6=8B=A9=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Transaction.vue | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue
index 009c705..8d35ca3 100644
--- a/src/views/Transaction.vue
+++ b/src/views/Transaction.vue
@@ -62,7 +62,9 @@
:data="treeData"
@check="currentChecked"
header-align="center"
- show-checkbox node-key="id"
+ show-checkbox
+ ref="tree"
+ node-key="id"
:props="defaultProps">
@@ -479,10 +481,12 @@ export default {
isDisabled: false, // 已禁用
isSave: false // 已保存
};
- if(item.type == undefined){
+ if(item.type == undefined || item.type == ''){
item.operationIds = item.id
item.type = null
}
+ console.log(item.operationIds)
+ console.log(item.type)
//题目类型(1选择 2判断 3填空 4问答 5指标结果)
if (item.type == 1 || item.type == 2) {
obj.subjectId = Number(item.emptyOne);
@@ -747,7 +751,19 @@ export default {
}
},
addRules(){
- this.configVisible = true
+ this.configVisible = true;
+
+ console.log(this.formData.lcJudgmentRuleList)
+ let operationIds = []
+ this.tableData.forEach(async (item, index) => {
+ // 勾选树节点
+ if (item.operationIds) {
+ operationIds.push(item.operationIds)
+ }
+ });
+ this.$nextTick(() => {
+ this.$refs.tree.setCheckedKeys(operationIds);
+ })
},
addRule() { // 新增规则
this.changeArr.splice(0, this.changeArr.length)
From e8b06f5d522bf4aa6d6dda6396ef2f5e7fbeb8da Mon Sep 17 00:00:00 2001
From: e <2432808546@qq.com>
Date: Thu, 23 Dec 2021 16:17:39 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=E5=88=A4=E5=88=86=E7=82=B9=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E9=80=89=E6=8B=A9=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Transaction.vue | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue
index 8d35ca3..f9d59ad 100644
--- a/src/views/Transaction.vue
+++ b/src/views/Transaction.vue
@@ -438,14 +438,14 @@ export default {
},
handleConfirm(){
let list = []
- if (this.formData.lcJudgmentRuleList.length){
- for (var j = 0;j
0){
for (var i=0;i 0){
@@ -485,8 +485,6 @@ export default {
item.operationIds = item.id
item.type = null
}
- console.log(item.operationIds)
- console.log(item.type)
//题目类型(1选择 2判断 3填空 4问答 5指标结果)
if (item.type == 1 || item.type == 2) {
obj.subjectId = Number(item.emptyOne);