bugfix
This commit is contained in:
19
src/api/admin/laboratory/account.js
Normal file
19
src/api/admin/laboratory/account.js
Normal file
@ -0,0 +1,19 @@
|
||||
// 获取用户详细信息
|
||||
import request from "@/utils/request";
|
||||
|
||||
/*获取实验室基本信息*/
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: "/app/laboratory/info",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 实验室信息修改
|
||||
export const updateLaboratory = (data) => {
|
||||
return request({
|
||||
url: "/app/laboratory/updateLaboratory",
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
};
|
40
src/api/admin/laboratory/patent.js
Normal file
40
src/api/admin/laboratory/patent.js
Normal file
@ -0,0 +1,40 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 实验室专利列表
|
||||
export const labPatentList = (params) => {
|
||||
return request({
|
||||
url: `/app/laboratory/patent/list`,
|
||||
method: "GET",
|
||||
params
|
||||
});
|
||||
};
|
||||
|
||||
// 实验室新增专利
|
||||
export const insertLabPatent = (data) => {
|
||||
return request({
|
||||
url: `/app/laboratory/patent`,
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 实验室修改专利
|
||||
* @param data
|
||||
* @return {*}
|
||||
*/
|
||||
export const updateLabPatent = (data) => {
|
||||
return request({
|
||||
url: `/app/laboratory/patent`,
|
||||
method: "PUT",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteLabPatentByIds = (ids) => {
|
||||
return request({
|
||||
url: `/app/laboratory/patent/${ids}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
};
|
@ -2,75 +2,82 @@ import request from "@/utils/request";
|
||||
|
||||
// 首页每一项
|
||||
export function identity() {
|
||||
return request({
|
||||
url: "/app/getRoleStatus",
|
||||
});
|
||||
return request({
|
||||
url: "/app/getRoleStatus",
|
||||
});
|
||||
}
|
||||
|
||||
// 当前状态
|
||||
export function settled() {
|
||||
return request({
|
||||
url: "/enterprise/v1/settled",
|
||||
});
|
||||
return request({
|
||||
url: "/enterprise/v1/settled",
|
||||
});
|
||||
}
|
||||
|
||||
// 当前状态切换
|
||||
export function identitySwitch(data) {
|
||||
return request({
|
||||
url: "/enterprise/v1/user/identity/switch",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
return request({
|
||||
url: "/enterprise/v1/user/identity/switch",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 申请企业入住
|
||||
export function insertEnterprise(data) {
|
||||
return request({
|
||||
url: "/app/insertEnterprise",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
return request({
|
||||
url: "/app/insertEnterprise",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 专家入驻
|
||||
export function insertCasExpert(data) {
|
||||
return request({
|
||||
url: "/app/expert/insertCasExpert",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
return request({
|
||||
url: "/app/expert/insertCasExpert",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 所属单位
|
||||
export function researchSelect() {
|
||||
return request({
|
||||
url: "/enterprise/v1/manage/research/select",
|
||||
});
|
||||
return request({
|
||||
url: "/enterprise/v1/manage/research/select",
|
||||
});
|
||||
}
|
||||
|
||||
// 所属单位>实验室
|
||||
export function laboratorySelect() {
|
||||
return request({
|
||||
url: "/enterprise/v1/manage/research/laboratory",
|
||||
});
|
||||
return request({
|
||||
url: "/enterprise/v1/manage/research/laboratory",
|
||||
});
|
||||
}
|
||||
|
||||
// 科研机构入驻
|
||||
export function research(data) {
|
||||
return request({
|
||||
url: "/enterprise/v1/settled/research",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
return request({
|
||||
url: "/enterprise/v1/settled/research",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 实验室入驻
|
||||
export function laboratory(data) {
|
||||
return request({
|
||||
url: "/enterprise/v1/settled/laboratory",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
export function insertLaboratory(data) {
|
||||
return request({
|
||||
url: "/app/laboratory/insertLaboratory",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 实验室入驻
|
||||
export function agent(data) {
|
||||
return request({
|
||||
url: "/enterprise/v1/settled/agent",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
return request({
|
||||
url: "/enterprise/v1/settled/agent",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
1390
src/router/index.js
1390
src/router/index.js
File diff suppressed because it is too large
Load Diff
@ -1,172 +1,133 @@
|
||||
import auth from "@/plugins/auth";
|
||||
import router, { constantRoutes, dynamicRoutes, enterpriseRoutes, expertRoutes } from "@/router";
|
||||
import { getRouters } from "@/api/menu";
|
||||
import {constantRoutes, enterpriseRoutes, expertRoutes, laboratoryRoutes} from "@/router";
|
||||
import Layout from "@/layout/index";
|
||||
import ParentView from "@/components/ParentView";
|
||||
import InnerLink from "@/layout/components/InnerLink";
|
||||
// import { enterpriseRoutes, expertRoutes } from "@/router";
|
||||
// import { expertRoutes } from "../../router";
|
||||
|
||||
// 匹配views里面所有的.vue文件
|
||||
const modules = import.meta.glob("./../../views/**/*.vue");
|
||||
|
||||
const usePermissionStore = defineStore("permission", {
|
||||
state: () => ({
|
||||
routes: [],
|
||||
addRoutes: [],
|
||||
defaultRoutes: [],
|
||||
topbarRouters: [],
|
||||
sidebarRouters: [],
|
||||
}),
|
||||
actions: {
|
||||
setRoutes(routes) {
|
||||
this.addRoutes = routes;
|
||||
this.routes = constantRoutes.concat(routes);
|
||||
// console.log(routes);
|
||||
state: () => ({
|
||||
routes: [],
|
||||
addRoutes: [],
|
||||
defaultRoutes: [],
|
||||
topbarRouters: [],
|
||||
sidebarRouters: [],
|
||||
}),
|
||||
actions: {
|
||||
setRoutes(routes) {
|
||||
this.addRoutes = routes;
|
||||
this.routes = constantRoutes.concat(routes);
|
||||
},
|
||||
setDefaultRoutes(routes) {
|
||||
this.defaultRoutes = constantRoutes.concat(routes);
|
||||
},
|
||||
setTopbarRoutes(routes) {
|
||||
this.topbarRouters = routes;
|
||||
},
|
||||
setSidebarRouters(routes) {
|
||||
this.sidebarRouters = routes;
|
||||
},
|
||||
generateRoutes(roles) {
|
||||
return new Promise((resolve) => {
|
||||
console.log(roles)
|
||||
let routesList = [];
|
||||
if (roles === "1") {
|
||||
routesList = enterpriseRoutes;
|
||||
} else if (roles === "2") {
|
||||
routesList = expertRoutes;
|
||||
} else if (roles === "3") {
|
||||
routesList = laboratoryRoutes
|
||||
}
|
||||
this.setRoutes(routesList);
|
||||
this.setSidebarRouters(constantRoutes.concat(routesList));
|
||||
this.setDefaultRoutes(routesList);
|
||||
this.setTopbarRoutes(routesList);
|
||||
resolve(routesList);
|
||||
});
|
||||
},
|
||||
},
|
||||
setDefaultRoutes(routes) {
|
||||
this.defaultRoutes = constantRoutes.concat(routes);
|
||||
},
|
||||
setTopbarRoutes(routes) {
|
||||
this.topbarRouters = routes;
|
||||
},
|
||||
setSidebarRouters(routes) {
|
||||
this.sidebarRouters = routes;
|
||||
},
|
||||
generateRoutes(roles) {
|
||||
return new Promise((resolve) => {
|
||||
let routesList = [];
|
||||
if (roles == 1) {
|
||||
routesList = enterpriseRoutes;
|
||||
} else if (roles == 2) {
|
||||
routesList = expertRoutes;
|
||||
// routesList = [];
|
||||
}
|
||||
// console.log(routesList);
|
||||
// const sdata = JSON.parse(JSON.stringify(routesList));
|
||||
// const rdata = JSON.parse(JSON.stringify(routesList));
|
||||
// const defaultData = JSON.parse(JSON.stringify(routesList));
|
||||
// const sidebarRoutes = filterAsyncRouter(sdata);
|
||||
// const rewriteRoutes = filterAsyncRouter(rdata, false, true);
|
||||
// const defaultRoutes = filterAsyncRouter(defaultData);
|
||||
// const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
|
||||
// console.log(
|
||||
// sdata,
|
||||
// rdata,
|
||||
// defaultData,
|
||||
// sidebarRoutes,
|
||||
// rewriteRoutes,
|
||||
// defaultRoutes,
|
||||
// asyncRoutes
|
||||
// );
|
||||
// asyncRoutes.forEach((route) => {
|
||||
// router.addRoute(route);
|
||||
// });
|
||||
this.setRoutes(routesList);
|
||||
this.setSidebarRouters(constantRoutes.concat(routesList));
|
||||
this.setDefaultRoutes(routesList);
|
||||
this.setTopbarRoutes(routesList);
|
||||
resolve(routesList);
|
||||
// 向后端请求路由数据
|
||||
// getRouters().then(res => {
|
||||
// console.log(res);
|
||||
// const sdata = JSON.parse(JSON.stringify(res.data))
|
||||
// const rdata = JSON.parse(JSON.stringify(res.data))
|
||||
// const defaultData = JSON.parse(JSON.stringify(res.data))
|
||||
// const sidebarRoutes = filterAsyncRouter(sdata)
|
||||
// const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
||||
// const defaultRoutes = filterAsyncRouter(defaultData)
|
||||
// const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
|
||||
// asyncRoutes.forEach(route => { router.addRoute(route) })
|
||||
// this.setRoutes(rewriteRoutes)
|
||||
// this.setSidebarRouters(constantRoutes.concat(sidebarRoutes))
|
||||
// this.setDefaultRoutes(sidebarRoutes)
|
||||
// this.setTopbarRoutes(defaultRoutes)
|
||||
// resolve(rewriteRoutes)
|
||||
// })
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// 遍历后台传来的路由字符串,转换为组件对象
|
||||
function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
|
||||
return asyncRouterMap.filter((route) => {
|
||||
if (type && route.children) {
|
||||
route.children = filterChildren(route.children);
|
||||
}
|
||||
if (route.component) {
|
||||
// Layout ParentView 组件特殊处理
|
||||
if (route.component === "Layout") {
|
||||
route.component = Layout;
|
||||
} else if (route.component === "ParentView") {
|
||||
route.component = ParentView;
|
||||
} else if (route.component === "InnerLink") {
|
||||
route.component = InnerLink;
|
||||
} else {
|
||||
route.component = loadView(route.component);
|
||||
}
|
||||
}
|
||||
if (route.children != null && route.children && route.children.length) {
|
||||
route.children = filterAsyncRouter(route.children, route, type);
|
||||
} else {
|
||||
delete route["children"];
|
||||
delete route["redirect"];
|
||||
}
|
||||
return true;
|
||||
});
|
||||
return asyncRouterMap.filter((route) => {
|
||||
if (type && route.children) {
|
||||
route.children = filterChildren(route.children);
|
||||
}
|
||||
if (route.component) {
|
||||
// Layout ParentView 组件特殊处理
|
||||
if (route.component === "Layout") {
|
||||
route.component = Layout;
|
||||
} else if (route.component === "ParentView") {
|
||||
route.component = ParentView;
|
||||
} else if (route.component === "InnerLink") {
|
||||
route.component = InnerLink;
|
||||
} else {
|
||||
route.component = loadView(route.component);
|
||||
}
|
||||
}
|
||||
if (route.children != null && route.children && route.children.length) {
|
||||
route.children = filterAsyncRouter(route.children, route, type);
|
||||
} else {
|
||||
delete route["children"];
|
||||
delete route["redirect"];
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
function filterChildren(childrenMap, lastRouter = false) {
|
||||
var children = [];
|
||||
childrenMap.forEach((el, index) => {
|
||||
if (el.children && el.children.length) {
|
||||
if (el.component === "ParentView" && !lastRouter) {
|
||||
el.children.forEach((c) => {
|
||||
c.path = el.path + "/" + c.path;
|
||||
if (c.children && c.children.length) {
|
||||
children = children.concat(filterChildren(c.children, c));
|
||||
return;
|
||||
}
|
||||
children.push(c);
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (lastRouter) {
|
||||
el.path = lastRouter.path + "/" + el.path;
|
||||
}
|
||||
children = children.concat(el);
|
||||
});
|
||||
return children;
|
||||
var children = [];
|
||||
childrenMap.forEach((el, index) => {
|
||||
if (el.children && el.children.length) {
|
||||
if (el.component === "ParentView" && !lastRouter) {
|
||||
el.children.forEach((c) => {
|
||||
c.path = el.path + "/" + c.path;
|
||||
if (c.children && c.children.length) {
|
||||
children = children.concat(filterChildren(c.children, c));
|
||||
return;
|
||||
}
|
||||
children.push(c);
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (lastRouter) {
|
||||
el.path = lastRouter.path + "/" + el.path;
|
||||
}
|
||||
children = children.concat(el);
|
||||
});
|
||||
return children;
|
||||
}
|
||||
|
||||
// 动态路由遍历,验证是否具备权限
|
||||
export function filterDynamicRoutes(routes) {
|
||||
const res = [];
|
||||
routes.forEach((route) => {
|
||||
if (route.permissions) {
|
||||
if (auth.hasPermiOr(route.permissions)) {
|
||||
res.push(route);
|
||||
}
|
||||
} else if (route.roles) {
|
||||
if (auth.hasRoleOr(route.roles)) {
|
||||
res.push(route);
|
||||
}
|
||||
}
|
||||
});
|
||||
return res;
|
||||
const res = [];
|
||||
routes.forEach((route) => {
|
||||
if (route.permissions) {
|
||||
if (auth.hasPermiOr(route.permissions)) {
|
||||
res.push(route);
|
||||
}
|
||||
} else if (route.roles) {
|
||||
if (auth.hasRoleOr(route.roles)) {
|
||||
res.push(route);
|
||||
}
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
export const loadView = (view) => {
|
||||
let res;
|
||||
for (const path in modules) {
|
||||
const dir = path.split("views/")[1].split(".vue")[0];
|
||||
if (dir === view) {
|
||||
res = () => modules[path]();
|
||||
let res;
|
||||
for (const path in modules) {
|
||||
const dir = path.split("views/")[1].split(".vue")[0];
|
||||
if (dir === view) {
|
||||
res = () => modules[path]();
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
return res;
|
||||
};
|
||||
|
||||
export default usePermissionStore;
|
||||
|
105
src/views/admin/laboratory/account/basic-info.vue
Normal file
105
src/views/admin/laboratory/account/basic-info.vue
Normal file
@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<p><b>基本资料</b></p>
|
||||
<el-form
|
||||
ref="personFormRef"
|
||||
:model="personForm"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="姓名:" prop="nickName">
|
||||
<el-input
|
||||
v-model="personForm.nickName"
|
||||
placeholder="请输入姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机:" prop="mobile">
|
||||
<el-input
|
||||
v-model="personForm.mobile"
|
||||
placeholder="请输入手机号"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱:" prop="email">
|
||||
<el-input v-model="personForm.email" placeholder="请输入邮箱"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="职务:" prop="post">
|
||||
<el-input v-model="personForm.post" placeholder="请输入职务"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="固定电话:" prop="phone">
|
||||
<el-input
|
||||
v-model="personForm.phone"
|
||||
placeholder="请输入固定电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitPersonalInfo">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<p><b>实验室资料</b></p>
|
||||
<laboratory-form ref="labFormRef" v-model="form" :is-add="false"/>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button type="primary" @click="submitExpertForm">提交</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import LaboratoryForm from "@/views/components/LaboratoryForm";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {getInfo, updateLaboratory} from '@/api/admin/laboratory/account'
|
||||
import {ElMessage} from "element-plus";
|
||||
import {insertClientUser} from "@/api/admin/enterprise";
|
||||
|
||||
const data = reactive({
|
||||
form: {
|
||||
researchs: [],
|
||||
keywords: []
|
||||
},
|
||||
personForm: {},
|
||||
rules: {},
|
||||
personRules: {}
|
||||
})
|
||||
const {form, personForm, rules} = toRefs(data)
|
||||
const labFormRef = ref()
|
||||
const personFormRef = ref()
|
||||
const labelWidth = ref(140);
|
||||
|
||||
// 获取基础信息用于回显
|
||||
const getBasicInfo = async () => {
|
||||
const {data} = await getInfo();
|
||||
data.laboratory.researchs = data.laboratory.researchDirection?.split(",") ?? [];
|
||||
data.laboratory.keywords = data.laboratory.keyword?.split(",") ?? [];
|
||||
form.value = data.laboratory ?? {}
|
||||
personForm.value = data.user ?? {};
|
||||
};
|
||||
|
||||
const submitPersonalInfo = async () => {
|
||||
try {
|
||||
await personFormRef.value.validate();
|
||||
await insertClientUser(personForm.value);
|
||||
ElMessage.success("更新个人信息成功");
|
||||
const {data} = await getInfo();
|
||||
personForm.value = data.user ?? {};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
const submitExpertForm = async () => {
|
||||
const valid = await labFormRef.value.validateForm();
|
||||
if (valid) {
|
||||
form.value.researchDirection = form.value.researchs?.join(',') ?? null
|
||||
form.value.keyword = form.value.keywords?.join(',') ?? null
|
||||
updateLaboratory(form.value).then((res) => {
|
||||
ElMessage.success("修改成功");
|
||||
getBasicInfo()
|
||||
});
|
||||
} else {
|
||||
console.log("校验未通过");
|
||||
}
|
||||
}
|
||||
getBasicInfo();
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
13
src/views/admin/laboratory/index.vue
Normal file
13
src/views/admin/laboratory/index.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
实验室后台
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
398
src/views/admin/laboratory/research/patent/index.vue
Normal file
398
src/views/admin/laboratory/research/patent/index.vue
Normal file
@ -0,0 +1,398 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
@submit.prevent
|
||||
>
|
||||
<el-form-item label="专利名称" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
placeholder="请输入专利名称"
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
icon="Search"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索
|
||||
</el-button
|
||||
>
|
||||
<el-button icon="Refresh" size="small" @click="resetQuery"
|
||||
>重置
|
||||
</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
plain
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>新增
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- 无接口 暂时注释 -->
|
||||
<el-col v-if="false" :span="1.5">
|
||||
<router-link to="./claimPatent">
|
||||
<el-button icon="Plus" plain size="small" type="primary"
|
||||
>认领
|
||||
</el-button
|
||||
>
|
||||
</router-link>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
<el-table-column label="数据编号" prop="id"/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
label="专利名称"
|
||||
prop="title"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
label="申请号"
|
||||
prop="applyCode"
|
||||
/>
|
||||
<el-table-column label="发明人" prop="inventor"/>
|
||||
<el-table-column label="申请(专利权)人" prop="applyName"/>
|
||||
<el-table-column align="center" label="申请日期" prop="applyAt">
|
||||
<template #default="{ row }">
|
||||
<span>{{ dayjs(row.applyAt).format("YYYY-MM-DD") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
icon="Edit"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleUpdate(row)"
|
||||
>修改
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改数据配置对话框 -->
|
||||
<el-dialog v-model="open" :title="title" append-to-body width="800px">
|
||||
<el-form ref="patentRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="申请人:" prop="applyName">
|
||||
<el-input
|
||||
v-model="form.applyName"
|
||||
placeholder="请输入申请(专利权)人(多个请以 , 分割)"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人地址:" prop="applyAddress">
|
||||
<el-input
|
||||
v-model="form.applyAddress"
|
||||
placeholder="请输入申请人地址"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发明人:" prop="inventor">
|
||||
<el-input
|
||||
v-model="form.inventor"
|
||||
placeholder="请输入发明人(多个请以 , 分割)"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="专利名称:" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入专利名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请号:" prop="applyCode">
|
||||
<el-input v-model="form.applyCode" placeholder="请输入申请号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公开号:" prop="openCode">
|
||||
<el-input v-model="form.openCode" placeholder="请输入公开号"/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请日期:" prop="applyAt">
|
||||
<el-date-picker
|
||||
v-model="form.applyAt"
|
||||
placeholder="请选择申请日期"
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公开日:" prop="openAt">
|
||||
<el-date-picker
|
||||
v-model="form.openAt"
|
||||
placeholder="请选择公开日"
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专利类型:" prop="kind">
|
||||
<el-select
|
||||
v-model="form.kind"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in patentOptions"
|
||||
:key="item.key"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="IPC分类号:" prop="ipcCode">
|
||||
<el-input v-model="form.ipcCode" placeholder="请输入IPC分类号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="专利状态:" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="1">授权</el-radio>
|
||||
<el-radio label="2">实审</el-radio>
|
||||
<el-radio label="3">公开</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="摘要:" prop="description">
|
||||
<el-input
|
||||
v-model="form.description"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
placeholder="请输入摘要"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主权项:" prop="principalClaim">
|
||||
<el-input
|
||||
v-model="form.principalClaim"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
placeholder="请输入主权项"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {deleteLabPatentByIds, insertLabPatent, labPatentList, updateLabPatent} from '@/api/admin/laboratory/patent'
|
||||
import {cloneDeep} from "lodash";
|
||||
import dayjs from "dayjs";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {patentOptions} from "@/utils/parameter";
|
||||
import {useRouter} from "vue-router";
|
||||
import {getCurrentInstance, reactive, ref, toRefs} from "vue";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
|
||||
const dataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
inventor: undefined,
|
||||
},
|
||||
rules: {
|
||||
applyName: [{required: true, message: "申请人不能为空", trigger: "blur"}],
|
||||
applyAddress: [
|
||||
{required: true, message: "申请人地址不能为空", trigger: "blur"},
|
||||
],
|
||||
openCode: [{required: true, message: "公开号不能为空", trigger: "blur"}],
|
||||
openAt: [{required: true, message: "公开日不能为空", trigger: "blur"}],
|
||||
inventor: [{required: true, message: "发明人不能为空", trigger: "blur"}],
|
||||
title: [{required: true, message: "专利名称不能为空", trigger: "blur"}],
|
||||
applyCode: [{required: true, message: "申请号不能为空", trigger: "blur"}],
|
||||
applyAt: [{required: true, message: "申请日期不能为空", trigger: "blur"}],
|
||||
kind: [{required: true, message: "请选择专利类型", trigger: "change"}],
|
||||
ipcCode: [
|
||||
{required: true, message: "IPC分类号不能为空", trigger: "blur"},
|
||||
],
|
||||
status: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择专利状态",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
description: [{required: true, message: "摘要不能为空", trigger: "blur"}],
|
||||
principalClaim: [
|
||||
{required: true, message: "主权项不能为空", trigger: "blur"},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const {queryParams, form, rules} = toRefs(data);
|
||||
|
||||
const queryRef = ref();
|
||||
const patentRef = ref();
|
||||
const expertId = ref(undefined);
|
||||
|
||||
/** 查询数据列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
// const { data } = await getInfo();
|
||||
// form.value.expertId = data.casExpert.id;
|
||||
// const id = data.casExpert.id;
|
||||
// expertId.value = data.casExpert.id;
|
||||
// expertPatentList(id, queryParams.value).then((resp) => {
|
||||
// dataList.value = resp.rows;
|
||||
// total.value = resp.total;
|
||||
// loading.value = false;
|
||||
// });
|
||||
labPatentList(queryParams.value).then(resp => {
|
||||
dataList.value = resp.rows
|
||||
total.value = resp.total
|
||||
loading.value = false
|
||||
}).catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
};
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
queryRef.value.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(id) {
|
||||
ElMessageBox.confirm('是否确认删除数据编号为"' + id + '"的专利项?')
|
||||
.then(function () {
|
||||
return deleteLabPatentByIds(id);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
/** 重置新增的表单以及其他数据 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
applyName: undefined,
|
||||
applyAddress: undefined,
|
||||
inventor: undefined,
|
||||
title: undefined,
|
||||
applyCode: undefined,
|
||||
openCode: undefined,
|
||||
openAt: undefined,
|
||||
applyAt: undefined,
|
||||
kind: undefined,
|
||||
ipcCode: undefined,
|
||||
description: undefined,
|
||||
principalClaim: undefined,
|
||||
};
|
||||
proxy.resetForm("patentRef");
|
||||
}
|
||||
|
||||
/** 添加数据 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加数据";
|
||||
};
|
||||
/** 修改数据 */
|
||||
const handleUpdate = (row) => {
|
||||
reset();
|
||||
const data = cloneDeep(row);
|
||||
// patentDetail({ id }).then((res) => {
|
||||
form.value = data;
|
||||
open.value = true;
|
||||
title.value = "修改数据";
|
||||
// });
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = async () => {
|
||||
await patentRef.value.validate();
|
||||
if (form.value.id != undefined) {
|
||||
await updateLabPatent({...form.value, expertId: expertId.value});
|
||||
ElMessage.success("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
} else {
|
||||
await insertLabPatent(form.value);
|
||||
ElMessage.success("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
13
src/views/admin/research/index.vue
Normal file
13
src/views/admin/research/index.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
研究机构后台
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
239
src/views/components/AgentForm/index.vue
Normal file
239
src/views/components/AgentForm/index.vue
Normal file
@ -0,0 +1,239 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="姓名:" prop="name">
|
||||
<el-input v-model="modelValue.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="手机号:" prop="mobile">
|
||||
<el-input v-model="modelValue.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证号:" prop="id_card">
|
||||
<el-input v-model="modelValue.id_card"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作所在地:" prop="work_place">
|
||||
<el-input v-model="modelValue.work_place"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作经历:" prop="work_experience">
|
||||
<el-input
|
||||
v-model="modelValue.work_experience"
|
||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="researchsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入擅长领域"
|
||||
title="擅长领域"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证:" required>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="id_image.front">
|
||||
<ImageUpload
|
||||
v-model="modelValue.id_image.front"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">身份证人像面</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="id_image.behind">
|
||||
<ImageUpload
|
||||
v-model="modelValue.id_image.behind"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">身份证国徽面</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="id_image.hold">
|
||||
<ImageUpload
|
||||
v-model="modelValue.id_image.hold"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">手持身份证人像面</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="成果经纪资格证书:" prop="credential_image">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<ImageUpload
|
||||
v-model="modelValue.credential_image"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
import {ref} from "vue";
|
||||
|
||||
const formRef = ref()
|
||||
const researchsFormRef = ref()
|
||||
const keywordsFormRef = ref()
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
})
|
||||
const rules = {
|
||||
product: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
kind: [{required: true, message: "请选择", trigger: "change"}],
|
||||
code: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
mobile: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
id_card: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_place: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_experience: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
],
|
||||
"id_image.front": [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
"id_image.behind": [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
"id_image.hold": [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
} catch (error) {
|
||||
formValid = false;
|
||||
}
|
||||
const researchsFormValid = await researchsFormRef.value.validateForm();
|
||||
const keywordsFormValid = await keywordsFormRef.value.validateForm();
|
||||
return (
|
||||
formValid &&
|
||||
researchsFormValid &&
|
||||
keywordsFormValid
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form_title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
|
||||
:deep(.hide) {
|
||||
height: 148px;
|
||||
}
|
||||
|
||||
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -287,13 +287,7 @@ const data = reactive({
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
license: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
|
@ -1,28 +1,28 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:disabled="disabled"
|
||||
ref="formRef"
|
||||
:disabled="disabled"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属领域:" required :show-message="false">
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-form-item :show-message="false" label="所属领域:" required>
|
||||
<el-row justify="space-between" type="flex">
|
||||
<el-col :span="6">
|
||||
<el-form-item prop="industrys">
|
||||
<el-select
|
||||
v-model="fields[0]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
@change="levelIChange"
|
||||
v-model="fields[0]"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
@change="levelIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelI"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelI"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -30,33 +30,33 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="fields[1]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
:disabled="levelII.length === 0"
|
||||
@change="levelIIChange"
|
||||
v-model="fields[1]"
|
||||
:disabled="levelII.length === 0"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
@change="levelIIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="fields[2]"
|
||||
value-key="id"
|
||||
:disabled="levelIII.length === 0"
|
||||
placeholder="请选择"
|
||||
v-model="fields[2]"
|
||||
:disabled="levelIII.length === 0"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelIII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelIII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -66,12 +66,13 @@
|
||||
<!-- <el-button type="primary" @click="check">验证</el-button> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="width: 100%"></div>
|
||||
<div class="e_tag">
|
||||
<el-tag
|
||||
v-for="(tag, index) in industrysTags"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleFieldClose(index)"
|
||||
v-for="(tag, index) in industrysTags"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleFieldClose(index)"
|
||||
>
|
||||
{{ getFieldNameById(tag) }}
|
||||
<!-- <template v-if="Array.isArray(tag)">
|
||||
@ -90,11 +91,11 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup name="FieldOptions">
|
||||
<script name="FieldOptions" setup>
|
||||
// import { industry } from "@/api/config";
|
||||
import { listSysIndustry } from "@/api/config";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { toRefs, watch } from "vue";
|
||||
import {listSysIndustry} from "@/api/config";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {toRefs, watch} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
@ -107,7 +108,7 @@ const props = defineProps({
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const { modelValue, labelWidth, disabled } = toRefs(props);
|
||||
const {modelValue, labelWidth, disabled} = toRefs(props);
|
||||
const formRef = ref(null);
|
||||
const levelI = ref([]); // I级数据
|
||||
const levelII = ref([]); // II级数据
|
||||
@ -126,11 +127,11 @@ const data = reactive({
|
||||
],
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
const {rules} = toRefs(data);
|
||||
|
||||
// 获取领域树形列表
|
||||
const getIndustryTreeData = async () => {
|
||||
const { data } = await listSysIndustry();
|
||||
const {data} = await listSysIndustry();
|
||||
levelI.value = data;
|
||||
};
|
||||
|
||||
|
251
src/views/components/LaboratoryForm/index.vue
Normal file
251
src/views/components/LaboratoryForm/index.vue
Normal file
@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="实验室名称" prop="name">
|
||||
<!--:disabled="isAdd"-->
|
||||
<el-input v-model="modelValue.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="组织机构代码:" prop="code">
|
||||
<el-row justify="space-between" type="flex">
|
||||
<el-col :span="20">
|
||||
<!--:disabled="isAdd"-->
|
||||
<el-input v-model="modelValue.code"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<!-- :disabled="isAdd"-->
|
||||
<el-button type="primary" @click=""
|
||||
>查找
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</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>
|
||||
|
||||
<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.url"
|
||||
placeholder="请输入实验室网站"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldOptions
|
||||
ref="fieldFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="directionsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入研究方向"
|
||||
title="研究方向"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="实验室简介" prop="introduction">
|
||||
<editor
|
||||
ref="introduceRef"
|
||||
v-model="modelValue.introduction"
|
||||
:minHeight="150"
|
||||
/>
|
||||
</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";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
})
|
||||
|
||||
const formRef = ref()
|
||||
const cityFormRef = ref()
|
||||
const fieldFormRef = ref()
|
||||
const keywordsFormRef = ref()
|
||||
const directionsFormRef = ref()
|
||||
const introduceRef = ref()
|
||||
|
||||
const data = reactive({
|
||||
rules: {
|
||||
product: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
kind: [{required: true, message: "请选择", trigger: "change"}],
|
||||
code: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
mobile: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
researchId: [{required: true, message: "请选择", trigger: "change"}],
|
||||
tenantId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
school: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
education: [{required: true, message: "请选择", trigger: "change"}],
|
||||
major: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
job: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
title: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_at: [
|
||||
{
|
||||
required: true,
|
||||
message: "从业时间不能为空",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
license: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
introduction: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
}
|
||||
});
|
||||
const {rules} = toRefs(data)
|
||||
const submitForm = () => {
|
||||
let flag = false;
|
||||
this.$refs["formRef"].validate((valid) => {
|
||||
const cityForm = this.$refs.cityForm.submitForm(); // 城市
|
||||
const fieldForm = this.$refs.fieldForm.submitForm();
|
||||
const keywordsForm = this.$refs.keywordsForm.submitForm();
|
||||
const directionsForm = this.$refs.directionsForm.submitForm();
|
||||
if (valid && cityForm && fieldForm && keywordsForm && directionsForm) {
|
||||
flag = !flag;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
}
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
} catch (error) {
|
||||
formValid = false;
|
||||
}
|
||||
const cityFormValid = await cityFormRef.value.validateForm(); // 城市选择表单验证
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm(); // 领域选择表单验证
|
||||
const keywordsFormValid = await keywordsFormRef.value.validateForm(); // 关键词表单验证
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm(); // 研究方向表单验证
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
keywordsFormValid &&
|
||||
directionsFormValid
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
|
||||
// researchSelect().then(({data}) => {
|
||||
// researchOptions.value = data;
|
||||
// });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form_title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -237,7 +237,6 @@ const data = reactive({
|
||||
// education: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
// major: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
// job: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
title: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
work_at: [
|
||||
{
|
||||
required: true,
|
||||
|
203
src/views/components/ResearchForm/index.vue
Normal file
203
src/views/components/ResearchForm/index.vue
Normal file
@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构logo:">
|
||||
<ImageUpload v-model="modelValue.image" :limit="1"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构名称" prop="name">
|
||||
<el-input v-model="modelValue.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="组织机构代码:" prop="code">
|
||||
<el-row justify="space-between" type="flex">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="modelValue.code"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" @click="">查找</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<CityOptions ref="cityFormRef" v-model="modelValue" :labelWidth="labelWidth"/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详细地址:">
|
||||
<el-input v-model="modelValue.address"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldSingle
|
||||
ref="fieldFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="directionsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入研究方向"
|
||||
title="研究方向"
|
||||
/>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="营业执照:" prop="license">
|
||||
<ImageUpload
|
||||
v-model="modelValue.license"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构简介" prop="introduce">
|
||||
<editor
|
||||
ref="introduceRef"
|
||||
v-model="modelValue.introduce"
|
||||
:minHeight="150"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import Editor from '@/components/WangEditor'
|
||||
import CityOptions from "../CityOptions";
|
||||
import FieldSingle from "../FieldSingle";
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
import {ref} from "vue";
|
||||
|
||||
const formRef = ref()
|
||||
const cityFormRef = ref()
|
||||
const fieldFormRef = ref()
|
||||
const directionsFormRef = ref()
|
||||
const introduceRef = ref()
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
})
|
||||
const rules = {
|
||||
product: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
kind: [{required: true, message: "请选择", trigger: "change"}],
|
||||
code: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
mobile: [
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
research_id: [{required: true, message: "请选择", trigger: "change"}],
|
||||
tenant_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
school: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
education: [{required: true, message: "请选择", trigger: "change"}],
|
||||
major: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
job: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
title: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_at: [
|
||||
{
|
||||
required: true,
|
||||
message: "从业时间不能为空",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
license: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
introduce: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid;
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
} catch (error) {
|
||||
formValid = false;
|
||||
}
|
||||
const cityFormValid = await cityFormRef.value.validateForm();
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm();
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm();
|
||||
const introduceValid = await introduceRef.value.validateForm();
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
directionsFormValid &&
|
||||
introduceValid
|
||||
);
|
||||
}
|
||||
defineExpose({
|
||||
validateForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form_title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
41
src/views/identity/agent.vue
Normal file
41
src/views/identity/agent.vue
Normal file
@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto">
|
||||
<agent-form ref="agentFormRef" v-model="form" is-add/>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button @click="$router.go(-1)">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import AgentForm from '@/views/components/AgentForm'
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120
|
||||
}
|
||||
})
|
||||
const data = reactive({
|
||||
form: {
|
||||
industrys: [],
|
||||
id_image: {}
|
||||
}
|
||||
})
|
||||
const {form} = toRefs(data)
|
||||
const agentFormRef = ref()
|
||||
const submitForm = async () => {
|
||||
if (!agentFormRef.value) return
|
||||
const valid = await agentFormRef.value.validateForm()
|
||||
if (valid) {
|
||||
// TODO: submit laboratory
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
@ -15,10 +15,11 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { insertCasExpert } from "@/api/identity/index";
|
||||
import { insertCasExpert } from "@/api/identity";
|
||||
import ExpertForm from "@/views/components/ExpertForm";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
import {reactive, ref} from "vue";
|
||||
|
||||
const router = useRouter();
|
||||
const labelWidth = 140;
|
||||
|
@ -1,49 +1,52 @@
|
||||
<template>
|
||||
<div class="app-container" v-if="identityList.length">
|
||||
<div v-if="identityList.length" class="app-container">
|
||||
<el-row>
|
||||
<el-col :span="2">
|
||||
<el-button size="small" :icon="ArrowLeftBold" round @click="backToHome"
|
||||
>返回</el-button
|
||||
></el-col
|
||||
<el-button :icon="ArrowLeftBold" plain round size="small" type="primary" @click="backToHome"
|
||||
>返回
|
||||
</el-button
|
||||
>
|
||||
</el-col
|
||||
>
|
||||
<el-col :span="22">
|
||||
<el-alert
|
||||
title="温馨提示:如是企业请入驻企业后台,专家请入驻专家后台,并完善资料"
|
||||
type="warning"
|
||||
:style="{
|
||||
:style="{
|
||||
marginBottom: `10px`,
|
||||
}"
|
||||
show-icon
|
||||
title="温馨提示:如是企业请入驻企业后台,专家请入驻专家后台,并完善资料"
|
||||
type="warning"
|
||||
></el-alert>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card shadow="always">
|
||||
<el-row :gutter="20" justify="center">
|
||||
<!-- v-show="item.id <= 2"-->
|
||||
<el-col
|
||||
:span="4"
|
||||
v-for="item in identityList.slice(0, 5)"
|
||||
v-show="item.id <= 2"
|
||||
:key="item.id"
|
||||
@click="handleStatus(item)"
|
||||
v-for="item in identityList"
|
||||
:key="item.id"
|
||||
:span="4"
|
||||
@click="handleStatus(item)"
|
||||
>
|
||||
<el-card style="text-align: center; height: 100%">
|
||||
<el-image
|
||||
style="height: 100px"
|
||||
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
||||
fit="cover"
|
||||
fit="cover"
|
||||
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
||||
style="height: 100px"
|
||||
></el-image>
|
||||
<h3>{{ `${item.title}入驻` }}</h3>
|
||||
<p v-if="item.status == 0">审核中</p>
|
||||
<div v-else-if="item.status == 2">
|
||||
<p v-if="item.status === '0'">审核中</p>
|
||||
<div v-else-if="item.status === '2'">
|
||||
<p class="text-danger">审核拒绝</p>
|
||||
<p
|
||||
class="text-navy"
|
||||
style="cursor: pointer"
|
||||
@click.stop="reason(item)"
|
||||
class="text-navy"
|
||||
style="cursor: pointer"
|
||||
@click.stop="reason(item)"
|
||||
>
|
||||
查看拒绝原因
|
||||
</p>
|
||||
</div>
|
||||
<div v-else-if="item.status == 4">
|
||||
<div v-else-if="item.status === '4'">
|
||||
<el-link type="primary">申请</el-link>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -53,20 +56,21 @@
|
||||
|
||||
<el-card class="mt20" shadow="always">
|
||||
<el-row :gutter="20" justify="center">
|
||||
<!-- v-show="item.id <= 2"-->
|
||||
<el-col
|
||||
:span="4"
|
||||
v-for="item in identityList.slice(0, 5)"
|
||||
v-show="item.id <= 2"
|
||||
:key="item.id"
|
||||
v-for="item in identityList"
|
||||
:key="item.id"
|
||||
|
||||
:span="4"
|
||||
>
|
||||
<el-card style="text-align: center; height: 100%">
|
||||
<el-image
|
||||
style="height: 100px"
|
||||
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
||||
fit="cover"
|
||||
fit="cover"
|
||||
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
||||
style="height: 100px"
|
||||
></el-image>
|
||||
<h3>{{ `${item.title}后台` }}</h3>
|
||||
<p v-if="item.status == 1">
|
||||
<p v-if="item.status === '1'">
|
||||
<!-- <p> -->
|
||||
<el-link type="primary" @click="handlePage(item)">进入</el-link>
|
||||
</p>
|
||||
@ -78,12 +82,14 @@
|
||||
</template>
|
||||
<script setup>
|
||||
// import store from "@/store";
|
||||
import { identity, settled, identitySwitch } from "@/api/identity/index";
|
||||
import { useRouter } from "vue-router";
|
||||
import {identity} from "@/api/identity";
|
||||
import {useRouter} from "vue-router";
|
||||
import usePermissionStore from "@/store/modules/permission";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { ArrowLeftBold } from "@element-plus/icons-vue";
|
||||
import {ElMessageBox} from "element-plus";
|
||||
import {ArrowLeftBold} from "@element-plus/icons-vue";
|
||||
import {onMounted, ref} from "vue";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const permissionStore = usePermissionStore();
|
||||
@ -92,8 +98,8 @@ const identityList = ref([]);
|
||||
const identityDict = {
|
||||
1: "企业",
|
||||
2: "专家",
|
||||
3: "研究机构",
|
||||
4: "实验室",
|
||||
3: "实验室",
|
||||
4: "研究机构",
|
||||
5: "科技经纪人",
|
||||
// 6: "企业后台",
|
||||
// 7: "专家后台",
|
||||
@ -103,85 +109,74 @@ const identityDict = {
|
||||
};
|
||||
onMounted(() => {
|
||||
identity().then((res) => {
|
||||
// console.log(res.data);
|
||||
res.data.forEach((item) => {
|
||||
identityList.value.push({
|
||||
id: item.roleId,
|
||||
title: identityDict[item.roleId],
|
||||
status: item.status,
|
||||
});
|
||||
});
|
||||
// settled().then((ret) => {
|
||||
// for (const key in res.data) {
|
||||
// const obj = { id: key, title: res.data[key], status: -1, remark: "" };
|
||||
// if (ret.data.examine_identity[key] !== undefined) {
|
||||
// obj.status = ret.data.examine_identity[key].status;
|
||||
// obj.remark = ret.data.examine_identity[key].remark;
|
||||
// }
|
||||
// if ((ret.data.identity & key) > 0) {
|
||||
// obj.status = 1;
|
||||
// }
|
||||
// identityList.value.push(obj);
|
||||
// }
|
||||
// });
|
||||
identityList.value = res.data.map(item => ({
|
||||
id: item.roleId,
|
||||
title: identityDict[item.roleId],
|
||||
status: item.status,
|
||||
})).slice(0, 5)
|
||||
});
|
||||
});
|
||||
|
||||
function reason(item) {
|
||||
alert("拒绝原因:\n" + item.remark);
|
||||
}
|
||||
|
||||
function noClicking() {
|
||||
return identityList.value.some(
|
||||
(item) => item.status == 0 || item.status == 1
|
||||
(item) => item.status === "0" || item.status === "1"
|
||||
);
|
||||
}
|
||||
|
||||
const backToHome = () => {
|
||||
router.push({
|
||||
path: "/",
|
||||
});
|
||||
};
|
||||
|
||||
// item.status -1>未入驻 0>审核中 1>通过 2拒绝
|
||||
function handleStatus(item) {
|
||||
// console.log(item);
|
||||
if (noClicking()) return ElMessageBox.alert("一个账号只能申请一个身份");
|
||||
if (item.status === "4" || item.status === "2") {
|
||||
if (item.id == 1) {
|
||||
if (item.id === 1) {
|
||||
// 企业
|
||||
router.push({ path: "/identity/enterprise" });
|
||||
} else if (item.id == 2) {
|
||||
router.push({path: "/identity/enterprise"});
|
||||
} else if (item.id === 2) {
|
||||
// 专家
|
||||
router.push({ path: "/identity/expert" });
|
||||
} else if (item.id == 3) {
|
||||
// 研究机构
|
||||
router.push({ path: "/identity/research" });
|
||||
} else if (item.id == 4) {
|
||||
router.push({path: "/identity/expert"});
|
||||
} else if (item.id === 3) {
|
||||
// 实验室
|
||||
router.push({ path: "/identity/laboratory" });
|
||||
} else if (item.id == 5) {
|
||||
router.push({path: "/identity/laboratory"});
|
||||
} else if (item.id === 4) {
|
||||
// 研究机构
|
||||
router.push({path: "/identity/research"});
|
||||
} else if (item.id === 5) {
|
||||
// 科技经纪人
|
||||
router.push({ path: "/identity/agent" });
|
||||
router.push({path: "/identity/agent"});
|
||||
}
|
||||
} else if (item.status === 1) {
|
||||
alert("您已入驻,请进入后台");
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
const handlePage = async (item) => {
|
||||
let routeData = "";
|
||||
if (item.id == 1) {
|
||||
if (item.id === 1) {
|
||||
// 企业
|
||||
routeData = router.resolve({ path: "/admin" });
|
||||
} else if (item.id == 2) {
|
||||
routeData = router.resolve({path: "/admin"});
|
||||
} else if (item.id === 2) {
|
||||
// 专家
|
||||
routeData = router.resolve({ path: "/admin" });
|
||||
} else if (item.id == 3) {
|
||||
routeData = router.resolve({path: "/admin"});
|
||||
} else if (item.id === 3) {
|
||||
// 研究机构
|
||||
routeData = router.resolve({ path: "/admin" });
|
||||
} else if (item.id == 4) {
|
||||
routeData = router.resolve({path: "/admin"});
|
||||
} else if (item.id === 4) {
|
||||
// 实验室
|
||||
routeData = router.resolve({ path: "/admin" });
|
||||
} else if (item.id == 5) {
|
||||
routeData = router.resolve({path: "/admin"});
|
||||
} else if (item.id === 5) {
|
||||
// 科技经纪人
|
||||
routeData = router.resolve({ path: "/five" });
|
||||
routeData = router.resolve({path: "/five"});
|
||||
}
|
||||
// return window.open(routeData.href, "_blank");
|
||||
// TODO ...... 切换身份待处理
|
||||
|
50
src/views/identity/laboratory.vue
Normal file
50
src/views/identity/laboratory.vue
Normal file
@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto">
|
||||
<laboratory-form ref="laboratoryFormRef" v-model="form" is-add/>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button @click="$router.go(-1)">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {insertLaboratory} from '@/api/identity'
|
||||
import LaboratoryForm from '@/views/components/LaboratoryForm'
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {useRouter} from "vue-router";
|
||||
|
||||
const props = defineProps({
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120
|
||||
}
|
||||
})
|
||||
const router = useRouter()
|
||||
const data = reactive({
|
||||
form: {researchs: []}
|
||||
})
|
||||
const {form} = toRefs(data)
|
||||
const laboratoryFormRef = ref()
|
||||
const submitForm = async () => {
|
||||
if (!laboratoryFormRef.value) return
|
||||
const valid = await laboratoryFormRef.value.validateForm()
|
||||
if (valid) {
|
||||
try {
|
||||
form.value.researchDirection = form.value.researchs?.join(",") ?? null
|
||||
await insertLaboratory(form.value)
|
||||
router.go(-1);
|
||||
ElMessage.success("实验室入驻成功")
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
ElMessage.error("入驻失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
40
src/views/identity/research.vue
Normal file
40
src/views/identity/research.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto">
|
||||
<research-form ref="researchFormRef" v-model="form" is-add/>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button @click="$router.go(-1)">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import ResearchForm from '@/views/components/ResearchForm'
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120
|
||||
}
|
||||
})
|
||||
const data = reactive({
|
||||
form: {
|
||||
industrys: [],
|
||||
}
|
||||
})
|
||||
const {form} = toRefs(data)
|
||||
const researchFormRef = ref()
|
||||
const submitForm = async () => {
|
||||
if (!researchFormRef.value) return
|
||||
const valid = await researchFormRef.value.validateForm()
|
||||
if (valid) {
|
||||
// TODO: submit laboratory
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
@ -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://101.34.131.16:1618",
|
||||
// target: "http://192.168.110.10:1618",
|
||||
target: "http://192.168.0.201:1618",
|
||||
// target: 'http://172.18.3.127:1618',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||
|
Reference in New Issue
Block a user