忘了写到哪了
This commit is contained in:
141
src/views/admin/enterprise/account/basicInfo.vue
Normal file
141
src/views/admin/enterprise/account/basicInfo.vue
Normal file
@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto">
|
||||
<p><b>基本资料</b></p>
|
||||
<el-form
|
||||
ref="userInfoFormRef"
|
||||
:model="userInfoForm"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="姓名:" prop="nickName">
|
||||
<el-input v-model="userInfoForm.nickName" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机:" prop="mobile">
|
||||
<el-input v-model="userInfoForm.mobile" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱:" prop="email">
|
||||
<el-input v-model="userInfoForm.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
<el-form-item label="职务:" prop="post">
|
||||
<el-input v-model="userInfoForm.post" placeholder="请输入职务" />
|
||||
</el-form-item>
|
||||
<el-form-item label="固定电话:" prop="phone">
|
||||
<el-input v-model="userInfoForm.phone" placeholder="请输入固定电话" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitUserInfoForm">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<p><b>企业资料</b></p>
|
||||
<EnterpriseForm
|
||||
v-model="enterpriseInfoForm"
|
||||
:isAdd="false"
|
||||
:labelWidth="labelWidth"
|
||||
ref="enterpriseInfoFormRef"
|
||||
/>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button type="primary" @click="submitEnterpriseForm">提交</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { expert } from "@/api/identity/index";
|
||||
import { getInfo } from "@/api/login";
|
||||
import { insertClientUser, updateEnterprise } from "@/api/enterprise";
|
||||
import EnterpriseForm from "@/views/components/EnterpriseForm";
|
||||
import { ElMessage } from "element-plus";
|
||||
const data = reactive({
|
||||
enterpriseInfoForm: {},
|
||||
userInfoForm: {},
|
||||
formData: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
postCode: undefined,
|
||||
},
|
||||
rules: {
|
||||
nickName: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
|
||||
phone: [{ required: true, message: "电话号码不能为空", trigger: "blur" }],
|
||||
mobile: [{ required: true, message: "手机号码不能为空", trigger: "blur" }],
|
||||
email: [{ required: true, message: "电子邮箱不能为空", trigger: "blur" }],
|
||||
post: [{ required: true, message: "职务不能为空", trigger: "blur" }],
|
||||
|
||||
bank: [{ required: true, message: "开户行不能为空", trigger: "blur" }],
|
||||
|
||||
bankAccount: [
|
||||
{ required: true, message: "开户行账号不能为空", trigger: "blur" },
|
||||
],
|
||||
bankPhone: [
|
||||
{ required: true, message: "开户行电话不能为空", trigger: "blur" },
|
||||
],
|
||||
address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
|
||||
username: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
userPhone: [
|
||||
{ required: true, message: "联系人电话不能为空", trigger: "blur" },
|
||||
],
|
||||
userAddress: [
|
||||
{ required: true, message: "邮寄地址不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, formData, rules, enterpriseInfoForm, userInfoForm } =
|
||||
toRefs(data);
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const labelWidth = 140;
|
||||
const form = reactive({
|
||||
laboratory_id: undefined, // 所属实验室
|
||||
gender: 1,
|
||||
});
|
||||
|
||||
const getBasicInfo = async () => {
|
||||
const { data } = await getInfo();
|
||||
// formData.value = data.enterprise;
|
||||
userInfoForm.value = data.user;
|
||||
enterpriseInfoForm.value = data.enterprise;
|
||||
};
|
||||
|
||||
// 更新个人信息
|
||||
const userInfoFormRef = ref();
|
||||
const submitUserInfoForm = async () => {
|
||||
await userInfoFormRef.value.validate();
|
||||
try {
|
||||
await insertClientUser(userInfoForm.value);
|
||||
getBasicInfo();
|
||||
ElMessage.success("更新基本信息成功");
|
||||
} catch (error) {
|
||||
ElMessage.error("更新基本信息失败");
|
||||
}
|
||||
};
|
||||
// 更新企业信息
|
||||
const enterpriseInfoFormRef = ref();
|
||||
const submitEnterpriseForm = async () => {
|
||||
const valid = await enterpriseInfoFormRef.value.validateForm();
|
||||
if (valid) {
|
||||
try {
|
||||
await updateEnterprise(enterpriseInfoForm.value);
|
||||
getBasicInfo();
|
||||
ElMessage.success("更新企业信息成功");
|
||||
} catch (error) {
|
||||
ElMessage.error("更新企业信息失败");
|
||||
}
|
||||
} else {
|
||||
console.log("校验未通过");
|
||||
}
|
||||
};
|
||||
// function submitForm(status) {
|
||||
// if (proxy.$refs.expertForm.submitForm()) {
|
||||
// expert(form).then((res) => {
|
||||
// proxy.$modal.msgSuccess("新增成功");
|
||||
// proxy.$router.go(-1);
|
||||
// });
|
||||
// } else {
|
||||
// console.log("校验未通过");
|
||||
// }
|
||||
// }
|
||||
|
||||
getBasicInfo();
|
||||
</script>
|
266
src/views/admin/enterprise/components/ReleaseForm/index.vue
Normal file
266
src/views/admin/enterprise/components/ReleaseForm/index.vue
Normal file
@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
<div class="form_title">
|
||||
<p><b>基本信息</b></p>
|
||||
</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品名称:" prop="title">
|
||||
<el-input
|
||||
v-model="modelValue.title"
|
||||
placeholder="请输入产品名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldOptions
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldFormRef"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="应用客户"
|
||||
placeholder="请输入应用客户"
|
||||
fieldKey="customers"
|
||||
ref="customerFormRef"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品成熟度:" prop="maturity">
|
||||
<el-select
|
||||
v-model="modelValue.maturity"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in maturityOptions"
|
||||
:key="item.key"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="成果领先性:" prop="leadStandard">
|
||||
<el-select
|
||||
v-model="modelValue.leadStandard"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in leadOptions"
|
||||
:key="item.key"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="合作模式:">
|
||||
<el-select
|
||||
v-model="modelValue.province"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="关键词"
|
||||
placeholder="请输入关键词"
|
||||
fieldKey="keywords"
|
||||
ref="keywordsFormRef"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品简介:" prop="introduce">
|
||||
<WangEditor v-model="modelValue.introduce" :min-height="300" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品图片:" prop="image">
|
||||
<ImageUpload v-model="modelValue.image" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品视频:">
|
||||
<VideoUpload
|
||||
v-model="modelValue.video"
|
||||
:limit="1"
|
||||
:fileType="['mp4']"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<p>
|
||||
<b>图片材料上传</b>
|
||||
</p>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="证明材料:" prop="file">
|
||||
<FileUpload
|
||||
v-model="modelValue.file"
|
||||
:limit="1"
|
||||
:fileType="['doc', 'xls', 'pdf', 'jpg', 'png', 'zip']"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
// import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import WangEditor from "@/components/WangEditor";
|
||||
import { maturityOptions, leadOptions } from "@/utils/parameter";
|
||||
import VideoUpload from "@/components/VideoUpload";
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
});
|
||||
const { modelValue, isAdd, showTitle, labelWidth } = toRefs(props);
|
||||
|
||||
const data = reactive({
|
||||
rules: {
|
||||
product: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
title: [{ 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" }],
|
||||
maturity: [{ 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"],
|
||||
},
|
||||
],
|
||||
leadStandard: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
introduce: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
// image: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: "请上传",
|
||||
// trigger: ["change", "blur"],
|
||||
// },
|
||||
// ],
|
||||
// video: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: "请上传",
|
||||
// trigger: ["change", "blur"],
|
||||
// },
|
||||
// ],
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
|
||||
const formRef = ref();
|
||||
const keywordsFormRef = ref();
|
||||
const fieldFormRef = ref();
|
||||
const customerFormRef = ref();
|
||||
|
||||
const validateForm = async () => {
|
||||
let formValid = ref();
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
} catch (error) {
|
||||
formValid = false;
|
||||
}
|
||||
const customerFormValid = await customerFormRef.value.validateForm(); // 领域选择表单验证
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm(); // 领域选择表单验证
|
||||
const keywordsFormValid = await keywordsFormRef.value.validateForm(); // 关键词表单验证
|
||||
return formValid && fieldFormValid && keywordsFormValid && customerFormValid;
|
||||
};
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
</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>
|
178
src/views/admin/enterprise/demand/serviceDemind.vue
Normal file
178
src/views/admin/enterprise/demand/serviceDemind.vue
Normal file
@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<router-link to="./release">
|
||||
<el-button type="primary" size="mini">发布需求</el-button>
|
||||
</router-link>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-radio-group
|
||||
v-model="queryParams.type"
|
||||
size="mini"
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-radio-button :label="1">待受理</el-radio-button>
|
||||
<el-radio-button :label="2">已受理</el-radio-button>
|
||||
<el-radio-button :label="3">已结束</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" style="margin-top: 20px">
|
||||
<el-table-column label="需求名称" align="center" prop="postCode" />
|
||||
<el-table-column label="需求类别" align="center" prop="postSort" />
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="联系人" align="center" prop="status" />
|
||||
<el-table-column label="手机号" align="center" prop="status" />
|
||||
<el-table-column
|
||||
label="发布时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="queryParams.type == 3"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="queryParams.type == 1"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Close"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
>取消发布</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="queryParams.type != 3"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="View"
|
||||
@click="handleEdit(scope.row.id)"
|
||||
>查看</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
demand,
|
||||
demandAdd,
|
||||
demandEdit,
|
||||
demandDetail,
|
||||
demandDelete,
|
||||
} from "@/api/admin/expert/demand";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const router = useRouter();
|
||||
|
||||
const postList = ref([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
page_num: 1,
|
||||
page_size: 10,
|
||||
type: 1,
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "公司名称不能为空", trigger: "blur" }],
|
||||
dutyParagraph: [
|
||||
{ required: true, message: "公司税号不能为空", trigger: "blur" },
|
||||
],
|
||||
bank: [{ required: true, message: "开户行不能为空", trigger: "blur" }],
|
||||
bankAccount: [
|
||||
{ required: true, message: "开户行账号不能为空", trigger: "blur" },
|
||||
],
|
||||
bankPhone: [
|
||||
{ required: true, message: "开户行电话不能为空", trigger: "blur" },
|
||||
],
|
||||
email: [{ required: true, message: "电子邮箱不能为空", trigger: "blur" }],
|
||||
phone: [{ required: true, message: "联系电话不能为空", trigger: "blur" }],
|
||||
address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
|
||||
username: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
userPhone: [
|
||||
{ required: true, message: "联系人电话不能为空", trigger: "blur" },
|
||||
],
|
||||
userAddress: [
|
||||
{ required: true, message: "邮寄地址不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
postList.value = [1];
|
||||
total.value = 15;
|
||||
loading.value = false;
|
||||
// demand(queryParams.value).then((response) => {
|
||||
// console.log(response);
|
||||
// // postList.value = response.data.data;
|
||||
// // total.value = response.data.count;
|
||||
// loading.value = false;
|
||||
// });
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(id) {
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除订单号为"' + id + '"的数据项?')
|
||||
.then(function () {
|
||||
return demandDelete(postIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
function handleEdit(id) {
|
||||
router.push({ path: "./release", query: { id } });
|
||||
}
|
||||
getList();
|
||||
</script>
|
173
src/views/admin/enterprise/extension/business.vue
Normal file
173
src/views/admin/enterprise/extension/business.vue
Normal file
@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-loading="loading">
|
||||
<div class="item" v-for="item in dataList" :key="item.id">
|
||||
<div style="margin: 10px 0 10px 0">浏览时间:2022-02-02 22:00:00</div>
|
||||
<el-row type="flex" style="justify-content: space-between">
|
||||
<div style="display: flex">
|
||||
<div class="img">
|
||||
<img :src="item.image" alt />
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="tit" @click="handleDetail(item.id)">
|
||||
<div class="text" style="flex: 1">{{ item.name }}</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
企业规模:
|
||||
<span>{{ item.kind_title || "后台暂没提供" }}</span>
|
||||
</div>
|
||||
<div class="line">
|
||||
核心产品及应用场景: <span>{{ item.product }}</span>
|
||||
</div>
|
||||
<div class="line">
|
||||
企业网站:
|
||||
<a :href="item.url"
|
||||
><span>{{ item.url || "后台暂没提供" }}</span></a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="keywords">
|
||||
<wordcloud :data="createdData(item.keywords)"></wordcloud>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-divider border-style="dashed"></el-divider>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import wordcloud from "@/views/admin/components/wordcloud.vue";
|
||||
|
||||
const dataList = ref([]);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
postCode: undefined,
|
||||
type: "1",
|
||||
},
|
||||
});
|
||||
const { queryParams } = toRefs(data);
|
||||
const router = useRouter();
|
||||
|
||||
/** 查询列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
dataList.value = [
|
||||
{
|
||||
id: "E8MnaAkwDj1X",
|
||||
kind: 103,
|
||||
name: "熊",
|
||||
image:
|
||||
"http://192.168.0.149:8000/upload/20220221/5b3fe85e89eea53535783ccbd7905c80.jpg",
|
||||
product: "核心成果核心产品",
|
||||
url: "",
|
||||
industrys: ["农、林、牧、渔业/农业/测试名称", "采矿业/煤炭开采和洗选业"],
|
||||
keywords: ["关键词1", "关键词2"],
|
||||
},
|
||||
{
|
||||
id: "6bPKVW8aZzXo",
|
||||
kind: 103,
|
||||
name: "单位名称",
|
||||
image:
|
||||
"http://192.168.0.149:8000/upload/20220222/4bad3f051b8f08d651ff8835fb785e46.jpg",
|
||||
product: "核心成果核心产品",
|
||||
url: "",
|
||||
industrys: [
|
||||
"农、林、牧、渔业/农业/测试名称",
|
||||
"采矿业/石油和天然气开采业",
|
||||
],
|
||||
keywords: ["关键词1", "关键词2"],
|
||||
},
|
||||
];
|
||||
total.value = 15;
|
||||
loading.value = false;
|
||||
// loading.value = true;
|
||||
// listPost(queryParams.value).then(
|
||||
// (response) => {
|
||||
// postList.value = response.rows;
|
||||
// total.value = response.total;
|
||||
// loading.value = false;
|
||||
// }
|
||||
// );
|
||||
}
|
||||
function createdData(arr) {
|
||||
let l = [];
|
||||
let snap = JSON.parse(JSON.stringify(arr));
|
||||
snap.map((e) => {
|
||||
l.push({ name: e, value: 30 });
|
||||
return { name: e, value: 30 };
|
||||
});
|
||||
return l;
|
||||
}
|
||||
function handleDetail(id) {
|
||||
let routeData = router.resolve({
|
||||
path: `/searchList/0/detail/${id}`,
|
||||
query: { keyword: null },
|
||||
});
|
||||
window.open(routeData.href, "_blank");
|
||||
}
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.item {
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
// margin-bottom: 16px;
|
||||
|
||||
.img {
|
||||
width: 90px;
|
||||
margin-right: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
img {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
display: inline-block;
|
||||
width: 390px;
|
||||
.line {
|
||||
font-size: 16px;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
margin: 10px 0;
|
||||
span {
|
||||
font-size: 16px;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
// .keywords {
|
||||
// flex: 1;
|
||||
// width: 129px;
|
||||
// height: 129px;
|
||||
// }
|
||||
.tit {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
.text {
|
||||
margin-right: 200px;
|
||||
overflow: hidden;
|
||||
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 20px;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
201
src/views/admin/enterprise/extension/product.vue
Normal file
201
src/views/admin/enterprise/extension/product.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<router-link to="./release">
|
||||
<el-button type="primary" size="small">发布产品</el-button>
|
||||
</router-link>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-radio-group
|
||||
v-model="queryParams.status"
|
||||
size="small"
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-radio-button label="1">已发布</el-radio-button>
|
||||
<el-radio-button label="0">待审核</el-radio-button>
|
||||
<el-radio-button label="2">已驳回</el-radio-button>
|
||||
<el-radio-button label="3">草稿箱</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-table v-loading="loading" :data="productList" style="margin-top: 20px">
|
||||
<el-table-column label="数据编号" prop="id" />
|
||||
<el-table-column label="产品名称" prop="title" />
|
||||
<el-table-column label="产品领域" prop="industryStr" />
|
||||
<!-- <el-table-column label="浏览量" prop="visit_count" /> -->
|
||||
<el-table-column label="发布时间" prop="createTime" width="180">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" class-name="small-padding fixed-width">
|
||||
<template #default="{ row }">
|
||||
<router-link
|
||||
:to="{ path: './release', query: { id: row.id } }"
|
||||
v-if="queryParams.status == 0"
|
||||
>
|
||||
<el-button size="small" type="text" icon="Edit">编辑</el-button>
|
||||
</router-link>
|
||||
|
||||
<el-button
|
||||
v-if="queryParams.status == 2"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="Download"
|
||||
@click="handleShelf(row)"
|
||||
>下架</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="queryParams.status != 1"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="queryParams.status == 2"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="View"
|
||||
@click="handleResults(row.id)"
|
||||
>查看匹配结果</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="queryParams.status == 2"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="View"
|
||||
@click="handlePages(row.id)"
|
||||
>浏览企业信息</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="queryParams.status == 1"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="Close"
|
||||
>取消发布</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Product">
|
||||
// import {
|
||||
// expertAchievement,
|
||||
// achievementShelf,
|
||||
// achievementDelete,
|
||||
// } from "@/api/admin/expert/technology";
|
||||
import { getEnterpriseProduct } from "@/api/enterprise";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const router = useRouter();
|
||||
|
||||
const productList = ref([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
status: "0",
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "公司名称不能为空", trigger: "blur" }],
|
||||
dutyParagraph: [
|
||||
{ required: true, message: "公司税号不能为空", trigger: "blur" },
|
||||
],
|
||||
bank: [{ required: true, message: "开户行不能为空", trigger: "blur" }],
|
||||
bankAccount: [
|
||||
{ required: true, message: "开户行账号不能为空", trigger: "blur" },
|
||||
],
|
||||
bankPhone: [
|
||||
{ required: true, message: "开户行电话不能为空", trigger: "blur" },
|
||||
],
|
||||
email: [{ required: true, message: "电子邮箱不能为空", trigger: "blur" }],
|
||||
phone: [{ required: true, message: "联系电话不能为空", trigger: "blur" }],
|
||||
address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
|
||||
username: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
userPhone: [
|
||||
{ required: true, message: "联系人电话不能为空", trigger: "blur" },
|
||||
],
|
||||
userAddress: [
|
||||
{ required: true, message: "邮寄地址不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const resp = await getEnterpriseProduct(queryParams.value);
|
||||
productList.value = resp.rows;
|
||||
total.value = resp.total;
|
||||
loading.value = false;
|
||||
};
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(id) {
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除数据编号为"' + id + '"的产品项?')
|
||||
.then(function () {
|
||||
return achievementDelete({ id });
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
function handleShelf(row) {
|
||||
let text = row.shelf_status == 2 ? "上架" : "下架";
|
||||
proxy.$modal
|
||||
.confirm('确认要"' + text + '""' + row.id + '"的产品吗?')
|
||||
.then(function () {
|
||||
let status = row.shelf_status == 1 ? 2 : 1;
|
||||
return achievementShelf({ id: row.id, status });
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(text + "成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
function handleResults(id) {
|
||||
router.push({ path: "./results" });
|
||||
}
|
||||
function handlePages(id) {
|
||||
router.push({ path: "./business" });
|
||||
}
|
||||
|
||||
// console.log(route);
|
||||
getList();
|
||||
</script>
|
47
src/views/admin/enterprise/extension/release.vue
Normal file
47
src/views/admin/enterprise/extension/release.vue
Normal file
@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto">
|
||||
<ReleaseForm
|
||||
v-model="form"
|
||||
:isAdd="false"
|
||||
:labelWidth="labelWidth"
|
||||
ref="releaseFormRef"
|
||||
/>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button type="primary" @click="submitForm('0')">保存草稿</el-button>
|
||||
<el-button type="primary" @click="submitForm('1')">提交审核</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { insertEnterpriseProduct } from "@/api/enterprise";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import ReleaseForm from "../components/ReleaseForm";
|
||||
import { getProductById } from "@/api/enterprise";
|
||||
const route = useRoute();
|
||||
const labelWidth = 140;
|
||||
const form = reactive({});
|
||||
const router = useRouter();
|
||||
const releaseFormRef = ref();
|
||||
|
||||
const submitForm = async (status) => {
|
||||
form.status = status;
|
||||
const valid = await releaseFormRef.value.validateForm();
|
||||
if (valid) {
|
||||
await insertEnterpriseProduct(form);
|
||||
ElMessage.success("新增产品成功");
|
||||
router.go(-1);
|
||||
} else {
|
||||
console.log("校验未通过");
|
||||
}
|
||||
};
|
||||
if (route.query.id) {
|
||||
getProductById({ id: route.query.id }).then((resp) => {
|
||||
console.log(resp);
|
||||
});
|
||||
// console.log(route.query.id);
|
||||
// queryParams.value.id = route.query.id;
|
||||
}
|
||||
</script>
|
222
src/views/admin/enterprise/extension/results.vue
Normal file
222
src/views/admin/enterprise/extension/results.vue
Normal file
@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-radio-group
|
||||
v-model="queryParams.type"
|
||||
size="mini"
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-radio-button label="1">成果</el-radio-button>
|
||||
<el-radio-button label="2">专利</el-radio-button>
|
||||
<el-radio-button label="3">专家</el-radio-button>
|
||||
<el-radio-button label="4">实验室</el-radio-button>
|
||||
<el-radio-button label="5">企业</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-col
|
||||
:xs="12"
|
||||
:sm="6"
|
||||
:lg="4"
|
||||
style="margin-top: 20px"
|
||||
v-for="item in 10"
|
||||
:key="item"
|
||||
>
|
||||
<div style="border: 1px solid #787878">
|
||||
<div style="text-align: right">
|
||||
<el-tag type="warning" effect="dark" style="border-radius: 0">
|
||||
7.8万
|
||||
</el-tag>
|
||||
</div>
|
||||
<div style="padding: 10px">
|
||||
<div class="ellipsis">
|
||||
高碳当量高强度灰铁材质研发高碳当量高强度灰铁材质研发
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
margin: 10px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<el-tag type="info" effect="plain">所属领域</el-tag>
|
||||
<el-tag type="info" effect="plain">普通企业需求</el-tag>
|
||||
</div>
|
||||
<div style="margin-bottom: 10px">研发类型:</div>
|
||||
<div>截止时间:</div>
|
||||
</div>
|
||||
<div class="btn_info pointer">查看详情</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
|
||||
<div style="margin-top: 20px" v-loading="loading">
|
||||
<section v-for="item in postList" :key="item.id">
|
||||
<div style="border: 1px solid #dcdcdc; margin-bottom: 10px">
|
||||
<gainItem :data="item"></gainItem>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- <pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Post">
|
||||
import {
|
||||
listPost,
|
||||
addPost,
|
||||
delPost,
|
||||
getPost,
|
||||
updatePost,
|
||||
} from "@/api/system/post";
|
||||
import gainItem from "@/views/admin/components/gainItem.vue";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const router = useRouter();
|
||||
|
||||
const postList = ref([]);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
postCode: undefined,
|
||||
type: "1",
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "公司名称不能为空", trigger: "blur" }],
|
||||
dutyParagraph: [
|
||||
{ required: true, message: "公司税号不能为空", trigger: "blur" },
|
||||
],
|
||||
bank: [{ required: true, message: "开户行不能为空", trigger: "blur" }],
|
||||
bankAccount: [
|
||||
{ required: true, message: "开户行账号不能为空", trigger: "blur" },
|
||||
],
|
||||
bankPhone: [
|
||||
{ required: true, message: "开户行电话不能为空", trigger: "blur" },
|
||||
],
|
||||
email: [{ required: true, message: "电子邮箱不能为空", trigger: "blur" }],
|
||||
phone: [{ required: true, message: "联系电话不能为空", trigger: "blur" }],
|
||||
address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
|
||||
username: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
userPhone: [
|
||||
{ required: true, message: "联系人电话不能为空", trigger: "blur" },
|
||||
],
|
||||
userAddress: [
|
||||
{ required: true, message: "邮寄地址不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询列表 */
|
||||
function getList() {
|
||||
postList.value = [
|
||||
{
|
||||
is_collect: true,
|
||||
id: "Q7K1Jx6VYodq",
|
||||
mode: 1,
|
||||
title: "测试6",
|
||||
description: "",
|
||||
image: "",
|
||||
file: "",
|
||||
maturity: 1,
|
||||
lead_standard: 0,
|
||||
cooperation_mode: 101,
|
||||
config: "",
|
||||
introduce: "",
|
||||
shelf_status: 0,
|
||||
status: 0,
|
||||
created_at: "0001-01-01T00:00:00Z",
|
||||
updated_at: "0001-01-01T00:00:00Z",
|
||||
research_name: "",
|
||||
visit_count: 0,
|
||||
collect_count: 0,
|
||||
mode_title: "免费模式",
|
||||
maturity_title: "正在研发",
|
||||
cooperation_mode_title: "技术转让",
|
||||
customers: ["关键词1", "关键词2"],
|
||||
industrys: ["农、林、牧、渔业/农业", "采矿业/煤炭开采和洗选业", "制造业"],
|
||||
keywords: ["关键词1", "关键词2"],
|
||||
},
|
||||
{
|
||||
is_collect: false,
|
||||
id: "gympJE5JrLxe",
|
||||
mode: 1,
|
||||
title: "测试5",
|
||||
description: "",
|
||||
image: "",
|
||||
file: "",
|
||||
maturity: 1,
|
||||
lead_standard: 0,
|
||||
cooperation_mode: 101,
|
||||
config: "",
|
||||
introduce: "",
|
||||
shelf_status: 0,
|
||||
status: 0,
|
||||
created_at: "0001-01-01T00:00:00Z",
|
||||
updated_at: "0001-01-01T00:00:00Z",
|
||||
research_name: "",
|
||||
visit_count: 0,
|
||||
collect_count: 0,
|
||||
mode_title: "免费模式",
|
||||
maturity_title: "正在研发",
|
||||
cooperation_mode_title: "技术转让",
|
||||
customers: ["关键词1", "关键词2"],
|
||||
industrys: ["农、林、牧、渔业/农业", "采矿业/煤炭开采和洗选业", "制造业"],
|
||||
keywords: ["关键词1", "关键词2"],
|
||||
},
|
||||
];
|
||||
total.value = 15;
|
||||
loading.value = false;
|
||||
// loading.value = true;
|
||||
// listPost(queryParams.value).then(
|
||||
// (response) => {
|
||||
// postList.value = response.rows;
|
||||
// total.value = response.total;
|
||||
// loading.value = false;
|
||||
// }
|
||||
// );
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(id) {
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除订单号为"' + id + '"的数据项?')
|
||||
.then(function () {
|
||||
return delPost(postIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
function handleResults(id) {
|
||||
router.push({ path: "./results" });
|
||||
}
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.btn_info {
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
background-color: #787878;
|
||||
}
|
||||
</style>
|
93
src/views/admin/index.vue
Normal file
93
src/views/admin/index.vue
Normal file
@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="card-panel surplus-currency" :class="flag ? 'vip-box' : ''">
|
||||
<div class="_tit">
|
||||
<span> 会员banner图 </span>
|
||||
<div class="fr" v-if="flag">
|
||||
<div class="text-right">续期</div>
|
||||
<div>升级VIP</div>
|
||||
</div>
|
||||
<div class="text-right" style="margin-top: 50px" v-if="flag">
|
||||
会员剩余天数:89天
|
||||
</div>
|
||||
</div>
|
||||
<span class="pointer" style="font-size: 14px" v-if="flag">
|
||||
查看会员权益
|
||||
</span>
|
||||
<p class="text-center pointer" v-else>开通VIP</p>
|
||||
</div>
|
||||
|
||||
<div class="card-panel surplus-currency">
|
||||
<span style="margin-right: 50px; font-size: 16px; font-weight: 700"
|
||||
>剩余创新币:98</span
|
||||
>
|
||||
<el-button class="x_btns">创新币充值</el-button>
|
||||
</div>
|
||||
|
||||
<el-card style="margin-top: 20px">
|
||||
<template #header>
|
||||
<div>快捷功能</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<router-link to="/extension/release">
|
||||
<el-card shadow="never" class="text-center pointer">
|
||||
发布产品
|
||||
</el-card>
|
||||
</router-link>
|
||||
</el-col>
|
||||
<el-col :span="21">
|
||||
<el-card shadow="never" class="text-center">文字简介</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" class="mt20">
|
||||
<el-col :span="3">
|
||||
<router-link to="/demand/released">
|
||||
<el-card shadow="never" class="text-center pointer">
|
||||
发布需求
|
||||
</el-card>
|
||||
</router-link>
|
||||
</el-col>
|
||||
<el-col :span="21">
|
||||
<el-card shadow="never" class="text-center">(技术需求)</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const flag = ref(true);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(el-card__header) {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
div {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
.surplus-currency {
|
||||
margin-bottom: 20px;
|
||||
height: 150px;
|
||||
background-color: #f2f2f2;
|
||||
padding: 20px 50px;
|
||||
._tit {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #bebebe;
|
||||
div {
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
.vip-box {
|
||||
height: auto;
|
||||
background-color: yellow;
|
||||
}
|
||||
</style>
|
174
src/views/components/CityOptions/index.vue
Normal file
174
src/views/components/CityOptions/index.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
: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
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
:disabled="provinceSelectList.length === 0"
|
||||
@change="provinceChanged"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in provinceSelectList"
|
||||
:key="item.provinceCode"
|
||||
:label="item.provinceName"
|
||||
:value="item.provinceCode"
|
||||
>
|
||||
</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
|
||||
filterable
|
||||
:disabled="citySelectList.length === 0"
|
||||
placeholder="请选择"
|
||||
@change="cityChanged"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in citySelectList"
|
||||
:key="item.cityCode"
|
||||
:label="item.cityName"
|
||||
:value="item.cityCode"
|
||||
>
|
||||
</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
|
||||
filterable
|
||||
:disabled="districtSelectList.length === 0"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in districtSelectList"
|
||||
:key="item.areaCode"
|
||||
:label="item.areaName"
|
||||
:value="item.areaCode"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup name="CityOptions">
|
||||
import { provinceList, cityList, districtList } from "@/api/config";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
});
|
||||
const { modelValue, labelWidth } = toRefs(props);
|
||||
const formRef = ref(null);
|
||||
const provinceSelectList = ref([]); // 省
|
||||
const citySelectList = ref([]); // 市
|
||||
const districtSelectList = ref([]); // 区\
|
||||
const data = reactive({
|
||||
rules: {
|
||||
province: [
|
||||
{ required: true, message: "请选择", trigger: ["change", "blue"] },
|
||||
],
|
||||
city: [{ required: true, message: "请选择", trigger: ["change", "blue"] }],
|
||||
district: [
|
||||
{ required: true, message: "请选择", trigger: ["change", "blue"] },
|
||||
],
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
// 获取 省列表
|
||||
const getProvinceList = async () => {
|
||||
const resp = await provinceList();
|
||||
provinceSelectList.value = resp.data.map((el) => {
|
||||
return { ...el, provinceCode: el.provinceCode.toString() };
|
||||
});
|
||||
};
|
||||
// 获取市列表
|
||||
const getCityListByProvinceId = async (provinceId) => {
|
||||
const { data } = await cityList(provinceId);
|
||||
citySelectList.value = data.map((el) => {
|
||||
return {
|
||||
...el,
|
||||
cityCode: el.cityCode.toString(),
|
||||
};
|
||||
});
|
||||
};
|
||||
// 根据市id获取县区列表
|
||||
const getAreaListByCityId = async (cityId) => {
|
||||
const { data } = await districtList(cityId);
|
||||
districtSelectList.value = data.map((el) => {
|
||||
return {
|
||||
...el,
|
||||
areaCode: el.areaCode.toString(),
|
||||
};
|
||||
});
|
||||
};
|
||||
// 当省改变时
|
||||
const provinceChanged = () => {
|
||||
// 清除市县代码列表
|
||||
modelValue.value.city = undefined;
|
||||
modelValue.value.district = undefined;
|
||||
// 清除市县列表
|
||||
citySelectList.value = [];
|
||||
districtSelectList.value = [];
|
||||
// 重新请求城市列表
|
||||
modelValue.value.province &&
|
||||
getCityListByProvinceId(modelValue.value.province);
|
||||
};
|
||||
// 当市改变时
|
||||
const cityChanged = () => {
|
||||
// 清除县区代码列表
|
||||
modelValue.value.district = undefined;
|
||||
districtSelectList.value = [];
|
||||
modelValue.value.city && getAreaListByCityId(modelValue.value.city);
|
||||
};
|
||||
|
||||
const validateForm = async () => {
|
||||
try {
|
||||
return await formRef.value.validate();
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
watch(modelValue, (val) => {
|
||||
if (val.province) {
|
||||
getCityListByProvinceId(val.province);
|
||||
}
|
||||
if (val.city) {
|
||||
getAreaListByCityId(val.city);
|
||||
}
|
||||
});
|
||||
|
||||
getProvinceList();
|
||||
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
</script>
|
263
src/views/components/EnterpriseForm/index.vue
Normal file
263
src/views/components/EnterpriseForm/index.vue
Normal file
@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
>
|
||||
<div class="form_title" v-if="showTitle">基本信息</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 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="cityFormRef"
|
||||
/>
|
||||
|
||||
<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>
|
||||
|
||||
<FieldOptions
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldFormRef"
|
||||
/>
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="关键词"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
fieldKey="keywords"
|
||||
ref="keywordsFormRef"
|
||||
/>
|
||||
<InputBoxAdd
|
||||
v-if="isAdd"
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="生产方向"
|
||||
placeholder="请输入生产方向"
|
||||
fieldKey="directions"
|
||||
ref="directionsFormRef"
|
||||
/>
|
||||
|
||||
<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 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">
|
||||
<WangEditor v-model="modelValue.introduce" :minHeight="300" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup name="EnterpriseForm">
|
||||
import CityOptions from "../CityOptions";
|
||||
import FieldOptions from "../FieldOptions";
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
// import { researchSelect, laboratorySelect } from "@/api/identity/index";
|
||||
import WangEditor from "@/components/WangEditor";
|
||||
import { enterpriseOptions } from "@/utils/parameter";
|
||||
import { toRefs } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
});
|
||||
const { modelValue, isAdd, showTitle, labelWidth } = toRefs(props);
|
||||
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",
|
||||
},
|
||||
],
|
||||
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 { rules } = toRefs(data);
|
||||
|
||||
const formRef = ref();
|
||||
const cityFormRef = ref();
|
||||
const fieldFormRef = ref();
|
||||
const keywordsFormRef = ref();
|
||||
const directionsFormRef = ref();
|
||||
|
||||
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(); // 关键词表单验证
|
||||
console.log(cityFormValid);
|
||||
if (isAdd.value) {
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm();
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
keywordsFormValid &&
|
||||
directionsFormValid
|
||||
);
|
||||
} else {
|
||||
return formValid && cityFormValid && fieldFormValid && keywordsFormValid;
|
||||
}
|
||||
};
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
</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>
|
218
src/views/components/FieldOptions/index.vue
Normal file
218
src/views/components/FieldOptions/index.vue
Normal file
@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属领域:" required :show-message="false">
|
||||
<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.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="fields[1]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
:disabled="levelII.length === 0"
|
||||
@change="levelIIChange"
|
||||
>
|
||||
<el-option
|
||||
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="请选择"
|
||||
>
|
||||
<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-button type="primary" @click="check">验证</el-button> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="e_tag">
|
||||
<el-tag
|
||||
v-for="(tag, index) in industrysTags"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleFieldClose(index)"
|
||||
>
|
||||
{{ getFieldNameById(tag) }}
|
||||
<!-- <template v-if="Array.isArray(tag)">
|
||||
<span v-for="(item, i) in tag" :key="item">
|
||||
{{ 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 setup name="FieldOptions">
|
||||
// import { industry } from "@/api/config";
|
||||
import { listSysIndustry } from "@/api/config";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { toRefs, watch } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const { modelValue, labelWidth, disabled } = toRefs(props);
|
||||
const formRef = ref(null);
|
||||
const levelI = ref([]); // I级数据
|
||||
const levelII = ref([]); // II级数据
|
||||
const levelIII = ref([]); // III级数据
|
||||
const fields = ref([]); // 当前下拉框选中的集合
|
||||
const industrysTags = ref([]); // 点击添加按钮后临时存储的数据集合
|
||||
const data = reactive({
|
||||
rules: {
|
||||
industrys: [
|
||||
{
|
||||
type: "array",
|
||||
required: true,
|
||||
message: "请选择并添加",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
const { rules } = toRefs(data);
|
||||
|
||||
// 获取领域树形列表
|
||||
const getIndustryTreeData = async () => {
|
||||
const { data } = await listSysIndustry();
|
||||
levelI.value = data;
|
||||
};
|
||||
|
||||
const levelIChange = async (item) => {
|
||||
delete fields.value[1];
|
||||
delete fields.value[2];
|
||||
levelII.value = levelI.value.find((el) => {
|
||||
return el.id === item;
|
||||
}).children;
|
||||
};
|
||||
|
||||
const levelIIChange = async (item) => {
|
||||
delete fields.value[2];
|
||||
levelIII.value = levelII.value.find((el) => el.id === item).children;
|
||||
};
|
||||
|
||||
// 根据id获取领域名称
|
||||
// TODO:如果领域已经被删除,则显示未知领域
|
||||
const getFieldNameById = (ids) => {
|
||||
if (levelI.value.length === 0) {
|
||||
return;
|
||||
}
|
||||
let fieldNameList = [];
|
||||
let subFieldList = [];
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
const id = ids[i];
|
||||
if (fieldNameList.length === 0) {
|
||||
subFieldList = levelI.value.find((el) => el.id == id)?.children;
|
||||
fieldNameList.push(levelI.value.find((el) => id === el.id)?.name);
|
||||
} else {
|
||||
fieldNameList.push(subFieldList.find((el) => id === el.id)?.name);
|
||||
subFieldList = subFieldList.find((el) => el.id == id)?.children;
|
||||
}
|
||||
}
|
||||
return fieldNameList.join(">");
|
||||
};
|
||||
|
||||
// 所属领域添加按钮
|
||||
const fieldAdd = () => {
|
||||
if (!fields.value.length) return ElMessage.error("请选择领域类型");
|
||||
industrysTags.value.push(fields.value);
|
||||
if (!modelValue.value.industrys) modelValue.value.industrys = [];
|
||||
modelValue.value.industrys.push(fields.value.join("-"));
|
||||
fields.value = [];
|
||||
levelII.value = [];
|
||||
levelIII.value = [];
|
||||
};
|
||||
|
||||
const handleFieldClose = (index) => {
|
||||
industrysTags.value.splice(index, 1);
|
||||
modelValue.value.industrys.splice(index, 1);
|
||||
formRef.value.validate();
|
||||
};
|
||||
|
||||
const validateForm = async () => {
|
||||
try {
|
||||
return await formRef.value.validate();
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
getIndustryTreeData();
|
||||
|
||||
watch(modelValue, (newVal) => {
|
||||
modelValue.value.industrys = [];
|
||||
industrysTags.value = [];
|
||||
modelValue.value.industrys.push(...modelValue.value.industry.split(","));
|
||||
for (const field of modelValue.value.industry.split(",")) {
|
||||
industrysTags.value.push(field.split("-").map((el) => parseInt(el)));
|
||||
}
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.e_tag {
|
||||
.el-tag {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
146
src/views/components/FieldSingle/index.vue
Normal file
146
src/views/components/FieldSingle/index.vue
Normal file
@ -0,0 +1,146 @@
|
||||
<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="industrys">
|
||||
<el-select
|
||||
v-model="modelValue.industrys[0]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
@change="levelIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelI"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-select
|
||||
v-model="modelValue.industrys[1]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
@change="levelIIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-select
|
||||
v-model="modelValue.industrys[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-row>
|
||||
</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级数据
|
||||
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;
|
||||
// },
|
||||
},
|
||||
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(id) {
|
||||
delete this.modelValue.industrys[1];
|
||||
delete this.modelValue.industrys[2];
|
||||
this.levelII = await this.getFieldByParent(id);
|
||||
},
|
||||
async levelIIChange(id) {
|
||||
delete this.modelValue.industrys[2];
|
||||
this.levelIII = await this.getFieldByParent(id);
|
||||
},
|
||||
submitForm() {
|
||||
let flag = false;
|
||||
this.$refs["form"].validate((valid) => {
|
||||
flag = valid;
|
||||
});
|
||||
return flag;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
industry().then((res) => {
|
||||
this.levelI = res.data;
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
109
src/views/components/InputBoxAdd/index.vue
Normal file
109
src/views/components/InputBoxAdd/index.vue
Normal file
@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:label-width="`${labelWidth}px`"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<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 modelValue[fieldKey]"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleFieldClose(fieldKey, index)"
|
||||
>
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup name="InputBoxAdd">
|
||||
// import { industry } from "@/api/config";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { ref, toRefs } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
fieldKey: {
|
||||
require: true,
|
||||
type: String,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const { modelValue, title, fieldKey, placeholder, disabled, labelWidth } =
|
||||
toRefs(props);
|
||||
const dataVal = ref("");
|
||||
const formRef = ref(null);
|
||||
const keyWordAdd = () => {
|
||||
if (!dataVal.value.length) return ElMessage.error(`请输入${title.value}`);
|
||||
if (!modelValue.value[fieldKey.value]) modelValue.value[fieldKey.value] = [];
|
||||
modelValue.value[fieldKey.value].push(dataVal.value);
|
||||
dataVal.value = "";
|
||||
};
|
||||
const handleFieldClose = (val, index) => {
|
||||
modelValue.value[val].splice(index, 1);
|
||||
};
|
||||
|
||||
const validateForm = async () => {
|
||||
try {
|
||||
return await formRef.value.validate();
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.e_tag {
|
||||
width: 100%;
|
||||
.el-tag {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
42
src/views/identity/enterprise.vue
Normal file
42
src/views/identity/enterprise.vue
Normal file
@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto">
|
||||
<EnterpriseForm
|
||||
v-model="form"
|
||||
:isAdd="false"
|
||||
:labelWidth="labelWidth"
|
||||
ref="enterpriseFormRef"
|
||||
/>
|
||||
<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 { insertEnterprise } from "@/api/identity/index";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { reactive, toRefs } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import EnterpriseForm from "../components/EnterpriseForm/index.vue";
|
||||
|
||||
const router = useRouter();
|
||||
const labelWidth = 140;
|
||||
|
||||
const data = reactive({ form: {} });
|
||||
const { form } = toRefs(data);
|
||||
const enterpriseFormRef = ref();
|
||||
|
||||
const submitForm = async (status) => {
|
||||
const valid = await enterpriseFormRef.value.validateForm();
|
||||
if (valid) {
|
||||
insertEnterprise(form.value).then(() => {
|
||||
ElMessage.success("新增成功");
|
||||
router.go(-1);
|
||||
});
|
||||
} else {
|
||||
console.log("校验未通过");
|
||||
}
|
||||
};
|
||||
</script>
|
172
src/views/identity/index.vue
Normal file
172
src/views/identity/index.vue
Normal file
@ -0,0 +1,172 @@
|
||||
<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.slice(0, 5)"
|
||||
: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>
|
||||
<!-- <div v-else-if="item.status == 4">
|
||||
<el-link type="primary">申请</el-link>
|
||||
</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.slice(0, 5)"
|
||||
: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 store from "@/store";
|
||||
import { identity, settled, identitySwitch } from "@/api/identity/index";
|
||||
import { useRouter } from "vue-router";
|
||||
import usePermissionStore from "@/store/modules/permission";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
const router = useRouter();
|
||||
|
||||
const permissionStore = usePermissionStore();
|
||||
const userStore = useUserStore();
|
||||
const identityList = ref([]);
|
||||
const identityDict = {
|
||||
1: "企业",
|
||||
2: "专家",
|
||||
3: "研究机构",
|
||||
4: "实验室",
|
||||
5: "科技经纪人",
|
||||
// 6: "企业后台",
|
||||
// 7: "专家后台",
|
||||
// 8: "研究机构后台",
|
||||
// 9: "实验室后台",
|
||||
// 10: "科技经纪人后台",
|
||||
};
|
||||
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);
|
||||
// }
|
||||
// });
|
||||
});
|
||||
});
|
||||
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) {
|
||||
if (noClicking()) return alert("你有已入住申请中");
|
||||
if (item.status === "4" || 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 == 3) {
|
||||
// 研究机构
|
||||
router.push({ path: "/identity/research" });
|
||||
} else if (item.id == 4) {
|
||||
// 实验室
|
||||
router.push({ path: "/identity/laboratory" });
|
||||
} else if (item.id == 5) {
|
||||
// 科技经纪人
|
||||
router.push({ path: "/identity/agent" });
|
||||
}
|
||||
} else if (item.status === 1) {
|
||||
alert("您已入驻,请进入后台");
|
||||
} else {
|
||||
}
|
||||
}
|
||||
const handlePage = async (item) => {
|
||||
let routeData = "";
|
||||
if (item.id == 1) {
|
||||
// 企业
|
||||
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 == 4) {
|
||||
// 实验室
|
||||
routeData = router.resolve({ path: "/admin" });
|
||||
} else if (item.id == 5) {
|
||||
// 科技经纪人
|
||||
routeData = router.resolve({ path: "/five" });
|
||||
}
|
||||
// return window.open(routeData.href, "_blank");
|
||||
// TODO ...... 切换身份待处理
|
||||
// await permissionStore.generateRoutes(item.id);
|
||||
userStore.switchRole(item.id);
|
||||
// console.log(userStore.roleId);
|
||||
window.open(routeData.href, "_blank");
|
||||
// identitySwitch({ identity: item.id - 0 }).then((res) => {
|
||||
// window.open(routeData.href, "_blank");
|
||||
// console.log(res);
|
||||
// });
|
||||
// store.dispatch("GenerateRoutes", 1).then(() => {
|
||||
// console.log(localStorage.getItem("select_identity"));
|
||||
// window.open(routeData.href, "_blank");
|
||||
// });
|
||||
};
|
||||
</script>
|
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>
|
1
src/views/identity/test.vue
Normal file
1
src/views/identity/test.vue
Normal file
@ -0,0 +1 @@
|
||||
<template>12341test</template>
|
3
src/views/test.vue
Normal file
3
src/views/test.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<h1>test</h1>
|
||||
</template>
|
10
src/views/website/home/index.vue
Normal file
10
src/views/website/home/index.vue
Normal file
@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
{{ msg }}
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const msg = ref("hekko");
|
||||
</script>
|
353
src/views/website/login/index.vue
Normal file
353
src/views/website/login/index.vue
Normal file
@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<div class="content">
|
||||
<img class="loginImg" src="@/assets/images/login.png" alt="" srcset="" />
|
||||
<div class="login-form">
|
||||
<el-tabs v-model="loginForm.mode" v-if="isLogin == 1">
|
||||
<el-tab-pane label="账号密码登录" name="102"></el-tab-pane>
|
||||
<el-tab-pane label="手机快捷登录" name="101"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-if="isLogin == 1">
|
||||
<el-form ref="loginRef" :model="loginForm" :rules="loginRules">
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
type="text"
|
||||
auto-complete="off"
|
||||
placeholder="手机号"
|
||||
>
|
||||
<template #prefix>
|
||||
<svg-icon
|
||||
icon-class="user"
|
||||
class="el-input__icon input-icon"
|
||||
/>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password" v-if="loginForm.mode == 102">
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
type="password"
|
||||
auto-complete="off"
|
||||
placeholder="密码"
|
||||
@keyup.enter="handleLogin"
|
||||
>
|
||||
<template #prefix>
|
||||
<svg-icon
|
||||
icon-class="password"
|
||||
class="el-input__icon input-icon"
|
||||
/>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="captcha" v-if="loginForm.mode == 101">
|
||||
<el-input
|
||||
v-model="loginForm.captcha"
|
||||
auto-complete="off"
|
||||
placeholder="验证码"
|
||||
style="width: 65%"
|
||||
@keyup.enter="handleLogin"
|
||||
>
|
||||
<template #prefix>
|
||||
<svg-icon
|
||||
icon-class="validCode"
|
||||
class="el-input__icon input-icon"
|
||||
/>
|
||||
</template>
|
||||
</el-input>
|
||||
<WebGetCode v-model:mobile="loginForm.username" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="loginForm.rememberMe">记住账号</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button
|
||||
class="x_btns"
|
||||
:loading="loading"
|
||||
size="default"
|
||||
type="primary"
|
||||
style="width: 100%"
|
||||
@click.prevent="handleLogin"
|
||||
>
|
||||
<span v-if="!loading">登 录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="overflow: hidden">
|
||||
<div style="float: left" v-if="isLogin == 1">
|
||||
<span class="text_col pointer" :to="'/login'" @click="isLogin = 3"
|
||||
>忘记密码</span
|
||||
>
|
||||
</div>
|
||||
<div style="float: right" v-if="register">
|
||||
<span @click="isLogin = 2" style="color: #0054ff" class="pointer"
|
||||
>注册</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-form
|
||||
v-if="isLogin == 1"
|
||||
:model="registerForm"
|
||||
status-icon
|
||||
:rules="isCheckRules"
|
||||
ref="isCheck"
|
||||
>
|
||||
<el-form-item prop="isCheck">
|
||||
<div style="margin-top: 43px">
|
||||
<div class="text_col">
|
||||
<div>其他登录方式</div>
|
||||
<img
|
||||
class="pointer"
|
||||
src="../../../assets/images/weixin.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<el-checkbox
|
||||
v-model="registerForm.isCheck"
|
||||
style="margin-top: 43px"
|
||||
>
|
||||
<span class="text_col">登录即同意</span
|
||||
><span style="color: #0054ff">《协议》</span>
|
||||
</el-checkbox>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<Register v-model:isLogin="isLogin" v-else-if="isLogin == 2" />
|
||||
<Retrieve v-model:isLogin="isLogin" v-else-if="isLogin == 3" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部 -->
|
||||
<div class="foot">Copyright © 2007-2021 中科云 版权所有</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Cookies from "js-cookie";
|
||||
import { encrypt, decrypt } from "@/utils/jsencrypt";
|
||||
import md5 from "js-md5";
|
||||
import Register from "../register";
|
||||
import Retrieve from "../retrieve";
|
||||
import WebGetCode from "@/components/webGetCode";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
// const store = useStore();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const isLogin = ref(1);
|
||||
console.log(md5);
|
||||
const loginForm = ref({
|
||||
username: "18212342345",
|
||||
password: "12342345",
|
||||
rememberMe: false,
|
||||
mode: "102",
|
||||
captcha: "",
|
||||
});
|
||||
|
||||
const registerForm = ref({
|
||||
isCheck: true,
|
||||
});
|
||||
|
||||
const disabled = ref(true);
|
||||
const buttonName = ref("获取验证码");
|
||||
const isDisabled = ref(false);
|
||||
const time = ref(10);
|
||||
|
||||
const loginRules = {
|
||||
username: [{ required: true, trigger: "blur", message: "请输入您的手机号" }],
|
||||
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
|
||||
// captcha: [{ required: true, trigger: "change", message: "请输入验证码" }],
|
||||
};
|
||||
|
||||
const isCheck = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error("请阅读并勾选"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const isCheckRules = {
|
||||
isCheck: [{ required: true, validator: isCheck, trigger: "change" }],
|
||||
};
|
||||
|
||||
// const codeUrl = ref("");
|
||||
const loading = ref(false);
|
||||
// 注册开关
|
||||
const register = ref(true);
|
||||
const redirect = ref(undefined);
|
||||
|
||||
function handleLogin() {
|
||||
proxy.$refs.loginRef.validate((valid) => {
|
||||
proxy.$refs.isCheck.validate((valid2) => {
|
||||
if (valid && valid2) {
|
||||
loading.value = true;
|
||||
|
||||
if (loginForm.value.rememberMe) {
|
||||
Cookies.set("username", loginForm.value.username, { expires: 30 });
|
||||
Cookies.set("password", loginForm.value.password, {
|
||||
expires: 30,
|
||||
});
|
||||
Cookies.set("rememberMe", loginForm.value.rememberMe, {
|
||||
expires: 30,
|
||||
});
|
||||
} else {
|
||||
// 否则移除
|
||||
Cookies.remove("username");
|
||||
Cookies.remove("password");
|
||||
Cookies.remove("rememberMe");
|
||||
}
|
||||
|
||||
// 调用action的登录方法
|
||||
let formData = Object.assign({}, loginForm.value);
|
||||
formData.password = md5(formData.password);
|
||||
console.log("123435");
|
||||
formData.mode = formData.mode - 0;
|
||||
userStore
|
||||
.login(formData)
|
||||
.then(() => {
|
||||
router.push({ path: redirect.value || "/" });
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getCookie() {
|
||||
const username = Cookies.get("username");
|
||||
const password = Cookies.get("password");
|
||||
const rememberMe = Cookies.get("rememberMe");
|
||||
loginForm.value = {
|
||||
username: username === undefined ? loginForm.value.username : username,
|
||||
password: password === undefined ? loginForm.value.password : password,
|
||||
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
|
||||
mode: loginForm.value.mode,
|
||||
};
|
||||
}
|
||||
getCookie();
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #b1ccff;
|
||||
.content {
|
||||
// padding: 0 250px;
|
||||
// padding: 0 30px;
|
||||
width: 1400px;
|
||||
margin: 0 auto;
|
||||
flex: 1;
|
||||
background: #b1ccff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.loginImg {
|
||||
width: 705px;
|
||||
height: 458px;
|
||||
}
|
||||
}
|
||||
.foot {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
background: #fff;
|
||||
font-size: 14px;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
margin: 0px auto 30px auto;
|
||||
text-align: center;
|
||||
color: #707070;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
width: 516px;
|
||||
min-width: 455px;
|
||||
// height: 517px;
|
||||
background: #ffffff;
|
||||
box-sizing: border-box;
|
||||
padding: 30px 33px;
|
||||
.tit {
|
||||
padding: 30px 0;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
.el-tab-pane {
|
||||
padding-top: 10px;
|
||||
}
|
||||
.el-input {
|
||||
height: 38px;
|
||||
input {
|
||||
height: 38px;
|
||||
}
|
||||
}
|
||||
.input-icon {
|
||||
height: 39px;
|
||||
width: 14px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
::v-deep .el-tabs__active-bar {
|
||||
background-color: #0054ff;
|
||||
}
|
||||
::v-deep .el-tabs__item {
|
||||
color: #666666;
|
||||
font-size: 16px;
|
||||
&.is-active {
|
||||
font-weight: 500;
|
||||
color: #0054ff;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.login-tip {
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
.login-code {
|
||||
width: 30%;
|
||||
height: 38px;
|
||||
float: right;
|
||||
img {
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.el-login-footer {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-family: Arial;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.login-code-img {
|
||||
height: 36px;
|
||||
}
|
||||
.text_col {
|
||||
color: #999999;
|
||||
img {
|
||||
width: 30px;
|
||||
margin: 10px 0 0 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
235
src/views/website/register/index.vue
Normal file
235
src/views/website/register/index.vue
Normal file
@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="registerRef"
|
||||
:model="registerForm"
|
||||
:rules="registerRules"
|
||||
class="register-form"
|
||||
>
|
||||
<h3 class="title">注册</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="registerForm.username"
|
||||
type="text"
|
||||
maxlength="11"
|
||||
auto-complete="off"
|
||||
placeholder="手机号"
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="user" class="el-input__icon input-icon"
|
||||
/></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model="registerForm.password"
|
||||
type="password"
|
||||
auto-complete="off"
|
||||
placeholder="密码"
|
||||
@keyup.enter="handleRegister"
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="password" class="el-input__icon input-icon"
|
||||
/></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="repeat_pass">
|
||||
<el-input
|
||||
v-model="registerForm.repeat_pass"
|
||||
type="password"
|
||||
auto-complete="off"
|
||||
placeholder="确认密码"
|
||||
@keyup.enter="handleRegister"
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="password" class="el-input__icon input-icon"
|
||||
/></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="captcha" style="margin-bottom: 0">
|
||||
<el-input
|
||||
v-model="registerForm.captcha"
|
||||
auto-complete="off"
|
||||
placeholder="验证码"
|
||||
style="width: 65%"
|
||||
@keyup.enter="handleRegister"
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="validCode" class="el-input__icon input-icon"
|
||||
/></template>
|
||||
</el-input>
|
||||
<webGetCode v-model:username="registerForm.username" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="isCheck" style="margin: 10px 0; height: 28px">
|
||||
<el-checkbox v-model="registerForm.isCheck">
|
||||
<span style="color: #999999">勾选即同意</span
|
||||
><span style="color: #0054ff">《协议》</span>
|
||||
</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%; margin-top: 35px">
|
||||
<el-button
|
||||
class="x_btns"
|
||||
:loading="loading"
|
||||
size="default"
|
||||
type="primary"
|
||||
style="width: 100%"
|
||||
@click.prevent="handleRegister"
|
||||
>
|
||||
<span v-if="!loading">注 册</span>
|
||||
<span v-else>注 册 中...</span>
|
||||
</el-button>
|
||||
<div style="float: right">
|
||||
<span
|
||||
class="x_blue pointer"
|
||||
@click="handleLogin"
|
||||
style="font-size: 16px"
|
||||
>登录</span
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { register } from "@/api/login";
|
||||
import webGetCode from "@/components/webGetCode";
|
||||
import md5 from "js-md5";
|
||||
|
||||
const props = defineProps({
|
||||
isLogin: Number,
|
||||
});
|
||||
|
||||
const emit = defineEmits();
|
||||
|
||||
function handleLogin() {
|
||||
emit("update:isLogin", 1);
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const registerRef = ref();
|
||||
const registerForm = ref({
|
||||
username: "",
|
||||
password: "",
|
||||
repeat_pass: "",
|
||||
captcha: "",
|
||||
isCheck: true,
|
||||
});
|
||||
|
||||
const equalToPassword = (rule, value, callback) => {
|
||||
if (registerForm.value.password !== value) {
|
||||
callback(new Error("两次输入的密码不一致"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const isCheck = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error("请阅读并勾选"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const registerRules = {
|
||||
username: [
|
||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
password: [
|
||||
{ required: true, trigger: "blur", message: "请输入您的密码" },
|
||||
{
|
||||
min: 5,
|
||||
max: 20,
|
||||
message: "用户密码长度必须介于 5 和 20 之间",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
repeat_pass: [
|
||||
{ required: true, trigger: "blur", message: "请再次输入您的密码" },
|
||||
{ required: true, validator: equalToPassword, trigger: "blur" },
|
||||
],
|
||||
// captcha: [{ required: true, trigger: "change", message: "请输入验证码" }],
|
||||
isCheck: [{ required: true, validator: isCheck, trigger: "change" }],
|
||||
};
|
||||
|
||||
const codeUrl = ref("");
|
||||
const loading = ref(false);
|
||||
|
||||
function handleRegister() {
|
||||
registerRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
let formData = Object.assign({}, registerForm.value);
|
||||
formData.password = md5(formData.password);
|
||||
formData.repeat_pass = md5(formData.repeat_pass);
|
||||
register(formData)
|
||||
.then((res) => {
|
||||
const username = formData.username;
|
||||
ElMessageBox.alert(
|
||||
"<font color='red'>恭喜你,您的账号 " +
|
||||
username +
|
||||
" 注册成功!</font>",
|
||||
"系统提示",
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: "success",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
handleLogin();
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
margin: 0px auto 40px auto;
|
||||
text-align: center;
|
||||
color: #333333;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.register-form {
|
||||
.el-input {
|
||||
height: 38px;
|
||||
input {
|
||||
height: 38px;
|
||||
}
|
||||
}
|
||||
.input-icon {
|
||||
height: 39px;
|
||||
width: 14px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
}
|
||||
.register-tip {
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
.el-register-footer {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-family: Arial;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
</style>
|
266
src/views/website/retrieve/index.vue
Normal file
266
src/views/website/retrieve/index.vue
Normal file
@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form
|
||||
v-if="step == 1"
|
||||
ref="mobileRef"
|
||||
:model="retrieveForm"
|
||||
:rules="mobileRules"
|
||||
class="retrieve-form"
|
||||
>
|
||||
<h3 class="title">
|
||||
<el-icon
|
||||
class="pointer"
|
||||
:size="18"
|
||||
color="#333333"
|
||||
@click="handleLogin"
|
||||
>
|
||||
<Back />
|
||||
</el-icon>
|
||||
<span>找回密码</span>
|
||||
</h3>
|
||||
<el-form-item prop="mobile">
|
||||
<el-input
|
||||
v-model="retrieveForm.mobile"
|
||||
type="text"
|
||||
auto-complete="off"
|
||||
placeholder="手机号"
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="user" class="el-input__icon input-icon"
|
||||
/></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="captcha" style="margin-bottom: 0">
|
||||
<el-input
|
||||
v-model="retrieveForm.captcha"
|
||||
auto-complete="off"
|
||||
placeholder="验证码"
|
||||
style="width: 65%"
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="validCode" class="el-input__icon input-icon"
|
||||
/></template>
|
||||
</el-input>
|
||||
<WebGetCode v-model:mobile="retrieveForm.mobile" />
|
||||
<!-- @isSuccess="isSuccess" -->
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%; margin-top: 35px">
|
||||
<!-- <el-button
|
||||
class="x_btns"
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width: 100%"
|
||||
@click.prevent="handleNext"
|
||||
>
|
||||
<span>下一步</span>
|
||||
</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-form
|
||||
v-else
|
||||
ref="passRef"
|
||||
:model="retrieveForm"
|
||||
:rules="passRules"
|
||||
class="retrieve-form"
|
||||
>
|
||||
<h3 class="title">
|
||||
<el-icon class="pointer" :size="18" color="#333333" @click="step--">
|
||||
<Back />
|
||||
</el-icon>
|
||||
<span>找回密码</span>
|
||||
</h3>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model="retrieveForm.password"
|
||||
type="password"
|
||||
auto-complete="off"
|
||||
placeholder="请输入新密码"
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="password" class="el-input__icon input-icon"
|
||||
/></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="repeat_pass">
|
||||
<el-input
|
||||
v-model="retrieveForm.repeat_pass"
|
||||
type="password"
|
||||
auto-complete="off"
|
||||
placeholder="确认密码"
|
||||
>
|
||||
<template #prefix
|
||||
><svg-icon icon-class="password" class="el-input__icon input-icon"
|
||||
/></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%; margin-top: 35px">
|
||||
<el-button
|
||||
class="x_btns"
|
||||
size="default"
|
||||
type="primary"
|
||||
style="width: 100%"
|
||||
@click.prevent="handleRetrieve"
|
||||
>
|
||||
<span>完 成</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { getCodeImg, resetPassword } from "@/api/login";
|
||||
import WebGetCode from "@/components/webGetCode";
|
||||
|
||||
const props = defineProps({
|
||||
isLogin: Number,
|
||||
});
|
||||
|
||||
const emit = defineEmits();
|
||||
|
||||
function handleLogin() {
|
||||
emit("update:isLogin", 1);
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const retrieveForm = ref({
|
||||
mobile: "",
|
||||
password: "",
|
||||
repeat_pass: "",
|
||||
captcha: "",
|
||||
token: "",
|
||||
});
|
||||
|
||||
const equalToPassword = (rule, value, callback) => {
|
||||
if (retrieveForm.value.password !== value) {
|
||||
callback(new Error("两次输入的密码不一致"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const mobileRules = {
|
||||
mobile: [
|
||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
captcha: [{ required: true, trigger: "change", message: "请输入验证码" }],
|
||||
};
|
||||
const passRules = {
|
||||
password: [
|
||||
{ required: true, trigger: "blur", message: "请输入您的密码" },
|
||||
{
|
||||
min: 5,
|
||||
max: 20,
|
||||
message: "用户密码长度必须介于 5 和 20 之间",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
repeat_pass: [
|
||||
{ required: true, trigger: "blur", message: "请再次输入您的新密码" },
|
||||
{ required: true, validator: equalToPassword, trigger: "blur" },
|
||||
],
|
||||
};
|
||||
|
||||
const step = ref(1);
|
||||
|
||||
// function handleNext() {
|
||||
// proxy.$refs.mobileRef.validate((valid) => {
|
||||
// if (valid) {
|
||||
// codeValid(retrieveForm.value).then((res) => {
|
||||
// if (res.code == 200) {
|
||||
// retrieveForm.value.token = res.data.token;
|
||||
// step.value = 2;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
function handleRetrieve() {
|
||||
proxy.$refs.passRef.validate((valid) => {
|
||||
if (valid) {
|
||||
let formData = Object.assign({}, retrieveForm.value);
|
||||
formData.password = proxy.md5(formData.password);
|
||||
formData.repeat_pass = proxy.md5(formData.repeat_pass);
|
||||
resetPassword(formData)
|
||||
.then((res) => {
|
||||
const mobile = formData.mobile;
|
||||
ElMessageBox.alert(
|
||||
"<font color='red'>恭喜你,您的账号 " +
|
||||
mobile +
|
||||
" 修改密码成功!</font>",
|
||||
"系统提示",
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: "success",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
handleLogin();
|
||||
// router.push("/login");
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0px auto 40px auto;
|
||||
color: #333333;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
.el-icon {
|
||||
text-align: left;
|
||||
}
|
||||
span {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.retrieve-form {
|
||||
.el-input {
|
||||
height: 38px;
|
||||
input {
|
||||
height: 38px;
|
||||
}
|
||||
}
|
||||
.input-icon {
|
||||
height: 39px;
|
||||
width: 14px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
}
|
||||
.register-tip {
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
.el-register-footer {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-family: Arial;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
</style>
|
26
src/views/website/website-layout.vue
Normal file
26
src/views/website/website-layout.vue
Normal file
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="index">
|
||||
<WebsiteHeader></WebsiteHeader>
|
||||
<div class="content">
|
||||
<router-view />
|
||||
</div>
|
||||
<el-backtop />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="WebsiteLayout">
|
||||
import WebsiteHeader from "@/components/WebsiteHeader";
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.index {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.content {
|
||||
width: 100%;
|
||||
padding-top: 80px;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user