فهرست منبع

代理中心完成一半

sujunling 1 سال پیش
والد
کامیت
5795f77744
4فایلهای تغییر یافته به همراه154 افزوده شده و 64 حذف شده
  1. 2 2
      .env.development
  2. 60 0
      src/api/resource/proxy.ts
  3. 75 15
      src/views/resource/proxy/index.vue
  4. 17 47
      src/views/resource/proxy/map.data.ts

+ 2 - 2
.env.development

@@ -11,10 +11,10 @@ VITE_GLOB_PUBLIC_PATH = /
 # VITE_PROXY = [["/api","http://192.168.2.225/api"]]
 
 # 线上演示环境
-# VITE_PROXY = [["/api","http://117.174.10.73:19200"],["/agent","http://117.174.10.73:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
+VITE_PROXY = [["/api","http://117.174.10.73:19200"],["/agent","http://117.174.10.73:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://192.168.49.163:20043"],["/agent","http://192.168.49.163:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://127.0.0.1:20043"],["/agent","http://127.0.0.1:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
-VITE_PROXY = [["/api","http://192.168.49.163:20043"],["/agent","http://192.168.49.163:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
+# VITE_PROXY = [["/api","http://192.168.49.163:20043"],["/agent","http://192.168.49.163:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://127.0.0.1:8008"],["/agent","http://127.0.0.1:8008"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://127.0.0.1:8008"],["/agent","http://127.0.0.1:8008"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://192.168.119.143:9200"],["/agent","http://192.168.119.143:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"]]                                                            

+ 60 - 0
src/api/resource/proxy.ts

@@ -0,0 +1,60 @@
+/*
+ * @Author: tengmingxue 1473375109@qq.com
+ * @Date: 2023-08-15 11:20:48
+ * @LastEditors: tengmingxue 1473375109@qq.com
+ * @LastEditTime: 2023-08-21 17:19:02
+ * @FilePath: \xld-gis-admin\src\api\resource\scene.ts
+ * @Description: 场景资源接口
+ */
+import { defHttp } from '/@/utils/http/axios';
+enum Api {
+    getMapService = '/base-center/SupermapProxy/getMapService',
+    proxyDel = '/base-center/SupermapProxy/del',
+    proxySave = '/base-center/SupermapProxy/edit',
+}
+const interfaceType = { apiUrl: true };
+
+/**
+ * @description:代理资源列表
+ */
+export function getProxyList(params) {
+    params.page = params.page;
+    params.rows = params.pageSize;
+    console.log("代理中心数据:", params);
+    return new Promise<void>((resolve, reject) => {
+        defHttp.post({ url: Api.getMapService, params, ...interfaceType })
+            .then((r) => {
+                if (r.resp_code == 0) {
+                    console.log("代理中心数据:", r.datas);
+                    r.datas[params.serviceType].items = r.datas[params.serviceType].pageData
+                    resolve(r.datas[params.serviceType]);
+                }
+            })
+    })
+}
+
+
+/**
+ * @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 })
+            .then((r) => {
+                if (r.resp_code == 0) {
+                    console.log("代理中心数据:", r.datas);
+                    resolve(r.datas);
+                }
+            })
+    })
+}
+
+/**
+ * @description:保存修改代理中心
+ */
+export function proxySave(params) {
+    return defHttp.post({ url: Api.proxySave, params: { mapServerProxy: [params] }, ...interfaceType })
+}
+

+ 75 - 15
src/views/resource/proxy/index.vue

@@ -11,27 +11,28 @@
       <BasicTable @register="registerTable" @fetch-success="onFetchSuccess">
         <template #toolbar>
           <Authority>
-            <a-button type="primary" @click="batchExamine" :disabled="hasBatchDelete">指定IP设置</a-button>
+            <a-button type="primary" @click="showModal">指定IP设置</a-button>
+            <!-- <a-button type="primary" @click="batchExamine" :disabled="hasBatchDelete">指定IP设置</a-button> -->
           </Authority>
         </template>
 
         <template #action="{ record }">
           <TableAction :actions="[
             {
-              label: '浏览',
+              label: '指定IP设置',
               ifShow: current == 'DR' ? false : true,
-              onClick: handleVliew.bind(null, record),
+              onClick: showModal.bind(null, record),
             },
             {
-              label: '查看',
+              label: '删除',
               onClick: handleDetail.bind(null, record),
             },
-            {
-              label: '审核',
-              disabled: statusShow == 1 ? false : true,
-              color: 'warning',
-              onClick: handleEdit.bind(null, record),
-            },
+            // {
+            //   label: '审核',
+            //   disabled: statusShow == 1 ? false : true,
+            //   color: 'warning',
+            //   onClick: handleEdit.bind(null, record),
+            // },
           ]" />
         </template>
         <template #pdate="{ record }">
@@ -39,8 +40,8 @@
             {{ record.publishdate ? moment(record.publishdate).format('YYYY-MM-DD HH:mm:ss') : '' }}
           </a-tag>
         </template>
-        <template #FLOWNAME="{ record }">
-          {{ record.FLOWNAME.replace('上传', '') }}
+        <template #SERVICEID="{ record }">
+          {{ record.SERVICEID.replace('上传', '') }}
         </template>
         <template #status="{ record }">
           <a-tag :style="`color:${record.status === 3 || record.status === 3 ? 'red' : ''};`">
@@ -67,6 +68,13 @@
       <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>
+      </div>
+      <span style="clear: both;"></span>
+    </a-modal>
   </div>
 </template>
 <script lang="ts">
@@ -91,10 +99,10 @@ 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 { Switch, Popconfirm, message } from 'ant-design-vue';
 import { queryResourceById } from '/@/api/resource/map';
 import Moment from 'moment';
-import { updateExamine } from '/@/api/resource/updateExamine';
+import { getProxyList, proxySave } from '/@/api/resource/proxy';
 import { useModal } from '/@/components/Modal';
 import { useRouter } from 'vue-router';
 import { useAppStore } from '/@/store/modules/app';
@@ -124,7 +132,7 @@ export default defineComponent({
       api: (param) => {
         statusShow.value = param.checkStatus;
         const data = Object.assign(param, { serviceType: current.value });
-        return updateExamine(data);
+        return getProxyList(data);
       }, //求接口
       //dataSource: dataSources, //表格的数据
       columns,
@@ -352,8 +360,39 @@ export default defineComponent({
       console.log('审核数据', getSelectRows());
     };
 
+    const visible = ref(false);
+
+    const showModal = (e) => {
+      visible.value = true;
+      if (e) formState.value.serviceid = e.SERVICEID;
+    };
+
+    function handleOk() {
+      proxySave(formState.value).then((r) => {
+        if (r.resp_code == 0) {
+          visible.value = false;
+          formState.value.ipaddress = '';
+          formState.value.serviceid = '';
+          message.success('保存成功');
+          reload();
+        } else {
+          message.error(r.resp_msg);
+        }
+      })
+    };
+    const formState = ref({
+      ipaddress: "",
+      serviceid: ""
+    });
+
 
     return {
+      labelCol: { span: 2 },
+      wrapperCol: { span: 6 },
+      formState,
+      visible,
+      handleOk,
+      showModal,
       statusShow,
       current,
       moment,
@@ -377,6 +416,27 @@ export default defineComponent({
 });
 </script>
 <style scoped lang="less">
+.wapper {
+  padding: 20px;
+  height: 130px;
+}
+
+.wapper p {
+  margin-bottom: 10px;
+  height: 43px;
+}
+
+.wapper p span {
+  float: left;
+  height: 32px;
+  line-height: 32px;
+}
+
+.wapper p input {
+  float: left;
+  width: 430px;
+}
+
 .examine-container {
   display: flex;
   height: 100%;

+ 17 - 47
src/views/resource/proxy/map.data.ts

@@ -181,9 +181,14 @@ export const searchFormSchemaSR: FormSchema[] = [
 export const columns: BasicColumn[] = [
   {
     title: '资源类型',
-    dataIndex: 'FLOWNAME',
-    width: 120,
-    slots: { customRender: 'FLOWNAME' },
+    dataIndex: 'SERVICEID',
+    width: 90,
+    // slots: { customRender: 'SERVICEID' },
+    sorter: true,
+    customRender: ({ record }) => {
+      var s = record.SERVICEID
+      return s.indexOf('MR') > -1 ? '地图' : s.indexOf('ER') > -1 ? '场景' : s.indexOf('DR') > -1 ? '文件' : '组件';
+    },
   },
   {
     title: '资源名称',
@@ -191,56 +196,21 @@ export const columns: BasicColumn[] = [
     width: 160,
   },
   {
-    title: '申请时间',
-    dataIndex: 'SQSJ',
-    width: 180,
-    // slots: { customRender: 'pdate' },
+    title: '真实地址',
+    dataIndex: 'PUBLICCURL',
+    width: 160,
   },
   {
-    title: '发布人',
-    dataIndex: 'SQR',
-    width: 80,
+    title: '代理地址',
+    dataIndex: 'MAPINGURL',
+    width: 160,
   },
 
   {
-    title: '当前环节',
-    dataIndex: 'NODENAME',
-    width: 90,
-  },
-  {
-    title: '当前处理人',
-    dataIndex: 'USERNAME',
-    width: 100,
-  },
-  // {
-  //   title: '审核状态',
-  //   dataIndex: 'BLZT',
-  //   width: 80,
-  //   slots: { customRender: 'BLZT' },
-  // },
-  {
-    title: '审核结果',
-    dataIndex: 'ISPASS',
-    align: 'center',
-    width: 80,
-    slots: { customRender: 'ISPASS' },
-  },
-  {
-    title: '审核意见',
-    dataIndex: 'CHECKINFO',
-    align: 'center',
-    width: 80,
+    title: '限制制定IP',
+    dataIndex: 'IPS',
+    width: 120,
   },
-  // {
-  //   title: '审核时间',
-  //   dataIndex: 'checkTime',
-  //   width: 180,
-  // },
-  // {
-  //   title: '审核意见',
-  //   dataIndex: 'examine',
-  //   width: 180,
-  // },
 ];
 
 /**