|
@@ -59,6 +59,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+const defaultSearchForm = {
|
|
|
+ name:'',
|
|
|
+ tenant:''
|
|
|
+}
|
|
|
export default {
|
|
|
components: {},
|
|
|
props: {
|
|
@@ -74,8 +78,7 @@ export default {
|
|
|
queryParams: {
|
|
|
current: 1,
|
|
|
size: 10,
|
|
|
- name:'',
|
|
|
- tenant:''
|
|
|
+ ...defaultSearchForm
|
|
|
},
|
|
|
};
|
|
|
},
|
|
@@ -137,17 +140,24 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.loading = true
|
|
|
- this.$api.deletePosition({ id: row.id }).then(response => {
|
|
|
+ this.loading = true
|
|
|
+ this.$api.deletePosition({ id: row.id }).then(response => {
|
|
|
this.$message.success('删除成功')
|
|
|
this.loading = false
|
|
|
- this.resetQuery()
|
|
|
+ this.delFinish()
|
|
|
}).catch(error => {
|
|
|
this.loading = false
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ delFinish(){
|
|
|
+ if(this.tableData.length == 1){
|
|
|
+ this.queryParams.current -= 1
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.current = 1;
|
|
@@ -156,7 +166,10 @@ export default {
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.queryParams.name = '';
|
|
|
+ this.queryParams={
|
|
|
+ ...this.queryParams,
|
|
|
+ ...defaultSearchForm
|
|
|
+ }
|
|
|
this.handleQuery();
|
|
|
}
|
|
|
},
|