Authored by 王涛

资产视图优化

  1 +${AnsiColor.BRIGHT_YELLOW}
  2 +
  3 +
  4 +${application.title} ${application.version} Base On Spring Boot ${spring-boot.version}
  5 +
  6 +----------------------------------------------------------------------------------------------------------
  7 + \\\ /// .-. \\\ ///wW Ww(o)__(o) .-. )) (O)) ((O) _ 2022
  8 + ((O) (O)) c(O_O)c ((O)(O))(O)(O)(__ __)c(O_O)c (Oo)-. || || wWw /||_
  9 + | \ / | ,'.---.`, | \ || (..) ( ) ,'.---.`, | (_)) || /\ || (O)_ /`_)
  10 + ||\\//||/ /|_|_|\ \||\\|| || )( / /|_|_|\ \ | .' ||//\\|| .' __)| `.
  11 + || \/ ||| \_____/ ||| \ | _||_ ( )| \_____/ | )|\\ / / \ \( _) | (_))
  12 + || ||'. `---' .`|| || (_/\_) )/ '. `---' .`(/ \) ( / \ )`.__) (.'-'
  13 + (_/ \_) `-...-' (_/ \_) ( `-...-' ) ) ( )
  14 + ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______
  15 +|______|______|______|______|______|______|______|______|______|______|______|______|______|______|______|
  16 +
  17 +
  18 +
  19 +
  20 +
1 <div style="display: flex;flex-wrap: nowrap"> 1 <div style="display: flex;flex-wrap: nowrap">
2 - <div style="width: calc(100% - 50px)"> 2 + <div style="width: calc(100% - 10px)">
3 <el-progress 3 <el-progress
4 :text-inside="true" 4 :text-inside="true"
5 :stroke-width="20" 5 :stroke-width="20"
6 - :percentage="textValue"  
7 - :status="status">  
8 - <span>{{textValue == '' ? ' ' : textValue + '%' }}</span> 6 + :percentage="textString"
  7 + status="success">
  8 + <div style="color: black">{{textString == '' ? ' ' : textString + '%' }}</div>
9 </el-progress> 9 </el-progress>
10 </div> 10 </div>
11 - <div style="width: 50px">{{textString == '' ? '' : textString }} </div> 11 + <!-- <div style="width: 50px">{{textString == '' ? '' : textString }} </div>-->
  12 +
  13 + <!--
  14 + <el-progress :text-inside="true" :stroke-width="26" :percentage="textString" >
  15 + <span>{{textString == '' ? ' ' : textString + '%' }}</span>
  16 + </el-progress>
  17 + -->
