| | |
| | | :key="item.id" |
| | | :class="{ active: activeTabObj.id === item.id }" |
| | | > |
| | | <div class="tab" @click="chooseTab(item)"> |
| | | <div |
| | | class="tab" |
| | | @click="chooseTab(item)" |
| | | @dblclick="chooseEdit(item)" |
| | | > |
| | | {{ item.name }} |
| | | </div> |
| | | <div class="iconfont del" @click="handleTabsEdit(item.id, 'remove')"> |
| | |
| | | time_rule: JSON.parse(data.time_rule), |
| | | }; |
| | | }); |
| | | }, |
| | | chooseEdit(data) { |
| | | this.$prompt("请输入新的场景名称", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | }) |
| | | .then(({ value }) => { |
| | | this.activeTabObj.name = value; |
| | | this.save(); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | handleTabsEdit(tabId, action) { |
| | |
| | | this.isAdding = false; |
| | | }) |
| | | .catch(() => { |
| | | this.$notify({ |
| | | type: "warning", |
| | | message: rsp.msg, |
| | | }); |
| | | this.isAdding = false; |
| | | }); |
| | | }, |