bug fix and performance improvements

This commit is contained in:
2023-07-19 15:13:25 +08:00
parent 1dffb878cd
commit 0f582dec46
25 changed files with 463 additions and 137 deletions

View File

@ -0,0 +1,12 @@
import request from "@/utils/request";
/**
* 获取经纪人统计数据
* @return {*}
*/
export const getBrokerStatistic = () => {
return request({
url: "/app/broker/statistic",
method: "get",
});
};

9
src/api/common.js Normal file
View File

@ -0,0 +1,9 @@
import request from "@/utils/request";
export const upload = (data) => {
return request({
url: "/common/upload",
method: "post",
data: data,
});
};

View File

@ -57,6 +57,7 @@ export function getCodeImg() {
timeout: 20000,
});
}
// 重置密码
export function resetPassword() {
return request({
@ -68,3 +69,12 @@ export function resetPassword() {
timeout: 20000,
});
}
// 修改用户头像
export function updateAvatar(data) {
return request({
url: "/app/updateAvatar",
method: "put",
data: data,
});
}

View File

@ -858,7 +858,7 @@ export const agentRoutes = [
children: [
{
path: "index",
component: () => import("@/views/admin/research/index"),
component: () => import("@/views/admin/agent/index"),
name: "Index",
meta: { title: "首页", icon: "dashboard", affix: true },
},
@ -918,6 +918,7 @@ export const agentRoutes = [
component: () =>
import("@/views/admin/agent/service/matching-demand/index.vue"),
name: "EnterpriseDemandMatch",
hidden: true,
meta: { title: "企业需求匹配", icon: "list" },
},
{

View File

@ -97,4 +97,27 @@ const submitExpertForm = async () => {
getBasicInfo();
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
//p {
// font-size: 18px;
//}
//
//:deep(.el-form-item__label) {
// font-size: 18px;
//}
//
//:deep(.el-input ) {
// font-size: 18px;
//}
//
//:deep(.el-textarea) {
// font-size: 18px;
//}
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -159,7 +159,7 @@ getList();
<right-toolbar v-model:show-search="showSearch" @query-table="getList" />
</el-row>
<!-- 表格数据-->
<el-table v-loading="loading" :data="tableData">
<el-table size="large" v-loading="loading" :data="tableData">
<el-table-column
align="center"
label="订单号"
@ -198,7 +198,6 @@ getList();
<template #default="{ row }">
<el-button
:disabled="row.status !== '0'"
size="small"
type="text"
@click="handleApplyInvoice(row)"
>发票申请
@ -254,4 +253,11 @@ getList();
</div>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -92,7 +92,7 @@ const getById = (id) => {};
</el-form-item>
</el-form>
<!-- element plus 表格 , :订单号,企业名称,所属领域,会员等级,会员金额,购买会员时间,操作-->
<el-table :data="tableData" class="withdraw-table">
<el-table size="large" :data="tableData" class="withdraw-table">
<el-table-column label="订单号" prop="id" width="180"></el-table-column>
<el-table-column
label="企业名称"
@ -121,7 +121,7 @@ const getById = (id) => {};
></el-table-column>
<el-table-column label="操作" width="180">
<template #default="{ row }">
<el-button size="small" type="primary" @click="goBack(row.id)"
<el-button type="primary" @click="goBack(row.id)"
>查看详情
</el-button>
</template>
@ -137,4 +137,11 @@ const getById = (id) => {};
</div>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -48,7 +48,7 @@ const handleQuery = () => {
</el-form>
<!-- el-radio-group 状态切换, 已审批和待审批 -->
<el-radio-group v-model="queryParams.status" size="small" style="width: 100%">
<el-radio-group v-model="queryParams.status" style="width: 100%">
<el-radio label="已审批" value="1" />
<el-radio label="待审批" value="2" />
</el-radio-group>
@ -56,7 +56,7 @@ const handleQuery = () => {
<h2 style="font-weight: bold">提现金额 : {{ 312312 }}¥</h2>
<!--提现记录表格 element-plus -->
<el-table :data="tableData" class="withdraw-table">
<el-table size="large" :data="tableData" class="withdraw-table">
<el-table-column
label="提现金额"
prop="amount"
@ -72,9 +72,7 @@ const handleQuery = () => {
<el-table-column label="操作" prop="action" width="150">
<template #default="{ row }">
<!--删除-->
<el-button size="small" type="text" @click="deleteRecord(row)"
>删除
</el-button>
<el-button type="text" @click="deleteRecord(row)">删除 </el-button>
</template>
</el-table-column>
</el-table>
@ -84,4 +82,10 @@ const handleQuery = () => {
.withdraw-table {
margin-top: 10px;
}
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -53,7 +53,7 @@ const handleDelete = (id) => {};
<el-button @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData">
<el-table size="large" :data="tableData">
<el-table-column label="Name" prop="name" />
<el-table-column label="Age" prop="age" />
<el-table-column label="Address" prop="address" />
@ -75,4 +75,11 @@ const handleDelete = (id) => {};
</div>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -40,4 +40,11 @@ const handleSave = () => {};
</div>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -0,0 +1,43 @@
<script setup>
import StatisticsPanel from "@/views/components/StatisticsPanel.vue";
import { getBrokerStatistic } from "@/api/admin/agent/home";
import { ref } from "vue";
const statisticsList = ref([]);
const loadStatistics = async () => {
const { data } = await getBrokerStatistic();
statisticsList.value = [
{
label: "企业数量",
value: data?.enterpriseCount ?? 0,
unit: "家",
},
{
label: "正在服务需求数",
value: data?.runDemandCount ?? 0,
unit: "个",
},
{
label: "订单总数",
value: data?.orderTotal ?? 0,
unit: "元",
},
{
// demandCount
label: "需求总数",
value: data?.demandCount ?? 0,
unit: "个",
},
];
};
loadStatistics();
</script>
<template>
<div class="app-container">
<statistics-panel :list="statisticsList" />
</div>
</template>
<style lang="scss" scoped></style>

View File

@ -8,13 +8,14 @@ import {
listBrokerEnterprise,
} from "@/api/admin/agent/service/enterprise";
import { ElMessage, ElMessageBox } from "element-plus";
import { useRouter } from "vue-router";
const router = useRouter();
const dataList = ref([]);
const loading = ref(true);
const total = ref(0);
const showSearch = ref(true);
const showDialog = ref();
const showDialog = ref(false);
const queryRef = ref();
const fieldRef = ref();
const formRef = ref();
@ -139,22 +140,15 @@ getList();
v-model="queryParams.enterpriseName"
clearable
placeholder="请输入企业名称"
size="small"
@keyup.enter.prevent="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
icon="Search"
size="small"
type="primary"
@click="handleQuery"
<el-button icon="Search" type="primary" @click="handleQuery"
>搜索
</el-button>
<el-button icon="Refresh" size="small" @click="resetQuery"
>重置
</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
@ -165,7 +159,7 @@ getList();
></right-toolbar>
</el-row>
<el-table :data="dataList">
<el-table :data="dataList" size="large">
<el-table-column align="center" label="企业名称" prop="enterpriseName" />
<el-table-column align="center" label="所属领域" prop="industryStr" />
<el-table-column align="center" label="需求数量" prop="demandCount" />
@ -184,19 +178,18 @@ getList();
{{ dayjs(row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
<el-table-column align="center" label="">
<el-table-column align="center" label="操作">
<template #default="{ row }">
<el-button
link
size="small"
type="text"
@click="handleTechDemand(row.enterpriseId)"
>技术需求管理</el-button
>
<el-button link size="small" type="text">成果管理</el-button>
<el-button link size="small" type="text" @click="handleDelete(row.id)"
>删除</el-button
>
>技术需求管理
</el-button>
<el-button link type="text">成果管理</el-button>
<el-button link type="text" @click="handleDelete(row.id)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -225,4 +218,11 @@ getList();
</div>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -349,4 +349,10 @@ onMounted(() => {
width: 100%;
}
}
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -78,7 +78,7 @@ if (route.query.id) {
></right-toolbar>
</el-row>
<el-table :data="dataList">
<el-table size="large" :data="dataList">
<!-- 编号 -->
<el-table-column align="center" label="编号" prop="id" />
<el-table-column align="center" label="需求名称" prop="title" />
@ -97,11 +97,11 @@ if (route.query.id) {
</el-table-column>
<el-table-column align="center" label="">
<template #default="{ row }">
<el-button size="small" type="text">删除</el-button>
<el-button size="small" type="text" @click="handleResults(row)"
<el-button type="text">删除</el-button>
<el-button type="text" @click="handleResults(row)"
>查看匹配结果</el-button
>
<el-button size="small" type="text" @click="handleUpdateStatus(row)"
<el-button type="text" @click="handleUpdateStatus(row)"
>更新状态
</el-button>
</template>
@ -117,4 +117,11 @@ if (route.query.id) {
</div>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -288,4 +288,10 @@ if (route.query.id) {
display: flex;
justify-content: end;
}
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -229,4 +229,10 @@ onMounted(() => {
width: 100%;
}
}
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -90,6 +90,8 @@ const cancel = () => {
reset();
showDialog.value = false;
};
getList();
</script>
<template>
@ -105,42 +107,41 @@ const cancel = () => {
v-model="queryParams.title"
clearable
placeholder="请输入企业名称"
size="small"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
icon="Search"
size="small"
type="primary"
@click="handleQuery"
<el-button icon="Search" type="primary" @click="handleQuery"
>搜索
</el-button>
<el-button icon="Refresh" size="small" @click="resetQuery"
>重置
</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="dataList">
<el-table-column align="center" label="企业名称" prop="name" />
<el-table-column align="center" label="所属领域" prop="name" />
<el-table-column align="center" label="需求数量" prop="name" />
<el-table-column align="center" label="正在服务需求数" prop="name" />
<el-table-column align="center" label="已完成需求数" prop="name" />
<el-table-column align="center" label="添加时间" prop="name">
<el-table :data="dataList" size="large">
<el-table-column align="center" label="企业名称" prop="enterpriseName" />
<el-table-column align="center" label="所属领域" prop="industryStr" />
<el-table-column align="center" label="需求数量" prop="demandCount" />
<el-table-column
align="center"
label="正在服务需求数"
prop="runDemandCount"
/>
<el-table-column
align="center"
label="已完成需求数"
prop="completeDemandCount"
/>
<el-table-column align="center" label="添加时间">
<template #default="{ row }">
{{ dayjs(row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template #default="{ row }">
<el-button link size="small" type="primary" @click=""
>查看详情</el-button
>
<el-button link size="small" type="primary">承接需求</el-button>
<el-button link type="primary" @click="">查看详情</el-button>
<el-button link type="primary">承接需求</el-button>
</template>
</el-table-column>
</el-table>
@ -172,4 +173,11 @@ const cancel = () => {
</div>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
//:deep(.el-table--large) {
//font-size: 18px;
//th {
//font-size: 18px;
//}
//}
</style>

View File

@ -36,6 +36,8 @@
>
<el-button class="x_btns">创新币充值</el-button>
</div> -->
<!-- <statistics-panel :list="statisticsList"/>-->
<el-card style="margin-top: 20px">
<template #header>
<div>快捷功能</div>
@ -104,6 +106,7 @@ import { reactive, ref, toRefs } from "vue";
import { getInfo } from "@/api/login";
import { useRouter } from "vue-router";
import { Box, Help, Goods } from "@element-plus/icons-vue";
import StatisticsPanel from "@/views/components/StatisticsPanel.vue";
const router = useRouter();
const flag = ref(false);
// const vip

View File

@ -1,29 +1,5 @@
<template>
<div class="app-container">
<!-- <div class="card-panel surplus-currency" :class="flag ? 'vip-box' : ''">
<div class="_tit">
<span style="visibility: hidden"> 会员banner图 </span>
<div class="fr" v-if="flag">
<div class="text-right">续期</div>
<div>升级VIP</div>
</div>
<div class="text-right" style="margin-top: 50px" v-if="flag">
会员剩余天数89天
</div>
</div>
<span class="pointer" style="font-size: 14px" v-if="flag">
查看会员权益
</span>
<p class="text-center pointer" v-else>开通VIP</p>
</div> -->
<!--
<div class="card-panel surplus-currency">
<span style="margin-right: 50px; font-size: 16px; font-weight: 700"
>剩余创新币98</span
>
<el-button class="x_btns">创新币充值</el-button>
</div> -->
<el-card style="margin-top: 20px">
<template #header>
<div>快捷功能</div>
@ -61,11 +37,13 @@ const flag = ref(true);
:deep(el-card__header) {
padding-top: 0;
padding-bottom: 0;
div {
height: 40px;
line-height: 40px;
}
}
.surplus-currency {
background-image: url("@/assets/index_banner.png");
margin-bottom: 20px;
@ -73,27 +51,33 @@ const flag = ref(true);
color: white;
background-color: #f2f2f2;
padding: 20px 50px;
._tit {
font-size: 24px;
font-weight: 700;
color: #bebebe;
div {
font-size: 18px;
// color: #000;
}
}
}
.vip-box {
height: auto;
// background-color: yellow;
}
.menu-item {
display: flex;
flex-direction: column;
align-items: center;
:deep(.el-avatar--icon) {
background-color: #409eff;
}
.title {
margin-top: 20px;
}

View File

@ -1,7 +1,35 @@
<script setup></script>
<script setup>
import StatisticsPanel from "@/views/components/StatisticsPanel.vue";
import { ref } from "vue";
const statisticsList = ref([
{
label: "专利数量",
value: 47,
unit: "项",
},
{
label: "成果数量",
value: 17,
unit: "个",
},
{
label: "需求数量",
value: 11,
unit: "个",
},
{
label: "论文数量",
value: 46,
unit: "篇",
},
]);
</script>
<template>
<div class="app-container">实验室后台</div>
<div class="app-container">
<statistics-panel :list="statisticsList" />
</div>
</template>
<style lang="scss" scoped></style>

View File

@ -1,7 +1,35 @@
<script setup></script>
<script setup>
import StatisticsPanel from "@/views/components/StatisticsPanel.vue";
import { ref } from "vue";
const statisticsList = ref([
{
label: "专利数量",
value: 32,
unit: "项",
},
{
label: "成果数量",
value: 13,
unit: "个",
},
{
label: "专家数量",
value: 1,
unit: "位",
},
{
label: "实验室数量",
value: 6,
unit: "家",
},
]);
</script>
<template>
<div class="app-container">研究机构后台</div>
<div class="app-container">
<statistics-panel :list="statisticsList" />
</div>
</template>
<style lang="scss" scoped></style>

View File

@ -16,6 +16,17 @@
</el-col>
</el-row>
<el-row v-if="isAdd">
<el-col :span="24">
<el-form-item label="所属院所或单位" prop="school">
<el-input
v-model="modelValue.school"
placeholder="请输入所属院所或单位"
/>
</el-form-item>
</el-col>
</el-row>
<!--FIXME:-->
<el-row v-if="isAdd && false">
<el-col :span="24">
@ -28,18 +39,16 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="isAdd">
<el-row>
<el-col :span="24">
<el-form-item label="所属院所或单位" prop="school">
<el-form-item label="实验室网站:">
<el-input
v-model="modelValue.school"
placeholder="请输入所属院所或单位"
/>
v-model="modelValue.url"
placeholder="请输入实验室网站"
></el-input>
</el-form-item>
</el-col>
</el-row>
<FieldOptions
ref="fieldFormRef"
v-model="modelValue"
@ -54,33 +63,23 @@
placeholder="应用场景关键词+技术产品关键词"
title="关键词"
/>
<el-row>
<el-col :span="24">
<el-form-item label="实验室网站:">
<el-input
v-model="modelValue.url"
placeholder="请输入实验室网站"
></el-input>
</el-form-item>
</el-col>
</el-row>
<CityOptions
ref="cityFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
/>
<!-- <CityOptions-->
<!-- ref="cityFormRef"-->
<!-- v-model="modelValue"-->
<!-- :labelWidth="labelWidth"-->
<!-- />-->
<el-row>
<el-col :span="24">
<el-form-item label="详细地址:">
<el-input
v-model="modelValue.address"
placeholder="请输入详细地址"
></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="详细地址:">-->
<!-- <el-input-->
<!-- v-model="modelValue.address"-->
<!-- placeholder="请输入详细地址"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<InputBoxAdd
ref="directionsFormRef"
v-model="modelValue"
@ -104,7 +103,7 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="科研项目" prop="researchProject">
<el-form-item label="承担科研项目情况" prop="researchProject">
<el-input
v-model="modelValue.researchProject"
:autosize="{ minRows: 4 }"
@ -128,7 +127,7 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="t('webContact.phone')" prop="phone">
<el-form-item label="联系电话" prop="phone">
<el-input
v-model="modelValue.phone"
:maxlength="11"
@ -150,11 +149,23 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="核心成员及简介" prop="member">
<WangEditor
ref="memberRef"
v-model="modelValue.member"
minHeight="320px"
@blur="formRef.validateField(`member`)"
/>
<!-- @click.native="handleEditAble" -->
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script setup>
import Editor from "@/components/WangEditor";
import CityOptions from "@/views/components/CityOptions";
import FieldOptions from "@/views/components/FieldOptions";
import InputBoxAdd from "@/views/components/InputBoxAdd";
import { reactive, ref, toRefs } from "vue";

View File

@ -0,0 +1,93 @@
<script setup>
const colors = ["#31b48d", "#38a1f2", "#7538c7", "#3b67a4"];
const prop = defineProps({
// 统计数据列表
list: {
type: Array,
default: () => [],
},
});
</script>
<template>
<div class="statistics-panel">
<div
v-for="(item, index) in list"
:style="{
backgroundColor: colors[index % colors.length],
}"
class="statistics-item"
>
<div class="left">
<div class="label">
{{ item.label }}
</div>
<div class="value">
{{ item.value }}
</div>
<div class="unit">
{{ item.unit }}
</div>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.statistics-panel {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.statistics-item {
width: 24%;
height: 140px;
margin-bottom: 20px;
border-radius: 5px;
background-color: #fff;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
padding: 20px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 14px;
color: #fff;
position: relative;
.left {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.label {
font-size: 16px;
//color: #333;
//margin-bottom: 10px;
}
.value {
font-size: 24px;
//color: #333;
font-weight: bold;
}
.unit {
font-size: 16px;
//color: #333;
}
}
.icon {
position: absolute;
top: 10px;
right: 10px;
font-size: 20px;
//color: #333;
cursor: pointer;
}
}
}
</style>

View File

@ -69,12 +69,13 @@
<script setup>
import "vue-cropper/dist/index.css";
import { VueCropper } from "vue-cropper";
import { uploadAvatar } from "@/api/system/user";
import useUserStore from "@/store/modules/user";
import { upload } from "@/api/common";
import { updateAvatar } from "@/api/login";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload");
const open = ref(false);
const visible = ref(false);
const title = ref("修改头像");
@ -137,14 +138,30 @@ function beforeUpload(file) {
function uploadImg() {
proxy.$refs.cropper.getCropBlob((data) => {
let formData = new FormData();
formData.append("avatarfile", data);
uploadAvatar(formData).then((response) => {
open.value = false;
options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl;
userStore.avatar = options.img;
proxy.$modal.msgSuccess("修改成功");
visible.value = false;
});
formData.append("file", data);
upload(formData)
.then((uploadResp) => {
console.log(uploadResp);
return uploadResp.url;
})
.then((url) => {
console.log(url);
updateAvatar({
avatar: url,
});
open.value = false;
options.img = url;
userStore.avatar = url;
proxy.$modal.msgSuccess("修改成功");
visible.value = false;
});
// uploadAvatar(formData).then((response) => {
// open.value = false;
// options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl;
// userStore.avatar = options.img;
// proxy.$modal.msgSuccess("修改成功");
// visible.value = false;
// });
});
}

View File

@ -31,9 +31,9 @@ export default defineConfig(({ mode, command }) => {
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
"/dev-api": {
target: "http://101.34.131.16:1618",
// target: "http://101.34.131.16:1618",
// target: "http://192.168.0.201:1618",
// target: "http://101.34.131.16:1618",
target: "http://192.168.0.201:1618",
// target: 'http://172.18.3.127:1618',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, ""),