diff --git a/package.json b/package.json index c4f5681..be6ac86 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "js-cookie": "3.0.1", "jsencrypt": "3.2.1", "nprogress": "0.2.0", + "quill": "^1.3.7", "vue": "3.2.22", "vue-cropper": "1.0.2", "vue-fullpage.js": "^0.1.7", diff --git a/src/api/config.js b/src/api/config.js index 5194aaa..de3eeb5 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -7,3 +7,19 @@ export function launch(data) { data }) } +// 省市区选择 +export function areaList(params) { + return request({ + url: '/enterprise/v1/config/area', + method: 'get', + params, + }) +} +// 领域 +export function industry(params) { + return request({ + url: '/enterprise/v1/config/industry', + method: 'get', + params, + }) +} \ No newline at end of file diff --git a/src/api/identity/index.js b/src/api/identity/index.js new file mode 100644 index 0000000..5d0a656 --- /dev/null +++ b/src/api/identity/index.js @@ -0,0 +1,22 @@ +import request from '@/utils/request'; + +// 首页每一项 +export function identity() { + return request({ + url: '/enterprise/v1/config/identity' + }); +} +// 当前状态 +export function settled() { + return request({ + url: '/enterprise/v1/settled' + }); +} +// 公司企业入职 +export function company(data) { + return request({ + url: '/enterprise/v1/settled/company', + method:'post', + data + }); +} diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue new file mode 100644 index 0000000..f3bc6b4 --- /dev/null +++ b/src/components/Editor/index.vue @@ -0,0 +1,283 @@ + + + + + diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index db89768..d10a789 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -67,7 +67,7 @@ const props = defineProps({ // 是否显示提示 isShowTip: { type: Boolean, - default: true + default: true, }, }); @@ -76,37 +76,45 @@ const emit = defineEmits(); const dialogImageUrl = ref(""); const dialogVisible = ref(false); const baseUrl = import.meta.env.VITE_APP_BASE_API; -const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传的图片服务器地址 -const headers = ref({ Authorization: "Bearer " + getToken() }); +const uploadImgUrl = ref( + import.meta.env.VITE_APP_BASE_API + "/enterprise/v1/upload" +); // 上传的图片服务器地址 +const headers = ref({ "x-token": getToken() }); const fileList = ref([]); const showTip = computed( () => props.isShowTip && (props.fileType || props.fileSize) ); -watch(() => props.modelValue, val => { - if (val) { - // 首先将值转为数组 - const list = Array.isArray(val) ? val : props.modelValue.split(","); - // 然后将数组转为对象数组 - fileList.value = list.map(item => { - if (typeof item === "string") { - if (item.indexOf(baseUrl) === -1) { - item = { name: baseUrl + item, url: baseUrl + item }; - } else { - item = { name: item, url: item }; +watch( + () => props.modelValue, + (val) => { + if (val) { + // 首先将值转为数组 + const list = Array.isArray(val) ? val : props.modelValue.split(","); + // 然后将数组转为对象数组 + fileList.value = list.map((item) => { + item = { name: item, url: item }; + return item; + ////////////// + if (typeof item === "string") { + if (item.indexOf(baseUrl) === -1) { + item = { name: baseUrl + item, url: baseUrl + item }; + } else { + item = { name: item, url: item }; + } } - } - return item; - }); - } else { - fileList.value = []; - return []; + return item; + }); + } else { + fileList.value = []; + return []; + } } -}); +); // 删除图片 function handleRemove(file, files) { - const findex = fileList.value.map(f => f.name).indexOf(file.name); + const findex = fileList.value.map((f) => f.name).indexOf(file.name); if (findex > -1) { fileList.value.splice(findex, 1); emit("update:modelValue", listToString(fileList.value)); @@ -115,7 +123,7 @@ function handleRemove(file, files) { // 上传成功回调 function handleUploadSuccess(res) { - fileList.value.push({ name: res.fileName, url: res.fileName }); + fileList.value.push({ name: res.data.url, url: res.data.url }); emit("update:modelValue", listToString(fileList.value)); proxy.$modal.closeLoading(); } @@ -128,7 +136,7 @@ function handleBeforeUpload(file) { if (file.name.lastIndexOf(".") > -1) { fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1); } - isImg = props.fileType.some(type => { + isImg = props.fileType.some((type) => { if (file.type.indexOf(type) > -1) return true; if (fileExtension && fileExtension.indexOf(type) > -1) return true; return false; diff --git a/src/main.js b/src/main.js index bb0d94c..f31fc64 100644 --- a/src/main.js +++ b/src/main.js @@ -26,11 +26,14 @@ import './permission' // permission control import { useDict } from '@/utils/dict' import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel } from '@/utils/ruoyi' +import { modeOptions, educationOptions, enterpriseOptions } from '@/utils/parameter' // 分页组件 import Pagination from '@/components/Pagination' // 自定义表格工具组件 import RightToolbar from '@/components/RightToolbar' +// 富文本组件 +import Editor from '@/components/Editor' // 图片上传组件 import ImageUpload from "@/components/ImageUpload" // 自定义树选择组件 @@ -50,11 +53,15 @@ app.config.globalProperties.resetForm = resetForm app.config.globalProperties.handleTree = handleTree app.config.globalProperties.addDateRange = addDateRange app.config.globalProperties.selectDictLabel = selectDictLabel +app.config.globalProperties.modeOptions = modeOptions +app.config.globalProperties.educationOptions = educationOptions +app.config.globalProperties.enterpriseOptions = enterpriseOptions // 全局组件挂载 app.component('DictTag', DictTag) app.component('Pagination', Pagination) app.component('TreeSelect', TreeSelect) +app.component('Editor', Editor) app.component('ImageUpload', ImageUpload) app.component('RightToolbar', RightToolbar) diff --git a/src/router/index.js b/src/router/index.js index d33cb62..dfa4d0b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -111,6 +111,48 @@ export const constantRoutes = [ component: () => import('@/views/error/401'), hidden: true }, + { + path: '/identity', + component: () => import('@/views/identity/layout'), + children:[ + { + path:'index', + component: () => import('@/views/identity/index'), + name: 'index', + meta: { title: '身份选择'}, + }, + { + path:'enterprise', + component: () => import('@/views/identity/enterprise'), + name: 'enterprise', + meta: { title: '企业入驻'} + }, + { + path:'expert', + component: () => import('@/views/identity/expert'), + name: 'expert', + meta: { title: '专家入驻'} + }, + { + path:'research', + component: () => import('@/views/identity/research'), + name: 'research', + meta: { title: '研究机构入驻'} + }, + { + path:'laboratory', + component: () => import('@/views/identity/laboratory'), + name: 'laboratory', + meta: { title: '实验室入驻'} + }, + { + path:'agent', + component: () => import('@/views/identity/agent'), + name: 'agent', + meta: { title: '科技经纪人入驻'} + } + ] + }, { path: '/admin', component: Layout, diff --git a/src/utils/parameter.js b/src/utils/parameter.js new file mode 100644 index 0000000..bc22466 --- /dev/null +++ b/src/utils/parameter.js @@ -0,0 +1,35 @@ +// 归属导航 +export const modeOptions = [ + { + value: 101, + label: '中小企业服务', + }, + { + value: 102, + label: '大型企业服务', + }, + { + value: 103, + label: '政府企业服务', + }, + { + value: 104, + label: '科研院所服务', + }, +] +// 学历 +export const educationOptions = [ + { key: 1, text: '小学' }, + { key: 2, text: '初中' }, + { key: 3, text: '高中' }, + { key: 4, text: '大专' }, + { key: 5, text: '本科' }, + { key: 6, text: '研究生' }, + { key: 7, text: '博士' }, +] +// 企业类型 +export const enterpriseOptions = [ + { key: 101, value: '上市企业' }, + { key: 102, value: '优质企业' }, + { key: 103, value: '普通企业' }, +] diff --git a/src/utils/request.js b/src/utils/request.js index f7560a9..1b626ca 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -22,7 +22,7 @@ service.interceptors.request.use(config => { // 是否需要设置 token const isToken = (config.headers || {}).isToken === false if (getToken() && !isToken) { - config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + config.headers['x-token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 } // get请求映射params参数 if (config.method === 'get' && config.params) { diff --git a/src/views/identity/agent.vue b/src/views/identity/agent.vue new file mode 100644 index 0000000..90d8574 --- /dev/null +++ b/src/views/identity/agent.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/identity/components/CityOptions/index.vue b/src/views/identity/components/CityOptions/index.vue new file mode 100644 index 0000000..e1b7cc5 --- /dev/null +++ b/src/views/identity/components/CityOptions/index.vue @@ -0,0 +1,160 @@ + + \ No newline at end of file diff --git a/src/views/identity/components/ExpertForm/index.vue b/src/views/identity/components/ExpertForm/index.vue new file mode 100644 index 0000000..f51d63b --- /dev/null +++ b/src/views/identity/components/ExpertForm/index.vue @@ -0,0 +1,236 @@ + + + \ No newline at end of file diff --git a/src/views/identity/components/FieldOptions/index.vue b/src/views/identity/components/FieldOptions/index.vue new file mode 100644 index 0000000..feba3aa --- /dev/null +++ b/src/views/identity/components/FieldOptions/index.vue @@ -0,0 +1,203 @@ + + + \ No newline at end of file diff --git a/src/views/identity/components/InputBoxAdd/index.vue b/src/views/identity/components/InputBoxAdd/index.vue new file mode 100644 index 0000000..4bd16d0 --- /dev/null +++ b/src/views/identity/components/InputBoxAdd/index.vue @@ -0,0 +1,94 @@ + + + \ No newline at end of file diff --git a/src/views/identity/enterprise.vue b/src/views/identity/enterprise.vue new file mode 100644 index 0000000..4adc9f3 --- /dev/null +++ b/src/views/identity/enterprise.vue @@ -0,0 +1,32 @@ + + \ No newline at end of file diff --git a/src/views/identity/expert.vue b/src/views/identity/expert.vue new file mode 100644 index 0000000..0aae795 --- /dev/null +++ b/src/views/identity/expert.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/identity/index.vue b/src/views/identity/index.vue new file mode 100644 index 0000000..c717766 --- /dev/null +++ b/src/views/identity/index.vue @@ -0,0 +1,110 @@ + + \ No newline at end of file diff --git a/src/views/identity/laboratory.vue b/src/views/identity/laboratory.vue new file mode 100644 index 0000000..8b19a89 --- /dev/null +++ b/src/views/identity/laboratory.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/identity/layout.vue b/src/views/identity/layout.vue new file mode 100644 index 0000000..ba32c22 --- /dev/null +++ b/src/views/identity/layout.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/identity/research.vue b/src/views/identity/research.vue new file mode 100644 index 0000000..78552da --- /dev/null +++ b/src/views/identity/research.vue @@ -0,0 +1,3 @@ + \ No newline at end of file