This commit is contained in:
quantulr
2023-11-29 17:22:34 +08:00
parent f0bf63e43f
commit 034b27fcbe
4 changed files with 160 additions and 148 deletions

View File

@ -1,95 +1,96 @@
<template> <template>
<el-badge <!-- <el-badge-->
v-if="!item.hidden" <!-- v-if="!item.hidden"-->
:hidden=" <!-- :hidden="-->
![ <!-- ![-->
`/approval/list`, <!-- `/approval/list`,-->
`/approval/dataList/approval`, <!-- `/approval/dataList/approval`,-->
`/auditing/achievement`, <!-- `/auditing/achievement`,-->
`/auditing/demand`, <!-- `/auditing/demand`,-->
`/auditing/serviceDemand`, <!-- `/auditing/serviceDemand`,-->
`/auditing/Enterpriseproducts`, <!-- `/auditing/Enterpriseproducts`,-->
`/approval/data-list/laboratory`, <!-- `/approval/data-list/laboratory`,-->
].includes(basePath) <!-- ].includes(basePath)-->
" <!-- "-->
:value="getCount(basePath)" <!-- :value="getCount(basePath)"-->
class="count-badge" <!-- class="count-badge"-->
> <!-- >-->
<div> <div v-if="!item.hidden">
<template <template
v-if=" v-if="
hasOneShowingChild(item.children, item) && hasOneShowingChild(item.children, item) &&
(!onlyOneChild.children || onlyOneChild.noShowingChildren) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) &&
!item.alwaysShow !item.alwaysShow
" "
> >
<app-link <app-link
v-if="onlyOneChild.meta" v-if="onlyOneChild.meta"
:to="resolvePath(onlyOneChild.path, onlyOneChild.query)" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"
> >
<el-menu-item <el-menu-item
:class="{ 'submenu-title-noDropdown': !isNest }" :class="{ 'submenu-title-noDropdown': !isNest }"
:index="resolvePath(onlyOneChild.path)" :index="resolvePath(onlyOneChild.path)"
:style="{ :style="{
paddingRight: '0px', paddingRight: '0px',
}" }"
> >
<svg-icon <svg-icon
:icon-class=" :icon-class="
onlyOneChild.meta.icon || (item.meta && item.meta.icon) onlyOneChild.meta.icon || (item.meta && item.meta.icon)
" "
/> />
<template #title <template #title
><span ><span
:title="hasTitle(onlyOneChild.meta.title)" :title="hasTitle(onlyOneChild.meta.title)"
class="menu-title" class="menu-title"
>{{ >{{
["/auditing/serviceDemand"].includes(basePath) /* ["/auditing/serviceDemand"].includes(basePath)
? `${onlyOneChild.meta.title} (${userStore.serviceDemandTotal})` ? `${onlyOneChild.meta.title} (${userStore.serviceDemandTotal})`
: ["/auditing/achievement"].includes(basePath) : ["/auditing/achievement"].includes(basePath)
? `${onlyOneChild.meta.title} (${userStore.achievementTotal})` ? `${onlyOneChild.meta.title} (${userStore.achievementTotal})`
: ["/auditing/demand"].includes(basePath) : ["/auditing/demand"].includes(basePath)
? `${onlyOneChild.meta.title} (${userStore.technologyTotal})` ? `${onlyOneChild.meta.title} (${userStore.technologyTotal})`
: ["/auditing/Enterpriseproducts"].includes(basePath) : ["/auditing/Enterpriseproducts"].includes(basePath)
? `${onlyOneChild.meta.title} (${userStore.productTotal})` ? `${onlyOneChild.meta.title} (${userStore.productTotal})`
: onlyOneChild.meta.title :*/
}}</span onlyOneChild.meta.title
></template }}</span
> ></template
</el-menu-item> >
</app-link> </el-menu-item>
</template> </app-link>
</template>
<el-sub-menu <el-sub-menu
v-else v-else
ref="subMenu" ref="subMenu"
:index="resolvePath(item.path)" :index="resolvePath(item.path)"
popper-append-to-body popper-append-to-body
> >
<template v-if="item.meta" #title> <template v-if="item.meta" #title>
<svg-icon :icon-class="item.meta && item.meta.icon" /> <svg-icon :icon-class="item.meta && item.meta.icon"/>
<span :title="hasTitle(item.meta.title)" class="menu-title">{{ <span :title="hasTitle(item.meta.title)" class="menu-title">{{
item.meta.title item.meta.title
}}</span> }}</span>
</template> </template>
<sidebar-item <sidebar-item
v-for="child in item.children" v-for="child in item.children"
:key="child.path" :key="child.path"
:base-path="resolvePath(child.path)" :base-path="resolvePath(child.path)"
:is-nest="true" :is-nest="true"
:item="child" :item="child"
class="nest-menu" class="nest-menu"
/> />
</el-sub-menu> </el-sub-menu>
</div> </div>
</el-badge> <!-- </el-badge>-->
</template> </template>
<script setup> <script setup>
import { isExternal } from "@/utils/validate"; import {isExternal} from "@/utils/validate";
import AppLink from "./Link"; import AppLink from "./Link";
import { getNormalPath } from "@/utils/ruoyi"; import {getNormalPath} from "@/utils/ruoyi";
import useUserStore from "@/store/modules/user"; import useUserStore from "@/store/modules/user";
const props = defineProps({ const props = defineProps({
@ -153,7 +154,7 @@ function hasOneShowingChild(children = [], parent) {
// Show parent if there are no child router to display // Show parent if there are no child router to display
if (showingChildren.length === 0) { if (showingChildren.length === 0) {
onlyOneChild.value = { ...parent, path: "", noShowingChildren: true }; onlyOneChild.value = {...parent, path: "", noShowingChildren: true};
return true; return true;
} }

View File

@ -1,15 +1,15 @@
<template> <template>
<el-form <el-form
ref="formRef" ref="formRef"
:label-width="labelWidth + 'px'" :label-width="labelWidth + 'px'"
:model="modelValue" :model="modelValue"
:rules="rules" :rules="rules"
> >
<div v-if="showTitle" class="form_title">基本信息</div> <div v-if="showTitle" class="form_title">基本信息</div>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="imageName" prop="image"> <el-form-item :label="imageName" prop="image">
<ImageUpload v-model="modelValue.image" :fileSize="2" :limit="1" /> <ImageUpload v-model="modelValue.image" :fileSize="2" :limit="1"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -18,8 +18,8 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="nameName" prop="name"> <el-form-item :label="nameName" prop="name">
<el-input <el-input
v-model="modelValue.name" v-model="modelValue.name"
:disabled="isAdd ? false : true" :disabled="isAdd ? false : true"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -53,9 +53,9 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="联系方式" prop="phone"> <el-form-item label="联系方式" prop="phone">
<el-input <el-input
v-model="modelValue.phone" v-model="modelValue.phone"
:maxlength="11" :maxlength="11"
oninput=" oninput="
value = value value = value
.replace(/[^\d.]/g, '') .replace(/[^\d.]/g, '')
.replace(/\.{2,}/g, '.') .replace(/\.{2,}/g, '.')
@ -83,10 +83,10 @@
<el-form-item label="企业类型:" prop="kind"> <el-form-item label="企业类型:" prop="kind">
<el-select v-model="modelValue.kind" placeholder="请选择"> <el-select v-model="modelValue.kind" placeholder="请选择">
<el-option <el-option
v-for="item in enterpriseOptions" v-for="item in enterpriseOptions"
:key="item.key" :key="item.key"
:label="item.value" :label="item.value"
:value="item.key" :value="item.key"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -103,16 +103,16 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="姓名:" prop="name"> <el-form-item label="姓名:" prop="name">
<el-input <el-input
v-model="modelValue.name" v-model="modelValue.name"
:disabled="isAdd ? false : true" :disabled="isAdd ? false : true"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="手机号:" prop="mobile"> <el-form-item label="手机号:" prop="mobile">
<el-input <el-input
v-model="modelValue.mobile" v-model="modelValue.mobile"
:disabled="isAdd ? false : true" :disabled="isAdd ? false : true"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -148,35 +148,35 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属实验室:"> <el-form-item label="所属实验室:">
<infinite-select <infinite-select
v-model="modelValue.laboratoryId" v-model="modelValue.laboratoryId"
:prop="{ label: 'name', value: 'id' }" :prop="{ label: 'name', value: 'id' }"
:query="{ page: 'pageNum', size: 'pageSize', searchKey: 'name' }" :query="{ page: 'pageNum', size: 'pageSize', searchKey: 'name' }"
:remote-method="loadLabOptions" :remote-method="loadLabOptions"
:default-label="modelValue.laboratoryName" :default-label="modelValue.laboratoryName"
class="infinite-select" class="infinite-select"
prefix-icon="pointer" prefix-icon="pointer"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属研究机构:"> <el-form-item label="所属研究机构:">
<infinite-select <infinite-select
v-model="modelValue.researchId" v-model="modelValue.researchId"
:default-label="modelValue.researchName" :default-label="modelValue.researchName"
:prop="{ label: 'name', value: 'id' }" :prop="{ label: 'name', value: 'id' }"
:query="{ page: 'pageNum', size: 'pageSize', searchKey: 'name' }" :query="{ page: 'pageNum', size: 'pageSize', searchKey: 'name' }"
:remote-method="loadResearchOptions" :remote-method="loadResearchOptions"
class="infinite-select" class="infinite-select"
prefix-icon="pointer" prefix-icon="pointer"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<CityOptions <CityOptions
ref="cityFormRef" ref="cityFormRef"
v-model="modelValue" v-model="modelValue"
:labelWidth="labelWidth" :labelWidth="labelWidth"
/> />
<el-row> <el-row>
@ -204,10 +204,11 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="最高学历:" prop="education"> <el-form-item label="最高学历:" prop="education">
<el-select v-model="modelValue.education" placeholder="请选择"> <el-select v-model="modelValue.education" placeholder="请选择">
<el-option label="博士" value="博士"></el-option> <!-- <el-option label="博士" value="博士"></el-option>
<el-option label="硕士" value="硕士"></el-option> <el-option label="硕士" value="硕士"></el-option>
<el-option label="本科" value="本科"></el-option> <el-option label="本科" value="本科"></el-option>
<el-option label="专科" value="专科"></el-option> <el-option label="专科" value="专科"></el-option>-->
<el-option v-for="option in educationOptions" :key="option.key" :value="option.key" :label="option.text"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -235,11 +236,11 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="从业时间:" prop="workTime"> <el-form-item label="从业时间:" prop="workTime">
<el-date-picker <el-date-picker
v-model="modelValue.workTime" v-model="modelValue.workTime"
format="YYYY-MM" format="YYYY-MM"
placeholder="选择日期" placeholder="选择日期"
type="month" type="month"
value-format="YYYY-MM" value-format="YYYY-MM"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -253,28 +254,28 @@
</el-row> </el-row>
<FieldOptions <FieldOptions
ref="fieldFormRef" ref="fieldFormRef"
v-model="modelValue" v-model="modelValue"
:labelWidth="labelWidth" :labelWidth="labelWidth"
/> />
<InputBoxAdd <InputBoxAdd
ref="keywordsFormRef" ref="keywordsFormRef"
v-model="modelValue" v-model="modelValue"
:labelWidth="labelWidth" :labelWidth="labelWidth"
fieldKey="keywords" fieldKey="keywords"
placeholder="应用场景关键词+技术产品关键词" placeholder="应用场景关键词+技术产品关键词"
title="关键词" title="关键词"
/> />
<InputBoxAdd <InputBoxAdd
v-if="formType != 2" v-if="formType != 2"
ref="researchsFormRef" ref="researchsFormRef"
v-model="modelValue" v-model="modelValue"
:labelWidth="labelWidth" :labelWidth="labelWidth"
fieldKey="researchs" fieldKey="researchs"
placeholder="请输入研究方向" placeholder="请输入研究方向"
title="研究方向" title="研究方向"
/> />
<!-- <InputBoxAdd <!-- <InputBoxAdd
@ -308,9 +309,9 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="营业执照:" prop="license"> <el-form-item label="营业执照:" prop="license">
<ImageUpload <ImageUpload
v-model="modelValue.license" v-model="modelValue.license"
:isShowTip="false" :isShowTip="false"
:limit="1" :limit="1"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -325,7 +326,7 @@
:autosize="{ minRows: 2, maxRows: 6 }" :autosize="{ minRows: 2, maxRows: 6 }"
/> --> /> -->
<!-- v-else --> <!-- v-else -->
<WangEditor v-model="modelValue.introduce" minHeight="150px" /> <WangEditor v-model="modelValue.introduce" minHeight="150px"/>
<!-- <Editor <!-- <Editor
v-else v-else
v-model="modelValue.introduce" v-model="modelValue.introduce"
@ -344,18 +345,18 @@ import CityOptions from "@/views/components/CityOptions";
import InputBoxAdd from "@/views/components/InputBoxAdd"; import InputBoxAdd from "@/views/components/InputBoxAdd";
// import { researchSelect } from "@/api/dataList/research"; // import { researchSelect } from "@/api/dataList/research";
// import { laboratorySelect } from "@/api/dataList/laboratory"; // import { laboratorySelect } from "@/api/dataList/laboratory";
import { tenantSelect } from "@/api/subPlatform/tenant"; import {tenantSelect} from "@/api/subPlatform/tenant";
import { enterpriseOptions } from "@/utils/parameter"; import {educationOptions, enterpriseOptions} from "@/utils/parameter";
import { reactive, ref, toRefs } from "vue"; import {reactive, ref, toRefs} from "vue";
import WangEditor from "@/components/WangEditor/index.vue"; import WangEditor from "@/components/WangEditor/index.vue";
// import SiteOptions from "@/views/components/SiteOptions"; // import SiteOptions from "@/views/components/SiteOptions";
import FieldOptions from "@/views/components/FieldOptions"; import FieldOptions from "@/views/components/FieldOptions";
import { casLaboratoryList } from "@/api/dataList/laboratory"; import {casLaboratoryList} from "@/api/dataList/laboratory";
import InfiniteSelect from "@/components/InfiniteSelect"; import InfiniteSelect from "@/components/InfiniteSelect";
import { researchList } from "@/api/dataList/research"; import {researchList} from "@/api/dataList/research";
const props = defineProps({ const props = defineProps({
modelValue: { type: Object }, modelValue: {type: Object},
isAdd: { isAdd: {
type: Boolean, type: Boolean,
default: true, default: true,
@ -373,7 +374,7 @@ const props = defineProps({
default: 120, default: 120,
}, },
}); });
const { formType, modelValue, labelWidth, showTitle, isAdd } = toRefs(props); const {formType, modelValue, labelWidth, showTitle, isAdd} = toRefs(props);
const cityFormRef = ref(null); const cityFormRef = ref(null);
const formRef = ref(null); const formRef = ref(null);
const keywordsFormRef = ref(null); const keywordsFormRef = ref(null);
@ -385,10 +386,10 @@ const options = ref([]);
const siteList = ref([]); const siteList = ref([]);
const data = reactive({ const data = reactive({
rules: { rules: {
product: [{ required: true, message: "请输入", trigger: "blur" }], product: [{required: true, message: "请输入", trigger: "blur"}],
name: [{ required: true, message: "请输入", trigger: "blur" }], name: [{required: true, message: "请输入", trigger: "blur"}],
kind: [{ required: true, message: "请选择", trigger: "change" }], kind: [{required: true, message: "请选择", trigger: "change"}],
code: [{ required: true, message: "请输入", trigger: "blur" }], code: [{required: true, message: "请输入", trigger: "blur"}],
// mobile: [ // mobile: [
// { required: true, message: "请输入", trigger: "blur" }, // { required: true, message: "请输入", trigger: "blur" },
// { // {
@ -397,7 +398,7 @@ const data = reactive({
// trigger: "blur", // trigger: "blur",
// }, // },
// ], // ],
researchId: [{ message: "请选择", trigger: "change" }], researchId: [{message: "请选择", trigger: "change"}],
tenantId: [ tenantId: [
{ {
required: true, required: true,
@ -405,12 +406,12 @@ const data = reactive({
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
], ],
school: [{ required: true, message: "请输入", trigger: "blur" }], school: [{required: true, message: "请输入", trigger: "blur"}],
organization: [{ required: true, message: "请输入", trigger: "blur" }], organization: [{required: true, message: "请输入", trigger: "blur"}],
education: [{ message: "请选择", trigger: "change" }], education: [{message: "请选择", trigger: "change"}],
// major: [{ required: true, message: "请输入", trigger: "blur" }], // major: [{ required: true, message: "请输入", trigger: "blur" }],
// job: [{ required: true, message: "请输入", trigger: "blur" }], // job: [{ required: true, message: "请输入", trigger: "blur" }],
title: [{ required: true, message: "请输入", trigger: "blur" }], title: [{required: true, message: "请输入", trigger: "blur"}],
workTime: [ workTime: [
{ {
required: true, required: true,
@ -425,10 +426,10 @@ const data = reactive({
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
], ],
introduce: [{ required: true, message: "请输入", trigger: "blur" }], introduce: [{required: true, message: "请输入", trigger: "blur"}],
}, },
}); });
const { rules } = toRefs(data); const {rules} = toRefs(data);
const introduceName = computed(() => { const introduceName = computed(() => {
if (formType.value === 1) { if (formType.value === 1) {
return "个人简介:"; return "个人简介:";
@ -474,9 +475,9 @@ const validateForm = async () => {
//企业 //企业
// const directionsFormValid = await directionsFormRef.value.validateForm(); //生产方向验证 // const directionsFormValid = await directionsFormRef.value.validateForm(); //生产方向验证
return ( return (
formValid && cityFormValid && fieldFormValid formValid && cityFormValid && fieldFormValid
// keywordsFormValid && // keywordsFormValid &&
// directionsFormValid // directionsFormValid
); );
} else { } else {
throw "未知的formType"; throw "未知的formType";
@ -490,9 +491,9 @@ const getSiteList = async () => {
}; };
const loadLabOptions = (query) => const loadLabOptions = (query) =>
casLaboratoryList({ ...query, examineStatus: "1" }).then((resp) => resp.rows); casLaboratoryList({...query, examineStatus: "1"}).then((resp) => resp.rows);
const loadResearchOptions = (query) => const loadResearchOptions = (query) =>
researchList({ ...query, examineStatus: "1" }).then((resp) => resp.rows); researchList({...query, examineStatus: "1"}).then((resp) => resp.rows);
getSiteList(); getSiteList();
defineExpose({ defineExpose({
validateForm, validateForm,

View File

@ -75,7 +75,11 @@
<div>{{ row.industryStr }}</div> <div>{{ row.industryStr }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="学历" prop="education" /> <el-table-column align="center" label="学历" prop="education">
<template #default="{row}">
{{ educationOptions.find((el) => el.key === row.education)?.text ?? "无" }}
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center" prop="introduce" /> --> <!-- <el-table-column label="备注" align="center" prop="introduce" /> -->
<!-- <el-table-column label="站点" align="center"> <!-- <el-table-column label="站点" align="center">
<template #default="{ row }"> <template #default="{ row }">
@ -274,6 +278,7 @@ import { blobValidate } from "@/utils/ruoyi";
import { ElLoading, ElMessage, ElMessageBox } from "element-plus"; import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
import dayjs from "dayjs"; import dayjs from "dayjs";
import request from "@/utils/request"; import request from "@/utils/request";
import {educationOptions} from "../../../utils/parameter";
const router = useRouter(); const router = useRouter();
// const siteList = ref([]); // const siteList = ref([]);

View File

@ -44,7 +44,11 @@
<div>{{ row.industryStr }}</div> <div>{{ row.industryStr }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="学历" prop="education" /> <el-table-column align="center" label="学历" prop="education">
<template #default="{row}">
{{ educationOptions.find((el) => el.key === row.education)?.text ?? "无" }}
</template>
</el-table-column>
<el-table-column align="center" label="个人备注" show-overflow-tooltip> <el-table-column align="center" label="个人备注" show-overflow-tooltip>
<template #default="{ row }"> <template #default="{ row }">
<div v-html="row.introduce"></div> <div v-html="row.introduce"></div>
@ -86,6 +90,7 @@ import useUserStore from "@/store/modules/user";
import DictTag from "@/components/DictTag/index.vue"; import DictTag from "@/components/DictTag/index.vue";
import { auditStatusDict } from "@/constant/dict"; import { auditStatusDict } from "@/constant/dict";
import { reactive, ref, toRefs } from "vue"; import { reactive, ref, toRefs } from "vue";
import {educationOptions} from "../../../utils/parameter";
const router = useRouter(); const router = useRouter();
const data = reactive({ const data = reactive({