公司企业入驻
This commit is contained in:
@ -7,3 +7,19 @@ export function launch(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
// 省市区选择
|
||||
export function areaList(params) {
|
||||
return request({
|
||||
url: '/enterprise/v1/config/area',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
// 领域
|
||||
export function industry(params) {
|
||||
return request({
|
||||
url: '/enterprise/v1/config/industry',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
22
src/api/identity/index.js
Normal file
22
src/api/identity/index.js
Normal file
@ -0,0 +1,22 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 首页每一项
|
||||
export function identity() {
|
||||
return request({
|
||||
url: '/enterprise/v1/config/identity'
|
||||
});
|
||||
}
|
||||
// 当前状态
|
||||
export function settled() {
|
||||
return request({
|
||||
url: '/enterprise/v1/settled'
|
||||
});
|
||||
}
|
||||
// 公司企业入职
|
||||
export function company(data) {
|
||||
return request({
|
||||
url: '/enterprise/v1/settled/company',
|
||||
method:'post',
|
||||
data
|
||||
});
|
||||
}
|
283
src/components/Editor/index.vue
Normal file
283
src/components/Editor/index.vue
Normal file
@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-upload
|
||||
:action="uploadUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:on-success="handleUploadSuccess"
|
||||
:on-error="handleUploadError"
|
||||
name="file"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
style="display: none"
|
||||
ref="upload"
|
||||
v-if="type == 'url'"
|
||||
>
|
||||
</el-upload>
|
||||
<div class="editor" ref="editor" :style="styles"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Quill from "quill";
|
||||
import "quill/dist/quill.core.css";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import "quill/dist/quill.bubble.css";
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: String,
|
||||
/* 高度 */
|
||||
height: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
/* 最小高度 */
|
||||
minHeight: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
/* 只读 */
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 上传文件大小限制(MB)
|
||||
fileSize: {
|
||||
type: Number,
|
||||
default: 5,
|
||||
},
|
||||
/* 类型(base64格式、url格式) */
|
||||
type: {
|
||||
type: String,
|
||||
default: "url",
|
||||
},
|
||||
});
|
||||
|
||||
const uploadUrl = ref(
|
||||
import.meta.env.VITE_APP_BASE_API + "/enterprise/v1/upload"
|
||||
); // 上传的图片服务器地址
|
||||
const headers = ref({ "x-token": getToken() });
|
||||
let quill = ref(null);
|
||||
let currentValue = ref("");
|
||||
const options = reactive({
|
||||
theme: "snow",
|
||||
bounds: document.body,
|
||||
debug: "warn",
|
||||
modules: {
|
||||
// 工具栏配置
|
||||
toolbar: [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ align: [] }], // 对齐方式
|
||||
["clean"], // 清除文本格式
|
||||
["link", "image", "video"], // 链接、图片、视频
|
||||
],
|
||||
},
|
||||
placeholder: "请输入内容",
|
||||
readOnly: props.readOnly,
|
||||
});
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits();
|
||||
|
||||
const styles = computed(() => {
|
||||
let style = {};
|
||||
if (props.minHeight) {
|
||||
style.minHeight = `${props.minHeight}px`;
|
||||
}
|
||||
if (props.height) {
|
||||
style.height = `${props.height}px`;
|
||||
}
|
||||
return style;
|
||||
});
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
if (val) {
|
||||
if (val !== proxy.currentValue) {
|
||||
proxy.currentValue = val === null ? "" : val;
|
||||
if (proxy.Quill) {
|
||||
proxy.Quill.pasteHTML(proxy.currentValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
// 上传前校检格式和大小
|
||||
function handleBeforeUpload(file) {
|
||||
// 校检文件大小
|
||||
if (proxy.fileSize) {
|
||||
const isLt = file.size / 1024 / 1024 < proxy.fileSize;
|
||||
if (!isLt) {
|
||||
proxy.$modal.msgError(`上传文件大小不能超过 ${proxy.fileSize} MB!`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function handleUploadSuccess(res, file) {
|
||||
// 获取富文本组件实例
|
||||
let quill = proxy.Quill;
|
||||
// 如果上传成功
|
||||
if (res.code == 200) {
|
||||
// 获取光标所在位置
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片 res.url为服务器返回的图片地址
|
||||
quill.insertEmbed(length, "image", res.data.url);
|
||||
// 调整光标到最后
|
||||
quill.setSelection(length + 1);
|
||||
} else {
|
||||
proxy.$modal.msgError("图片插入失败");
|
||||
}
|
||||
}
|
||||
function handleUploadError() {
|
||||
proxy.$modal.msgError("图片插入失败");
|
||||
}
|
||||
function init() {
|
||||
const editor = proxy.$refs.editor;
|
||||
proxy.Quill = new Quill(editor, options);
|
||||
// 如果设置了上传地址则自定义图片上传事件
|
||||
if (props.type == "url") {
|
||||
let toolbar = proxy.Quill.getModule("toolbar");
|
||||
toolbar.addHandler("image", (value) => {
|
||||
proxy.uploadType = "image";
|
||||
if (value) {
|
||||
// console.log(proxy.$refs.upload.$refs.uploadRef.$refs);
|
||||
proxy.$refs.upload.$refs.uploadRef.$refs.inputRef.click();
|
||||
} else {
|
||||
proxy.quill.format("image", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
proxy.Quill.pasteHTML(proxy.currentValue);
|
||||
proxy.Quill.on("text-change", (delta, oldDelta, source) => {
|
||||
const html = proxy.$refs.editor.children[0].innerHTML;
|
||||
const text = proxy.Quill.getText();
|
||||
const quill = proxy.Quill;
|
||||
proxy.currentValue = html;
|
||||
emit("update:modelValue", html);
|
||||
// proxy.$emit("input", html);
|
||||
// proxy.$emit("on-change", { html, text, quill });
|
||||
});
|
||||
// proxy.Quill.on("text-change", (delta, oldDelta, source) => {
|
||||
// proxy.$emit("on-text-change", delta, oldDelta, source);
|
||||
// });
|
||||
// proxy.Quill.on("selection-change", (range, oldRange, source) => {
|
||||
// proxy.$emit("on-selection-change", range, oldRange, source);
|
||||
// });
|
||||
// proxy.Quill.on("editor-change", (eventName, ...args) => {
|
||||
// proxy.$emit("on-editor-change", eventName, ...args);
|
||||
// });
|
||||
}
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
|
||||
// export default {
|
||||
// watch: {
|
||||
// value: {
|
||||
// handler(val, old) {
|
||||
// console.log(val);
|
||||
// console.log(old);
|
||||
// if (val !== this.currentValue) {
|
||||
// this.currentValue = val === null ? "" : val;
|
||||
// if (this.Quill) {
|
||||
// this.Quill.pasteHTML(this.currentValue);
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// immediate: true,
|
||||
// },
|
||||
// },
|
||||
// beforeDestroy() {
|
||||
// this.Quill = null;
|
||||
// },
|
||||
// };
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.editor,
|
||||
.ql-toolbar {
|
||||
white-space: pre-wrap !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.quill-img {
|
||||
display: none;
|
||||
}
|
||||
.ql-snow .ql-tooltip[data-mode="link"]::before {
|
||||
content: "请输入链接地址:";
|
||||
}
|
||||
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
|
||||
border-right: 0px;
|
||||
content: "保存";
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
.ql-snow .ql-tooltip[data-mode="video"]::before {
|
||||
content: "请输入视频地址:";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
|
||||
content: "14px";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
|
||||
content: "10px";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
|
||||
content: "18px";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
|
||||
content: "32px";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
|
||||
content: "文本";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
|
||||
content: "标题1";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
|
||||
content: "标题2";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
|
||||
content: "标题3";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
|
||||
content: "标题4";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
|
||||
content: "标题5";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
|
||||
content: "标题6";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
|
||||
content: "标准字体";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
|
||||
content: "衬线字体";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
|
||||
content: "等宽字体";
|
||||
}
|
||||
</style>
|
@ -67,7 +67,7 @@ const props = defineProps({
|
||||
// 是否显示提示
|
||||
isShowTip: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
@ -76,37 +76,45 @@ const emit = defineEmits();
|
||||
const dialogImageUrl = ref("");
|
||||
const dialogVisible = ref(false);
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传的图片服务器地址
|
||||
const headers = ref({ Authorization: "Bearer " + getToken() });
|
||||
const uploadImgUrl = ref(
|
||||
import.meta.env.VITE_APP_BASE_API + "/enterprise/v1/upload"
|
||||
); // 上传的图片服务器地址
|
||||
const headers = ref({ "x-token": getToken() });
|
||||
const fileList = ref([]);
|
||||
const showTip = computed(
|
||||
() => props.isShowTip && (props.fileType || props.fileSize)
|
||||
);
|
||||
|
||||
watch(() => props.modelValue, val => {
|
||||
if (val) {
|
||||
// 首先将值转为数组
|
||||
const list = Array.isArray(val) ? val : props.modelValue.split(",");
|
||||
// 然后将数组转为对象数组
|
||||
fileList.value = list.map(item => {
|
||||
if (typeof item === "string") {
|
||||
if (item.indexOf(baseUrl) === -1) {
|
||||
item = { name: baseUrl + item, url: baseUrl + item };
|
||||
} else {
|
||||
item = { name: item, url: item };
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
if (val) {
|
||||
// 首先将值转为数组
|
||||
const list = Array.isArray(val) ? val : props.modelValue.split(",");
|
||||
// 然后将数组转为对象数组
|
||||
fileList.value = list.map((item) => {
|
||||
item = { name: item, url: item };
|
||||
return item;
|
||||
//////////////
|
||||
if (typeof item === "string") {
|
||||
if (item.indexOf(baseUrl) === -1) {
|
||||
item = { name: baseUrl + item, url: baseUrl + item };
|
||||
} else {
|
||||
item = { name: item, url: item };
|
||||
}
|
||||
}
|
||||
}
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
fileList.value = [];
|
||||
return [];
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
fileList.value = [];
|
||||
return [];
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
// 删除图片
|
||||
function handleRemove(file, files) {
|
||||
const findex = fileList.value.map(f => f.name).indexOf(file.name);
|
||||
const findex = fileList.value.map((f) => f.name).indexOf(file.name);
|
||||
if (findex > -1) {
|
||||
fileList.value.splice(findex, 1);
|
||||
emit("update:modelValue", listToString(fileList.value));
|
||||
@ -115,7 +123,7 @@ function handleRemove(file, files) {
|
||||
|
||||
// 上传成功回调
|
||||
function handleUploadSuccess(res) {
|
||||
fileList.value.push({ name: res.fileName, url: res.fileName });
|
||||
fileList.value.push({ name: res.data.url, url: res.data.url });
|
||||
emit("update:modelValue", listToString(fileList.value));
|
||||
proxy.$modal.closeLoading();
|
||||
}
|
||||
@ -128,7 +136,7 @@ function handleBeforeUpload(file) {
|
||||
if (file.name.lastIndexOf(".") > -1) {
|
||||
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
||||
}
|
||||
isImg = props.fileType.some(type => {
|
||||
isImg = props.fileType.some((type) => {
|
||||
if (file.type.indexOf(type) > -1) return true;
|
||||
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
||||
return false;
|
||||
|
@ -26,11 +26,14 @@ import './permission' // permission control
|
||||
|
||||
import { useDict } from '@/utils/dict'
|
||||
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel } from '@/utils/ruoyi'
|
||||
import { modeOptions, educationOptions, enterpriseOptions } from '@/utils/parameter'
|
||||
|
||||
// 分页组件
|
||||
import Pagination from '@/components/Pagination'
|
||||
// 自定义表格工具组件
|
||||
import RightToolbar from '@/components/RightToolbar'
|
||||
// 富文本组件
|
||||
import Editor from '@/components/Editor'
|
||||
// 图片上传组件
|
||||
import ImageUpload from "@/components/ImageUpload"
|
||||
// 自定义树选择组件
|
||||
@ -50,11 +53,15 @@ app.config.globalProperties.resetForm = resetForm
|
||||
app.config.globalProperties.handleTree = handleTree
|
||||
app.config.globalProperties.addDateRange = addDateRange
|
||||
app.config.globalProperties.selectDictLabel = selectDictLabel
|
||||
app.config.globalProperties.modeOptions = modeOptions
|
||||
app.config.globalProperties.educationOptions = educationOptions
|
||||
app.config.globalProperties.enterpriseOptions = enterpriseOptions
|
||||
|
||||
// 全局组件挂载
|
||||
app.component('DictTag', DictTag)
|
||||
app.component('Pagination', Pagination)
|
||||
app.component('TreeSelect', TreeSelect)
|
||||
app.component('Editor', Editor)
|
||||
app.component('ImageUpload', ImageUpload)
|
||||
app.component('RightToolbar', RightToolbar)
|
||||
|
||||
|
@ -111,6 +111,48 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/error/401'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/identity',
|
||||
component: () => import('@/views/identity/layout'),
|
||||
children:[
|
||||
{
|
||||
path:'index',
|
||||
component: () => import('@/views/identity/index'),
|
||||
name: 'index',
|
||||
meta: { title: '身份选择'},
|
||||
},
|
||||
{
|
||||
path:'enterprise',
|
||||
component: () => import('@/views/identity/enterprise'),
|
||||
name: 'enterprise',
|
||||
meta: { title: '企业入驻'}
|
||||
},
|
||||
{
|
||||
path:'expert',
|
||||
component: () => import('@/views/identity/expert'),
|
||||
name: 'expert',
|
||||
meta: { title: '专家入驻'}
|
||||
},
|
||||
{
|
||||
path:'research',
|
||||
component: () => import('@/views/identity/research'),
|
||||
name: 'research',
|
||||
meta: { title: '研究机构入驻'}
|
||||
},
|
||||
{
|
||||
path:'laboratory',
|
||||
component: () => import('@/views/identity/laboratory'),
|
||||
name: 'laboratory',
|
||||
meta: { title: '实验室入驻'}
|
||||
},
|
||||
{
|
||||
path:'agent',
|
||||
component: () => import('@/views/identity/agent'),
|
||||
name: 'agent',
|
||||
meta: { title: '科技经纪人入驻'}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/admin',
|
||||
component: Layout,
|
||||
|
35
src/utils/parameter.js
Normal file
35
src/utils/parameter.js
Normal file
@ -0,0 +1,35 @@
|
||||
// 归属导航
|
||||
export const modeOptions = [
|
||||
{
|
||||
value: 101,
|
||||
label: '中小企业服务',
|
||||
},
|
||||
{
|
||||
value: 102,
|
||||
label: '大型企业服务',
|
||||
},
|
||||
{
|
||||
value: 103,
|
||||
label: '政府企业服务',
|
||||
},
|
||||
{
|
||||
value: 104,
|
||||
label: '科研院所服务',
|
||||
},
|
||||
]
|
||||
// 学历
|
||||
export const educationOptions = [
|
||||
{ key: 1, text: '小学' },
|
||||
{ key: 2, text: '初中' },
|
||||
{ key: 3, text: '高中' },
|
||||
{ key: 4, text: '大专' },
|
||||
{ key: 5, text: '本科' },
|
||||
{ key: 6, text: '研究生' },
|
||||
{ key: 7, text: '博士' },
|
||||
]
|
||||
// 企业类型
|
||||
export const enterpriseOptions = [
|
||||
{ key: 101, value: '上市企业' },
|
||||
{ key: 102, value: '优质企业' },
|
||||
{ key: 103, value: '普通企业' },
|
||||
]
|
@ -22,7 +22,7 @@ service.interceptors.request.use(config => {
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
config.headers['x-token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.method === 'get' && config.params) {
|
||||
|
3
src/views/identity/agent.vue
Normal file
3
src/views/identity/agent.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>agent</div>
|
||||
</template>
|
160
src/views/identity/components/CityOptions/index.vue
Normal file
160
src/views/identity/components/CityOptions/index.vue
Normal file
@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所在地:" required>
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-col :span="7">
|
||||
<el-form-item prop="province">
|
||||
<el-select
|
||||
v-model="modelValue.province"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
@change="provinceCodeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(key, value) in provinceSelectList"
|
||||
:key="value"
|
||||
:label="key"
|
||||
:value="value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item prop="city">
|
||||
<el-select
|
||||
v-model="modelValue.city"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
@change="cityCodeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(key, value) in citySelectList"
|
||||
:key="value"
|
||||
:label="key"
|
||||
:value="value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item prop="district">
|
||||
<el-select
|
||||
v-model="modelValue.district"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="(key, value) in districtSelectList"
|
||||
:key="value"
|
||||
:label="key"
|
||||
:value="value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { areaList } from "@/api/config";
|
||||
export default {
|
||||
props: {
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
provinceSelectList: [], // 省
|
||||
citySelectList: [], // 市
|
||||
districtSelectList: [], // 区
|
||||
rules: {
|
||||
province: [
|
||||
{ required: true, message: "请选择", trigger: ["change", "blue"] },
|
||||
],
|
||||
city: [
|
||||
{ required: true, message: "请选择", trigger: ["change", "blue"] },
|
||||
],
|
||||
district: [
|
||||
{ required: true, message: "请选择", trigger: ["change", "blue"] },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newOld) {
|
||||
const data = Object.assign({}, newOld);
|
||||
this.provinceCodeChange(data.province);
|
||||
this.cityCodeChange(data.city);
|
||||
newOld.city = data.city;
|
||||
newOld.district = data.district;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getProvinceByParent(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
areaList({ code: id })
|
||||
.then(({ code, msg, data }) => {
|
||||
if (code == 200) {
|
||||
resolve(data);
|
||||
} else {
|
||||
this.$modal.msgError(msg);
|
||||
reject({ msg, code });
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
async provinceCodeChange(id) {
|
||||
// delete this.modelValue.city;
|
||||
// delete this.modelValue.district;
|
||||
this.modelValue.city = undefined;
|
||||
this.modelValue.district = undefined;
|
||||
if (!id) {
|
||||
this.citySelectList = [];
|
||||
this.districtSelectList = [];
|
||||
return false;
|
||||
}
|
||||
this.citySelectList = await this.getProvinceByParent(id);
|
||||
},
|
||||
async cityCodeChange(id) {
|
||||
// delete this.modelValue.district;
|
||||
this.modelValue.district = undefined;
|
||||
if (!id) {
|
||||
this.districtSelectList = [];
|
||||
return false;
|
||||
}
|
||||
this.districtSelectList = await this.getProvinceByParent(id);
|
||||
},
|
||||
submitForm() {
|
||||
let flag = false;
|
||||
this.$refs["form"].validate((valid) => {
|
||||
flag = valid;
|
||||
});
|
||||
return flag;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
areaList().then((res) => {
|
||||
this.provinceSelectList = res.data;
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
236
src/views/identity/components/ExpertForm/index.vue
Normal file
236
src/views/identity/components/ExpertForm/index.vue
Normal file
@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
<div class="form_title" v-if="showTitle">基本信息</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="专家头像:">
|
||||
<ImageUpload v-model="modelValue.image" :fileSize="2" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<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="code">
|
||||
<el-row type="flex" justify="space-between">
|
||||
<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>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="企业类型:" prop="kind">
|
||||
<el-select v-model="modelValue.kind" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in enterpriseOptions"
|
||||
:key="item.key"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="核心成果核心产品:" prop="product">
|
||||
<el-input v-model="modelValue.product"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<CityOptions v-model="modelValue" :labelWidth="labelWidth" ref="cityForm" />
|
||||
|
||||
<FieldOptions
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldForm"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="关键词"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
fieldKey="keywords"
|
||||
ref="keywordsForm"
|
||||
/>
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="生产方向"
|
||||
placeholder="请输入生产方向"
|
||||
fieldKey="directions"
|
||||
ref="directionsForm"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="邀请码:">
|
||||
<el-input v-model="modelValue.inviter_code"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="企业网站:">
|
||||
<el-input v-model="modelValue.url"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<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
|
||||
v-model="modelValue.introduce"
|
||||
:minHeight="150"
|
||||
ref="introduceRef"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import CityOptions from "../CityOptions";
|
||||
import FieldOptions from "../FieldOptions";
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
// import { researchSelect, laboratorySelect } from "@/api/identity/index";
|
||||
export default {
|
||||
components: {
|
||||
CityOptions,
|
||||
FieldOptions,
|
||||
InputBoxAdd,
|
||||
},
|
||||
props: {
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
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"],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
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;
|
||||
},
|
||||
},
|
||||
};
|
||||
</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>
|
203
src/views/identity/components/FieldOptions/index.vue
Normal file
203
src/views/identity/components/FieldOptions/index.vue
Normal file
@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属领域:" required>
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-col :span="6">
|
||||
<el-form-item prop="industrys">
|
||||
<el-select
|
||||
v-model="fields[0]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
@change="levelIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelI"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="fields[1]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
@change="levelIIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="fields[2]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelIII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" @click="fieldAdd">添加</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="e_tag">
|
||||
<el-tag
|
||||
v-for="(tag, index) in industrysTags"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleFieldClose(index)"
|
||||
>
|
||||
<template v-if="Array.isArray(tag)">
|
||||
<span v-for="(item, i) in tag" :key="item.id">
|
||||
{{ item.name }}
|
||||
<span v-if="tag.length != i + 1">></span>
|
||||
</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{ tag }}</span>
|
||||
</template>
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { industry } from "@/api/config";
|
||||
export default {
|
||||
props: {
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
levelI: [], // I级数据
|
||||
levelII: [], // II级数据
|
||||
levelIII: [], // III级数据
|
||||
fields: [], // 当前下拉框选中的集合
|
||||
industrysTags: [], // 点击添加按钮后临时存储的数据集合
|
||||
rules: {
|
||||
industrys: [
|
||||
{
|
||||
type: "array",
|
||||
required: true,
|
||||
message: "请选择并添加",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(newVal, oldVal) {
|
||||
let _key = [];
|
||||
let _value = [];
|
||||
for (let i = 0; i < newVal.industrys.length; i++) {
|
||||
const item = newVal.industrys[i];
|
||||
_key.push(item.key);
|
||||
_value.push(item.value);
|
||||
}
|
||||
newVal.industrys = _key;
|
||||
this.industrysTags = _value;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getFieldByParent(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
industry({ parent_id: id })
|
||||
.then(({ code, msg, data }) => {
|
||||
if (code == 200) {
|
||||
resolve(data);
|
||||
} else {
|
||||
this.$modal.msgError(msg);
|
||||
reject({ msg, code });
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
async levelIChange(item) {
|
||||
delete this.fields[1];
|
||||
delete this.fields[2];
|
||||
this.levelII = await this.getFieldByParent(item.id);
|
||||
},
|
||||
async levelIIChange(item) {
|
||||
delete this.fields[2];
|
||||
this.levelIII = await this.getFieldByParent(item.id);
|
||||
},
|
||||
// 所属领域添加按钮
|
||||
fieldAdd() {
|
||||
if (!this.fields.length) return this.$modal.msgError("请选择领域类型");
|
||||
this.modelValue.industrys = [];
|
||||
this.industrysTags.push(this.fields);
|
||||
for (let i = 0; i < this.industrysTags.length; i++) {
|
||||
this.modelValue.industrys.push("");
|
||||
const item = this.industrysTags[i];
|
||||
for (let j = 0; j < item.length; j++) {
|
||||
const item2 = item[j];
|
||||
if (this.modelValue.industrys[i] == "") {
|
||||
this.modelValue.industrys[i] = item2.id;
|
||||
} else {
|
||||
this.modelValue.industrys[i] =
|
||||
this.modelValue.industrys[i] + "-" + item2.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.fields = [];
|
||||
this.levelII = [];
|
||||
this.levelIII = [];
|
||||
},
|
||||
handleFieldClose(index) {
|
||||
this.industrysTags.splice(index, 1);
|
||||
this.modelValue.industrys.splice(index, 1);
|
||||
},
|
||||
submitForm() {
|
||||
let flag = false;
|
||||
this.$refs["form"].validate((valid) => {
|
||||
flag = valid;
|
||||
});
|
||||
return flag;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
industry().then((res) => {
|
||||
this.levelI = res.data;
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.e_tag {
|
||||
.el-tag {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
94
src/views/identity/components/InputBoxAdd/index.vue
Normal file
94
src/views/identity/components/InputBoxAdd/index.vue
Normal file
@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<el-form ref="form" :model="modelValue" :label-width="labelWidth + 'px'">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
:label="title + ':'"
|
||||
:prop="fieldKey"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
type: 'array',
|
||||
message: '请输入并添加',
|
||||
trigger: 'change',
|
||||
},
|
||||
]"
|
||||
>
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="dataVal" :placeholder="placeholder"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" @click="keyWordAdd">添加</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="e_tag">
|
||||
<el-tag
|
||||
v-for="(tag, index) in this.modelValue[fieldKey]"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleFieldClose(fieldKey, index)"
|
||||
>
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { industry } from "@/api/config";
|
||||
export default {
|
||||
props: {
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
fieldKey: {
|
||||
require: true,
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataVal: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
keyWordAdd() {
|
||||
if (!this.dataVal.length)
|
||||
return this.$message.error("请输入" + this.title);
|
||||
if (!this.modelValue[this.fieldKey]) this.modelValue[this.fieldKey] = [];
|
||||
this.modelValue[this.fieldKey].push(this.dataVal);
|
||||
this.dataVal = "";
|
||||
},
|
||||
handleFieldClose(val, index) {
|
||||
this.modelValue[val].splice(index, 1);
|
||||
},
|
||||
submitForm() {
|
||||
let flag = false;
|
||||
this.$refs["form"].validate((valid) => {
|
||||
flag = valid;
|
||||
});
|
||||
return flag;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.e_tag {
|
||||
.el-tag {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
32
src/views/identity/enterprise.vue
Normal file
32
src/views/identity/enterprise.vue
Normal file
@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto">
|
||||
<EnterpriseForm
|
||||
v-model="form"
|
||||
:isAdd="false"
|
||||
:labelWidth="labelWidth"
|
||||
ref="enterpriseForm"
|
||||
/>
|
||||
<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 { company } from "@/api/identity/index";
|
||||
import EnterpriseForm from "./components/EnterpriseForm";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const labelWidth = 140;
|
||||
const form = reactive({});
|
||||
function submitForm(status) {
|
||||
if (proxy.$refs.enterpriseForm.submitForm()) {
|
||||
company(form).then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
} else {
|
||||
console.log("校验未通过");
|
||||
}
|
||||
}
|
||||
</script>
|
3
src/views/identity/expert.vue
Normal file
3
src/views/identity/expert.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>expert</div>
|
||||
</template>
|
110
src/views/identity/index.vue
Normal file
110
src/views/identity/index.vue
Normal file
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div class="app-container" v-if="identityList.length">
|
||||
<el-card shadow="always">
|
||||
<el-row :gutter="20" justify="center">
|
||||
<el-col
|
||||
:span="4"
|
||||
v-for="item in identityList"
|
||||
:key="item.id"
|
||||
@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"
|
||||
></el-image>
|
||||
<h3>{{ item.title + "入驻" }}</h3>
|
||||
<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)"
|
||||
>
|
||||
查看拒绝原因
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt20" shadow="always">
|
||||
<el-row :gutter="20" justify="center">
|
||||
<el-col :span="4" v-for="item in identityList" :key="item.id">
|
||||
<el-card style="text-align: center; height: 100%">
|
||||
<el-image
|
||||
style="height: 100px"
|
||||
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
<h3>{{ item.title + "后台" }}</h3>
|
||||
<p v-if="item.status == 1">
|
||||
<el-link type="primary" @click="handlePage(item)">进入</el-link>
|
||||
</p>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { identity, settled } from "@/api/identity/index";
|
||||
const router = useRouter();
|
||||
const identityList = ref([]);
|
||||
onMounted(() => {
|
||||
identity().then((res) => {
|
||||
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);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function reason(item) {
|
||||
alert("拒绝原因\n" + item.remark);
|
||||
}
|
||||
function noClicking() {
|
||||
return identityList.value.some((item) => item.status === 0);
|
||||
}
|
||||
// item.status -1>未入驻 0>审核中 1>通过 2拒绝
|
||||
function handleStatus(item) {
|
||||
console.log(item);
|
||||
if (noClicking()) return alert("你有已入住申请中");
|
||||
if (item.status === -1 || item.status === 2) {
|
||||
if (item.id == 1) {
|
||||
// 企业
|
||||
router.push({ path: "/identity/enterprise" });
|
||||
} else if (item.id == 2) {
|
||||
// 专家
|
||||
router.push({ path: "/identity/expert" });
|
||||
} else if (item.id == 4) {
|
||||
// 研究机构
|
||||
router.push({ path: "/identity/research" });
|
||||
} else if (item.id == 8) {
|
||||
// 实验室
|
||||
router.push({ path: "/identity/laboratory" });
|
||||
} else if (item.id == 16) {
|
||||
// 科技经纪人
|
||||
router.push({ path: "/identity/agent" });
|
||||
}
|
||||
} else if (item.status === 1) {
|
||||
alert("您已入驻,请进入后台");
|
||||
} else {
|
||||
}
|
||||
}
|
||||
function handlePage(item) {
|
||||
console.log(item);
|
||||
alert("进入后台");
|
||||
}
|
||||
</script>
|
3
src/views/identity/laboratory.vue
Normal file
3
src/views/identity/laboratory.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>laboratory</div>
|
||||
</template>
|
3
src/views/identity/layout.vue
Normal file
3
src/views/identity/layout.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
3
src/views/identity/research.vue
Normal file
3
src/views/identity/research.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>research</div>
|
||||
</template>
|
Reference in New Issue
Block a user