浏览代码

填报管理调整,外链调整调整

Hwf 3 月之前
父节点
当前提交
8ed1662dfe

+ 10 - 2
src/api/login.ts

@@ -18,7 +18,7 @@ export function login(data: LoginData): AxiosPromise<LoginResult> {
     grantType: data.grantType || 'password'
   };
   params.password = encryptWithAes(params.password, parseAesKey(params.uuid));
-  
+
   return request({
     url: '/api/auth/login',
     headers: {
@@ -132,4 +132,12 @@ export function loginWithUsbkey(data) {
     method: 'post',
     data: data
   });
-}
+}
+
+// 产生单点登录token
+export function getSsoToken() {
+  return request({
+    url: '/sso/token/create',
+    method: 'get'
+  });
+}

+ 23 - 5
src/layout/components/Sidebar/Link.vue

@@ -6,6 +6,7 @@
 
 <script setup lang="ts">
 import { isExternal } from '@/utils/validate';
+import { getSsoToken } from '@/api/login';
 
 const props = defineProps({
   to: {
@@ -27,14 +28,31 @@ const type = computed(() => {
 
 function linkProps() {
   if (isExt.value) {
-    return {
-      href: props.to,
-      target: '_blank',
-      rel: 'noopener'
-    };
+    if (props.to === 'http://19.155.220.218/#/considerable-web/overallSituation?type=insertM') {
+      return {
+        href: props.to,
+        target: '_blank',
+        rel: 'noopener',
+        onClick: getSsoTonkenTojump
+      };
+    } else {
+      return {
+        href: props.to,
+        target: '_blank',
+        rel: 'noopener'
+      };
+    }
   }
   return {
     to: props.to
   };
 }
+const getSsoTonkenTojump = (e) => {
+  e.preventDefault();
+  getSsoToken().then((res) => {
+    const ssoToken = res.data && res.data.sso_token ? res.data.sso_token : '';
+    const url = props.to + '&sso_token=' + ssoToken;
+    window.open(url, '_blank');
+  });
+};
 </script>

+ 2 - 8
src/types/components.d.ts

@@ -27,8 +27,8 @@ declare module 'vue' {
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCard: typeof import('element-plus/es')['ElCard']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
-    ElCheckboxButton: typeof import('element-plus/es')['ElCheckboxButton']
     ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
@@ -56,23 +56,17 @@ declare module 'vue' {
     ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
+    ElSegmented: typeof import('element-plus/es')['ElSegmented']
     ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
-    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
     ElSlider: typeof import('element-plus/es')['ElSlider']
-    ElStep: typeof import('element-plus/es')['ElStep']
-    ElSteps: typeof import('element-plus/es')['ElSteps']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
-    ElTabPane: typeof import('element-plus/es')['ElTabPane']
-    ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
     ElTimeline: typeof import('element-plus/es')['ElTimeline']
     ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
-    ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
     ElTree: typeof import('element-plus/es')['ElTree']
     ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']

+ 12 - 10
src/views/dataFilling/fillingManage.vue

@@ -8,8 +8,8 @@
               <el-row :gutter="20">
                 <!-- 表格名称 -->
                 <el-col :span="6">
-                  <el-form-item label="表格名称:" prop="table_name" label-width="auto">
-                    <el-input v-model="queryParams.table_name" placeholder="请输入表格名称"></el-input>
+                  <el-form-item label="字段名称:" prop="table_name" label-width="auto">
+                    <el-input v-model="queryParams.table_name" placeholder="请输入字段名称"></el-input>
                   </el-form-item>
                 </el-col>
                 <!-- 表格状态 -->
@@ -46,7 +46,7 @@
                   <el-button type="primary" icon="Plus" @click="handleAdd">新增</el-button>
                   <el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
                   <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-                  <el-button type="warning" plain icon="Download" @click="exportTableData">导出</el-button>
+                  <el-button type="warning" plain icon="Download" :disabled="multiple" @click="exportTableData">导出</el-button>
                 </el-col>
               </el-row>
             </el-form>
@@ -54,7 +54,7 @@
         </transition>
         <!-- 表格组件 -->
         <el-table ref="multipleTable" v-loading="loading" :data="tableData" @selection-change="handleSelectionChange" style="margin-top: 10px">
-<!--          <el-table-column type="selection" width="55" align="center" />-->
+          <el-table-column type="selection" width="55" align="center" />
           <el-table-column label="序号" align="center" type="index" width="50px" />
           <el-table-column label="表格名称" align="center" prop="table_name" />
           <el-table-column label="发布日期" align="center" prop="start_time" />
@@ -231,14 +231,16 @@ const resetQuery = () => {
 
 const filename = ref();
 const handleSelectionChange = (selection) => {
+  let idsArr = [];
   selection.forEach((item) => {
-    ids.value.push(item.report_id);
+    idsArr.push(item.report_id);
     filename.value = item.table_name;
-  })
+  });
+  ids.value = idsArr;
   if (selection.length == 1) {
-    multiple .value = false;
-  }if (selection.length !== 1) {
-    multiple .value = true;
+    multiple.value = false;
+  } else if (selection.length !== 1) {
+    multiple.value = true;
   }
 };
 
@@ -249,7 +251,7 @@ const handleTimeChange = () => {
 const baseUrl = import.meta.env.VITE_APP_BASE_API;
 const exportTableData = () => {
   fillingTable(ids.value[0]);
-  download2(baseUrl + '/api/dataFilling/export_to_excel?report_id='+ids.value[0], filename.value + '.xlsx');
+  download2(baseUrl + '/api/dataFilling/export_to_excel?report_id=' + ids.value[0], filename.value + '.xlsx');
 };
 
 const handlePagination = ({ page, limit }) => {

+ 6 - 1
src/views/dataFilling/myFilling.vue

@@ -62,7 +62,12 @@
           </el-table-column>
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template #default="scope">
-              <el-text v-if="Number(scope.row.submission_status) === 0" class="common-btn-text-primary" @click="handleWrite(scope.row)">填表</el-text>
+              <el-text
+                v-if="scope.row.submission_status === 0 && scope.row.collection_status === '0'"
+                class="common-btn-text-primary"
+                @click="handleWrite(scope.row)"
+                >填表</el-text
+              >
               <el-text class="common-btn-text-primary" @click="handleView(scope.row)">详情</el-text>
             </template>
           </el-table-column>