Commit 486a8f14 authored by 黄奎's avatar 黄奎

座位图修改

parent 65772c55
...@@ -410,72 +410,128 @@ ...@@ -410,72 +410,128 @@
var flag = col_input % 2 == 1 ? true : false; var flag = col_input % 2 == 1 ? true : false;
var rightArray = []; var rightArray = [];
var leftArray = []; var leftArray = [];
for (var i = 0; i < newObj.ColumnArray.length; i++) { var leftCount = 0;
//单数列 var rightCount = 0;
if (flag) {
if ((i + 1) < middleIndex) { var shopType = 2;
if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') { var leftNewArray = [];
leftArray.push('0'); var rightNewArray = [];
var newArray =[];
var resultArray = [];
if (shopType == 1) {
for (var i = 0; i < newObj.ColumnArray.length; i++) {
//单数列
if (flag) {
if ((i + 1) < middleIndex) {
if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') {
leftArray.push('0');
}
else {
leftArray.push(i + 1);
leftCount++;
}
} }
else { else {
leftArray.push(i + 1); if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') {
rightArray.push('0');
}
else {
rightArray.push(i + 1);
rightCount++;
}
} }
} }
//双数列
else { else {
if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') { if ((i + 1) <= middleIndex) {
rightArray.push('0'); if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') {
leftArray.push('0');
}
else {
leftArray.push(i + 1);
leftCount++;
}
} }
else { else {
rightArray.push(i + 1); if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') {
rightArray.push('0');
}
else {
rightArray.push(i + 1);
rightCount++;
}
} }
} }
} }
//双数列 var leftIndex = 1;
else { for (var i = leftArray.length - 1; i >= 0; i--) {
if ((i + 1) <= middleIndex) { if (leftArray[i] != "0") {
if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') { leftNewArray.push(leftIndex * 2);
leftArray.push('0'); leftIndex++;
} }
else { else {
leftArray.push(i + 1); leftNewArray.push("0");
} }
}
var rightIndex = 1;
for (var i = 0; i < rightArray.length; i++) {
if (rightArray[i] != "0") {
rightNewArray.push((rightIndex * 2 - 1));
rightIndex++;
}
else {
rightNewArray.push("0");
}
}
newArray = leftNewArray.reverse();
resultArray = newArray.concat(rightNewArray);
}
else {
var singleArray = [];
var doubleArray = [];
var newObjArray = [];
var chooseIndex = 1;
for (var i = 0; i < newObj.ColumnArray.length; i++) {
if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') {
newObjArray.push({ ID: i, Value: 0 });
} }
else { else {
if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') { if (i % 2 == 0) {
rightArray.push('0'); singleArray.push(chooseIndex);
} }
else { else {
rightArray.push(i + 1); doubleArray.push(chooseIndex);
} }
chooseIndex++;
newObjArray.push({ID:i,Value:1});
} }
} }
}
var leftIndex = 1;
var leftNewArray = [];
for (var i = leftArray.length - 1; i >= 0; i--) {
if (leftArray[i] != "0") {
leftNewArray.push(leftIndex * 2);
leftIndex++;
}
else {
leftNewArray.push("0");
}
}
var rightIndex = 1; var doubleIndex = 0;
var rightNewArray = []; var singleIndex = 0;
for (var i = 0; i < rightArray.length; i++) { if (doubleArray != null && doubleArray.length > 0) {
if (rightArray[i] != "0") { doubleIndex = doubleArray.length - 1;
rightNewArray.push((rightIndex * 2 - 1));
rightIndex++;
} }
else { for (var i = 0; i < newObjArray.length; i++) {
rightNewArray.push("0"); if (newObjArray[i].Value == 1) {
if (doubleIndex >= 0) {
resultArray.push(doubleArray[doubleIndex]);
doubleIndex--;
}
else {
if (singleIndex < singleArray.length) {
resultArray.push(singleArray[singleIndex]);
singleIndex++;
}
}
}
else {
resultArray.push("0");
}
} }
} }
var newArray = leftNewArray.reverse();
var resultArray = newArray.concat(rightNewArray);
for (var k = 0; k < newObj.ColumnArray.length; k++) { for (var k = 0; k < newObj.ColumnArray.length; k++) {
newObj.ColumnArray[k].col = resultArray[k]; newObj.ColumnArray[k].col = resultArray[k];
} }
...@@ -507,7 +563,6 @@ ...@@ -507,7 +563,6 @@
} }
} }
} }
} }
else if (isAdd == 0 && newObj.rowIndex == "") { else if (isAdd == 0 && newObj.rowIndex == "") {
newObj.rowIndex = (dataRowIndex + 1) + "排"; newObj.rowIndex = (dataRowIndex + 1) + "排";
...@@ -532,7 +587,6 @@ ...@@ -532,7 +587,6 @@
} }
} }
} }
} }
else { else {
SeatData.replace(SeatData()[dataRowIndex], newObj); SeatData.replace(SeatData()[dataRowIndex], newObj);
......
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