| | |
| | | return;
|
| | | } else {
|
| | | this.isAdding = true;
|
| | | let name = "时间段1";
|
| | |
|
| | | for (
|
| | | let index = this.VideoManageData.TimeRules.length;
|
| | | index > 0;
|
| | | index--
|
| | | ) {
|
| | | const sliceIndex =
|
| | | this.VideoManageData.TimeRules[index - 1].name.indexOf("时间段");
|
| | |
|
| | | if (sliceIndex != -1) {
|
| | | const number = +this.VideoManageData.TimeRules[
|
| | | index - 1
|
| | | ].name.slice(sliceIndex + 3);
|
| | |
|
| | | console.log(number);
|
| | | console.log(typeof number);
|
| | | console.log(typeof NaN);
|
| | |
|
| | | if (
|
| | | typeof number === "number" &&
|
| | | !Number.isNaN(number) &&
|
| | | number != 0
|
| | | ) {
|
| | | console.log("--------------");
|
| | |
|
| | | name = "时间段" + (number + 1);
|
| | |
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | let newRule = {
|
| | | id: "",
|
| | | name: "时间段" + this.VideoManageData.TimeRules.length,
|
| | | name: name,
|
| | | time_rule: this.allDay,
|
| | | };
|
| | |
|
| | | this.updateTimeRule(newRule);
|
| | | }
|
| | | }
|
| | |
| | | if (rsp && rsp.success) {
|
| | | await this.VideoManageData.getTimeRule();
|
| | | this.isAdding = false;
|
| | | this.activeTab = rsp.data.id;
|
| | | this.$nextTick(() => {
|
| | | this.activeTab =
|
| | | this.VideoManageData.TimeRules[
|
| | | this.VideoManageData.TimeRuleSum - 1
|
| | | ].id;
|
| | | });
|
| | | } else {
|
| | | this.isAdding = false;
|
| | | }
|
| | |
| | | },
|
| | | };
|
| | | </script>
|
| | | <style lang='scss'>
|
| | | <style lang="scss">
|
| | | .sub-time-box {
|
| | | padding-right: 30px;
|
| | | position: relative;
|
| | |
| | | // z-index: 1;
|
| | | // }
|
| | | }
|
| | | </style> |
| | | </style>
|