|  |  |  | 
|---|
|  |  |  | @selection-change="handleSelectionChange" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column prop="name" label="地区名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="行政区代码" align="center" min-width="140px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createDate" label="创建时间" align="center" min-width="140px"></el-table-column> | 
|---|
|  |  |  | <!-- | 
|---|
|  |  |  | <el-table-column prop="sortnum" label="排序码" align="center" min-width="140px"></el-table-column> | 
|---|
|  |  |  | --> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-if="containPermissions(['business:areas:update', 'business:areas:create', 'business:areas:delete'])" | 
|---|
|  |  |  | label="操作" | 
|---|
|  |  |  | 
|---|
|  |  |  | this.tableData.list = this.dataAddBool(data) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$message.error(e) | 
|---|
|  |  |  | console.log(e) | 
|---|
|  |  |  | this.$tip.error('操作失败') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking.search = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | dataAddBool(array) { | 
|---|
|  |  |  | if(array==null){ | 
|---|
|  |  |  | return  [] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | array.forEach(item => { | 
|---|
|  |  |  | item.hasChildren = item.type != 2 | 
|---|
|  |  |  | // item.childList = item.childList && this.dataAddBool(item.childList) | 
|---|
|  |  |  | 
|---|
|  |  |  | this.treeMaps.set(tree.id, { tree, treeNode, resolve }) | 
|---|
|  |  |  | listByParentId({ parentId: tree.id, type: tree.type + 1 }) | 
|---|
|  |  |  | .then(data => { | 
|---|
|  |  |  | resolve(this.dataAddBool(data||[])) | 
|---|
|  |  |  | resolve(this.dataAddBool(data || [])) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$message.error(e) | 
|---|
|  |  |  | console.log(e) | 
|---|
|  |  |  | this.$tip.error('操作失败') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking.search = false | 
|---|
|  |  |  | 
|---|
|  |  |  | this.isWorking.delete = true | 
|---|
|  |  |  | this.api.deleteById(row[this.configData['field.id']]) | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.$message.success('删除成功') | 
|---|
|  |  |  | this.$tip.apiSuccess('删除成功') | 
|---|
|  |  |  | this.refreshLoadTree(row.parentId) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$message.error(e) | 
|---|
|  |  |  | console.log(e) | 
|---|
|  |  |  | this.$tip.error('操作失败') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking.delete = false | 
|---|