|
|
@@ -2,206 +2,49 @@
|
|
|
<div class="examine-container">
|
|
|
<div class="left-container">
|
|
|
<template v-for="source in sourceTypes" :key="source.name">
|
|
|
- <div
|
|
|
- class="soure-item-row"
|
|
|
- :class="{ active: current === source.name }"
|
|
|
- @click="current = source.name"
|
|
|
- >
|
|
|
- {{ `${source.name}(${source.num})` }}
|
|
|
+ <div class="soure-item-row" :class="{ active: current === source.name }" @click="current = source.name">
|
|
|
+ {{ source.name }}( <span :id="'sjck' + source.type">{{ getNum(source.type, 'sjck') }} </span>)
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
<div class="right-container">
|
|
|
- <BasicTable :rowSelection="{ type: 'checkbox' }" rowKey="serviceid" @register="registerTable">
|
|
|
- <template #action="{ record }">
|
|
|
- <TableAction
|
|
|
- :actions="[
|
|
|
- {
|
|
|
- label: '浏览',
|
|
|
- icon: '' /**clarity:note-edit-line*/,
|
|
|
- onClick: handleEdit.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '详情',
|
|
|
- icon: '' /**clarity:note-edit-line*/,
|
|
|
- onClick: handleEdit.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' : ''};`">
|
|
|
- {{
|
|
|
- record.status === 0
|
|
|
- ? '待审核'
|
|
|
- : record.status === 1
|
|
|
- ? '审核通过'
|
|
|
- : record.status === 2
|
|
|
- ? '审核不通过'
|
|
|
- : record.status === 3
|
|
|
- ? '被驳回'
|
|
|
- : '未提交'
|
|
|
- }}
|
|
|
- </Tag>
|
|
|
- </template>
|
|
|
- </BasicTable>
|
|
|
- <MapSourceModal @register="registerModal" @success="handleSuccess" />
|
|
|
+ <MapList :isChild="false" v-if="current == '地图资源'"></MapList>
|
|
|
+ <SceneList :isChild="false" v-if="current == '场景资源'"></SceneList>
|
|
|
+ <FileList :isChild="false" v-if="current == '文件资源'"></FileList>
|
|
|
+ <AssList :isChild="false" v-if="current == '组件资源'"></AssList>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, nextTick, onBeforeMount, reactive, ref, toRef } 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 MapSourceModal from './MapSourceModal.vue';
|
|
|
-import { columns, searchFormSchema } from './map.data';
|
|
|
+import { defineComponent, ref } from 'vue';
|
|
|
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 } from '/@/api/resource/map';
|
|
|
-import Moment from 'moment';
|
|
|
-import { active } from 'sortablejs';
|
|
|
+import MapList from '../dataAdmin/mapUpload/index.vue';
|
|
|
+import SceneList from '../dataAdmin/sceneResourceUpload/index.vue';
|
|
|
+import FileList from '../dataAdmin/fileResourceUpload/index.vue';
|
|
|
+import AssList from '../assembly/index.vue';
|
|
|
+import { MEDSTotal } from '/@/api/dataAdmin/mrerdr';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'RoleManagement',
|
|
|
- components: { BasicTable, MapSourceModal, TableAction, Authority, Switch, Popconfirm },
|
|
|
+ components: { MapList, SceneList, FileList, AssList },
|
|
|
setup() {
|
|
|
let current = ref('地图资源');
|
|
|
- //const [registerDrawer, { openDrawer }] = useDrawer();
|
|
|
- const [registerModal, { openModal }] = useModal();
|
|
|
- const [registerTable, { getSelectRows, setProps, reload, setSelectedRowKeys }] = useTable({
|
|
|
- title: '地图资源列表',
|
|
|
- api: list, //求接口
|
|
|
- //dataSource: dataSources, //表格的数据
|
|
|
- columns,
|
|
|
- rowKey: 'serviceid',
|
|
|
- formConfig: {
|
|
|
- labelWidth: 100,
|
|
|
- schemas: searchFormSchema,
|
|
|
- },
|
|
|
- useSearchForm: true,
|
|
|
- showTableSetting: true,
|
|
|
- bordered: true,
|
|
|
- showIndexColumn: true,
|
|
|
- actionColumn: {
|
|
|
- width: 200,
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- fixed: 'right',
|
|
|
- },
|
|
|
- pagination: {
|
|
|
- hideOnSinglePage: false,
|
|
|
- },
|
|
|
- clickToRowSelect: true, //点击当前行多选框不选中,默认是true
|
|
|
- rowSelection: { type: 'checkbox' }, //是否有多选功能
|
|
|
- tableSetting: {
|
|
|
- redo: true,
|
|
|
- size: true,
|
|
|
- setting: false,
|
|
|
- fullScreen: false
|
|
|
- },
|
|
|
- });
|
|
|
- const moment = Moment;
|
|
|
-
|
|
|
const sourceTypes = ref([
|
|
|
- { name: '地图资源', num: 4 },
|
|
|
- { name: '场景资源', num: 5 },
|
|
|
- { name: '文件资源', num: 10 },
|
|
|
- { name: '组件资源', num: 2 },
|
|
|
+ { name: '地图资源', type: 'MR', num: 0 },
|
|
|
+ { name: '场景资源', type: 'ER', num: 0 },
|
|
|
+ { name: '文件资源', type: 'DR', num: 0 },
|
|
|
+ { name: '组件资源', type: 'SR', num: 0 },
|
|
|
]);
|
|
|
- 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);
|
|
|
- });
|
|
|
-
|
|
|
- function handleCreate() {
|
|
|
- // openDrawer(true, {
|
|
|
- // isUpdate: false,
|
|
|
- // });
|
|
|
- openModal(true, {
|
|
|
- isUpdate: false,
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
- function handleEdit(record: Recordable) {
|
|
|
- // openDrawer(true, {
|
|
|
- // record,
|
|
|
- // isUpdate: true,
|
|
|
- // });
|
|
|
- openModal(true, {
|
|
|
- record,
|
|
|
- isUpdate: true,
|
|
|
- });
|
|
|
+ function getNum(type, name) {
|
|
|
+ MEDSTotal({ type: type }, name + type)
|
|
|
}
|
|
|
|
|
|
- function handleSuccess() {
|
|
|
- openModal(false, {
|
|
|
- isUpdate: false,
|
|
|
- });
|
|
|
- reload();
|
|
|
- }
|
|
|
-
|
|
|
- const statusChange = async (checked, record) => {
|
|
|
- setProps({
|
|
|
- loading: true,
|
|
|
- });
|
|
|
- setSelectedRowKeys([]);
|
|
|
- resetSelectedRowKeys();
|
|
|
- const newStatus = checked ? 1 : 0;
|
|
|
- const { createMessage } = useMessage();
|
|
|
- try {
|
|
|
- await setRoleStatus(record.id, newStatus);
|
|
|
- if (newStatus) {
|
|
|
- createMessage.success(`启用成功`);
|
|
|
- } else {
|
|
|
- createMessage.success('禁用成功');
|
|
|
- }
|
|
|
- } finally {
|
|
|
- setProps({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- reload();
|
|
|
- }
|
|
|
- };
|
|
|
- const batchExamine = () => {
|
|
|
- console.log('审核数据',getSelectRows())
|
|
|
- };
|
|
|
-
|
|
|
- onBeforeMount(async () => {});
|
|
|
-
|
|
|
return {
|
|
|
+ getNum,
|
|
|
current,
|
|
|
- moment,
|
|
|
sourceTypes,
|
|
|
- registerTable,
|
|
|
- registerModal,
|
|
|
- handleCreate,
|
|
|
- handleEdit,
|
|
|
- handleSuccess,
|
|
|
RoleEnum,
|
|
|
- hasBatchDelete,
|
|
|
- handleDeleteOrBatchDelete,
|
|
|
- statusChange,
|
|
|
- batchExamine,
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
@@ -211,6 +54,7 @@ export default defineComponent({
|
|
|
display: flex;
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
+
|
|
|
.left-container {
|
|
|
width: 240px;
|
|
|
height: calc(100% - 32px);
|
|
|
@@ -218,6 +62,8 @@ export default defineComponent({
|
|
|
padding: 10px 20px;
|
|
|
background-color: #fff;
|
|
|
border-radius: 2px;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
.soure-item-row {
|
|
|
height: 34px;
|
|
|
width: 100%;
|
|
|
@@ -231,11 +77,13 @@ export default defineComponent({
|
|
|
background: #eff0f5;
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
+
|
|
|
.active {
|
|
|
background: #0671dd;
|
|
|
color: #fff;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.right-container {
|
|
|
width: calc(100% - 260px);
|
|
|
height: 100%;
|