运维工具-入驻咨询数据清除工具
This commit is contained in:
parent
edd84dd113
commit
1a277c88a7
|
|
@ -0,0 +1,26 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
|
||||
list = '/internaltool/cleanEmpAdvisory/list',
|
||||
clean = '/internaltool/cleanEmpAdvisory/clean',
|
||||
delete = '/internaltool/cleanEmpAdvisory/delete',
|
||||
|
||||
}
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const dataClean = (params,handleSuccess) => {
|
||||
return defHttp.post({url: Api.clean, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
export const dataDelete = (params,handleSuccess) => {
|
||||
return defHttp.post({url: Api.delete, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '申请ID',
|
||||
align: "center",
|
||||
dataIndex: 'applyId',
|
||||
ifShow: false
|
||||
},
|
||||
{
|
||||
title: 'OPENID',
|
||||
align: "center",
|
||||
dataIndex: 'openId',
|
||||
width: 220
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
align: "center",
|
||||
dataIndex: 'name',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '电话',
|
||||
align: "center",
|
||||
dataIndex: 'tel',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '咨询类型',
|
||||
dataIndex: 'advisoryType',
|
||||
width: 150,
|
||||
customRender:({text})=>{
|
||||
if(text == '1'){
|
||||
return "家属";
|
||||
}else if(text == '2'){
|
||||
return "员工";
|
||||
}else if(text == '3'){
|
||||
return "公司";
|
||||
}else{
|
||||
return "其他";
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '企业名称',
|
||||
align: "center",
|
||||
dataIndex: 'comName',
|
||||
width: 240
|
||||
},
|
||||
{
|
||||
title: '注册时间',
|
||||
align: "center",
|
||||
dataIndex: 'createTime',
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
title: '申请时间',
|
||||
align: "center",
|
||||
dataIndex: 'updateTime',
|
||||
width: 160
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '电话',
|
||||
field: 'tel',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入电话',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'OPENID',
|
||||
field: 'openId',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入OPENID',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
<template>
|
||||
<div >
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" style="padding: 0 !important;">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)"/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="internaltool-clean-advisory" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, formSchema } from './cleanadvisory.data';
|
||||
import { list,dataClean,dataDelete } from './cleanadvisory.api';
|
||||
|
||||
const props = defineProps({
|
||||
serverType: '',
|
||||
});
|
||||
|
||||
const queryParam = reactive<any>({});
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '入驻咨询表',
|
||||
api: list,
|
||||
columns: columns,
|
||||
formConfig: {
|
||||
schemas: formSchema
|
||||
},
|
||||
canResize: false,
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
showActionColumn: true,
|
||||
showIndexColumn: true,
|
||||
beforeFetch: async (params) => {
|
||||
queryParam.serverType = props.serverType
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
async function handleClean(record) {
|
||||
await dataClean(record, handleSuccess);
|
||||
}
|
||||
|
||||
async function handleDelete(record) {
|
||||
await dataDelete(record, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '清除入驻',
|
||||
popConfirm: {
|
||||
title: '是否确认清除入驻',
|
||||
confirm: handleClean.bind(null, record,'0'),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '清除所有',
|
||||
popConfirm: {
|
||||
title: '是否确认清除所有',
|
||||
confirm: handleDelete.bind(null, record,'1'),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
searchQuery
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.query-group-cust {
|
||||
min-width: 100px !important;
|
||||
}
|
||||
|
||||
.query-group-split-cust {
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.ant-form-item:not(.ant-form-item-with-help) {
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-table-title) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:deep(.darkened-table) {
|
||||
.ant-table-thead>tr>th {
|
||||
background-color: #dadadaee;
|
||||
}
|
||||
.ant-table-tbody>tr>td {
|
||||
background-color: #f3f3f3f5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
:deep(.z-table-class) {
|
||||
.ant-table-thead>tr>th {
|
||||
background-color: #e6f0fd;
|
||||
}
|
||||
|
||||
.ant-table-tbody>tr>td {
|
||||
background-color: #FBFBFB;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue