| | |
| | | { day: 6, time_range: [{ start: "00:00", end: "24:00" }] },
|
| | | { day: 7, time_range: [{ start: "00:00", end: "24:00" }] },
|
| | | ],
|
| | | isAdding: false,
|
| | | };
|
| | | },
|
| | | mounted() {
|
| | |
| | | handleTabsEdit(tabId, action) {
|
| | | let tabs = this.VideoManageData.TimeRules;
|
| | | if (action === "add") {
|
| | | let newRule = {
|
| | | id: "",
|
| | | name: "时间段" + this.VideoManageData.TimeRules.length,
|
| | | time_rule: this.allDay,
|
| | | };
|
| | | this.updateTimeRule(newRule);
|
| | | if (this.isAdding) {
|
| | | return;
|
| | | } else {
|
| | | this.isAdding = true;
|
| | | let newRule = {
|
| | | id: "",
|
| | | name: "时间段" + this.VideoManageData.TimeRules.length,
|
| | | time_rule: this.allDay,
|
| | | };
|
| | | this.updateTimeRule(newRule);
|
| | | }
|
| | | }
|
| | | if (action === "remove") {
|
| | | console.log();
|
| | |
|
| | | if (this.VideoManageData.TimeRules.length == 1) {
|
| | | this.$notify({
|
| | | title: "警告",
|
| | |
| | | console.log("时间组件宽度:", timeSlideWidth);
|
| | | },
|
| | | updateTimeRule(rule) {
|
| | | saveTimeRule(rule).then((rsp) => {
|
| | | if (rsp && rsp.success) {
|
| | | this.VideoManageData.getTimeRule();
|
| | | this.activeTab = rsp.data.id;
|
| | | }
|
| | | });
|
| | | saveTimeRule(rule)
|
| | | .then(async (rsp) => {
|
| | | if (rsp && rsp.success) {
|
| | | await this.VideoManageData.getTimeRule();
|
| | | this.isAdding = false;
|
| | | this.activeTab = rsp.data.id;
|
| | | } else {
|
| | | this.isAdding = false;
|
| | | }
|
| | | })
|
| | | .catch(() => {
|
| | | this.isAdding = false;
|
| | | });
|
| | | },
|
| | | tabClick(item) {
|
| | | if (this.activeTab === item.id) {
|