| | |
| | | import { getAllTimeRule, saveTimeRule } from "@/api/timeRule"; |
| | | import { findDictionaryByType } from "@/api/dictionary"; |
| | | import { findBaseByRuleEditor } from "@/api/es"; |
| | | import { getAllTimeRule, saveTimeRule } from "@/api/timeRule" |
| | | import { findDictionaryByType } from "@/api/dictionary" |
| | | import { findBaseByRuleEditor } from "@/api/es" |
| | | |
| | | const AllDayRule = [ |
| | | { day: 1, time_range: [{ start: "00:00", end: "24:00" }] }, |
| | |
| | | { day: 7, time_range: [{ start: "00:00", end: "24:00" }] } |
| | | ] |
| | | |
| | | |
| | | export default class VideoManageData { |
| | | public SepTasks: Array<object> = []; |
| | | public TimeRules: Array<object> = []; |
| | | public Dictionary: object = {}; |
| | | public TagList: Array<object> = []; |
| | | public TimeRuleSum: number = 0; |
| | | public SepTasks: Array<object> = [] |
| | | public TimeRules: Array<object> = [] |
| | | public Dictionary: object = {} |
| | | public TagList: Array<object> = [] |
| | | public TimeRuleSum: number = 0 |
| | | |
| | | public init() { |
| | | // this.getAllSeparateTasks(); |
| | | this.getTimeRule(); |
| | | this.getDictionary(); |
| | | // this.getTagList(); |
| | | this.getTimeRule() |
| | | this.getDictionary() |
| | | // this.getTagList(); |
| | | } |
| | | |
| | | public async getTimeRule() { |
| | | let rsp: any = await getAllTimeRule(); |
| | | console.log(rsp); |
| | | let rsp: any = await getAllTimeRule("") |
| | | console.log(rsp) |
| | | |
| | | if (rsp && rsp.success) { |
| | | this.TimeRules = rsp.data.timeRules; |
| | | this.TimeRules = rsp.data.timeRules |
| | | this.TimeRuleSum = this.TimeRules.length |
| | | } |
| | | |
| | |
| | | id: "", |
| | | name: "全天", |
| | | time_rule: AllDayRule |
| | | }; |
| | | } |
| | | |
| | | rsp = await saveTimeRule(newRule) |
| | | if (rsp && rsp.success) { |
| | | this.getTimeRule(); |
| | | this.getTimeRule() |
| | | } |
| | | } |
| | | } |
| | | |
| | | public async getDictionary() { |
| | | const rsp: any = await findDictionaryByType(); |
| | | const rsp: any = await findDictionaryByType() |
| | | if (rsp && rsp.success) { |
| | | this.Dictionary = rsp.data; |
| | | this.Dictionary = rsp.data |
| | | } |
| | | } |
| | | |
| | | public async getTagList() { |
| | | const rsp: any = await findBaseByRuleEditor(); |
| | | const rsp: any = await findBaseByRuleEditor() |
| | | if (rsp && rsp.success) { |
| | | this.TagList = rsp.data; |
| | | this.TagList = rsp.data |
| | | } |
| | | } |
| | | } |