|
@@ -1,3 +1,4 @@
|
|
|
+/* eslint-disable prettier/prettier */
|
|
|
import { defineComponent, ref } from "vue";
|
|
|
import PureTable from "@pureadmin/table";
|
|
|
import { pageContentProps } from "./types";
|
|
@@ -81,6 +82,7 @@ const PageConent = defineComponent({
|
|
|
superUserNoAction,
|
|
|
superUserNoPerview,
|
|
|
showPayTagFn,
|
|
|
+ showStatus,
|
|
|
showReturnTagFn
|
|
|
} = contentConfig;
|
|
|
|
|
@@ -97,6 +99,13 @@ const PageConent = defineComponent({
|
|
|
const showPay = showPayTagFn ? showPayTagFn(row, powers) : true;
|
|
|
const showRerturn = showReturnTagFn ? showReturnTagFn(row, powers) : true;
|
|
|
|
|
|
+ const _showStatus = showStatus
|
|
|
+ ? showStatus(isSuperUser.value)
|
|
|
+ : action.status &&
|
|
|
+ noAction &&
|
|
|
+ ((powers.some(i => i == "003") && row.status + "" === "0") ||
|
|
|
+ (powers.some(i => i == "004") && row.status + "" === "1"));
|
|
|
+
|
|
|
return (
|
|
|
<>
|
|
|
{!notPreview && view && noPerview && powers.some(i => i == "007") && (
|
|
@@ -132,20 +141,17 @@ const PageConent = defineComponent({
|
|
|
/>
|
|
|
)}
|
|
|
|
|
|
- {action.status &&
|
|
|
- noAction &&
|
|
|
- ((powers.some(i => i == "003") && row.status + "" === "0") ||
|
|
|
- (powers.some(i => i == "004") && row.status + "" === "1")) && (
|
|
|
- <Operation.Status
|
|
|
- row={row}
|
|
|
- prop={contentConfig.statusProp}
|
|
|
- // eslint-disable-next-line prettier/prettier
|
|
|
- statusRowProp={contentConfig.statusRowProp}
|
|
|
- onReload={() => onSearch()}
|
|
|
- isRequesetArray={isRequesetArray}
|
|
|
- {...createActionProps("status", apis)}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {_showStatus && (
|
|
|
+ <Operation.Status
|
|
|
+ row={row}
|
|
|
+ prop={contentConfig.statusProp}
|
|
|
+ // eslint-disable-next-line prettier/prettier
|
|
|
+ statusRowProp={contentConfig.statusRowProp}
|
|
|
+ onReload={() => onSearch()}
|
|
|
+ isRequesetArray={isRequesetArray}
|
|
|
+ {...createActionProps("status", apis)}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
{del && noAction && action.delete && powers.some(i => i == "006") && (
|
|
|
<Operation.Delete
|
|
@@ -162,8 +168,12 @@ const PageConent = defineComponent({
|
|
|
|
|
|
function renderCreateButton() {
|
|
|
const { contentConfig, powers } = props;
|
|
|
- const { superUserNoAction } = contentConfig;
|
|
|
- if (superUserNoAction && isSuperUser.value) {
|
|
|
+ const { superUserNoAction, showCreate } = contentConfig;
|
|
|
+
|
|
|
+ if (
|
|
|
+ (superUserNoAction && isSuperUser.value) ||
|
|
|
+ (showCreate && !showCreate(isSuperUser.value))
|
|
|
+ ) {
|
|
|
return null;
|
|
|
}
|
|
|
|