feat: 新增工作台loading

This commit is contained in:
wanglihui 2023-09-10 00:19:26 +08:00
parent d857c1a953
commit ae7a72e1c1
4 changed files with 79 additions and 15 deletions

View File

@ -35,3 +35,12 @@ export function categoryAppPost(data: any) {
data
});
}
// 分类删除应用
export function categoryAppDelete(params: any) {
return request({
url: '/manager/workplace/category/app',
method: 'delete',
params
});
}

View File

@ -123,9 +123,15 @@ const queryFrom = reactive({
//
const getTableList = () => {
bannerGet(queryFrom).then((res: any) => {
tableData.value = res;
});
loadTable.value = true;
bannerGet(queryFrom)
.then((res: any) => {
loadTable.value = false;
tableData.value = res;
})
.catch(() => {
loadTable.value = false;
});
};
//

View File

@ -75,13 +75,13 @@
</template>
<script lang="tsx" name="CustomGroup" setup>
import { ElButton, ElSpace, ElImage } from 'element-plus';
import { ElButton, ElSpace, ElImage, ElMessageBox, ElMessage } from 'element-plus';
import CategoryDialog from './CategoryDialog.vue';
import AppDialog from './AppDialog.vue';
import { BU_DOU_CONFIG } from '@/config';
// API
import { categoryGet, categoryAppGet } from '@/api/workplace/category';
import { categoryGet, categoryAppGet, categoryAppDelete } from '@/api/workplace/category';
interface Tree {
category_no: string;
@ -173,11 +173,13 @@ const column = reactive<Column.ColumnOptions[]>([
prop: 'operation',
label: '操作',
align: 'center',
width: 120,
render: (_scope: any) => {
width: 84,
render: (scope: any) => {
return (
<ElSpace>
<ElButton type="primary">删除</ElButton>
<ElButton type="danger" onClick={() => onDelApply(scope.row)}>
删除
</ElButton>
</ElSpace>
);
}
@ -193,9 +195,50 @@ const queryFrom = reactive({
//
const getTableList = () => {
categoryAppGet(queryFrom).then((res: any) => {
tableData.value = res;
});
loadTable.value = true;
categoryAppGet(queryFrom)
.then((res: any) => {
loadTable.value = false;
tableData.value = res;
})
.catch(() => {
loadTable.value = false;
});
};
//
const onDelApply = (item: any) => {
ElMessageBox.confirm(`确定要对该应用移除吗?`, `操作提示`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
closeOnClickModal: false,
type: 'warning'
})
.then(() => {
const fromLiftban = {
category_no: optTree.value,
app_id: item.app_id
};
categoryAppDelete(fromLiftban)
.then((_res: any) => {
getTableList();
ElMessage({
type: 'success',
message: `应用移除成功!`
});
})
.catch(err => {
if (err.status == 400) {
ElMessage.error(err.msg);
}
});
})
.catch(() => {
ElMessage({
type: 'info',
message: '取消成功!'
});
});
};
onMounted(() => {

View File

@ -164,9 +164,15 @@ const queryFrom = reactive({
//
const getTableList = () => {
appGet(queryFrom).then((res: any) => {
tableData.value = res;
});
loadTable.value = true;
appGet(queryFrom)
.then((res: any) => {
loadTable.value = false;
tableData.value = res;
})
.catch(() => {
loadTable.value = false;
});
};
//
@ -180,7 +186,7 @@ const oApplyEidt = (item: any) => {
//
const onDelApply = (item: any) => {
ElMessageBox.confirm(`确定要对该应用吗?`, `操作提示`, {
ElMessageBox.confirm(`确定要对该应用删除吗?`, `操作提示`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
closeOnClickModal: false,