Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangjiahao 2021-12-09 14:58:21 +08:00
commit 6b0acb4967
6 changed files with 31 additions and 11 deletions

View File

@ -32,7 +32,12 @@ public interface StoreApi {
@ApiOperation("移除收藏")
@PostMapping("/remove/{storeId}")
void remove(@PathVariable("storeId") String storeId);
@PostMapping("/remove/{panelId}")
void remove(@PathVariable("panelId") String panelId);
@ApiOperation("收藏状态")
@PostMapping("/status/{id}")
Boolean hasStar(@PathVariable("id") String id);
}

View File

@ -29,4 +29,9 @@ public class StoreServer implements StoreApi {
public void remove(String panelId) {
storeService.removeByPanelId(panelId);
}
@Override
public Boolean hasStar(String id) {
return storeService.count(id) > 0L;
}
}

View File

@ -53,4 +53,11 @@ public class StoreService {
return extPanelStoreMapper.query(example);
}
public Long count(String panelId) {
PanelStoreExample example = new PanelStoreExample();
example.createCriteria().andUserIdEqualTo(AuthUtils.getUser().getUserId()).andPanelGroupIdEqualTo(panelId);
return panelStoreMapper.countByExample(example);
}
}

View File

@ -25,3 +25,10 @@ export function enshrineList(data) {
})
}
export function starStatus(panelId) {
return request({
url: '/api/store/status/' + panelId,
method: 'post',
loading: true
})
}

View File

@ -172,10 +172,7 @@ export default {
}
},
watch: {
'chart.xaxis': function() {
this.isEnableCompare()
},
'chart.extStack': function() {
'chart': function() {
this.isEnableCompare()
}
},
@ -198,7 +195,7 @@ export default {
const t2 = extStack.filter(ele => {
return ele.deType === 1
})
if (t1.length > 0 || t2.length > 0) {
if ((t1.length > 0 || t2.length > 0) && this.chart.type !== 'text' && this.chart.type !== 'gauge' && this.chart.type !== 'liquid') {
this.disableEditCompare = false
} else {
this.disableEditCompare = true

View File

@ -125,7 +125,7 @@ import SaveToTemplate from '@/views/panel/list/SaveToTemplate'
import { mapState } from 'vuex'
import html2canvas from 'html2canvasde'
import FileSaver from 'file-saver'
import { enshrineList, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import bus from '@/utils/bus'
import { queryAll } from '@/api/panel/pdfTemplate'
import ShareHead from '@/views/panel/GrantAuth/ShareHead'
@ -294,9 +294,8 @@ export default {
})
},
initHasStar() {
const param = {}
enshrineList(param).then(res => {
this.hasStar = res.data && res.data.some(item => item.panelGroupId === this.panelInfo.id)
starStatus(this.panelInfo.id).then(res => {
this.hasStar = res.data
})
},
refreshStarList(isStar) {