Ver Fonte

功能完善

zmq há 1 ano atrás
pai
commit
87cc1524ec

+ 154 - 0
src/api/admin/Banner.ts

@@ -0,0 +1,154 @@
+/* eslint-disable */
+/* tslint:disable */
+/*
+ * ---------------------------------------------------------------
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API        ##
+ * ##                                                           ##
+ * ## AUTHOR: acacode                                           ##
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
+ * ---------------------------------------------------------------
+ */
+
+import { AxiosResponse } from 'axios'
+import {
+    ResultOutputBannerGetOutput,
+
+    ResultOutputInt64,
+    ResultOutputPageOutputNoticeGetPageOutput,
+    ResultOutputNoticeGetOutput,
+    NoticeAddInput,
+    NoticeUpdateInput,
+    PageInputNoticeGetPageDto,
+} from './data-contracts'
+import { ContentType, HttpClient, RequestParams } from './http-client'
+
+export class BannerApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
+    /**
+     * No description
+     *
+     * @tags banner
+     * @name Get
+     * @summary 查询模块
+     * @request GET:/api/admin/banner/get
+     * @secure
+     */
+    get = (
+        query?: {
+            /** @format int64 */
+            id?: number
+        },
+        params: RequestParams = {}
+    ) =>
+        this.request<ResultOutputBannerGetOutput, any>({
+            path: `/api/admin/banner/get`,
+            method: 'GET',
+            query: query,
+            secure: true,
+            format: 'json',
+            ...params,
+        })
+    /**
+     * No description
+     *
+     * @tags banner
+     * @name GetPage
+     * @summary 查询分页
+     * @request POST:/api/admin/banner/get-page
+     * @secure
+     */
+    getPage = (data: PageInputNoticeGetPageDto, params: RequestParams = {}) =>
+        this.request<ResultOutputPageOutputNoticeGetPageOutput, any>({
+            path: `/api/admin/banner/get-page`,
+            method: 'POST',
+            body: data,
+            secure: true,
+            type: ContentType.Json,
+            format: 'json',
+            ...params,
+        })
+
+    /**
+     * No description
+     *
+     * @tags notice
+     * @name Add
+     * @summary 新增公告
+     * @request POST:/api/admin/notice/add
+     * @secure
+     */
+    add = (data: NoticeAddInput, params: RequestParams = {}) =>
+        this.request<ResultOutputInt64, any>({
+            path: `/api/admin/notice/add`,
+            method: 'POST',
+            body: data,
+            secure: true,
+            type: ContentType.Json,
+            format: 'json',
+            ...params,
+        })
+    /**
+     * No description
+     *
+     * @tags notice
+     * @name Update
+     * @summary 修改公告
+     * @request PUT:/api/admin/notice/update
+     * @secure
+     */
+    update = (data: NoticeUpdateInput, params: RequestParams = {}) =>
+        this.request<AxiosResponse, any>({
+            path: `/api/admin/notice/update`,
+            method: 'PUT',
+            body: data,
+            secure: true,
+            type: ContentType.Json,
+            ...params,
+        })
+    /**
+     * No description
+     *
+     * @tags notice
+     * @name SoftDelete
+     * @summary 删除公告
+     * @request DELETE:/api/admin/notice/soft-delete
+     * @secure
+     */
+    softDelete = (
+        query?: {
+            /** @format int64 */
+            id?: number
+        },
+        params: RequestParams = {}
+    ) =>
+        this.request<AxiosResponse, any>({
+            path: `/api/admin/notice/soft-delete`,
+            method: 'DELETE',
+            query: query,
+            secure: true,
+            ...params,
+        })
+    /**
+     * No description
+     *
+     * @tags notice
+     * @name Get
+     * @summary 查询重要公告
+     * @request GET:/api/admin/notice/get-weight
+     * @secure
+     */
+    getWeight = (
+        query?: {
+
+        },
+        params: RequestParams = {}
+    ) =>
+        this.request<ResultOutputNoticeGetOutput, any>({
+            path: `/api/admin/notice/get-weight`,
+            method: 'GET',
+            query: query,
+            secure: true,
+            format: 'json',
+            ...params,
+        })
+}
+

