Compare commits
2 Commits
c3ece4c50d
...
45594e3a39
| Author | SHA1 | Date |
|---|---|---|
|
|
45594e3a39 | |
|
|
1f16573a05 |
|
|
@ -2,26 +2,27 @@
|
||||||
<!-- <PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> -->
|
<!-- <PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> -->
|
||||||
<div class="select-account">
|
<div class="select-account">
|
||||||
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
|
<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>
|
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo" />
|
||||||
</div>
|
</div>
|
||||||
<!-- </PageWrapper> -->
|
<!-- </PageWrapper> -->
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive } from 'vue';
|
import { reactive, watch, defineProps } from 'vue';
|
||||||
|
|
||||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||||
import { getAccountList, deleteAccount } from '@/api/demo/system';
|
import { getAccountList, deleteAccount } from '@/api/demo/system';
|
||||||
import { PageWrapper } from '@/components/Page';
|
import { PageWrapper } from '@/components/Page';
|
||||||
import DeptTree from './DeptTree.vue';
|
import DeptTree from './DeptTree.vue';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
|
|
||||||
import { columns, searchFormSchema } from './account.data';
|
import { columns, searchFormSchema } from './account.data';
|
||||||
|
|
||||||
defineOptions({ name: 'AccountManagement' });
|
defineOptions({ name: 'AccountManagement' });
|
||||||
|
|
||||||
const searchInfo = reactive<Recordable>({});
|
const searchInfo = reactive<Recordable>({});
|
||||||
const [registerTable, { reload, updateTableDataRecord, getSelectRows, clearSelectedRowKeys }] = useTable({
|
const [
|
||||||
|
registerTable,
|
||||||
|
{ reload, updateTableDataRecord, getSelectRows, clearSelectedRowKeys, setSelectedRowKeys },
|
||||||
|
] = useTable({
|
||||||
title: '账号列表',
|
title: '账号列表',
|
||||||
api: getAccountList,
|
api: getAccountList,
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
|
|
@ -31,7 +32,8 @@
|
||||||
schemas: searchFormSchema,
|
schemas: searchFormSchema,
|
||||||
autoSubmitOnEnter: true,
|
autoSubmitOnEnter: true,
|
||||||
},
|
},
|
||||||
rowSelection: {//多选框
|
rowSelection: {
|
||||||
|
//多选框
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
},
|
},
|
||||||
useSearchForm: true,
|
useSearchForm: true,
|
||||||
|
|
@ -44,6 +46,20 @@
|
||||||
return info;
|
return info;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
selectListValue: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => props.selectListValue,
|
||||||
|
(newVal: any) => {
|
||||||
|
setSelectedRowKeys(newVal);
|
||||||
|
},
|
||||||
|
);
|
||||||
function handleSelect(orgId = '') {
|
function handleSelect(orgId = '') {
|
||||||
searchInfo.orgId = orgId;
|
searchInfo.orgId = orgId;
|
||||||
reload();
|
reload();
|
||||||
|
|
@ -51,12 +67,11 @@
|
||||||
|
|
||||||
function getRow() {
|
function getRow() {
|
||||||
let rows = getSelectRows();
|
let rows = getSelectRows();
|
||||||
console.log(rows)
|
return rows;
|
||||||
return rows
|
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
getRow
|
getRow,
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.select-account {
|
.select-account {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,30 @@
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</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>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|
@ -29,12 +53,15 @@
|
||||||
import { BasicForm, useForm } from '@/components/Form';
|
import { BasicForm, useForm } from '@/components/Form';
|
||||||
import { PageWrapper } from '@/components/Page';
|
import { PageWrapper } from '@/components/Page';
|
||||||
import { ColumnProps } from 'ant-design-vue/es/table/interface';
|
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({
|
const searchParams = ref({
|
||||||
beginTime: null,
|
beginTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
});
|
});
|
||||||
const isDelete = ref(0);
|
|
||||||
const columns: ColumnProps[] = [
|
const columns: ColumnProps[] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
|
|
@ -221,12 +248,8 @@
|
||||||
}
|
}
|
||||||
function onBtnClicked(domId) {
|
function onBtnClicked(domId) {
|
||||||
switch (domId) {
|
switch (domId) {
|
||||||
case 'btnDelete':
|
case 'btnExport':
|
||||||
if (isDelete.value == 1) {
|
open_chuantou.value = true;
|
||||||
completelyDel();
|
|
||||||
} else {
|
|
||||||
handleDelete();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -235,6 +258,57 @@
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getTableData(searchParams.value);
|
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>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.full-modal {
|
.full-modal {
|
||||||
|
|
@ -267,4 +341,9 @@
|
||||||
::v-deep .ant-form-item-control-input-content {
|
::v-deep .ant-form-item-control-input-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
.exportbutton {
|
||||||
|
width: 510px;
|
||||||
|
height: 60px;
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
@ok="accountHandleOk"
|
@ok="accountHandleOk"
|
||||||
:destroyOnClose="true"
|
:destroyOnClose="true"
|
||||||
>
|
>
|
||||||
<SelectAccount ref="accountRef" />
|
<SelectAccount ref="accountRef" :selectListValue="groupList" />
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -36,7 +36,12 @@
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
|
|
||||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
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 { useMessage } from '@/hooks/web/useMessage';
|
||||||
import { useModal } from '@/components/Modal';
|
import { useModal } from '@/components/Modal';
|
||||||
|
|
@ -51,7 +56,7 @@
|
||||||
const [registerModal, { openModal: openRoleModal }] = useModal();
|
const [registerModal, { openModal: openRoleModal }] = useModal();
|
||||||
const [registerAccountModal, { openModal: openAccountModal }] = useModal();
|
const [registerAccountModal, { openModal: openAccountModal }] = useModal();
|
||||||
const searchInfo = reactive<Recordable>({});
|
const searchInfo = reactive<Recordable>({});
|
||||||
|
const groupList = ref([]);
|
||||||
const [registerTable, { reload, getSelectRows, clearSelectedRowKeys }] = useTable({
|
const [registerTable, { reload, getSelectRows, clearSelectedRowKeys }] = useTable({
|
||||||
// 表格名称
|
// 表格名称
|
||||||
title: '组列表',
|
title: '组列表',
|
||||||
|
|
@ -152,16 +157,25 @@
|
||||||
handleDelete();
|
handleDelete();
|
||||||
break;
|
break;
|
||||||
case 'btnAccounts':
|
case 'btnAccounts':
|
||||||
|
handleAccount();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function handleAccount() {
|
||||||
let rows = getSelectRows();
|
let rows = getSelectRows();
|
||||||
if (rows.length == 0) {
|
if (rows.length == 0) {
|
||||||
return createMessage.warn('请勾选一个组进行编辑');
|
return createMessage.warn('请勾选一个组进行编辑');
|
||||||
}
|
}
|
||||||
groupId.value = rows[0].id;
|
groupId.value = rows[0].id;
|
||||||
accountOpen.value = true;
|
accountOpen.value = true;
|
||||||
break;
|
const data = await getLoadUserListByGroupid({
|
||||||
default:
|
groupid: groupId.value,
|
||||||
break;
|
page: 1,
|
||||||
}
|
limit: 99999,
|
||||||
|
});
|
||||||
|
groupList.value = data.items.map((item) => item.id);
|
||||||
}
|
}
|
||||||
const accountRef = ref<any>();
|
const accountRef = ref<any>();
|
||||||
async function accountHandleOk() {
|
async function accountHandleOk() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue