|
@@ -373,11 +373,18 @@ export default {
|
|
|
},
|
|
|
// 删除提示选项
|
|
|
deleteHint(index) {
|
|
|
- if (this.curQue.hintOtion.length <= 1) {
|
|
|
- this.$message.warning("至少要保留一个选项");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.curQue.hintOtion.splice(index, 1);
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (this.curQue.hintOtion.length <= 1) {
|
|
|
+ this.$message.warning("至少要保留一个选项");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.curQue.hintOtion.splice(index, 1);
|
|
|
+ })
|
|
|
},
|
|
|
// 增加提示选项
|
|
|
addHint() {
|
|
@@ -463,35 +470,49 @@ export default {
|
|
|
},
|
|
|
// 删除行
|
|
|
removeRow(index) {
|
|
|
- if (this.curQue.option.length <= 1) {
|
|
|
- this.$message.warning("至少要保留一行");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.curQue.option.forEach((item, i) => {
|
|
|
- if (i == index) {
|
|
|
- this.curQue.option.splice(i, 1);
|
|
|
- }
|
|
|
- });
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (this.curQue.option.length <= 1) {
|
|
|
+ this.$message.warning("至少要保留一行");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.curQue.option.forEach((item, i) => {
|
|
|
+ if (i == index) {
|
|
|
+ this.curQue.option.splice(i, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
// 删除列
|
|
|
removeCol(index) {
|
|
|
- if (this.curQue.option[0].length <= 1) {
|
|
|
- this.$message.warning("至少要保留一列");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.curQue.option.forEach((item) => {
|
|
|
- item.forEach((it, i) => {
|
|
|
- if (i == index) {
|
|
|
- item.splice(i, 1);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- this.curQue.headerList.forEach((item, i) => {
|
|
|
- if (i == index) {
|
|
|
- this.curQue.headerList.splice(i, 1);
|
|
|
- }
|
|
|
- });
|
|
|
- this.curQue.colWidthList.splice(index, 1);
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (this.curQue.option[0].length <= 1) {
|
|
|
+ this.$message.warning("至少要保留一列");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.curQue.option.forEach((item) => {
|
|
|
+ item.forEach((it, i) => {
|
|
|
+ if (i == index) {
|
|
|
+ item.splice(i, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.curQue.headerList.forEach((item, i) => {
|
|
|
+ if (i == index) {
|
|
|
+ this.curQue.headerList.splice(i, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.curQue.colWidthList.splice(index, 1);
|
|
|
+ })
|
|
|
},
|
|
|
// 删除td
|
|
|
removeTd(rowi, coli) {
|
|
@@ -539,15 +560,22 @@ export default {
|
|
|
},
|
|
|
// 删除其中一个表头
|
|
|
deleteHeader(index) {
|
|
|
- if (this.curQue.headerList.length <= 1) {
|
|
|
- this.$message.warning("至少要保留一个表头");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.curQue.headerList.splice(index, 1);
|
|
|
- this.curQue.option.forEach((item) => {
|
|
|
- item.splice(index, 1);
|
|
|
- });
|
|
|
- this.curQue.colWidthList.splice(index, 1);
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (this.curQue.headerList.length <= 1) {
|
|
|
+ this.$message.warning("至少要保留一个表头");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.curQue.headerList.splice(index, 1);
|
|
|
+ this.curQue.option.forEach((item) => {
|
|
|
+ item.splice(index, 1);
|
|
|
+ });
|
|
|
+ this.curQue.colWidthList.splice(index, 1);
|
|
|
+ })
|
|
|
},
|
|
|
//添加一个表头
|
|
|
addHeader() {
|