Browse Source

Merge branch 'master' of http://git.cc-lotus.info/Information/cxyy-web

lrf 8 months ago
parent
commit
707933ded1

BIN
public/产学研用供给模板.xlsx


BIN
public/产学研用成果模板.xlsx


BIN
public/产学研用需求模板.xlsx


BIN
public/产学研用项目模板.xlsx


BIN
public/导入模板.xlsx


+ 3 - 1
src/layout/index.vue

@@ -45,7 +45,7 @@
 import QRCodeVue from 'qrcode.vue'
 import { get } from 'lodash-es'
 import { LoginOutlined } from '@ant-design/icons-vue'
-import { siteInfo, menuList3 } from '@/layout/site'
+import { siteInfo } from '@/layout/site'
 // 接口
 import { DesignStore } from '@/store/api/platform/design'
 const designStore = DesignStore()
@@ -54,6 +54,7 @@ import { UserStore } from '@/store/user'
 const userStore = UserStore()
 const user = computed(() => userStore.user)
 const menusList = get(user, 'value.menus', [])
+
 // 加载中
 const loading = ref(false)
 // 路由
@@ -79,6 +80,7 @@ const checkHasComponent = (menu) => {
 // 请求
 onMounted(async () => {
   await searchOther()
+  menusList.value = get(user, 'value.menus', [])
 })
 const searchOther = async () => {
   // 基础设置

+ 15 - 17
src/views/center/achievement.vue

@@ -6,7 +6,7 @@
           <div class="one_left">
             <div class="button" @click="toAdd">发布成果</div>
             <div class="button" @click="toTemplate">下载导出模板</div>
-            <el-upload class="button" :action="url" :show-file-list="false" :on-error="onError" :http-request="httpRequse" accept=".xlsx"> 选择excel模板文件 </el-upload>
+            <el-upload class="button" action="/files/web/cxyy_import/upload" :show-file-list="false" :on-success="onSuccess" accept=".xlsx"> 选择excel模板文件 </el-upload>
             <div class="button" @click="toDownload">下载Excel</div>
           </div>
           <div class="one_right">
@@ -96,6 +96,7 @@
 </template>
 
 <script setup>
+import axios from 'axios'
 import { Search } from '@element-plus/icons-vue'
 import { cloneDeep, get } from 'lodash-es'
 const $checkRes = inject('$checkRes')
@@ -311,26 +312,23 @@ const checkedExportChange = (value) => {
 }
 // 下载导出模板
 const toTemplate = () => {
-  window.open('/cxyyWeb/导入模板.xlsx')
+  window.open('/cxyyWeb/产学研用成果模板.xlsx')
 }
 // 上传Excel
-const httpRequse = async (param) => {
+const onSuccess = async (response, file) => {
   const msgbox = ElMessage({ message: '正在导入中,请稍后...', center: true, duration: 0 })
   try {
-    let fileObj = param.file
-    let fd = new FormData()
-    fd.append('file', fileObj, fileObj.name)
-    const res = await utilStore.toImport(fd)
-    // let list
-    console.log(res)
-    // if (res.status !== 200) {
-    //   list = [{ key: '请求发生错误' }]
-    // } else if (res.data.errcode !== 0) {
-    //   list = [{ key: '请求发生错误', num: res.data.errmsg }]
-    // } else {
-    //   list = res.data.data
-    // }
-    // console.log(list)
+    const res = await utilStore.toImport({ url: response.uri })
+    if (res.errcode == '0') {
+      if (res.data[0].errorList) {
+        ElMessageBox.alert(res.data[0].errorList, '错误提示', {
+          confirmButtonText: 'OK'
+        })
+      } else {
+        ElMessage({ message: '导入成功', type: 'success' })
+      }
+      search({ skip, limit })
+    }
   } catch (error) {
     console.error(error)
   } finally {

+ 14 - 17
src/views/center/demand.vue

@@ -6,7 +6,7 @@
           <div class="one_left">
             <div class="button" @click="toAdd">发布需求</div>
             <div class="button" @click="toTemplate">下载导出模板</div>
-            <el-upload class="button" :action="url" :show-file-list="false" :on-error="onError" :http-request="httpRequse" accept=".xlsx"> 选择excel模板文件 </el-upload>
+            <el-upload class="button" action="/files/web/cxyy_import/upload" :show-file-list="false" :on-success="onSuccess" accept=".xlsx"> 选择excel模板文件 </el-upload>
             <div class="button" @click="toDownload">下载Excel</div>
           </div>
           <div class="one_right">
@@ -368,26 +368,23 @@ const checkedExportChange = (value) => {
 }
 // 下载导出模板
 const toTemplate = () => {
-  window.open('/cxyyWeb/导入模板.xlsx')
+  window.open('/cxyyWeb/产学研用需求模板.xlsx')
 }
 // 上传Excel
-const httpRequse = async (param) => {
+const onSuccess = async (response, file) => {
   const msgbox = ElMessage({ message: '正在导入中,请稍后...', center: true, duration: 0 })
   try {
-    let fileObj = param.file
-    let fd = new FormData()
-    fd.append('file', fileObj, fileObj.name)
-    const res = await utilStore.toImport(fd)
-    // let list
-    console.log(res)
-    // if (res.status !== 200) {
-    //   list = [{ key: '请求发生错误' }]
-    // } else if (res.data.errcode !== 0) {
-    //   list = [{ key: '请求发生错误', num: res.data.errmsg }]
-    // } else {
-    //   list = res.data.data
-    // }
-    // console.log(list)
+    const res = await utilStore.toImport({ url: response.uri })
+    if (res.errcode == '0') {
+      if (res.data[0].errorList) {
+        ElMessageBox.alert(res.data[0].errorList, '错误提示', {
+          confirmButtonText: 'OK'
+        })
+      } else {
+        ElMessage({ message: '导入成功', type: 'success' })
+      }
+      search({ skip, limit })
+    }
   } catch (error) {
     console.error(error)
   } finally {

+ 1 - 1
src/views/center/parts/incubator.vue

@@ -42,7 +42,7 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="是否和平台合作标识" prop="cooperate">
-            <el-radio-group v-model="form.cooperate">
+            <el-radio-group v-model="form.cooperate" disabled>
               <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
             </el-radio-group>
           </el-form-item>

+ 14 - 17
src/views/center/project.vue

@@ -6,7 +6,7 @@
           <div class="one_left">
             <div class="button" @click="toAdd">发布项目</div>
             <div class="button" @click="toTemplate">下载导出模板</div>
-            <el-upload class="button" :action="url" :show-file-list="false" :on-error="onError" :http-request="httpRequse" accept=".xlsx"> 选择excel模板文件 </el-upload>
+            <el-upload class="button" action="/files/web/cxyy_import/upload" :show-file-list="false" :on-success="onSuccess" accept=".xlsx"> 选择excel模板文件 </el-upload>
             <div class="button" @click="toDownload">下载Excel</div>
           </div>
           <div class="one_right">
@@ -376,26 +376,23 @@ const checkedExportChange = (value) => {
 }
 // 下载导出模板
 const toTemplate = () => {
-  window.open('/cxyyWeb/导入模板.xlsx')
+  window.open('/cxyyWeb/产学研用项目模板.xlsx')
 }
 // 上传Excel
-const httpRequse = async (param) => {
+const onSuccess = async (response, file) => {
   const msgbox = ElMessage({ message: '正在导入中,请稍后...', center: true, duration: 0 })
   try {
-    let fileObj = param.file
-    let fd = new FormData()
-    fd.append('file', fileObj, fileObj.name)
-    const res = await utilStore.toImport(fd)
-    // let list
-    console.log(res)
-    // if (res.status !== 200) {
-    //   list = [{ key: '请求发生错误' }]
-    // } else if (res.data.errcode !== 0) {
-    //   list = [{ key: '请求发生错误', num: res.data.errmsg }]
-    // } else {
-    //   list = res.data.data
-    // }
-    // console.log(list)
+    const res = await utilStore.toImport({ url: response.uri })
+    if (res.errcode == '0') {
+      if (res.data[0].errorList) {
+        ElMessageBox.alert(res.data[0].errorList, '错误提示', {
+          confirmButtonText: 'OK'
+        })
+      } else {
+        ElMessage({ message: '导入成功', type: 'success' })
+      }
+      search({ skip, limit })
+    }
   } catch (error) {
     console.error(error)
   } finally {

+ 14 - 17
src/views/center/supply.vue

@@ -6,7 +6,7 @@
           <div class="one_left">
             <div class="button" @click="toAdd">发布供给</div>
             <div class="button" @click="toTemplate">下载导出模板</div>
-            <el-upload class="button" :action="url" :show-file-list="false" :on-error="onError" :http-request="httpRequse" accept=".xlsx"> 选择excel模板文件 </el-upload>
+            <el-upload class="button" action="/files/web/cxyy_import/upload" :show-file-list="false" :on-success="onSuccess" accept=".xlsx"> 选择excel模板文件 </el-upload>
             <div class="button" @click="toDownload">下载Excel</div>
           </div>
           <div class="one_right">
@@ -366,26 +366,23 @@ const checkedExportChange = (value) => {
 }
 // 下载导出模板
 const toTemplate = () => {
-  window.open('/cxyyWeb/导入模板.xlsx')
+  window.open('/cxyyWeb/产学研用供给模板.xlsx')
 }
 // 上传Excel
-const httpRequse = async (param) => {
+const onSuccess = async (response, file) => {
   const msgbox = ElMessage({ message: '正在导入中,请稍后...', center: true, duration: 0 })
   try {
-    let fileObj = param.file
-    let fd = new FormData()
-    fd.append('file', fileObj, fileObj.name)
-    const res = await utilStore.toImport(fd)
-    // let list
-    console.log(res)
-    // if (res.status !== 200) {
-    //   list = [{ key: '请求发生错误' }]
-    // } else if (res.data.errcode !== 0) {
-    //   list = [{ key: '请求发生错误', num: res.data.errmsg }]
-    // } else {
-    //   list = res.data.data
-    // }
-    // console.log(list)
+    const res = await utilStore.toImport({ url: response.uri })
+    if (res.errcode == '0') {
+      if (res.data[0].errorList) {
+        ElMessageBox.alert(res.data[0].errorList, '错误提示', {
+          confirmButtonText: 'OK'
+        })
+      } else {
+        ElMessage({ message: '导入成功', type: 'success' })
+      }
+      search({ skip, limit })
+    }
   } catch (error) {
     console.error(error)
   } finally {

+ 24 - 0
src/views/detail/baseDetail.vue

@@ -48,6 +48,20 @@
               <div v-if="info.brief" v-html="info.brief"></div>
             </div>
           </div>
+          <div class="center">
+            <div class="title">合作企业</div>
+            <div class="content">
+              <el-table :data="cirelationList" stripe style="width: 100%" :header-cell-style="{ backgroundColor: 'rgba(194, 209, 225, 0.5)', color: '#ffffff', fontSize: '16px', textAlign: 'center' }" :cell-style="{ fontSize: '16px', textAlign: 'center' }" :row-style="{ fontSize: '16px', textAlign: 'center' }">
+                <el-table-column prop="company_name" label="企业名称" />
+                <el-table-column prop="time" label="申请时间" />
+                <el-table-column prop="time" label="查看详情">
+                  <template #default="scope">
+                    <el-button type="primary" @click="toCompany(scope.row)">查看详情</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
           <div class="bottom">
             <div class="title">相关孵化基地</div>
             <div class="content">
@@ -85,8 +99,10 @@ const $checkRes = inject('$checkRes')
 import { get } from 'lodash-es'
 // 接口
 import { IncubatorStore } from '@/store/api/user/incubator'
+import { CirelationStore } from '@/store/api/user/cirelation'
 import { DictDataStore } from '@/store/api/system/dictData'
 const store = IncubatorStore()
+const cirelationStore = CirelationStore()
 const dictDataStore = DictDataStore()
 import { UserStore } from '@/store/user'
 const userStore = UserStore()
@@ -107,6 +123,7 @@ const info = ref({})
 // 列表
 const list = ref([])
 const isUseList = ref([])
+const cirelationList = ref([])
 // 请求
 onMounted(async () => {
   loading.value = true
@@ -128,12 +145,19 @@ const search = async () => {
   if (id) {
     let res = await store.detail(id)
     if (res.errcode == '0') info.value = res.data
+    const data = { skip: 0, limit: 6, incubator: res.data.id, status: '1' }
+    res = await cirelationStore.list(data)
+    if (res.errcode == '0') cirelationList.value = res.data
   }
 }
 // 查看
 const toView = (item) => {
   router.push({ path: '/base/detail', query: { id: item.id || item._id } })
 }
+// 查看企业详情
+const toCompany = (item) => {
+  router.push({ path: `/company/detail`, query: { id: item.company } })
+}
 const getUrl = (item) => {
   if (item) return `${import.meta.env.VITE_APP_HOST}${item}`
 }

+ 8 - 0
src/views/login/parts/login.vue

@@ -44,6 +44,10 @@
                 <span @click="toAgree"> 服务条款、隐私政策</span>
               </div>
             </div>
+            <el-col :span="24" class="text">
+              <span></span>
+              <span @click="toBack">返回首页</span>
+            </el-col>
           </el-col>
         </el-form>
       </div>
@@ -159,6 +163,10 @@ const submitForm = async (formEl) => {
 const toRegister = () => {
   router.push({ path: '/login', query: { status: '0' } })
 }
+// 返回首页
+const toBack = () => {
+  router.push({ path: '/' })
+}
 // 查看隐私协议
 const toAgree = () => {
   dialog.value = !dialog.value

+ 8 - 0
src/views/login/parts/register.vue

@@ -75,6 +75,10 @@
             <span @click="toAgree"> 服务条款、隐私政策</span>
           </div>
         </div>
+        <el-col :span="24" class="text">
+          <span></span>
+          <span @click="toBack">返回首页</span>
+        </el-col>
       </el-form>
     </div>
   </div>
@@ -169,6 +173,10 @@ const toLogin = () => {
 const toAgree = () => {
   dialog.value = !dialog.value
 }
+// 返回首页
+const toBack = () => {
+  router.push({ path: '/' })
+}
 </script>
 <style scoped lang="scss">
 .register {

+ 1 - 1
src/views/thirteen/index.vue

@@ -21,7 +21,7 @@
             <div class="other_3">
               <div class="other_list" v-for="(tag, indexs) in item.list" :key="indexs">
                 <el-image class="image" :src="getUrl(tag.file)" fit="fill" />
-                <div class="title">{{ tag.name || '暂无标题' }}</div>
+                <div class="title textOne">{{ tag.name || '暂无标题' }}</div>
               </div>
             </div>
           </div>