6 changed files with 234 additions and 14 deletions
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
<template> |
||||
<AMap/> |
||||
</template> |
||||
<script setup lang="ts"> |
||||
import { AMap } from '/@/components/AMap'; |
||||
</script> |
||||
<style scoped> |
||||
.main-content { |
||||
margin: 0 !important; |
||||
} |
||||
</style> |
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
<template> |
||||
<BasicModal v-bind="$attrs" |
||||
width="720px" |
||||
@ok="handleSubmit" |
||||
@register="registerModal" |
||||
> |
||||
<AMap/> |
||||
</BasicModal> |
||||
</template> |
||||
<script lang="ts" setup> |
||||
/** |
||||
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 |
||||
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||
* author entfrm开发团队-王翔 |
||||
*/ |
||||
import { ref, unref } from 'vue'; |
||||
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal'; |
||||
import { AMap } from '/@/components/AMap'; |
||||
|
||||
/** 通用变量统一声明区域 */ |
||||
const tag = ref<Nullable<string>>(''); |
||||
/** https://v3.cn.vuejs.org/api/options-data.html#emits */ |
||||
const emit = defineEmits(['success', 'register']); |
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data: WindowInnerData = { _tag: '' }) => { |
||||
// 处理清除脏数据 |
||||
|
||||
// 处理设置数据 |
||||
tag.value = data._tag; |
||||
const deptId = data.record?.deptId; |
||||
const props: Partial<ModalProps> = { confirmLoading: false, title: '地图设计' }; |
||||
// 采用tag标签区分操作 |
||||
switch (unref(tag)) { |
||||
case 'add': |
||||
|
||||
|
||||
break; |
||||
case 'edit': |
||||
|
||||
|
||||
break; |
||||
} |
||||
// 尾部:设置处理后的最终配置数据 |
||||
setModalProps(props); |
||||
}); |
||||
|
||||
/** 处理弹出框提交 */ |
||||
async function handleSubmit() { |
||||
try { |
||||
// 处理提交之前逻辑 |
||||
setModalProps({ confirmLoading: true }); |
||||
// 采用tag标签区分操作 |
||||
switch (unref(tag)) { |
||||
case 'add': |
||||
|
||||
break; |
||||
case 'edit': |
||||
|
||||
break; |
||||
} |
||||
// 处理提交完成之后逻辑 |
||||
closeModal(); |
||||
emit('success'); |
||||
} finally { |
||||
setModalProps({ confirmLoading: false }); |
||||
} |
||||
} |
||||
|
||||
</script> |
@ -0,0 +1,61 @@
@@ -0,0 +1,61 @@
|
||||
import { BasicColumn } from '/@/components/Table'; |
||||
import { FormSchema } from '/@/components/Table'; |
||||
|
||||
export const columns: BasicColumn[] = [ |
||||
{ |
||||
title: '地图名称', |
||||
dataIndex: 'name', |
||||
width: 120, |
||||
}, |
||||
{ |
||||
title: '收样员名称', |
||||
dataIndex: 'courierUserName', |
||||
width: 120, |
||||
}, |
||||
{ |
||||
title: '收样员起点经度值', |
||||
dataIndex: 'courierLng', |
||||
}, |
||||
{ |
||||
title: '收样员起点纬度值', |
||||
dataIndex: 'courierLat', |
||||
}, |
||||
{ |
||||
title: '发单下级医院名称', |
||||
dataIndex: 'sendOrderName', |
||||
width: 120 |
||||
}, |
||||
{ |
||||
title: '发单起点经度值', |
||||
dataIndex: 'sendOrderLng', |
||||
}, |
||||
{ |
||||
title: '发单起点纬度值', |
||||
dataIndex: 'sendOrderLat', |
||||
}, |
||||
{ |
||||
title: '报告单批次码', |
||||
dataIndex: 'batchCode', |
||||
}, |
||||
]; |
||||
|
||||
export const searchFormSchema: FormSchema[] = [ |
||||
{ |
||||
field: 'name', |
||||
label: '地图名称' , |
||||
component: 'Input', |
||||
componentProps: { |
||||
placeholder: '请输入地图名称', |
||||
}, |
||||
colProps: { span: 8 }, |
||||
}, |
||||
{ |
||||
field: 'batchCode', |
||||
label: '报告单批次码', |
||||
component: 'Input', |
||||
componentProps: { |
||||
placeholder: '请输入报告单批次码', |
||||
}, |
||||
colProps: { span: 8 } |
||||
} |
||||
]; |
@ -0,0 +1,100 @@
@@ -0,0 +1,100 @@
|
||||
<template> |
||||
<div> |
||||
<BasicTable @register="registerTable"> |
||||
<template #toolbar> |
||||
<a-button type="primary" |
||||
@click="handleAdd()" |
||||
>新增地图线路</a-button> |
||||
</template> |
||||
<template #action="{ record }"> |
||||
<TableAction :actions="[ |
||||
{ |
||||
label: '设计', |
||||
icon: 'fa6-regular:pen-to-square', |
||||
onClick: handleEdit.bind(null, record) |
||||
}, |
||||
{ |
||||
label: '删除', |
||||
icon: 'ant-design:delete-outlined', |
||||
color: 'error', |
||||
onClick: handleDel.bind(null, record) |
||||
}]" |
||||
/> |
||||
</template> |
||||
</BasicTable> |
||||
<!--弹出窗体区域--> |
||||
<AmapTaskModal @register="registerModal" @success="handleRefreshTable"/> |
||||
</div> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
/** |
||||
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 |
||||
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||
* author entfrm开发团队-王翔 |
||||
*/ |
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
||||
import { useModal } from '/@/components/Modal'; |
||||
import { columns, searchFormSchema } from './amapTask.data'; |
||||
import { useMessage } from '/@/hooks/web/useMessage'; |
||||
import AmapTaskModal from './AmapTaskModal.vue'; |
||||
|
||||
const { createConfirm, createMessage } = useMessage(); |
||||
const [registerModal, { openModal }] = useModal(); |
||||
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ |
||||
title: '地图任务列表', |
||||
//api: , |
||||
rowKey: 'id', |
||||
columns, |
||||
formConfig: { |
||||
labelWidth: 120, |
||||
schemas: searchFormSchema, |
||||
autoSubmitOnEnter: true, |
||||
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']] |
||||
}, |
||||
useSearchForm: true, |
||||
showTableSetting: true, |
||||
bordered: true, |
||||
clickToRowSelect: false, |
||||
actionColumn: { |
||||
width: 220, |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
slots: { customRender: 'action' }, |
||||
fixed: false |
||||
} |
||||
}); |
||||
|
||||
/** 新增按钮操作,行内新增与工具栏局域新增通用 */ |
||||
function handleAdd() { |
||||
openModal(true,{ _tag: 'add' }); |
||||
} |
||||
|
||||
/** 编辑按钮操作,行内编辑 */ |
||||
function handleEdit(record?: Recordable) { |
||||
record = record || { id: getSelectRowKeys() }; |
||||
openModal(true, { _tag: 'edit', record }); |
||||
} |
||||
|
||||
/** 删除按钮操作,行内删除 */ |
||||
async function handleDel(record?: Recordable) { |
||||
const id = record?.id || getSelectRowKeys(); |
||||
createConfirm({ |
||||
iconType: 'warning', |
||||
title: '警告', |
||||
content: `是否确认删除机构编号为${id}机构吗?`, |
||||
onOk: async () => { |
||||
|
||||
createMessage.success('删除成功!'); |
||||
handleRefreshTable(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** 处理表格刷新 */ |
||||
function handleRefreshTable() { |
||||
clearSelectedRowKeys(); |
||||
reload(); |
||||
} |
||||
</script> |
Loading…
Reference in new issue