|
@@ -7,23 +7,22 @@ import { useRequeset } from "./hooks/use-request";
|
|
|
import { Operation } from "./actions";
|
|
|
import { useSelection } from "./hooks/use-selection";
|
|
|
import { POWERS } from "/@/config/status";
|
|
|
-import {
|
|
|
- ElButton,
|
|
|
- ElButtonGroup,
|
|
|
- ElCheckbox,
|
|
|
- ElCheckboxGroup,
|
|
|
- ElScrollbar,
|
|
|
- ElTooltip
|
|
|
-} from "element-plus";
|
|
|
+// import {
|
|
|
+// ElButton,
|
|
|
+// ElButtonGroup,
|
|
|
+// ElCheckbox,
|
|
|
+// ElCheckboxGroup,
|
|
|
+// ElScrollbar,
|
|
|
+// ElTooltip
|
|
|
+// } from "element-plus";
|
|
|
import { useColumns } from "./hooks/use-columns";
|
|
|
-import { useRenderIcon } from "../../ReIcon/src/hooks";
|
|
|
+// import { useRenderIcon } from "../../ReIcon/src/hooks";
|
|
|
import "./styles/index.scss";
|
|
|
const powers = POWERS;
|
|
|
const PageConent = defineComponent({
|
|
|
name: "PageContent",
|
|
|
props: pageContentProps,
|
|
|
emits: [
|
|
|
- "createBtnClick",
|
|
|
"updateBtnClick",
|
|
|
"previewBtnClick",
|
|
|
"statusBtnClick",
|
|
@@ -50,9 +49,12 @@ const PageConent = defineComponent({
|
|
|
|
|
|
const { selects } = useSelection();
|
|
|
|
|
|
- const { columns, fixed, displayColumns, _raw, reset } = useColumns(
|
|
|
- props.contentConfig.columns
|
|
|
- );
|
|
|
+ const {
|
|
|
+ columns
|
|
|
+ // fixed, displayColumns,
|
|
|
+ // _raw
|
|
|
+ // reset
|
|
|
+ } = useColumns(props.contentConfig.columns);
|
|
|
|
|
|
function handleSelection(value) {
|
|
|
selects.value = value;
|
|
@@ -71,6 +73,7 @@ const PageConent = defineComponent({
|
|
|
inv,
|
|
|
apis,
|
|
|
notPreview,
|
|
|
+ notLog,
|
|
|
delTooltip,
|
|
|
showPreview,
|
|
|
showDelete,
|
|
@@ -78,7 +81,6 @@ const PageConent = defineComponent({
|
|
|
} = contentConfig;
|
|
|
|
|
|
const view = showPreview ? showPreview(row) : true;
|
|
|
-
|
|
|
const del = showDelete ? showDelete(row) : true;
|
|
|
|
|
|
return (
|
|
@@ -138,14 +140,8 @@ const PageConent = defineComponent({
|
|
|
{...createActionProps("resetPwd", apis)}
|
|
|
/>
|
|
|
)}
|
|
|
- {action.log && powers.some(i => i == "022") && (
|
|
|
- <Operation.Log
|
|
|
- row={row}
|
|
|
- prop={contentConfig.logProp}
|
|
|
- delTooltip={delTooltip}
|
|
|
- onLog={() => emit("logBtnClick", row)}
|
|
|
- {...createActionProps("log", apis)}
|
|
|
- />
|
|
|
+ {!notLog && powers.some(i => i == "022") && (
|
|
|
+ <Operation.Log onLog={() => emit("logBtnClick", row)} />
|
|
|
)}
|
|
|
</>
|
|
|
);
|
|
@@ -162,13 +158,6 @@ const PageConent = defineComponent({
|
|
|
<div style={{ display: "flex", gap: "5px" }}>
|
|
|
{/* excel导出 */}
|
|
|
{slots.header && slots.header()}
|
|
|
- {(slots.create && slots.create()) ||
|
|
|
- (action.create && powers.some(i => i == "003") && (
|
|
|
- <Operation.Create
|
|
|
- {...createActionProps("create", contentConfig.apis)}
|
|
|
- onCreate={() => emit("createBtnClick")}
|
|
|
- />
|
|
|
- ))}
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
@@ -186,56 +175,56 @@ const PageConent = defineComponent({
|
|
|
return slots.expand && slots.expand(row);
|
|
|
}
|
|
|
|
|
|
- function renderFilterColumnns() {
|
|
|
- return (
|
|
|
- <div class="filter-columns__content">
|
|
|
- <div class="filter-columns_reset">
|
|
|
- 列筛选
|
|
|
- <ElButton onClick={() => reset()}>重置</ElButton>
|
|
|
- </div>
|
|
|
+ // function renderFilterColumnns() {
|
|
|
+ // return (
|
|
|
+ // <div class="filter-columns__content">
|
|
|
+ // <div class="filter-columns_reset">
|
|
|
+ // 列筛选
|
|
|
+ // <ElButton onClick={() => reset()}>重置</ElButton>
|
|
|
+ // </div>
|
|
|
|
|
|
- <ElScrollbar maxHeight={300}>
|
|
|
- <ElCheckboxGroup v-model={displayColumns.value}>
|
|
|
- {_raw.map(({ label, prop, fixed: fixedValue }, index) => {
|
|
|
- if (!label || label === "序号" || label === "操作") return;
|
|
|
+ // <ElScrollbar maxHeight={300}>
|
|
|
+ // <ElCheckboxGroup v-model={displayColumns.value}>
|
|
|
+ // {_raw.map(({ label, prop, fixed: fixedValue }, index) => {
|
|
|
+ // if (!label || label === "序号" || label === "操作") return;
|
|
|
|
|
|
- return (
|
|
|
- <div class="fixed-group">
|
|
|
- <ElButtonGroup>
|
|
|
- <ElTooltip
|
|
|
- content="固定在左边"
|
|
|
- placement="top"
|
|
|
- disabled={fixedValue === "left"}
|
|
|
- >
|
|
|
- <ElButton
|
|
|
- link
|
|
|
- icon={useRenderIcon("arrow-left-s-line")}
|
|
|
- onClick={() => fixed("left", index)}
|
|
|
- />
|
|
|
- </ElTooltip>
|
|
|
- <ElTooltip
|
|
|
- content="固定在右边"
|
|
|
- placement="top"
|
|
|
- disabled={fixedValue === "right"}
|
|
|
- >
|
|
|
- <ElButton
|
|
|
- link
|
|
|
- icon={useRenderIcon("arrow-right-s-line")}
|
|
|
- onClick={() => fixed("right", index)}
|
|
|
- />
|
|
|
- </ElTooltip>
|
|
|
- </ElButtonGroup>
|
|
|
- <ElCheckbox label={prop} key={prop}>
|
|
|
- {label}
|
|
|
- </ElCheckbox>
|
|
|
- </div>
|
|
|
- );
|
|
|
- })}
|
|
|
- </ElCheckboxGroup>
|
|
|
- </ElScrollbar>
|
|
|
- </div>
|
|
|
- );
|
|
|
- }
|
|
|
+ // return (
|
|
|
+ // <div class="fixed-group">
|
|
|
+ // <ElButtonGroup>
|
|
|
+ // <ElTooltip
|
|
|
+ // content="固定在左边"
|
|
|
+ // placement="top"
|
|
|
+ // disabled={fixedValue === "left"}
|
|
|
+ // >
|
|
|
+ // <ElButton
|
|
|
+ // link
|
|
|
+ // icon={useRenderIcon("arrow-left-s-line")}
|
|
|
+ // onClick={() => fixed("left", index)}
|
|
|
+ // />
|
|
|
+ // </ElTooltip>
|
|
|
+ // <ElTooltip
|
|
|
+ // content="固定在右边"
|
|
|
+ // placement="top"
|
|
|
+ // disabled={fixedValue === "right"}
|
|
|
+ // >
|
|
|
+ // <ElButton
|
|
|
+ // link
|
|
|
+ // icon={useRenderIcon("arrow-right-s-line")}
|
|
|
+ // onClick={() => fixed("right", index)}
|
|
|
+ // />
|
|
|
+ // </ElTooltip>
|
|
|
+ // </ElButtonGroup>
|
|
|
+ // <ElCheckbox label={prop} key={prop}>
|
|
|
+ // {label}
|
|
|
+ // </ElCheckbox>
|
|
|
+ // </div>
|
|
|
+ // );
|
|
|
+ // })}
|
|
|
+ // </ElCheckboxGroup>
|
|
|
+ // </ElScrollbar>
|
|
|
+ // </div>
|
|
|
+ // );
|
|
|
+ // }
|
|
|
|
|
|
function renderPureTable(size, checkList) {
|
|
|
const { contentConfig } = props;
|
|
@@ -287,7 +276,7 @@ const PageConent = defineComponent({
|
|
|
loading={loading.value}
|
|
|
v-slots={{
|
|
|
buttons: () => renderButtons(),
|
|
|
- toolbar: () => renderFilterColumnns(),
|
|
|
+ // toolbar: () => renderFilterColumnns(),
|
|
|
default: ({ size, checkList }) => renderPureTable(size, checkList)
|
|
|
}}
|
|
|
/>
|