...
|
...
|
@@ -96,17 +96,15 @@ export default { |
|
|
align: 'center',
|
|
|
render: function (row) {
|
|
|
if(row.resType == 'HOST_X86SERVER'){
|
|
|
//初始化select内容
|
|
|
/* var html='<div><select data-resId="'+d.resId+'" data-username="'+username+'" data-index="99" name="showType" class="layui-input user_showType" style="min-width: 150px;display: inline">';
|
|
|
let span='<span>';
|
|
|
showTypeList.value.map((v,i)=>{
|
|
|
if(d.showType == v.value){
|
|
|
html += '<option value="' + v.value + '" selected>' + v.name + '</option> '
|
|
|
}else{
|
|
|
html += '<option value="' + v.value + '">' + v.name + '</option> '
|
|
|
if(row.showType == v.value){
|
|
|
span += v.name
|
|
|
}
|
|
|
})
|
|
|
html+='</select></div>';
|
|
|
return html;*/
|
|
|
span+='</span>';
|
|
|
return span;
|
|
|
|
|
|
}else{
|
|
|
return '';
|
|
|
}
|
...
|
...
|
@@ -116,19 +114,12 @@ export default { |
|
|
|
|
|
//列表数据
|
|
|
let resourceData = Vue.ref([]);
|
|
|
|
|
|
//资源数据
|
|
|
let resIdArr = Vue.ref([]);
|
|
|
|
|
|
|
|
|
//获取列表数据
|
|
|
const getListData = () => {
|
|
|
|
|
|
let username=proxy.$route.query.username;
|
|
|
let resName=proxy.$route.query.resName;
|
|
|
//定义列表参数
|
|
|
let getParams = {
|
|
|
resIds: resIdArr.value.join(','),
|
|
|
resType:search.value.resType,
|
|
|
keyword:search.value.keyword,
|
|
|
resName: resName,
|
...
|
...
|
@@ -144,10 +135,21 @@ export default { |
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
//重新加载表格数据
|
|
|
let loadTableDataList = ({page, limit}) => {
|
|
|
search.value.page=page;
|
|
|
search.value.limit=limit;
|
|
|
getListData();
|
|
|
}
|
|
|
let resIds=Vue.ref('');//选中的ids
|
|
|
//表格全选事件
|
|
|
let selectionChange = (val) => {
|
|
|
pitch.value = val;
|
|
|
let arr=[];
|
|
|
pitch.value.map(item=>{
|
|
|
arr.push(item.resId)
|
|
|
})
|
|
|
resIds.value=arr.join(",");//选中的值
|
|
|
proxy.resourceData.map((v, i) => {
|
|
|
v.checked = false;
|
|
|
});
|
...
|
...
|
@@ -166,28 +168,47 @@ export default { |
|
|
})
|
|
|
}
|
|
|
}
|
|
|
//获取资源类型数据
|
|
|
let getResourceTypoe=()=>{
|
|
|
proxy.$http.get(`/api-web/manage/restype/list`, {}, function (res) {
|
|
|
if (res && res.data) {
|
|
|
resTypeOptions.value=res.data
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//获取展示类型的字典数据
|
|
|
let initShowType=()=>{
|
|
|
proxy.$http.post("/api-web/manage/ddic/findSucDdics/DETAILS_POWER", {}, function (res) {
|
|
|
if (res && res.success) {
|
|
|
let arr=res.data;
|
|
|
if(arr && arr.length>0){
|
|
|
arr.map(v=>{
|
|
|
showTypeList.value.push({
|
|
|
name: v.ddicName
|
|
|
,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length)
|
|
|
});
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//批量取消相关资源
|
|
|
let changeCancel = () => {
|
|
|
console.log("123654",pitch.value)
|
|
|
if(pitch.value.length<1){
|
|
|
proxy.$global.showMsg('请至少选择一项','warning');
|
|
|
|
|
|
}else{
|
|
|
proxy.$global.confirm("确定取消相关资源?", function () {
|
|
|
proxy.$global.showMsg('取消成功!');
|
|
|
|
|
|
// proxy.$http.get(`/api-web/alarmsubscribe/exclude/delete/${row.id}`, {}, function (res) {
|
|
|
// proxy.$http.get(`/api-web/`, {resIds:resIds.value}, function (res) {
|
|
|
// if (res && res.success) {
|
|
|
// proxy.$global.showMsg('取消成功!');
|
|
|
// getListData()
|
|
|
// }
|
|
|
// })
|
|
|
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//变更负责人
|
|
|
let changeAdmin = () => {
|
|
|
if(pitch.value.length<1){
|
...
|
...
|
@@ -198,14 +219,6 @@ export default { |
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//重新加载表格数据
|
|
|
let loadTableDataList = ({page, limit}) => {
|
|
|
search.value.page=page;
|
|
|
search.value.limit=limit;
|
|
|
getListData();
|
|
|
}
|
|
|
|
|
|
//变更人员的弹框关闭后
|
|
|
let hideDialog =(flag)=>{
|
|
|
show.value=flag;
|
...
|
...
|
@@ -215,37 +228,20 @@ export default { |
|
|
let savebtn =(obj)=>{
|
|
|
show.value=false;
|
|
|
//obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组
|
|
|
console.log("&&&",obj)
|
|
|
getListData();
|
|
|
}
|
|
|
//获取资源类型数据
|
|
|
let getResourceTypoe=()=>{
|
|
|
proxy.$http.get(`/api-web/manage/restype/list`, {}, function (res) {
|
|
|
if (res && res.data) {
|
|
|
resTypeOptions.value=res.data
|
|
|
}
|
|
|
})
|
|
|
|
|
|
}
|
|
|
//获取展示类型的字典数据
|
|
|
let initShowType=()=>{
|
|
|
proxy.$http.get("/api-web/manage/resource/getAllResByUser", {}, function (res) {
|
|
|
if (res && res.success) {
|
|
|
let arr=res.data;
|
|
|
if(arr && arr.length>0){
|
|
|
arr.map(v=>{
|
|
|
showTypeList.value.push({
|
|
|
name: v.ddicName
|
|
|
,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length)
|
|
|
});
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
})
|
|
|
let params={
|
|
|
resIds:resIds.value,
|
|
|
selectModel:obj.selectModel,
|
|
|
}
|
|
|
// proxy.$http.get(`/api-web/`, {}, function (res) {
|
|
|
// if (res && res.success) {
|
|
|
// proxy.$global.showMsg('变更成功!');
|
|
|
// getListData()
|
|
|
// }
|
|
|
// })
|
|
|
}
|
|
|
// 挂载完
|
|
|
Vue.onMounted(() => {
|
|
|
initShowType();
|
|
|
getResourceTypoe();
|
|
|
getListData();
|
|
|
})
|
...
|
...
|
|