|
@@ -612,31 +612,46 @@ function openAddToMyETADialog(){
|
|
|
isShowAddToMyETADialog.value = true
|
|
|
}
|
|
|
//删除图表
|
|
|
-function deleteChart(){
|
|
|
- console.log(routeQueryData);
|
|
|
-
|
|
|
+async function deleteChart(){
|
|
|
+ const res = await apiChart.deleteCheck({
|
|
|
+ ChartClassifyId:Number(routeQueryData.chartClassifyId),
|
|
|
+ ChartInfoId:Number(routeQueryData.id),
|
|
|
+ })
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ const hintTextMap = {
|
|
|
+ 0:'确定删除当前分类吗?',
|
|
|
+ 1:'该分类下关联图表不可删除!',
|
|
|
+ 2:'确认删除当前分类及包含的子分类吗?',
|
|
|
+ 3:'删除后,该图表将从ETA投研资源库同步删除,影响客户的查看权限,是否确认删除?'
|
|
|
+ }
|
|
|
showDialog({
|
|
|
title: '提示',
|
|
|
- message: '删除后该图表将不能再引用,确认删除吗?',
|
|
|
- showCancelButton:true
|
|
|
+ message: hintTextMap[res.Data.DeleteStatus||0],
|
|
|
+ showCancelButton:res.Data.DeleteStatus!==1
|
|
|
}).then(() => {
|
|
|
- apiChart.deleteClassify({
|
|
|
- ChartClassifyId:Number(routeQueryData.chartClassifyId),
|
|
|
- ChartInfoId:Number(routeQueryData.id),
|
|
|
- }).then(res=>{
|
|
|
- if(res.Ret===200){
|
|
|
- cachedViewsStore.removeCaches('ChartETAList')
|
|
|
- cachedViewsStore.removeCaches('ChartETASearch')
|
|
|
- showToast('删除成功')
|
|
|
- setTimeout(() => {
|
|
|
- router.back()
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(()=>{
|
|
|
-
|
|
|
+ if(res.Data.DeleteStatus!==1){
|
|
|
+ handleDeleteRequest()
|
|
|
+ }
|
|
|
+ }).catch(()=>{})
|
|
|
+}
|
|
|
+
|
|
|
+// 删除请求
|
|
|
+function handleDeleteRequest(){
|
|
|
+ apiChart.deleteClassify({
|
|
|
+ ChartClassifyId:Number(routeQueryData.chartClassifyId),
|
|
|
+ ChartInfoId:Number(routeQueryData.id),
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ cachedViewsStore.removeCaches('ChartETAList')
|
|
|
+ cachedViewsStore.removeCaches('ChartETASearch')
|
|
|
+ showToast('删除成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ router.back()
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
// 保存至素材库
|
|
|
const showSaveToMaterial=ref(false)
|
|
|
function handleShowSaveToMaterial(){
|