|
@@ -91,7 +91,7 @@
|
|
|
}
|
|
|
}
|
|
|
.rich_text {
|
|
|
- padding: 0 10px;
|
|
|
+ padding: 10px 37px;
|
|
|
}
|
|
|
}
|
|
|
.rich_text {
|
|
@@ -243,7 +243,7 @@ it .ql-editor,
|
|
|
<div class="rich_text" v-if="table.textType === 12">
|
|
|
<el-form-item
|
|
|
label="概述:"
|
|
|
- label-width="100px"
|
|
|
+ label-width="70px"
|
|
|
ref="editor"
|
|
|
:prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[0].content`"
|
|
|
:rules="rules.fwbContent"
|
|
@@ -254,6 +254,7 @@ it .ql-editor,
|
|
|
:options="editorOption"
|
|
|
class="ql-editor"
|
|
|
ref="quillEditor"
|
|
|
+ @change="onEditorChange($event)"
|
|
|
></quillEditor>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -307,9 +308,9 @@ import rules from "./rules";
|
|
|
const defaultDate = {
|
|
|
groupId: new Date().valueOf().toString(),
|
|
|
issueId: new Date().valueOf().toString() + "-" + new Date().valueOf(),
|
|
|
- two_constant: "",
|
|
|
+ two_constant: 0,
|
|
|
two_content: "",
|
|
|
- two_factor: "",
|
|
|
+ two_factor: 1,
|
|
|
two_orderNo: 0,
|
|
|
two_remark: "",
|
|
|
two_resultType: 0,
|
|
@@ -365,9 +366,9 @@ export default {
|
|
|
{
|
|
|
groupId: 0,
|
|
|
issueId: 0,
|
|
|
- two_constant: "",
|
|
|
+ two_constant:0,
|
|
|
two_content: "",
|
|
|
- two_factor: "",
|
|
|
+ two_factor: 1,
|
|
|
two_orderNo: 0,
|
|
|
two_remark: "",
|
|
|
two_resultType: 0,
|
|
@@ -504,6 +505,18 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ onEditorChange(e){
|
|
|
+ e.quill.deleteText(1000,4);
|
|
|
+ console.log(e.quill.getLength());
|
|
|
+ // if(e.quill.getLength()>1000){
|
|
|
+
|
|
|
+ // }
|
|
|
+ // if(this.form.intro==''){
|
|
|
+ // this.TiLength=0
|
|
|
+ // }else{
|
|
|
+ // this.TiLength=e.quill.getLength()-1
|
|
|
+ // }
|
|
|
+ },
|
|
|
// 提交 (父级调用)
|
|
|
assessCommit() {
|
|
|
this.$refs["scaleFormRef"].validate((valid) => {
|
|
@@ -521,10 +534,9 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
- console.log("/one/", this.scaleData);
|
|
|
// 提交数据的处理 start....
|
|
|
// 1. 新建一个整体对象
|
|
|
- const obj = {
|
|
|
+ const params = {
|
|
|
conceptId: 0,
|
|
|
klScaleParent: [],
|
|
|
modifier: "0"
|
|
@@ -532,11 +544,11 @@ export default {
|
|
|
// 2. 遍历数据
|
|
|
this.scaleData.klScaleParent.forEach((table, tableIndex) => {
|
|
|
// 3. 将第一层数据格式顺序放进新对象(对应一个表格的数据)
|
|
|
- obj.klScaleParent.push({
|
|
|
+ params.klScaleParent.push({
|
|
|
...table,
|
|
|
klScaleSaveGroup: []
|
|
|
});
|
|
|
- // 4. 建立一个新数组 用于后边赋值 obj.klScaleParent[tableIndex].klScaleSaveGroup = groupArr;
|
|
|
+ // 4. 建立一个新数组 用于后边赋值 params.klScaleParent[tableIndex].klScaleSaveGroup = groupArr;
|
|
|
let groupArr = [];
|
|
|
// 5. 遍历数据 添加组、问题、以及选项。
|
|
|
table.klScaleSaveGroup.forEach((group, groupIndex) => {
|
|
@@ -546,14 +558,14 @@ export default {
|
|
|
// 6. 查看数组中有没有同组的,如果没有同组的,直接push
|
|
|
if (groupFindIndex === -1) {
|
|
|
groupArr.push({
|
|
|
- groupNum: group.groupId,
|
|
|
+ groupNum: 0,
|
|
|
klScaleSub: [
|
|
|
{
|
|
|
issueId: group.issueId,
|
|
|
constant: group.two_constant,
|
|
|
content: group.two_content,
|
|
|
factor: group.two_factor,
|
|
|
- orderNo: group.two_orderNo,
|
|
|
+ orderNo: 0,
|
|
|
remark: group.two_remark,
|
|
|
resultType: group.two_resultType,
|
|
|
ruleCode: group.two_ruleCode,
|
|
@@ -564,7 +576,7 @@ export default {
|
|
|
klScaleDetail: [
|
|
|
{
|
|
|
content: group.content,
|
|
|
- orderNo: group.orderNo,
|
|
|
+ orderNo: 0,
|
|
|
pushInfo: group.pushInfo,
|
|
|
remark: group.remark,
|
|
|
result: group.result,
|
|
@@ -591,7 +603,7 @@ export default {
|
|
|
constant: group.two_constant,
|
|
|
content: group.two_content,
|
|
|
factor: group.two_factor,
|
|
|
- orderNo: group.two_orderNo,
|
|
|
+ orderNo: 0,
|
|
|
remark: group.two_remark,
|
|
|
resultType: group.two_resultType,
|
|
|
ruleCode: group.two_ruleCode,
|
|
@@ -602,7 +614,7 @@ export default {
|
|
|
klScaleDetail: [
|
|
|
{
|
|
|
content: group.content,
|
|
|
- orderNo: group.orderNo,
|
|
|
+ orderNo: 0,
|
|
|
pushInfo: group.pushInfo,
|
|
|
remark: group.remark,
|
|
|
result: group.result,
|
|
@@ -619,7 +631,7 @@ export default {
|
|
|
issueIdFindIndex
|
|
|
].klScaleDetail.push({
|
|
|
content: group.content,
|
|
|
- orderNo: group.orderNo,
|
|
|
+ orderNo: 0,
|
|
|
pushInfo: group.pushInfo,
|
|
|
remark: group.remark,
|
|
|
result: group.result,
|
|
@@ -631,11 +643,73 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- // 将groupArr赋值到提交数据中
|
|
|
- obj.klScaleParent[tableIndex].klScaleSaveGroup = groupArr;
|
|
|
+ // 10. 将groupArr赋值到提交数据中
|
|
|
+ params.klScaleParent[tableIndex].klScaleSaveGroup = groupArr;
|
|
|
});
|
|
|
|
|
|
- console.dir(obj);
|
|
|
+ // 11.将得分结果中的content转成字符串 max和min
|
|
|
+ const scoreresultPatam = this.scoreresults.scoreresultsdatas.map(
|
|
|
+ (item, index) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ orderNo: index,
|
|
|
+ content: JSON.stringify(item.content)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ );
|
|
|
+ // 12. 创建一个得分结果的表格 并将数据赋值上
|
|
|
+ const table = {
|
|
|
+ constant: 0,
|
|
|
+ content: "得分结果",
|
|
|
+ factor: 0,
|
|
|
+ klScaleSaveGroup: [
|
|
|
+ {
|
|
|
+ groupNum: 0,
|
|
|
+ klScaleSub: [
|
|
|
+ {
|
|
|
+ constant: 0,
|
|
|
+ content: "得分范围",
|
|
|
+ factor: 0,
|
|
|
+ klScaleDetail: [...scoreresultPatam],
|
|
|
+ orderNo: 0,
|
|
|
+ remark: "string",
|
|
|
+ resultType: 0,
|
|
|
+ ruleCode: "string",
|
|
|
+ score: 0,
|
|
|
+ selectType: 0,
|
|
|
+ status: 0,
|
|
|
+ textType: 0
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ orderNo: 0,
|
|
|
+ remark: "string",
|
|
|
+ resultType: 0,
|
|
|
+ ruleCode: "string",
|
|
|
+ score: 0,
|
|
|
+ status: 0,
|
|
|
+ textType: 13
|
|
|
+ };
|
|
|
+ // 13. 将得分结果加入到提交数据中
|
|
|
+ params.klScaleParent.push(table);
|
|
|
+ // 14 提交数据设置新的orderNo,删除issueId
|
|
|
+ params.klScaleParent.forEach((tableItem, tableIndex) => {
|
|
|
+ tableItem.orderNo = tableIndex;
|
|
|
+ tableItem.klScaleSaveGroup.forEach((groupItem, groupIndex) => {
|
|
|
+ groupItem.groupNum = groupIndex;
|
|
|
+ groupItem.klScaleSub.forEach((issueItem, issueIndex) => {
|
|
|
+ issueItem.orderNo = issueIndex;
|
|
|
+ issueItem.issueId && delete issueItem.issueId;
|
|
|
+ issueItem.klScaleDetail.forEach((optionItem, optionIndex) => {
|
|
|
+ optionItem.orderNo = optionIndex;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ console.dir(params);
|
|
|
+
|
|
|
// 提交数据的处理 end....
|
|
|
},
|
|
|
/**
|