import {getSchemeDataToTheme} from "@/api/ThemeAnalize" import {setSchemeData} from "@/api/ThemeAnalize" import {delCarBigDataByGuid} from "@/api/ThemeAnalize" import {getSchemeDataByGuid} from "@/api/ThemeAnalize" export default { getNowData() { let obj = Object.assign({}, this.form); getSchemeDataToTheme(obj).then(res => { let data = res.data; let themeArr = []; data.forEach(ele => { let obj = { guids: ele.Guids, name: ele.Name, startTime: ele.StartTime, endTime: ele.EndTime, total: ele.ReportSum, isCom: true }; //判断是否到期 if(new Date(ele.EndTime) <= new Date(this.getDatetime().clock + '' + this.getDatetime().sClock)) { obj.isCom = false } themeArr.push(obj); }) this.myThemeArr = themeArr; }) }, //回退 goBack() { this.setHeaderType(3); this.$router.go(-1); }, //新增按钮 handlerAdd() { this.modalObj.title = '新建主题' this.reSet(); this.combo = { number: 0, display: [] }; this.combo2 = { number: 0, display: [] }; this.modalObj.visible = true }, //编辑修改 handlerEdit(guids) { this.modalObj.title = '编辑主题' let obj = { token: this.getToken, Guids: guids }; getSchemeDataByGuid(obj).then(res => { let data = res.data; this.addForm = data; this.selTime = [data.StartTime, data.EndTime]; if(data.DetailsData[0].IsAdvancedQuery == 1) { this.changeMode(1) } else if(data.DetailsData[0].IsAdvancedQuery == 2) { this.changeMode(0); this.handlerHH(1); } else { this.changeMode(0); this.handlerHH(0); } this.doCombo(); this.doCombo2(); this.modalObj.visible = true; }) }, //删除 handlerDel(guids) { let obj = { token: this.getToken, Guids: guids } delCarBigDataByGuid(obj).then(() => { this.getNowData(); }) }, //删除确认框 cancel() {}, onClose() { this.modalObj.visible = false; }, //新增确认框 handlerOk() { let newForm = { token: "", DataJson: "" }; newForm.token = this.getToken; newForm.DataJson = JSON.stringify(this.addForm); let obj = Object.assign({}, newForm); setSchemeData(obj).then(res => { this.getNowData(); this.reSet(); }) this.modalObj.visible = false; }, handlerCancel() { this.addForm.Guids = null; this.reSet(); this.modalObj.visible = false; }, //配置示例 doCombo() { let bArr = this.addForm.DetailsData[0].AnalyzeWord.replace(/,/g,','); let bWord = bArr.split(','); let hArr = this.addForm.DetailsData[0].HuoWord.replace(/,/g,','); let hWord = hArr.split(','); let arr = []; let bString = ''; for(let i=0;i { let str = ''; if(ele != '') { str = bString + '+' + ele.trim(); } else { str = bString + ele.trim(); } arr.push(str) }) this.combo.display = arr; this.combo.number = arr.length; }, doCombo2() { let bArr = this.addForm.DetailsData[0].AnalyzeWord.replace(/,/g,','); let bWord = bArr.split(','); let hArr = this.addForm.DetailsData[0].HuoWord.replace(/,/g,','); let hWord = hArr.split(','); let hArr1 = this.addForm.DetailsData[0].HuoWord1.replace(/,/g,','); let hWord1 = hArr1.split(','); let arr = []; for(let i = 0; i { let data = res.data; sTime = data.StartTime; eTime = data.EndTime; this.$router.push( { path: '/ThemeData', query: { sGuid: guids, name: name }, } ) }) }, //日期 calendarPriceRangeChange(date) { this.selectPriceDate = date[0]; }, handlerChangeTime(val) { this.addForm.StartTime = val[0]; this.addForm.EndTime = val[1]; this.selectPriceDate = ""; }, disabledDate(current) { return false; }, //主题对比 handlerCompare() { this.$router.push( { path: '/ThemeComparison' } ) } }