소스 검색

二三维一体化工具调整

sujunling 2 년 전
부모
커밋
df5e5b7bcc

BIN
.DS_Store


+ 32 - 13
src/api/sys/mapTools.ts

@@ -7,6 +7,7 @@ enum Api {
     GetMenu = '/xld-2And3/findAllMenu',
     AddTools = '/xld-2And3/addTool',
     RemoveTool = '/xld-2And3/removeTool',
+    ShowTool = '/xld-2And3/updateToolStatus',
 }
 const locationType = { mapToolsUrl: true };
 /**
@@ -14,13 +15,13 @@ const locationType = { mapToolsUrl: true };
  */
 export const addTools = (params) => {
     return new Promise<void>((resolve) => {
-        defHttp.post({ 
-            ...locationType, 
-            url: Api.AddTools, 
-            data:{
-                data:JSON.stringify(params)
+        defHttp.post({
+            ...locationType,
+            url: Api.AddTools,
+            data: {
+                data: JSON.stringify(params)
             }
-         }).then((res) => {
+        }).then((res) => {
             resolve(res)
         })
     })
@@ -30,14 +31,32 @@ export const addTools = (params) => {
  */
 export const delTools = (params) => {
     return new Promise<void>((resolve) => {
-        defHttp.post({ 
-            ...locationType, 
-            url: Api.RemoveTool, 
-            data:{
-                id: `'${params.id}'`
+        defHttp.post({
+            ...locationType,
+            url: Api.RemoveTool,
+            data: {
+                id: `${params.id}`
             }
-         },
-         ).then((res) => {
+        },
+        ).then((res) => {
+            resolve(res)
+        })
+    })
+};
+/**
+ * @description: 隐藏地图工具
+ */
+export const showTools = (params) => {
+    return new Promise<void>((resolve) => {
+        defHttp.post({
+            ...locationType,
+            url: Api.ShowTool,
+            data: {
+                id: `${params.id}`,
+                show: !params.show
+            }
+        },
+        ).then((res) => {
             resolve(res)
         })
     })

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 3 - 0
src/api/sys/menu.ts


+ 9 - 6
src/api/twoAndThree/menu.ts

@@ -44,21 +44,24 @@ export function saveMenuApi(params, mode = 'modal') {
   return defHttp.post({
     url: Api.UpdateMenu,
     ...locationType,
+    // data: params.id,
     data: {
-      id: `'${params.id}'`,
-      menu: JSON.stringify(params)
+      id: params.id,
+      menu: params
     },
-  }, { errorMessageMode: mode });
+    // headers: {
+    //   'Content-Type': 'application/json;charset=UTF-8'
+    // },
+  });
 }
 
-
 export const delMenu = (id) => {
   const url = Api.RemoveMenu;
   return defHttp.post({
-    url: url, 
+    url: url,
     ...locationType,
     data: {
-      id: `'${id[0]}'`,
+      id: id[0],
       isRemove: true
     }
   });

+ 1 - 1
src/views/sys/login/LoginForm.vue

@@ -39,7 +39,7 @@
     <!-- </ACol> -->
     <!-- </ARow> -->
 
-    <FormItem class="enter-x" style="position:absolute;bottom: 0;width: 100%;margin-bottom: 0;">
+    <FormItem class="enter-x" style="position:absolute;bottom: 0;width: 268px;margin-bottom: 0;">
       <Button type="primary" size="large" block @click="handleLogin" :loading="loading" style="background: linear-gradient(90deg, #0E7FFF, #04CAF5);
 box-shadow: 0px 12px 8px 0px rgba(3,30,55,0.2);
 border-radius: 2px;">

+ 53 - 8
src/views/systemAdmin/system/mapTools/tools/index.vue

@@ -24,6 +24,13 @@
                             icon: 'clarity:note-edit-line',
                             onClick: handleEdit.bind(null, record),
                         },
+                        {
+                            label: '显隐',
+                            tooltip: '显隐',
+                            icon: 'ant-design:delete-outlined',
+                            color: 'error',
+                            onClick: handleShow.bind(null, record)
+                        },
                         {
                             label: '删除',
                             tooltip: '删除',
@@ -49,14 +56,19 @@ import ToolsDrawer from './ToolsDrawer.vue';
 import { message, Modal } from 'ant-design-vue';
 import moment from 'moment'
 import { session } from '/@/utils/Memory';
-import { getAllTools, addTools, delTools } from '/@/api/sys/mapTools';
+import { getAllTools, addTools, delTools, showTools } from '/@/api/sys/mapTools';
 import { useSyncConfirm } from '/@/hooks/component/useSyncConfirm';
 import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
+import { useI18n } from '/@/hooks/web/useI18n';
+import { h } from 'vue';
+import { Tag } from 'ant-design-vue';
+
 
 export default defineComponent({
     components: { BasicTable, TableAction, Button, ToolsDrawer, ExclamationCircleOutlined },
     name: "tools",
     setup() {
+        const { t } = useI18n(); //加载国际化
         const columns = [
             {
                 title: '分组名称',
@@ -64,12 +76,12 @@ export default defineComponent({
                 key: 'group',
                 align: 'center'
             },
-            {
-                title: 'id',
-                dataIndex: 'id',
-                key: 'id',
-                align: 'center'
-            },
+            // {
+            //     title: 'id',
+            //     dataIndex: 'id',
+            //     key: 'id',
+            //     align: 'center'
+            // },
             {
                 title: '显示名称',
                 dataIndex: 'label',
@@ -88,6 +100,20 @@ export default defineComponent({
                 key: 'icon',
                 align: 'center'
             },
+            {
+                title: '状态',
+                dataIndex: 'show',
+                width: 80,
+                customRender: ({ record }) => {
+                    const status = !record.show;
+                    const enable = ~~status === 0;
+                    const color = enable ? 'green' : 'red';
+                    const enableText = t('routes.common.system.tableTitleSystemEnable'); //国际化处理--启用
+                    const stopText = t('routes.common.system.tableTitleSystemStop'); //国际化处理--停用
+                    const text = enable ? enableText : stopText;
+                    return h(Tag, { color: color }, () => text);
+                },
+            },
             {
                 title: '功能',
                 dataIndex: 'action',
@@ -109,7 +135,7 @@ export default defineComponent({
                 cancelText: '取消',
                 onOk: (() => {
                     let param = {
-                        id:record.id
+                        id: record.id
                     }
                     delTools(param).then(res => {
                         message.success('操作成功');
@@ -118,6 +144,24 @@ export default defineComponent({
                 })
             });
         }
+        const handleShow = (record) => {
+            Modal.confirm({
+                title: '隐藏提示',
+                icon: createVNode(ExclamationCircleOutlined),
+                content: '确定隐藏该工具?',
+                centered: true,
+                okText: '确定',
+                okType: 'danger',
+                cancelText: '取消',
+                onOk: (() => {
+                    showTools(record).then(res => {
+                        message.success('操作成功');
+                        reload();
+                    })
+                })
+            });
+        }
+
         const ifShowDialog = ref(false)
         const handleAdd = () => {
             ifShowDialog.value = true
@@ -189,6 +233,7 @@ export default defineComponent({
             },
         });
         return {
+            handleShow,
             hasSelected,
             ifShowDialog,
             registerTable,

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
target/dist/assets/app-antd-dark-theme-style.e3b0c442.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
target/dist/index.html