|
|
@@ -5,11 +5,11 @@
|
|
|
<Authority>
|
|
|
<a-button type="primary" @click="handleCreate">新增地图</a-button>
|
|
|
</Authority>
|
|
|
- <!-- <Authority>
|
|
|
- <Popconfirm title="您确定要批量删除数据" ok-text="确定" cancel-text="取消" @confirm="handleDeleteOrBatchDelete(null)">
|
|
|
- <a-button type="primary" color="error" :disabled="hasBatchDelete"> 批量删除 </a-button>
|
|
|
- </Popconfirm>
|
|
|
- </Authority> -->
|
|
|
+ <Authority>
|
|
|
+ <!-- <Popconfirm title="您确定要批量删除数据" ok-text="确定" cancel-text="取消" @confirm="handleDeleteOrBatchDelete(null)"> -->
|
|
|
+ <a-button type="primary" @click="handleDelete" color="error" :disabled="hasBatchDelete"> 批量删除 </a-button>
|
|
|
+ <!-- </Popconfirm> -->
|
|
|
+ </Authority>
|
|
|
</template>
|
|
|
<!-- <template #status="{ record }">
|
|
|
<Switch :checked="record.status === 1" :loading="record.pendingStatus" checkedChildren="启用" unCheckedChildren="禁用"
|
|
|
@@ -51,10 +51,7 @@
|
|
|
color: 'error',
|
|
|
ifShow: record.roleType != RoleEnum.SYS_ADMIN,
|
|
|
disabled: record.status == 3 ? false : true,
|
|
|
- popConfirm: {
|
|
|
- title: '是否确认删除',
|
|
|
- confirm: handleDelete.bind(null, record),
|
|
|
- },
|
|
|
+ onClick: handleDelete.bind(null, record),
|
|
|
},
|
|
|
]" />
|
|
|
</template>
|
|
|
@@ -111,6 +108,7 @@ import { mapList } from '/@/api/dataAdmin/mrerdr';
|
|
|
import Moment from 'moment';
|
|
|
import { queryFlowInfoPage, submitExamine } from '/@/api/resource/examine';
|
|
|
import getKeywords from '/@/views/minWidgets/Keywords.js';
|
|
|
+import uiTool from '/@/utils/uiTool';
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
@@ -119,7 +117,7 @@ export default defineComponent({
|
|
|
setup() {
|
|
|
const tagValue = ref('');
|
|
|
const [registerModal, { openModal }] = useModal();
|
|
|
- const [registerTable, { setProps, reload, setSelectedRowKeys }] = useTable({
|
|
|
+ const [registerTable, { setProps, reload, setSelectedRowKeys, getSelectRows }] = useTable({
|
|
|
title: '地图资源列表',
|
|
|
api: mapList,
|
|
|
columns,
|
|
|
@@ -236,17 +234,21 @@ export default defineComponent({
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- const handleDelete = async (record: Recordable) => {
|
|
|
- if (record?.serviceid) {
|
|
|
- const res = await deleteService(record?.serviceid);
|
|
|
- if (res?.status !== '-1') {
|
|
|
- reload();
|
|
|
- createMessage.success('删除成功!', 1);
|
|
|
- } else {
|
|
|
- createMessage.error('删除失败!失败原因:' + res?.message, 1);
|
|
|
+ //删除所有选中
|
|
|
+ function handleDelete(record) {
|
|
|
+ uiTool.delModal('确定删除选中的地图资源?', async () => {
|
|
|
+ var ids = record?.serviceid ? record.serviceid : getSelectRows().map(i => i.serviceid).toString()
|
|
|
+ if (ids) {
|
|
|
+ const res = await deleteService(ids)
|
|
|
+ if (res?.status !== '-1') {
|
|
|
+ reload();
|
|
|
+ createMessage.success('删除成功!', 1)
|
|
|
+ } else {
|
|
|
+ createMessage.error('删除失败!失败原因:' + res?.message, 1)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- };
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
function handleSuccess() {
|
|
|
openModal(false, {
|