sujunling 1 год назад
Родитель
Сommit
2b6a93bd2a

+ 6 - 6
src/api/authorize/authorize.ts

@@ -29,12 +29,12 @@ export function list(data) {
         page: 1,
         rows: 1000
     }
-    var name = JSON.stringify(params);
-    if (session.getItem(name)) {
-        return new Promise<void>((resolve, reject) => {
-            resolve(session.getItem(name))
-        })
-    }
+    // var name = JSON.stringify(params);
+    // if (session.getItem(name)) {
+    //     return new Promise<void>((resolve, reject) => {
+    //         resolve(session.getItem(name))
+    //     })
+    // }
     return new Promise<void>((resolve, reject) => {
         defHttp.post({ url: Api.List, params })
             .then((r) => {

+ 16 - 2
src/views/assembly/item/EmpowerInfo.vue

@@ -8,7 +8,10 @@
                 <p>案例地址:{{ info.assUrl }}</p>
             </li>
             <li>
-                <p>授权文件:{{ info?.resInfo?.PUBLICCURL }}</p>
+                <p>授权文件下载:<a :id="info.MAPINGURL" :href="getImg(info.MAPINGURL)" target="downloadFile" download>
+                            <button v-if="info?.bz?.indexOf(',') > -1">下载文件</button>
+                        </a>
+                </p>
             </li>
         </ul>
     </a-modal>
@@ -22,7 +25,7 @@ import moment from 'moment';
 import { setHtmlImg } from '/@/views/minWidgets/CommonWay.js';
 import { getResInCar, getResViewInfo, queryServiceTags } from '/@/api/resource/plat';
 import { getAllTags } from '/@/api/sys/tag';
-
+import { getImgUrl } from '/@/api/dataAdmin/assembly';
 
 export default defineComponent({
     name: 'EmpowerInfo',
@@ -62,7 +65,18 @@ export default defineComponent({
             })
         }
 
+        function getImg(i) {
+          if (i) {
+            var arr = i.split(',')
+            arr.length > 1 && getImgUrl(arr[0], arr[1]).then(r => {
+              var d = document.getElementById(i);
+              if (d) d.href = r;
+            })
+          }
+        }
+
         return {
+            getImg,
             shyjInfo,
             info,
             showInfo,

+ 5 - 0
src/views/authorize/app/app.data.ts

@@ -10,6 +10,11 @@ const { t } = useI18n();
 
 //菜单管理页,所需的列 配置
 export const columns: BasicColumn[] = [
+  {
+    title: '序号',
+    slots: { customRender: 'index' },
+    width: 50,
+  },
   {
     title: '系统名称',
     dataIndex: 'NAME',

+ 0 - 197
src/views/authorize/app/index copy.vue

@@ -1,197 +0,0 @@
-<template>
-  <div class="p-4">
-    <BasicTable @register="registerTable" @fetch-success="onFetchSuccess">
-      <template #toolbar>
-        <Button type="primary" @click="handleCreate">
-          {{ getI18nCreateMenu }}
-        </Button>
-        <!-- <Button type="primary" danger :disabled="getCanBatchDelete" @click="handleBatchDelete">
-          批量删除
-        </Button> -->
-      </template>
-      <template #action="{ record }">
-        <TableAction :actions="[
-          {
-            label: '编辑',
-            tooltip: '编辑',
-            icon: 'clarity:note-edit-line',
-            onClick: handleEdit.bind(null, record),
-          },
-          {
-            label: '删除',
-            tooltip: '删除',
-            icon: 'ant-design:delete-outlined',
-            color: 'error',
-            popConfirm: {
-              title: getDeleteTitle(),
-              confirm: handleDelete.bind(null, record),
-            },
-          },
-        ]" />
-      </template>
-    </BasicTable>
-
-    <!-- 弹出框 -->
-    <AppDrawer @register="registerDrawer" @success="handleSuccess" />
-  </div>
-</template>
-<script lang="ts">
-//导入所需插件
-import { computed, defineComponent, nextTick } from 'vue';
-
-// 导入表格组件,表格事件
-import { BasicTable, useTable, TableAction } from '/@/components/Table';
-
-// 加载表格数据
-import { list, deleteApp } from '/@/api/authorize/authorize';
-// 加载自定义侧边弹出框 组件
-import { useDrawer } from '/@/components/Drawer';
-
-// 导入子页面【新增、修改】
-import AppDrawer from './AppDrawer.vue';
-
-// 导入列 属性,和搜索栏内容
-import { columns } from './app.data';
-import { useI18n } from '/@/hooks/web/useI18n';
-import { Button, notification } from 'ant-design-vue';
-import { useSyncConfirm } from '/@/hooks/component/useSyncConfirm';
-import { isArray } from '/@/utils/is';
-// 自定义表格组件和属性
-export default defineComponent({
-  name: 'MenuManagement',
-  components: { BasicTable, AppDrawer, TableAction, Button },
-  setup() {
-    const [registerDrawer, { openDrawer }] = useDrawer(); //使用右侧弹出框
-    const { t } = useI18n(); //加载国际化
-    // 新增菜单
-    const getI18nCreateMenu = computed(() => ('新增应用'));
-
-    const [
-      registerTable,
-      { reload, collapseAll, getRowSelection, getSelectRowKeys, setSelectedRowKeys },
-    ] = useTable({
-      title: '应用列表', //'菜单列表'
-      api: list, //加载数据
-      columns, //加载列
-      isTreeTable: true,
-      pagination: false,
-      striped: false,
-      showTableSetting: true,
-      bordered: true,
-      showIndexColumn: true,
-      canResize: false,
-      rowKey: (record) => record.id,
-      actionColumn: {
-        width: 200,
-        title: t('routes.common.system.pageSystemTitleOperation'), //操作
-        dataIndex: 'action',
-        slots: { customRender: 'action' },
-        fixed: 'right',
-      },
-      rowSelection: {
-        type: 'checkbox',
-      },
-      tableSetting: {
-        redo: true,
-        size: true,
-        setting: false,
-        fullScreen: false
-      },
-    });
-
-    const getCanBatchDelete = computed(() => {
-      const rowSelection = getRowSelection();
-      return !rowSelection.selectedRowKeys?.length;
-    });
-    const { createSyncConfirm } = useSyncConfirm();
-    const handleBatchDelete = async () => {
-      const rowKeys = getSelectRowKeys();
-      try {
-        await createSyncConfirm({
-          iconType: 'warning',
-          content: '确认后所有选中的菜单将被删除',
-        });
-        await handleDelete({ id: rowKeys });
-        setSelectedRowKeys([]);
-        reload();
-      } catch (error) { }
-    };
-
-    /**
-     * 获得删除提示框的文字
-     */
-    function getDeleteTitle(): string {
-      let labelText = t('routes.common.system.pageSystemTitleWhetherDelete');
-      return labelText;
-    }
-
-    /**
-     * 打开新增菜单
-     */
-    function handleCreate() {
-      openDrawer(true, {
-        isUpdate: false,
-      });
-    }
-
-    /**
-     * 打开 编辑菜单
-     * @param record
-     */
-    function handleEdit(record: Recordable) {
-      openDrawer(true, {
-        record,
-        isUpdate: true,
-      });
-    }
-
-    /**
-     * 执行 删除操作
-     * @param record
-     */
-    async function handleDelete(record: Recordable) {
-      try {
-        // let ids = isArray(record.departid) ? record.departid : [record.departid];
-        await deleteApp({
-          "systemId": record.SYSID,
-          "systemKey": record.KEY,
-        });
-        notification.success({
-          message: '成功',
-          description: '删除应用成功',
-          duration: 3,
-        });
-        await reload();
-      } catch (e) {
-        return Promise.reject(e);
-      }
-    }
-
-    /**
-     * 操作成功,重新加载页面
-     */
-    function handleSuccess() {
-      reload();
-    }
-
-    function onFetchSuccess() {
-      // 演示默认展开所有表项
-      nextTick(collapseAll);
-    }
-
-    return {
-      getDeleteTitle,
-      getI18nCreateMenu,
-      registerTable,
-      registerDrawer,
-      handleCreate,
-      handleEdit,
-      handleDelete,
-      handleSuccess,
-      onFetchSuccess,
-      getCanBatchDelete,
-      handleBatchDelete,
-    };
-  },
-});
-</script>

+ 4 - 1
src/views/authorize/app/index.vue

@@ -17,6 +17,9 @@
         <template #toolbar>
           <a-button type="primary" @click="handleAdd">新增</a-button>
         </template>
+        <template #index="{ index }">
+          {{ index + 1 }}
+        </template>
         <template #action="{ record }">
           <TableAction :actions="[
             {
@@ -99,7 +102,7 @@ export default defineComponent({
       bordered: false,
       striped: false,
       canResize: true,
-      showIndexColumn: true,
+      showIndexColumn: false,
       indexColumnProps: { fixed: 'left' },
       actionColumn: {
         width: 150,