12 </div> 18 </div>
@@ -3,12 +3,6 @@ export default { @@ -3,12 +3,6 @@ export default {
3 template: '', 3 template: '',
4 components: {}, 4 components: {},
5 props: { 5 props: {
6 - // 百分比数字,例如:50%,percentage= 50  
7 - textValue: {  
8 - type: Number,  
9 - default: 0  
10 - },  
11 -  
12 // 状态 success/exception/warning 6 // 状态 success/exception/warning
13 status: { 7 status: {
14 type: String, 8 type: String,
@@ -20,7 +14,7 @@ export default { @@ -20,7 +14,7 @@ export default {
20 }, 14 },
21 // 文本 15 // 文本
22 textString: { 16 textString: {
23 - type: String, 17 + type: Number,
24 default: 0 18 default: 0
25 }, 19 },
26 optionData: { 20 optionData: {
@@ -154,18 +154,23 @@ @@ -154,18 +154,23 @@
154 <template v-slot> 154 <template v-slot>
155 <div style="padding: 10px" style="display: flex;flex-wrap: wrap"> 155 <div style="padding: 10px" style="display: flex;flex-wrap: wrap">
156 <div v-for="(v,k) in fieldsValueObj[currentRow.id].props" style="width: 50%"> 156 <div v-for="(v,k) in fieldsValueObj[currentRow.id].props" style="width: 50%">
157 - <div style="text-align: left;padding-left: 10px;">{{v}}</div> 157 +
  158 + <div v-if="k.indexOf('_msg') != -1" style="text-align: left;padding-left: 10px;width: 100%">
  159 + {{v}}
  160 + </div>
  161 + <div v-else style="text-align: left;padding-left: 10px;">{{v}}</div>
158 162
159 <div v-if="k.indexOf('_input') != -1"> 163 <div v-if="k.indexOf('_input') != -1">
160 <el-input v-model="settingVal[currentRow.id][k]" :placeholder="v"></el-input> 164 <el-input v-model="settingVal[currentRow.id][k]" :placeholder="v"></el-input>
161 </div> 165 </div>
162 - <el-select v-else v-model="settingVal[currentRow.id][k]" :placeholder="v" style="margin: 3px"> 166 + <el-select clearable v-else-if="k.indexOf('_input') == -1 && k.indexOf('_msg') == -1" v-model="settingVal[currentRow.id][k]" :placeholder="v" style="margin: 3px">
163 <el-option v-for="(value ,index) in fieldsValueObj[currentRow.id].object" 167 <el-option v-for="(value ,index) in fieldsValueObj[currentRow.id].object"
164 :key="index" 168 :key="index"
165 :label="value[fieldsValueObj[currentRow.id].text]" 169 :label="value[fieldsValueObj[currentRow.id].text]"
166 :value="value[fieldsValueObj[currentRow.id].value]" > 170 :value="value[fieldsValueObj[currentRow.id].value]" >
167 </el-option> 171 </el-option>
168 </el-select> 172 </el-select>
  173 +
169 </div> 174 </div>
170 </div> 175 </div>
171 </template> 176 </template>
@@ -15,7 +15,15 @@ @@ -15,7 +15,15 @@
15 <el-form :inline="true" :model="searchForm" class="demo-form-inline"> 15 <el-form :inline="true" :model="searchForm" class="demo-form-inline">
16 <el-form-item v-for="searchInfo in obj.searchList" :label="searchInfo.name"> 16 <el-form-item v-for="searchInfo in obj.searchList" :label="searchInfo.name">
17 <el-input v-if="searchInfo.type == 'INPUT'" v-model="searchForm[searchInfo.key]" :placeholder="'请输入' + searchInfo.name"></el-input> 17 <el-input v-if="searchInfo.type == 'INPUT'" v-model="searchForm[searchInfo.key]" :placeholder="'请输入' + searchInfo.name"></el-input>
18 - <el-input v-else v-model="searchForm[searchInfo.key]" :placeholder="'请输入' + searchInfo.name"></el-input> 18 + <el-select v-else v-model="searchForm[searchInfo.key]" :placeholder="'请选择' + searchInfo.name" clearable >
  19 + <el-option
  20 + v-for="item in searchItem[searchInfo.key]"
  21 + :key="item.val"
  22 + :label="item.label"
  23 + :value="item.val"
  24 + >
  25 + </el-option>
  26 + </el-select>
19 </el-form-item> 27 </el-form-item>
20 28
21 <el-form-item> 29 <el-form-item>
@@ -72,6 +72,8 @@ export default { @@ -72,6 +72,8 @@ export default {
72 72
73 let total = Vue.ref(0); 73 let total = Vue.ref(0);
74 74
  75 + let searchItem = Vue.ref({});
  76 +
75 // 计算减去左侧树的宽度 77 // 计算减去左侧树的宽度
76 let max = (function (){ 78 let max = (function (){
77 let right = window.innerWidth; 79 let right = window.innerWidth;
@@ -114,6 +116,9 @@ export default { @@ -114,6 +116,9 @@ export default {
114 if (res && res.object) { 116 if (res && res.object) {
115 obj.value = res.object 117 obj.value = res.object
116 total.value = res.count; 118 total.value = res.count;
  119 +
  120 + // 查询搜索下拉
  121 + getSearchItem(res.object.searchList);
117 } else { 122 } else {
118 obj.value.maps = []; 123 obj.value.maps = [];
119 } 124 }
@@ -133,30 +138,26 @@ export default { @@ -133,30 +138,26 @@ export default {
133 dialogFlg.value = flg; 138 dialogFlg.value = flg;
134 } 139 }
135 140
136 - let cellClick = (row, prop, column) => {  
137 - openCabinet(true);  
138 - showDialog(true);  
139 - cellDetail.value['prop'] = prop;  
140 - cellDetail.value['row'] = row;  
141 - cellDetail.value['title'] = column.label + '详情';  
142 - }  
143 - let cabinetNoSrc = Vue.ref('');  
144 - let openCabinet = (isInit) => {  
145 - if (isInit) {  
146 - cabinetNoSrc.value = "/vue3/src/assets/images/res/img01.jpg"  
147 - } else {  
148 - cabinetNoSrc.value = "/vue3/src/assets/images/res/img03.jpg"  
149 - }  
150 - }  
151 -  
152 let getPage = (pageInfo) =>{ 141 let getPage = (pageInfo) =>{
153 page.value = pageInfo.page; 142 page.value = pageInfo.page;
154 limit.value = pageInfo.limit; 143 limit.value = pageInfo.limit;
155 loadResList() 144 loadResList()
156 } 145 }
157 146
158 - let isManager = () => {  
159 - 147 + let getSearchItem = (searchList) => {
  148 + if(!searchList){
  149 + return;
  150 + }
  151 + searchList.forEach(function (v){
  152 + if(v.type == 'TABLE_REL'){
  153 + //searchItem
  154 + proxy.$http.get(`/api-web/v32/res/search/${v.treeNodeId}/${v.key}`, {}, function (res) {
  155 + if (res && res.data && res.data.length > 0) {
  156 + searchItem.value[v.key] = res.data;
  157 + }
  158 + });
  159 + }
  160 + })
160 } 161 }
161 162
162 163
@@ -166,8 +167,6 @@ export default { @@ -166,8 +167,6 @@ export default {
166 // 挂载完 167 // 挂载完
167 Vue.onMounted(() => { 168 Vue.onMounted(() => {
168 loadTree(); 169 loadTree();
169 -  
170 - openCabinet(true);  
171 }) 170 })
172 171
173 172
@@ -176,6 +175,7 @@ export default { @@ -176,6 +175,7 @@ export default {
176 currentNode, 175 currentNode,
177 treeData, 176 treeData,
178 searchForm, 177 searchForm,
  178 + searchItem,
179 height, 179 height,
180 obj, 180 obj,
181 handleNodeClick, 181 handleNodeClick,
@@ -183,10 +183,7 @@ export default { @@ -183,10 +183,7 @@ export default {
183 dialogFlg, 183 dialogFlg,
184 showDialog, 184 showDialog,
185 cellDetail, 185 cellDetail,
186 - cellClick,  
187 186
188 - openCabinet,  
189 - cabinetNoSrc,  
190 total, 187 total,
191 max, 188 max,
192 getPage, 189 getPage,