修复工单内容格式与财务页面接口契约
This commit is contained in:
1 parent
90989f8f8a
commit
d330ad01cc
8 files changed
+551
-149
No files matched your search
+62
-74
@@ -4,7 +4,6 @@
|
||||
*/
|
||||
import { definePageMeta } from "#imports";
|
||||
import "~/assets/styles/TicketAttachments.DtbJGLkE.css";
|
||||
import "~/assets/styles/RichTextEditor.NkmgPT5m.css";
|
||||
import "~/assets/styles/_id_.C-0--Lx-.css";
|
||||
definePageMeta({
|
||||
key: (e) => e.fullPath,
|
||||
@@ -19,7 +18,6 @@ import { ref } from "vue";
|
||||
import { withCtx } from "vue";
|
||||
import { createCommentVNode } from "vue";
|
||||
import { computed } from "vue";
|
||||
import { isRef } from "vue";
|
||||
import { createElementBlock } from "vue";
|
||||
import { Fragment } from "vue";
|
||||
import { createElementVNode } from "vue";
|
||||
@@ -38,7 +36,7 @@ import message from "openvue/message";
|
||||
import { r as dict_r } from "~/lib/dict.js";
|
||||
import skeleton from "openvue/skeleton";
|
||||
import { n as sanitize_n } from "~/lib/sanitize.js";
|
||||
import RichTextEditor from "~/components/RichTextEditor.vue";
|
||||
import textarea from "openvue/textarea";
|
||||
import { n as ticketAttachments_n } from "~/lib/ticketAttachments.js";
|
||||
import TicketAttachments from "~/components/TicketAttachments.vue";
|
||||
import TicketNotice from "~/components/TicketNotice.vue";
|
||||
@@ -84,12 +82,10 @@ var le = {
|
||||
k = {
|
||||
class: `time`,
|
||||
},
|
||||
A = [`innerHTML`],
|
||||
j = {
|
||||
key: 0,
|
||||
class: `message-quote`,
|
||||
},
|
||||
M = [`innerHTML`],
|
||||
N = {
|
||||
class: `reply-box`,
|
||||
},
|
||||
@@ -98,7 +94,6 @@ var le = {
|
||||
class: `reply-quote`,
|
||||
role: `status`,
|
||||
},
|
||||
F = [`innerHTML`],
|
||||
I = {
|
||||
class: `reply-attachments`,
|
||||
},
|
||||
@@ -173,6 +168,7 @@ var le = {
|
||||
{
|
||||
id: 0,
|
||||
content: e.content,
|
||||
content_format: e.content_format,
|
||||
attachment: e.attachment || [],
|
||||
create_time: e.create_time,
|
||||
type: `Client`,
|
||||
@@ -235,13 +231,26 @@ var le = {
|
||||
function Ce(e) {
|
||||
e.id > 0 && canOperate.value && (Y.value = e.id);
|
||||
}
|
||||
// 引用已删除时明确提示;否则优先用服务端引用快照,再从当前对话寻找原文。
|
||||
// 正文和引用共用格式边界:纯文本不经过 HTML 解码,历史富文本继续净化。
|
||||
function contentProps(item) {
|
||||
return item?.content_format === `text`
|
||||
? {
|
||||
textContent: String(item.content ?? ``),
|
||||
style: { whiteSpace: `pre-wrap`, overflowWrap: `anywhere` },
|
||||
}
|
||||
: { innerHTML: sanitize_n(item?.content) };
|
||||
}
|
||||
// 引用快照保留服务端格式;删除提示或缺失提示明确使用纯文本。
|
||||
function we(e) {
|
||||
return Number(e.quote_info?.is_deleted) === 1
|
||||
? `该回复已删除`
|
||||
: e.quote_info?.content ||
|
||||
Z.value.find((t) => t.id === e.quote_reply_id)?.content ||
|
||||
`原回复 #${e.quote_reply_id}(内容暂不可用)`;
|
||||
if (Number(e.quote_info?.is_deleted) === 1)
|
||||
return { content: `该回复已删除`, content_format: `text` };
|
||||
if (typeof e.quote_info?.content === `string`) return e.quote_info;
|
||||
return (
|
||||
Z.value.find((t) => t.id === e.quote_reply_id) || {
|
||||
content: `原回复 #${e.quote_reply_id}(内容暂不可用)`,
|
||||
content_format: `text`,
|
||||
}
|
||||
);
|
||||
}
|
||||
// 引用发送者优先来自引用快照,缺失时回查当前对话。
|
||||
function Te(e) {
|
||||
@@ -273,7 +282,7 @@ var le = {
|
||||
G.value = !0;
|
||||
try {
|
||||
await z.post(`/ticket/${B}/reply`, {
|
||||
content: W.value.trim(),
|
||||
content: W.value,
|
||||
attachment: q.value.map((e) => e.save_name),
|
||||
quote_reply_id: Y.value,
|
||||
});
|
||||
@@ -320,7 +329,7 @@ var le = {
|
||||
}
|
||||
return (
|
||||
onMounted(X),
|
||||
// 对话按时间展示并使用公共 HTML 清理与附件解析;引用删除有独立文案,只读工单不开放回复编辑。
|
||||
// 对话遵循服务端内容格式;客户回复使用纯文本,只读工单不开放编辑。
|
||||
(n, a) => {
|
||||
let c = TicketNotice,
|
||||
m = NuxtLink,
|
||||
@@ -328,7 +337,7 @@ var le = {
|
||||
v = message,
|
||||
y = button,
|
||||
S = TicketAttachments,
|
||||
C = RichTextEditor;
|
||||
C = textarea;
|
||||
return (
|
||||
openBlock(),
|
||||
createElementBlock(`div`, le, [
|
||||
@@ -513,13 +522,10 @@ var le = {
|
||||
`div`,
|
||||
{
|
||||
class: `message-body`,
|
||||
innerHTML: (`sanitizeHtml` in n
|
||||
? n.sanitizeHtml
|
||||
: unref(sanitize_n))(t.content),
|
||||
...contentProps(t),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
A,
|
||||
16,
|
||||
),
|
||||
t.quote_reply_id
|
||||
? (openBlock(),
|
||||
@@ -535,16 +541,10 @@ var le = {
|
||||
createElementVNode(
|
||||
`div`,
|
||||
{
|
||||
innerHTML:
|
||||
(`sanitizeHtml` in n
|
||||
? n.sanitizeHtml
|
||||
: unref(sanitize_n))(
|
||||
we(t),
|
||||
),
|
||||
...contentProps(we(t)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
M,
|
||||
16,
|
||||
),
|
||||
createVNode(
|
||||
S,
|
||||
@@ -608,15 +608,10 @@ var le = {
|
||||
createElementVNode(
|
||||
`div`,
|
||||
{
|
||||
innerHTML: (`sanitizeHtml` in n
|
||||
? n.sanitizeHtml
|
||||
: unref(sanitize_n))(
|
||||
unref($).content,
|
||||
),
|
||||
...contentProps(unref($)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
F,
|
||||
16,
|
||||
),
|
||||
]),
|
||||
createVNode(y, {
|
||||
@@ -635,50 +630,43 @@ var le = {
|
||||
{
|
||||
modelValue: unref(W),
|
||||
"onUpdate:modelValue": (a[1] ||= (e) =>
|
||||
isRef(W) ? (W.value = e) : null),
|
||||
label: `回复内容`,
|
||||
"min-height": 140,
|
||||
(W.value = e)),
|
||||
"aria-label": `回复内容`,
|
||||
rows: 6,
|
||||
autoResize: true,
|
||||
fluid: true,
|
||||
placeholder: `输入回复内容…`,
|
||||
disabled: !unref(canOperate),
|
||||
},
|
||||
{
|
||||
"toolbar-end": withCtx(() => [
|
||||
createElementVNode(`label`, L, [
|
||||
(a[3] ||= createElementVNode(
|
||||
`i`,
|
||||
{
|
||||
class: `pi pi-paperclip`,
|
||||
},
|
||||
null,
|
||||
-1,
|
||||
)),
|
||||
(a[4] ||= createTextVNode(
|
||||
`添加附件`,
|
||||
-1,
|
||||
)),
|
||||
createElementVNode(
|
||||
`input`,
|
||||
{
|
||||
id: `reply-files`,
|
||||
type: `file`,
|
||||
multiple: ``,
|
||||
disabled:
|
||||
unref(G) ||
|
||||
unref(J) ||
|
||||
!unref(canOperate),
|
||||
onChange: xe,
|
||||
},
|
||||
null,
|
||||
40,
|
||||
_e,
|
||||
),
|
||||
]),
|
||||
]),
|
||||
_: 1,
|
||||
disabled: !unref(canOperate) || unref(G),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
[`modelValue`, `disabled`],
|
||||
),
|
||||
createElementVNode(`label`, L, [
|
||||
(a[3] ||= createElementVNode(
|
||||
`i`,
|
||||
{ class: `pi pi-paperclip` },
|
||||
null,
|
||||
-1,
|
||||
)),
|
||||
(a[4] ||= createTextVNode(`添加附件`, -1)),
|
||||
createElementVNode(
|
||||
`input`,
|
||||
{
|
||||
id: `reply-files`,
|
||||
type: `file`,
|
||||
multiple: ``,
|
||||
disabled:
|
||||
unref(G) ||
|
||||
unref(J) ||
|
||||
!unref(canOperate),
|
||||
onChange: xe,
|
||||
},
|
||||
null,
|
||||
40,
|
||||
_e,
|
||||
),
|
||||
]),
|
||||
createElementVNode(`div`, I, [
|
||||
unref(J)
|
||||
? (openBlock(),
|
||||
|
||||
Reference in new issue
Block a user