+ 23 - 0
src/api/admin/Tenant.ts

@@ -18,6 +18,7 @@ import {
   TenantAddInput,
   TenantSetEnableInput,
   TenantUpdateInput,
+  ResultOutputListTenantSelectListOutput
 } from './data-contracts'
 import { ContentType, HttpClient, RequestParams } from './http-client'
 
@@ -184,4 +185,26 @@ export class TenantApi<SecurityDataType = unknown> extends HttpClient<SecurityDa
       type: ContentType.Json,
       ...params,
     })
+  /**
+   * No description
+   *
+   * @tags tenant
+   * @name GetPage
+   * @summary 查询所有租户
+   * @request POST:/api/admin/tenant/get-all
+   * @secure
+   */
+  getAll = (
+    query?: {      
+    },
+    params: RequestParams = {}
+  ) =>
+    this.request<ResultOutputListTenantSelectListOutput, any>({
+      path: `/api/admin/tenant/get-all`,
+      method: 'GET',
+      query: query,
+      secure: true,
+      format: 'json',
+      ...params,
+    })
 }

+ 127 - 0
src/api/admin/data-contracts.ts

@@ -5288,4 +5288,131 @@ export interface ProjectStatManagePageOutput {
   projectId: number
   // 平台Id
   tenantId: number
+}
+/** 轮播图结果输出 */
+export interface ResultOutputBannerGetOutput {
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  data?: BannerGetOutput
+}
+export interface BannerGetOutput {
+  /**
+   * 活动名称   
+   */
+  name: string
+  /** 
+   * 跳转方式 
+   */
+  skipWay: number
+  /**
+   * 跳转参数 文章Id或项目Id
+   */
+  skipContent: string
+  /**
+   * 活动图片
+   */
+  imgUrl: string
+  /** 
+   * 开始时间 
+   */
+  beginTime: string
+  /** 
+   * 开始时间 
+   */
+  endTime: string
+  /** 
+   * 排序 数值越大越靠前
+   */
+  rank: number
+  /**
+   * 主键Id
+   * @format int64
+   */
+  id: number
+}
+/** 轮播分页信息输入 */
+export interface PageInputBannerGetPageDto {
+  /**
+   * 当前页标
+   * @format int32
+   */
+  currentPage?: number
+  /**
+   * 每页大小
+   * @format int32
+   */
+  pageSize?: number
+  dynamicFilter?: DynamicFilterInfo
+  /** 用户分页查询条件 */
+  filter?: BannerGetPageDto
+}
+export interface BannerGetPageDto{ 
+  status?: number
+}
+/** 公告列表结果输出 */
+export interface ResultOutputPageOutputBannerListOutput {
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  /** 分页信息输出 */
+  data?: PageOutputBannerListOutput
+}
+/** 分页信息输出 */
+export interface PageOutputBannerListOutput {
+  /**
+   * 数据总数
+   * @format int64
+   */
+  total?: number
+  /** 数据 */
+  list?: BannerListOutput[] | null
+}
+export interface BannerListOutput {
+  /**
+  * 活动名称  
+  */
+  name: string
+  /**
+   * 活动图片   
+   */
+  imgUrl: string
+  /** 
+   * 开始时间 
+   */
+  beginTime: string
+  /** 
+   * 结束时间 
+   */
+  endTime: string
+  /**
+   * 排序 数值越大越靠前   
+   */
+  rank?: number | null
+  /**
+   * 主键Id   
+   */
+  id: number  
+}
+/** 结果输出 */
+export interface ResultOutputListTenantSelectListOutput {
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  data?: TenantSelectListOutput[] |null
+}
+export interface TenantSelectListOutput {
+  /** 主键 */
+  id?: number | null
+  /** 企业名称 */
+  name?: string | null 
 }

