summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchenjinsong <[email protected]>2019-11-07 11:44:14 +0800
committerchenjinsong <[email protected]>2019-11-07 11:44:14 +0800
commite9f1a907f39d81ff5e974c1b65674ea9a69099cb (patch)
tree93f0d64ebbf2734235e0faf462a03546326539a2
parent7e698f029d7774b170bc41770e95cc31ab7b8295 (diff)
分配节点组件更改
-rw-r--r--nezha-admin/src/main/resources/templates/js/modules/common/nodeRel.js10
-rw-r--r--nezha-admin/src/main/resources/templates/modules/common/nodeRel.html4
-rw-r--r--nezha-admin/src/main/resources/templates/modules/sys/system.html2
3 files changed, 7 insertions, 9 deletions
diff --git a/nezha-admin/src/main/resources/templates/js/modules/common/nodeRel.js b/nezha-admin/src/main/resources/templates/js/modules/common/nodeRel.js
index 52c85dba..f9ae8677 100644
--- a/nezha-admin/src/main/resources/templates/js/modules/common/nodeRel.js
+++ b/nezha-admin/src/main/resources/templates/js/modules/common/nodeRel.js
@@ -10,9 +10,7 @@ var nodeRelComponent = Vue.extend({
initSelectableNodes: { //可分配节点
type: Array,
required: true
- },
- initSelectedTotalCount: Number, //初始的已分配数量
- initSelectableTotalCount: Number //初始的可分配数量
+ }
},
data: function () {
return {
@@ -25,8 +23,8 @@ var nodeRelComponent = Vue.extend({
selectableIPEnd: '',
selectedCount: 0, //已分配列表中勾选的数量
selectableCount: 0, //可分配列表中勾选的数量
- selectedTotalCount: null, //已分配总数
- selectableTotalCount: null, //可分配总数
+ selectedTotalCount: 0, //已分配总数
+ selectableTotalCount: 0, //可分配总数
selectedNodes: [],
selectableNodes: [],
tempSelectedNodes: [],
@@ -256,10 +254,12 @@ var nodeRelComponent = Vue.extend({
initSelectedNodes: function(n, o) {
this.tempSelectedNodes = n;
this.selectedNodes = n;
+ this.selectedTotalCount = n.length;
},
initSelectableNodes: function(n, o) {
this.tempSelectableNodes = n;
this.selectableNodes = n;
+ this.selectableTotalCount = n.length;
}
}
})
diff --git a/nezha-admin/src/main/resources/templates/modules/common/nodeRel.html b/nezha-admin/src/main/resources/templates/modules/common/nodeRel.html
index f05e504b..57909173 100644
--- a/nezha-admin/src/main/resources/templates/modules/common/nodeRel.html
+++ b/nezha-admin/src/main/resources/templates/modules/common/nodeRel.html
@@ -39,7 +39,7 @@
</tbody>
</table>
</div>
- <div class="box_counter">已选&nbsp;&nbsp;<span>{{selectedCount}}</span>&nbsp;/&nbsp;{{selectedTotalCount == null ? initSelectedTotalCount : selectedTotalCount}}</div>
+ <div class="box_counter">已选&nbsp;&nbsp;<span>{{selectedCount}}</span>&nbsp;/&nbsp;{{selectedTotalCount}}</div>
</div>
<div class="box">
<div class="title">可分配</div>
@@ -80,7 +80,7 @@
</tbody>
</table>
</div>
- <div class="box_counter">已选&nbsp;&nbsp;<span>{{selectableCount}}</span>&nbsp;/&nbsp;{{selectableTotalCount == null ? initSelectableTotalCount : selectableTotalCount}}</div>
+ <div class="box_counter">已选&nbsp;&nbsp;<span>{{selectableCount}}</span>&nbsp;/&nbsp;{{selectableTotalCount}}</div>
</div>
<span class="box_toright myicon-right1" @click="nodeRelChange(0)"></span>
<span class="box_toleft myicon-left1" @click="nodeRelChange(1)"></span>
diff --git a/nezha-admin/src/main/resources/templates/modules/sys/system.html b/nezha-admin/src/main/resources/templates/modules/sys/system.html
index 9e367053..8cbc03c6 100644
--- a/nezha-admin/src/main/resources/templates/modules/sys/system.html
+++ b/nezha-admin/src/main/resources/templates/modules/sys/system.html
@@ -71,8 +71,6 @@
v-on:node-change="nodeChange"
:init-selected-nodes="selectedNodes"
:init-selectable-nodes="selectableNodes"
- :init-selected-total-count="selectedNodes.length"
- :init-selectable-total-count="selectableNodes.length"
></node-rel-component>
</div>
</div>