{"version":3,"file":"KrCsat.cjs","sources":["../../../../../packages/src/kr-csat/KrCsat.vue"],"sourcesContent":["<template>\n    <!-- 单选题 -->\n    <div class=\"question-item\">\n        <div class=\"question-item-num\">\n            <question-title v-if=\"titleIsEdit\" :dataList=\"dataList\" @numberBlur=\"(e) => emits('numberChange', e)\" />\n            <div v-else style=\"margin-top: 8px\">{{ dataList.questionNumber }}</div>\n        </div>\n        <div class=\"question-item-content\">\n            <div class=\"title\">\n                <rich-text-editor\n                    ref=\"titileInput\"\n                    class=\"titile-input\"\n                    v-model:valueData=\"dataList.title\"\n                    @focus=\"() => (tipsShow = true)\"\n                    @blur=\"() => (tipsShow = false)\"\n                />\n            </div>\n            <div class=\"content\">\n                <div class=\"score-box\" v-if=\"dataList.icon === 'Number'\">\n                    <div class=\"score-icon\" v-for=\"(item, index) in dataList.score\" :key=\"index\">\n                        <div\n                            class=\"score-icon_number\"\n                            :style=\"{\n                                background: index === 0 ? 'rgba(34, 64, 195, 1)' : '',\n                                color: index === 0 ? '#fff' : '',\n                            }\"\n                        >\n                            {{ item }}\n                        </div>\n                        <div v-if=\"dataList.showScoreExplain\" class=\"score-explain\">\n                            <span>{{ dataList[`score${index + 1}`] }}</span>\n                        </div>\n                    </div>\n                </div>\n                <div class=\"score-box\" v-else-if=\"dataList.icon === 'Ruler'\">\n                    <div class=\"score-icon\" v-for=\"(item, index) in dataList.score\" :key=\"index\">\n                        <div\n                            class=\"score-icon_ruler\"\n                            :style=\"{\n                                background: index === 0 ? 'rgba(34, 64, 195, 1)' : '',\n                                color: index === 0 ? '#fff' : '',\n                            }\"\n                        >\n                            {{ item }}\n                        </div>\n                        <div v-if=\"dataList.showScoreExplain\" class=\"score-explain\">\n                            <span>{{ dataList[`score${index + 1}`] }}</span>\n                        </div>\n                    </div>\n                </div>\n                <div v-else class=\"score-box\">\n                    <div class=\"score-icon\" v-for=\"(item, index) in dataList.score\">\n                        <img v-if=\"index === 0\" :src=\"getAssetsImages(dataList.icon + '_light')\" />\n                        <img v-else :src=\"getAssetsImages(dataList.icon)\" />\n                        <div v-if=\"dataList.showScoreExplain\" class=\"score-explain\">\n                            <span>{{ dataList[`score${index + 1}`] }}</span>\n                        </div>\n                    </div>\n                </div>\n                <!-- 题目聚焦时，出现提示框 -->\n                <div v-show=\"tipsShow\" class=\"title-tips\">此题是判断客户整体满意度的重要题目，修改题干请勿偏离“整体满意度”原意。</div>\n            </div>\n\n            <!-- 底部操作栏 -->\n            <div class=\"footer-operation\" v-if=\"footerShow\">\n                <action-bar\n                    class=\"action-bar\"\n                    @addCopy=\"() => emits('copyQuestion', dataList)\"\n                    @deleteQuestion=\"() => emits('deleteQuestion')\"\n                    @view=\"(e) => emits('singlePreview', e)\"\n                />\n            </div>\n        </div>\n    </div>\n</template>\n<script setup name=\"kr-csat\">\n// js\nimport { ref, watch, provide } from \"vue\";\n\n// components\nimport RichTextEditor from \"@/components/editor/RichTextEditor.vue\";\nimport ActionBar from \"@/components/action/ActionBar.vue\";\nimport QuestionTitle from \"@/components/question/QuestionNumber.vue\";\n\nimport { getAssetsImages } from \"@/utils/index\";\n\n// props\nconst props = defineProps({\n    // 是否展示底部操作栏\n    footerShow: {\n        type: Boolean,\n        default: true,\n    },\n    // 题号是否可编辑\n    titleIsEdit: {\n        type: Boolean,\n        default: true,\n    },\n    // 数据渲染\n    dataList: {\n        type: Object,\n        default: () => ({}),\n    },\n});\nconst emits = defineEmits([\"copyQuestion\", \"deleteQuestion\", \"change\", \"singlePreview\", \"numberChange\"]); // 复制题目，删除题目, 数据改变, 单题预览;\nconst titileInput = ref(null);\nlet tipsShow = ref(false);\nwatch(\n    () => props.dataList,\n    (curr, old) => {\n        // 绑定数据改变时调change方法\n        emits(\"change\", curr);\n    },\n    { deep: true }\n);\n\n// 可能会在外面改变内部输入框的聚焦情况\ndefineExpose({ titileInput });\nprovide(\"data\", props.dataList);\n</script>\n<style lang=\"scss\" scoped>\n@use \"@/css/common.scss\" as *;\n.content {\n    .score-box {\n        display: flex;\n        .score-icon {\n            width: 60px;\n            min-height: 32px;\n            margin-right: 25px;\n            display: flex;\n            flex-direction: column;\n            white-space: nowrap;\n            align-items: center;\n            img {\n                width: 32px;\n                height: 32px;\n            }\n            .score-explain {\n                height: 18px;\n                margin-top: 10px;\n                color: rgba(112, 120, 134, 1);\n                font-size: 12px;\n                white-space: pre-wrap;\n                text-align: center;\n            }\n        }\n        .score-icon_ruler {\n            width: 32px;\n            height: 32px;\n            border: 1px solid rgba(228, 229, 232, 1);\n            color: rgba(102, 102, 102, 1);\n            line-height: 33px;\n            text-align: center;\n        }\n        .score-icon_number {\n            width: 32px;\n            height: 32px;\n            border: 1px solid rgba(228, 229, 232, 1);\n            color: rgba(102, 102, 102, 1);\n            border-radius: 50%;\n            line-height: 33px;\n            text-align: center;\n        }\n    }\n}\n</style>\n"],"names":["titileInput","ref","tipsShow","watch","props","curr","old","emits","expose","provide"],"mappings":"2oCAyGAA,EAAAC,EAAAA,IAAA,IAAA,EACA,IAAAC,EAAAD,EAAAA,IAAA,EAAA,EACAE,OAAAA,EAAA,MACA,IAAAC,EAAA,SACA,CAAAC,EAAAC,IAAA,CAEAC,EAAA,SAAAF,CAAA,CACA,EACA,CAAA,KAAA,EAAA,CACA,EAGAG,EAAA,CAAA,YAAAR,CAAA,CAAA,EACAS,EAAAA,QAAA,OAAAL,EAAA,QAAA"}