|
@@ -502,7 +502,6 @@ export default {
|
|
|
name: "upfile",
|
|
|
size: 1,
|
|
|
sizeError: (err) => {
|
|
|
- console.log("errrrrr", err);
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "请上传 1M 以内的图片!",
|
|
@@ -555,39 +554,38 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- numInputInput(value, len = 6, decimals = 1) {
|
|
|
+ numInputInput(value, len = 5, decimals = 1) {
|
|
|
// value:修改的数字 len 总长度 decimals:允许小数点后几位
|
|
|
+ //todo 5位整数数加一位小数
|
|
|
value += "";
|
|
|
- if (value.length > len) value = value.slice(0, len);
|
|
|
- if (value.length == 0) {
|
|
|
- return null;
|
|
|
- }
|
|
|
let index = value.lastIndexOf(".");
|
|
|
if (index != -1) {
|
|
|
- index += 1;
|
|
|
- let str = value.slice(0, index + decimals);
|
|
|
- return parseFloat(str);
|
|
|
+ let [int, dec] = value.split(".");
|
|
|
+ if (dec.length > decimals) {
|
|
|
+ dec = dec.slice(0, dec.length - 1);
|
|
|
+ }
|
|
|
+ if (int.length > len) {
|
|
|
+ int = int.slice(0, int.length - 1);
|
|
|
+ }
|
|
|
+ return parseFloat(int + "." + dec);
|
|
|
+ }
|
|
|
+ if (value.length > len) {
|
|
|
+ value = value.slice(0, value.length - 1);
|
|
|
}
|
|
|
-
|
|
|
return parseFloat(value);
|
|
|
},
|
|
|
clearValidate(data) {
|
|
|
this.$refs.ScoreResultsRef.clearValidate(data);
|
|
|
},
|
|
|
getDom(ref) {
|
|
|
- console.log("getBoundingClientRect", document.getElementById(ref));
|
|
|
- // const dom = this.getElementTop(document.getElementById(ref));
|
|
|
let dom = document.getElementById(ref).getBoundingClientRect().top;
|
|
|
- console.log("dom,dom", dom);
|
|
|
return dom;
|
|
|
},
|
|
|
CHANGE_ISSUE_CONTENT(data) {
|
|
|
const { value, tableIndex, rowIndex, name } = data;
|
|
|
- console.log(value, tableIndex, rowIndex, name);
|
|
|
const thisIssueId =
|
|
|
this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup[rowIndex]
|
|
|
.issueId;
|
|
|
- console.log(thisIssueId);
|
|
|
this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.forEach(
|
|
|
(item) => {
|
|
|
if (item.issueId === thisIssueId) item[name] = value;
|
|
@@ -904,7 +902,6 @@ export default {
|
|
|
const top = document.getElementById(id).getBoundingClientRect().top;
|
|
|
this.$emit("scrollTo", top);
|
|
|
// `klScaleParent[${tableIndex}].content`
|
|
|
- console.log(this.$refs[`klScaleParent[${tableIndex}].content`]);
|
|
|
const inp = this.$refs[`klScaleParent[${tableIndex + 1}].content`];
|
|
|
inp && inp[0].focus();
|
|
|
}, 50);
|
|
@@ -1069,7 +1066,6 @@ export default {
|
|
|
tableIndex
|
|
|
].klScaleSaveGroup.filter((item) => item.issueId === issueId);
|
|
|
copyIssueData = JSON.parse(JSON.stringify(copyIssueData));
|
|
|
- console.dir(copyIssueData);
|
|
|
let newIssueIdArrIssue = [];
|
|
|
copyIssueData.forEach((item, i, arr) => {
|
|
|
if (i === 0 || item.issueId !== arr[i - 1].issueId) {
|
|
@@ -1121,7 +1117,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
resizeTable() {
|
|
|
- console.log("!!!!");
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.ScaleTable.forEach((item) => {
|
|
|
item.resizeTable();
|
|
@@ -1134,11 +1129,9 @@ export default {
|
|
|
initText() {
|
|
|
"upload";
|
|
|
let quillArr;
|
|
|
- console.log("this.$refs.scalequillEditor", this.$refs.scalequillEditor);
|
|
|
if (this.$refs.scalequillEditor && this.$refs.scalequillEditor.length) {
|
|
|
quillArr = this.$refs.scalequillEditor;
|
|
|
}
|
|
|
- console.log("s_quill", quillArr);
|
|
|
// return;
|
|
|
quillArr &&
|
|
|
quillArr.forEach((item) => {
|
|
@@ -1146,27 +1139,22 @@ export default {
|
|
|
quill.root.addEventListener(
|
|
|
"paste",
|
|
|
(evt) => {
|
|
|
- console.log("evt", evt);
|
|
|
if (
|
|
|
evt.clipboardData &&
|
|
|
evt.clipboardData.files &&
|
|
|
evt.clipboardData.files.length
|
|
|
) {
|
|
|
- console.log("ddadada");
|
|
|
evt.preventDefault();
|
|
|
[].forEach.call(evt.clipboardData.files, (file) => {
|
|
|
- console.log("file", file);
|
|
|
if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i))
|
|
|
return;
|
|
|
if (file.size > 1024 * 1000) return;
|
|
|
let formData = new FormData();
|
|
|
formData.append("upfile", file);
|
|
|
api.uploadFile(formData).then((res) => {
|
|
|
- console.log("formData", res);
|
|
|
if (res.data.code == "0") {
|
|
|
let imgUrl = config.imgHost + res.data.data.url;
|
|
|
var range = quill.getSelection();
|
|
|
- console.log("range", range);
|
|
|
if (range) {
|
|
|
// this.uploadAttachment(res, file, null);
|
|
|
let length = quill.getSelection().index;
|
|
@@ -1214,17 +1202,12 @@ export default {
|
|
|
};
|
|
|
|
|
|
this.childScaleData.klScaleDetail.forEach((table, tableIndex) => {
|
|
|
- console.log("?????");
|
|
|
if (table.textType === 13) {
|
|
|
// 计算结果
|
|
|
scoreresults.scoreresultsdatas = table.subMenuList[0].subMenuList;
|
|
|
scoreresults.scoreresultsdatas.forEach((item) => {
|
|
|
item.content = JSON.parse(item.content);
|
|
|
});
|
|
|
- console.log(
|
|
|
- "scoreresults.scoreresultsdatas",
|
|
|
- scoreresults.scoreresultsdatas
|
|
|
- );
|
|
|
} else if (table.textType === 11) {
|
|
|
// 选项
|
|
|
obj.klScaleParent.push({
|