Commit 4661846a by Jaxon

Merge branch 'feature/task-center' into 'SAAS+V5.8.2'

feat(任务中心): 极限数据情况处理

See merge request !689
2 parents 8fafd4fc 54d85c77
...@@ -31,19 +31,79 @@ function parseDatetime(value) { ...@@ -31,19 +31,79 @@ function parseDatetime(value) {
return "-"; return "-";
} }
function renderText(h, { data, schemaItem, schema }) { // tooltip: true,
return h("span", schemaItem.meta.fieldValue || "-"); // parentProps: {
// style: {
// display: "inline-block",
// height: "32px",
// width: "auto",
// maxWidth: "100%",
// verticalAlign: "top",
// },
// },
// // tooltipProps: el-tooltip 的传参
// render: (h, { data, schemaItem, schema }) => {
// return h("div", { class: "text-hide" }, data.description || "-");
// },
function renderText() {
return {
tooltip: true,
tooltipProps: {
render: (h, { data, schemaItem, schema }) => {
return h("div", schemaItem.meta.fieldValue || "-");
},
},
parentProps: {
style: {
display: "inline-block",
height: "32px",
width: "auto",
maxWidth: "100%",
verticalAlign: "top",
},
},
render: (h, { data, schemaItem, schema }) => {
return h("div", { class: "text-hide" }, schemaItem.meta.fieldValue || "-");
},
};
} }
function renderDatetime(h, { data, schemaItem, schema }) { function renderDatetime() {
return {
render: (h, { data, schemaItem, schema }) => {
const formatted = parseDatetime(schemaItem.meta.fieldValue); const formatted = parseDatetime(schemaItem.meta.fieldValue);
return h("span", formatted); return h("span", formatted);
},
};
} }
function renderLink(h, { data, schemaItem, schema }) { function renderLink() {
return {
tooltip: true,
tooltipProps: {
render: (h, { data, schemaItem, schema }) => {
return h("div", schemaItem.meta.fieldValue || "-");
},
},
parentProps: {
style: {
display: "inline-block",
height: "32px",
width: "auto",
maxWidth: "100%",
verticalAlign: "top",
},
},
render: (h, { data, schemaItem, schema }) => {
const { fieldValue, linkAlias } = schemaItem.meta; const { fieldValue, linkAlias } = schemaItem.meta;
if (!fieldValue) if (!fieldValue)
return h("span", "-"); return h("span", "-");
const linkProps = { const linkProps = {
class: "text-hide link-type",
style: {
width: "100%",
},
attrs: { attrs: {
href: fieldValue, href: fieldValue,
target: "_blank", target: "_blank",
...@@ -56,19 +116,27 @@ function renderLink(h, { data, schemaItem, schema }) { ...@@ -56,19 +116,27 @@ function renderLink(h, { data, schemaItem, schema }) {
}, },
}, },
}; };
return h("el-link", linkProps, linkAlias || fieldValue); return h("el-link", linkProps, linkAlias || fieldValue);
},
};
} }
function renderImage(h, { data, schemaItem, schema }) { function renderImage() {
return {
render: (h, { data, schemaItem, schema }) => {
const { fieldValue } = schemaItem.meta; const { fieldValue } = schemaItem.meta;
if (!fieldValue || !Array.isArray(fieldValue) || fieldValue.length === 0) { if (!fieldValue || !Array.isArray(fieldValue) || fieldValue.length === 0) {
return h("span", "-"); return h("span", "-");
} }
return h(DescriptionImageList, { props: { list: fieldValue, size: 80 } }); return h(DescriptionImageList, { props: { list: fieldValue, size: 80 } });
},
};
} }
function renderAttachment(h, { data, schemaItem, schema }) { function renderAttachment() {
return {
render: (h, { data, schemaItem, schema }) => {
const { fieldValue } = schemaItem.meta; const { fieldValue } = schemaItem.meta;
if (!fieldValue || !Array.isArray(fieldValue) || fieldValue.length === 0) { if (!fieldValue || !Array.isArray(fieldValue) || fieldValue.length === 0) {
return h("span", "-"); return h("span", "-");
...@@ -90,7 +158,7 @@ function renderAttachment(h, { data, schemaItem, schema }) { ...@@ -90,7 +158,7 @@ function renderAttachment(h, { data, schemaItem, schema }) {
rowChildren.push( rowChildren.push(
h("el-link", { h("el-link", {
attrs: { href: fileUrl, target: "_blank" }, attrs: { href: fileUrl, target: "_blank", title: fileUrl },
props: { type: "primary", underline: false }, props: { type: "primary", underline: false },
style: { marginLeft: "8px", lineHeight: 1 }, style: { marginLeft: "8px", lineHeight: 1 },
on: { on: {
...@@ -104,10 +172,13 @@ function renderAttachment(h, { data, schemaItem, schema }) { ...@@ -104,10 +172,13 @@ function renderAttachment(h, { data, schemaItem, schema }) {
}, "下载"), }, "下载"),
); );
return h("div", { attrs: { class: "attachment-item", style: "display: flex; align-items: center; margin-bottom: 8px;" } }, rowChildren); return h("div", { attrs: { class: "attachment-item" } }, rowChildren);
}); });
return h("div", { attrs: { class: "attachment-list" } }, containerChildren); return h("div", { attrs: { class: "attachment-list" } }, containerChildren);
},
};
} }
export default { export default {
......
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
}, },
labelWidth: "120px", labelWidth: "120px",
meta: item, meta: item,
render: cover2Descriptions[toUpper(item.fieldType)], ...cover2Descriptions?.[toUpper(item.fieldType)]?.(),
}))); })));
this.descriptionSchema = schema; this.descriptionSchema = schema;
} else { } else {
...@@ -238,6 +238,29 @@ export default { ...@@ -238,6 +238,29 @@ export default {
margin: 0 0 12px; margin: 0 0 12px;
background-color: #ebeef5; background-color: #ebeef5;
} }
::v-deep .link-type {
overflow: hidden;
.el-link--inner {
display: inline-block;
height: 32px;
width: auto;
max-width: 100%;
vertical-align: top;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
::v-deep .attachment-list {
.attachment-item {
margin-bottom: 8px;
display: flex;
align-items: center;
&:last-child {
margin-bottom: 0;
}
}
}
::v-deep .form-item { ::v-deep .form-item {
margin-bottom: 12px; margin-bottom: 12px;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!