Compare commits
2 Commits
c3ece4c50d
...
45594e3a39
| Author | SHA1 | Date |
|---|---|---|
|
|
45594e3a39 | |
|
|
1f16573a05 |
|
|
@ -1,27 +1,28 @@
|
|||
<template>
|
||||
<!-- <PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> -->
|
||||
<div class="select-account">
|
||||
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
|
||||
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo"> </BasicTable>
|
||||
</div>
|
||||
<div class="select-account">
|
||||
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
|
||||
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo" />
|
||||
</div>
|
||||
<!-- </PageWrapper> -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive } from 'vue';
|
||||
|
||||
import { reactive, watch, defineProps } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { getAccountList, deleteAccount } from '@/api/demo/system';
|
||||
import { PageWrapper } from '@/components/Page';
|
||||
import DeptTree from './DeptTree.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
|
||||
import { columns, searchFormSchema } from './account.data';
|
||||
|
||||
defineOptions({ name: 'AccountManagement' });
|
||||
|
||||
const searchInfo = reactive < Recordable > ({});
|
||||
const [registerTable, { reload, updateTableDataRecord, getSelectRows, clearSelectedRowKeys }] = useTable({
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
const [
|
||||
registerTable,
|
||||
{ reload, updateTableDataRecord, getSelectRows, clearSelectedRowKeys, setSelectedRowKeys },
|
||||
] = useTable({
|
||||
title: '账号列表',
|
||||
api: getAccountList,
|
||||
rowKey: 'id',
|
||||
|
|
@ -31,7 +32,8 @@
|
|||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
},
|
||||
rowSelection: {//多选框
|
||||
rowSelection: {
|
||||
//多选框
|
||||
type: 'checkbox',
|
||||
},
|
||||
useSearchForm: true,
|
||||
|
|
@ -44,6 +46,20 @@
|
|||
return info;
|
||||
},
|
||||
});
|
||||
const props = defineProps({
|
||||
selectListValue: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
});
|
||||
watch(
|
||||
() => props.selectListValue,
|
||||
(newVal: any) => {
|
||||
setSelectedRowKeys(newVal);
|
||||
},
|
||||
);
|
||||
function handleSelect(orgId = '') {
|
||||
searchInfo.orgId = orgId;
|
||||
reload();
|
||||
|
|
@ -51,16 +67,15 @@
|
|||
|
||||
function getRow() {
|
||||
let rows = getSelectRows();
|
||||
console.log(rows)
|
||||
return rows
|
||||
return rows;
|
||||
}
|
||||
defineExpose({
|
||||
getRow
|
||||
})
|
||||
getRow,
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.select-account{
|
||||
.select-account {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,30 @@
|
|||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<a-modal v-model:open="open_chuantou" title="导出文件" :footer="null">
|
||||
<div>
|
||||
<a-button
|
||||
class="exportbutton"
|
||||
@click="handleExport('jiexifenxi_execl', '解析分析数据交付与费用记账表')"
|
||||
>
|
||||
解析分析数据交付与费用记账表(execl)
|
||||
</a-button>
|
||||
<a-button
|
||||
class="exportbutton"
|
||||
@click="
|
||||
handleExport('weixingyaoganyingxiang_shp', '卫星遥感影像补充数据交付与费用记录表')
|
||||
"
|
||||
>
|
||||
卫星遥感影像补充数据交付与费用记录表(execl)
|
||||
</a-button>
|
||||
<a-button
|
||||
class="exportbutton"
|
||||
@click="handleExport('wurenjixunfei_shp', '无人机巡飞数据交付与费用记录表')"
|
||||
>
|
||||
无人机巡飞数据交付与费用记录表(execl)
|
||||
</a-button>
|
||||
</div>
|
||||
</a-modal>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -29,12 +53,15 @@
|
|||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { PageWrapper } from '@/components/Page';
|
||||
import { ColumnProps } from 'ant-design-vue/es/table/interface';
|
||||
import axios from 'axios';
|
||||
import { getAppEnvConfig } from '@/utils/env';
|
||||
|
||||
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||
const open_chuantou = ref<boolean>(false);
|
||||
const searchParams = ref({
|
||||
beginTime: null,
|
||||
endTime: null,
|
||||
});
|
||||
const isDelete = ref(0);
|
||||
const columns: ColumnProps[] = [
|
||||
{
|
||||
title: '序号',
|
||||
|
|
@ -221,12 +248,8 @@
|
|||
}
|
||||
function onBtnClicked(domId) {
|
||||
switch (domId) {
|
||||
case 'btnDelete':
|
||||
if (isDelete.value == 1) {
|
||||
completelyDel();
|
||||
} else {
|
||||
handleDelete();
|
||||
}
|
||||
case 'btnExport':
|
||||
open_chuantou.value = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -235,6 +258,57 @@
|
|||
onMounted(() => {
|
||||
getTableData(searchParams.value);
|
||||
});
|
||||
// 直接下载接口返回的二进制流
|
||||
function handleExport(exportType, name) {
|
||||
let url = '';
|
||||
let fileName = '';
|
||||
let params: any = {};
|
||||
let afterTitle = '';
|
||||
if (
|
||||
dayjs(searchParams.value?.beginTime).startOf('day').format('YYYY-MM-DD') ===
|
||||
dayjs(searchParams.value?.endTime).endOf('day').format('YYYY-MM-DD')
|
||||
) {
|
||||
afterTitle = dayjs(searchParams.value?.beginTime).startOf('day').format('YYYY-MM-DD');
|
||||
} else {
|
||||
afterTitle =
|
||||
dayjs(searchParams.value?.beginTime).startOf('day').format('YYYY-MM-DD') +
|
||||
'至' +
|
||||
dayjs(searchParams.value?.endTime).endOf('day').format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
fileName = name + afterTitle + '.xls';
|
||||
switch (exportType) {
|
||||
case 'jiexifenxi_execl':
|
||||
url = VITE_GLOB_API_URL + '/api/DroneCaseInfoSingle/ExprotCaseListByType';
|
||||
break;
|
||||
case 'weixingyaoganyingxiang_shp':
|
||||
url = VITE_GLOB_API_URL + '/api/DroneCaseInfoSingle/ExportShapefile';
|
||||
break;
|
||||
case 'wurenjixunfei_shp':
|
||||
url = VITE_GLOB_API_URL + '/api/DroneCaseInfoSingle/CaseOffenceToExcel';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
axios({
|
||||
method: 'post',
|
||||
url: url,
|
||||
params: params,
|
||||
headers: {
|
||||
'X-Token': localStorage.getItem('X-Token'),
|
||||
},
|
||||
responseType: 'blob',
|
||||
}).then((res) => {
|
||||
const elink = document.createElement('a');
|
||||
elink.download = fileName;
|
||||
elink.style.display = 'none';
|
||||
elink.href = URL.createObjectURL(res.data);
|
||||
document.body.appendChild(elink);
|
||||
elink.click();
|
||||
URL.revokeObjectURL(elink.href);
|
||||
document.body.removeChild(elink);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.full-modal {
|
||||
|
|
@ -267,4 +341,9 @@
|
|||
::v-deep .ant-form-item-control-input-content {
|
||||
display: flex;
|
||||
}
|
||||
.exportbutton {
|
||||
width: 510px;
|
||||
height: 60px;
|
||||
margin: 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
@ok="accountHandleOk"
|
||||
:destroyOnClose="true"
|
||||
>
|
||||
<SelectAccount ref="accountRef" />
|
||||
<SelectAccount ref="accountRef" :selectListValue="groupList" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -36,7 +36,12 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { getLoadGroupList, deleteGroup, assignGroupUser } from '@/api/demo/system';
|
||||
import {
|
||||
getLoadGroupList,
|
||||
deleteGroup,
|
||||
assignGroupUser,
|
||||
getLoadUserListByGroupid,
|
||||
} from '@/api/demo/system';
|
||||
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useModal } from '@/components/Modal';
|
||||
|
|
@ -51,7 +56,7 @@
|
|||
const [registerModal, { openModal: openRoleModal }] = useModal();
|
||||
const [registerAccountModal, { openModal: openAccountModal }] = useModal();
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
|
||||
const groupList = ref([]);
|
||||
const [registerTable, { reload, getSelectRows, clearSelectedRowKeys }] = useTable({
|
||||
// 表格名称
|
||||
title: '组列表',
|
||||
|
|
@ -152,17 +157,26 @@
|
|||
handleDelete();
|
||||
break;
|
||||
case 'btnAccounts':
|
||||
let rows = getSelectRows();
|
||||
if (rows.length == 0) {
|
||||
return createMessage.warn('请勾选一个组进行编辑');
|
||||
}
|
||||
groupId.value = rows[0].id;
|
||||
accountOpen.value = true;
|
||||
handleAccount();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
async function handleAccount() {
|
||||
let rows = getSelectRows();
|
||||
if (rows.length == 0) {
|
||||
return createMessage.warn('请勾选一个组进行编辑');
|
||||
}
|
||||
groupId.value = rows[0].id;
|
||||
accountOpen.value = true;
|
||||
const data = await getLoadUserListByGroupid({
|
||||
groupid: groupId.value,
|
||||
page: 1,
|
||||
limit: 99999,
|
||||
});
|
||||
groupList.value = data.items.map((item) => item.id);
|
||||
}
|
||||
const accountRef = ref<any>();
|
||||
async function accountHandleOk() {
|
||||
const list = accountRef.value.getRow();
|
||||
|
|
|
|||
Loading…
Reference in New Issue