From 6d74d87ce215ff1f278c15930c4f46d801e9b85b Mon Sep 17 00:00:00 2001 From: sudoooooo Date: Wed, 3 Apr 2024 21:41:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=85=BC=E5=AE=B9=E5=B1=95=E7=A4=BA=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=92=8Cnps=E9=A2=98=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../survey/template/surveyTemplate/survey/normal.json | 8 -------- .../survey/template/surveyTemplate/survey/nps.json | 4 ++-- .../template/surveyTemplate/survey/register.json | 8 -------- .../survey/template/surveyTemplate/survey/vote.json | 8 -------- web/src/common/xss.js | 2 +- web/src/management/pages/analysis/components/table.vue | 9 +++++++-- .../materials/questions/widgets/NpsModule/index.vue | 10 +++++++++- web/src/materials/questions/widgets/NpsModule/meta.js | 2 ++ web/src/materials/setters/widgets/Select.vue | 5 ++++- 9 files changed, 25 insertions(+), 31 deletions(-) diff --git a/server/src/modules/survey/template/surveyTemplate/survey/normal.json b/server/src/modules/survey/template/surveyTemplate/survey/normal.json index 34ec56d1..3808e775 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/normal.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/normal.json @@ -16,10 +16,6 @@ "minNum": "", "maxNum": "", "star": 5, - "nps": { - "leftText": "极不满意", - "rightText": "极满意" - }, "placeholderDesc": "", "urlKey": "", "textRange": { @@ -71,10 +67,6 @@ "importData": "", "cOption": "", "cOptions": [], - "nps": { - "leftText": "极不满意", - "rightText": "极满意" - }, "star": 5, "exclude": false, "textRange": { diff --git a/server/src/modules/survey/template/surveyTemplate/survey/nps.json b/server/src/modules/survey/template/surveyTemplate/survey/nps.json index 86bac01e..8901c69b 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/nps.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/nps.json @@ -19,7 +19,8 @@ "extraOptions": [], "importKey": "single", "importData": "", - "npsMin": 0, + "addressType": 3, + "isAuto": false, "urlKey": "", "hasRely": true, "relyList": [], @@ -60,7 +61,6 @@ "importData": "", "cOption": "", "cOptions": [], - "npsMin": 0, "star": 5, "urlKey": "", "defaultProps": { diff --git a/server/src/modules/survey/template/surveyTemplate/survey/register.json b/server/src/modules/survey/template/surveyTemplate/survey/register.json index 9145e4b3..5f2fd5be 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/register.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/register.json @@ -16,10 +16,6 @@ "minNum": "", "maxNum": "", "star": 5, - "nps": { - "leftText": "极不满意", - "rightText": "极满意" - }, "exclude": false, "placeholderDesc": "", "textRange": { @@ -86,10 +82,6 @@ "placeholderDesc": "" } ], - "nps": { - "leftText": "极不满意", - "rightText": "极满意" - }, "star": 5, "exclude": false, "urlKey": "", diff --git a/server/src/modules/survey/template/surveyTemplate/survey/vote.json b/server/src/modules/survey/template/surveyTemplate/survey/vote.json index 40ca93b3..9ae7d7fe 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/vote.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/vote.json @@ -17,10 +17,6 @@ "minNum": "", "maxNum": "", "star": 5, - "nps": { - "leftText": "极不满意", - "rightText": "极满意" - }, "exclude": false, "placeholderDesc": "", "urlKey": "", @@ -70,10 +66,6 @@ "hash": "115020" } ], - "nps": { - "leftText": "极不满意", - "rightText": "极满意" - }, "star": 5, "textRange": { "min": { diff --git a/web/src/common/xss.js b/web/src/common/xss.js index f0c03ea1..79154118 100644 --- a/web/src/common/xss.js +++ b/web/src/common/xss.js @@ -29,7 +29,7 @@ const isVideo = (html) => { export const cleanRichText = (text) => { if (!text) { - return ''; + return text === 0 ? 0 : ''; } const html = transformHtmlTag(text); const content = html.replace(/<[^<>]+>/g, '').replace(/ /g, ''); diff --git a/web/src/management/pages/analysis/components/table.vue b/web/src/management/pages/analysis/components/table.vue index dd44b1d5..21950f0a 100644 --- a/web/src/management/pages/analysis/components/table.vue +++ b/web/src/management/pages/analysis/components/table.vue @@ -39,14 +39,14 @@ class="table-row-cell" v-popover="scope.$index + scope.column.property" > - {{ cleanRichText(scope.row[scope.column.property]) || '未知' }} + {{ getContent(scope.row[scope.column.property]) }} @@ -69,6 +69,11 @@ export default { methods: { cleanRichText, + getContent(value) { + const content = cleanRichText(value) + + return content === 0 ? 0 : (content || '未知') + } }, }; diff --git a/web/src/materials/questions/widgets/NpsModule/index.vue b/web/src/materials/questions/widgets/NpsModule/index.vue index fa4f0748..9d819533 100644 --- a/web/src/materials/questions/widgets/NpsModule/index.vue +++ b/web/src/materials/questions/widgets/NpsModule/index.vue @@ -12,6 +12,7 @@ :value="indexValue" iconClass="number" @change="confirmNps" + :class="npsClass" /> { } } } - ::v-deep .star-wrapper-main { + @media (max-width: 930px) { + ::v-deep .question-block { + padding: 0; + } + } + ::v-deep .radio-nps-hover { .star-item { &:hover { background-color: $primary-color; diff --git a/web/src/materials/questions/widgets/NpsModule/meta.js b/web/src/materials/questions/widgets/NpsModule/meta.js index df34b950..42c620fd 100644 --- a/web/src/materials/questions/widgets/NpsModule/meta.js +++ b/web/src/materials/questions/widgets/NpsModule/meta.js @@ -68,12 +68,14 @@ const meta = { type: 'Input', key: 'minMsg', direction: 'horizon', + placeholder: '极不满意', }, { label: '最大值文案', type: 'Input', key: 'maxMsg', direction: 'horizon', + placeholder: '十分满意', }, ], }, diff --git a/web/src/materials/setters/widgets/Select.vue b/web/src/materials/setters/widgets/Select.vue index 0520c6bd..70a646da 100644 --- a/web/src/materials/setters/widgets/Select.vue +++ b/web/src/materials/setters/widgets/Select.vue @@ -27,7 +27,10 @@ export default { name: 'Select', data() { return { - validValue: this.formConfig.value || '', + validValue: + !this.formConfig.value && this.formConfig.value != 0 + ? '' + : this.formConfig.value, }; }, props: {