Explorar o código

Merge branch 'master' of http://221.182.8.141:11666/sujunlin/xld-gis-admin

XiaXxxxxx hai 1 ano
pai
achega
14c7535147

+ 1 - 0
src/views/dataAdmin/dataAdmin/flowStep/handleLog.vue

@@ -64,6 +64,7 @@ export default defineComponent({
       bordered: true,
       showIndexColumn: true,
       pagination: false,
+      canResize:false
       //   pagination: {
       //     hideOnSinglePage: false,
       //   },

+ 6 - 5
src/views/systemAdmin/system/mapTools/baseConfig/index.vue

@@ -3,7 +3,7 @@
         <BasicTable @register="registerTable">
             <template #toolbar>
                 <Button type="primary" @click="openDialog(null)">
-                    新增工具
+                    新增
                 </Button>
                 <Button type="primary" danger :disabled="hasSelected" @click="delAllData">
                     批量删除
@@ -12,15 +12,15 @@
             <template #func="{ record }">
                 <TableAction :actions="[
                     {
-                        label: '',
+                        label: '编辑',
                         tooltip: '编辑',
-                        icon: 'ant-design:edit-outlined',
+                        //icon: 'ant-design:edit-outlined',
                         onClick: openDialog.bind(null, record),
                     },
                     {
-                        label: '',
+                        label: '删除',
                         tooltip: '删除',
-                        icon: 'ant-design:delete-outlined',
+                        //icon: 'ant-design:delete-outlined',
                         onClick: onDelete.bind(null, record.id),
                     },
                 ]" />
@@ -389,6 +389,7 @@ export default defineComponent({
             bordered: true,
             showTableSetting: true,  // 显示表格设置
             showIndexColumn: true,
+            canResize: false,
             pagination: {
                 // pageSize: 10,
                 hideOnSinglePage: false

+ 5 - 4
src/views/systemAdmin/system/mapTools/layer2d/index.vue

@@ -4,7 +4,7 @@
             <BasicTable @register="registerTable">
                 <template #toolbar>
                     <Button type="primary" @click="handleCreate(null)">
-                        新增图层
+                        新增
                     </Button>
                     <!-- <Button type="primary" danger :disabled="hasSelected" @click="delAllData">
                         批量删除
@@ -26,14 +26,14 @@
                         {
                             label: '编辑',
                             tooltip: '编辑',
-                            icon: 'clarity:note-edit-line',
+                            //icon: 'clarity:note-edit-line',
                             onClick: handleEdit.bind(null, record),
                         },
                         {
                             label: '删除',
                             tooltip: '删除',
-                            icon: 'ant-design:delete-outlined',
-                            color: 'error',
+                            //icon: 'ant-design:delete-outlined',
+                            //color: 'error',
                             popConfirm: {
                                 title: '确定删除该数据吗?',
                                 confirm: handleDelete.bind(null, record),
@@ -100,6 +100,7 @@ export default defineComponent({
             columns: columns,
             useSearchForm: false,     //开启搜索区域
             bordered: true,
+            canResize: false,
             showTableSetting: true,  // 显示表格设置
             tableSetting: {
                 redo: true,

+ 5 - 4
src/views/systemAdmin/system/mapTools/layer3d/index.vue

@@ -4,7 +4,7 @@
             <BasicTable @register="registerTable">
                 <template #toolbar>
                     <Button type="primary" @click="handleCreate(null)">
-                        新增图层
+                        新增
                     </Button>
                     <!-- <Button type="primary" danger :disabled="hasSelected" @click="delAllData">
                         批量删除
@@ -21,14 +21,14 @@
                         {
                             label: '编辑',
                             tooltip: '编辑',
-                            icon: 'clarity:note-edit-line',
+                            //icon: 'clarity:note-edit-line',
                             onClick: handleEdit.bind(null, record),
                         },
                         {
                             label: '删除',
                             tooltip: '删除',
-                            icon: 'ant-design:delete-outlined',
-                            color: 'error',
+                            //icon: 'ant-design:delete-outlined',
+                            //color: 'error',
                             popConfirm: {
                                 title: '确定删除该数据吗?',
                                 confirm: handleDelete.bind(null, record),
@@ -95,6 +95,7 @@ export default defineComponent({
             columns: columns,
             useSearchForm: false,     //开启搜索区域
             bordered: true,
+            canResize: false,
             showTableSetting: true,  // 显示表格设置
             tableSetting: {
                 redo: true,

+ 2 - 2
src/views/systemAdmin/system/mapTools/menus/index.vue

@@ -14,7 +14,7 @@
           {
             label: '编辑',
             tooltip: '编辑',
-            icon: 'clarity:note-edit-line',
+            //icon: 'clarity:note-edit-line',
             onClick: handleEdit.bind(null, record),
           },
           // {
@@ -82,7 +82,7 @@ export default defineComponent({
       canResize: false,
       rowKey: (record) => record.id,
       actionColumn: {
-        width: 200,
+        // width: 200,
         title: t('routes.common.system.pageSystemTitleOperation'), //操作
         dataIndex: 'action',
         slots: { customRender: 'action' },

+ 169 - 0
src/views/systemAdmin/system/mapTools/tools/ToolsModel.vue

@@ -0,0 +1,169 @@
+<template>
+    <!-- <a-drawer title="新增工具" :visible="true" :width="540" :body-style="{ paddingBottom: '80px' }"
+        :footer-style="{ textAlign: 'right' }" @close="onClose"> -->
+    <BasicModal v-bind="$attrs" showFooter title="新增工具" width="50%" :maskClosable="false" :showOkBtn="false" :showCancelBtn="false">    
+        <a-form ref="formRef" :model="form" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
+            <a-form-item label="分组名称" name="group">
+                <a-input v-model:value="form.group" style="width: 100%" placeholder="请输入分组名称" />
+            </a-form-item>
+            <a-form-item label="工具标题" name="label">
+                <a-input v-model:value="form.label" style="width: 100%" placeholder="请输入标题" />
+            </a-form-item>
+            <a-form-item label="提示文字" name="tip">
+                <a-input v-model:value="form.tip" style="width: 100%" placeholder="请输入提示文字" />
+            </a-form-item>
+            <a-form-item label="是否启用" name="show" :label-col="{span:6}" :wrapper-col="{span:6}">
+                <a-radio-group v-model:value="form.show" button-style="solid">
+                    <a-radio-button value="1">是</a-radio-button>
+                    <a-radio-button value="0">否</a-radio-button>
+                </a-radio-group>
+            </a-form-item>
+            <a-form-item label="快捷定位" name="isQuick" :label-col="{span:6}" :wrapper-col="{span:6}">
+                <a-radio-group v-model:value="form.isQuick" button-style="solid">
+                    <a-radio-button value="1">是</a-radio-button>
+                    <a-radio-button value="0">否</a-radio-button>
+                </a-radio-group>
+            </a-form-item>
+            <a-form-item label="工具配置" name="option">
+                <a-textarea v-model:value="form.option" :rows="3" />
+            </a-form-item>
+            <a-form-item label="工具图标" name="icon">
+                <a-input v-model:value="form.icon" style="width: 100%" placeholder="请输入图标标识" />
+            </a-form-item>
+            <a-form-item label="工具功能" name="action">
+                <a-input v-model:value="form.action" style="width: 100%" placeholder="请输入工具功能" />
+            </a-form-item>
+            <a-form-item label="工具排序" name="idx">
+                <a-input v-model:value="form.idx" style="width: 100%" placeholder="请输入工具排序" />
+            </a-form-item>
+        </a-form>
+        <div :style="{
+            position: 'absolute',
+            right: 0,
+            bottom: 0,
+            width: '100%',
+            borderTop: '1px solid #e9e9e9',
+            padding: '10px 16px',
+            background: '#fff',
+            textAlign: 'right',
+            zIndex: 1,
+        }">
+            <a-button style="margin-right: 8px" @click="onClose">取消</a-button>
+            <a-button type="primary" @click="onSubmit">确定</a-button>
+        </div>
+    <!-- </a-drawer> -->
+    </BasicModal>
+</template>
+<script>
+import { defineComponent, reactive, ref, onMounted, watch } from 'vue';
+import { message } from 'ant-design-vue';
+import { getAllTagsType, generateCodeByName, addTag, updateTag, checkTagCode } from '/@/api/sys/tag';
+import { session } from '/@/utils/Memory';
+import { addTools } from '/@/api/sys/mapTools';
+import { v4 as uuidv4 } from 'uuid';
+  import { BasicModal } from '/@/components/Modal';
+
+const props = {
+}
+export default defineComponent({
+    name: 'ToolsDrawer',
+    components: { BasicModal },
+    props,
+    setup(props, { emit }) {
+        const form = reactive({
+            group: "",
+            show: '1',
+            isQuick: '1',
+            label: "",
+            option: "{\n\n}",
+            idx: "",
+            id: "",
+            tip: "",
+            icon: "",
+            action: ""
+        });
+        const rules = {
+            group: [{
+                required: true,
+                message: '请输入分组名称',
+                trigger: 'blur'
+            }],
+            label: [{
+                required: true,
+                message: '请输入工具标题',
+                trigger: 'blur'
+            }],
+            idx: [{
+                required: true,
+                message: '请输入工具排序',
+                trigger: 'blur'
+            }],
+            tip: [{
+                required: true,
+                message: '请输入提示文字',
+                trigger: 'blur'
+            }],
+            icon: [{
+                required: true,
+                message: '请选择工具图标',
+                trigger: 'blur'
+            }],
+            action: [{
+                required: true,
+                message: '请输入工具功能',
+                trigger: 'blur'
+            }]
+        };
+        const formRef = ref()
+
+        // 关闭弹窗
+        const onClose = () => {
+            emit('closeDialog')
+            resetForm()
+        };
+        // 提交信息
+        const onSubmit = () => {
+            formRef.value.validate().then(() => {
+                //在这里新增,新增之前处理一下form后再传
+                let params = {
+                    group: form.group,
+                    show: form.show === '0' ? false : true,
+                    isQuick: form.isQuick === '0' ? false : true,
+                    label: form.label,
+                    option: JSON.parse(form.option),
+                    idx: parseInt(form.idx),
+                    id: uuidv4(),
+                    tip: form.tip,
+                    icon: form.icon,
+                    action: form.action
+                }
+                addTools(params).then(res => {
+                    if(res.code===200 && res.data?.insertedId){
+                        message.success('新增成功')
+                        emit('onSubmit')
+                        onClose();
+                    }else{
+                        message.error('新增失败')
+                    }
+                })
+            }).catch((error) => {
+                console.log('error', error);
+            });
+        };
+        // 重置表单
+        const resetForm = () => {
+            formRef.value.resetFields();
+        };
+        return {
+            form,
+            rules,
+            formRef,
+            labelCol: { span: 3 },
+            wrapperCol: { span: 20 },
+            onClose,
+            onSubmit,
+            resetForm
+        };
+    },
+});
+</script>

+ 13 - 7
src/views/systemAdmin/system/mapTools/tools/index.vue

@@ -4,7 +4,7 @@
             <BasicTable @register="registerTable">
                 <template #toolbar>
                     <Button type="primary" @click="handleAdd">
-                        新增工具
+                        新增
                     </Button>
                     <Button type="primary" danger :disabled="hasSelected" @click="handleBatchDelete">
                         批量删除
@@ -27,8 +27,8 @@
                         {
                             label: '显隐',
                             tooltip: '显隐',
-                            icon: 'ant-design:delete-outlined',
-                            color: 'error',
+                            //icon: 'ant-design:delete-outlined',
+                            //color: 'error',
                             onClick: handleShow.bind(null, record)
                         },
                         // {
@@ -42,8 +42,8 @@
                 </template>
             </BasicTable>
         </div>
-        <ToolsDrawer v-if="ifShowDialog" @closeDialog="ifShowDialog = false" @onSubmit="onSubmit">
-        </ToolsDrawer>
+        <!-- <ToolsDrawer v-if="ifShowDialog" @closeDialog="ifShowDialog = false" @onSubmit="onSubmit"></ToolsDrawer> -->
+        <ToolsModel @register="registerModal" @closeDialog="ifShowDialog = false" @onSubmit="onSubmit"></ToolsModel>
     </div>
 </template>
 
@@ -53,6 +53,7 @@ import { defineComponent, onMounted, watch, ref, reactive, toRefs, computed, cre
 import { BasicTable, useTable, TableAction } from '/@/components/Table';
 import { Button } from 'ant-design-vue';
 import ToolsDrawer from './ToolsDrawer.vue';
+import ToolsModel from './ToolsModel.vue';
 import { message, Modal } from 'ant-design-vue';
 import moment from 'moment'
 import { session } from '/@/utils/Memory';
@@ -62,10 +63,11 @@ import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import { useI18n } from '/@/hooks/web/useI18n';
 import { h } from 'vue';
 import { Tag } from 'ant-design-vue';
+import { useModal } from '/@/components/Modal';
 
 
 export default defineComponent({
-    components: { BasicTable, TableAction, Button, ToolsDrawer, ExclamationCircleOutlined },
+    components: { BasicTable,ToolsModel, TableAction, Button, ToolsDrawer, ExclamationCircleOutlined },
     name: "tools",
     setup() {
         const { t } = useI18n(); //加载国际化
@@ -146,7 +148,7 @@ export default defineComponent({
         }
         const handleShow = (record) => {
             Modal.confirm({
-                title: '隐藏提示',
+                title: '提示',
                 icon: createVNode(ExclamationCircleOutlined),
                 content: '确定隐藏该工具?',
                 centered: true,
@@ -163,8 +165,10 @@ export default defineComponent({
         }
 
         const ifShowDialog = ref(false)
+        const [registerModal, { openModal }] = useModal();
         const handleAdd = () => {
             ifShowDialog.value = true
+            openModal(true)
         }
         const onSubmit = () => {
             reload();
@@ -221,6 +225,7 @@ export default defineComponent({
                 // pageSize: 10,
                 hideOnSinglePage: false
             },
+            canResize: false,
             rowKey: (record) => record.id,
             actionColumn: {
                 width: 200,
@@ -233,6 +238,7 @@ export default defineComponent({
             },
         });
         return {
+            registerModal,
             handleShow,
             hasSelected,
             ifShowDialog,