|
|
@@ -1,120 +1,162 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <BasicTable :rowSelection="{ type: 'checkbox' }" @register="registerTable" :clickToRowSelect="false">
|
|
|
- <template #toolbar>
|
|
|
- <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>
|
|
|
- </template>
|
|
|
- <!-- <template #status="{ record }">
|
|
|
- <Switch :checked="record.status === 1" :loading="record.pendingStatus" checkedChildren="启用" unCheckedChildren="禁用"
|
|
|
- @change="(checked: boolean) => statusChange(checked, record)" />
|
|
|
- </template> -->
|
|
|
- <template #action="{ record }">
|
|
|
- <TableAction :actions="[
|
|
|
- {
|
|
|
- label: '浏览',
|
|
|
- icon: '' /**clarity:note-edit-line*/,
|
|
|
- onClick: handleViewMap.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '查看',
|
|
|
- icon: '' /**clarity:note-edit-line*/,
|
|
|
- onClick: handleView.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '编辑',
|
|
|
- icon: '' /**clarity:note-edit-line*/,
|
|
|
- color: 'warning',
|
|
|
- onClick: handleEdit.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '删除',
|
|
|
- icon: '' /**ant-design:delete-outlined'*/,
|
|
|
- color: 'error',
|
|
|
- ifShow: record.roleType != RoleEnum.SYS_ADMIN,
|
|
|
- popConfirm: {
|
|
|
- title: '是否确认删除',
|
|
|
- confirm: handleDelete.bind(null, record),
|
|
|
+ <div class="p-4">
|
|
|
+ <div class="top-search">
|
|
|
+ <div class="left-search-input">
|
|
|
+ <div class="input">
|
|
|
+ <span>关键字</span>
|
|
|
+ <a-input allowClear v-model:value="searchValue" style="width: 200px;" placeholder="请输入资源名称"></a-input>
|
|
|
+ </div>
|
|
|
+ <div class="input">
|
|
|
+ <span>资源类型</span>
|
|
|
+ <a-select allowClear v-model:value="selectTypeValue" style="width: 200px" :options="typeOptions">
|
|
|
+ </a-select>
|
|
|
+ </div>
|
|
|
+ <div class="input">
|
|
|
+ <span>应用系统</span>
|
|
|
+ <a-select allowClear v-model:value="selectSystemValue" style="width: 200px" :options="sysOptions">
|
|
|
+ </a-select>
|
|
|
+ </div>
|
|
|
+ <div class="input">
|
|
|
+ <span>审核状态</span>
|
|
|
+ <a-select allowClear v-model:value="selectStatusValue" style="width: 200px" :options="statusOptions">
|
|
|
+ </a-select>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="input">
|
|
|
+ <span>申请时间</span>
|
|
|
+ <a-date-picker v-model:value="searchTime" placeholder="申请时间" style="width: 200px" />
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+ <div class="right-btns">
|
|
|
+ <a-button style="margin-right: 15px;" @click="handleReset">重置</a-button>
|
|
|
+ <a-button type="primary" @click="handleSearch">查询</a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="bottom-table">
|
|
|
+ <BasicTable @register="registerTable" class="basic-table">
|
|
|
+ <template #toolbar>
|
|
|
+ <a-button style="background-color: #fc8b01;color: #fff;" :disabled="hasSelected"
|
|
|
+ @click="handleCreate">批量审核</a-button>
|
|
|
+ </template>
|
|
|
+ <template #action="{ record }">
|
|
|
+ <TableAction :actions="[
|
|
|
+ {
|
|
|
+ label: '详情',
|
|
|
+ tooltip: '详情',
|
|
|
+ onClick: handleViewMap.bind(null, record),
|
|
|
},
|
|
|
- },
|
|
|
- ]" />
|
|
|
- </template>
|
|
|
- <template #pdate="{ record }">
|
|
|
- <Tag :color="'red'">
|
|
|
- {{
|
|
|
- record.publishdate ? moment(record.publishdate).format('YYYY-MM-DD HH:mm:ss') : ''
|
|
|
- }}
|
|
|
- </Tag>
|
|
|
- </template>
|
|
|
- <template #status="{ record }">
|
|
|
- <Tag :style="`color:${record.status === 3 || record.status === 3 ? 'red' : '#05B069'};`">
|
|
|
- {{
|
|
|
- record.status === 0 ? '待审核' : (record.status === 1 ? '审核通过' : (record.status === 2 ? '审核不通过' : (record.status
|
|
|
- === 3 ? '被驳回' : '未提交')))
|
|
|
- }}
|
|
|
- </Tag>
|
|
|
- </template>
|
|
|
- </BasicTable>
|
|
|
- <!-- <MapDrawer @register="registerDrawer" @success="handleSuccess" /> -->
|
|
|
- <MapSourceModal @register="registerModal" @success="handleSuccess" />
|
|
|
+ {
|
|
|
+ label: '审核',
|
|
|
+ tooltip: '审核',
|
|
|
+ onClick: handleView.bind(null, record),
|
|
|
+ }
|
|
|
+ ]" />
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+ <!-- <MapDrawer @register="registerDrawer" @success="handleSuccess" /> -->
|
|
|
+ <!-- <MapSourceModal @register="registerModal" @success="handleSuccess" /> -->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, nextTick, onBeforeMount, onMounted } from 'vue';
|
|
|
+import { defineComponent, reactive, ref, onMounted, watch, toRefs, computed, createVNode } from 'vue';
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
-import { delRole, getRoleListByPage, setRoleStatus } from '/@/api/system/system';
|
|
|
-// import { useDrawer } from '/@/components/Drawer';
|
|
|
-import { useModal } from '/@/components/Modal';
|
|
|
-import MapDrawer from './MapDrawer.vue';
|
|
|
-import MapSourceModal from './MapSourceModal.vue';
|
|
|
-import { columns, searchFormSchema } from './map.data';
|
|
|
-import { RoleEnum } from '/@/enums/roleEnum';
|
|
|
-import { Authority } from '/@/components/Authority';
|
|
|
-import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
|
|
|
-import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
-import { Switch, Popconfirm } from 'ant-design-vue';
|
|
|
-import { list, deleteService } from '/@/api/resource/map';
|
|
|
-import Moment from 'moment';
|
|
|
+
|
|
|
+import { columns } from './map.data';
|
|
|
+
|
|
|
+import moment from 'moment';
|
|
|
import { session } from '/@/utils/Memory';
|
|
|
//查询用户需要授权的数据api
|
|
|
import { queryTaskInfoPage } from '/@/api/resource/examine';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- name: 'RoleManagement',
|
|
|
- components: { BasicTable, MapDrawer, MapSourceModal, TableAction, Authority, Switch, Popconfirm },
|
|
|
+ name: 'Empowerment',
|
|
|
+ components: { BasicTable, TableAction },
|
|
|
setup() {
|
|
|
- onMounted(()=>{
|
|
|
+ const searchValue = ref('')
|
|
|
+ const selectTypeValue = ref('')
|
|
|
+ const selectSystemValue = ref('')
|
|
|
+ const selectStatusValue = ref('')
|
|
|
+ const searchTime = ref(null)
|
|
|
+ const typeOptions = [
|
|
|
+ {
|
|
|
+ label: "地图资源",
|
|
|
+ value: "map"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "场景资源",
|
|
|
+ value: "scene"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "文件资源",
|
|
|
+ value: "file"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "组件资源",
|
|
|
+ value: "zujian"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "接口服务",
|
|
|
+ value: "interface"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ const sysOptions = [
|
|
|
+ {
|
|
|
+ label: "xx系统",
|
|
|
+ value: "1"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "xxx系统",
|
|
|
+ value: "2"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "xx平台",
|
|
|
+ value: "3"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ const statusOptions = [
|
|
|
+ {
|
|
|
+ label: "未提交",
|
|
|
+ value: "未审核"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核中",
|
|
|
+ value: "审核中"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核通过",
|
|
|
+ value: "审核通过"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核不通过",
|
|
|
+ value: "审核不通过"
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ onMounted(() => {
|
|
|
let params = {
|
|
|
- page:1,
|
|
|
- rows:10000,
|
|
|
+ page: 1,
|
|
|
+ rows: 10000,
|
|
|
userId: session.getItem('userId'),
|
|
|
}
|
|
|
- queryTaskInfoPage(params).then(res=>{
|
|
|
+ queryTaskInfoPage(params).then(res => {
|
|
|
console.log(res)
|
|
|
})
|
|
|
})
|
|
|
- //const [registerDrawer, { openDrawer }] = useDrawer();
|
|
|
- const [registerModal, { openModal }] = useModal();
|
|
|
- const [registerTable, { setProps, reload, setSelectedRowKeys }] = useTable({
|
|
|
+
|
|
|
+ const [registerTable, { reload, getRowSelection, getSelectRowKeys, clearSelectedRowKeys }] = useTable({
|
|
|
title: '地图资源列表',
|
|
|
- api: list,
|
|
|
+ // api: list,
|
|
|
+ dataSource: [],
|
|
|
columns,
|
|
|
- formConfig: {
|
|
|
- labelWidth: 100,
|
|
|
- schemas: searchFormSchema,
|
|
|
- },
|
|
|
- useSearchForm: true,
|
|
|
+ rowSelection: { type: 'checkbox' },
|
|
|
+ useSearchForm: false,
|
|
|
showTableSetting: true,
|
|
|
- bordered: true,
|
|
|
+ bordered: false,
|
|
|
+ striped: false,
|
|
|
+ canResize: true,
|
|
|
showIndexColumn: true,
|
|
|
+ indexColumnProps: { fixed: 'left' },
|
|
|
actionColumn: {
|
|
|
- width: 200,
|
|
|
+ width: 120,
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
slots: { customRender: 'action' },
|
|
|
@@ -130,109 +172,120 @@ export default defineComponent({
|
|
|
fullScreen: false
|
|
|
},
|
|
|
});
|
|
|
- const moment = Moment
|
|
|
- const { createMessage } = useMessage();
|
|
|
- const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } =
|
|
|
- useBatchDelete(delRole, handleSuccess, setProps);
|
|
|
- selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => {
|
|
|
- // Demo:status为1的选择框禁用
|
|
|
- if (record.status === 1) {
|
|
|
- return { disabled: true };
|
|
|
- } else {
|
|
|
- return { disabled: false };
|
|
|
- }
|
|
|
- };
|
|
|
- nextTick(() => {
|
|
|
- setProps(selectionOptions);
|
|
|
+
|
|
|
+ //判断是否选中数据
|
|
|
+ const hasSelected = computed(() => {
|
|
|
+ const rowSelection = getRowSelection();
|
|
|
+ return !(rowSelection.selectedRowKeys?.length);
|
|
|
});
|
|
|
+ //重置查询
|
|
|
+ const handleReset = () => {
|
|
|
+ searchValue.value = ''
|
|
|
+ selectTypeValue.value = 'map'
|
|
|
+ selectSystemValue.value = '1'
|
|
|
+ selectStatusValue.value = '未审核'
|
|
|
+ searchTime.value = moment()
|
|
|
+ }
|
|
|
+ //条件查询
|
|
|
+ const handleSearch = () => {
|
|
|
+ reload();
|
|
|
+ }
|
|
|
|
|
|
- function handleCreate() {
|
|
|
- openModal(true, {
|
|
|
- isUpdate: false,
|
|
|
- });
|
|
|
+ const handleCreate = () => {
|
|
|
}
|
|
|
|
|
|
- function handleView(record: Recordable) {
|
|
|
- openModal(true, {
|
|
|
- record,
|
|
|
- isUpdate: true,
|
|
|
- isView: true,
|
|
|
- });
|
|
|
+ const handleView = (record) => {
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- function handleEdit(record: Recordable) {
|
|
|
- openModal(true, {
|
|
|
- record,
|
|
|
- isUpdate: true,
|
|
|
- });
|
|
|
+ const handleEdit = (record) => {
|
|
|
}
|
|
|
|
|
|
- function handleViewMap(record: Recordable) {
|
|
|
- window.open(`http://106.12.170.138:8080/onemapV5.0/mapview.html?${record.serviceid}`, 'target', "")
|
|
|
+ const handleViewMap = (record) => {
|
|
|
}
|
|
|
|
|
|
- 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)
|
|
|
- }
|
|
|
- }
|
|
|
+ const handleDelete = async (record) => {
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function handleSuccess() {
|
|
|
- openModal(false, {
|
|
|
- isUpdate: false,
|
|
|
- });
|
|
|
reload();
|
|
|
}
|
|
|
|
|
|
- const statusChange = async (checked, record) => {
|
|
|
- setProps({
|
|
|
- loading: true,
|
|
|
- });
|
|
|
- setSelectedRowKeys([]);
|
|
|
- resetSelectedRowKeys();
|
|
|
- const newStatus = checked ? 1 : 0;
|
|
|
- try {
|
|
|
- await setRoleStatus(record.id, newStatus);
|
|
|
- if (newStatus) {
|
|
|
- createMessage.success(`启用成功`);
|
|
|
- } else {
|
|
|
- createMessage.success('禁用成功');
|
|
|
- }
|
|
|
- } finally {
|
|
|
- setProps({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- reload();
|
|
|
- }
|
|
|
- };
|
|
|
- onBeforeMount(async () => {
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
return {
|
|
|
- moment,
|
|
|
- createMessage,
|
|
|
+ searchValue,
|
|
|
+ selectTypeValue,
|
|
|
+ selectSystemValue,
|
|
|
+ selectStatusValue,
|
|
|
+ searchTime,
|
|
|
+ typeOptions,
|
|
|
+ sysOptions,
|
|
|
+ statusOptions,
|
|
|
+ hasSelected,
|
|
|
registerTable,
|
|
|
// registerDrawer,
|
|
|
- registerModal,
|
|
|
+ handleReset,
|
|
|
+ handleSearch,
|
|
|
handleCreate,
|
|
|
handleViewMap,
|
|
|
handleEdit,
|
|
|
handleView,
|
|
|
handleDelete,
|
|
|
handleSuccess,
|
|
|
- RoleEnum,
|
|
|
- hasBatchDelete,
|
|
|
- handleDeleteOrBatchDelete,
|
|
|
- statusChange,
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.p-4 {
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .top-search {
|
|
|
+ width: 100%;
|
|
|
+ height: 74px;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .left-search-input {
|
|
|
+ margin-left: 20px;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .input {
|
|
|
+ margin-right: 30px;
|
|
|
+
|
|
|
+ span {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .right-btns {
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom-table {
|
|
|
+ margin-top: 24px;
|
|
|
+
|
|
|
+ .basic-table {
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ ::v-deep .ant-table-title {
|
|
|
+ padding: 0 !important;
|
|
|
+
|
|
|
+ .vben-basic-title {
|
|
|
+ font-family: '阿里巴巴普惠体 2.0';
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|