@qxs-bns/components-wc 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/editor/blocksuite-editor.mjs +312 -43
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/entry-subject.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/subject/blank-fill.mjs +34 -56
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/draft.mjs +2 -0
- package/es/subject/draft.mjs.map +1 -0
- package/es/subject/list.mjs +57 -99
- package/es/subject/list.mjs.map +1 -1
- package/es/subject/page-end.mjs +3 -3
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/pagination.mjs +2 -0
- package/es/subject/pagination.mjs.map +1 -0
- package/es/subject/runtime.mjs +2 -0
- package/es/subject/runtime.mjs.map +1 -0
- package/es/subject/scale.mjs +101 -152
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/single.mjs +89 -88
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/sort-controller.mjs +2 -0
- package/es/subject/sort-controller.mjs.map +1 -0
- package/es/subject/sortable.mjs +30 -0
- package/es/subject/sortable.mjs.map +1 -0
- package/es/subject/sorting-card.mjs +52 -0
- package/es/subject/sorting-card.mjs.map +1 -0
- package/es/subject/text-fill.mjs +24 -45
- package/es/subject/text-fill.mjs.map +1 -1
- package/es/subject/types.mjs +1 -1
- package/es/subject/types.mjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +304 -35
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/entry-subject.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/subject/blank-fill.cjs +24 -46
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/draft.cjs +2 -0
- package/lib/subject/draft.cjs.map +1 -0
- package/lib/subject/list.cjs +16 -58
- package/lib/subject/list.cjs.map +1 -1
- package/lib/subject/page-end.cjs +3 -3
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/pagination.cjs +2 -0
- package/lib/subject/pagination.cjs.map +1 -0
- package/lib/subject/runtime.cjs +2 -0
- package/lib/subject/runtime.cjs.map +1 -0
- package/lib/subject/scale.cjs +98 -149
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/single.cjs +89 -88
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/sort-controller.cjs +2 -0
- package/lib/subject/sort-controller.cjs.map +1 -0
- package/lib/subject/sortable.cjs +30 -0
- package/lib/subject/sortable.cjs.map +1 -0
- package/lib/subject/sorting-card.cjs +52 -0
- package/lib/subject/sorting-card.cjs.map +1 -0
- package/lib/subject/text-fill.cjs +24 -45
- package/lib/subject/text-fill.cjs.map +1 -1
- package/lib/subject/types.cjs +1 -1
- package/lib/subject/types.cjs.map +1 -1
- package/package.json +1 -1
package/lib/subject/scale.cjs
CHANGED
|
@@ -1,72 +1,24 @@
|
|
|
1
|
-
"use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./types.cjs"),a=Object.defineProperty,
|
|
1
|
+
"use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./sorting-card.cjs"),o=require("./types.cjs"),a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?n(e,s):e,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&a(e,s,o),o};function p(){return{title:""}}function d(){return Array.from({length:5},p)}function c(t){const e={...t,title:i.trimText(t?.title??t?.answer??"")},s=t?.answerId??t?.examAnswerId;return void 0!==s&&(e.answerId=s),delete e.answer,delete e.examAnswerId,e}function h(t,e){const s={...c(t),orderIndex:e+1,answer:i.trimText(t?.title??t?.answer??"")};return s.title=i.trimText(s.title??""),void 0!==s.answerId&&(s.examAnswerId=s.answerId),void 0===s.answerId&&delete s.answerId,void 0===s.isCorrect&&delete s.isCorrect,s}const x=t.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`,u=t.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>`;exports.QxsScale=class extends t.LitElement{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["show-action"]=!0,this["show-add"]=!0,this.sorting=!1,this.analysis="",this["rich-text-content"]="",this["exam-answer-relation-type"]=0,this["upload-image"]=async t=>new Promise((e,s)=>{const i=new FileReader;i.onload=t=>e(t.target?.result),i.onerror=s,i.readAsDataURL(t)}),this._answers=d(),this._scaleQuestions=[],this._rowTitle="",this._title="",this._showRichText=!1,this._richText="",this["model-value"]="",this["use-model"]=!1,this.TITLE_MAX=200}get"answer-list"(){return this._answers}set"answer-list"(t){const e=function(t){return Array.isArray(t)?t.slice(0,5).map(c):[]}(t);this._answers=e.length?e:d(),this.requestUpdate("answer-list")}get"scale-question-list"(){return this._scaleQuestions}set"scale-question-list"(t){this._scaleQuestions=function(t){return Array.isArray(t)?t.map(t=>String(t??"").trim()).filter(Boolean):[]}(t),this.requestUpdate("scale-question-list")}get"scale-questions"(){return this._scaleQuestions}set"scale-questions"(t){this["scale-question-list"]=t,this.requestUpdate("scale-questions")}willUpdate(t){const e=t.has("title")||t.has("answer-list")||t.has("rich-text-content")||t.has("scale-question-list")||t.has("scale-questions");(t.has("is-edit")&&this["is-edit"]||!this["is-edit"]&&e)&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_syncProps(){this._title=this.title||"",this._rowTitle=this._scaleQuestions.join("\n"),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"]}_emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??null}))}_onTitleInput(t){const e=t.target;e.value.length>this.TITLE_MAX&&(e.value=e.value.slice(0,this.TITLE_MAX)),this._title=e.value,this["use-model"]&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}_resolvedQuestions(){const t=this["is-edit"]?this._rowTitle:this._scaleQuestions.join("\n");return t.split("\n").map(t=>t.trim()).filter(Boolean)}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:o.SubjectType.SCALE,orderIndex:this["order-index"]},r=i.trimText(this["is-edit"]?this._title:this.title||""),a=this["is-edit"]?this._answers:this["answer-list"],n=this._resolvedQuestions(),l=this["is-edit"]?this._richText:this["rich-text-content"]||"",p=this["is-edit"]?this._showRichText:!!this["rich-text-content"];if(!r)return void e(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",s));for(let t=0;t<a.length;t++)if(!a[t].title)return void e(new i.SubjectError(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",s));if(0===n.length)return void e(new i.SubjectError("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",s));const d={answerType:o.SubjectType.SCALE,examTypeEnum:o.SubjectType.SCALE,title:r,answers:a.map(h),scaleQuestionList:n,analysis:i.trimText(this.analysis||""),examRichTextContent:p?l:"",isSetCorrectAnswer:!1};this["custom-id"]&&(d.customId=this["custom-id"]),t(d)})}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){!function(t){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(e),setTimeout(()=>{e.style.opacity="0",setTimeout(()=>e.remove(),300)},2500)}(t.message)}}validate(){const t=[],e={customId:this["custom-id"]||void 0,answerType:o.SubjectType.SCALE,orderIndex:this["order-index"]},s=i.trimText(this["is-edit"]?this._title:this.title||""),r=this["is-edit"]?this._answers:this["answer-list"],a=this._resolvedQuestions();return s||t.push(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e)),r.forEach((s,r)=>{s.title||t.push(new i.SubjectError(`选项${String.fromCharCode(65+r)}未填写`,"ANSWER_EMPTY","answers",e))}),0===a.length&&t.push(new i.SubjectError("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e)),t}_renderPreview(){const e=Math.floor(100/((this._answers.length||1)+1));return t.html`
|
|
2
2
|
<div class="preview">
|
|
3
3
|
<span class="title">${this["order-index"]+1}.${this.title}(量表题)</span>
|
|
4
4
|
${this["rich-text-content"]?t.html`<div style="margin-top:8px" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<div class="section-row">
|
|
20
|
-
<span class="value-text">标签/关键信息:</span>
|
|
21
|
-
<div class="tag-list" style="margin-top:6px">
|
|
22
|
-
${this._selectedTagList.map(e=>t.html`<span class="tag-item">${e.tagName}</span>`)}
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
`:""}
|
|
26
|
-
${this._renderResourceSection()}
|
|
27
|
-
</div>
|
|
28
|
-
`}_renderTagSection(){return this["show-tag"]?t.html`
|
|
29
|
-
<div class="flex-items-start section-row">
|
|
30
|
-
<div class="label"><span>标签:</span></div>
|
|
31
|
-
<div style="flex:1">
|
|
32
|
-
<div class="tag-list">
|
|
33
|
-
${this._selectedTagList.length?this._selectedTagList.map(e=>t.html`
|
|
34
|
-
<span class="tag-item">
|
|
35
|
-
${e.tagName}
|
|
36
|
-
${this["is-save"]?"":t.html`<span class="close" @click=${()=>this._removeTag(e.tagId)}>×</span>`}
|
|
37
|
-
</span>
|
|
38
|
-
`):t.html`<span class="tag-hint">暂无标签/关键信息</span>`}
|
|
39
|
-
</div>
|
|
40
|
-
${this["is-edit"]&&!this["is-save"]?t.html`<div style="margin-top:8px"><span class="el-link" @click=${()=>this._chooseTag()}>选择</span></div>`:""}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
`:""}_renderCategorySection(){return this["show-category"]?t.html`
|
|
44
|
-
<div class="flex-items-start section-row">
|
|
45
|
-
<div class="label"><span>分类:</span></div>
|
|
46
|
-
<div style="flex:1">
|
|
47
|
-
${this["is-edit"]?t.html`
|
|
48
|
-
<select class="el-select" .value=${String(this._categoryId)} ?disabled=${this["is-save"]}
|
|
49
|
-
@change=${t=>this._onCategoryChange(t.target.value)}>
|
|
50
|
-
<option value="">选择分类</option>
|
|
51
|
-
${this["category-list"].map(e=>t.html`
|
|
52
|
-
<option value=${String(e.categoryId)} ?selected=${String(e.categoryId)===String(this._categoryId)}>${e.title||e.categoryName}</option>
|
|
5
|
+
<div class="scale-table-wrap">
|
|
6
|
+
<table class="scale-table">
|
|
7
|
+
<thead>
|
|
8
|
+
<tr>
|
|
9
|
+
<th style="width:${e}%">问题 \ 选项</th>
|
|
10
|
+
${this._answers.map(s=>t.html`<th style="width:${e}%">${s.title}</th>`)}
|
|
11
|
+
</tr>
|
|
12
|
+
</thead>
|
|
13
|
+
<tbody>
|
|
14
|
+
${this._scaleQuestions.map(e=>t.html`
|
|
15
|
+
<tr>
|
|
16
|
+
<td>${e}</td>
|
|
17
|
+
${this._answers.map(()=>t.html`<td><input type="radio" disabled /></td>`)}
|
|
18
|
+
</tr>
|
|
53
19
|
`)}
|
|
54
|
-
</
|
|
55
|
-
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
`:""}_renderResourceSection(){if(!this["show-resource"])return"";const e=this._imageResources(),s=this._videoResource();return t.html`
|
|
59
|
-
<div class="flex-items-start section-row">
|
|
60
|
-
<div class="label"><span>资源:</span></div>
|
|
61
|
-
<div style="flex:1">
|
|
62
|
-
<div class="resource-summary">图片 ${e.length} 张${s?.url?",含视频资源":""}</div>
|
|
63
|
-
${e.length?t.html`
|
|
64
|
-
<div class="resource-thumbs">
|
|
65
|
-
${e.slice(0,4).map(e=>t.html`<img class="resource-thumb" src=${e} alt="resource" />`)}
|
|
66
|
-
</div>
|
|
67
|
-
`:""}
|
|
68
|
-
${s?.url?t.html`<div style="margin-top:8px"><a class="el-link" href=${s.url} target="_blank" rel="noreferrer">查看视频</a></div>`:""}
|
|
69
|
-
${e.length||s?.url?"":t.html`<div class="tag-hint">暂无资源</div>`}
|
|
20
|
+
</tbody>
|
|
21
|
+
</table>
|
|
70
22
|
</div>
|
|
71
23
|
</div>
|
|
72
24
|
`}_renderEdit(){return t.html`
|
|
@@ -74,106 +26,127 @@
|
|
|
74
26
|
<div class="label"><span>题目:</span></div>
|
|
75
27
|
<div style="flex:1">
|
|
76
28
|
<div class="el-input">
|
|
77
|
-
<textarea
|
|
29
|
+
<textarea
|
|
30
|
+
rows="2"
|
|
31
|
+
.value=${this._title}
|
|
78
32
|
maxlength=${this.TITLE_MAX}
|
|
79
33
|
@input=${t=>this._onTitleInput(t)}
|
|
80
|
-
placeholder="【量表题】请输入问题"
|
|
34
|
+
placeholder="【量表题】请输入问题"
|
|
35
|
+
></textarea>
|
|
81
36
|
<span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
|
|
82
37
|
</div>
|
|
83
38
|
</div>
|
|
84
39
|
</div>
|
|
85
40
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
${this._renderCategorySection()}
|
|
89
|
-
|
|
90
|
-
${this._renderResourceSection()}
|
|
41
|
+
<slot name="business-tag"></slot>
|
|
91
42
|
|
|
92
43
|
<div class="flex-items-start" style="margin-top:12px">
|
|
93
44
|
<div class="label"><span>行标题:</span></div>
|
|
94
45
|
<div class="flex" style="flex:1">
|
|
95
46
|
<div class="el-input" style="width:160px">
|
|
96
|
-
<textarea
|
|
47
|
+
<textarea
|
|
48
|
+
class="row-title-textarea"
|
|
49
|
+
.value=${this._rowTitle}
|
|
97
50
|
@input=${t=>{this._rowTitle=t.target.value}}
|
|
98
51
|
@keydown=${t=>{t.stopPropagation()}}
|
|
99
|
-
placeholder="请输入行标题"
|
|
52
|
+
placeholder="请输入行标题"
|
|
53
|
+
></textarea>
|
|
100
54
|
</div>
|
|
101
55
|
<div style="flex:1;margin-left:12px">
|
|
102
56
|
${this._answers.map((e,s)=>t.html`
|
|
103
57
|
<div class="answer-item">
|
|
104
58
|
<span class="label">${String.fromCharCode(65+s)}.</span>
|
|
105
59
|
<div class="input">
|
|
106
|
-
<input
|
|
60
|
+
<input
|
|
61
|
+
type="text"
|
|
62
|
+
.value=${e.title}
|
|
107
63
|
maxlength="10"
|
|
108
64
|
@input=${t=>{const e=t.target.value;this._answers=this._answers.map((t,i)=>i===s?{...t,title:e}:t)}}
|
|
109
|
-
placeholder="选项${s+1}"
|
|
65
|
+
placeholder="选项${s+1}"
|
|
66
|
+
/>
|
|
110
67
|
</div>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
68
|
+
<span
|
|
69
|
+
class="icon"
|
|
70
|
+
@click=${()=>{this._answers.length<5&&(this._answers=[...this._answers,{title:""}])}}
|
|
71
|
+
>${x}</span>
|
|
72
|
+
<span
|
|
73
|
+
class="icon ${this._answers.length<3?"disabled":""}"
|
|
74
|
+
@click=${()=>{this._answers.length>3&&(this._answers=this._answers.filter((t,e)=>e!==s))}}
|
|
75
|
+
>${u}</span>
|
|
115
76
|
</div>
|
|
116
77
|
`)}
|
|
117
78
|
</div>
|
|
118
79
|
</div>
|
|
119
80
|
</div>
|
|
120
81
|
|
|
121
|
-
<div class="flex-items-start" style="margin-top:12px">
|
|
122
|
-
<div class="label"><span>解析:</span></div>
|
|
123
|
-
<div style="flex:1">
|
|
124
|
-
<div class="el-input">
|
|
125
|
-
<textarea rows="2" .value=${this._analysis} ?disabled=${this["is-save"]}
|
|
126
|
-
@input=${t=>{this._analysis=t.target.value}}
|
|
127
|
-
placeholder="请输入题目解析"></textarea>
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
82
|
${this._showRichText?t.html`
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
83
|
+
<div class="flex-items-start" style="margin-top:12px">
|
|
84
|
+
<div class="label"><span>副文本:</span></div>
|
|
85
|
+
<div style="flex:1">
|
|
86
|
+
<slot name="sub-text">
|
|
87
|
+
<qxs-blocksuite-editor
|
|
88
|
+
.content=${this._richText}
|
|
89
|
+
.upload-image=${this["upload-image"]}
|
|
90
|
+
?is-edit=${!0}
|
|
91
|
+
@input=${t=>{this._richText=t.target.getContent()}}
|
|
92
|
+
></qxs-blocksuite-editor>
|
|
93
|
+
</slot>
|
|
94
|
+
${this["show-action"]?"":t.html`
|
|
95
|
+
<div class="flex-justify-end" style="margin-top:8px">
|
|
96
|
+
<span
|
|
97
|
+
class="el-link danger"
|
|
98
|
+
@click=${()=>{this._showRichText=!1,this._richText=""}}
|
|
99
|
+
>删除富文本</span>
|
|
100
|
+
</div>
|
|
101
|
+
`}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
`:""}
|
|
105
|
+
`}_renderSorting(){const t=i.trimText(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=`${this["order-index"]+1}. ${t}`;return r.renderSortingCard(e,o.SubjectTypeLabel[o.SubjectType.SCALE]||o.SubjectType.SCALE)}render(){if(this.sorting)return this._renderSorting();const e=this["is-edit"]?t.html`<div slot="edit">${this._renderEdit()}</div>`:t.html`<div slot="preview">${this._renderPreview()}</div>`;return t.html`
|
|
146
106
|
<qxs-subject-layout .show-edit=${this["is-edit"]}>
|
|
147
|
-
|
|
148
|
-
<div slot="edit">${this._renderEdit()}</div>
|
|
107
|
+
${e}
|
|
149
108
|
${this["show-action"]?t.html`
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
109
|
+
<qxs-subject-action
|
|
110
|
+
.is-edit=${this["is-edit"]}
|
|
111
|
+
.is-set=${this["is-set"]}
|
|
112
|
+
.show-add=${this["show-add"]}
|
|
113
|
+
.show-rich-text=${this._showRichText}
|
|
114
|
+
.show-other-option=${!1}
|
|
115
|
+
exam-answer-relation-type=${this["exam-answer-relation-type"]}
|
|
116
|
+
@delete=${()=>this._emit("delete")}
|
|
117
|
+
@save=${this._save}
|
|
118
|
+
@edit=${()=>this._emit("edit")}
|
|
119
|
+
@add=${t=>this._emit("add",t.detail)}
|
|
120
|
+
@on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
|
|
121
|
+
></qxs-subject-action>
|
|
122
|
+
`:""}
|
|
164
123
|
</qxs-subject-layout>
|
|
165
|
-
`}},exports.QxsScale.styles=t.css`
|
|
124
|
+
`}},exports.QxsScale.styles=[r.sortingCardStyles,t.css`
|
|
166
125
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
167
126
|
*, ::before, ::after { box-sizing: border-box; }
|
|
168
127
|
|
|
169
128
|
.preview { padding: 12px 0; }
|
|
170
129
|
.preview .title { font-size: 14px; color: #303133; }
|
|
171
|
-
.scale-table {
|
|
172
|
-
|
|
130
|
+
.scale-table-wrap {
|
|
131
|
+
margin-top: 12px;
|
|
132
|
+
border-radius: 12px;
|
|
133
|
+
background: #fff;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
}
|
|
136
|
+
.scale-table { width: 100%; border-collapse: collapse; font-size: 12px; }
|
|
137
|
+
.scale-table th, .scale-table td { border: 1px solid #e4e7ed; padding: 8px 6px; text-align: center; }
|
|
173
138
|
.scale-table th { background: #f5f7fa; color: #909399; }
|
|
139
|
+
.scale-table td:first-child,
|
|
140
|
+
.scale-table th:first-child {
|
|
141
|
+
background: #fbfcff;
|
|
142
|
+
color: #606266;
|
|
143
|
+
font-weight: 600;
|
|
144
|
+
}
|
|
145
|
+
.scale-table input[type="radio"] {
|
|
146
|
+
accent-color: #3D61E3;
|
|
147
|
+
}
|
|
174
148
|
|
|
175
149
|
.flex { display: flex; }
|
|
176
|
-
.flex-items-center { display: flex; align-items: center; }
|
|
177
150
|
.flex-items-start { display: flex; align-items: flex-start; }
|
|
178
151
|
.flex-justify-end { display: flex; justify-content: flex-end; }
|
|
179
152
|
.label { min-width: 60px; font-size: 13px; color: #606266; }
|
|
@@ -194,7 +167,6 @@
|
|
|
194
167
|
}
|
|
195
168
|
|
|
196
169
|
.el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }
|
|
197
|
-
.el-link:hover { color: #2D4CB8; }
|
|
198
170
|
.el-link.danger { color: #f56c6c; }
|
|
199
171
|
|
|
200
172
|
.answer-item { display: flex; align-items: center; margin-top: 6px; }
|
|
@@ -219,28 +191,5 @@
|
|
|
219
191
|
.answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
|
|
220
192
|
|
|
221
193
|
.row-title-textarea { height: 200px; }
|
|
222
|
-
|
|
223
|
-
.value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }
|
|
224
|
-
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
|
|
225
|
-
.tag-item {
|
|
226
|
-
display: inline-flex; align-items: center; gap: 4px;
|
|
227
|
-
padding: 4px 8px; font-size: 12px; line-height: 1;
|
|
228
|
-
color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;
|
|
229
|
-
}
|
|
230
|
-
.tag-item .close { cursor: pointer; color: #909399; }
|
|
231
|
-
.tag-item .close:hover { color: #f56c6c; }
|
|
232
|
-
.tag-hint { font-size: 12px; color: #909399; }
|
|
233
|
-
.el-select {
|
|
234
|
-
width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;
|
|
235
|
-
padding: 0 8px; font-size: 13px; background: #fff; appearance: none;
|
|
236
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
|
|
237
|
-
background-repeat: no-repeat; background-position: right 8px center;
|
|
238
|
-
}
|
|
239
|
-
.resource-summary { font-size: 12px; color: #606266; }
|
|
240
|
-
.resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
|
|
241
|
-
.resource-thumb {
|
|
242
|
-
width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
|
|
243
|
-
border: 1px solid #e4e7ed; background: #f5f7fa;
|
|
244
|
-
}
|
|
245
|
-
`,l([e.property({type:Number,attribute:"order-index"})],exports.QxsScale.prototype,"order-index",2),l([e.property({type:String})],exports.QxsScale.prototype,"title",2),l([e.property({type:String,attribute:"custom-id"})],exports.QxsScale.prototype,"custom-id",2),l([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsScale.prototype,"is-edit",2),l([e.property({type:Boolean,attribute:"is-save"})],exports.QxsScale.prototype,"is-save",2),l([e.property({type:Boolean,attribute:"is-set"})],exports.QxsScale.prototype,"is-set",2),l([e.property({type:Boolean,attribute:"show-action"})],exports.QxsScale.prototype,"show-action",2),l([e.property({type:Boolean,attribute:"show-add"})],exports.QxsScale.prototype,"show-add",2),l([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsScale.prototype,"show-analysis",2),l([e.property({type:String})],exports.QxsScale.prototype,"analysis",2),l([e.property({type:String,attribute:"rich-text-content"})],exports.QxsScale.prototype,"rich-text-content",2),l([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsScale.prototype,"exam-answer-relation-type",2),l([e.property({type:Number,attribute:"exam-id"})],exports.QxsScale.prototype,"exam-id",2),l([e.property({type:String,attribute:"category-id"})],exports.QxsScale.prototype,"category-id",2),l([e.property({type:Array,attribute:"tag-list"})],exports.QxsScale.prototype,"tag-list",2),l([e.property({type:Array,attribute:"category-list"})],exports.QxsScale.prototype,"category-list",2),l([e.property({type:Array,attribute:"resource-list"})],exports.QxsScale.prototype,"resource-list",2),l([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsScale.prototype,"show-tag",2),l([e.property({type:Boolean,attribute:"show-category"})],exports.QxsScale.prototype,"show-category",2),l([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsScale.prototype,"show-resource",2),l([e.property({type:Object,attribute:"upload-image"})],exports.QxsScale.prototype,"upload-image",2),l([e.property({type:Array,attribute:"answer-list"})],exports.QxsScale.prototype,"answer-list",1),l([e.property({type:Array,attribute:"scale-questions"})],exports.QxsScale.prototype,"scale-questions",1),l([e.state()],exports.QxsScale.prototype,"_answers",2),l([e.state()],exports.QxsScale.prototype,"_scaleQuestions",2),l([e.state()],exports.QxsScale.prototype,"_rowTitle",2),l([e.state()],exports.QxsScale.prototype,"_title",2),l([e.state()],exports.QxsScale.prototype,"_analysis",2),l([e.state()],exports.QxsScale.prototype,"_showRichText",2),l([e.state()],exports.QxsScale.prototype,"_richText",2),l([e.state()],exports.QxsScale.prototype,"_selectedTagList",2),l([e.state()],exports.QxsScale.prototype,"_categoryId",2),l([e.property({type:String,attribute:"model-value"})],exports.QxsScale.prototype,"model-value",2),l([e.property({type:Boolean,attribute:"use-model"})],exports.QxsScale.prototype,"use-model",2),exports.QxsScale=l([s.safeCustomElement("qxs-scale")],exports.QxsScale);
|
|
194
|
+
`],l([e.property({type:Number,attribute:"order-index"})],exports.QxsScale.prototype,"order-index",2),l([e.property({type:String})],exports.QxsScale.prototype,"title",2),l([e.property({type:String,attribute:"custom-id"})],exports.QxsScale.prototype,"custom-id",2),l([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsScale.prototype,"is-edit",2),l([e.property({type:Boolean,attribute:"is-save"})],exports.QxsScale.prototype,"is-save",2),l([e.property({type:Boolean,attribute:"is-set"})],exports.QxsScale.prototype,"is-set",2),l([e.property({type:Boolean,attribute:"show-action"})],exports.QxsScale.prototype,"show-action",2),l([e.property({type:Boolean,attribute:"show-add"})],exports.QxsScale.prototype,"show-add",2),l([e.property({type:Boolean,reflect:!0})],exports.QxsScale.prototype,"sorting",2),l([e.property({type:String})],exports.QxsScale.prototype,"analysis",2),l([e.property({type:String,attribute:"rich-text-content"})],exports.QxsScale.prototype,"rich-text-content",2),l([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsScale.prototype,"exam-answer-relation-type",2),l([e.property({type:Object,attribute:"upload-image"})],exports.QxsScale.prototype,"upload-image",2),l([e.property({type:Array,attribute:"answer-list"})],exports.QxsScale.prototype,"answer-list",1),l([e.property({type:Array,attribute:"scale-question-list"})],exports.QxsScale.prototype,"scale-question-list",1),l([e.property({type:Array,attribute:"scale-questions"})],exports.QxsScale.prototype,"scale-questions",1),l([e.state()],exports.QxsScale.prototype,"_answers",2),l([e.state()],exports.QxsScale.prototype,"_scaleQuestions",2),l([e.state()],exports.QxsScale.prototype,"_rowTitle",2),l([e.state()],exports.QxsScale.prototype,"_title",2),l([e.state()],exports.QxsScale.prototype,"_showRichText",2),l([e.state()],exports.QxsScale.prototype,"_richText",2),l([e.property({type:String,attribute:"model-value"})],exports.QxsScale.prototype,"model-value",2),l([e.property({type:Boolean,attribute:"use-model"})],exports.QxsScale.prototype,"use-model",2),exports.QxsScale=l([s.safeCustomElement("qxs-scale")],exports.QxsScale);
|
|
246
195
|
//# sourceMappingURL=scale.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.cjs","sources":["../../../../packages/components-wc/src/subject/scale.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem } from './single'\nimport { SubjectType } from './types'\n\ninterface ScaleAnswer {\n title: string\n answerId?: string | number\n [key: string]: any\n}\n\nconst iconPlus = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\nconst iconRemove = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-scale')\nexport class QxsScale extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .scale-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }\n .scale-table th, .scale-table td { border: 1px solid #e4e7ed; padding: 6px 4px; text-align: center; }\n .scale-table th { background: #f5f7fa; color: #909399; }\n\n .flex { display: flex; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 60px; font-size: 13px; color: #606266; }\n\n textarea, input[type=\"text\"] {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box; white-space: pre-wrap;\n }\n textarea:focus, input[type=\"text\"]:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled, input[type=\"text\"]:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n .answer-item { display: flex; align-items: center; margin-top: 6px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 200px; }\n .answer-item .input input {\n height: 32px; padding: 0 8px;\n font-size: 13px; line-height: 32px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n transition: border-color .2s; box-sizing: border-box;\n }\n .answer-item .input input:focus { border-color: #3D61E3; outline: none; }\n\n .answer-item .icon {\n margin-left: 6px; cursor: pointer; display: inline-flex;\n align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 4px;\n border: 1px solid #dcdfe6; background: #fff; color: #909399;\n transition: all 0.2s;\n }\n .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }\n\n .row-title-textarea { height: 200px; }\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\n }\n `\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = true\n @property({ type: String }) analysis = ''\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' })\n get 'answer-list'() { return this._answers }\n\n set 'answer-list'(value: any) {\n const arr = Array.isArray(value) ? value : []\n this._answers = arr.length ? arr.slice(0, 5) : [{ title: '' }, { title: '' }, { title: '' }, { title: '' }, { title: '' }]\n this.requestUpdate('answer-list')\n }\n\n @property({ type: Array, attribute: 'scale-questions' })\n get 'scale-questions'() { return this._scaleQuestions }\n\n set 'scale-questions'(value: any) {\n this._scaleQuestions = Array.isArray(value) && value.length ? value : ['问题1']\n this.requestUpdate('scale-questions')\n }\n\n @state() private _answers: ScaleAnswer[] = [{ title: '' }, { title: '' }, { title: '' }, { title: '' }, { title: '' }]\n @state() private _scaleQuestions: string[] = ['问题1']\n @state() private _rowTitle = ''\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n private readonly TITLE_MAX = 200\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('rich-text-content') || changed.has('scale-questions') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value']\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n this._rowTitle = this._scaleQuestions.join('\\n')\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n if (this['use-model']) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private _removeTag(tagId: string | number) {\n this._selectedTagList = this._selectedTagList.filter(item => String(item.tagId) !== String(tagId))\n this._emit('tag-change', {\n value: this._selectedTagList,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _chooseTag() {\n this._emit('choose-tag', {\n value: this._selectedTagList,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'scale', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title || ''\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || [])\n const analysis = this['is-edit'] ? this._analysis : this.analysis || ''\n const rowTitle = this['is-edit'] ? this._rowTitle : (this['scale-questions']?.join('\\n') || '')\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const selectedTagList = this._selectedTagList || []\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n\n for (let i = 0; i < answers.length; i++) {\n if (!answers[i].title) {\n reject(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写。`, 'ANSWER_EMPTY', 'answers', row))\n return\n }\n }\n\n if (!rowTitle) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const questions = rowTitle.split('\\n').filter((item: string) => item.trim())\n if (questions.length === 0) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.SCALE,\n title,\n analysis,\n answers,\n scaleQuestionList: questions,\n examRichTextContent: showRichText ? richText : '',\n examAnswerRelationType: this['exam-answer-relation-type'],\n categoryId: this._categoryId || '',\n memberTagInfo: selectedTagList,\n tagInfos: selectedTagList,\n resourceList: this['resource-list'] || [],\n examResourceBOList: this['resource-list'] || [],\n isSetCorrectAnswer: false,\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'scale', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title || ''\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || [])\n const rowTitle = this['is-edit'] ? this._rowTitle : (this['scale-questions']?.join('\\n') || '')\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n\n answers.forEach((answer: any, index: number) => {\n if (!answer.title) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + index)}未填写`, 'ANSWER_EMPTY', 'answers', row))\n }\n })\n\n if (!rowTitle) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n else {\n const questions = rowTitle.split('\\n').filter((item: string) => item.trim())\n if (questions.length === 0) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n }\n\n return errors\n }\n\n private _renderPreview() {\n const colWidth = Math.floor(100 / (this._answers.length + 1))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${this.title}(量表题)</span>\n ${this['rich-text-content'] ? html`<div style=\"margin-top:8px\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n <table class=\"scale-table\">\n <thead><tr>\n <th style=\"width:${colWidth}%\">问题 \\ 选项</th>\n ${this._answers.map(answer => html`<th style=\"width:${colWidth}%\">${answer.title}</th>`)}\n </tr></thead>\n <tbody>\n ${this._scaleQuestions.map(question => html`\n <tr><td>${question}</td>${this._answers.map(() => html`<td><input type=\"radio\" disabled /></td>`)}</tr>\n `)}\n </tbody>\n </table>\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this['show-tag'] && this._selectedTagList.length\n ? html`\n <div class=\"section-row\">\n <span class=\"value-text\">标签/关键信息:</span>\n <div class=\"tag-list\" style=\"margin-top:6px\">\n ${this._selectedTagList.map(item => html`<span class=\"tag-item\">${item.tagName}</span>`)}\n </div>\n </div>\n `\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderTagSection() {\n if (!this['show-tag']) { return '' }\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>标签:</span></div>\n <div style=\"flex:1\">\n <div class=\"tag-list\">\n ${this._selectedTagList.length\n ? this._selectedTagList.map(item => html`\n <span class=\"tag-item\">\n ${item.tagName}\n ${!this['is-save'] ? html`<span class=\"close\" @click=${() => this._removeTag(item.tagId)}>×</span>` : ''}\n </span>\n `)\n : html`<span class=\"tag-hint\">暂无标签/关键信息</span>`}\n </div>\n ${this['is-edit'] && !this['is-save']\n ? html`<div style=\"margin-top:8px\"><span class=\"el-link\" @click=${() => this._chooseTag()}>选择</span></div>`\n : ''}\n </div>\n </div>\n `\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)} ?disabled=${this['is-save']}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title} ?disabled=${this['is-save']}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【量表题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n ${this._renderTagSection()}\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>行标题:</span></div>\n <div class=\"flex\" style=\"flex:1\">\n <div class=\"el-input\" style=\"width:160px\">\n <textarea class=\"row-title-textarea\" .value=${this._rowTitle} ?disabled=${this['is-save']}\n @input=${(e: Event) => { this._rowTitle = (e.target as HTMLTextAreaElement).value }}\n @keydown=${(e: KeyboardEvent) => { e.stopPropagation() }}\n placeholder=\"请输入行标题\"></textarea>\n </div>\n <div style=\"flex:1;margin-left:12px\">\n ${this._answers.map((answer, index) => html`\n <div class=\"answer-item\">\n <span class=\"label\">${String.fromCharCode(65 + index)}.</span>\n <div class=\"input\">\n <input type=\"text\" .value=${answer.title} ?disabled=${this['is-save']}\n maxlength=\"10\"\n @input=${(e: Event) => {\n const value = (e.target as HTMLInputElement).value\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? { ...item, title: value } : item)\n }}\n placeholder=\"选项${index + 1}\" />\n </div>\n ${!this['is-save']\n ? html`\n <span class=\"icon\" @click=${() => {\n if (this._answers.length < 5) { this._answers = [...this._answers, { title: '' }] }\n }}>${iconPlus}</span>\n <span class=\"icon ${this._answers.length < 3 ? 'disabled' : ''}\" @click=${() => {\n if (this._answers.length > 3) { this._answers = this._answers.filter((_, currentIndex) => currentIndex !== index) }\n }}>${iconRemove}</span>\n `\n : ''}\n </div>\n `)}\n </div>\n </div>\n </div>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis} ?disabled=${this['is-save']}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n\n ${this._showRichText\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n ${!this['show-action']\n ? html`<div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>`\n : ''}\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this._showRichText}\n .show-other-option=${false}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","iconRemove","QxsScale","LitElement","constructor","super","arguments","this","title","analysis","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","_scaleQuestions","_rowTitle","_title","_analysis","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","value","arr","Array","isArray","length","slice","requestUpdate","willUpdate","changed","has","_syncProps","map","item","String","join","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","_removeTag","tagId","filter","customId","examId","_chooseTag","_onCategoryChange","_imageResources","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","toJSON","row","answerType","orderIndex","answers","rowTitle","showRichText","richText","selectedTagList","SubjectError","i","fromCharCode","questions","split","trim","SubjectType","SCALE","scaleQuestionList","examRichTextContent","examAnswerRelationType","memberTagInfo","tagInfos","resourceList","examResourceBOList","isSetCorrectAnswer","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","forEach","answer","index","_renderPreview","colWidth","Math","floor","question","tagName","_renderResourceSection","_renderTagSection","_renderCategorySection","images","video","src","_renderEdit","stopPropagation","currentIndex","_","render","styles","css","__decorateClass","property","type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,QAAS2F,UAAW,eA7I3B9J,QAAAA,SA6I0C+J,UAAA,YAAA,GA7I1C/J,QAAAA,SAAN0J,EAAA,CADNO,EAAAA,kBAAkB,cACNjK,QAAAA"}
|
|
1
|
+
{"version":3,"file":"scale.cjs","sources":["../../../../packages/components-wc/src/subject/scale.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { SubjectError, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface ScaleAnswer {\n title: string\n answerId?: string | number\n orderIndex?: number\n isCorrect?: boolean\n [key: string]: any\n}\n\nfunction createEmptyScaleAnswer(): ScaleAnswer {\n return { title: '' }\n}\n\nfunction createDefaultScaleAnswers(): ScaleAnswer[] {\n return Array.from({ length: 5 }, createEmptyScaleAnswer)\n}\n\nfunction normalizeScaleAnswer(answer: any): ScaleAnswer {\n const next: ScaleAnswer = {\n ...answer,\n title: trimText(answer?.title ?? answer?.answer ?? ''),\n }\n const answerId = answer?.answerId ?? answer?.examAnswerId\n if (answerId !== undefined) {\n next.answerId = answerId\n }\n delete next.answer\n delete next.examAnswerId\n return next\n}\n\nfunction normalizeScaleAnswers(value: any): ScaleAnswer[] {\n return Array.isArray(value) ? value.slice(0, 5).map(normalizeScaleAnswer) : []\n}\n\nfunction normalizeScaleQuestionList(value: any): string[] {\n if (!Array.isArray(value)) {\n return []\n }\n return value\n .map(item => String(item ?? '').trim())\n .filter(Boolean)\n}\n\nfunction splitScaleQuestionLines(value: string): string[] {\n return value\n .split('\\n')\n .map(item => item.trim())\n .filter(Boolean)\n}\n\nfunction serializeScaleAnswer(answer: any, index: number): ScaleAnswer {\n const next: ScaleAnswer = {\n ...normalizeScaleAnswer(answer),\n orderIndex: index + 1,\n answer: trimText(answer?.title ?? answer?.answer ?? ''),\n }\n next.title = trimText(next.title ?? '')\n if (next.answerId !== undefined) {\n next.examAnswerId = next.answerId\n }\n if (next.answerId === undefined) {\n delete next.answerId\n }\n if (next.isCorrect === undefined) {\n delete next.isCorrect\n }\n return next\n}\n\nconst iconPlus = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\nconst iconRemove = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => {\n el.style.opacity = '0'\n setTimeout(() => el.remove(), 300)\n }, 2500)\n}\n\n@safeCustomElement('qxs-scale')\nexport class QxsScale extends LitElement {\n static styles = [sortingCardStyles, css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .scale-table-wrap {\n margin-top: 12px;\n border-radius: 12px;\n background: #fff;\n overflow: hidden;\n }\n .scale-table { width: 100%; border-collapse: collapse; font-size: 12px; }\n .scale-table th, .scale-table td { border: 1px solid #e4e7ed; padding: 8px 6px; text-align: center; }\n .scale-table th { background: #f5f7fa; color: #909399; }\n .scale-table td:first-child,\n .scale-table th:first-child {\n background: #fbfcff;\n color: #606266;\n font-weight: 600;\n }\n .scale-table input[type=\"radio\"] {\n accent-color: #3D61E3;\n }\n\n .flex { display: flex; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 60px; font-size: 13px; color: #606266; }\n\n textarea, input[type=\"text\"] {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box; white-space: pre-wrap;\n }\n textarea:focus, input[type=\"text\"]:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled, input[type=\"text\"]:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }\n .el-link.danger { color: #f56c6c; }\n\n .answer-item { display: flex; align-items: center; margin-top: 6px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 200px; }\n .answer-item .input input {\n height: 32px; padding: 0 8px;\n font-size: 13px; line-height: 32px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n transition: border-color .2s; box-sizing: border-box;\n }\n .answer-item .input input:focus { border-color: #3D61E3; outline: none; }\n\n .answer-item .icon {\n margin-left: 6px; cursor: pointer; display: inline-flex;\n align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 4px;\n border: 1px solid #dcdfe6; background: #fff; color: #909399;\n transition: all 0.2s;\n }\n .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }\n\n .row-title-textarea { height: 200px; }\n `]\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, reflect: true }) sorting = false\n @property({ type: String }) analysis = ''\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' })\n get 'answer-list'() { return this._answers }\n\n set 'answer-list'(value: any) {\n const answers = normalizeScaleAnswers(value)\n this._answers = answers.length ? answers : createDefaultScaleAnswers()\n this.requestUpdate('answer-list')\n }\n\n @property({ type: Array, attribute: 'scale-question-list' })\n get 'scale-question-list'() { return this._scaleQuestions }\n\n set 'scale-question-list'(value: any) {\n this._scaleQuestions = normalizeScaleQuestionList(value)\n this.requestUpdate('scale-question-list')\n }\n\n @property({ type: Array, attribute: 'scale-questions' })\n get 'scale-questions'() { return this._scaleQuestions }\n\n set 'scale-questions'(value: any) {\n this['scale-question-list'] = value\n this.requestUpdate('scale-questions')\n }\n\n @state() private _answers: ScaleAnswer[] = createDefaultScaleAnswers()\n @state() private _scaleQuestions: string[] = []\n @state() private _rowTitle = ''\n @state() private _title = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n private readonly TITLE_MAX = 200\n\n willUpdate(changed: Map<string, unknown>) {\n const shouldSyncProps = changed.has('title')\n || changed.has('answer-list')\n || changed.has('rich-text-content')\n || changed.has('scale-question-list')\n || changed.has('scale-questions')\n\n if ((changed.has('is-edit') && this['is-edit']) || (!this['is-edit'] && shouldSyncProps)) {\n this._syncProps()\n }\n\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value']\n }\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._rowTitle = this._scaleQuestions.join('\\n')\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) {\n el.value = el.value.slice(0, this.TITLE_MAX)\n }\n this._title = el.value\n if (this['use-model']) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private _resolvedQuestions(): string[] {\n const rowTitle = this['is-edit'] ? this._rowTitle : this._scaleQuestions.join('\\n')\n return splitScaleQuestionLines(rowTitle)\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = {\n customId: this['custom-id'] || undefined,\n answerType: SubjectType.SCALE,\n orderIndex: this['order-index'],\n }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this['is-edit'] ? this._answers : this['answer-list']\n const questions = this._resolvedQuestions()\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n\n for (let i = 0; i < answers.length; i++) {\n if (!answers[i].title) {\n reject(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写。`, 'ANSWER_EMPTY', 'answers', row))\n return\n }\n }\n\n if (questions.length === 0) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.SCALE,\n examTypeEnum: SubjectType.SCALE,\n title,\n answers: answers.map(serializeScaleAnswer),\n scaleQuestionList: questions,\n analysis: trimText(this.analysis || ''),\n examRichTextContent: showRichText ? richText : '',\n isSetCorrectAnswer: false,\n }\n\n if (this['custom-id']) {\n result.customId = this['custom-id']\n }\n\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = {\n customId: this['custom-id'] || undefined,\n answerType: SubjectType.SCALE,\n orderIndex: this['order-index'],\n }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this['is-edit'] ? this._answers : this['answer-list']\n const questions = this._resolvedQuestions()\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n\n answers.forEach((answer: ScaleAnswer, index: number) => {\n if (!answer.title) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + index)}未填写`, 'ANSWER_EMPTY', 'answers', row))\n }\n })\n\n if (questions.length === 0) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const colWidth = Math.floor(100 / ((this._answers.length || 1) + 1))\n\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${this.title}(量表题)</span>\n ${this['rich-text-content'] ? html`<div style=\"margin-top:8px\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n <div class=\"scale-table-wrap\">\n <table class=\"scale-table\">\n <thead>\n <tr>\n <th style=\"width:${colWidth}%\">问题 \\ 选项</th>\n ${this._answers.map(answer => html`<th style=\"width:${colWidth}%\">${answer.title}</th>`)}\n </tr>\n </thead>\n <tbody>\n ${this._scaleQuestions.map(question => html`\n <tr>\n <td>${question}</td>\n ${this._answers.map(() => html`<td><input type=\"radio\" disabled /></td>`)}\n </tr>\n `)}\n </tbody>\n </table>\n </div>\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea\n rows=\"2\"\n .value=${this._title}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【量表题】请输入问题\"\n ></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>行标题:</span></div>\n <div class=\"flex\" style=\"flex:1\">\n <div class=\"el-input\" style=\"width:160px\">\n <textarea\n class=\"row-title-textarea\"\n .value=${this._rowTitle}\n @input=${(e: Event) => { this._rowTitle = (e.target as HTMLTextAreaElement).value }}\n @keydown=${(e: KeyboardEvent) => { e.stopPropagation() }}\n placeholder=\"请输入行标题\"\n ></textarea>\n </div>\n <div style=\"flex:1;margin-left:12px\">\n ${this._answers.map((answer, index) => html`\n <div class=\"answer-item\">\n <span class=\"label\">${String.fromCharCode(65 + index)}.</span>\n <div class=\"input\">\n <input\n type=\"text\"\n .value=${answer.title}\n maxlength=\"10\"\n @input=${(e: Event) => {\n const value = (e.target as HTMLInputElement).value\n this._answers = this._answers.map((item, currentIndex) =>\n currentIndex === index ? { ...item, title: value } : item,\n )\n }}\n placeholder=\"选项${index + 1}\"\n />\n </div>\n <span\n class=\"icon\"\n @click=${() => {\n if (this._answers.length < 5) {\n this._answers = [...this._answers, createEmptyScaleAnswer()]\n }\n }}\n >${iconPlus}</span>\n <span\n class=\"icon ${this._answers.length < 3 ? 'disabled' : ''}\"\n @click=${() => {\n if (this._answers.length > 3) {\n this._answers = this._answers.filter((_, currentIndex) => currentIndex !== index)\n }\n }}\n >${iconRemove}</span>\n </div>\n `)}\n </div>\n </div>\n </div>\n\n ${this._showRichText\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>副文本:</span></div>\n <div style=\"flex:1\">\n <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\n ${!this['show-action']\n ? html`\n <div class=\"flex-justify-end\" style=\"margin-top:8px\">\n <span\n class=\"el-link danger\"\n @click=${() => {\n this._showRichText = false\n this._richText = ''\n }}\n >删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = `${this['order-index'] + 1}. ${title}`\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.SCALE] || SubjectType.SCALE)\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this._showRichText}\n .show-other-option=${false}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["createEmptyScaleAnswer","title","createDefaultScaleAnswers","Array","from","length","normalizeScaleAnswer","answer","next","trimText","answerId","examAnswerId","serializeScaleAnswer","index","orderIndex","isCorrect","iconPlus","html","iconRemove","QxsScale","LitElement","constructor","super","arguments","this","sorting","analysis","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","_scaleQuestions","_rowTitle","_title","_showRichText","_richText","TITLE_MAX","value","answers","isArray","slice","map","normalizeScaleAnswers","requestUpdate","item","String","trim","filter","Boolean","normalizeScaleQuestionList","willUpdate","changed","shouldSyncProps","has","_syncProps","join","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","_resolvedQuestions","rowTitle","split","toJSON","row","customId","answerType","SubjectType","SCALE","questions","richText","showRichText","SubjectError","i","fromCharCode","examTypeEnum","scaleQuestionList","examRichTextContent","isSetCorrectAnswer","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","forEach","_renderPreview","colWidth","Math","floor","question","_renderEdit","stopPropagation","currentIndex","_","getContent","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gXAeA,SAASA,IACP,MAAO,CAAEC,MAAO,GAClB,CAEA,SAASC,IACP,OAAOC,MAAMC,KAAK,CAAEC,OAAQ,GAAKL,EACnC,CAEA,SAASM,EAAqBC,GAC5B,MAAMC,EAAoB,IACrBD,EACHN,MAAOQ,EAAAA,SAASF,GAAQN,OAASM,GAAQA,QAAU,KAE/CG,EAAWH,GAAQG,UAAYH,GAAQI,aAM7C,YALiB,IAAbD,IACFF,E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