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

座位图修改

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