Bläddra i källkod

代理中心剩余页面完成

sujunling 1 år sedan
förälder
incheckning
54cf7af411

+ 4 - 5
src/api/resource/proxy.ts

@@ -38,15 +38,14 @@ export function getProxyList(params) {
  * @description:删除代理中心
  */
 export function proxyDel(params) {
-    params.page = params.page;
-    params.rows = params.pageSize;
     return new Promise<void>((resolve, reject) => {
-        defHttp.post({ url: Api.proxyDel, params, ...interfaceType })
+        defHttp.post({ url: Api.proxyDel, params: { mapServerProxy: [params] }, ...interfaceType })
             .then((r) => {
                 if (r.resp_code == 0) {
-                    console.log("代理中心数据:", r.datas);
-                    resolve(r.datas);
+                    resolve(r);
                 }
+            }).catch((r) => {
+                reject(false);
             })
     })
 }

+ 0 - 143
src/views/resource/proxy/check.vue

@@ -1,143 +0,0 @@
-<template>
-  <BasicModal width="600px" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit"
-    :useWrapper="true" :minHeight="200">
-    <div style="height: 50vh">
-      <BasicForm @register="registerForm">
-        <template #descinfo>
-          <div class="basic-info-title">描述信息</div>
-        </template>
-      </BasicForm>
-    </div>
-  </BasicModal>
-</template>
-<script lang="ts">
-import { defineComponent, ref, computed, unref, onMounted } from 'vue';
-import { BasicModal, useModalInner } from '/@/components/Modal';
-import { BasicForm, useForm } from '/@/components/Form/index';
-import { accountFormSchema } from './map.data.ts';
-import { filterRoleList } from '/@/api/system/system';
-import { useMessage } from '/@/hooks/web/useMessage';
-import { TOption } from '/@/views/rule/linkedge/config/config.data';
-import { PlusOutlined } from '@ant-design/icons-vue';
-import { subminExamineResult } from '/@/api/resource/examine';
-import { session } from '/@/utils/Memory.js';
-
-export default defineComponent({
-  name: 'AccountModal',
-  components: {
-    BasicModal,
-    BasicForm,
-    PlusOutlined,
-  },
-  emits: ['success', 'register'],
-  setup(_, { emit }) {
-    const tenantLogo = ref('');
-    const loading = ref(false);
-    const roleOptions = ref<TOption[]>([]);
-    const isUpdate = ref(true);
-    const bussid = ref('');
-    const userinfo = session.getItem('userInfo');
-    const getRoleList = async () => {
-      const res = await filterRoleList();
-      console.log(res);
-      roleOptions.value = res.map((m) => {
-        return {
-          label: m.name,
-          value: m.id,
-        };
-      });
-    };
-    onMounted(async () => {
-      //await getRoleList();   //这个会导致查询失败
-    });
-
-    const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
-      labelWidth: 100,
-      schemas: accountFormSchema,
-      showActionButtonGroup: false,
-      actionColOptions: {
-        span: 18,
-      },
-    });
-
-    const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
-      await resetFields();
-      setModalProps({ confirmLoading: false });
-      isUpdate.value = !!data?.isUpdate;
-      if (unref(isUpdate)) {
-        bussid.value = data.record.BUSSID;
-        setFieldsValue(data.record);
-      }
-    });
-    const getTitle = '审核';
-    async function handleSubmit() {
-      setModalProps({ confirmLoading: true });
-      try {
-        const { createMessage } = useMessage();
-        const values = await validate(); //validate(['parentId']);
-        console.log('userinfo', userinfo)
-        const params = {
-          bussInfoId: bussid.value,    //业务id
-          ispass: values.ispass,       //是否通过
-          opinion: values.opinion,      //意见
-        }
-        const res = await subminExamineResult(params) as any
-        if (res) {
-          console.log(res);
-          closeModal();
-          emit('success');
-          var type = res.resp_code == 0 ? 'success' : 'error';
-          createMessage[type](res.resp_msg);
-        } else {
-          closeModal();
-          emit('success');
-          createMessage.error('审核失败!');
-        }
-      } finally {
-        setTimeout(() => {
-          setModalProps({ confirmLoading: false });
-        }, 300);
-      }
-    }
-
-    return {
-      registerModal,
-      registerForm,
-      handleSubmit,
-      getTitle,
-      roleOptions,
-      tenantLogo,
-      loading,
-    };
-  },
-});
-</script>
-<style scoped lang="less">
-:deep(.vben-basic-tree) {
-  width: 100% !important;
-}
-
-:deep(.is-unflod) {
-  display: none !important;
-}
-
-:deep(.is-flod) {
-  display: none !important;
-}
-
-.basic-info-title {
-  height: 19px;
-  line-height: 18px;
-  padding-left: 6px;
-  margin-left: 20px;
-  border-left: 3px solid #0671dd;
-  font-family: Source Han Sans CN;
-  font-size: 16px;
-  font-weight: 350;
-  letter-spacing: 0px;
-}
-
-:deep(.ant-calendar-picker) {
-  width: 100% !important;
-}
-</style>

+ 22 - 143
src/views/resource/proxy/index.vue

@@ -12,7 +12,6 @@
         <template #toolbar>
           <Authority>
             <a-button type="primary" @click="showModal">指定IP设置</a-button>
-            <!-- <a-button type="primary" @click="batchExamine" :disabled="hasBatchDelete">指定IP设置</a-button> -->
           </Authority>
         </template>
 
@@ -20,58 +19,20 @@
           <TableAction :actions="[
             {
               label: '指定IP设置',
-              ifShow: current == 'DR' ? false : true,
               onClick: showModal.bind(null, record),
             },
             {
               label: '删除',
-              onClick: handleDetail.bind(null, record),
+              onClick: handleDel.bind(null, record),
             },
-            // {
-            //   label: '审核',
-            //   disabled: statusShow == 1 ? false : true,
-            //   color: 'warning',
-            //   onClick: handleEdit.bind(null, record),
-            // },
           ]" />
         </template>
-        <template #pdate="{ record }">
-          <a-tag :color="'red'">
-            {{ record.publishdate ? moment(record.publishdate).format('YYYY-MM-DD HH:mm:ss') : '' }}
-          </a-tag>
-        </template>
-        <template #SERVICEID="{ record }">
-          {{ record.SERVICEID.replace('上传', '') }}
-        </template>
-        <template #status="{ record }">
-          <a-tag :style="`color:${record.status === 3 || record.status === 3 ? 'red' : ''};`">
-            {{
-              !record.status ? '待审核' : record.status == 2 ? '审核不通过' : record.status ? '审核通过' : ''
-            }}
-          </a-tag>
-        </template>
-        <template #BLZT="{ record }">
-          <a-tag :style="`color:${record.status === 3 || record.status === 3 ? 'red' : ''};`">
-            {{
-              record.BLZT
-            }}
-          </a-tag>
-        </template>
       </BasicTable>
-      <check v-if="ischect" @register="registerModal" @success="handleSuccess" />
-      <map-resource-upload v-if="!ischect && current === 'MR'" @register="registerModal"
-        @success="handleSuccess"></map-resource-upload>
-      <scene-resource-upload v-if="!ischect && current === 'ER'" @register="registerModal"
-        @success="handleSuccess"></scene-resource-upload>
-      <file-resource-upload v-if="!ischect && current === 'DR'" @register="registerModal"
-        @success="handleSuccess"></file-resource-upload>
-      <ass-resource-upload v-if="!ischect && current === 'SR'" @register="registerModal"
-        @success="handleSuccess"></ass-resource-upload>
     </div>
     <a-modal v-model:visible="visible" :label-col="labelCol" :wrapper-col="wrapperCol" title="代理IP地址设置" @ok="handleOk">
       <div class="wapper">
-        <p><span>IP地址:</span><a-input v-model:value="formState.ipaddress" /></p>
-        <p><span>服务ID:</span><a-input v-model:value="formState.serviceid" /></p>
+        <p><span>IP地址:&nbsp;</span><a-input v-model:value="formState.ipaddress" /></p>
+        <p><span>服务ID:&nbsp;</span><a-input v-model:value="formState.serviceid" /></p>
       </div>
       <span style="clear: both;"></span>
     </a-modal>
@@ -81,13 +42,6 @@
 import { defineComponent, nextTick, ref, watch } from 'vue';
 import { BasicTable, useTable, TableAction } from '/@/components/Table';
 import { delRole, setRoleStatus } from '/@/api/system/system';
-import MapResourceUpload from '/@/views/dataAdmin/dataAdmin/mapUpload/MapSourceModal.vue';
-import FileResourceUpload from '/@/views/dataAdmin/dataAdmin/fileResourceUpload/AddMethod.vue';
-import SceneResourceUpload from '/@/views/dataAdmin/dataAdmin/sceneResourceUpload/AddMethod.vue';
-import AssResourceUpload from '/@/views/dataAdmin/assembly/MapSourceModal.vue';
-import check from './check.vue';
-import { getFileUrl } from '/@/api/resource/files';
-import { session } from '/@/utils/Memory.js';
 import {
   columns,
   searchFormSchemaMR,
@@ -98,11 +52,9 @@ import {
 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, message } from 'ant-design-vue';
-import { queryResourceById } from '/@/api/resource/map';
 import Moment from 'moment';
-import { getProxyList, proxySave } from '/@/api/resource/proxy';
+import { getProxyList, proxySave, proxyDel } from '/@/api/resource/proxy';
 import { useModal } from '/@/components/Modal';
 import { useRouter } from 'vue-router';
 import { useAppStore } from '/@/store/modules/app';
@@ -111,15 +63,10 @@ export default defineComponent({
   name: 'RoleManagement',
   components: {
     BasicTable,
-    check,
     TableAction,
     Authority,
     Switch,
-    Popconfirm,
-    MapResourceUpload,
-    FileResourceUpload,
-    AssResourceUpload,
-    SceneResourceUpload,
+    Popconfirm
   },
   setup() {
     const appStore = useAppStore();
@@ -257,21 +204,16 @@ export default defineComponent({
     /**
      * 详情
      */
-    async function handleDetail(record: Recordable) {
-      ischect.value = false;
-      const res = (await queryResourceById(record?.SERVICEID)) as any;
-      if (res) {
-        if (res.dataVersionConf) {
-          res.metadata.isnew = res.servicebase.isnew = res.dataVersionConf.active == 'Y' ? "1" : "0";
+    async function handleDel(record: Recordable) {
+      console.log(record);
+      proxyDel(record).then((r) => {
+        if (r) {
+          message.success(r.resp_msg);
+          reload();
+        } else {
+          message.error('删除代理失败!');
         }
-        const result = Object.assign(res.metadata, res.servicebase, res.dataVersionConf || {});
-        if (record.bussid) res.bussid = record.BUSSID;
-        openModal(true, {
-          record: result,
-          isUpdate: true,
-          isView: true,
-        });
-      }
+      })
     }
 
     /**
@@ -287,45 +229,7 @@ export default defineComponent({
         appStore.setRouterPushAuditFlag(false)
       }, 100);
     }
-    /**
-     * 浏览
-     */
-    async function handleVliew(record: Recordable) {
-      //场景资源
-      if (current.value === 'ER') {
-        window.open(`http://192.168.119.143:8080/onemapV5.0/sceneview.html?${record.SERVICEID}`, 'target', '');
-      }
-      //地图资源
-      if (current.value === 'MR') {
-        window.open(`http://192.168.119.143:8080/onemapV5.0/mapview.html?${record.SERVICEID}`, 'target', '');
-      }
-      //地图资源
-      if (current.value === 'SR') {
-        var res = (await queryResourceById(record?.SERVICEID)) as any;
-        res = Object.assign(res.metadata, res.servicebase, res.dataVersionConf || {});
-        if (res) {
-          window.open(`./mapview.html?onlineIde_${res.servicealiasname}`, 'target', '');
-        }
-      }
-      //文件资源
-      if (current.value === 'DR') {
-        const obj = {
-          id: record['fileid'],
-          userid: record['userid'],
-          parentId: session.getItem('sysFild').dirId,
-        };
-        const res = (await getFileUrl(obj)) as any;
-        if (res) {
-          const fileName = res.fileName;
-          console.log('下载文件', fileName);
-          const url = res.url;
-          window.open(url);
-        }
-      }
-      if (current.value === 'DR') {
-        console.log('组件');
-      }
-    }
+
 
     function handleSuccess() {
       openModal(false, {
@@ -334,37 +238,15 @@ export default defineComponent({
       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());
-    };
-
     const visible = ref(false);
 
+    const disabled = ref(true);
     const showModal = (e) => {
       visible.value = true;
-      if (e) formState.value.serviceid = e.SERVICEID;
+      disabled.value = e ? true : false;
+      if (e) {
+        formState.value.serviceid = e.SERVICEID;
+      }
     };
 
     function handleOk() {
@@ -387,6 +269,7 @@ export default defineComponent({
 
 
     return {
+      disabled,
       labelCol: { span: 2 },
       wrapperCol: { span: 6 },
       formState,
@@ -400,15 +283,12 @@ export default defineComponent({
       sourceTypes,
       registerTable,
       registerModal,
-      handleVliew,
-      handleDetail,
+      handleDel,
       handleEdit,
       handleSuccess,
       RoleEnum,
       hasBatchDelete,
       handleDeleteOrBatchDelete,
-      statusChange,
-      batchExamine,
       selectHandle,
       onFetchSuccess
     };
@@ -464,7 +344,6 @@ export default defineComponent({
       border-radius: 2px;
       cursor: pointer;
     }
-
     .active {
       background: #0671dd;
       color: #fff;

+ 7 - 196
src/views/resource/proxy/map.data.ts

@@ -1,76 +1,6 @@
 import { BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Table';
-import { RoleEnum } from '/@/enums/roleEnum';
-import { getServiceTypes, queryServiceTags, queryDicsByName, queryCoors } from '/@/api/resource/map';
 
-const resTag = await queryServiceTags()
-let listTag = []
-resTag.map(item => {
-  listTag.push({
-    label: item.name,
-    value: item.code
-  })
-})
-/**
- * 密级字典
-*/
-export const secrets = await queryDicsByName('密级')
-/**
- * 服务标签
-*/
-export const serviceTags = listTag;
-/**
- * 坐标系列表
-*/
-export const sysCoors = await queryCoors()
-/**
- * 服务类型
-*/
-export const serviceTypes = await getServiceTypes()
-/**
- * 责任处室
-*/
-export const respDept = await queryDicsByName('责任处室')
-/**
- * 保管单位
-*/
-export const collectDept = await queryDicsByName('保管单位')
-/**
- * EPSG code
-*/
-export const EPSGCodes = await queryDicsByName('EPSG code')
-
-
-const checkStatus = [
-  // { label: '未提交', value: 3 },
-  // { label: '审核中', value: 2 },
-  // { label: '审核不通过', value: 0 },
-  // { label: '被驳回', value: 4 },
-  // { label: '审核通过', value: 1 },
-
-  // { label: '全部状态', value: '7' },
-  // { label: '待审核', value: 0 },
-  // { label: '审核通过', value: 1 },
-  // { label: '审核不通过', value: 2 },
-
-  // { label: '在办', value: 1 },
-  { label: '待办', value: 1 },
-  { label: '已办结', value: 2 },
-
-  // { label: '待审核', value: 1 },
-  // { label: '已审核', value: 2 },
-]
-export enum KeysTypeEnum {
-  DISABLED = 'disabled',
-  ENABLED = 'enabled',
-}
-
-export const RoleMenuDictEnum: Recordable<{ key: string; keyType: KeysTypeEnum }> = {
-  [RoleEnum.PLATFORM_ADMIN]: { key: 'enabled_platform_admin_auth', keyType: KeysTypeEnum.ENABLED },
-  [RoleEnum.SYS_ADMIN]: { key: 'enabled_sysadmin_auth', keyType: KeysTypeEnum.ENABLED },
-  [RoleEnum.TENANT_ADMIN]: { key: 'disabled_tenant_auth', keyType: KeysTypeEnum.DISABLED },
-  [RoleEnum.CUSTOMER_USER]: { key: 'disabled_tenant_auth', keyType: KeysTypeEnum.DISABLED },
-};
 
 
 
@@ -82,21 +12,11 @@ export const searchFormSchemaMR: FormSchema[] = [
     field: 'keyStr',
     label: '关键字',
     component: 'Input',
-    colProps: { span: 5 },
+    colProps: { span: 7 },
     componentProps: {
       maxLength: 255,
     },
-  },
-  {
-    field: 'checkStatus',
-    label: '审核状态',
-    component: 'Select',
-    defaultValue: 1,
-    componentProps: {
-      options: checkStatus,
-    },
-    colProps: { span: 5 },
-  },
+  }
 ];
 
 /**
@@ -107,21 +27,11 @@ export const searchFormSchemaER: FormSchema[] = [
     field: 'keyStr',
     label: '关键字',
     component: 'Input',
-    colProps: { span: 5 },
+    colProps: { span: 7 },
     componentProps: {
       maxLength: 255,
     },
-  },
-  {
-    field: 'checkStatus',
-    label: '审核状态',
-    component: 'Select',
-    defaultValue: 1,
-    componentProps: {
-      options: checkStatus,
-    },
-    colProps: { span: 5 },
-  },
+  }
 ];
 
 /**
@@ -132,21 +42,11 @@ export const searchFormSchemaDR: FormSchema[] = [
     field: 'keyStr',
     label: '关键字',
     component: 'Input',
-    colProps: { span: 5 },
+    colProps: { span: 7 },
     componentProps: {
       maxLength: 255,
     },
-  },
-  {
-    field: 'checkStatus',
-    label: '审核状态',
-    component: 'Select',
-    defaultValue: 1,
-    componentProps: {
-      options: checkStatus,
-    },
-    colProps: { span: 5 },
-  },
+  }
 ];
 
 /**
@@ -157,21 +57,11 @@ export const searchFormSchemaSR: FormSchema[] = [
     field: 'keyStr',
     label: '关键字',
     component: 'Input',
-    colProps: { span: 5 },
+    colProps: { span: 7 },
     componentProps: {
       maxLength: 255,
     },
   },
-  {
-    field: 'checkStatus',
-    label: '审核状态',
-    component: 'Select',
-    defaultValue: 1,
-    componentProps: {
-      options: checkStatus,
-    },
-    colProps: { span: 5 },
-  },
 ];
 
 
@@ -213,82 +103,3 @@ export const columns: BasicColumn[] = [
   },
 ];
 
-/**
- * 表单
-*/
-export const formSchema: FormSchema[] = [
-  {
-    field: 'groupName',
-    label: '角色名称',
-    required: true,
-    component: 'Input',
-    componentProps: {
-      maxLength: 255,
-      placeholder: '请输入角色名称',
-    },
-  },
-  {
-    label: '排序',
-    field: 'sort',
-    component: 'Input',
-    componentProps: {
-      maxLength: 255,
-      placeholder: '请输入排序',
-    },
-  }
-];
-
-function getOp() {
-  return new Promise<void>((resolve, reject) => {
-    resolve([
-      { label: "通过", value: '1' },
-      { label: "不通过", value: '0' },
-    ])
-  })
-}
-
-
-// 新增表单配置
-export const accountFormSchema = [
-  {
-    field: 'ispass',
-    label: "审核结果", //状态
-    component: 'RadioButtonGroup',
-    required: true,
-    colProps: { span: 24 },
-    defaultValue: '1',
-    componentProps: {
-      options: [
-        { label: "通过", value: '1' },
-        { label: "不通过", value: '0' },
-      ],
-    },
-  },
-  {
-    field: 'opinion',
-    label: '审核意见',
-    component: 'Input',
-    defaultValue: '',
-    colProps: { span: 24 },
-    componentProps: {
-      placeholder: '请输入审核意见',
-    },
-    dynamicRules: ({ values }) => {
-      if (values?.ispass) {
-        var type = Number(values?.ispass) ? false : true
-        return [{
-          required: type,
-          validator(_, value) {
-            return new Promise((resolve, reject) => {
-              if (type && !value) {
-                reject('不通过意见不能为空!');
-              } else {
-                resolve();
-              }
-            });
-          }
-        }];
-      }
-    },
-  },
-]