|
@@ -8,44 +8,29 @@ export function renderProp(options: any[], prop = "status") {
|
|
|
const item = options.find(s => s.value === String(row[prop]));
|
|
|
return h(
|
|
|
ElTag,
|
|
|
- {
|
|
|
- type: item && item.type ? item.type : ""
|
|
|
- },
|
|
|
- {
|
|
|
- default: () => item?.label || "--"
|
|
|
- }
|
|
|
+ { type: item && item.type ? item.type : "" },
|
|
|
+ { default: () => item?.label || "--" }
|
|
|
);
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-export function renderIconLabelLeft(leftProp, rightProp, label = "", okProp = "") {
|
|
|
-
|
|
|
+export function renderIconLabelLeft(
|
|
|
+ leftProp,
|
|
|
+ rightProp,
|
|
|
+ label = "",
|
|
|
+ okProp = ""
|
|
|
+) {
|
|
|
return {
|
|
|
cellRenderer({ row }) {
|
|
|
- if (okProp && !row[okProp]) {
|
|
|
- return null
|
|
|
- }
|
|
|
-
|
|
|
+ if (okProp && !row[okProp]) { return null }
|
|
|
return [
|
|
|
- h(
|
|
|
- ElPopover,
|
|
|
- {
|
|
|
- content: label + row[leftProp],
|
|
|
- placement:'left',
|
|
|
- width: 300,
|
|
|
- },
|
|
|
- {
|
|
|
- reference: () =>
|
|
|
- h(ElButton, {
|
|
|
- link: true,
|
|
|
- size:'large',
|
|
|
- icon: useRenderIcon("information-line")
|
|
|
- })
|
|
|
- }
|
|
|
+ h(ElPopover,
|
|
|
+ { content: label + row[leftProp], placement:'left', width: 300, },
|
|
|
+ { reference: () => h(ElButton, { link: true, size:'large', icon: useRenderIcon("information-line") }) }
|
|
|
),
|
|
|
h("text", null, row[rightProp] || '--')
|
|
|
]
|
|
|
}
|
|
|
};
|
|
|
-}
|
|
|
+}
|