fix: 修复数据统计兼容展示处理和nps题型问题

This commit is contained in:
sudoooooo 2024-04-03 21:41:31 +08:00
parent 08aaefc3e4
commit 6d74d87ce2
9 changed files with 25 additions and 31 deletions

View File

@ -16,10 +16,6 @@
"minNum": "", "minNum": "",
"maxNum": "", "maxNum": "",
"star": 5, "star": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"placeholderDesc": "", "placeholderDesc": "",
"urlKey": "", "urlKey": "",
"textRange": { "textRange": {
@ -71,10 +67,6 @@
"importData": "", "importData": "",
"cOption": "", "cOption": "",
"cOptions": [], "cOptions": [],
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5, "star": 5,
"exclude": false, "exclude": false,
"textRange": { "textRange": {

View File

@ -19,7 +19,8 @@
"extraOptions": [], "extraOptions": [],
"importKey": "single", "importKey": "single",
"importData": "", "importData": "",
"npsMin": 0, "addressType": 3,
"isAuto": false,
"urlKey": "", "urlKey": "",
"hasRely": true, "hasRely": true,
"relyList": [], "relyList": [],
@ -60,7 +61,6 @@
"importData": "", "importData": "",
"cOption": "", "cOption": "",
"cOptions": [], "cOptions": [],
"npsMin": 0,
"star": 5, "star": 5,
"urlKey": "", "urlKey": "",
"defaultProps": { "defaultProps": {

View File

@ -16,10 +16,6 @@
"minNum": "", "minNum": "",
"maxNum": "", "maxNum": "",
"star": 5, "star": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false, "exclude": false,
"placeholderDesc": "", "placeholderDesc": "",
"textRange": { "textRange": {
@ -86,10 +82,6 @@
"placeholderDesc": "" "placeholderDesc": ""
} }
], ],
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5, "star": 5,
"exclude": false, "exclude": false,
"urlKey": "", "urlKey": "",

View File

@ -17,10 +17,6 @@
"minNum": "", "minNum": "",
"maxNum": "", "maxNum": "",
"star": 5, "star": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false, "exclude": false,
"placeholderDesc": "", "placeholderDesc": "",
"urlKey": "", "urlKey": "",
@ -70,10 +66,6 @@
"hash": "115020" "hash": "115020"
} }
], ],
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5, "star": 5,
"textRange": { "textRange": {
"min": { "min": {

View File

@ -29,7 +29,7 @@ const isVideo = (html) => {
export const cleanRichText = (text) => { export const cleanRichText = (text) => {
if (!text) { if (!text) {
return ''; return text === 0 ? 0 : '';
} }
const html = transformHtmlTag(text); const html = transformHtmlTag(text);
const content = html.replace(/<[^<>]+>/g, '').replace(/&nbsp;/g, ''); const content = html.replace(/<[^<>]+>/g, '').replace(/&nbsp;/g, '');

View File

@ -39,14 +39,14 @@
class="table-row-cell" class="table-row-cell"
v-popover="scope.$index + scope.column.property" v-popover="scope.$index + scope.column.property"
> >
{{ cleanRichText(scope.row[scope.column.property]) || '未知' }} {{ getContent(scope.row[scope.column.property]) }}
</span> </span>
<el-popover <el-popover
:ref="scope.$index + scope.column.property" :ref="scope.$index + scope.column.property"
placement="top-start" placement="top-start"
trigger="hover" trigger="hover"
width="300" width="300"
:content="cleanRichText(scope.row[scope.column.property]) || '未知'" :content="getContent(scope.row[scope.column.property])"
> >
</el-popover> </el-popover>
</template> </template>
@ -69,6 +69,11 @@ export default {
methods: { methods: {
cleanRichText, cleanRichText,
getContent(value) {
const content = cleanRichText(value)
return content === 0 ? 0 : (content || '未知')
}
}, },
}; };
</script> </script>

View File

@ -12,6 +12,7 @@
:value="indexValue" :value="indexValue"
iconClass="number" iconClass="number"
@change="confirmNps" @change="confirmNps"
:class="npsClass"
/> />
<QuestionWithRule <QuestionWithRule
v-if="isShowInput" v-if="isShowInput"
@ -63,6 +64,8 @@ const props = defineProps({
}); });
const emit = defineEmits(['change']); const emit = defineEmits(['change']);
const npsClass = !props.readonly ? 'radio-nps-hover' : '';
const rating = computed({ const rating = computed({
get() { get() {
return props.value; return props.value;
@ -134,7 +137,12 @@ const onMoreDataChange = (data) => {
} }
} }
} }
::v-deep .star-wrapper-main { @media (max-width: 930px) {
::v-deep .question-block {
padding: 0;
}
}
::v-deep .radio-nps-hover {
.star-item { .star-item {
&:hover { &:hover {
background-color: $primary-color; background-color: $primary-color;

View File

@ -68,12 +68,14 @@ const meta = {
type: 'Input', type: 'Input',
key: 'minMsg', key: 'minMsg',
direction: 'horizon', direction: 'horizon',
placeholder: '极不满意',
}, },
{ {
label: '最大值文案', label: '最大值文案',
type: 'Input', type: 'Input',
key: 'maxMsg', key: 'maxMsg',
direction: 'horizon', direction: 'horizon',
placeholder: '十分满意',
}, },
], ],
}, },

View File

@ -27,7 +27,10 @@ export default {
name: 'Select', name: 'Select',
data() { data() {
return { return {
validValue: this.formConfig.value || '', validValue:
!this.formConfig.value && this.formConfig.value != 0
? ''
: this.formConfig.value,
}; };
}, },
props: { props: {