暂存工作台的修改

This commit is contained in:
2025-02-20 17:28:45 +08:00
parent 5d617f2282
commit 16a03fbb4b
10 changed files with 126 additions and 48 deletions

View File

@@ -1,4 +1,9 @@
// pages/workBench/components/account/index.js
import request from "../../../../utils/request"
import { getTenementBackInfo, getTenementUsers } from "../../../../service/tenement"
import { alertInfo } from "../../../../utils/index"
const { OK } = request
Component({
/**
@@ -12,7 +17,8 @@ Component({
* 组件的初始数据
*/
data: {
list: [],
tenementInfo: {},
},
/**
@@ -39,6 +45,7 @@ Component({
})
},
onConfirm(e) {
const that = this;
const { type, data } = e.detail;
switch(type) {
case "park":
@@ -53,10 +60,18 @@ Component({
tenement: data.id,
tenementName: data.name,
show: false,
}, () => {
that.initUserList();
that.getTenementInfo();
})
break;
}
},
onConcal() {
this.setData({
show: false,
})
},
handleDelete(e) {
const {} = e;
wx.showModal({
@@ -73,9 +88,34 @@ Component({
}
})
},
async init() {
const { tenementName } = this.data;
const { code, message, data } = await
async getTenementInfo() {
const { tenement, park } = this.data;
const { code, message, tenement: data } = await getTenementBackInfo(park, tenement)
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
tenementInfo: data,
})
},
async initUserList() {
const { tenementName, park } = this.data;
const { code, message, data } = await getTenementUsers({ park, keyword: tenementName });
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
list: data,
})
},
handleAddSon() {
this.setData({
visible: true,
type: "add",
title: "新建子账号"
})
}
}
})