Skip to content

Commit

Permalink
合并develop
Browse files Browse the repository at this point in the history
  • Loading branch information
chaorenluo committed Aug 5, 2024
2 parents e5df926 + 9d89a1c commit 4d9162d
Show file tree
Hide file tree
Showing 22 changed files with 137 additions and 100 deletions.
2 changes: 1 addition & 1 deletion server/src/models/surveyResponse.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class SurveyResponse extends BaseEntity {
data: Record<string, any>;

@Column()
difTime: number;
diffTime: number;

@Column()
clientTime: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class DataStatisticService {
}
return {
...data,
difTime: (submitedData.difTime / 1000).toFixed(2),
diffTime: (submitedData.diffTime / 1000).toFixed(2),
createDate: moment(submitedData.createDate).format(
'YYYY-MM-DD HH:mm:ss',
),
Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/survey/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function getListHeadByDataList(dataList) {
};
});
listHead.push({
field: 'difTime',
field: 'diffTime',
title: '答题耗时(秒)',
type: QUESTION_TYPE.TEXT,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class SurveyResponseController {
encryptType: Joi.string(),
sessionId: Joi.string(),
clientTime: Joi.number().required(),
difTime: Joi.number(),
diffTime: Joi.number(),
password: Joi.string().allow(null, ''),
whitelist: Joi.string().allow(null, ''),
}).validate(reqBody, { allowUnknown: true });
Expand All @@ -65,7 +65,7 @@ export class SurveyResponseController {
data,
sessionId,
clientTime,
difTime,
diffTime,
password,
whitelist: whitelistValue,
} = value;
Expand Down Expand Up @@ -254,7 +254,7 @@ export class SurveyResponseController {
surveyPath: value.surveyPath,
data: decryptedData,
clientTime,
difTime,
diffTime,
surveyId: responseSchema.pageId,
optionTextAndId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class SurveyResponseService {
async createSurveyResponse({
data,
clientTime,
difTime,
diffTime,
surveyId,
surveyPath,
optionTextAndId,
Expand All @@ -22,7 +22,7 @@ export class SurveyResponseService {
data,
secretKeys: [],
clientTime,
difTime,
diffTime,
pageId: surveyId,
optionTextAndId,
});
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils/messagePushing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('getPushingData', () => {
status: RECORD_STATUS.NEW,
date: 1711025113146,
},
difTime: 30518,
diffTime: 30518,
data: {
data458: '15000000000',
data515: '115019',
Expand Down
2 changes: 1 addition & 1 deletion web/src/management/pages/analysis/AnalysisPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { analysisType } from '@/management/config/analysisConfig'
.right {
width: 100%;
height: 100%;
min-width: 1160px;
min-width: 1300px;
display: flex;
flex-direction: column;
overflow: hidden;
Expand Down
4 changes: 2 additions & 2 deletions web/src/management/pages/edit/components/MaterialGroup.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<draggable
v-model="renderData"
handle=".question-wrapper.isSelected"
filter=".question-wrapper.isSelected .question.isSelected"
handle=".question-wrapper.is-move"
filter=".question-wrapper.is-move .question.isSelected"
:preventOnFilter="false"
:group="DND_GROUP"
:onEnd="checkEnd"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="pagination-wrap">
<Pagination v-model="pagingEditOne" :totalPage="pagingCount" @changePage="updatePageEditOne" :intervalCount="10">
<PaginationPanel v-model="pagingEditOne" :totalPage="pagingCount" @changePage="updatePageEditOne" :intervalCount="10">
<template #tooltip="{index}">
<div>
<div v-if="index != 1" class="controls-wrap-item" @click="movePaging(index, 'up')">前移一页</div>
Expand All @@ -9,12 +9,12 @@
<div class="mt8 controls-wrap-item" @click="deletePaging(index)">删除</div>
</div>
</template>
</Pagination>
</PaginationPanel>
<i-ep-plus style="font-size: 12px;" @click="addPagingControls" class="plus-add" />
</div>
</template>
<script setup>
import Pagination from '../modules/pagingModule/Pagination.vue'
import PaginationPanel from '../modules/pagingModule/PaginationPanel.vue'
import { useEditStore } from '@/management/stores/edit'
import { storeToRefs } from 'pinia'
import { QUESTION_TYPE } from '@/common/typeEnum.ts'
Expand Down
14 changes: 11 additions & 3 deletions web/src/management/pages/edit/components/QuestionWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<template>
<div
:class="itemClass"
:class="[itemClass, { 'is-move': isSelected || isMove }]"
@mouseenter="onMouseenter"
@mouseleave="onMouseleave"
@click="clickFormItem"
>
<div><slot v-if="moduleConfig.type !== 'section'"></slot></div>

<div :class="[showHover ? 'visibily' : 'hidden', 'hoverItem']">
<div class="item el-icon-rank" @click.stop.prevent="onMove">
<div
class="item el-icon-rank"
@click.stop.prevent
@mouseenter="setMoveState(true)"
@mouseleave="setMoveState(false)"
>
<i-ep-rank />
</div>
<div v-if="showUp" class="item" @click.stop.prevent="onMoveUp">
Expand Down Expand Up @@ -66,6 +71,7 @@ const emit = defineEmits(['changeSeq', 'select'])
const { getShowLogicText, hasShowLogic } = useShowLogicInfo(props.moduleConfig.field)
const isHover = ref(false)
const isMove = ref(false)
const itemClass = computed(() => {
return {
Expand Down Expand Up @@ -158,7 +164,9 @@ const onDelete = async () => {
}
}
const onMove = () => {}
const setMoveState = (state: boolean) => {
isMove.value = state
}
</script>

<style lang="scss" scoped>
Expand Down
2 changes: 1 addition & 1 deletion web/src/management/pages/edit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ onMounted(async () => {
}
.right {
min-width: 1160px;
min-width: 1300px;
height: 100%;
padding-left: 80px;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ const hideFullTitle = () => {
<style lang="scss" scoped>
.title-container {
position: relative;
width: 280px;
max-width: 280px;
}
.title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
cursor: pointer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@ const tabSelected = ref<string>('0')
</script>
<style lang="scss" scoped>
.tab-box {
width: 300px;
width: 360px;
height: 100%;
box-shadow: none;
border: none;
overflow-y: auto;
display: flex;
flex-direction: column;
:deep(.el-tabs__nav) {
width: 100%;
}
:deep(.el-tabs__content) {
flex: 1;
overflow-y: auto;
}
:deep(.el-tabs__item) {
text-align: center;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="main-operation" @click="onMainClick" ref="mainOperation">
<div class="pagination-wrapper">
<Paging/>
<PagingWrapper/>
</div>
<div class="operation-wrapper" ref="operationWrapper">
<div class="box content" ref="box">
Expand Down Expand Up @@ -37,7 +37,7 @@
<script setup>
import { ref, watch, toRefs } from 'vue'
import communalLoader from '@materials/communals/communalLoader.js'
import Paging from '@/management/pages/edit/components/Paging.vue'
import PagingWrapper from '@/management/pages/edit/components/PagingWrapper.vue'
import MaterialGroup from '@/management/pages/edit/components/MaterialGroup.vue'
import { storeToRefs } from 'pinia'
import { useEditStore } from '@/management/stores/edit'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ import { DND_GROUP } from '@/management/config/dnd'
import questionMenuConfig, { questionTypeList } from '@/management/config/questionMenuConfig'
import { storeToRefs } from 'pinia'
import { useEditStore } from '@/management/stores/edit'
import { isNumber as _isNumber } from 'lodash-es'
import { ref } from 'vue'
const editStore = useEditStore()
const { newQuestionIndex,currentEditOne } = storeToRefs(editStore)
const { newQuestionIndex } = storeToRefs(editStore)
const { addQuestion, setCurrentEditOne,createNewQuestion } = editStore
const activeNames = ref([0, 1])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const handleChangePreview = (data: any) => {
</script>
<style lang="scss" scoped>
.tab-box {
width: 300px;
width: 360px;
height: 100%;
box-shadow: none;
border: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const changePreset = (banner: any) => {
</script>
<style lang="scss" scoped>
.tab-box {
width: 300px;
width: 360px;
height: 100%;
box-shadow: none;
border: none;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="main-operation">
<div class="pagination-wrapper">
<Paging />
<PagingWrapper />
</div>
<div class="operation-wrapper">
<div class="box" ref="box">
Expand All @@ -21,7 +21,7 @@
<script>
import { defineComponent, toRefs } from 'vue'
import MaterialGroup from '@/management/pages/edit/components/MaterialGroup.vue'
import Paging from '@/management/pages/edit/components/Paging.vue'
import PagingWrapper from '@/management/pages/edit/components/PagingWrapper.vue'
import { storeToRefs } from 'pinia'
import { useEditStore } from '@/management/stores/edit'
import communalLoader from '@materials/communals/communalLoader.js'
Expand All @@ -34,7 +34,7 @@ const LogoIcon = () => communalLoader.loadComponent('LogoIcon')
export default defineComponent({
components: {
MaterialGroup,
Paging,
PagingWrapper,
HeaderContent: HeaderContent(),
MainTitle: MainTitle(),
SubmitButton: SubmitButton(),
Expand Down
2 changes: 2 additions & 0 deletions web/src/management/pages/edit/pages/edit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ watch(
.navbar-tab {
position: absolute;
top: 10px;
left: 50%;
transform: translate(-50%);
cursor: pointer;
:deep(.el-radio-button__original-radio + .el-radio-button__inner) {
font-size: 12px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ export default defineComponent({
},
setup(props, { slots }) {
const status = ref('')
const moduleTitleRef = ref()
watch(
() => props.isSelected,
() => {
status.value = 'preview'
}
)

const handleClick = () => {
if (props.isSelected) {
status.value = 'edit'
watch(status, (v) => {
if (v === 'edit') {
document.addEventListener('click', handleDocumentClick)
} else {
document.removeEventListener('click', handleDocumentClick)
}
}
})

const typeName = computed(() => {
if (!props.showType) return ''
Expand Down Expand Up @@ -84,13 +87,34 @@ export default defineComponent({
return htmlText
})

return { slots, handleClick, status, tagTitle }
function handleClick(e) {
if (props.isSelected && status.value === 'preview') {
e.stopPropagation()
status.value = 'edit'
}
}

function handleDocumentClick(e) {
const richEditorDOM = moduleTitleRef.value.querySelector('.rich-editor')
const isClickRichEditor = richEditorDOM?.contains(e.target)

if (status.value === 'edit' && richEditorDOM && !isClickRichEditor) {
// 监听编辑状态时点击非编辑区域
status.value = 'preview'
}
}

return { slots, handleClick, status, tagTitle, moduleTitleRef }
},
render() {
const { isRequired, indexNumber, slots, status, tagTitle } = this

return (
<div class={['module-title', isRequired ? 'is-required' : '']} onClick={this.handleClick}>
<div
ref="moduleTitleRef"
class={['module-title', isRequired ? 'is-required' : '']}
onClick={this.handleClick}
>
{isRequired && <i class="module-title-required">*</i>}
<div class="module-content">
{this.showIndex && <span class="index"> {indexNumber}.</span>}
Expand Down
Loading

0 comments on commit 4d9162d

Please sign in to comment.