...
|
...
|
@@ -4,7 +4,7 @@ export default { |
|
|
components: {},
|
|
|
props: {
|
|
|
// 资源名称
|
|
|
resName: {
|
|
|
textString: {
|
|
|
type: String,
|
|
|
default: 0
|
|
|
},
|
...
|
...
|
@@ -25,6 +25,10 @@ export default { |
|
|
type: String,
|
|
|
default: ''
|
|
|
},
|
|
|
resTypeId: {
|
|
|
type: String,
|
|
|
default: ''
|
|
|
},
|
|
|
|
|
|
},
|
|
|
data() {
|
...
|
...
|
@@ -45,15 +49,13 @@ export default { |
|
|
* 时间:2021/11/9 18:30
|
|
|
*/
|
|
|
let showDialog = (flg) => {
|
|
|
dialogFlg.value = flg;
|
|
|
|
|
|
if (favData.value.length == 0) {
|
|
|
// 加载收藏文件列表
|
|
|
proxy.$http.get(`/api-web/favorites/treeSelectData`, {}, function (res) {
|
|
|
if (res && res.data && res.data.length > 0) {
|
|
|
let arr = [];
|
|
|
let getChilds = (arr) => {
|
|
|
arr.forEach(function (v) {
|
|
|
let getChilds = (list) => {
|
|
|
list.forEach(function (v) {
|
|
|
if (v.children && v.children.length > 0) {
|
|
|
getChilds(v.children);
|
|
|
} else {
|
...
|
...
|
@@ -61,10 +63,15 @@ export default { |
|
|
}
|
|
|
})
|
|
|
}
|
|
|
getChilds(res.data);
|
|
|
favData.value = arr;
|
|
|
dialogFlg.value = flg;
|
|
|
} else {
|
|
|
proxy.$global.showMsg("没有查询到收藏夹,请先添加!","warning")
|
|
|
}
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
dialogFlg.value = flg;
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -76,12 +83,12 @@ export default { |
|
|
*/
|
|
|
let saveStart = () => {
|
|
|
if (props.resId == '') {
|
|
|
proxy.$global.showMsg("资源Id不存在,确认!")
|
|
|
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let params = {
|
|
|
favIds: favIds,
|
|
|
favIds: favIds.value.join(','),
|
|
|
resId: props.resId
|
|
|
}
|
|
|
proxy.$http.post(`/api-web/favorites/save/fav`, params, function (res) {
|
...
|
...
|
@@ -95,14 +102,14 @@ export default { |
|
|
|
|
|
let openTopoPage = () => {
|
|
|
if (props.resId == '') {
|
|
|
proxy.$global.showMsg("资源Id不存在,确认!")
|
|
|
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 查询topoId
|
|
|
proxy.$http.get(`/api-web/mxgraph/generateByResId`, {resId: props.resId}, function (res) {
|
|
|
if (response && response.success) {
|
|
|
let topoId = response.str;
|
|
|
if (res && res.success) {
|
|
|
let topoId = res.str;
|
|
|
proxy.$global.openGraphEditor(topoId)
|
|
|
} else {
|
|
|
proxy.$global.showMsg('生成资源拓扑失败!', "error");
|
...
|
...
|
@@ -111,12 +118,26 @@ export default { |
|
|
}
|
|
|
|
|
|
let openDetail = () => {
|
|
|
|
|
|
if (props.resId == '') {
|
|
|
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
let openCmdbAssets = () => {
|
|
|
proxy.$global.openCmdbAssets(props.resId);
|
|
|
if (props.resId == '') {
|
|
|
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (props.resTypeId == '') {
|
|
|
proxy.$global.showMsg("资源类型不存在,请确认!","warning")
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
proxy.$global.openCmdbAssets(props.resTypeId, props.resId, proxy);
|
|
|
|
|
|
}
|
|
|
|
|
|
return {
|
...
|
...
|
|