Merge branch 'feature-creative-center' into feature-creative-center-v2
This commit is contained in:
@@ -25,7 +25,7 @@ export default {
|
||||
state.guideOtherNeed = false;
|
||||
},
|
||||
[GUIDE_SELECT_NEED](state) {
|
||||
state.guideOtherNeed = false;
|
||||
state.guideSelectNeed = false;
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -46,5 +46,33 @@ class Common {
|
||||
}
|
||||
return sColor;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取富文本的文本内容
|
||||
*/
|
||||
static rtxGetText(tx) {
|
||||
return cheerio.load(tx).text().replace(/\s*/g, "").replaceAll("\n", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断富文本是否相等
|
||||
*/
|
||||
static rtxEqual(tx1, tx2){
|
||||
if(tx1.includes("img") || tx2.includes("img")){
|
||||
return tx1 == tx2;
|
||||
}
|
||||
const $old = this.rtxGetText(tx1);
|
||||
const $new = this.rtxGetText(tx2);
|
||||
return $old === $new;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断富文本是否为空
|
||||
*/
|
||||
static rtxIsEmpty(tx) {
|
||||
if(tx.includes("img") ) return false;
|
||||
return this.rtxEqual(tx, '')
|
||||
}
|
||||
}
|
||||
export default Common
|
||||
|
||||
@@ -34,7 +34,7 @@ export default defineComponent({
|
||||
};
|
||||
const isMobile = browser.versions.mobile && !browser.versions.iPad;
|
||||
try {
|
||||
localStorage.setItem("plantIp", returnCitySN["cip"]);
|
||||
localStorage.setItem("plantIp", window.returnCitySN?window.returnCitySN["cip"]:"127.0.0.1");
|
||||
} catch (error) {
|
||||
localStorage.setItem("plantIp", "");
|
||||
}
|
||||
|
||||
@@ -193,9 +193,6 @@
|
||||
v-model:answer="question.answer"
|
||||
@changeAnswer="onRelation($event, question)"
|
||||
isMobile
|
||||
:answerSn="questionsData.answer.sn"
|
||||
:answerSurveySn="questionsData.answer.survey_sn"
|
||||
:question="question"
|
||||
/>
|
||||
<!-- 矩阵打分题 -->
|
||||
<matrix-rate
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<Remark :title="label + '介绍语评论'" :type="2" v-if="!isAnswer" />
|
||||
</div>
|
||||
</div>
|
||||
<SceneSurveyViewer v-if="shopData" :shopData="shopData" :surveyId="surveyId" :hidden="true"/>
|
||||
<SceneSurveyViewer v-if="shopData" :shopData="shopData" :surveyId="surveyId" :hidden="true" @onLoadingCompletion="onLoadingCompletion" :page="page" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -79,6 +79,7 @@ export default defineComponent({
|
||||
|
||||
const shopData = ref(null);
|
||||
const surveyId = ref(null);
|
||||
const page = ref(null);
|
||||
|
||||
watch(() => props.questions, (arr) => {
|
||||
|
||||
@@ -95,7 +96,38 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
|
||||
return { themeColor, shopData, surveyId };
|
||||
const onLoadingCompletion = () => {
|
||||
|
||||
// 3D资源预获取
|
||||
try{
|
||||
var target = props.questions.find(question => question?.config?.scene_information);
|
||||
if(!target) return;
|
||||
|
||||
var scene = target.config.scene_information;
|
||||
if(!scene) return;
|
||||
|
||||
var shelf = scene.shelves.find(shelf => shelf.planetid == target.config.shelf);
|
||||
if(!shelf) return;
|
||||
|
||||
var wares = shelf.wares;
|
||||
|
||||
page.value = {
|
||||
cells: shelf.cells.map((cell, index) => {
|
||||
return {
|
||||
...cell,
|
||||
...wares[index % wares.length],
|
||||
showSign: !!target.config.is_price_tag,
|
||||
showLogo: false,
|
||||
};
|
||||
}),
|
||||
};
|
||||
}
|
||||
catch(e) {
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
return { themeColor, shopData, surveyId, onLoadingCompletion, page };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -61,8 +61,9 @@ import BrowsingRecordApi from "./api.js";
|
||||
import { QUESTION_TYPE } from "@/views/planetDesign/Design/components/config/config3d.constant.js";
|
||||
|
||||
import SceneGuidance from "./SceneGuidance.vue";
|
||||
import { debounce } from 'lodash-es';
|
||||
|
||||
const no3dPages = ["/survey/analyse/data-particulars", "/preview"];
|
||||
const no3dPages = ["/survey/analyse/data-particulars", "/preview", "/home/market"];
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@@ -81,7 +82,7 @@ export default defineComponent({
|
||||
// 配置
|
||||
config: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
default: () => ({}),
|
||||
},
|
||||
// 样本SN
|
||||
answerSn: {
|
||||
@@ -114,9 +115,9 @@ export default defineComponent({
|
||||
surveyId() {
|
||||
return this.config.scene;
|
||||
},
|
||||
scene() {
|
||||
return this.config.scene_information;
|
||||
},
|
||||
// scene() {
|
||||
// return this.config.scene_information;
|
||||
// },
|
||||
shelves() {
|
||||
if (!this.scene) return [];
|
||||
return this.scene.shelves;
|
||||
@@ -161,38 +162,99 @@ export default defineComponent({
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
scene: null,
|
||||
|
||||
shopData: null,
|
||||
page: null,
|
||||
sceneAction: null,
|
||||
elCart: null,
|
||||
hold: null,
|
||||
|
||||
// 用于控制下一页点击
|
||||
pager: {
|
||||
// 判断能否点击
|
||||
activate: false,
|
||||
timeoutId: 0,
|
||||
// 初始化点击延迟
|
||||
init(time = 4000) {
|
||||
this.activate = false;
|
||||
if(this.timeoutId) {
|
||||
clearTimeout(this.timeoutId);
|
||||
this.timeoutId = 0
|
||||
}
|
||||
this.timeoutId = setTimeout(() => {
|
||||
this.activate = true;
|
||||
}, time);
|
||||
},
|
||||
// 清空延迟
|
||||
clear() {
|
||||
if(this.timeoutId) {
|
||||
clearTimeout(this.timeoutId);
|
||||
this.timeoutId = 0
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
showTimeTimeoutId: 0,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
beforeUnmount() {
|
||||
this.pager.clear();
|
||||
if(this.showTimeTimeoutId) clearTimeout(this.showTimeTimeoutId);
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
if(!this.canUse3D) return;
|
||||
|
||||
this.pager.init();
|
||||
|
||||
this.scene = this.config.scene_information;
|
||||
|
||||
// 解决缓存问题,答卷时加载场景信息
|
||||
if(!this.scene) {
|
||||
var res = await BrowsingRecordApi.getSurveysScene({
|
||||
sn: this.$route.query.sn,
|
||||
question_index: this.question.question_index
|
||||
});
|
||||
this.scene = res.data?.scene_information;
|
||||
}
|
||||
|
||||
this.shopData = buildShopDataDemo(this.scene);
|
||||
|
||||
if(this.config.is_show_time && this.config.show_time){
|
||||
setTimeout(() => this.$emit("next"), this.config.show_time * 1000)
|
||||
this.showTimeTimeoutId = setTimeout(() => {
|
||||
this.showTimeTimeoutId = 0;
|
||||
this.$emit("next");
|
||||
}, this.config.show_time * 1000)
|
||||
}
|
||||
|
||||
if(this.config.is_three_dimensions) {
|
||||
|
||||
if(this.config.is_binding_goods) {
|
||||
this.$refs.SceneGuidance.show({
|
||||
this.$refs.SceneGuidance?.show({
|
||||
isSelect: true,
|
||||
isMobile: this.isMobile
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.$refs.SceneGuidance.show({
|
||||
this.$refs.SceneGuidance?.show({
|
||||
isSelect: false,
|
||||
isMobile: this.isMobile
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
next() {
|
||||
|
||||
console.log(this.pager.activate);
|
||||
if(!this.pager.activate) {
|
||||
return;
|
||||
}
|
||||
this.pager.init();
|
||||
|
||||
this.$emit("next", () => new Promise((resolve) => {
|
||||
this.sceneAction = {
|
||||
action: "hold_to_shelf",
|
||||
@@ -201,6 +263,12 @@ export default defineComponent({
|
||||
}));
|
||||
},
|
||||
previous() {
|
||||
|
||||
if(!this.pager.activate) {
|
||||
return;
|
||||
}
|
||||
this.pager.init();
|
||||
|
||||
this.sceneAction = {
|
||||
action: "hold_to_shelf",
|
||||
};
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
:freezeRotY="!!config.is_default_perspective"
|
||||
@onLoadingCompletion="onLoadingCompletion"
|
||||
@onFromSceneHoldToShelf="onFromSceneHoldToShelf"
|
||||
@onPageCompletion="onPageCompletion"
|
||||
@onBehaviorFlush="onBehaviorFlush"
|
||||
/>
|
||||
<div :class="isMobile?'mobile':'pc'">
|
||||
@@ -41,8 +42,9 @@ import { message } from "ant-design-vue";
|
||||
import { matrixInputValidate } from "./questionValidate";
|
||||
|
||||
import SceneGuidance from "./SceneGuidance.vue";
|
||||
import { debounce } from 'lodash-es';
|
||||
|
||||
const no3dPages = ["/survey/analyse/data-particulars", "/preview"];
|
||||
const no3dPages = ["/survey/analyse/data-particulars", "/preview", "/home/market"];
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@@ -105,9 +107,9 @@ export default defineComponent({
|
||||
surveyId() {
|
||||
return this.config.scene;
|
||||
},
|
||||
scene() {
|
||||
return this.config.scene_information;
|
||||
},
|
||||
// scene() {
|
||||
// return this.config.scene_information;
|
||||
// },
|
||||
shelves() {
|
||||
if (!this.scene) return [];
|
||||
return this.scene.shelves;
|
||||
@@ -133,25 +135,76 @@ export default defineComponent({
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
||||
scene: null,
|
||||
|
||||
shopData: null,
|
||||
page: null,
|
||||
rowIndex: 0,
|
||||
sceneAction: null
|
||||
sceneAction: null,
|
||||
|
||||
|
||||
// 用于控制下一页点击
|
||||
pager: {
|
||||
// 判断能否点击
|
||||
activate: false,
|
||||
timeoutId: 0,
|
||||
// 初始化点击延迟
|
||||
init(time = 4000) {
|
||||
this.activate = false;
|
||||
if(this.timeoutId) {
|
||||
clearTimeout(this.timeoutId);
|
||||
this.timeoutId = 0
|
||||
}
|
||||
this.timeoutId = setTimeout(() => {
|
||||
this.activate = true;
|
||||
}, time);
|
||||
},
|
||||
// 清空延迟
|
||||
clear() {
|
||||
if(this.timeoutId) {
|
||||
clearTimeout(this.timeoutId);
|
||||
this.timeoutId = 0
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
beforeUnmount() {
|
||||
this.pager.clear();
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
if(!this.canUse3D) return;
|
||||
|
||||
this.pager.init();
|
||||
|
||||
this.scene = this.config.scene_information;
|
||||
|
||||
// 解决缓存问题,答卷时加载场景信息
|
||||
if(!this.scene) {
|
||||
var res = await BrowsingRecordApi.getSurveysScene({
|
||||
sn: this.$route.query.sn,
|
||||
question_index: this.question.question_index
|
||||
});
|
||||
this.scene = res.data?.scene_information;
|
||||
}
|
||||
|
||||
this.shopData = buildShopDataDemo(this.scene);
|
||||
|
||||
this.$emit("update:answer", {});
|
||||
this.shopData = buildShopDataDemo(this.scene);
|
||||
this.rowIndex = 0;
|
||||
|
||||
if(this.config.is_three_dimensions) {
|
||||
this.$refs.SceneGuidance.show({
|
||||
this.$refs.SceneGuidance?.show({
|
||||
isSelect: false,
|
||||
isMobile: this.isMobile
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
next() {
|
||||
|
||||
// 矩阵填空题判断逻辑
|
||||
@@ -185,6 +238,13 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
if(this.rowIndex + 1 >= this.row.length){
|
||||
|
||||
console.log(this.pager.activate);
|
||||
if(!this.pager.activate) {
|
||||
return;
|
||||
}
|
||||
this.pager.init();
|
||||
|
||||
this.$emit("next", () => new Promise((resolve) => {
|
||||
this.sceneAction = {
|
||||
action: "hold_to_shelf",
|
||||
@@ -196,7 +256,14 @@ export default defineComponent({
|
||||
this.rowIndex += 1;
|
||||
},
|
||||
previous(){
|
||||
|
||||
if(this.rowIndex <= 0){
|
||||
|
||||
if(!this.pager.activate) {
|
||||
return;
|
||||
}
|
||||
this.pager.init();
|
||||
|
||||
this.sceneAction = {
|
||||
action: "hold_to_shelf",
|
||||
};
|
||||
@@ -227,6 +294,8 @@ export default defineComponent({
|
||||
// action: "hold_to_shelf",
|
||||
// }
|
||||
},
|
||||
onPageCompletion() {
|
||||
},
|
||||
// 用户行为记录
|
||||
onBehaviorFlush(data) {
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export default {
|
||||
onEventTrigger: () => {},
|
||||
|
||||
// 是否为选择购物车模式
|
||||
isSelect: true,
|
||||
types: [],
|
||||
|
||||
// 当前提示页
|
||||
current: 0,
|
||||
@@ -33,22 +33,22 @@ export default {
|
||||
// 提示数据
|
||||
stepsData: [
|
||||
{
|
||||
isSelect: false,
|
||||
type: "other",
|
||||
urlPC: "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/guide/pc-1.png",
|
||||
urlMb: "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/guide/mobile-1.png",
|
||||
},
|
||||
{
|
||||
isSelect: false,
|
||||
type: "other",
|
||||
urlPC: "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/guide/pc-2.png",
|
||||
urlMb: "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/guide/mobile-2.png",
|
||||
},
|
||||
{
|
||||
isSelect: false,
|
||||
type: "other",
|
||||
urlPC: "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/guide/pc-3.png",
|
||||
urlMb: "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/guide/mobile-3.png",
|
||||
},
|
||||
{
|
||||
isSelect: true,
|
||||
type: "select",
|
||||
urlPC: "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/guide/pc-4.png",
|
||||
urlMb: "https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/guide/mobile-4.png",
|
||||
},
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
|
||||
computed: {
|
||||
steps(){
|
||||
return this.stepsData.filter(x => x.isSelect == this.isSelect).map(x => ({ url: x[this.deviceType]}));
|
||||
return this.stepsData.filter(x => this.types.includes(x.type)).map(x => ({ url: x[this.deviceType]}));
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
@@ -92,17 +92,28 @@ export default {
|
||||
// 展示提示
|
||||
show({isSelect, isMobile}) {
|
||||
|
||||
var types = [];
|
||||
if(isSelect){
|
||||
if(!this.$store.state.answer.guideSelectNeed) return;
|
||||
this.$store.commit("answer/GUIDE_SELECT_NEED")
|
||||
if(this.$store.state.answer.guideSelectNeed) {
|
||||
this.$store.commit("answer/GUIDE_SELECT_NEED");
|
||||
types.push("select");
|
||||
}
|
||||
if(this.$store.state.answer.guideOtherNeed) {
|
||||
this.$store.commit("answer/GUIDE_OTHER_NEED");
|
||||
types.push("other");
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(!this.$store.state.answer.guideOtherNeed) return;
|
||||
this.$store.commit("answer/GUIDE_OTHER_NEED")
|
||||
if(this.$store.state.answer.guideOtherNeed) {
|
||||
this.$store.commit("answer/GUIDE_OTHER_NEED");
|
||||
types.push("other");
|
||||
}
|
||||
}
|
||||
|
||||
if(types.length <= 0) return;
|
||||
|
||||
//
|
||||
this.isSelect = !!isSelect;
|
||||
this.types = types;
|
||||
this.steps = 0;
|
||||
this.visible = true;
|
||||
},
|
||||
@@ -118,6 +129,8 @@ export default {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: 9999;
|
||||
background-color: #FFFFFF;
|
||||
user-select: none;
|
||||
.step{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -8,5 +8,12 @@ export default class BrowsingRecordApi {
|
||||
data: params.data,
|
||||
})
|
||||
}
|
||||
/* 获取3D资源 */
|
||||
static getSurveysScene(params) {
|
||||
return request({
|
||||
method: 'get',
|
||||
url: `/answer/surveys/${params.sn}/scene?question_index=${params.question_index}`,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
color: #fff;
|
||||
z-index: 999;
|
||||
padding: 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.pc .page .iconfont {
|
||||
@@ -41,13 +42,13 @@
|
||||
.pc .pageNext::before{
|
||||
content: "下一页";
|
||||
padding-right: 10px;
|
||||
line-height: 52px;
|
||||
line-height: 50px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.pc .pagePre::after{
|
||||
content: "上一页";
|
||||
padding-left: 10px;
|
||||
line-height: 52px;
|
||||
line-height: 50px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
@@ -89,6 +90,7 @@
|
||||
transform: translate(-50%, -50%);
|
||||
display: inline-block;
|
||||
z-index: 998;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pc .q-content-top {
|
||||
@@ -101,7 +103,7 @@
|
||||
|
||||
line-height: 30px;
|
||||
padding: 10px 20px;
|
||||
top: 40px;
|
||||
top: 0;
|
||||
|
||||
z-index: 997;
|
||||
}
|
||||
@@ -110,7 +112,7 @@
|
||||
}
|
||||
|
||||
.pc .q-content-top>*:nth-child(2) {
|
||||
margin-top: 10px;
|
||||
/*margin-top: 10px;*/
|
||||
}
|
||||
|
||||
.pc .q-content-top .ant-radio {
|
||||
@@ -172,14 +174,14 @@
|
||||
.mobile .pageNext::before{
|
||||
content: "下一页";
|
||||
padding-right: 10px;
|
||||
line-height: 42px;
|
||||
line-height: 43px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.mobile .pagePre::after{
|
||||
content: "上一页";
|
||||
padding-left: 10px;
|
||||
line-height: 42px;
|
||||
line-height: 43px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
@@ -235,7 +237,7 @@
|
||||
|
||||
line-height: 30px;
|
||||
padding: 10px 20px;
|
||||
top: 40px;
|
||||
top: 20px;
|
||||
|
||||
width: 90%;
|
||||
|
||||
@@ -246,7 +248,7 @@
|
||||
}
|
||||
|
||||
.mobile .q-content-top>*:nth-child(2) {
|
||||
margin-top: 10px;
|
||||
/*margin-top: 10px;*/
|
||||
}
|
||||
|
||||
.mobile .q-content-top .ant-radio {
|
||||
@@ -264,9 +266,14 @@
|
||||
|
||||
|
||||
/* 公共样式 - 开始 */
|
||||
.q-content-top .radio-group{
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
.q-content-top .radio-group>.radio {
|
||||
width: auto !important;
|
||||
color: #fff !important;
|
||||
margin-bottom: 0!important;
|
||||
margin-right: 16px!important;
|
||||
}
|
||||
|
||||
.q-content-top .ant-radio-inner {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</a-select>
|
||||
</div>
|
||||
<div style="width: 100%; height: 400px; position: relative;">
|
||||
<div :ref="scene.planet_id" style="width: 100%; height: 100%;"></div>
|
||||
<div :ref="scene.chart_ref" style="width: 100%; height: 100%;"></div>
|
||||
<div v-show="!scene.data.length" class="no-result">
|
||||
<img :src="require('@/assets/img/publish/no-data.png')" alt="" class="empty-img"/>
|
||||
<div class="empty-text">暂无分析结果</div>
|
||||
@@ -111,7 +111,8 @@ export default {
|
||||
},
|
||||
async mounted() {
|
||||
var res = await browsingRecordScenes({ sn: this.$route.query.sn });
|
||||
res.data.scenes.forEach((scene) => {
|
||||
res.data.scenes.forEach((scene, index) => {
|
||||
scene.chart_ref = "q3d_chart_" + index;
|
||||
scene.selectedQuestionIndex = [];
|
||||
scene.columns = columns;
|
||||
scene.data = [];
|
||||
@@ -178,6 +179,11 @@ export default {
|
||||
* 选择变换事件
|
||||
*/
|
||||
onQuestionIndexChange: debounce(async function(scene) {
|
||||
|
||||
if(scene.selectedQuestionIndex.length <= 0) {
|
||||
scene.data = [];
|
||||
return;
|
||||
}
|
||||
|
||||
scene.spinning = true;
|
||||
var res = await tdsceneAnalysis({
|
||||
@@ -192,7 +198,7 @@ export default {
|
||||
|
||||
scene.data = data;
|
||||
|
||||
charts[scene.planet_id].setOption({
|
||||
charts[scene.chart_ref].setOption({
|
||||
title: {
|
||||
show: false,
|
||||
},
|
||||
@@ -244,10 +250,10 @@ export default {
|
||||
});
|
||||
}, 500),
|
||||
init(scene) {
|
||||
var el = this.$refs[scene.planet_id];
|
||||
var el = this.$refs[scene.chart_ref];
|
||||
if (el instanceof Array) el = el[0];
|
||||
charts[scene.planet_id] = echarts.init(el);
|
||||
charts[scene.planet_id].setOption({
|
||||
charts[scene.chart_ref] = echarts.init(el);
|
||||
charts[scene.chart_ref].setOption({
|
||||
title: {
|
||||
text: '暂无数据',
|
||||
x: 'center',
|
||||
|
||||
@@ -18,6 +18,7 @@ import { computed, defineComponent, ref } from "vue";
|
||||
import { jsonp } from "vue-jsonp";
|
||||
import { loginIn } from "../Login/api.js";
|
||||
import { jsonpUrl } from "../../config.js";
|
||||
import { message } from "ant-design-vue";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Avatar,
|
||||
@@ -35,7 +36,7 @@ export default defineComponent({
|
||||
}
|
||||
const token = computed(() => store.state.common.token);
|
||||
try {
|
||||
localStorage.setItem("plantIp", returnCitySN["cip"]);
|
||||
localStorage.setItem("plantIp", window.returnCitySN?window.returnCitySN["cip"]:"127.0.0.1");
|
||||
} catch (error) {
|
||||
localStorage.setItem("plantIp", "");
|
||||
}
|
||||
@@ -56,7 +57,7 @@ export default defineComponent({
|
||||
localStorage.setItem("plantUserInfo", JSON.stringify(data));
|
||||
localStorage.setItem("plantId", JSON.stringify(data.id));
|
||||
} catch (error) {
|
||||
this.$message.error(
|
||||
message.error(
|
||||
error.data?.message || error.message || "服务器错误"
|
||||
);
|
||||
}
|
||||
@@ -66,7 +67,7 @@ export default defineComponent({
|
||||
spinningLoading.value = true;
|
||||
jsonp(jsonpUrl, {
|
||||
appId: "yip",
|
||||
remoteIp: returnCitySN["cip"],
|
||||
remoteIp: window.returnCitySN?window.returnCitySN["cip"]:"127.0.0.1",
|
||||
callbackQuery: "jsonpCallback",
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
@change="(val) => {
|
||||
configTemp.shelf = null;
|
||||
configTemp.ware = null;
|
||||
onUpdate(val);
|
||||
configTemp.material_sn = null;
|
||||
onSceneChange(val);
|
||||
}"
|
||||
allowClear
|
||||
placeholder="请选择场景"
|
||||
@@ -189,6 +190,8 @@
|
||||
:max="100000"
|
||||
:value="configTemp.show_time"
|
||||
@update:value="(val) => configTemp.show_time = Number(val).toFixed(0)"
|
||||
:formatter="value => `${value}秒`"
|
||||
:parser="value => value.replace('秒', '')"
|
||||
style="width: 80px; border-radius: 4px;"
|
||||
@change="onUpdate"
|
||||
/>
|
||||
@@ -331,6 +334,9 @@ export default {
|
||||
shelves() {
|
||||
if (!this.configTemp.scene) return [];
|
||||
if (!this.scene) return [];
|
||||
if (this.configTemp.scene_information) {
|
||||
return this.configTemp.scene_information.shelves;
|
||||
}
|
||||
return this.scene.shelves;
|
||||
},
|
||||
shelf() {
|
||||
@@ -350,7 +356,6 @@ export default {
|
||||
},
|
||||
// 权限-是否展示3D
|
||||
permission3D() {
|
||||
return true;
|
||||
try{
|
||||
return !!this.$store.state.common.questionInfo.survey.is_three_d_permissions;
|
||||
}
|
||||
@@ -388,8 +393,11 @@ export default {
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
// 环境类型
|
||||
var type0 = process.env.VUE_APP_CURRENTMODE == "prod" ? "prod" : "test";
|
||||
var type1 = process.env.VUE_APP_CURRENTMODE == "prod" ? "prod" : "uat";
|
||||
// 默认的模型接口
|
||||
var res = await fetch("https://test-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/uat-yls/3D/shelves/scenes_data/yili.json").then(res => res.json());
|
||||
var res = await fetch(`https://${type0}-cxp-public-web-1302259445.cos.ap-beijing.myqcloud.com/${type1}-yls/3D/shelves/scenes_data/yili.json`).then(res => res.json());
|
||||
this.scenes = res;
|
||||
},
|
||||
methods: {
|
||||
@@ -405,14 +413,16 @@ export default {
|
||||
this.onUpdate();
|
||||
},
|
||||
|
||||
onUpdate() {
|
||||
|
||||
onSceneChange(){
|
||||
if (this.scene) {
|
||||
this.configTemp.scene_information = JSON.parse(
|
||||
JSON.stringify(this.scene)
|
||||
);
|
||||
}
|
||||
|
||||
this.onUpdate();
|
||||
},
|
||||
|
||||
onUpdate() {
|
||||
this.$emit("update:config", this.configTemp);
|
||||
this.$emit("changeConfig", this.configTemp);
|
||||
},
|
||||
|
||||
@@ -48,6 +48,7 @@ export default {
|
||||
};
|
||||
},
|
||||
beforeUnmount(){
|
||||
if(!target) return;
|
||||
target.style.zIndex = -1;
|
||||
window.removeEventListener('message', this.handler);
|
||||
},
|
||||
@@ -55,6 +56,9 @@ export default {
|
||||
|
||||
// 获取根元素
|
||||
target = document.getElementById("__3d__");
|
||||
|
||||
// 未知页面不做处理
|
||||
if(!target) return;
|
||||
|
||||
// 隐藏模式加载
|
||||
if(!this.hidden){
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<template>
|
||||
<div class="container-viewer-1-"></div>
|
||||
<div class="container-viewer-1-">
|
||||
<div v-if="freezeRotY" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SurveyViewer } from "@/views/planetDesign/SceneSurveyViewerPage/shelves.module.js";
|
||||
import { SurveyViewer } from "./shelves.module.js";
|
||||
|
||||
export default {
|
||||
props: ["surveyId", "shopData", "page", "sceneAction", "elCart", "defaultWare", "isLocked", "freezeRotY"],
|
||||
@@ -49,6 +51,10 @@ export default {
|
||||
page(newVal, oldVal) {
|
||||
// console.log('page ........', newVal, oldVal)
|
||||
if (this.viewer_) {
|
||||
|
||||
this.viewer_.flyAnimation = !(this.defaultWare?.planetid && this.isLocked);
|
||||
this.viewer_.frostFarScene = this.isLocked;
|
||||
|
||||
this.viewer_.arrange(newVal).then(() => {
|
||||
this.$emit("onPageCompletion");
|
||||
|
||||
@@ -58,8 +64,7 @@ export default {
|
||||
this.viewer_.hold({
|
||||
wareId: this.defaultWare?.planetid,
|
||||
keepHold: this.isLocked,
|
||||
frostFarScene: this.isLocked,
|
||||
freezeRotY: this.freezeRotY ? "0" : undefined,
|
||||
// freezeRotY: this.freezeRotY ? "0" : undefined,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -171,6 +171,9 @@ import OptionShow from "../../components/OptionShow.vue";
|
||||
import * as cheerio from "cheerio";
|
||||
import { message } from "ant-design-vue";
|
||||
import { getOptionName } from "../../js/util.js";
|
||||
|
||||
import common from "@/utils/methods/Common.js"
|
||||
|
||||
export default {
|
||||
name: "Choice",
|
||||
components: {
|
||||
@@ -284,17 +287,18 @@ export default {
|
||||
const optionSet = (optionList, element, index) => {
|
||||
const findIndex = optionList.findIndex((opt, fIndex) => {
|
||||
if (fIndex !== index) {
|
||||
const $old = cheerio
|
||||
.load(opt.option)
|
||||
.text()
|
||||
.replace(/\s*/g, "")
|
||||
.replaceAll("\n", "");
|
||||
const $new = cheerio
|
||||
.load(element.option)
|
||||
.text()
|
||||
.replace(/\s*/g, "")
|
||||
.replaceAll("\n", "");
|
||||
return $old === $new;
|
||||
// const $old = cheerio
|
||||
// .load(opt.option)
|
||||
// .text()
|
||||
// .replace(/\s*/g, "")
|
||||
// .replaceAll("\n", "");
|
||||
// const $new = cheerio
|
||||
// .load(element.option)
|
||||
// .text()
|
||||
// .replace(/\s*/g, "")
|
||||
// .replaceAll("\n", "");
|
||||
// return $old === $new;
|
||||
return common.rtxEqual(opt.option, element.option);
|
||||
}
|
||||
});
|
||||
if (findIndex !== -1) {
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
</ConfigBaseItem>
|
||||
<!-- 3D 相关配置 -->
|
||||
<Config3D :key="copyConfig.question_index&©Config.question_type" v-model:config="copyConfig.config" @changeConfig="() => updateConfig(copyConfig)" :questionType="copyConfig.question_type" :question="copyConfig"/>
|
||||
<Config3D :key="copyConfig.question_index*copyConfig.question_type" v-model:config="copyConfig.config" @changeConfig="() => updateConfig(copyConfig)" :questionType="copyConfig.question_type" :question="copyConfig"/>
|
||||
|
||||
<ConfigRequire
|
||||
title="选项随机"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<div v-if="spinning" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; background-color: #fff;">
|
||||
<a-spin style="position: absolute; left: 50%; top: 50%;"/>
|
||||
</div>
|
||||
<div v-if="freezeRotY" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -121,6 +122,10 @@ export default {
|
||||
page(newVal, oldVal) {
|
||||
// console.log('page ........', newVal, oldVal)
|
||||
if (this.viewer_) {
|
||||
|
||||
this.viewer_.flyAnimation = !(this.defaultWare?.planetid && this.isLocked);
|
||||
this.viewer_.frostFarScene = this.isLocked;
|
||||
|
||||
this.viewer_.arrange(newVal).then(() => {
|
||||
// this.$emit("onPageCompletion");
|
||||
setTimeout(() => {
|
||||
@@ -134,8 +139,8 @@ export default {
|
||||
this.viewer_.hold({
|
||||
wareId: this.defaultWare?.planetid,
|
||||
keepHold: this.isLocked,
|
||||
frostFarScene: this.isLocked,
|
||||
freezeRotY: this.freezeRotY ? "0" : undefined,
|
||||
// 组件内置的固定角度有问题,单独通过遮罩实现
|
||||
// freezeRotY: this.freezeRotY ? "0" : undefined,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user