debug
This commit is contained in:
parent
713787d020
commit
934187376b
2
web/.env
2
web/.env
@ -1,3 +1,3 @@
|
||||
VITE_TITLE = 'Vue FastAPI Admin'
|
||||
VITE_TITLE = '成都文化产权交易所'
|
||||
|
||||
VITE_PORT = 3100
|
||||
@ -5,4 +5,4 @@ VITE_PUBLIC_PATH = '/'
|
||||
VITE_USE_PROXY = true
|
||||
|
||||
# base api
|
||||
VITE_BASE_API = '/api/v1'
|
||||
VITE_BASE_API = 'https://value.cdcee.net/api/v1'
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
VITE_PUBLIC_PATH = '/'
|
||||
|
||||
# base api
|
||||
VITE_BASE_API = '/api/v1'
|
||||
VITE_BASE_API = 'https://value.cdcee.net/api/v1'
|
||||
|
||||
# 是否启用压缩
|
||||
VITE_USE_COMPRESS = true
|
||||
|
||||
@ -10,8 +10,9 @@ export default {
|
||||
loginPhone: (data) => request.post('/app-user/login', data, { noNeedToken: true }),
|
||||
// pages
|
||||
getIndustryList: () => request.get('/industry/list'),
|
||||
getHistoryList: (params) => request.get('/app-valuations', { params }),
|
||||
valuations: (data = {}) => request.post('/app-valuations', data),
|
||||
getHistoryList: (params) => request.get('/app-valuations/', { params }),
|
||||
valuations: (data = {}) => request.post('/app-valuations/', data),
|
||||
deleteValuations: (params = {}) => request.delete(`/app-valuations/${params.id}`),
|
||||
// profile
|
||||
updatePassword: (data = {}) => request.post('/base/update_password', data),
|
||||
// users
|
||||
|
||||
@ -26,7 +26,10 @@ export function resResolve(response) {
|
||||
const code = data?.code ?? status
|
||||
/** 根据code处理对应的操作,并返回处理后的message */
|
||||
const message = resolveResError(code, data?.msg ?? statusText)
|
||||
window.$message?.error(message, { keepAliveOnHover: true })
|
||||
console.log(message,'message')
|
||||
if(message){
|
||||
window.$message?.error(message, { keepAliveOnHover: true })
|
||||
}
|
||||
return Promise.reject({ code, message, error: data || response })
|
||||
}
|
||||
return Promise.resolve(data)
|
||||
@ -37,7 +40,10 @@ export async function resReject(error) {
|
||||
const code = error?.code
|
||||
/** 根据code处理对应的操作,并返回处理后的message */
|
||||
const message = resolveResError(code, error.message)
|
||||
window.$message?.error(message)
|
||||
console.log(message,'message')
|
||||
if(message){
|
||||
window.$message?.error(message)
|
||||
}
|
||||
return Promise.reject({ code, message, error })
|
||||
}
|
||||
const { data, status } = error.response
|
||||
@ -54,6 +60,9 @@ export async function resReject(error) {
|
||||
// 后端返回的response数据
|
||||
const code = data?.code ?? status
|
||||
const message = resolveResError(code, data?.msg ?? error.message)
|
||||
window.$message?.error(message, { keepAliveOnHover: true })
|
||||
console.log(message,'message')
|
||||
if(message){
|
||||
window.$message?.error(message, { keepAliveOnHover: true })
|
||||
}
|
||||
return Promise.reject({ code, message, error: error.response?.data || error.response })
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<div style="margin-left: 20px;">
|
||||
<div v-for="(item, index) in historyList" @click="selectTimeBox(item)" :class="{ timeBox: item.id != isSelected, timeBox2: item.id == isSelected}">
|
||||
{{ item.created_at.slice(0,10) + ' ' + item.created_at.slice(11,16) }}
|
||||
<img v-if="item.id == isSelected" class="delete-icon" src="@/assets/images/delete.png" alt="">
|
||||
<img v-if="item.id == isSelected" class="delete-icon" src="@/assets/images/delete.png" alt="" @click.stop="deleteValuations(item)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -363,9 +363,9 @@
|
||||
:options="accountsOptions"
|
||||
/>
|
||||
<NInput v-model:value="modalForm.online_accounts[1]" placeholder="请输入账号" style="width: 220px; margin-left: 10px;" />
|
||||
<NInput v-model:value="modalForm.online_accounts[2]" placeholder="请输入点赞量" style="width: 220px; margin-left: 10px;" type="number"/>
|
||||
<NInput v-model:value="modalForm.online_accounts[3]" placeholder="请输入评论量" style="width: 220px; margin-left: 10px;" type="number"/>
|
||||
<NInput v-model:value="modalForm.online_accounts[4]" placeholder="请输入评论量" style="width: 220px; margin-left: 10px;" type="number"/>
|
||||
<NInput v-model:value="modalForm.online_accounts[2]" placeholder="请输入点赞数量" style="width: 220px; margin-left: 10px;" type="number"/>
|
||||
<NInput v-model:value="modalForm.online_accounts[3]" placeholder="请输入评论数量" style="width: 220px; margin-left: 10px;" type="number"/>
|
||||
<NInput v-model:value="modalForm.online_accounts[4]" placeholder="请输入分享数量" style="width: 220px; margin-left: 10px;" type="number"/>
|
||||
</n-form-item-gi>
|
||||
</n-grid>
|
||||
<n-grid v-if="currentStep == 4" :cols="24" :x-gap="0">
|
||||
@ -409,7 +409,7 @@
|
||||
</n-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
<n-select v-model:value="modalForm.circulation" placeholder="请选择" :options="circulationOptions"/>
|
||||
<n-select v-model:value="modalForm.circulation" placeholder="请选择" :options="circulationOptions" :consistent-menu-width="false"/>
|
||||
</n-form-item-gi>
|
||||
<n-form-item-gi :span="12" class="form-item" label="该商品最近一次市场活动时间" path="last_market_activity">
|
||||
<template #label>
|
||||
@ -458,14 +458,18 @@
|
||||
</n-grid>
|
||||
</NForm>
|
||||
<div class="submit-box">
|
||||
<div v-if="currentStep != 0" class="submit-btn2" @click="previousStep">
|
||||
<div v-if="currentStep != 0" class="submit-btn2" style="cursor: pointer;" @click="previousStep" >
|
||||
上一步
|
||||
</div>
|
||||
<div v-if="currentStep != 4" class="submit-btn" @click="nextStep">
|
||||
下一步
|
||||
<div v-if="currentStep != 4" class="submit-btn">
|
||||
<n-spin style="cursor: pointer;" :show="loading" @click="nextStep">
|
||||
下一步
|
||||
</n-spin>
|
||||
</div>
|
||||
<div v-if="currentStep == 4" class="submit-btn" @click="nextStep">
|
||||
立即评估
|
||||
<div v-if="currentStep == 4" class="submit-btn">
|
||||
<n-spin :show="loading" @click="nextStep" style="cursor: pointer;">
|
||||
立即评估
|
||||
</n-spin>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -473,7 +477,7 @@
|
||||
<div v-if="status=='success'" class="right" >
|
||||
<div class="price-container" :style="{ backgroundImage: `url(${backgroundImg})`}">
|
||||
<div>
|
||||
¥9,988,670
|
||||
¥{{ parseInt(selectedObj?.calculation_result?.final_value_ab) }}
|
||||
</div>
|
||||
<div style="font-size: 20px; color: #303133; line-height: 20px;">
|
||||
最终评估结果
|
||||
@ -515,14 +519,19 @@
|
||||
<div style="margin-top: 20px;">风险调整系数:<span style="font-weight: bold; color: #2EAE44; ">低</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="retry" @click="retry" style="background: #F8F8F8; color: #303133;">重新评估</div>
|
||||
<div class="retry" @click="retry" style="background: #F8F8F8; color: #303133; line-height: 40px;">
|
||||
<img style="width: 16px; height: 16px; transform: translate(0,2px); margin-right: 6px;" src="@/assets/images/retry.png" alt="">
|
||||
重新评估
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="status=='fail'" class="right" style="text-align: center;">
|
||||
<img style="width: 100px; height: 100px; margin-top: 30vh;" src="@/assets/images/fail.png" alt="">
|
||||
<div style="font-size: 20px;">评估失败</div>
|
||||
<div style="font-size: 14px; color: #999999; margin-top: 10px;">很抱歉,您的知识产权和非物质文化遗产的价值评估失败,请重新评估</div>
|
||||
|
||||
<div class="retry" @click="retry">重新评估</div>
|
||||
<div class="retry" @click="retry">
|
||||
<img style="width: 16px; height: 16px; transform: translate(0,2px); margin-right: 6px;" src="@/assets/images/retry.png" alt="">
|
||||
重新评估
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="status=='pending'" class="right" style="text-align: center;">
|
||||
<img style="width: 100px; height: 100px; margin-top: 30vh;" src="@/assets/images/loading.png" alt="">
|
||||
@ -537,7 +546,7 @@ import type { FormInst, FormItemRule, FormRules } from 'naive-ui'
|
||||
import StepProgressBar from './components/StepProgressBar.vue';
|
||||
import api from '@/api'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { useMessage, useDialog } from 'naive-ui'
|
||||
import backgroundImg from '@/assets/images/background.png';
|
||||
import backgroundImg1 from '@/assets/images/bgc.png';
|
||||
import backgroundImg2 from '@/assets/images/bgy.png';
|
||||
@ -553,7 +562,8 @@ const steps = [
|
||||
{ title: '非遗应用与推广' },
|
||||
{ title: '非遗资产衍生商品信息' }
|
||||
];
|
||||
const actionUrl = 'http://124.222.245.240:8080/api/v1/upload/image'
|
||||
const loading = ref(false)
|
||||
const actionUrl = 'https://value.cdcee.net/api/v1/upload/image'
|
||||
const currentStep = ref(0)
|
||||
const historyList = ref([])
|
||||
const modalForm = reactive({
|
||||
@ -1003,11 +1013,15 @@ const delete3 = (file) => {
|
||||
console.log(modalForm.inheritor_certificates)
|
||||
}
|
||||
const previousStep = () => {
|
||||
console.log(modalForm)
|
||||
currentStep.value --
|
||||
}
|
||||
|
||||
const nextStep = () => {
|
||||
console.log(modalForm)
|
||||
if(loading.value){
|
||||
return
|
||||
}
|
||||
modalFormRef.value?.validate((errors) => {
|
||||
if (!errors) {
|
||||
if(currentStep.value != 4){
|
||||
@ -1018,7 +1032,6 @@ const nextStep = () => {
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log(errors)
|
||||
message.error('请完善表单')
|
||||
}
|
||||
})
|
||||
@ -1043,7 +1056,7 @@ const submit = () => {
|
||||
pattern_images: modalForm.pattern_images.map(item => item.url),
|
||||
implementation_stage: maturityOptions.find(item => item.value === modalForm.application_maturity).label,
|
||||
coverage_area: coverageOptions.find(item => item.value === modalForm.application_coverage).label,
|
||||
collaboration_type: depthOptions.find(item => item.value === modalForm.cooperation_depth).label,
|
||||
collaboration_type: depthOptions.find(item => item.value === modalForm.cooperation_depth)?.label,
|
||||
scarcity_level: circulationOptions.find(item => item.value === modalForm.circulation).label,
|
||||
market_activity_time: activityOptions.find(item => item.value === modalForm.last_market_activity).label,
|
||||
price_fluctuation: [modalForm.price_fluctuation[0]-0,modalForm.price_fluctuation[1]-0],
|
||||
@ -1088,14 +1101,13 @@ const submit = () => {
|
||||
}
|
||||
}
|
||||
data.inheritor_age_count = data.inheritor_ages
|
||||
message.success('正在评估中,请前往历史记录查看')
|
||||
loading.value = true
|
||||
api.valuations(data).then(res=>{
|
||||
message.success('评估中,请前往历史记录查看')
|
||||
loading.value = false
|
||||
getHistoryList()
|
||||
setTimeout(() => {
|
||||
window.location.reload()
|
||||
}, 1000);
|
||||
window.location.reload()
|
||||
})
|
||||
console.log('data',data)
|
||||
}
|
||||
const getHistoryList = () => {
|
||||
const params = {
|
||||
@ -1106,15 +1118,36 @@ const getHistoryList = () => {
|
||||
historyList.value = res.data
|
||||
})
|
||||
}
|
||||
const selectedObj = ref({
|
||||
calculation_result: '',
|
||||
})
|
||||
|
||||
const selectTimeBox = (item) => {
|
||||
isSelected.value = item.id
|
||||
status.value = item.status
|
||||
selectedObj.value = item
|
||||
}
|
||||
|
||||
const retry = () => {
|
||||
status.value = 'create'
|
||||
}
|
||||
const dialog = useDialog()
|
||||
const deleteValuations = (item) => {
|
||||
dialog.warning({
|
||||
title: '确认删除',
|
||||
content: '是否确认删除记录?',
|
||||
positiveText: '确定',
|
||||
negativeText: '取消',
|
||||
draggable: true,
|
||||
onPositiveClick: () => {
|
||||
api.deleteValuations(item).then(()=>{
|
||||
message.success('删除成功')
|
||||
getHistoryList()
|
||||
status.value = 'create'
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const params = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user