bugfix and performance improves

This commit is contained in:
quantulr
2023-08-04 17:27:34 +08:00
parent fec49d35bc
commit 2177189c34
8 changed files with 351 additions and 341 deletions

View File

@ -4,11 +4,11 @@
#} #}
:4173 { :4173 {
handle_path /api/* { handle /api/* {
reverse_proxy http://101.34.131.16:1618 reverse_proxy http://101.34.251.155
} }
handle { handle {
root * "/Volumes/iMac Doc/WebstormProjects/cas_cloud_admin/dist" root * "/Volumes/iMac Doc/WebstormProjects/cas_cloud_admin_i18n/dist"
file_server file_server
try_files {path} / try_files {path} /
} }

View File

@ -23,15 +23,21 @@ export const updateExpertAchievement = (data) =>
data, data,
}); });
// 批量审核成果 /**
export const batchAchievement = (ids) => * 批量审核成果
* @param ids
* @param status 1->通过|2->驳回
* @returns {*}
*/
export const batchAchievement = (ids, status) =>
request({ request({
url: `/business/dataReview/batchAchievement`, url: `/business/dataReview/batchAchievement/${status}`,
method: "put", method: "put",
data: { data: {
ids, ids,
}, },
}); });
// 批量删除成果 // 批量删除成果
export const deleteAchievementByIds = (ids) => export const deleteAchievementByIds = (ids) =>
request({ request({

View File

@ -9,9 +9,9 @@ export const updateTechnologyDemand = (data) =>
}); });
// 批量审核企业技术需求 // 批量审核企业技术需求
export const batchTechnologyDemand = (ids) => export const batchTechnologyDemand = (ids, status) =>
request({ request({
url: `/business/dataReview/batchTechnologyDemand/${ids}`, url: `/business/dataReview/batchTechnologyDemand/${ids}/${status}`,
method: "PUT", method: "PUT",
}); });

View File

@ -17,7 +17,9 @@
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:class="{ hide: fileList.length >= limit }" :class="{ hide: fileList.length >= limit }"
> >
<el-icon class="avatar-uploader-icon"><plus /></el-icon> <el-icon class="avatar-uploader-icon">
<plus/>
</el-icon>
</el-upload> </el-upload>
<!-- 上传提示 --> <!-- 上传提示 -->
<div class="el-upload__tip" v-if="showTip"> <div class="el-upload__tip" v-if="showTip">
@ -46,7 +48,7 @@
</template> </template>
<script setup> <script setup>
import { getToken } from "@/utils/auth"; import {getToken} from "@/utils/auth";
const props = defineProps({ const props = defineProps({
modelValue: [String, Object, Array], modelValue: [String, Object, Array],
@ -76,7 +78,7 @@ const props = defineProps({
}, },
}); });
const { proxy } = getCurrentInstance(); const {proxy} = getCurrentInstance();
const emit = defineEmits(); const emit = defineEmits();
const number = ref(0); const number = ref(0);
const uploadList = ref([]); const uploadList = ref([]);
@ -84,7 +86,7 @@ const dialogImageUrl = ref("");
const dialogVisible = ref(false); const dialogVisible = ref(false);
const baseUrl = import.meta.env.VITE_APP_BASE_API; const baseUrl = import.meta.env.VITE_APP_BASE_API;
const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传的图片服务器地址 const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传的图片服务器地址
const headers = ref({ Authorization: "Bearer " + getToken() }); const headers = ref({Authorization: "Bearer " + getToken()});
const fileList = ref([]); const fileList = ref([]);
const showTip = computed( const showTip = computed(
() => props.isShowTip && (props.fileType || props.fileSize) () => props.isShowTip && (props.fileType || props.fileSize)
@ -100,9 +102,9 @@ watch(
fileList.value = list.map((item) => { fileList.value = list.map((item) => {
if (typeof item === "string") { if (typeof item === "string") {
if (item.indexOf(baseUrl) === -1) { if (item.indexOf(baseUrl) === -1) {
item = { name: baseUrl + item, url: baseUrl + item }; item = {name: baseUrl + "/file" + item, url: baseUrl + "/file" + item};
} else { } else {
item = { name: item, url: item }; item = {name: item, url: item};
} }
} }
return item; return item;
@ -112,7 +114,7 @@ watch(
return []; return [];
} }
}, },
{ deep: true, immediate: true } {deep: true, immediate: true}
); );
// 删除图片 // 删除图片
@ -122,7 +124,7 @@ function handleRemove(file, files) {
// 上传成功回调 // 上传成功回调
function handleUploadSuccess(res) { function handleUploadSuccess(res) {
uploadList.value.push({ name: res.fileName, url: res.url }); uploadList.value.push({name: res.fileName, url: res.fileName});
if (uploadList.value.length === number.value) { if (uploadList.value.length === number.value) {
fileList.value = fileList.value fileList.value = fileList.value
.filter((f) => f.url !== undefined) .filter((f) => f.url !== undefined)

View File

@ -25,7 +25,8 @@
v-for="item in checkList" v-for="item in checkList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
>{{ item.name }}</el-checkbox >{{ item.name }}
</el-checkbox
> >
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
@ -81,7 +82,8 @@
false-label="1" false-label="1"
true-label="2" true-label="2"
v-model="modelValue.budgetMode" v-model="modelValue.budgetMode"
>面议</el-checkbox >面议
</el-checkbox
> >
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -161,15 +163,16 @@
</el-dialog> </el-dialog>
</template> </template>
<script setup> <script setup>
import { updateTechnologyDemand } from "@/api/dataApproval/enterpriseTechnologyDemand"; import {demandCategoryList} from "@/utils/parameter";
import { demandCategoryList } from "@/utils/parameter";
import WangEditor from "@/components/WangEditor"; import WangEditor from "@/components/WangEditor";
import CityOptions from "@/views/components/CityOptions"; import CityOptions from "@/views/components/CityOptions";
import FieldOptions from "@/views/components/FieldOptions"; import FieldOptions from "@/views/components/FieldOptions";
import InputBoxAdd from "@/views/components/InputBoxAdd"; import InputBoxAdd from "@/views/components/InputBoxAdd";
import { ElMessage } from "element-plus"; import {ElMessage} from "element-plus";
import { ref, toRefs } from "vue"; import {toRefs} from "vue";
import useUserStore from "@/store/modules/user"; import useUserStore from "@/store/modules/user";
import {batchTechnologyDemand} from "@/api/dataApproval/enterpriseTechnologyDemand";
const userStore = useUserStore(); const userStore = useUserStore();
const emit = defineEmits(["update-list"]); const emit = defineEmits(["update-list"]);
const props = defineProps({ const props = defineProps({
@ -182,12 +185,13 @@ const props = defineProps({
required: true, required: true,
}, },
}); });
const { isShow, modelValue } = toRefs(props); const {isShow, modelValue} = toRefs(props);
const labelWidth = 160; const labelWidth = 160;
const checkList = reactive(demandCategoryList); const checkList = reactive(demandCategoryList);
const approve = async (status) => { const approve = async (status) => {
let title = status == 1 ? "通过" : "驳回"; let title = status == 1 ? "通过" : "驳回";
await updateTechnologyDemand({ id: modelValue.value.id, status }); // await updateTechnologyDemand({ id: modelValue.value.id, status });
await batchTechnologyDemand(modelValue.value.id, status)
userStore.getUnApprovedTechnology(); userStore.getUnApprovedTechnology();
ElMessage.success(`${title}需求`); ElMessage.success(`${title}需求`);
emit("update:isShow", false); emit("update:isShow", false);

View File

@ -38,12 +38,12 @@
fieldKey="customers" fieldKey="customers"
ref="customerFormRef" ref="customerFormRef"
/> />
<city-options <!-- <city-options-->
v-model="form" <!-- v-model="form"-->
disabled <!-- disabled-->
:labelWidth="labelWidth" <!-- :labelWidth="labelWidth"-->
ref="cityFormRef" <!-- ref="cityFormRef"-->
></city-options> <!-- ></city-options>-->
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="成果成熟度:" prop="maturity"> <el-form-item label="成果成熟度:" prop="maturity">
@ -111,8 +111,10 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="所属单位:" prop="unit"> <el-form-item label="所属单位:" prop="unit">
<el-input v-model="form.unit"></el-input> <el-input v-model="form.unit"></el-input>
</el-form-item> </el-col </el-form-item>
></el-row> </el-col
>
</el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="成果简介:" prop="description"> <el-form-item label="成果简介:" prop="description">
@ -129,7 +131,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="成果图片:" prop="image"> <el-form-item label="成果图片:" prop="image">
<ImageUpload v-model="form.image" :limit="1" /> <ImageUpload v-model="form.image" :limit="1"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -151,7 +153,8 @@
:disabled="!form.image" :disabled="!form.image"
type="primary" type="primary"
@click="downloadImage" @click="downloadImage"
>下载图片材料</el-link >下载图片材料
</el-link
> >
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -165,38 +168,29 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { demandCategoryList } from "@/utils/parameter"; import {cooperationOptions, demandCategoryList, leadOptions, maturityOptions} from "@/utils/parameter";
import CityOptions from "@/views/components/CityOptions";
import FieldOptions from "@/views/components/FieldOptions"; import FieldOptions from "@/views/components/FieldOptions";
import InputBoxAdd from "@/views/components/InputBoxAdd"; import InputBoxAdd from "@/views/components/InputBoxAdd";
import { reactive, toRefs } from "vue"; import {reactive, toRefs} from "vue";
import { useRoute, useRouter } from "vue-router"; import {useRoute, useRouter} from "vue-router";
import { ElMessage } from "element-plus"; import {ElMessage} from "element-plus";
import { import {batchAchievement, expertAchievementInfo,} from "@/api/dataApproval/achivement";
expertAchievementInfo, import {downloadFile} from "../../../utils/request";
updateExpertAchievement,
} from "@/api/dataApproval/achivement";
import { customDownload } from "@/utils/request";
import {
maturityOptions,
leadOptions,
cooperationOptions,
} from "@/utils/parameter";
import { downloadFile } from "../../../utils/request";
import useUserStore from "@/store/modules/user"; import useUserStore from "@/store/modules/user";
const userStore = useUserStore(); const userStore = useUserStore();
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const data = reactive({ const data = reactive({
form: {}, form: {},
}); });
const { form } = toRefs(data); const {form} = toRefs(data);
const labelWidth = ref(120); const labelWidth = ref(120);
const checkList = reactive(demandCategoryList); const checkList = reactive(demandCategoryList);
const getAchievementInfo = async () => { const getAchievementInfo = async () => {
const resp = await expertAchievementInfo({ id: route.query.id }); const resp = await expertAchievementInfo({id: route.query.id});
form.value = resp.data; form.value = resp.data;
form.value.keywords = form.value.keyword?.split(",") ?? []; form.value.keywords = form.value.keyword?.split(",") ?? [];
form.value.customers = form.value.customer?.split(",") ?? []; form.value.customers = form.value.customer?.split(",") ?? [];
@ -209,7 +203,8 @@ const downloadImage = () => {
}; };
const submitForm = async (status) => { const submitForm = async (status) => {
await updateExpertAchievement({ ...form.value, status }); // await updateExpertAchievement({ ...form.value, status });
await batchAchievement([form.value.id], status);
let successMessage; let successMessage;
switch (status) { switch (status) {
case "1": case "1":

View File

@ -86,7 +86,7 @@
{{ comeFromDict.find((el) => el.value === row.comeFrom)?.label }} {{ comeFromDict.find((el) => el.value === row.comeFrom)?.label }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 来源名称--> <!-- 来源名称-->
<el-table-column <el-table-column
align="center" align="center"
label="来源名称" label="来源名称"
@ -224,7 +224,7 @@ const handleBatchApproval = async () => {
`是否确认批量审核通过编号为${selectedIds.value.join(",")}的数据项?` `是否确认批量审核通过编号为${selectedIds.value.join(",")}的数据项?`
) )
.then(async () => { .then(async () => {
await batchAchievement(selectedIds.value); await batchAchievement(selectedIds.value, 1);
userStore.getUnApprovedAchivement(); userStore.getUnApprovedAchivement();
getList(); getList();
ElMessage.success("批量审核成功"); ElMessage.success("批量审核成功");

View File

@ -21,7 +21,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="所属站点" prop="tenantId"> <el-form-item label="所属站点" prop="tenantId">
<SiteOptions v-model="queryParams.tenantId" :site-list="siteList" /> <SiteOptions v-model="queryParams.tenantId" :site-list="siteList"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -162,12 +162,12 @@
</template> </template>
<script setup> <script setup>
import AppointBroker from "@/views/components/appoint-broker.vue"; import AppointBroker from "@/views/components/appoint-broker.vue";
import { businessList } from "@/api/Businessneeds/index.js"; import {businessList} from "@/api/Businessneeds/index.js";
import Edialog from "@/views/components/Businessneeds/Approvaldetails.vue"; import Edialog from "@/views/components/Businessneeds/Approvaldetails.vue";
import SiteOptions from "@/views/components/SiteOptions"; import SiteOptions from "@/views/components/SiteOptions";
import { tenantSelect } from "@/api/subPlatform/tenant"; import {tenantSelect} from "@/api/subPlatform/tenant";
import { reactive, ref, toRefs } from "vue"; import {reactive, ref, toRefs} from "vue";
import { cloneDeep } from "lodash"; import {cloneDeep} from "lodash";
import useUserStore from "@/store/modules/user"; import useUserStore from "@/store/modules/user";
import { import {
batchTechnologyDemand, batchTechnologyDemand,
@ -175,7 +175,7 @@ import {
deleteTechnologyDemand, deleteTechnologyDemand,
updateTechnologyDemand, updateTechnologyDemand,
} from "@/api/dataApproval/enterpriseTechnologyDemand"; } from "@/api/dataApproval/enterpriseTechnologyDemand";
import { ElMessage, ElMessageBox } from "element-plus"; import {ElMessage, ElMessageBox} from "element-plus";
const userStore = useUserStore(); const userStore = useUserStore();
const data = reactive({ const data = reactive({
@ -192,7 +192,7 @@ const siteList = ref([]);
const dataList = ref([]); const dataList = ref([]);
const total = ref(0); const total = ref(0);
const isShow = ref(false); const isShow = ref(false);
const { queryParams, demandForm, brokerForm } = toRefs(data); const {queryParams, demandForm, brokerForm} = toRefs(data);
const queryFormRef = ref(); const queryFormRef = ref();
const getList = async () => { const getList = async () => {
const resp = await businessList(queryParams.value); const resp = await businessList(queryParams.value);
@ -244,31 +244,34 @@ const handleDelete = async (...ids) => {
getList(); getList();
ElMessage.success("删除成功"); ElMessage.success("删除成功");
}) })
.catch(() => {}); .catch(() => {
});
}; };
const handleBatchApproval = async () => { const handleBatchApproval = async () => {
ElMessageBox.confirm( ElMessageBox.confirm(
`是否确认批量审核通过编号为${selectedIds.value.join(",")}的数据项?` `是否确认批量审核通过编号为${selectedIds.value.join(",")}的数据项?`
) )
.then(async () => { .then(async () => {
await batchTechnologyDemand(selectedIds.value); await batchTechnologyDemand(selectedIds.value.join(","), 1);
userStore.getUnApprovedTechnology(); userStore.getUnApprovedTechnology();
getList(); getList();
ElMessage.success("批量审核成功"); ElMessage.success("批量审核成功");
}) })
.catch(() => {}); .catch(() => {
});
}; };
// 修改为完成状态 // 修改为完成状态
const complete = (id) => { const complete = (id) => {
ElMessageBox.confirm(`是否确认结束编号为${id}的数据项?`) ElMessageBox.confirm(`是否确认结束编号为${id}的数据项?`)
.then(async () => { .then(async () => {
await updateTechnologyDemand({ id, status: 4 }); await updateTechnologyDemand({id, status: 4});
userStore.getUnApprovedTechnology(); userStore.getUnApprovedTechnology();
getList(); getList();
ElMessage.success("删除成功"); ElMessage.success("删除成功");
}) })
.catch(() => {}); .catch(() => {
});
}; };
const showAppointBroker = ref(false); const showAppointBroker = ref(false);