first commit
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<view class="min-height bg-main-light">
|
||||
<HeaderItem title="企业法治体检"/>
|
||||
<view class="bg-white p-20 text-25 flex justify-center items-center">
|
||||
<text class="tag selected-tag">{{ title }}</text>
|
||||
</view>
|
||||
<view class="pos-r" v-if="configList && configList.length">
|
||||
<view class="circle-bottom-bg"></view>
|
||||
<view class="tips-card-wrap">
|
||||
<view class="tips-card">
|
||||
<view class="text-28 font-bold text-center p-30">【{{ typeLabel }}】</view>
|
||||
<u-line color="#1DBCBC" dashed></u-line>
|
||||
<view class="text-25 p-20">{{ configList[activeIndex].title }}</view>
|
||||
<view class="p-20 flex justify-start items-center" @click="selectItem(item, index)"
|
||||
v-for="(item, index) in JSON.parse(configList[activeIndex].answer)" :key="index">
|
||||
<template v-if="configList[activeIndex].type === 'single'">
|
||||
<u-icon
|
||||
:name="configList[activeIndex].selected.includes(item.content) ? '/legalOrgCheck/static/radio-selected.png' : '/legalOrgCheck/static/radio.png'"/>
|
||||
<text class="text-25 ml-10">{{ item.content }}</text>
|
||||
</template>
|
||||
<template v-else-if="configList[activeIndex].type === 'multi'">
|
||||
<u-icon
|
||||
:name="configList[activeIndex].selected.includes(item.content) ? '/legalOrgCheck/static/checkbox-selected.png' : '/legalOrgCheck/static/checkbox.png'"/>
|
||||
<text class="text-25 ml-10">{{ item.content }}</text>
|
||||
</template>
|
||||
</view>
|
||||
<u-gap height="100rpx"/>
|
||||
</view>
|
||||
<view class="flex justify-center items-center">
|
||||
<view class="mx-15">
|
||||
<u-button shape="circle" @click="toLastItem" v-if="activeIndex > 0"
|
||||
:customStyle="{background: 'linear-gradient(91.28deg, rgba(14,146,252,1) 27.63%,rgba(29,188,188,1) 80.08%)',
|
||||
border: 0, width: '200rpx',
|
||||
color: 'white'}">
|
||||
查看上一题
|
||||
</u-button>
|
||||
</view>
|
||||
<view class="mx-15">
|
||||
<u-button shape="circle" @click="toNextItem"
|
||||
v-if="activeIndex > 0 && configList[activeIndex].type === 'multi'"
|
||||
:customStyle="{background: 'linear-gradient(91.28deg, rgba(14,146,252,1) 27.63%,rgba(29,188,188,1) 80.08%)',
|
||||
border: 0, width: '200rpx',
|
||||
color: 'white'}">
|
||||
确认
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderItem from "@/components/HeaderItem.vue";
|
||||
import {listLegalOrgCheckConfigReq} from "@/api/legalOrgCheck";
|
||||
|
||||
export default {
|
||||
name: "detail",
|
||||
components: {HeaderItem},
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
title: '',
|
||||
configList: [],
|
||||
typeList: [{value: 'single', label: '单选'}, {value: 'multi', label: '多选'}, {value: 'fill', label: '填空'}],
|
||||
activeIndex: 0,
|
||||
typeLabel: '',
|
||||
point: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
const {data} = await listLegalOrgCheckConfigReq({
|
||||
typeId: this.id
|
||||
})
|
||||
this.configList = data
|
||||
this.typeLabel = this.typeList.find(item => item.value === data[0].type).label
|
||||
this.configList.map(item => {
|
||||
item.selected = []
|
||||
return item
|
||||
})
|
||||
},
|
||||
selectItem(item, index) {
|
||||
// console.log(index, this.configList[index], this.configList.length - 1)
|
||||
if (this.configList[this.activeIndex].type === 'single') {
|
||||
this.configList[this.activeIndex].selected = [item.content]
|
||||
if (this.activeIndex === this.configList.length - 1) {
|
||||
this.toEnd()
|
||||
} else {
|
||||
this.activeIndex += 1
|
||||
this.typeLabel = this.typeList.find(item => item.value === this.configList[this.activeIndex].type).label
|
||||
}
|
||||
} else if (this.configList[this.activeIndex].type === 'multi') {
|
||||
const hasIndex = this.configList[this.activeIndex].selected.findIndex(i => i === item.content)
|
||||
if (hasIndex > -1) {
|
||||
this.configList[this.activeIndex].selected.splice(hasIndex, 1)
|
||||
} else {
|
||||
this.configList[this.activeIndex].selected.push(item.content)
|
||||
}
|
||||
}
|
||||
this.calPoint()
|
||||
this.$forceUpdate()
|
||||
},
|
||||
calPoint() {
|
||||
this.point = 0
|
||||
this.configList.forEach(item => {
|
||||
JSON.parse(item.answer).map(answer => {
|
||||
if (item.selected.includes(answer.content)) {
|
||||
this.point += parseFloat(answer.point)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
toNextItem() {
|
||||
if (!this.configList[this.activeIndex].selected.length) {
|
||||
return this.$toast('请选择选项')
|
||||
}
|
||||
if (this.activeIndex === this.configList.length - 1) {
|
||||
this.toEnd()
|
||||
} else {
|
||||
this.activeIndex += 1
|
||||
this.typeLabel = this.typeList.find(item => item.value === this.configList[this.activeIndex].type).label
|
||||
}
|
||||
},
|
||||
toLastItem() {
|
||||
this.activeIndex -= 1
|
||||
},
|
||||
toEnd() {
|
||||
let content = []
|
||||
this.configList.map(item => {
|
||||
content.push({
|
||||
quest: item.title,
|
||||
answer: item.selected.join('、')
|
||||
})
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: `/legalOrgCheck/pages/result?title=${this.title}&typeId=${this.id}&point=${this.point}`,
|
||||
success: res => {
|
||||
res.eventChannel.emit('content', content)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad({id, title}) {
|
||||
this.id = id
|
||||
this.title = title
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tag {
|
||||
padding: 10rpx 25rpx;
|
||||
margin-right: 25rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.selected-tag {
|
||||
background-color: #FFCA68;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
|
||||
|
||||
.circle-bottom-bg {
|
||||
background-color: #1DBCBC;
|
||||
width: 100vw;
|
||||
height: 200rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-radius: 0 0 100vw 100vw;
|
||||
}
|
||||
|
||||
.tips-card-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 70rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
|
||||
.tips-card {
|
||||
width: 80%;
|
||||
line-height: 30rpx;
|
||||
border-radius: 50rpx;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(16, 16, 16, 1);
|
||||
box-shadow: 0 2px 6px 0 rgba(202, 247, 247, 1);
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<view class="min-height bg-main-light">
|
||||
<HeaderItem title="企业法治体检"/>
|
||||
<u-image src="/legalOrgCheck/static/v2_suc04p.png" width="100%" height="160rpx" mode="widthFix"></u-image>
|
||||
<view class="bg-white p-20 text-25 flex justify-start items-center overflow-x">
|
||||
<text v-for="(item, index) in typeList" :key="index" class="tag"
|
||||
@click="changeType(index)"
|
||||
:class="[item.id === activeId ? 'selected-tag' : '']">{{ item.title }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="pos-r">
|
||||
<view class="circle-bottom-bg"></view>
|
||||
<view class="tips-card-wrap">
|
||||
<view class="tips-card">
|
||||
<view class="text-28 font-bold text-center">{{ activeTitle }}</view>
|
||||
<view class="text-25 mt-20" style="padding-bottom: 50rpx">
|
||||
{{ activeContent }}
|
||||
</view>
|
||||
</view>
|
||||
<u-button shape="circle" @click="$jump(`/legalOrgCheck/pages/detail?id=${activeId}&title=${activeTitle}`)"
|
||||
:customStyle="{background: 'linear-gradient(91.28deg, rgba(14,146,252,1) 27.63%,rgba(29,188,188,1) 80.08%)',
|
||||
border: 0, width: '200rpx',
|
||||
color: 'white'}">
|
||||
开始
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderItem from "@/components/HeaderItem.vue";
|
||||
import {listLegalOrgCheckTypeReq} from "@/api/legalOrgCheck";
|
||||
|
||||
export default {
|
||||
name: "index",
|
||||
components: {HeaderItem},
|
||||
data() {
|
||||
return {
|
||||
typeList: [],
|
||||
activeId: 0,
|
||||
activeTitle: 0,
|
||||
activeContent: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getTypeList() {
|
||||
const {data} = await listLegalOrgCheckTypeReq()
|
||||
this.typeList = data
|
||||
this.activeId = data[0].id
|
||||
this.activeTitle = data[0].title
|
||||
this.activeContent = data[0].content
|
||||
},
|
||||
changeType(index){
|
||||
this.activeId = this.typeList[index].id
|
||||
this.activeTitle = this.typeList[index].title
|
||||
this.activeContent = this.typeList[index].content
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getTypeList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tag {
|
||||
padding: 10rpx 25rpx;
|
||||
margin-right: 25rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.selected-tag {
|
||||
background-color: #FFCA68;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
|
||||
.circle-bottom-bg {
|
||||
background-color: #3A89CD;
|
||||
width: 100vw;
|
||||
height: 200rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-radius: 0 0 100vw 100vw;
|
||||
}
|
||||
|
||||
.tips-card-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 70rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
|
||||
.tips-card {
|
||||
width: 80%;
|
||||
line-height: 30rpx;
|
||||
padding: 30rpx;
|
||||
border-radius: 50rpx;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(16, 16, 16, 1);
|
||||
box-shadow: 0 2px 6px 0 rgba(202, 247, 247, 1);
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<web-view :src="`https://sifa-h5.wsdns.cn/#/legalOrgCheck/pages/result?id=${id}&typeId=${typeId}`"
|
||||
@message="onMessage" @onPostMessage="onMessage"/>
|
||||
<!-- <web-view :src="`http://localhost:8080/#/legalOrgCheck/pages/result?id=${id}&typeId=${typeId}`"-->
|
||||
<!-- @message="onMessage" @onPostMessage="onMessage"/>-->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "pdfResult",
|
||||
data() {
|
||||
return {
|
||||
id: null,
|
||||
typeId: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onMessage(e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
onLoad({id, typeId}) {
|
||||
this.id = id
|
||||
this.typeId = typeId
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<view class="min-height bg-main-light">
|
||||
<HeaderItem :title="title"/>
|
||||
<view class="p-30 bg-linear text-25 text-white pos-r" style="border-radius: 0 0 1000rpx 1000rpx" id="tag0">
|
||||
<view class="flex justify-center items-center">
|
||||
<view>贵公司(单位)存在的</view>
|
||||
<view class="text-orange">{{ title }}</view>
|
||||
<view>为</view>
|
||||
</view>
|
||||
<view class="flex justify-center items-center pos-r mt-25">
|
||||
<piaoyiProgressBar canvasId="progressCanvas4" :progress="25" backgroundColor="#EFEFF4"
|
||||
progressBackgroundColor="#FFC923" :showText="false" textColor="#000000" :textSize="24"
|
||||
:height="10"
|
||||
:isCircular="true" :diameter="100"></piaoyiProgressBar>
|
||||
<view class="flex justify-center items-center text-20 pos-a w-100p" style="left: 0; top: 0; height: 100rpx">
|
||||
{{ point }}分
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-25 text-25 text-white text-center">(数值越高风险越大)</view>
|
||||
<view class="pos-a w-100p flex justify-center items-center" style="bottom: -50rpx; left: 0">
|
||||
<u-button :customStyle="levelStyle" shape="circle">
|
||||
{{ comment }}
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap height="40rpx"></u-gap>
|
||||
<view class="card m-30 text-25" style="text-indent: 50rpx">
|
||||
您好! 感谢您使用“企业法治体检”对贵企业进行法律风险评估,根据您描述,结合人工智能技术,为你生成企业法治体检风险指数报告,以供参考,经评测,贵企业企业合同风险分析如下:
|
||||
</view>
|
||||
<view class="card m-30" id="tag1">
|
||||
<view v-if="loading" class="p-15 flex justify-center items-center">
|
||||
<u-loading-icon mode="semicircle" :color="MAIN()"></u-loading-icon>
|
||||
</view>
|
||||
<zero-markdown-view :markdown="returnContent" v-else></zero-markdown-view>
|
||||
</view>
|
||||
<view class="card m-30 text-25" id="tag2">
|
||||
<view class="font-bold text-center">---温馨提示---</view>
|
||||
<view style="text-indent: 50rpx" class="my-15">
|
||||
平台提醒:您的企业有着较高的企业合同风险防范意识,基本可以很好的避免企业合同风险,但此次测评仅从单一的法律领域内进行的评估,此后您的企业可在专业人士的指导下从多方法律领域进行评估,就其他可能存在风险的问题进行完善,进一步提高防控水平,以更好地规范公司各项制度。
|
||||
</view>
|
||||
<view style="color: #77A5CD">请注意:此次测评仅以公司经营过程中常见法律风险为参数进行评估,测评结果仅供参考。</view>
|
||||
</view>
|
||||
<u-gap height="200rpx"></u-gap>
|
||||
<view class="footer flex justify-center items-center text-white text-25">
|
||||
<view class="bg-main flex-1 p-20 text-center" @click="showGuide = true">报告导航</view>
|
||||
<view class="bg-orange flex-1 p-20 text-center" @click="download">下载报告</view>
|
||||
<view class="bg-main flex-1 p-20 text-center" @click="back">重做</view>
|
||||
</view>
|
||||
<u-popup :show="showGuide" close-on-click-overlay @close="showGuide = false" round="10"
|
||||
:closeable="false" mode="bottom"
|
||||
:safe-area-inset-bottom="false">
|
||||
<view class="pos-r">
|
||||
<view class="p-25 border-bottom" @click="jumpTo(0)">风险等级</view>
|
||||
<view class="p-25 border-bottom" @click="jumpTo(1)">AI分析</view>
|
||||
<view class="p-25 border-bottom" @click="jumpTo(2)">温馨提示</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderItem from "@/components/HeaderItem.vue";
|
||||
import {listArticleReq} from "@/api/common";
|
||||
import {
|
||||
addLegalOrgCheckContentReq,
|
||||
listLegalOrgCheckTypeInfoReq,
|
||||
updateLegalOrgCheckContentReq
|
||||
} from "@/api/legalOrgCheck";
|
||||
import piaoyiProgressBar
|
||||
from '@/uni_modules/piaoyi-progress-bar/components/piaoyi-progress-bar/piaoyi-progress-bar.vue';
|
||||
import {WS_API} from "@/config";
|
||||
import {getUserInfo} from "@/util/user";
|
||||
import {sendChatReq} from "@/api/lawOrg";
|
||||
import {MAIN} from "@/config/color";
|
||||
|
||||
export default {
|
||||
name: "result",
|
||||
components: {HeaderItem, piaoyiProgressBar},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
typeId: null,
|
||||
content: [],
|
||||
config: null,
|
||||
articleList: [],
|
||||
point: 0,
|
||||
levelStyle: {
|
||||
color: 'white',
|
||||
background: 'linear-gradient(97.98deg, rgba(255,201,35,1) 30.49%,rgba(255,144,10,1) 78.96%)',
|
||||
border: 0,
|
||||
width: '300rpx'
|
||||
},
|
||||
comment: '',
|
||||
returnContent: '',
|
||||
loading: false,
|
||||
aiDone: false,
|
||||
id: null,
|
||||
showGuide: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
MAIN() {
|
||||
return MAIN
|
||||
},
|
||||
back() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
async getConfig() {
|
||||
const {data} = await listLegalOrgCheckTypeInfoReq(this.typeId)
|
||||
this.config = data
|
||||
if (this.config.scoreConfig) {
|
||||
JSON.parse(this.config.scoreConfig).map(item => {
|
||||
if (item.minPoint < this.point && this.point <= item.maxPoint) {
|
||||
this.comment = item.title
|
||||
}
|
||||
})
|
||||
}
|
||||
await this.getArticleList()
|
||||
},
|
||||
async getArticleList() {
|
||||
const {data} = await listArticleReq({
|
||||
categoryId: this.config.articleCateId
|
||||
})
|
||||
this.articleList = data
|
||||
},
|
||||
downloadFile(file) {
|
||||
uni.showLoading({title: '加载中'})
|
||||
uni.downloadFile({
|
||||
url: file,
|
||||
success: function (res) {
|
||||
uni.hideLoading()
|
||||
uni.openDocument({
|
||||
showMenu: true,
|
||||
filePath: res.tempFilePath
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
copy(url) {
|
||||
uni.setClipboardData({
|
||||
data: url,
|
||||
success: function () {
|
||||
uni.showToast({
|
||||
title: '复制成功',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
async addLog(title, content, point) {
|
||||
const {data} = await addLegalOrgCheckContentReq({
|
||||
title,
|
||||
content,
|
||||
point: parseFloat(point)
|
||||
})
|
||||
this.id = data
|
||||
},
|
||||
jumpTo(id) {
|
||||
uni.pageScrollTo({
|
||||
selector: `#tag${id}`,
|
||||
duration: 300
|
||||
})
|
||||
this.showGuide = false
|
||||
},
|
||||
download(){
|
||||
if (!this.aiDone) return this.$toast('请先等待AI回答完毕')
|
||||
this.$jump(`/legalOrgCheck/pages/pdfResult?id=${this.id}&typeId=${this.typeId}`)
|
||||
}
|
||||
},
|
||||
onLoad({title, typeId, point}) {
|
||||
this.title = title
|
||||
this.typeId = typeId
|
||||
this.point = point
|
||||
this.getConfig()
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
this.returnContent = ''
|
||||
eventChannel.on('content', data => {
|
||||
this.content = data
|
||||
this.addLog(title, JSON.stringify(data), point)
|
||||
let query = `帮我分析${this.title}`
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const item = data[i]
|
||||
query += `${item.quest}: ${item.answer};`
|
||||
}
|
||||
uni.connectSocket({
|
||||
url: `${WS_API}/${getUserInfo().uid}`,
|
||||
success: () => {
|
||||
this.loading = true
|
||||
this.aiDone = false
|
||||
sendChatReq({
|
||||
query,
|
||||
user: getUserInfo().uid
|
||||
}).finally(() => {
|
||||
uni.closeSocket()
|
||||
})
|
||||
}
|
||||
})
|
||||
const _this = this
|
||||
uni.onSocketMessage(res => {
|
||||
if (res.data === '连接成功') return
|
||||
this.loading = false
|
||||
const aiData = JSON.parse(res.data)
|
||||
if (aiData.answer !== '__END__') this.returnContent += aiData.answer
|
||||
else {
|
||||
updateLegalOrgCheckContentReq({
|
||||
id: _this.id,
|
||||
aiContent: _this.returnContent
|
||||
}).then(() => {
|
||||
_this.aiDone = true
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onHide() {
|
||||
uni.closeSocket()
|
||||
},
|
||||
onUnload() {
|
||||
uni.closeSocket()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 24 KiB |