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">
@ -100,7 +102,7 @@ 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};
} }
@ -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({
@ -187,7 +190,8 @@ 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">
@ -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,25 +168,16 @@
</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,
updateExpertAchievement,
} from "@/api/dataApproval/achivement";
import { customDownload } from "@/utils/request";
import {
maturityOptions,
leadOptions,
cooperationOptions,
} from "@/utils/parameter";
import {downloadFile} from "../../../utils/request"; 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();
@ -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

@ -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

@ -244,19 +244,21 @@ 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(() => {
});
}; };
// 修改为完成状态 // 修改为完成状态
@ -268,7 +270,8 @@ const complete = (id) => {
getList(); getList();
ElMessage.success("删除成功"); ElMessage.success("删除成功");
}) })
.catch(() => {}); .catch(() => {
});
}; };
const showAppointBroker = ref(false); const showAppointBroker = ref(false);