bugfix
This commit is contained in:
@ -1,17 +1,28 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 实验室专利成果
|
||||
// 专家成果
|
||||
export const achievementList = (params) => {
|
||||
return request({
|
||||
url: `/app/laboratory/achievementList`,
|
||||
method: "GET",
|
||||
params,
|
||||
});
|
||||
return request({
|
||||
url: `/app/laboratory/achievementList`,
|
||||
method: "GET",
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
// 实验室成果
|
||||
export const laboratoryAchievementList = (params) => {
|
||||
return request({
|
||||
url: `/app/laboratory/laboratoryAchievementList`,
|
||||
method: "GET",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export const deleteAchievements = (ids) => {
|
||||
return request({
|
||||
url: `/app/laboratory/deleteAchievements/${ids}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
return request({
|
||||
url: `/app/laboratory/deleteAchievements/${ids}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ export const deleteLabPatentByIds = (ids) => {
|
||||
|
||||
|
||||
/**
|
||||
* 实验室专利列表
|
||||
* 实验室未绑定专家列表
|
||||
* @param params
|
||||
* @return {*}
|
||||
*/
|
||||
|
@ -2,16 +2,25 @@ import request from "@/utils/request";
|
||||
|
||||
// 实验室专利成果
|
||||
export const achievementList = (params) => {
|
||||
return request({
|
||||
url: `/app/research/achievementList`,
|
||||
method: "GET",
|
||||
params,
|
||||
});
|
||||
return request({
|
||||
url: `/app/research/achievementList`,
|
||||
method: "GET",
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
// 科研成果
|
||||
export const researchAchievementList = (params) => {
|
||||
return request({
|
||||
url: `/app/research/researchAchievementList`,
|
||||
method: "GET",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export const deleteAchievements = (ids) => {
|
||||
return request({
|
||||
url: `/app/research/deleteAchievements/${ids}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
return request({
|
||||
url: `/app/research/deleteAchievements/${ids}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
};
|
||||
|
22
src/assets/achievement_import_description.txt
Normal file
22
src/assets/achievement_import_description.txt
Normal file
@ -0,0 +1,22 @@
|
||||
1. ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD>ͺ<EFBFBD>̨<EFBFBD><CCA8>Ӧ(<28><><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>д<EFBFBD>ɰ<EFBFBD><C9B0><EFBFBD>ʡ, <20>Ϸ<EFBFBD><CFB7>в<EFBFBD><D0B2><EFBFBD>д<EFBFBD>ɺϷ<C9BA>)
|
||||
|
||||
2. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
a. ͨ<><CDA8> > <20><><EFBFBD><EFBFBD>
|
||||
<09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҽҩ><3E><>ҩ<EFBFBD><D2A9><EFBFBD><EFBFBD>Ȼҩ<C8BB><D2A9>><3E><><EFBFBD><EFBFBD>ҩ<EFBFBD><D2A9><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
b. <20><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8> / <20><><EFBFBD><EFBFBD>
|
||||
<09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҽҩ><3E><>ҩ<EFBFBD><D2A9><EFBFBD><EFBFBD>Ȼҩ<C8BB><D2A9>><3E><><EFBFBD><EFBFBD>ҩ<EFBFBD><D2A9><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD>/<2F><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>֪ʶ<D6AA><CAB6>Ȩ<EFBFBD><C8A8><EFBFBD>ɹ<EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
3. Ӧ<>ÿͻ<C3BF>
|
||||
<09><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8> , (Ӣ<>Ķ<EFBFBD><C4B6><EFBFBD>) <20><><EFBFBD><EFBFBD>
|
||||
|
||||
4. <20>ؼ<EFBFBD><D8BC><EFBFBD>
|
||||
<09><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8> , (Ӣ<>Ķ<EFBFBD><C4B6><EFBFBD>) <20><><EFBFBD><EFBFBD>
|
||||
|
||||
5. <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
<09><><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD> С<>Խ<D4BD> ͨ<><CDA8>С<EFBFBD><D0A1> <20><><EFBFBD>Խ<D4BD> ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ɹ<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>
|
||||
|
||||
6. <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
<09><><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
7. <20><><EFBFBD><EFBFBD>ģʽ:
|
||||
<09><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>˾ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>г<EFBFBD><D0B3>ƹ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
BIN
src/assets/achievement_import_template.xlsx
Normal file
BIN
src/assets/achievement_import_template.xlsx
Normal file
Binary file not shown.
@ -1,24 +1,24 @@
|
||||
<template>
|
||||
<div class="component-upload-image">
|
||||
<el-upload
|
||||
:action="uploadImgUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:class="{ hide: fileList.length >= limit }"
|
||||
:file-list="fileList"
|
||||
:headers="headers"
|
||||
:limit="limit"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove"
|
||||
:on-success="handleUploadSuccess"
|
||||
:show-file-list="true"
|
||||
list-type="picture-card"
|
||||
multiple
|
||||
name="file"
|
||||
:action="uploadImgUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:class="{ hide: fileList.length >= limit }"
|
||||
:file-list="fileList"
|
||||
:headers="headers"
|
||||
:limit="limit"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove"
|
||||
:on-success="handleUploadSuccess"
|
||||
:show-file-list="true"
|
||||
list-type="picture-card"
|
||||
multiple
|
||||
name="file"
|
||||
>
|
||||
<el-icon class="avatar-uploader-icon">
|
||||
<plus />
|
||||
<plus/>
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<!-- 上传提示 -->
|
||||
@ -34,21 +34,21 @@
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
append-to-body
|
||||
title="预览"
|
||||
width="800px"
|
||||
v-model="dialogVisible"
|
||||
append-to-body
|
||||
title="预览"
|
||||
width="800px"
|
||||
>
|
||||
<img
|
||||
:src="dialogImageUrl"
|
||||
style="display: block; max-width: 100%; margin: 0 auto"
|
||||
:src="dialogImageUrl"
|
||||
style="display: block; max-width: 100%; margin: 0 auto"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getToken } from "@/utils/auth";
|
||||
import {getToken} from "@/utils/auth";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: [String, Object, Array],
|
||||
@ -74,7 +74,7 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const {proxy} = getCurrentInstance();
|
||||
const emit = defineEmits();
|
||||
const number = ref(0);
|
||||
const uploadList = ref([]);
|
||||
@ -82,35 +82,36 @@ 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({ "client-token": "Bearer " + getToken() });
|
||||
const headers = ref({"client-token": "Bearer " + getToken()});
|
||||
const fileList = ref([]);
|
||||
const showTip = computed(
|
||||
() => props.isShowTip && (props.fileType || props.fileSize)
|
||||
() => 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 };
|
||||
() => 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};
|
||||
item = {name: item, url: `${baseUrl}/file${item}`};
|
||||
} else {
|
||||
item = {name: item, url: item};
|
||||
}
|
||||
}
|
||||
}
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
fileList.value = [];
|
||||
return [];
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
fileList.value = [];
|
||||
return [];
|
||||
}
|
||||
},
|
||||
{deep: true, immediate: true}
|
||||
);
|
||||
|
||||
// 删除图片
|
||||
@ -120,11 +121,11 @@ function handleRemove(file, files) {
|
||||
|
||||
// 上传成功回调
|
||||
function handleUploadSuccess(res) {
|
||||
uploadList.value.push({ name: res.fileName, url: res.url });
|
||||
uploadList.value.push({name: res.fileName, url: `${baseUrl}/file${res.fileName}`});
|
||||
if (uploadList.value.length === number.value) {
|
||||
fileList.value = fileList.value
|
||||
.filter((f) => f.url !== undefined)
|
||||
.concat(uploadList.value);
|
||||
.filter((f) => f.url !== undefined)
|
||||
.concat(uploadList.value);
|
||||
uploadList.value = [];
|
||||
number.value = 0;
|
||||
emit("update:modelValue", listToString(fileList.value));
|
||||
@ -150,7 +151,7 @@ function handleBeforeUpload(file) {
|
||||
}
|
||||
if (!isImg) {
|
||||
proxy.$modal.msgError(
|
||||
`文件格式不正确, 请上传${props.fileType.join("/")}图片格式文件!`
|
||||
`文件格式不正确, 请上传${props.fileType.join("/")}图片格式文件!`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -189,7 +190,7 @@ function listToString(list, separator) {
|
||||
for (let i in list) {
|
||||
if (undefined !== list[i].url && list[i].url.indexOf("blob:") !== 0) {
|
||||
// strs += list[i].url.replace(baseUrl, "") + separator;
|
||||
strs += list[i].url + separator;
|
||||
strs += list[i].name + separator;
|
||||
}
|
||||
}
|
||||
return strs != "" ? strs.substr(0, strs.length - 1) : "";
|
||||
|
2005
src/router/index.js
2005
src/router/index.js
File diff suppressed because it is too large
Load Diff
@ -1,32 +1,7 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto"
|
||||
><p><b>基本资料</b></p>
|
||||
<el-form
|
||||
ref="personFormRef"
|
||||
:model="personForm"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="姓名:" prop="nickName">
|
||||
<el-input v-model="personForm.nickName" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机:" prop="mobile">
|
||||
<el-input v-model="personForm.mobile" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱:" prop="email">
|
||||
<el-input v-model="personForm.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
<el-form-item label="职务:" prop="post">
|
||||
<el-input v-model="personForm.post" placeholder="请输入职务" />
|
||||
</el-form-item>
|
||||
<el-form-item label="固定电话:" prop="phone">
|
||||
<el-input v-model="personForm.phone" placeholder="请输入固定电话" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitPersonalInfo">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<p><b>实验室资料</b></p>
|
||||
<!-- <laboratory-form ref="labFormRef" v-model="form" :is-add="false"/>-->
|
||||
<agent-form ref="agentFormRef" v-model="form" :is-add="false" />
|
||||
|
@ -1,56 +1,59 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
@submit.prevent
|
||||
v-show="showSearch"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
@submit.prevent
|
||||
>
|
||||
<el-form-item label="成果名称" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
placeholder="请输入成果名称"
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
placeholder="请输入成果名称"
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
icon="Search"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索
|
||||
icon="Search"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索
|
||||
</el-button>
|
||||
<el-button icon="Refresh" size="small" @click="resetQuery"
|
||||
>重置
|
||||
>重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col v-if="route.name==='LabAchievement'" :span="1.5">
|
||||
<el-button icon="UploadFilled" size="small" type="primary" @click="handleImport">导入成果</el-button>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
<el-table-column label="数据编号" prop="id" />
|
||||
<el-table-column label="数据编号" prop="id"/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
label="成果名称"
|
||||
prop="title"
|
||||
:show-overflow-tooltip="true"
|
||||
label="成果名称"
|
||||
prop="title"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
label="成果领域"
|
||||
prop="industryStr"
|
||||
:show-overflow-tooltip="true"
|
||||
label="成果领域"
|
||||
prop="industryStr"
|
||||
/>
|
||||
<el-table-column label="所属专家" prop="expertName" />
|
||||
<el-table-column v-if="route.name ==='ExpertAchievement'" label="所属专家" prop="expertName"/>
|
||||
<!-- <el-table-column label="浏览量" prop="visitCount"/>-->
|
||||
<el-table-column align="center" label="发布时间" prop="createTime">
|
||||
<template #default="{ row }">
|
||||
@ -58,9 +61,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button-->
|
||||
@ -72,47 +75,109 @@
|
||||
<!-- </el-button-->
|
||||
<!-- >-->
|
||||
<el-button
|
||||
icon="delete"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除
|
||||
icon="delete"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog
|
||||
v-model="upload.dialogVisible"
|
||||
append-to-body
|
||||
title="导入成果"
|
||||
width="400px"
|
||||
>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:action="upload.url"
|
||||
:auto-upload="false"
|
||||
:disabled="upload.isUploading"
|
||||
:headers="upload.headers"
|
||||
:limit="1"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
accept=".xlsx, .xls"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload">
|
||||
<upload-filled/>
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
type="primary"
|
||||
@click="saveAs(xlsl, '成果导入模板.xlsx')"
|
||||
>下载模板
|
||||
</el-link
|
||||
>
|
||||
</div>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span style="color: red">成果导入说明(必读)。</span>
|
||||
<el-link
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
type="primary"
|
||||
@click="saveAs(importTip, '成果导入说明(必读).txt')"
|
||||
>下载
|
||||
</el-link
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from "dayjs";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
import { getCurrentInstance, reactive, ref, toRefs } from "vue";
|
||||
import {
|
||||
achievementList,
|
||||
deleteAchievements,
|
||||
} from "@/api/admin/laboratory/achievement";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {useRouter} from "vue-router";
|
||||
import {getCurrentInstance, reactive, ref, toRefs} from "vue";
|
||||
import {achievementList, deleteAchievements, laboratoryAchievementList} from "@/api/admin/laboratory/achievement";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import xlsl from '@/assets/achievement_import_template.xlsx?url'
|
||||
import importTip from '@/assets/achievement_import_description.txt?url'
|
||||
import {saveAs} from 'file-saver'
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute()
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
console.log(route.name)
|
||||
const dataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const fetchMethods = {
|
||||
"LabAchievement": laboratoryAchievementList,
|
||||
"ExpertAchievement": achievementList,
|
||||
}
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -121,22 +186,22 @@ const data = reactive({
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
const {queryParams} = toRefs(data);
|
||||
|
||||
const queryRef = ref();
|
||||
|
||||
/** 查询数据列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
achievementList(queryParams.value)
|
||||
.then((resp) => {
|
||||
dataList.value = resp.rows;
|
||||
total.value = resp.total;
|
||||
loading.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
fetchMethods[route.name](queryParams.value)
|
||||
.then((resp) => {
|
||||
dataList.value = resp.rows;
|
||||
total.value = resp.total;
|
||||
loading.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@ -157,16 +222,69 @@ function resetQuery() {
|
||||
*/
|
||||
function handleDelete(id) {
|
||||
ElMessageBox.confirm('是否确认删除数据编号为"' + id + '"的成果项?')
|
||||
.then(function () {
|
||||
return deleteAchievements(id);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
.then(function () {
|
||||
return deleteAchievements(id);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
const uploadRef = ref(null)
|
||||
const upload = reactive({
|
||||
dialogVisible: false,
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: {'client-token': "Bearer " + getToken()},
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/app/laboratory/importData",
|
||||
})
|
||||
|
||||
/**
|
||||
* 导入成果
|
||||
*/
|
||||
const handleImport = () => {
|
||||
upload.dialogVisible = true
|
||||
};
|
||||
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.dialogVisible = false;
|
||||
upload.isUploading = false;
|
||||
uploadRef.value.handleRemove(file);
|
||||
proxy.$alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{dangerouslyUseHTMLString: true}
|
||||
);
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 下载模板操作 */
|
||||
const importTemplate = () => {
|
||||
saveAs(xlsl, '成果导入模板.xlsx')
|
||||
}
|
||||
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
uploadRef.value.submit();
|
||||
}
|
||||
|
||||
getList();
|
||||
|
@ -1,56 +1,61 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
@submit.prevent
|
||||
v-show="showSearch"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
@submit.prevent
|
||||
>
|
||||
<el-form-item label="成果名称" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
placeholder="请输入成果名称"
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
placeholder="请输入成果名称"
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
icon="Search"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索
|
||||
icon="Search"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索
|
||||
</el-button>
|
||||
<el-button icon="Refresh" size="small" @click="resetQuery"
|
||||
>重置
|
||||
>重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button v-if="route.name==='ResearchAchievement'" icon="UploadFilled" size="small" type="primary"
|
||||
@click="handleImport">导入成果
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
<el-table-column label="数据编号" prop="id" />
|
||||
<el-table-column label="数据编号" prop="id"/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
label="成果名称"
|
||||
prop="title"
|
||||
:show-overflow-tooltip="true"
|
||||
label="成果名称"
|
||||
prop="title"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
label="成果领域"
|
||||
prop="industryStr"
|
||||
:show-overflow-tooltip="true"
|
||||
label="成果领域"
|
||||
prop="industryStr"
|
||||
/>
|
||||
<el-table-column label="所属专家" prop="expertName" />
|
||||
<el-table-column v-if="route.name==='ExpertAchievement'" label="所属专家" prop="expertName"/>
|
||||
<!-- <el-table-column label="浏览量" prop="visitCount"/>-->
|
||||
<el-table-column align="center" label="发布时间" prop="createTime">
|
||||
<template #default="{ row }">
|
||||
@ -58,9 +63,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button-->
|
||||
@ -72,35 +77,93 @@
|
||||
<!-- </el-button-->
|
||||
<!-- >-->
|
||||
<el-button
|
||||
icon="delete"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除
|
||||
icon="delete"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog
|
||||
v-model="upload.dialogVisible"
|
||||
append-to-body
|
||||
title="导入成果"
|
||||
width="400px"
|
||||
>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:action="upload.url"
|
||||
:auto-upload="false"
|
||||
:disabled="upload.isUploading"
|
||||
:headers="upload.headers"
|
||||
:limit="1"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
accept=".xlsx, .xls"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload">
|
||||
<upload-filled/>
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
type="primary"
|
||||
@click="saveAs(xlsl, '成果导入模板.xlsx')"
|
||||
>下载模板
|
||||
</el-link
|
||||
>
|
||||
</div>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span style="color: red">成果导入说明(必读)。</span>
|
||||
<el-link
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
type="primary"
|
||||
@click="saveAs(importTip, '成果导入说明(必读).txt')"
|
||||
>下载
|
||||
</el-link
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from "dayjs";
|
||||
import { useRouter } from "vue-router";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import {
|
||||
achievementList,
|
||||
deleteAchievements,
|
||||
} from "@/api/admin/research/achievement";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {achievementList, deleteAchievements, researchAchievementList} from "@/api/admin/research/achievement";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import xlsl from '@/assets/achievement_import_template.xlsx?url'
|
||||
import importTip from '@/assets/achievement_import_description.txt?url'
|
||||
import {saveAs} from "file-saver";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@ -110,7 +173,7 @@ const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const route = useRoute()
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -119,22 +182,25 @@ const data = reactive({
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
const {queryParams} = toRefs(data);
|
||||
|
||||
const queryRef = ref();
|
||||
|
||||
const fetchMethods = {
|
||||
"ResearchAchievement": researchAchievementList,
|
||||
"ExpertAchievement": achievementList,
|
||||
}
|
||||
/** 查询数据列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
achievementList(queryParams.value)
|
||||
.then((resp) => {
|
||||
dataList.value = resp.rows;
|
||||
total.value = resp.total;
|
||||
loading.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
fetchMethods[route.name](queryParams.value)
|
||||
.then((resp) => {
|
||||
dataList.value = resp.rows;
|
||||
total.value = resp.total;
|
||||
loading.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@ -155,14 +221,65 @@ function resetQuery() {
|
||||
*/
|
||||
function handleDelete(id) {
|
||||
ElMessageBox.confirm(`是否确认删除数据编号为"${id}"的成果项?'`)
|
||||
.then(function () {
|
||||
return deleteAchievements(id);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
});
|
||||
.then(function () {
|
||||
return deleteAchievements(id);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const uploadRef = ref(null)
|
||||
const upload = reactive({
|
||||
dialogVisible: false,
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: {'client-token': "Bearer " + getToken()},
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/app/research/importData",
|
||||
})
|
||||
|
||||
/**
|
||||
* 导入成果
|
||||
*/
|
||||
const handleImport = () => {
|
||||
upload.dialogVisible = true
|
||||
};
|
||||
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.dialogVisible = false;
|
||||
upload.isUploading = false;
|
||||
uploadRef.value.handleRemove(file);
|
||||
proxy.$alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{dangerouslyUseHTMLString: true}
|
||||
);
|
||||
getList();
|
||||
};
|
||||
|
||||
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
uploadRef.value.submit();
|
||||
}
|
||||
|
||||
|
||||
getList();
|
||||
</script>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="姓名:" prop="name">
|
||||
<el-input v-model="modelValue.name"></el-input>
|
||||
@ -15,10 +15,10 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="手机号:" prop="mobile">
|
||||
<el-input v-model="modelValue.mobile"></el-input>
|
||||
<el-form-item label="手机号:" prop="phone">
|
||||
<el-input v-model="modelValue.phone"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -34,7 +34,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作所在地:" prop="wordAddress">
|
||||
<el-input v-model="modelValue.wordAddress" />
|
||||
<el-input v-model="modelValue.wordAddress"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -43,23 +43,23 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作经历:" prop="experience">
|
||||
<el-input
|
||||
v-model="modelValue.experience"
|
||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
||||
type="textarea"
|
||||
v-model="modelValue.experience"
|
||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<field-options ref="researchsFormRef" v-model="modelValue" />
|
||||
<field-options ref="researchsFormRef" v-model="modelValue"/>
|
||||
|
||||
<InputBoxAdd
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
ref="keywordsFormRef"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="keywords"
|
||||
placeholder="应用场景关键词+技术产品关键词"
|
||||
title="关键词"
|
||||
/>
|
||||
|
||||
<el-row v-if="isAdd">
|
||||
@ -69,9 +69,9 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="idImage.0">
|
||||
<ImageUpload
|
||||
v-model="modelValue.idImage[0]"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
v-model="modelValue.idImage[0]"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">身份证人像面</div>
|
||||
@ -79,9 +79,9 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="idImage.1">
|
||||
<ImageUpload
|
||||
v-model="modelValue.idImage[1]"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
v-model="modelValue.idImage[1]"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">身份证国徽面</div>
|
||||
@ -89,9 +89,9 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="idImage.2">
|
||||
<ImageUpload
|
||||
v-model="modelValue.idImage[2]"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
v-model="modelValue.idImage[2]"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">手持身份证人像面</div>
|
||||
@ -107,8 +107,8 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<image-upload
|
||||
v-model="modelValue.certificatePics"
|
||||
:isShowTip="false"
|
||||
v-model="modelValue.certificatePics"
|
||||
:isShowTip="false"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -120,7 +120,7 @@
|
||||
<script setup>
|
||||
import InputBoxAdd from "../InputBoxAdd";
|
||||
import FieldOptions from "../FieldOptions";
|
||||
import { ref } from "vue";
|
||||
import {ref} from "vue";
|
||||
|
||||
const formRef = ref();
|
||||
const researchsFormRef = ref();
|
||||
@ -141,21 +141,21 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
const rules = {
|
||||
product: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
kind: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
code: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
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" },
|
||||
{required: true, message: "请输入手机号码", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3-9]\d{9}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
idCard: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
wordAddress: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
experience: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
idCard: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
wordAddress: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
experience: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
"idImage.0": [
|
||||
{
|
||||
required: true,
|
||||
|
@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="box3" v-loading="loading">
|
||||
<div v-loading="loading" class="box3">
|
||||
<div class="tit">专家分布地图</div>
|
||||
<div v-if="state.isShowGoBack" class="close-back" @click="goBack">
|
||||
<img src="./img/back_button.png" />
|
||||
<img src="./img/back_button.png"/>
|
||||
</div>
|
||||
<!-- echartsDom 兼容缩放 -->
|
||||
<div ref="map" class="map echartsDom" id="map"></div>
|
||||
<div id="map" ref="map" class="map echartsDom"></div>
|
||||
<div class="leftBox">
|
||||
<div class="head">
|
||||
<div class="a">地区</div>
|
||||
@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<template v-if="snapTree.length > 0">
|
||||
<div
|
||||
v-for="v in snapTree.slice(
|
||||
v-for="v in snapTree.slice(
|
||||
(leftBoxPageNum - 1) * 5,
|
||||
leftBoxPageNum * 5
|
||||
)"
|
||||
@ -27,9 +27,9 @@
|
||||
<div class="b">暂无</div>
|
||||
</div>
|
||||
<RegionPagine
|
||||
v-if="snapTree.length"
|
||||
v-model:page="leftBoxPageNum"
|
||||
:total="snapTree.length"
|
||||
v-if="snapTree.length"
|
||||
v-model:page="leftBoxPageNum"
|
||||
:total="snapTree.length"
|
||||
></RegionPagine>
|
||||
</div>
|
||||
<div class="rightBox">
|
||||
@ -38,10 +38,10 @@
|
||||
<div class="b">专家数量</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="Object.keys(industryTree).length > 0"
|
||||
v-for="(v, k) in industryTree"
|
||||
v-for="(v, k) in industryTree"
|
||||
v-if="Object.keys(industryTree).length > 0"
|
||||
>
|
||||
<div class="a" :title="k">{{ k }}</div>
|
||||
<div :title="k" class="a">{{ k }}</div>
|
||||
<div class="b">{{ v ?? 0 }}</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
@ -53,19 +53,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineComponent, getCurrentInstance, onMounted, reactive } from "vue";
|
||||
import {
|
||||
countExpertByArea,
|
||||
countExpertByCity,
|
||||
countExpertByProvince,
|
||||
} from "../../../../api/website/home/index";
|
||||
import {getCurrentInstance, onMounted, reactive} from "vue";
|
||||
import {countExpertByArea, countExpertByCity, countExpertByProvince,} from "../../../../api/website/home/index";
|
||||
// return;
|
||||
// console.log(echarts);
|
||||
import * as echarts from "echarts";
|
||||
import RegionPagine from "./RegionPagine.vue";
|
||||
// import { ElMessage } from "element-plus";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const {proxy} = getCurrentInstance();
|
||||
const loading = shallowRef(true);
|
||||
|
||||
let treeData = {};
|
||||
@ -78,9 +74,9 @@ const searchRegionData = async (code, level) => {
|
||||
let data = {};
|
||||
|
||||
if (
|
||||
snapTree.value.length &&
|
||||
snapTree.value[0].code.substring(0, 2) == code.substring(0, 2) &&
|
||||
snapTree.value[0].code.substring(2, 4) != code.substring(2, 4)
|
||||
snapTree.value.length &&
|
||||
snapTree.value[0].code.substring(0, 2) == code.substring(0, 2) &&
|
||||
snapTree.value[0].code.substring(2, 4) != code.substring(2, 4)
|
||||
) {
|
||||
data = snapTree.value;
|
||||
} else {
|
||||
@ -94,9 +90,9 @@ const searchRegionData = async (code, level) => {
|
||||
const ctcode = code.substring(0, 4) + "00";
|
||||
let data = {};
|
||||
if (
|
||||
snapTree.value.length &&
|
||||
snapTree.value[0].code.substring(0, 4) == code.substring(0, 4) &&
|
||||
snapTree.value[0].code.substring(4, 6) != code.substring(4, 6)
|
||||
snapTree.value.length &&
|
||||
snapTree.value[0].code.substring(0, 4) == code.substring(0, 4) &&
|
||||
snapTree.value[0].code.substring(4, 6) != code.substring(4, 6)
|
||||
) {
|
||||
data = snapTree.value;
|
||||
} else {
|
||||
@ -112,7 +108,7 @@ const searchRegionData = async (code, level) => {
|
||||
snapTree.value = treeData.count ?? [];
|
||||
return treeData.count.find((item) => item.code == code) || false;
|
||||
} else {
|
||||
const { count, industry } = await countExpertByProvince();
|
||||
const {count, industry} = await countExpertByProvince();
|
||||
industryTree.value = industry ?? {};
|
||||
return count.find((item) => item.code == code) || false;
|
||||
}
|
||||
@ -122,6 +118,7 @@ const searchRegionData = async (code, level) => {
|
||||
const findMapCount = (data, code) => {
|
||||
return data.find((item) => item.code == code) || false;
|
||||
};
|
||||
|
||||
function deepFindTree(code, tree) {
|
||||
let snap = false;
|
||||
for (const key in tree) {
|
||||
@ -142,7 +139,8 @@ function deepFindTree(code, tree) {
|
||||
return snap;
|
||||
}
|
||||
|
||||
const getIndustry = () => {};
|
||||
const getIndustry = () => {
|
||||
};
|
||||
|
||||
// function getIndustry(object) {
|
||||
// let snap = {};
|
||||
@ -162,9 +160,7 @@ const getIndustry = () => {};
|
||||
// // for (let index = 0; index < element['industry'].length; index++) {
|
||||
// // const ele = element['industry'][index];
|
||||
// // if(Object.hasOwnProperty.call(snap, ele)) {
|
||||
|
||||
// // }
|
||||
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
@ -216,7 +212,6 @@ onMounted(() => {
|
||||
industryTree.value = resp.industry ?? {};
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
let height = document.body.clientHeight;
|
||||
let width = document.body.clientWidth;
|
||||
let dom = proxy.$refs["map"];
|
||||
@ -365,8 +360,8 @@ function loadMapData(areaCode) {
|
||||
console.log("------------------");
|
||||
for (var i = 0; i < mapJson.features.length; i++) {
|
||||
if (
|
||||
mapJson.features[i].properties.adcode == 810000 ||
|
||||
mapJson.features[i].properties.adcode == 820000
|
||||
mapJson.features[i].properties.adcode == 810000 ||
|
||||
mapJson.features[i].properties.adcode == 820000
|
||||
) {
|
||||
mapJson.features.splice(i, 1); // 删除下标为i 的元素,i开始只删除一个就它自己了
|
||||
i--; // 删除一个元素后数组长度减一了
|
||||
@ -390,10 +385,10 @@ function loadMap(mapName, data) {
|
||||
orient: "horizontal", //图例排列方向
|
||||
padding: 5,
|
||||
pieces: [
|
||||
{ gte: 0, lte: 99, label: "99", color: "#CAE9FD" },
|
||||
{ gte: 100, lte: 299, label: "100-299", color: "#7ED2F7" },
|
||||
{ gte: 300, lte: 499, label: "299-499", color: "#039DDD" },
|
||||
{ gte: 500, label: "500", color: "#0D4884" },
|
||||
{gte: 0, lte: 99, label: "99", color: "#CAE9FD"},
|
||||
{gte: 100, lte: 299, label: "100-299", color: "#7ED2F7"},
|
||||
{gte: 300, lte: 499, label: "299-499", color: "#039DDD"},
|
||||
{gte: 500, label: "500", color: "#0D4884"},
|
||||
// {max: 30, label: '安全', color: '#2c9a42'},
|
||||
// {min: 30, max: 60, label: '警告', color: '#d08a00'},
|
||||
// {min: 60, label: '危险', color: '#c23c33'},
|
||||
@ -467,6 +462,7 @@ function loadMap(mapName, data) {
|
||||
height: 100%;
|
||||
background: linear-gradient(0deg, #010101, #041744);
|
||||
position: relative;
|
||||
|
||||
.tit {
|
||||
position: absolute;
|
||||
top: 75px;
|
||||
@ -478,6 +474,7 @@ function loadMap(mapName, data) {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.map {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@ -498,9 +495,11 @@ function loadMap(mapName, data) {
|
||||
top: 100px;
|
||||
cursor: pointer;
|
||||
z-index: 1000;
|
||||
|
||||
&:hover {
|
||||
left: 55px;
|
||||
}
|
||||
|
||||
img {
|
||||
margin: 28px auto 0;
|
||||
width: 30px;
|
||||
@ -508,9 +507,11 @@ function loadMap(mapName, data) {
|
||||
transition: all 0.5s;
|
||||
}
|
||||
}
|
||||
|
||||
.leftBox {
|
||||
left: 6%;
|
||||
}
|
||||
|
||||
.rightBox {
|
||||
right: 6%;
|
||||
max-height: 465px !important;
|
||||
@ -527,13 +528,16 @@ function loadMap(mapName, data) {
|
||||
background: rgba(4, 22, 65, 0.5);
|
||||
border: 1px solid #0054ff;
|
||||
color: rgba(161, 192, 255, 1);
|
||||
|
||||
& > div {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.head {
|
||||
border-bottom: 1px solid #0054ff;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.a {
|
||||
flex: 1;
|
||||
border-right: 1px solid #0054ff;
|
||||
@ -543,12 +547,14 @@ function loadMap(mapName, data) {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.b {
|
||||
text-align: center;
|
||||
line-height: 42px;
|
||||
width: 90px;
|
||||
}
|
||||
}
|
||||
|
||||
.rightBox {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -31,9 +31,9 @@ export default defineConfig(({ mode, command }) => {
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
"/dev-api": {
|
||||
target: "http://101.34.131.16:1618",
|
||||
// target: "http://101.34.131.16:1618",
|
||||
// target: "http://192.168.0.201:1618",
|
||||
// target: "http://101.34.131.16:1618",
|
||||
target: "http://192.168.0.201:1618",
|
||||
// target: 'http://172.18.3.127:1618',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||
|
Reference in New Issue
Block a user