+ 2 - 2
src/components/editor/index.vue

@@ -63,7 +63,7 @@ const state = reactive({
     placeholder: props.placeholder,       
     MENU_CONF: {
       uploadImage: {       
-        async customUpload(file : any, insertFn) { 
+        async customUpload(file : any, insertFn:any) { 
           
           if (file.type.indexOf('image/') < 0) { 
             proxy.$modal.msgError("请选择图片上传");
@@ -84,7 +84,7 @@ const state = reactive({
         },
       },
       uploadVideo: {
-        async customUpload(file:any, insertFn) {          
+        async customUpload(file:any, insertFn:any) {          
           if (file.type.indexOf('video/') < 0) {
             proxy.$modal.msgError("请选择视频上传");
             return

+ 0 - 96
src/views/admin/banner/alternotice.vue

@@ -1,96 +0,0 @@
-<template>
-    <div class="my-layout">
-        <el-card class="my-fill mt8" shadow="never" :body-style="{ paddingBottom: '0' }">
-            <el-form ref="formRef" :model="state.form" size="default" label-width="80px">
-                    <el-row :gutter="35">                      
-                      <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-                          <el-form-item label="内容" prop="content" :rules="[{ required: true, message: '请输入通知内容', trigger: ['blur', 'change'] }]">                
-                            <Editor v-model:get-html="state.editor.htmlVal" v-model:get-text="state.editor.textVal" :disable="state.editor.disable" />
-                          </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-                        <el-form-item size="large">
-                            <el-button type="primary" @click="onSure" size="default" :loading="state.sureLoading">确 定</el-button>
-                        </el-form-item>
-                    </el-col>                    
-                  </el-form> 
-        </el-card>        
-    </div>
-             
-</template>
-<script lang="ts" setup name="admin/notice/alternotice">
-
-// import { stat } from 'fs'
-import { reactive, getCurrentInstance, ref, defineAsyncComponent, onMounted } from 'vue'
-import { NoticeAddInput, NoticeUpdateInput } from '/@/api/admin/data-contracts'
-import { NoticeApi } from '/@/api/admin/Notice'
-
-// 引入组件
-const Editor = defineAsyncComponent(() => import('/@/components/editor/index.vue'))
-
-
-const { proxy } = getCurrentInstance() as any
-
-
-const formRef = ref()
-
-const state = reactive({    
-    sureLoading: false,
-    form: {} as NoticeAddInput & NoticeUpdateInput,
-    editor: {
-        htmlVal: '',
-        textVal: '',
-        disable: false,
-    },
-})
-
-onMounted(() => {
-    onQuery();    
-
-})
-
-// 查询重要通知
-const onQuery = async () => {    
-    const res = await new NoticeApi().getWeight({ }, { loading: true }).catch(() => {
-        proxy.$modal.closeLoading()
-    })
-    
-    if (res?.success) {
-        if (res.data != null) {
-            state.form = res.data as NoticeAddInput & NoticeUpdateInput;
-            state.editor.htmlVal = state.form.content;
-        } else { 
-            state.form = {} as NoticeAddInput & NoticeUpdateInput
-        }
-        
-    }    
-}
-
-// 确定
-const onSure = () => {
-    if (state.editor.textVal!="")
-        state.form.content = state.editor.htmlVal;    
-    formRef.value.validate(async (valid: boolean) => {        
-        if (!valid) return        
-        state.sureLoading = true
-        state.form.isAlter = 1;
-        state.form.rank = 0;
-        state.form.title='重要通知'
-        let res = {} as any
-        if (state.form.id != undefined && state.form.id > 0) {
-            res = await new NoticeApi().update(state.form, { showSuccessMessage: true }).catch(() => {                
-                state.sureLoading = false
-            })
-        } else {
-            res = await new NoticeApi().add(state.form, { showSuccessMessage: true }).catch(() => {                
-                state.sureLoading = false
-            })
-        }
-        if (res?.success) {
-            onQuery();
-            state.sureLoading = false
-        }
-    }) 
-}
-</script>

+ 7 - 7
src/views/admin/projectlink/index.vue

@@ -3,7 +3,7 @@
         <el-card class="mt8" shadow="never" :body-style="{ paddingBottom: '0' }">
             <el-form :inline="true" @submit.stop.prevent>
                 <el-form-item>
-                    <el-select lable="选择项目" v-model="state.uploadFilter.projectId" value-key="id" clearable >                                         
+                    <el-select placeholder="选择拉新项目" v-model="state.uploadFilter.projectId" value-key="id" clearable >                                         
                         <el-option v-for="item in state.uploadProjectList" :key="item.id" :label="item.name" :value="item.id" ></el-option>                        
                     </el-select>
                 </el-form-item>
@@ -21,7 +21,7 @@
                     :on-error="onUploadLinkError" 
                     accept=".xlsx"                                       
                     >
-                    <el-button type="primary" icon="ele-Upload"> 导入推广码 </el-button>
+                    <el-button :loading="state.LinkLoading" type="primary" icon="ele-Upload"> 导入推广码 </el-button>
                 </el-upload>                
                     <el-button type="primary" icon="ele-Download" @click="onDownExcel"> 导出推广码样式 </el-button>
                 </el-form-item>
@@ -88,11 +88,11 @@ const state = reactive({
     tenantFormTitle: '',
     linkFormTitle: '',
     uploadFilter: {
-        projectId: 0,
+        projectId: '',
         Company: ''
     },
     filter: {
-        projectId: 0,
+        projectId: '',
         keywords:''
     },pageInput: {
         currentPage: 1,
@@ -161,7 +161,7 @@ const onUploadLinkSuccess = (res: AxiosResponse) => {
         }
         return
     } else { 
-        eventBus.off('refreshProjectLink')
+        eventBus.emit('refreshProjectLink')
     }  
 }
 // 上传推广码失败
@@ -179,7 +179,7 @@ const onUploadLinkError = (error: any) => {
 }
 //上传推广码前
 const OnUploadLinkBefore = () => {    
-    if(state.uploadFilter.projectId <= 0)
+    if(state.uploadFilter.projectId === '')
     {
         proxy.$modal.msgError("请选择项目");
         return false;
@@ -192,7 +192,7 @@ const OnUploadLinkBefore = () => {
     state.LinkLoading = true    
 }
 const onDetail = (row: ProjectLinkManagePageOutput) => {
-    state.tenantFormTitle = '编辑租户'
+    state.tenantFormTitle = 'mingxi'
     tenantFormRef.value.open(row)
 
     // state.linkFormTitle = '明细'

+ 56 - 23
src/views/admin/projectstat/index.vue

@@ -3,7 +3,7 @@
     <el-card class="mt8" shadow="never" :body-style="{ paddingBottom: '0' }">
       <el-form :inline="true" @submit.stop.prevent>
         <el-form-item>
-          <el-select lable="选择项目" v-model="state.uploadFilter.ProjectId" value-key="id" clearable>
+          <el-select placeholder="选择项目" v-model="state.uploadFilter.ProjectId" value-key="id" clearable>
             <el-option v-for="item in state.uploadProjectList" :key="item.id" :label="item.name"
               :value="item.id"></el-option>
           </el-select>
@@ -13,7 +13,7 @@
             :data="{ ProjectId: state.uploadFilter.ProjectId }"
             :show-file-list="false" :before-upload="OnUploadStatBefore" :on-success="onUploadStatSuccess"
             :on-error="onUploadStatError" accept=".xlsx">
-            <el-button type="primary" icon="ele-Upload"> 导入每日统计 </el-button>
+            <el-button :loading="state.LinkLoading" type="primary" icon="ele-Upload"> 导入每日统计 </el-button>
           </el-upload>          
         </el-form-item>
          <el-form-item>
@@ -22,27 +22,27 @@
         <el-form-item>            
             <el-button type="primary" @click="onSettle"> 结算 </el-button>
           </el-form-item>
-          <!-- <el-form-item>            
-              <el-button type="primary" icon="ele-Download" @click="onDownExcel"> 导出项目统计模板 </el-button>
-            </el-form-item> -->
+          <el-form-item>            
+            <el-button type="primary" icon="ele-Download" @click="onDownExcel"> 导出项目统计模板 </el-button>
+          </el-form-item>
       </el-form>
     </el-card>
     <el-card class="mt8" shadow="never" :body-style="{ paddingBottom: '0' }">
       <el-form :inline="true" @submit.stop.prevent>
         <el-form-item>
-          <el-select lable="选择项目" v-model="state.filter.projectId" value-key="id" clearable>
+          <el-select placeholder="选择搜索项目" v-model="state.filter.projectId" value-key="id" clearable>
             <el-option v-for="item in state.uploadProjectList" :key="item.id" :label="item.name"
               :value="item.id"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-            <el-select lable="选择平台" v-model="state.filter.tenantId" value-key="id" clearable>
-              <el-option v-for="item in state.uploadProjectList" :key="item.id" :label="item.name"
+            <el-select placeholder="选择平台" v-model="state.filter.tenantId" value-key="id" clearable>
+              <el-option v-for="item in state.queryTenantList" :key="item.id" :label="item.name"
                 :value="item.id"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item>
-              <el-select lable="选择结算状态" v-model="state.filter.isSettele"  clearable>
+              <el-select placeholder="选择结算状态" v-model="state.filter.isSettele"  clearable>
                 <el-option label="已结算" value="1"></el-option>
                   <el-option label="未结算" value="0"></el-option>
               </el-select>
@@ -86,9 +86,11 @@
 </template>
 <script lang="ts" setup name="admin/projectlink">
 import { onMounted, computed, reactive, onBeforeMount, getCurrentInstance } from 'vue'
-import { PageInputProjectStatManagePageInput, ProjectStatManagePageOutput, ProjectSelectOutput } from '/@/api/admin/data-contracts'
+import { PageInputProjectStatManagePageInput, ProjectStatManagePageOutput, ProjectSelectOutput, TenantSelectListOutput } from '/@/api/admin/data-contracts'
+import { formatPast } from '/@/utils/formatTime'
 import { ProjectStatApi } from '/@/api/admin/ProjectStat'
 import { ProjectApi } from '/@/api/admin/project'
+import { TenantApi } from '/@/api/admin/Tenant'
 import pinia from '/@/stores/index'
 import { useUserInfo } from '/@/stores/userInfo'
 import eventBus from '/@/utils/mitt'
@@ -105,13 +107,13 @@ const state = reactive({
   tenantFormTitle: '',
   linkFormTitle: '',
   uploadFilter: {
-    ProjectId: 0,
+    ProjectId: '',
     EffecDate: ''
   },
   filter: {
-    projectId: 0,
-    tenantId: 0,
-    isSettele: -1,
+    projectId: '',
+    tenantId: '',
+    isSettele: '',
     effectDate: ''
   },
   pageInput: {
@@ -122,11 +124,13 @@ const state = reactive({
   listData: [] as Array<ProjectStatManagePageOutput>,
   uploadProjectList: [] as Array<ProjectSelectOutput>,
   queryProjectList: [] as Array<ProjectSelectOutput>,
+  queryTenantList: [] as Array<TenantSelectListOutput>,
   LinkLoading: false,
   token: storesUserInfo.getToken()
 })
 onMounted(() => {
   onProjects();
+  onTenants();
   onQuery()
   eventBus.off('refreshProjectStat')
   eventBus.on('refreshProjectStat', async () => {
@@ -140,7 +144,12 @@ onBeforeMount(() => {
 //查询
 const onQuery = async () => {
   state.loading = true
-  state.pageInput.filter = state.filter
+  state.pageInput.filter = state.filter;
+  if (state.filter.effectDate != '') {
+    state.pageInput.filter.effectDate = formatPast(new Date(state.filter.effectDate), 'YYYY-mm-dd');
+  }
+
+  
   const res = await new ProjectStatApi().getPageManage(state.pageInput).catch(() => {
     state.loading = false
   })
@@ -157,6 +166,14 @@ const onProjects = async () => {
   state.uploadProjectList = res?.data ?? []
   state.queryProjectList = res?.data ?? []
 }
+//平台列表
+const onTenants = async () => {
+  let input: any = {}
+  const res = await new TenantApi().getAll(input).catch(() => {
+
+  })
+  state.queryTenantList = res?.data ?? []  
+}
 //导入项目统计
 // 上传项目统计请求url
 const StatAction = computed(() => {
@@ -169,13 +186,12 @@ const StatHeaders = computed(() => {
 // 上传项目统计成功
 const onUploadStatSuccess = (res: AxiosResponse) => {
   state.LinkLoading = false
-  if (!res?.success) {
+  if (!res?.success) {    
     if (res.msg) {
       proxy.$modal.msgError(res.msg)
-    }
-    return
-  } else {
-    eventBus.off('refreshProjectStat')
+    }    
+  } else {    
+    eventBus.emit('refreshProjectStat')
   }
 }
 // 上传项目统计失败
@@ -193,7 +209,7 @@ const onUploadStatError = (error: any) => {
 }
 //上传项目统计前
 const OnUploadStatBefore = () => {
-  if (state.uploadFilter.ProjectId <= 0) {
+  if (state.uploadFilter.ProjectId === '') {
     proxy.$modal.msgError("请选择项目");
     return false;
   }  
@@ -202,10 +218,22 @@ const OnUploadStatBefore = () => {
 }
 //结算
 const onSettle = async () => {
+  if (state.uploadFilter.ProjectId == '') { 
+    proxy.$modal.msgError("请选择项目");
+    return;
+  }
+  if (state.uploadFilter.EffecDate == '') {
+    proxy.$modal.msgError("请选择结算日期");
+    return;
+  }
    proxy.$modal
     .confirm(`请确认是否结算`)
-    .then(async () => {
-      const res = await new ProjectStatApi().Settle(state.uploadFilter, { loading: true }).catch(() => {
+     .then(async () => {
+       let EffecDate = formatPast(new Date(state.uploadFilter.EffecDate), 'YYYYmmdd');       
+       const res = await new ProjectStatApi().Settle({
+         ProjectId: state.uploadFilter.ProjectId,
+         EffecDate:EffecDate
+       }, { loading: true }).catch(() => {
         proxy.$modal.closeLoading()
       })      
       if (res?.success) {
@@ -215,5 +243,10 @@ const onSettle = async () => {
     })
     .catch(() => { })   
 }
+// 导出项目统计模板
+const onDownExcel = () => {   
+  let url = import.meta.env.VITE_API_URL + '/stat/项目统计模板.xlsx'
+  window.open(url, '_self');
+}
 
 </script>

+ 1 - 0
src/views/admin/tenant/index.vue

@@ -43,6 +43,7 @@
             </template>
           </template>
         </el-table-column>
+        <el-table-column prop="h5WebSite" label="H5网址" min-width="120" show-overflow-tooltip />
         <el-table-column label="操作" width="140" header-align="center" align="center" fixed="right">
           <template #default="{ row }">
             <el-button v-auth="'api:admin:tenant:update'" icon="ele-EditPen" size="small" text type="primary" @click="onEdit(row)">编辑</el-button>