Browse Source

Merge branch 'v2.0_ch' into v2.0

chenlei 5 tháng trước cách đây
mục cha
commit
6c69c49276

+ 0 - 5
src/api/modules/etaMenuApi.js

@@ -55,9 +55,4 @@ export const menuConfigInterface = {
     addMenuIcon:params=>{
         return post('/eta_business/menu/icon/add',params)
     },
-    
-    //上传banner图
-    bannerupload:params=>{
-        return post('/banner/upload',params)
-    }
 }

+ 1 - 1
src/api/modules/trainingApi.js

@@ -165,7 +165,7 @@ export const VideoInterface = {
      * @returns 
      */
     bannerupload:(params)=>{
-        return post('/banner/upload',params)
+        return post('/resource/image/upload',params)
     },
     /**
      * 上传阿里云 oss获取临时票据

+ 11 - 14
src/views/business_manage/addBusiness.vue

@@ -86,10 +86,6 @@
               </t-form-item>
             </div>
             <div class="form-line">
-              <t-form-item label="用户上限" name="userMax">
-                <t-input v-model:modelValue="firstFormData.userMax" :disabled="currentRoute === 'businessDetail'"
-                  type="number" placeholder="请输入用户上限" />
-              </t-form-item>
               <t-form-item label="所属销售" name="saller">
                 <t-cascader :disabled="currentRoute === 'businessDetail'" v-model:modelValue="firstFormData.saller"
                   :options="salesArr" :show-all-levels="false" :keys="cascaderProps" filterable @change="changeSaller"
@@ -184,7 +180,6 @@ const firstFormData = reactive({
   teamSize: '',
   fundsize: '',
   industry: '',
-  userMax: '',
   saller: ''
 });
 const secondFormData = reactive({
@@ -229,7 +224,6 @@ const rules = {
   decisionMaker: [{ required: true, message: '请输入决策人', trigger: 'blur' }],
   teamSize: [{ required: true, message: '请选择研究团队规模', trigger: 'change' }],
   industry: [{ required: true, message: '请选择所属行业', trigger: 'change' }],
-  userMax: [{ required: true, message: '请输入用户上限', trigger: 'blur' }],
   saller: [{ required: true, message: '请选择所属销售', trigger: 'change' }],
   signDate: [{ required: true, message: '请选择签约日期', trigger: 'change' }],
   expirationDate: [{ required: true, message: '请选择到期日期', trigger: 'change' }],
@@ -338,7 +332,7 @@ const fetchBusinessData = async () => {
   try {
     const res = await businessCustomInterence.getBusinessDetail({ EtaBusinessId: businessId.value });
     if (res.Ret !== 200) return;
-    const { RegionType, BusinessName, CreditCode, Nation, Leader, ResearchTeamSize, CapitalScale, IndustryId, UserMax, SellerId, SigningTime, ExpiredTime, City } = res.Data;
+    const { RegionType, BusinessName, CreditCode, Nation, Leader, ResearchTeamSize, CapitalScale, IndustryId, SellerId, SigningTime, ExpiredTime, City, Province } = res.Data;
     Object.assign(firstFormData, {
       areaType: RegionType,
       name: BusinessName,
@@ -348,9 +342,10 @@ const fetchBusinessData = async () => {
       teamSize: ResearchTeamSize,
       fundsize: CapitalScale,
       industry: IndustryId,
-      userMax: UserMax,
       saller: SellerId,
-      address: City
+      address: City,
+      province: Province,
+      city: City
     });
     Object.assign(secondFormData, {
       expirationDate: ExpiredTime,
@@ -396,7 +391,6 @@ const getTimeLineData = async () => {
   }
 };
 
-
 // 提交
 const normalizingParams = (params) => {
   const IndustryName = tradeArr.value.find(item => item.IndustryId === params.industry)?.IndustryName || '';
@@ -414,7 +408,6 @@ const normalizingParams = (params) => {
     IndustryName: IndustryName,
     CapitalScale: params.fundsize,
     ResearchTeamSize: params.teamSize,
-    UserMax: Number(params.userMax),
     SigningTime: params.signDate || '',
     ExpiredTime: params.expirationDate || '',
     IsCheck: params.IsCheck,
@@ -447,7 +440,7 @@ const handleStepSecond = async (stepName) => {
 
 const handleAddBusiness = async (isEdit = '') => {
   const res = await businessCustomInterence.addChartPermission({
-    ChartClassifyIdStr: permissionRef.value.actuallyAllChecked.join(',') || '',
+    ChartClassifyIdStr: permissionRef.value && permissionRef.value.actuallyAllChecked.join(',') || '',
     EtaBusinessId: handleEtaBusinessId.value === 0 ? businessId.value : handleEtaBusinessId.value
   });
   if (res.Ret !== 200) return;
@@ -489,7 +482,9 @@ const changeActiveStep = (index) => {
 
 // 编辑
 const editEtaBusiness = async () => {
-  const {creditCode, province, city, decisionMaker,industry,nation,teamSize,userMax} = firstFormData;
+  const {creditCode, province, city, decisionMaker,industry,nation,teamSize} = firstFormData;
+  console.log('editEtaBusiness', firstFormData);
+  
   const IndustryName = tradeArr.value.find(item => item.IndustryId === industry)?.IndustryName || '';
   const query = {
     EtaBusinessId: businessId.value,
@@ -499,7 +494,6 @@ const editEtaBusiness = async () => {
     ResearchTeamSize: teamSize||'',
     Nation: nation,
     IndustryId:Number(industry),
-    UserMax:Number(userMax),
     Province:province,
     City:city,
   }
@@ -540,6 +534,9 @@ const editEtaBusiness = async () => {
           width: 48%;
           margin-right: 20px;
         }
+        .t-form-item__saller {
+          margin-bottom: var(--td-comp-margin-xxl);
+        }
       }
     }
 

+ 1 - 1
src/views/business_manage/components/EditBox.vue

@@ -5,7 +5,7 @@
                 <t-button block theme="primary" variant="base" @click="goEdit">编辑</t-button>
             </template>
             <template v-if="currentRoute === 'editBusiness'">
-                <t-button block theme="primary" variant="base" @click="edit">编辑</t-button>
+                <t-button block theme="primary" variant="base" @click="edit">保存</t-button>
                 <t-button block theme="default" @click="goList">取消</t-button>
             </template>
         </div>

+ 2 - 1
src/views/business_manage/components/SetPermission.vue

@@ -104,6 +104,8 @@ const onChange = (checked, context) => {
     if (node.data.Children.length) {                    // 如果当前节点有子节点,则把所有子节点的id都加上去  
       allChecked.value = [...new Set([...allChecked.value, node.value, ...getAllChildIds(node.data.Children)])];
       actuallyAllChecked.value = [...new Set([...actuallyAllChecked.value, node.value, ...getAllChildIds(node.data.Children)])];
+    } else {                                            // 如果当前节点有子节点,则直接加上该节点的id
+      actuallyAllChecked.value = [...new Set([...actuallyAllChecked.value, node.value])];                                                  
     }
   } else {    
     if (node.data.Children.length) {                    // 如果当前节点有子节点,则直接去掉该节点和子节点的所有id 
@@ -142,7 +144,6 @@ const removeChildren = (arrayA, arrayB) => {
     return arrayA.filter(item => !setB.has(item));
 }
 
-
 // 保存按钮
 const handleSave = async () => {
   emit('setPermission', actuallyAllChecked.value);

+ 21 - 8
src/views/etaMenu/components/ChoosedIconDialog.vue

@@ -11,8 +11,9 @@
             <div class="dialog-container-wrap">
                 <div class="top">
                     <t-upload action="" accept="image/*" 
-                        :http-request="handleUploadImg" 
-                        :show-file-list="false"
+                        :requestMethod="handleUploadImg" 
+                        :show-image-file-name="false" 
+                        theme="custom" 
                     >
                         <t-button size="small">选择文件</t-button>
                         <span>支持上传图标</span>
@@ -39,6 +40,7 @@
 <script setup>
 import { ref, watch, onMounted } from 'vue';
 import { menuConfigInterface } from '@/api/modules/etaMenuApi';
+import { VideoInterface } from '@/api/modules/trainingApi';
 
 // 定义响应式数据
 const props = defineProps({
@@ -72,29 +74,40 @@ watch(() => props.isShowIconDialog, (newVal) => {
 
 // 处理图片上传的方法
 const handleUploadImg = async (e) => {
-  if (!['image/png', 'image/jpeg'].includes(e.file.type)) {
+  if (!['image/png', 'image/jpeg'].includes(e.raw.type)) {
     MessagePlugin.warning('仅支持png、jpg格式的图片');
     return;
   }
-  if (e.file.size > 50 * 1024) {
+  if (e.raw.size > 50 * 1024) {
     MessagePlugin.warning('图标文件大小不能超过50kb');
     return;
   }
 
   const form = new FormData();
-  form.append('file', e.file);
-
+  form.append('file', e.raw);
+  let isSuccess = false
+  let url = ''
   try {
-    const res = await bannerupload.bannerupload(form);
+    const res = await VideoInterface.bannerupload(form);
     if (res.Ret === 200) {
       await menuConfigInterface.addMenuIcon({
         IconPath: res.Data.ResourceUrl,
       });
       getIconList();
-    }
+      isSuccess = true;
+      url = res.Data.ResourceUrl;
+    } else isSuccess = false;
   } catch (error) {
     console.error('上传图标失败', error);
+    isSuccess = false;
   }
+  return {
+    status: isSuccess ? 'success' : 'fail',
+    response: {
+      url,
+    },
+    error: '上传失败',
+  };
 };
 
 // 保存图标的方法

+ 26 - 25
src/views/etaMenu/components/ModifyMenuDialog.vue

@@ -11,10 +11,10 @@
         <div class="dialog-container-wrap">
             <t-form :data="form" :rules="rules" label-width="80px" ref="menuFormRef">
                 <t-form-item label="菜单类型" name="MenuType">
-                    <t-radio-group v-model="form.MenuType" :disabled="form.MenuId">
-                    <t-radio :value="0" :disabled="isMenuDisabled">菜单</t-radio>
-                    <t-radio :value="1" :disabled="isbtnDisabled">按钮</t-radio>
-                    <t-radio :value="2" :disabled="isbtnDisabled">字段</t-radio>
+                    <t-radio-group v-model="form.MenuType">
+                    <t-radio :value="0" :disabled="isMenuDisabled || form.MenuId ? true : false">菜单</t-radio>
+                    <t-radio :value="1" :disabled="isbtnDisabled || form.MenuId ? true : false">按钮</t-radio>
+                    <t-radio :value="2" :disabled="isbtnDisabled || form.MenuId ? true : false">字段</t-radio>
                     </t-radio-group>
                 </t-form-item>
                 <t-form-item label="上级菜单" name="ParentId">
@@ -25,7 +25,7 @@
                     <t-input v-model="form.Name"></t-input>
                 </t-form-item>
                 <template v-if="form.MenuType === 0">
-                    <t-form-item label="菜单图标" name="Name" v-if="form.treeLevel === 0">
+                    <t-form-item label="菜单图标" name="IconPath" v-if="form.treeLevel === 0">
                     <div class="icon-wrap">
                         <img :src="form.IconPath" v-if="form.IconPath">
                         <t-button @click="isShowIconDialog = true">选择图标</t-button>
@@ -105,7 +105,7 @@ const emit = defineEmits(['add', 'edit', 'close']);
 // 响应式数据
 const form = ref({
   MenuType: 0,
-  ParentId: 0,
+  ParentId: -1,
   Name: '',
   IconPath: '',
   Path: '',
@@ -210,14 +210,23 @@ const changeListLevel = (level) => {
       return m;
     });
   } else {
-    menuList.value = [...menuList.value, ..._.cloneDeep(props.etaMenu)];
+    const mergedArray = [...menuList.value, ...props.etaMenu].reduce((acc, curr) => {
+      const existing = acc.find(item => item.MenuId === curr.MenuId);
+      if (existing) {
+        Object.assign(existing, curr);
+      } else {
+        acc.push(curr);
+      }
+      return acc;
+    }, []);
+    menuList.value = mergedArray;
   }
 };
 
 const resetForm = () => {
   form.value = {
     MenuType: 0,
-    ParentId: 0,
+    ParentId: -1,
     Name: '',
     IconPath: '',
     Path: '',
@@ -246,23 +255,15 @@ onMounted(() => {
         flex-direction: column;
         margin: 0 auto;
         width: 400px;
-        .el-form{
-            align-self: center;
-            .el-form-item{
-                .el-input{
-                    width: 315px;
-                }
-                .icon-wrap{
-                    display: flex;
-                    align-items: center;
-                    img{
-                        width:24px;
-                        height: 24px;
-                        margin-right: 15px;
-                    }
-                }
-            }
-        }
+          .icon-wrap{
+              display: flex;
+              align-items: center;
+              img{
+                  width:24px;
+                  height: 24px;
+                  margin-right: 15px;
+              }
+          }
         .btn-wrap {
             margin-top: 20px;
             display: flex;

+ 1 - 1
src/views/etaMenu/etaMenuConfig.vue

@@ -2,7 +2,7 @@
     <div class="eta-menu-config-wrap">
         <div class="menu-top">
             <t-button @click="handleModifyMenu('add',{})">添加菜单</t-button>
-            <t-input style="width: 310px; margin-left: auto" placeholder="请输入菜单名称" clearable v-model="Keyword" @input="getMenuData">
+            <t-input style="width: 310px; margin-left: auto" placeholder="请输入菜单名称" clearable v-model="Keyword" @change="getMenuData">
                 <template #prefixIcon><SearchIcon /></template>
             </t-input>
         </div>

+ 1 - 1
src/views/etaTrial/etaTrialList.vue

@@ -51,7 +51,7 @@
         <t-input
           v-model="searchText"
           placeholder="姓名/公司名称"
-          @input="searchHandle"
+          @change="searchHandle"
           style="width: 400px; margin-left: 20px;"
         >
         <template #prefixIcon><SearchIcon /></template>

+ 1 - 1
src/views/system/updateLog.vue

@@ -2,7 +2,7 @@
     <div class="update-log-manage-wrap">
         <div class="top-wrap">
             <t-button theme="primary" @click="isLogSetShow=true">添加日志</t-button>
-            <t-input v-model="searchText" @input="getTableData" placeholder="输入更新内容检索" clearable style="width:240px;" @clear="getTableData">
+            <t-input v-model:value="searchText" @change="getTableData" placeholder="输入更新内容检索" clearable style="width:240px;">
                 <template #prefixIcon>
                     <SearchIcon/>
                 </template>

+ 1 - 1
src/views/training/classifyManage.vue

@@ -2,7 +2,7 @@
     <div class="classify-manage-wrap traing-manage">
         <div class="top-wrap">
             <t-button theme="primary" @click="handleModifyClassify({})">添加分类</t-button>
-            <t-input v-model="searchText" clearable placeholder="请输入分类名称" @input="getTableData" style="width:240px;">
+            <t-input v-model="searchText" clearable placeholder="请输入分类名称" @change="getTableData" style="width:240px;">
                 <template #prefixIcon>
                     <SearchIcon/>
                 </template>

+ 2 - 2
src/views/training/components/addTags.vue

@@ -10,7 +10,7 @@
     >
         <div class="dialog-container">
             <div class="search-box">
-                <t-input  placeholder="请输入标签名称" v-model.trim="searchText" clearable @input="getTagList(searchText)">
+                <t-input  placeholder="请输入标签名称" v-model.trim="searchText" clearable @change="getTagList(searchText)">
                     <template #prefixIcon>
                         <SearchIcon/>
                     </template>
@@ -128,7 +128,7 @@ const modifyTags = () => {
 };
 
 const toTagPage = () => {
-  window.open('/trainingLabel');
+  window.open('/training/trainingLabel');
 };
 </script>
 

+ 1 - 1
src/views/training/labelManage.vue

@@ -3,7 +3,7 @@
     <div class="label-manage-wrap traing-manage">
         <div class="top-wrap">
             <t-button theme="primary" @click="handleModifyLabel({})">新增标签</t-button>
-            <t-input v-model="searchText" clearable placeholder="请输入标签名称" @input="handleCurrentChange(1)" style="width:240px;">
+            <t-input v-model="searchText" clearable placeholder="请输入标签名称" @change="handleCurrentChange(1)" style="width:240px;">
                 <template #prefixIcon>
                     <SearchIcon/>
                 </template>

+ 22 - 17
src/views/training/modifyVideoPage.vue

@@ -26,7 +26,7 @@
             <t-form-item label="上传封面" name="CoverImg">
               <div style="display: block;">
                   <t-upload accept="image/*" 
-                      :http-request="handleUploadImg" :show-file-list="false" :disabled="isImageUploading">
+                      :requestMethod="handleUploadImg" theme="custom" :show-image-file-name="false" :disabled="isImageUploading">
                       <t-button theme="primary" :loading="isImageUploading">点击上传</t-button>
                       <span style="color:#999999;margin-left: 5px;" @click.stop>建议尺寸比例3:2,支持png、jpg、gif、jpeg格式</span>
                   </t-upload>
@@ -80,9 +80,9 @@
         <!-- 预览视频弹窗 -->
         <t-dialog
             :visible.sync="previewPop"
-            :modal-append-to-body='false'
             width="60vw"
-            :title="previewPopTitle"
+            :header="previewPopTitle"
+            :footer="false"
             @close="endingPreview"
         >
          <video style="width: 100%;height: 100%;max-height: 70vh;outline: none;" 
@@ -197,26 +197,33 @@ const getTagList = async (keyword = '') => {
 };
 
 // 检查图片是否合法
-const handleUploadImg = (file) => {
+const handleUploadImg = async (file) => {
   isImageUploading.value = true;
-  const { type } = file.file;
+  const { type } = file.raw;
   if (!['image/png', 'image/jpeg'].includes(type)) {
     MessagePlugin.warning('仅支持png、jpg格式的图片');
     isImageUploading.value = false;
     return;
   }
-  uploadImg(file);
+  const res = await uploadImg(file);
+  return {
+    status: res ? 'success' : 'fail',
+    response: {
+      url: form.value.CoverImg,
+    },
+    error: '上传失败',
+  };
 };
 
 // 上传图片
-const uploadImg = (file) => {
+const uploadImg = async (file) => {
   const formData = new FormData();
-  formData.append('file', file.file);
-  VideoInterface.bannerupload(formData).then(res => {
-    isImageUploading.value = false;
-    if (res.Ret !== 200) return;
-    form.value.CoverImg = res.Data.ResourceUrl;
-  });
+  formData.append('file', file.raw);
+  const res = await VideoInterface.bannerupload(formData)
+  isImageUploading.value = false;
+  if (res.Ret !== 200) return false;
+  form.value.CoverImg = res.Data.ResourceUrl;
+  return true;
 };
 
 // 检查视频是否合法,并获取视频时长
@@ -233,8 +240,6 @@ const handleUploadVideo = async (file) => {
 
 // 获取视频时长的Promise
 const handleGetDuration = (file) => {
-  console.log(file);
-  
   return new Promise((resolve, reject) => {
     const fileUrl = URL.createObjectURL(file.raw);
     const audioEl = new Audio(fileUrl);
@@ -370,8 +375,8 @@ const publishVideo = async () => {
     res = await VideoInterface.publishVideo({ VideoId: Number(form.value.VideoId), PublishState: 1 });
     if (res.Ret !== 200) return;
     MessagePlugin.success('发布成功');
+    changeRoute();
   }
-  changeRoute();
 };
 
 // 改变路由
@@ -386,10 +391,10 @@ const changeRoute = () => {
 // 预览视频
 const handlePreviewVideo = () => {
   if (isVideoUploading.value || !form.value.VideoUrl) return;
-  previewVideo.play();
   previewPopTitle.value = form.value.Title || '暂无标题';
   previewVideoUrl.value = form.value.VideoUrl;
   previewPop.value = true;
+  previewVideo.play();
 };
 
 // 结束预览弹窗关闭回调 -- 暂停视频

+ 1 - 1
src/views/training/videoManage.vue

@@ -42,7 +42,7 @@
                     <t-option label="已发布" :value="2"/>
                 </t-select>
             </div>
-            <t-input v-model="searchText" clearable placeholder="请输入视频名称" @input="handleCurrentChange(1)" style="width:240px;">
+            <t-input v-model="searchText" clearable placeholder="请输入视频名称" @change="handleCurrentChange(1)" style="width:240px;">
                 <template #prefixIcon><SearchIcon /></template>
             </t-input>
         </div>