Commit 9217f8e6 authored by WUYING\505623963_1041864935's avatar WUYING\505623963_1041864935

Merge branch 'master' of http://120.27.1.210:43210/huiwan/op53

parents 2bce16e9 8eb85009
......@@ -183,7 +183,8 @@
<div style="margin-right: 20px;width: 150px;text-align: right;">
<span style="line-height: 55px;">文字分组</span>
</div>
<div style="display: flex; justify-items: center; padding-top: 10px">
<div *ngIf="item.titleGroup.length<item.title.length"
style="display: flex; justify-items: center; padding-top: 10px">
<button style="margin-bottom: 10px;" nz-button nzType="default" (click)="addGroup(i)">
<span>增加分组</span>
</button>
......
......@@ -186,19 +186,72 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
deleteGroup(i, n) {
let item = this.picArr.list[i];
item.titleGroup.splice(n, 1);
let delArr = item.titleGroupUseWord[n];
item.titleGroupUseWord.forEach((arr, index) => {
if (index == n) return;
for (let m = 0; m < delArr.length; m++) {
if (delArr[m] == 0) arr[m] = 0;
}
})
item.titleGroupUseWord.splice(n, 1);
let lastArr = [];
item.titleGroupUseWord.forEach((arr, index) => {
for (let m = 0; m < arr.length; m++) {
if (arr[m] == 1) {
lastArr[m] = 1;
} else {
if (lastArr[m] != 1) {
lastArr[m] = 0;
}
}
}
})
item.titleGroupUseWord.push(lastArr);
if (item.titleGroup.length == 0) item.titleGroupUseWord.length = 0;
this.save();
}
onChoseGroup(arr, i, val, item, n) {
console.log(arr);
arr[i] = val;
for (let index = 0; index < item.title.split("").length; index++) {
if (n == index) continue;
if (n == index) {
if (!item.titleGroupUseWord[index]) item.titleGroupUseWord[index] = [];
item.titleGroupUseWord[index][i] = 0;
console.log(item.titleGroupUseWord[index])
continue;
}
if (!item.titleGroupUseWord[index]) item.titleGroupUseWord[index] = [];
item.titleGroupUseWord[index][i] = val;
}
this.save();
}
// refreshUserWord(item) {
// let tg = item.titleGroup;
// tg.forEach((t, n) => {
// let inx = t.index;
// if (inx.length < item.title.split("").length) inx.length = item.title.split("").length;
// for (let i = 0; i < inx.length; i++) {
// let u = inx[i];
// this.updateUserWord(u, i, item)
// }
// })
// }
// updateUserWord(num, pos, item) {
// let uw = item.titleGroupUseWord;
// for (let i = 0; i < uw.length; i++) {
// let u = uw[i];
// if (!u) u = [];
// for (let j = 0; j < u.length; j++) {
// if (j == pos) {
// u[j] = num || 0;
// break;
// }
// }
// }
// }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment