|
@@ -1,15 +1,16 @@
|
|
/* eslint-disable prettier/prettier */
|
|
/* eslint-disable prettier/prettier */
|
|
import { defineComponent, ref } from "vue";
|
|
import { defineComponent, ref } from "vue";
|
|
|
|
+
|
|
import PureTable from "@pureadmin/table";
|
|
import PureTable from "@pureadmin/table";
|
|
import { pageContentProps } from "./types";
|
|
import { pageContentProps } from "./types";
|
|
import { TableProBar } from "../../ReTable";
|
|
import { TableProBar } from "../../ReTable";
|
|
-import { createActionProps } from "./utils/create-operation";
|
|
|
|
|
|
+import { onBeforeRouteLeave } from "vue-router";
|
|
|
|
+import { useColumns } from "./hooks/use-columns";
|
|
|
|
+import { useActions } from "./hooks/use-actions";
|
|
import { useRequeset } from "./hooks/use-request";
|
|
import { useRequeset } from "./hooks/use-request";
|
|
import { useSelection } from "./hooks/use-selection";
|
|
import { useSelection } from "./hooks/use-selection";
|
|
import { useRenderIcon } from "../../ReIcon/src/hooks";
|
|
import { useRenderIcon } from "../../ReIcon/src/hooks";
|
|
-import { useColumns } from "./hooks/use-columns";
|
|
|
|
-import { useActions } from "./hooks/use-actions";
|
|
|
|
-import { onBeforeRouteLeave } from "vue-router";
|
|
|
|
|
|
+import { createActionProps } from "./utils/create-operation";
|
|
|
|
|
|
import { useAppStoreHook } from "/@/store/modules/app";
|
|
import { useAppStoreHook } from "/@/store/modules/app";
|
|
import { useUserInfo } from "/@/hooks/core/useUser";
|
|
import { useUserInfo } from "/@/hooks/core/useUser";
|
|
@@ -18,11 +19,11 @@ import "./styles/index.scss";
|
|
|
|
|
|
import {
|
|
import {
|
|
ElButton,
|
|
ElButton,
|
|
- ElButtonGroup,
|
|
|
|
|
|
+ ElTooltip,
|
|
ElCheckbox,
|
|
ElCheckbox,
|
|
- ElCheckboxGroup,
|
|
|
|
ElScrollbar,
|
|
ElScrollbar,
|
|
- ElTooltip
|
|
|
|
|
|
+ ElButtonGroup,
|
|
|
|
+ ElCheckboxGroup
|
|
} from "element-plus";
|
|
} from "element-plus";
|
|
|
|
|
|
const PageContent = defineComponent({
|
|
const PageContent = defineComponent({
|
|
@@ -31,10 +32,10 @@ const PageContent = defineComponent({
|
|
emits: [
|
|
emits: [
|
|
"createBtnClick",
|
|
"createBtnClick",
|
|
"updateBtnClick",
|
|
"updateBtnClick",
|
|
- "previewBtnClick",
|
|
|
|
"statusBtnClick",
|
|
"statusBtnClick",
|
|
- "selectionChange",
|
|
|
|
"getContentData",
|
|
"getContentData",
|
|
|
|
+ "previewBtnClick",
|
|
|
|
+ "selectionChange",
|
|
],
|
|
],
|
|
setup(props, { expose, emit, slots }) {
|
|
setup(props, { expose, emit, slots }) {
|
|
//根据传入的api决定表格需要的操作
|
|
//根据传入的api决定表格需要的操作
|
|
@@ -67,26 +68,26 @@ const PageContent = defineComponent({
|
|
emit("selectionChange", value);
|
|
emit("selectionChange", value);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 渲染需要的操作按钮
|
|
|
|
- */
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 渲染需要的操作按钮
|
|
|
|
+ */
|
|
function renderOperation(row) {
|
|
function renderOperation(row) {
|
|
const { contentConfig, powers } = props;
|
|
const { contentConfig, powers } = props;
|
|
const {
|
|
const {
|
|
- apis,
|
|
|
|
inv,
|
|
inv,
|
|
|
|
+ apis,
|
|
|
|
+ payProps,
|
|
|
|
+ showStatus,
|
|
notPreview,
|
|
notPreview,
|
|
delTooltip,
|
|
delTooltip,
|
|
- showPreview,
|
|
|
|
showDelete,
|
|
showDelete,
|
|
- payProps,
|
|
|
|
returnProps,
|
|
returnProps,
|
|
|
|
+ showPreview,
|
|
|
|
+ showPayTagFn,
|
|
|
|
+ showReturnTagFn,
|
|
isRequesetArray,
|
|
isRequesetArray,
|
|
superUserNoAction,
|
|
superUserNoAction,
|
|
superUserNoPerview,
|
|
superUserNoPerview,
|
|
- showPayTagFn,
|
|
|
|
- showStatus,
|
|
|
|
- showReturnTagFn
|
|
|
|
} = contentConfig;
|
|
} = contentConfig;
|
|
|
|
|
|
const view = showPreview ? showPreview(row) : true;
|
|
const view = showPreview ? showPreview(row) : true;
|
|
@@ -148,7 +149,6 @@ const PageContent = defineComponent({
|
|
<Operation.Status
|
|
<Operation.Status
|
|
row={row}
|
|
row={row}
|
|
prop={contentConfig.statusProp}
|
|
prop={contentConfig.statusProp}
|
|
- // eslint-disable-next-line prettier/prettier
|
|
|
|
statusRowProp={contentConfig.statusRowProp}
|
|
statusRowProp={contentConfig.statusRowProp}
|
|
onReload={() => onSearch()}
|
|
onReload={() => onSearch()}
|
|
isRequesetArray={isRequesetArray}
|
|
isRequesetArray={isRequesetArray}
|
|
@@ -229,7 +229,7 @@ const PageContent = defineComponent({
|
|
<ElScrollbar maxHeight={300} size="small">
|
|
<ElScrollbar maxHeight={300} size="small">
|
|
<ElCheckboxGroup v-model={displayColumns.value} size="small">
|
|
<ElCheckboxGroup v-model={displayColumns.value} size="small">
|
|
{_raw.map(({ label, prop, fixed: fixedValue }, index) => {
|
|
{_raw.map(({ label, prop, fixed: fixedValue }, index) => {
|
|
- if (!label || label === "序号" || label === "操作") return;
|
|
|
|
|
|
+ if (!label || label === "序号" || label === "z ") return;
|
|
return (
|
|
return (
|
|
<div class="fixed-group">
|
|
<div class="fixed-group">
|
|
<ElButtonGroup size="small">
|
|
<ElButtonGroup size="small">
|
|
@@ -279,20 +279,22 @@ const PageContent = defineComponent({
|
|
return (
|
|
return (
|
|
<PureTable
|
|
<PureTable
|
|
ref={isTree && tableRef}
|
|
ref={isTree && tableRef}
|
|
- maxHeight={ maxHeight ? maxHeight : '660px'}
|
|
|
|
border
|
|
border
|
|
|
|
+ stripe
|
|
defaultExp
|
|
defaultExp
|
|
align="left"
|
|
align="left"
|
|
- showOverflowTooltip
|
|
|
|
- table-layout="auto"
|
|
|
|
size="small"
|
|
size="small"
|
|
- stripe
|
|
|
|
rowKey={rowKey}
|
|
rowKey={rowKey}
|
|
|
|
+ table-layout="auto"
|
|
|
|
+ showOverflowTooltip
|
|
columns={columns.value}
|
|
columns={columns.value}
|
|
treeProps={treeProps}
|
|
treeProps={treeProps}
|
|
data={dataList.value}
|
|
data={dataList.value}
|
|
checkList={checkList}
|
|
checkList={checkList}
|
|
- paginationSmall={size === "small" ? true : false}
|
|
|
|
|
|
+ maxHeight={ maxHeight ? maxHeight : '660px'}
|
|
|
|
+ paginationSmall={
|
|
|
|
+ size === "small" ? true : false
|
|
|
|
+ }
|
|
headerCellStyle={{ background: "#fafafa", color: "#606266" }}
|
|
headerCellStyle={{ background: "#fafafa", color: "#606266" }}
|
|
onSelectionChange={handleSelection}
|
|
onSelectionChange={handleSelection}
|
|
{...paginationConfig}
|
|
{...paginationConfig}
|