@qxs-bns/components-wc 0.0.24 → 0.0.26

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.
@@ -1,108 +1,122 @@
1
- import{html as t,css as e,LitElement as i}from"lit";import{property as s,state as o}from"lit/decorators.js";import{safeCustomElement as a}from"../base/define.mjs";import{SubjectError as r}from"./single.mjs";import{SubjectType as n}from"./types.mjs";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(t,e,i,s)=>{for(var o,a=s>1?void 0:s?d(e,i):e,r=t.length-1;r>=0;r--)(o=t[r])&&(a=(s?o(e,i,a):o(a))||a);return s&&a&&l(e,i,a),a};const p=t`<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>`,c=t`<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>`;let x=class extends i{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["show-analysis"]=!0,this.analysis="",this["rich-text-content"]="",this["exam-answer-relation-type"]=0,this["upload-image"]=async t=>new Promise((e,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.readAsDataURL(t)}),this._answers=[{title:""},{title:""},{title:""},{title:""},{title:""}],this._scaleQuestions=["问题1"],this._rowTitle="",this._title="",this._analysis="",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=Array.isArray(t)?t:[];this._answers=e.length?e.slice(0,5):[{title:""},{title:""},{title:""},{title:""},{title:""}],this.requestUpdate("answer-list")}get"scale-questions"(){return this._scaleQuestions}set"scale-questions"(t){this._scaleQuestions=Array.isArray(t)&&t.length?t:["问题1"],this.requestUpdate("scale-questions")}willUpdate(t){t.has("is-edit")&&this["is-edit"]&&this._syncProps(),!this["is-edit"]&&(t.has("title")||t.has("answer-list")||t.has("analysis")||t.has("rich-text-content")||t.has("scale-questions"))&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._rowTitle=this._scaleQuestions.join("\n"),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"]}async toJSON(){return new Promise((t,e)=>{const i={customId:this["custom-id"]||void 0,answerType:"scale",orderIndex:this["order-index"]},s=this["is-edit"]?this._title:this.title||"",o=this["is-edit"]?this._answers:this["answer-list"]||[],a=this["is-edit"]?this._analysis:this.analysis||"",l=this["is-edit"]?this._rowTitle:this["scale-questions"]?.join("\n")||"",d=this["is-edit"]?this._showRichText:!!this["rich-text-content"],h=this["is-edit"]?this._richText:this["rich-text-content"]||"";if(!s)return void e(new r("题目标题不能为空!","EMPTY_TITLE","title",i));for(let t=0;t<o.length;t++)if(!o[t].title)return void e(new r(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",i));if(!l)return void e(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",i));const p=l.split("\n").filter(t=>t.trim());if(0===p.length)return void e(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",i));const c={answerType:n.SCALE,title:s,analysis:a,answers:o,scaleQuestionList:p,examRichTextContent:d?h:"",examAnswerRelationType:this["exam-answer-relation-type"]};this["custom-id"]&&(c.customId=this["custom-id"]),t(c)})}_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}))}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:"scale",orderIndex:this["order-index"]},i=this["is-edit"]?this._title:this.title||"",s=this["is-edit"]?this._answers:this["answer-list"]||[],o=this["is-edit"]?this._rowTitle:this["scale-questions"]?.join("\n")||"";if(i||t.push(new r("题目标题不能为空!","EMPTY_TITLE","title",e)),s.forEach((i,s)=>{i.title||t.push(new r(`选项${String.fromCharCode(65+s)}未填写`,"ANSWER_EMPTY","answers",e))}),o){0===o.split("\n").filter(t=>t.trim()).length&&t.push(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e))}else t.push(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e));return t}_renderPreview(){const e=Math.floor(100/(this._answers.length+1));return t`
1
+ import{html as t,css as e,LitElement as s}from"lit";import{property as i,state as o}from"lit/decorators.js";import{safeCustomElement as r}from"../base/define.mjs";import{SubjectError as n}from"./single.mjs";import{SubjectType as a}from"./types.mjs";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(t,e,s,i)=>{for(var o,r=i>1?void 0:i?d(e,s):e,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&l(e,s,r),r};function p(){return{title:""}}function c(){return Array.from({length:5},p)}function u(t){const e={...t,title:String(t?.title??t?.answer??"")},s=t?.answerId??t?.examAnswerId;return void 0!==s&&(e.answerId=s),delete e.answer,delete e.examAnswerId,e}function x(t,e){const s={...u(t),orderIndex:e+1,answer:String(t?.title??t?.answer??"")};return s.title=String(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 w=t`<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>`,m=t`<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>`;let y=class extends s{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.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=c(),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){this._answers=Array.isArray(t)?function(t){return Array.isArray(t)?t.slice(0,5).map(u):[]}(t):c(),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:a.SCALE,orderIndex:this["order-index"]},i=this["is-edit"]?this._title:this.title||"",o=this["is-edit"]?this._answers:this["answer-list"],r=this._resolvedQuestions(),l=this["is-edit"]?this._richText:this["rich-text-content"]||"",d=this["is-edit"]?this._showRichText:!!this["rich-text-content"];if(!i)return void e(new n("题目标题不能为空!","EMPTY_TITLE","title",s));for(let t=0;t<o.length;t++)if(!o[t].title)return void e(new n(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",s));if(0===r.length)return void e(new n("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",s));const h={answerType:a.SCALE,examTypeEnum:a.SCALE,title:i,answers:o.map(x),scaleQuestionList:r,analysis:this.analysis||"",examRichTextContent:d?l:"",isSetCorrectAnswer:!1};this["custom-id"]&&(h.customId=this["custom-id"]),t(h)})}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:a.SCALE,orderIndex:this["order-index"]},s=this["is-edit"]?this._title:this.title||"",i=this["is-edit"]?this._answers:this["answer-list"],o=this._resolvedQuestions();return s||t.push(new n("题目标题不能为空!","EMPTY_TITLE","title",e)),i.forEach((s,i)=>{s.title||t.push(new n(`选项${String.fromCharCode(65+i)}未填写`,"ANSWER_EMPTY","answers",e))}),0===o.length&&t.push(new n("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e)),t}_renderPreview(){const e=Math.floor(100/((this._answers.length||1)+1));return t`
2
2
  <div class="preview">
3
3
  <span class="title">${this["order-index"]+1}.${this.title}(量表题)</span>
4
4
  ${this["rich-text-content"]?t`<div style="margin-top:8px" .innerHTML=${this["rich-text-content"]}></div>`:""}
5
5
  <table class="scale-table">
6
- <thead><tr>
7
- <th style="width:${e}%">问题 \ 选项</th>
8
- ${this._answers.map(i=>t`<th style="width:${e}%">${i.title}</th>`)}
9
- </tr></thead>
6
+ <thead>
7
+ <tr>
8
+ <th style="width:${e}%">问题 \ 选项</th>
9
+ ${this._answers.map(s=>t`<th style="width:${e}%">${s.title}</th>`)}
10
+ </tr>
11
+ </thead>
10
12
  <tbody>
11
13
  ${this._scaleQuestions.map(e=>t`
12
- <tr><td>${e}</td>${this._answers.map(()=>t`<td><input type="radio" disabled /></td>`)}</tr>
14
+ <tr>
15
+ <td>${e}</td>
16
+ ${this._answers.map(()=>t`<td><input type="radio" disabled /></td>`)}
17
+ </tr>
13
18
  `)}
14
19
  </tbody>
15
20
  </table>
16
- ${this.analysis?t`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
17
21
  </div>
18
22
  `}_renderEdit(){return t`
19
23
  <div class="flex-items-start">
20
24
  <div class="label"><span>题目:</span></div>
21
25
  <div style="flex:1">
22
26
  <div class="el-input">
23
- <textarea rows="2" .value=${this._title} ?disabled=${this["is-save"]}
27
+ <textarea
28
+ rows="2"
29
+ .value=${this._title}
24
30
  maxlength=${this.TITLE_MAX}
25
31
  @input=${t=>this._onTitleInput(t)}
26
- placeholder="【量表题】请输入问题"></textarea>
32
+ placeholder="【量表题】请输入问题"
33
+ ></textarea>
27
34
  <span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
28
35
  </div>
29
36
  </div>
30
37
  </div>
31
38
 
39
+ <slot name="business-tag"></slot>
40
+
32
41
  <div class="flex-items-start" style="margin-top:12px">
33
42
  <div class="label"><span>行标题:</span></div>
34
43
  <div class="flex" style="flex:1">
35
44
  <div class="el-input" style="width:160px">
36
- <textarea class="row-title-textarea" .value=${this._rowTitle} ?disabled=${this["is-save"]}
45
+ <textarea
46
+ class="row-title-textarea"
47
+ .value=${this._rowTitle}
37
48
  @input=${t=>{this._rowTitle=t.target.value}}
38
49
  @keydown=${t=>{t.stopPropagation()}}
39
- placeholder="请输入行标题"></textarea>
50
+ placeholder="请输入行标题"
51
+ ></textarea>
40
52
  </div>
41
53
  <div style="flex:1;margin-left:12px">
42
- ${this._answers.map((e,i)=>t`
54
+ ${this._answers.map((e,s)=>t`
43
55
  <div class="answer-item">
44
- <span class="label">${String.fromCharCode(65+i)}.</span>
56
+ <span class="label">${String.fromCharCode(65+s)}.</span>
45
57
  <div class="input">
46
- <input type="text" .value=${e.title} ?disabled=${this["is-save"]}
58
+ <input
59
+ type="text"
60
+ .value=${e.title}
47
61
  maxlength="10"
48
- @input=${t=>{this._answers=this._answers.map((e,s)=>s===i?{title:t.target.value}:e)}}
49
- placeholder="选项${i+1}" />
62
+ @input=${t=>{const e=t.target.value;this._answers=this._answers.map((t,i)=>i===s?{...t,title:e}:t)}}
63
+ placeholder="选项${s+1}"
64
+ />
50
65
  </div>
51
- ${this["is-save"]?"":t`
52
- <span class="icon" @click=${()=>{this._answers.length<5&&(this._answers=[...this._answers,{title:""}])}}>${p}</span>
53
- <span class="icon ${this._answers.length<3?"disabled":""}" @click=${()=>{this._answers.length>3&&(this._answers=this._answers.filter((t,e)=>e!==i))}}>${c}</span>
54
- `}
66
+ <span
67
+ class="icon"
68
+ @click=${()=>{this._answers.length<5&&(this._answers=[...this._answers,{title:""}])}}
69
+ >${w}</span>
70
+ <span
71
+ class="icon ${this._answers.length<3?"disabled":""}"
72
+ @click=${()=>{this._answers.length>3&&(this._answers=this._answers.filter((t,e)=>e!==s))}}
73
+ >${m}</span>
55
74
  </div>
56
75
  `)}
57
76
  </div>
58
77
  </div>
59
78
  </div>
60
79
 
61
- <div class="flex-items-start" style="margin-top:12px">
62
- <div class="label"><span>解析:</span></div>
63
- <div style="flex:1">
64
- <div class="el-input">
65
- <textarea rows="2" .value=${this._analysis} ?disabled=${this["is-save"]}
66
- @input=${t=>{this._analysis=t.target.value}}
67
- placeholder="请输入题目解析"></textarea>
68
- </div>
69
- </div>
70
- </div>
71
-
72
80
  ${this._showRichText?t`
73
- <div class="flex-items-start" style="margin-top:12px">
74
- <div class="label"><span>富文本:</span></div>
75
- <div style="flex:1">
76
- <qxs-blocksuite-editor
77
- .content=${this._richText}
78
- .upload-image=${this["upload-image"]}
79
- ?is-edit=${!0}
80
- ></qxs-blocksuite-editor>
81
- ${this["show-action"]?"":t`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
82
- </div>
83
- </div>
84
- `:""}
85
- `}render(){return t`
81
+ <div class="flex-items-start" style="margin-top:12px">
82
+ <div class="label"><span>富文本:</span></div>
83
+ <div style="flex:1">
84
+ <qxs-blocksuite-editor
85
+ .content=${this._richText}
86
+ .upload-image=${this["upload-image"]}
87
+ ?is-edit=${!0}
88
+ ></qxs-blocksuite-editor>
89
+ ${this["show-action"]?"":t`
90
+ <div class="flex-justify-end" style="margin-top:8px">
91
+ <span
92
+ class="el-link danger"
93
+ @click=${()=>{this._showRichText=!1,this._richText=""}}
94
+ >删除富文本</span>
95
+ </div>
96
+ `}
97
+ </div>
98
+ </div>
99
+ `:""}
100
+ `}render(){const e=this["is-edit"]?t`<div slot="edit">${this._renderEdit()}</div>`:t`<div slot="preview">${this._renderPreview()}</div>`;return t`
86
101
  <qxs-subject-layout .show-edit=${this["is-edit"]}>
87
- <div slot="preview">${this._renderPreview()}</div>
88
- <div slot="edit">${this._renderEdit()}</div>
102
+ ${e}
89
103
  ${this["show-action"]?t`
90
- <qxs-subject-action
91
- .is-edit=${this["is-edit"]}
92
- .is-set=${this["is-set"]}
93
- .show-add=${this["show-add"]}
94
- .show-rich-text=${this._showRichText}
95
- .show-other-option=${!1}
96
- exam-answer-relation-type=${this["exam-answer-relation-type"]}
97
- @delete=${()=>this._emit("delete")}
98
- @save=${this._save}
99
- @edit=${()=>this._emit("edit")}
100
- @add=${t=>this._emit("add",t.detail)}
101
- @on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
102
- ></qxs-subject-action>
103
- `:""}
104
+ <qxs-subject-action
105
+ .is-edit=${this["is-edit"]}
106
+ .is-set=${this["is-set"]}
107
+ .show-add=${this["show-add"]}
108
+ .show-rich-text=${this._showRichText}
109
+ .show-other-option=${!1}
110
+ exam-answer-relation-type=${this["exam-answer-relation-type"]}
111
+ @delete=${()=>this._emit("delete")}
112
+ @save=${this._save}
113
+ @edit=${()=>this._emit("edit")}
114
+ @add=${t=>this._emit("add",t.detail)}
115
+ @on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
116
+ ></qxs-subject-action>
117
+ `:""}
104
118
  </qxs-subject-layout>
105
- `}};x.styles=e`
119
+ `}};y.styles=e`
106
120
  :host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
107
121
  *, ::before, ::after { box-sizing: border-box; }
108
122
 
@@ -113,7 +127,6 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
113
127
  .scale-table th { background: #f5f7fa; color: #909399; }
114
128
 
115
129
  .flex { display: flex; }
116
- .flex-items-center { display: flex; align-items: center; }
117
130
  .flex-items-start { display: flex; align-items: flex-start; }
118
131
  .flex-justify-end { display: flex; justify-content: flex-end; }
119
132
  .label { min-width: 60px; font-size: 13px; color: #606266; }
@@ -134,7 +147,6 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
134
147
  }
135
148
 
136
149
  .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }
137
- .el-link:hover { color: #2D4CB8; }
138
150
  .el-link.danger { color: #f56c6c; }
139
151
 
140
152
  .answer-item { display: flex; align-items: center; margin-top: 6px; }
@@ -158,8 +170,6 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
158
170
  .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }
159
171
  .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
160
172
 
161
- .row-title-textarea {
162
- height: 200px;
163
- }
164
- `,h([s({type:Number,attribute:"order-index"})],x.prototype,"order-index",2),h([s({type:String})],x.prototype,"title",2),h([s({type:String,attribute:"custom-id"})],x.prototype,"custom-id",2),h([s({type:Boolean,attribute:"is-edit"})],x.prototype,"is-edit",2),h([s({type:Boolean,attribute:"is-save"})],x.prototype,"is-save",2),h([s({type:Boolean,attribute:"is-set"})],x.prototype,"is-set",2),h([s({type:Boolean,attribute:"show-action"})],x.prototype,"show-action",2),h([s({type:Boolean,attribute:"show-add"})],x.prototype,"show-add",2),h([s({type:Boolean,attribute:"show-analysis"})],x.prototype,"show-analysis",2),h([s({type:String})],x.prototype,"analysis",2),h([s({type:String,attribute:"rich-text-content"})],x.prototype,"rich-text-content",2),h([s({type:Number,attribute:"exam-answer-relation-type"})],x.prototype,"exam-answer-relation-type",2),h([s({type:Object,attribute:"upload-image"})],x.prototype,"upload-image",2),h([s({type:Array,attribute:"answer-list"})],x.prototype,"answer-list",1),h([s({type:Array,attribute:"scale-questions"})],x.prototype,"scale-questions",1),h([o()],x.prototype,"_answers",2),h([o()],x.prototype,"_scaleQuestions",2),h([o()],x.prototype,"_rowTitle",2),h([o()],x.prototype,"_title",2),h([o()],x.prototype,"_analysis",2),h([o()],x.prototype,"_showRichText",2),h([o()],x.prototype,"_richText",2),h([s({type:String,attribute:"model-value"})],x.prototype,"model-value",2),h([s({type:Boolean,attribute:"use-model"})],x.prototype,"use-model",2),x=h([a("qxs-scale")],x);export{x as QxsScale};
173
+ .row-title-textarea { height: 200px; }
174
+ `,h([i({type:Number,attribute:"order-index"})],y.prototype,"order-index",2),h([i({type:String})],y.prototype,"title",2),h([i({type:String,attribute:"custom-id"})],y.prototype,"custom-id",2),h([i({type:Boolean,attribute:"is-edit"})],y.prototype,"is-edit",2),h([i({type:Boolean,attribute:"is-save"})],y.prototype,"is-save",2),h([i({type:Boolean,attribute:"is-set"})],y.prototype,"is-set",2),h([i({type:Boolean,attribute:"show-action"})],y.prototype,"show-action",2),h([i({type:Boolean,attribute:"show-add"})],y.prototype,"show-add",2),h([i({type:String})],y.prototype,"analysis",2),h([i({type:String,attribute:"rich-text-content"})],y.prototype,"rich-text-content",2),h([i({type:Number,attribute:"exam-answer-relation-type"})],y.prototype,"exam-answer-relation-type",2),h([i({type:Object,attribute:"upload-image"})],y.prototype,"upload-image",2),h([i({type:Array,attribute:"answer-list"})],y.prototype,"answer-list",1),h([i({type:Array,attribute:"scale-question-list"})],y.prototype,"scale-question-list",1),h([i({type:Array,attribute:"scale-questions"})],y.prototype,"scale-questions",1),h([o()],y.prototype,"_answers",2),h([o()],y.prototype,"_scaleQuestions",2),h([o()],y.prototype,"_rowTitle",2),h([o()],y.prototype,"_title",2),h([o()],y.prototype,"_showRichText",2),h([o()],y.prototype,"_richText",2),h([i({type:String,attribute:"model-value"})],y.prototype,"model-value",2),h([i({type:Boolean,attribute:"use-model"})],y.prototype,"use-model",2),y=h([r("qxs-scale")],y);export{y as QxsScale};
165
175
  //# sourceMappingURL=scale.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"scale.mjs","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 } from './single'\nimport { SubjectType } from './types'\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 {\n height: 200px;\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: 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'(v: any) {\n const arr = Array.isArray(v) ? v : []\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'(v: any) {\n this._scaleQuestions = Array.isArray(v) && v.length ? v : ['问题1']\n this.requestUpdate('scale-questions')\n }\n\n @state() private _answers: { title: string }[] = [{ 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\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'))) {\n this._syncProps()\n }\n // 当外部 modelValue 变化时同步内部状态\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._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 }\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\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((i: string) => i.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 }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\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 // 双向绑定:通知外部更新\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 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((a: any, i: number) => {\n if (!a.title) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写`, '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((i: string) => i.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(a => html`<th style=\"width:${colWidth}%\">${a.title}</th>`)}\n </tr></thead>\n <tbody>\n ${this._scaleQuestions.map(q => html`\n <tr><td>${q}</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 </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 <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((a, i) => html`\n <div class=\"answer-item\">\n <span class=\"label\">${String.fromCharCode(65 + i)}.</span>\n <div class=\"input\">\n <input type=\"text\" .value=${a.title} ?disabled=${this['is-save']}\n maxlength=\"10\"\n @input=${(e: Event) => { this._answers = this._answers.map((x, j) => j === i ? { title: (e.target as HTMLInputElement).value } : x) }}\n placeholder=\"选项${i + 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((_, j) => j !== i) }\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","TITLE_MAX","v","arr","Array","isArray","length","slice","requestUpdate","willUpdate","changed","has","_syncProps","join","toJSON","row","customId","answerType","orderIndex","answers","rowTitle","showRichText","richText","SubjectError","i","String","fromCharCode","questions","split","filter","trim","SubjectType","SCALE","scaleQuestionList","examRichTextContent","examAnswerRelationType","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","_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","a","_renderPreview","colWidth","Math","floor","map","q","_renderEdit","stopPropagation","x","j","_","render","styles","css","__decorateClass","property","type","Number","attribute","prototype","Boolean","state","safeCustomElement"],"mappings":"ybAMA,MAAMA,EAAWC,CAAA,2NACXC,EAAaD,CAAA,qLAgBZ,IAAME,EAAN,cAAuBC,EAAvBC,WAAAA,GAAAC,SAAAC,WA8DiDC,KAAA,eAAgB,EAC1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACRA,KAAA,kBAAkB,EAC/CA,KAAAE,SAAW,GACqBF,KAAA,qBAAsB,GACdA,KAAA,6BAA8B,EAElGA,KAAA,gBAAkDG,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,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AQC,UAAW,+BAzE1B9H,EAyEyD+H,UAAA,4BAAA,GAEpEL,EAAA,CADCC,EAAS,CAAEC,KAAM3C,OAAQ6C,UAAW,kBA1E1B9H,EA2EX+H,UAAA,eAAA,GAUIL,EAAA,CADHC,EAAS,CAAEC,KAAM7F,MAAO+F,UAAW,iBApFzB9H,EAqFP+H,UAAA,cAAA,GASAL,EAAA,CADHC,EAAS,CAAEC,KAAM7F,MAAO+F,UAAW,qBA7FzB9H,EA8FP+H,UAAA,kBAAA,GAOaL,EAAA,CAAhBO,KArGUjI,EAqGM+H,UAAA,WAAA,GACAL,EAAA,CAAhBO,KAtGUjI,EAsGM+H,UAAA,kBAAA,GACAL,EAAA,CAAhBO,KAvGUjI,EAuGM+H,UAAA,YAAA,GACAL,EAAA,CAAhBO,KAxGUjI,EAwGM+H,UAAA,SAAA,GACAL,EAAA,CAAhBO,KAzGUjI,EAyGM+H,UAAA,YAAA,GACAL,EAAA,CAAhBO,KA1GUjI,EA0GM+H,UAAA,gBAAA,GACAL,EAAA,CAAhBO,KA3GUjI,EA2GM+H,UAAA,YAAA,GAGqCL,EAAA,CAArDC,EAAS,CAAEC,KAAMxE,OAAQ0E,UAAW,iBA9G1B9H,EA8G2C+H,UAAA,cAAA,GACDL,EAAA,CAApDC,EAAS,CAAEC,KAAMI,QAASF,UAAW,eA/G3B9H,EA+G0C+H,UAAA,YAAA,GA/G1C/H,EAAN0H,EAAA,CADNQ,EAAkB,cACNlI"}
1
+ {"version":3,"file":"scale.mjs","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 } from './single'\nimport { SubjectType } 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: String(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: String(answer?.title ?? answer?.answer ?? ''),\n }\n next.title = String(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 = 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-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: 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 this._answers = Array.isArray(value) ? normalizeScaleAnswers(value) : 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 = 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: 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 = 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 <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 `\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 <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`\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 render() {\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","String","answerId","examAnswerId","serializeScaleAnswer","index","orderIndex","isCorrect","iconPlus","html","iconRemove","QxsScale","LitElement","constructor","super","arguments","this","analysis","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","_scaleQuestions","_rowTitle","_title","_showRichText","_richText","TITLE_MAX","value","isArray","slice","map","normalizeScaleAnswers","requestUpdate","item","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","answers","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","_","render","content","styles","css","__decorateClass","property","type","Number","attribute","prototype","state","safeCustomElement"],"mappings":"ybAcA,SAASA,IACP,MAAO,CAAEC,MAAO,GAClB,CAEA,SAASC,IACP,OAAOC,MAAMC,KAAK,CAAEC,OAAQ,GAAKL,EACnC,CAEA,SAASM,EAAqBC,GAC5B,MAAMC,E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