Authored by 王涛

资源视图优化

@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <cm-dialog title="收藏" width="500px" :showDialogVisible="dialogFlg" @hidedialog="showDialog" @okfunc="saveStart"> 22 <cm-dialog title="收藏" width="500px" :showDialogVisible="dialogFlg" @hidedialog="showDialog" @okfunc="saveStart">
23 <template v-slot> 23 <template v-slot>
24 <div style="text-align: center;"> 24 <div style="text-align: center;">
25 - <el-select v-model="favIds" multiple placeholder="请选择" style="margin: 3px"> 25 + <el-select v-model="favIds" placeholder="请选择" style="margin: 3px">
26 <el-option v-for="(item ,index) in favData" 26 <el-option v-for="(item ,index) in favData"
27 :key="index" 27 :key="index"
28 :label="item.name" 28 :label="item.name"
@@ -47,7 +47,7 @@ export default { @@ -47,7 +47,7 @@ export default {
47 const {proxy} = Vue.getCurrentInstance(); 47 const {proxy} = Vue.getCurrentInstance();
48 48
49 let dialogFlg = Vue.ref(false); 49 let dialogFlg = Vue.ref(false);
50 - let favIds = Vue.ref([]); 50 + let favIds = Vue.ref('');
51 let favData = Vue.ref([]); 51 let favData = Vue.ref([]);
52 52
53 /** 53 /**
@@ -95,13 +95,12 @@ export default { @@ -95,13 +95,12 @@ export default {
95 return; 95 return;
96 } 96 }
97 97
98 - let params = {  
99 - favIds: favIds.value.join(','),  
100 - resId: props.resId  
101 - }  
102 - proxy.$http.post(`/api-web/favorites/save/fav`, params, function (res) {  
103 - if (res && res.success) {  
104 - proxy.$global.showMsg("收藏成功!") 98 + proxy.$http.post(`/api-web/favorites/save/res?favId=${favIds.value}&resIds=${props.resId}`, {}, function (res) {
  99 + if (res && res.code ==0) {
  100 + let msg = !res.msg ? '收藏成功!' : res.msg;
  101 + let type = !res.success ? 'warning' : 'success';
  102 + proxy.$global.showMsg(msg,type);
  103 + showDialog(false);
105 } 104 }
106 }); 105 });
107 } 106 }
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 </div> 28 </div>
29 29
30 <cm-table-page :columns="obj.columns" :dataList="obj.maps" @loaddata="getPage" :showIndex="true" 30 <cm-table-page :columns="obj.columns" :dataList="obj.maps" @loaddata="getPage" :showIndex="true"
  31 + :pageSizes="[10,50,90, 200, 300, 400]" :pageSize="limit"
31 :showBorder="true" :currentPage="currentPage" :total="total" :loading="false" 32 :showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
32 :showPage="true" :height="(height - 95)" 33 :showPage="true" :height="(height - 95)"
33 :maxWidth="max"> 34 :maxWidth="max">
@@ -99,7 +99,7 @@ export default { @@ -99,7 +99,7 @@ export default {
99 } 99 }
100 100
101 let page = Vue.ref(1); 101 let page = Vue.ref(1);
102 - let limit = Vue.ref(10); 102 + let limit = Vue.ref(90);
103 103
104 let loadResList = () => { 104 let loadResList = () => {
105 if (currentNode.value) { 105 if (currentNode.value) {
@@ -110,12 +110,14 @@ export default { @@ -110,12 +110,14 @@ export default {
110 page: page.value, 110 page: page.value,
111 limit: limit.value, 111 limit: limit.value,
112 treeNodeId: currentNode.value.id, 112 treeNodeId: currentNode.value.id,
113 - query: {} 113 + query: JSON.stringify(fv)
114 } 114 }
115 proxy.$http.get(`/api-web/v32/res/list`, params, function (res) { 115 proxy.$http.get(`/api-web/v32/res/list`, params, function (res) {
116 if (res && res.object) { 116 if (res && res.object) {
117 obj.value = res.object 117 obj.value = res.object
118 total.value = res.count; 118 total.value = res.count;
  119 + } else {
  120 + obj.value.maps = [];
119 } 121 }
120 }); 122 });
121 } 123 }
@@ -189,6 +191,7 @@ export default { @@ -189,6 +191,7 @@ export default {
189 total, 191 total,
190 max, 192 max,
191 getPage, 193 getPage,
  194 + limit,
192 195
193 // 配置页面 196 // 配置页面
194 showConfig, configObj, showConfigDialog 197 showConfig, configObj, showConfigDialog