|
@@ -29,21 +29,20 @@ Component({
|
|
systemIndex: 0, //系统index
|
|
systemIndex: 0, //系统index
|
|
portIndex: 0, //选择端口Index
|
|
portIndex: 0, //选择端口Index
|
|
moduleIndex: 0, //选择模块Index
|
|
moduleIndex: 0, //选择模块Index
|
|
- result: ['a', 'b'],
|
|
|
|
portID: null, //端口ID
|
|
portID: null, //端口ID
|
|
leftIntoViewId: null,
|
|
leftIntoViewId: null,
|
|
rightIntoViewId: null,
|
|
rightIntoViewId: null,
|
|
heightList: [],
|
|
heightList: [],
|
|
modulesIndex: 0, //模块列表
|
|
modulesIndex: 0, //模块列表
|
|
- scrollTop: 0
|
|
|
|
|
|
+ scrollTop: 0,
|
|
|
|
+ checkList: [], //选中列表
|
|
},
|
|
},
|
|
|
|
|
|
observers: {
|
|
observers: {
|
|
'list': function (list) {
|
|
'list': function (list) {
|
|
|
|
+ console.log(12)
|
|
if (!list.length) return;
|
|
if (!list.length) return;
|
|
let data = list[0].clients[0];
|
|
let data = list[0].clients[0];
|
|
- console.log("list", list)
|
|
|
|
- console.log("data", data)
|
|
|
|
let id = data.modules[0] ? "M" + data.modules[0].systemmoduleid : '';
|
|
let id = data.modules[0] ? "M" + data.modules[0].systemmoduleid : '';
|
|
if (this.data.portID == null) this.setData({
|
|
if (this.data.portID == null) this.setData({
|
|
portID: 'S' + data.systemclientid,
|
|
portID: 'S' + data.systemclientid,
|
|
@@ -60,6 +59,36 @@ Component({
|
|
* 组件的方法列表
|
|
* 组件的方法列表
|
|
*/
|
|
*/
|
|
methods: {
|
|
methods: {
|
|
|
|
+ /* 模块选择 */
|
|
|
|
+ checkBack(e) {
|
|
|
|
+ let list = this.data.checkList,
|
|
|
|
+ obj = {
|
|
|
|
+ id: e.target.id - 0,
|
|
|
|
+ arr: JSON.parse(JSON.stringify(e.detail.arr))
|
|
|
|
+ };
|
|
|
|
+ const index = list.findIndex(v => v.id == obj.id);
|
|
|
|
+ if (index == -1) {
|
|
|
|
+ list.push(obj)
|
|
|
|
+ } else {
|
|
|
|
+ list.splice(index, 1, obj)
|
|
|
|
+ }
|
|
|
|
+ let idList = e.detail.apps.map(v => v.systemappid);
|
|
|
|
+ const i = list.findIndex(v => v.id == obj.id);
|
|
|
|
+ list[i].arr = list[i].arr.filter(v => idList.includes(v.systemappid));
|
|
|
|
+ this.setData({
|
|
|
|
+ checkList: list
|
|
|
|
+ });
|
|
|
|
+ const mIndex = this.data.list[this.data.systemIndex].clients[this.data.portIndex].modules.findIndex(v => v.systemmoduleid == obj.id);
|
|
|
|
+ this.setData({
|
|
|
|
+ [`list[${this.data.systemIndex}].clients[${this.data.portIndex}].modules[${mIndex}].apps`]: e.detail.apps
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ backData() {
|
|
|
|
+ let newArr = [];
|
|
|
|
+ this.data.checkList.forEach(v => newArr = newArr.concat(v.arr));
|
|
|
|
+ return newArr;
|
|
|
|
+ },
|
|
/* 系统分类 */
|
|
/* 系统分类 */
|
|
changePortID(e) {
|
|
changePortID(e) {
|
|
const {
|
|
const {
|
|
@@ -93,15 +122,20 @@ Component({
|
|
query.exec(res => {
|
|
query.exec(res => {
|
|
if (!res[0]) return this.getAppsHeight();
|
|
if (!res[0]) return this.getAppsHeight();
|
|
heightList.push(res[0])
|
|
heightList.push(res[0])
|
|
- if (list.length == heightList.length) this.setData({
|
|
|
|
- heightList,
|
|
|
|
- leftIntoViewId: id,
|
|
|
|
- rightIntoViewId: id
|
|
|
|
- })
|
|
|
|
|
|
+ if (list.length == heightList.length) {
|
|
|
|
+ this.setData({
|
|
|
|
+ heightList,
|
|
|
|
+ leftIntoViewId: id,
|
|
|
|
+ rightIntoViewId: id
|
|
|
|
+ })
|
|
|
|
+ let MyArr = that.selectAllComponents('.My_group');
|
|
|
|
+ for (let k = 0; k < MyArr.length; k++) {
|
|
|
|
+ MyArr[k].refactorDom();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- }
|
|
|
|
|
|
+ };
|
|
},
|
|
},
|
|
-
|
|
|
|
viewScroll({
|
|
viewScroll({
|
|
detail
|
|
detail
|
|
}) {
|
|
}) {
|
|
@@ -119,7 +153,7 @@ Component({
|
|
})
|
|
})
|
|
} else if (scrollTop < top) {
|
|
} else if (scrollTop < top) {
|
|
if (!arr[i - 1] || id == arr[0].id) return;
|
|
if (!arr[i - 1] || id == arr[0].id) return;
|
|
- if (scrollTop < Math.abs(arr[i - 1].top - arr[i - 1].height + 80)) this.setData({
|
|
|
|
|
|
+ if (scrollTop < Math.abs(arr[i - 1].top - arr[i - 1].height / 2)) this.setData({
|
|
leftIntoViewId: arr[i - 1].id
|
|
leftIntoViewId: arr[i - 1].id
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|