ow
This commit is contained in:
1 parent
04c69d4941
commit
4f57b65451
15 files changed
+2338
-24
No files matched your search
@@ -53,7 +53,7 @@
|
||||
<div class="ft-field">
|
||||
<div class="ft-label">功能名称<span class="ft-required">*</span></div>
|
||||
<a-input size="large" required placeholder="请输入功能名称"
|
||||
:readonly="!isEdit || !!data.SecurityFunction.FunctionName"
|
||||
:readonly="!isEdit || !!data.SecurityFunction.CreatedBy"
|
||||
v-model:value="data.SecurityFunction.FunctionName" />
|
||||
</div>
|
||||
<div class="ft-field">
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
<template>
|
||||
<search-card @on-submit="onSubmit" @on-reset="onReset" @use-pagination="onPagination" :is-modal="isModal"
|
||||
:loading="loading" :pagination="result" :rowSelectionType="selectionType"
|
||||
:card-title-keys="[SecurityHelpFeatureEntity.NAME]" @on-row-dblclick="onRowDblclick"
|
||||
@on-select-change="onSelectChange">
|
||||
<template #control>
|
||||
<a-button type="primary" v-if="canCreate && !isModal" :icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate">新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<!-- 所属组存的是组主键,这里换成组编码显示,便于和维护页对应 -->
|
||||
<template v-if="column.dataIndex === SecurityHelpFeatureEntity.HELP_FEATURE_GROUP_ID">
|
||||
<span>{{ groupCodeOf(record.HelpFeatureGroupId) || "-" }}</span>
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div v-if="!isModal" class="page-footer">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length == 1)" @click.prevent="onView">查看</a-button>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!(keys && keys.length == 1)" @click.prevent="onAmend">修改</a-button>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
</search-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, inject, onMounted, ref, unref, provide, h, computed } from "vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import searchCard from "@/components/basic/SearchCard.vue";
|
||||
import { EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue";
|
||||
|
||||
import { SecurityHelpFunctionResultData } from "@/data/auto/securityHelpFunctionResultData";
|
||||
import { SecurityHelpFeatureEntity } from "@/data/auto/securityHelpFeatureEntity";
|
||||
import { SecurityHelpFeatureGroupEntity } from "@/data/auto/securityHelpFeatureGroupEntity";
|
||||
import { SearchFilter } from "@/data/auto/searchFilter"
|
||||
import securityHelpFunctionService from "@/service/security/securityHelpFunctionService";
|
||||
import { SecurityHelpFunctionSearchCriteria } from "@/data/auto/securityHelpFunctionSearchCriteria";
|
||||
|
||||
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { useBindOption } from "@/hooks/useBindOption";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy"
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy"
|
||||
import { OperationToEnquiryModelOption, operationToEnquiryMethodKey, enquiryMethodKey, searchCriteriaManagerKey } from "@/injections";
|
||||
import { useOrderedChildren } from "@/hooks/use-ordered-children";
|
||||
import { SearchCriteriaContext } from "@/injections";
|
||||
|
||||
//================inject================
|
||||
const operationMethod = inject(operationToEnquiryMethodKey, undefined);
|
||||
const modelOption = operationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
|
||||
|
||||
const isModal = ref(modelOption ? !!modelOption.isModalHelpFunction : false);
|
||||
const selectionType = modelOption ? modelOption.selectionTypeHelpFunction ?? 'radio' : 'checkbox';
|
||||
const initBindOptions = ref((modelOption ? modelOption.initBindOptionsHelpFunction : []) as BindOption[]);
|
||||
//================inject================
|
||||
|
||||
const emit = defineEmits(['onRowDblclick']);
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const canView = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
width: '5%',
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
sequence: 0,
|
||||
hidden: 'N',
|
||||
format: ''
|
||||
},
|
||||
{
|
||||
title: "功能点名称",
|
||||
dataIndex: SecurityHelpFeatureEntity.NAME,
|
||||
sorter: true,
|
||||
width: '20%',
|
||||
sequence: 1,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "作用说明",
|
||||
dataIndex: SecurityHelpFeatureEntity.DESCRIPTION,
|
||||
sorter: true,
|
||||
width: '35%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "所属组",
|
||||
dataIndex: SecurityHelpFeatureEntity.HELP_FEATURE_GROUP_ID,
|
||||
sorter: true,
|
||||
width: '15%',
|
||||
sequence: 3,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "图标",
|
||||
dataIndex: SecurityHelpFeatureEntity.ICON,
|
||||
sorter: true,
|
||||
width: '15%',
|
||||
sequence: 4,
|
||||
hidden: 'N'
|
||||
},
|
||||
]);
|
||||
|
||||
const viewOption = {
|
||||
Value: 'default',
|
||||
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: 'default', BindColumn: columns }]
|
||||
};
|
||||
|
||||
const bindOptions = ref<BindOption[]>([]);
|
||||
|
||||
const datas = ref<SecurityHelpFeatureEntity[]>([]);
|
||||
const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 });
|
||||
const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
|
||||
|
||||
const data = ref<SecurityHelpFunctionResultData>(new SecurityHelpFunctionResultData());
|
||||
|
||||
const isSearched = ref<boolean>(false);
|
||||
const currentSearchCriteria = ref<SecurityHelpFunctionSearchCriteria>(new SecurityHelpFunctionSearchCriteria());
|
||||
|
||||
const keys = ref<SecurityHelpFeatureEntity[]>([]);
|
||||
|
||||
/** 功能点组,用来把「组主键」翻译成「组编码」 */
|
||||
const groups = ref<SecurityHelpFeatureGroupEntity[]>([]);
|
||||
|
||||
const groupCodeOf = ((helpFeatureGroupId?: string) => {
|
||||
if (!helpFeatureGroupId) return "";
|
||||
const g = groups.value.find(x => x.HelpFeatureGroupId == helpFeatureGroupId);
|
||||
return g ? g.GroupCode : "";
|
||||
})
|
||||
|
||||
const {
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
} = useOrderedChildren<SearchCriteriaContext>();
|
||||
|
||||
//================provide================
|
||||
provide(enquiryMethodKey, {
|
||||
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; },
|
||||
getBindOptions: () => { return unref(bindOptions); },
|
||||
getViewOption: () => { return unref(viewOption); },
|
||||
getDatas: () => { return datas; },
|
||||
});
|
||||
|
||||
provide(
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
})
|
||||
);
|
||||
//================provide================
|
||||
|
||||
defineExpose({
|
||||
keys,
|
||||
initBindOptions,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
initBindOption();
|
||||
loadGroups();
|
||||
onSearch();
|
||||
})
|
||||
|
||||
const onSelectChange = ((selected: SecurityHelpFeatureEntity[]) => {
|
||||
keys.value = selected;
|
||||
})
|
||||
|
||||
/** 点一条功能点,进它所属组的维护页 */
|
||||
const gotoGroup = ((record: SecurityHelpFeatureEntity) => {
|
||||
const groupCode = groupCodeOf(record.HelpFeatureGroupId);
|
||||
router.push({ name: "SecurityHelpFeatureOperation", params: { id: groupCode, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onRowDblclick = ((e: any, record: SecurityHelpFeatureEntity) => {
|
||||
if (isModal.value) {
|
||||
emit('onRowDblclick', record);
|
||||
}
|
||||
else {
|
||||
gotoGroup(record);
|
||||
}
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
})
|
||||
|
||||
const onView = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
gotoGroup(keys.value[0]);
|
||||
})
|
||||
|
||||
const onCreate = (() => {
|
||||
router.push({ name: "SecurityHelpFeatureOperation", params: { id: '', mode: 'create' } });
|
||||
})
|
||||
|
||||
const onAmend = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
const groupCode = groupCodeOf(keys.value[0].HelpFeatureGroupId);
|
||||
router.push({ name: "SecurityHelpFeatureOperation", params: { id: groupCode, mode: 'amend' } });
|
||||
})
|
||||
|
||||
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
})
|
||||
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(SecurityHelpFeatureEntity.DB_NAME, '功能点名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
bindOption = ubo.getBindOption(SecurityHelpFeatureEntity.DB_DESCRIPTION, '作用说明', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
bindOption = ubo.getBindOption(SecurityHelpFeatureEntity.DB_ICON, '图标', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
initBindOptions.value.forEach(element => {
|
||||
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled);
|
||||
});
|
||||
})
|
||||
|
||||
/** 组是翻译「组主键 → 组编码」用的,数据来自整表查询 */
|
||||
const loadGroups = (async () => {
|
||||
try {
|
||||
const all = await securityHelpFunctionService.FindAll();
|
||||
groups.value = all.SecurityHelpFeatureGroups ?? [];
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
|
||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
result.value.Page = pagingParams.value.page ?? 1;
|
||||
result.value.Limit = pagingParams.value.pageSize;
|
||||
|
||||
const onSubmit = (async (filters: SearchFilter[]) => {
|
||||
|
||||
let c: SecurityHelpFunctionSearchCriteria = new SecurityHelpFunctionSearchCriteria();
|
||||
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
})
|
||||
|
||||
const onSearch = (async () => {
|
||||
onSubmit(items.value[0].getFilter());
|
||||
})
|
||||
|
||||
const findBySearchCriteria = (async (c: SecurityHelpFunctionSearchCriteria) => {
|
||||
try {
|
||||
data.value = await securityHelpFunctionService.FindFeatureBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Features ?? [];
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
|
||||
const onPagination = (async (params: PagingParams) => {
|
||||
|
||||
if (!isSearched.value) return;
|
||||
let c: SecurityHelpFunctionSearchCriteria = new SecurityHelpFunctionSearchCriteria();
|
||||
|
||||
c.Filter = items.value[0].getFilter();
|
||||
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField)
|
||||
c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
});
|
||||
|
||||
const onReload = (async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
})
|
||||
//table end-----------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@@ -0,0 +1,412 @@
|
||||
<template>
|
||||
<a-spin size="large" :spinning="loading">
|
||||
<div class="page-container">
|
||||
<div class="page-header">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-col :lg="8" :sm="24">
|
||||
<a-row :wrap="false">
|
||||
<a-col flex="none">
|
||||
<div style="padding: 0 "><a-input flex="none" readonly value="组编码"
|
||||
class="site-input-split" style="width: 160px;border-radius:0; border-top-left-radius: 5pt 5pt;
|
||||
border-bottom-left-radius: 5pt 5pt;
|
||||
pointer-events: none" /></div>
|
||||
</a-col>
|
||||
<a-col flex="auto">
|
||||
<a-input-search :disabled="isEdit" v-model:value="groupCode" flex="auto"
|
||||
@search="onModalSearch" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
<a-col :lg="12" :sm="24">
|
||||
<a-space>
|
||||
<a-button type="primary" :disabled="isEdit" :icon="h(FileSearchOutlined)"
|
||||
@click.prevent="onSearch">查询</a-button>
|
||||
<a-button type="primary" :disabled="isEdit" :icon="h(ClearOutlined)"
|
||||
@click.prevent="onReset">重置</a-button>
|
||||
<a-button type="primary" :disabled="isEdit" :icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate">新增</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<div class="page-main ft-page" :class="{ 'ft-readonly': !isEdit }" :style="{ height: resultH }">
|
||||
<!-- 顶部信息卡 -->
|
||||
<div class="ft-hero">
|
||||
<div class="ft-hero-icon">
|
||||
<AppstoreOutlined />
|
||||
</div>
|
||||
<div class="ft-hero-main">
|
||||
<div class="ft-hero-name">
|
||||
{{ data.SecurityHelpFeatureGroup.GroupName || data.SecurityHelpFeatureGroup.GroupCode ||
|
||||
"未填写功能点组" }}
|
||||
</div>
|
||||
<div class="ft-hero-meta">
|
||||
<span class="ft-chip">组编码 {{ data.SecurityHelpFeatureGroup.GroupCode || "-" }}</span>
|
||||
<span class="ft-chip">功能点 {{ (data.SecurityHelpFeatures || []).length }} 条</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 组信息 -->
|
||||
<div class="ft-card">
|
||||
<div class="ft-card-title">功能点组</div>
|
||||
<div class="ft-grid">
|
||||
<div class="ft-field">
|
||||
<div class="ft-label">组编码<span class="ft-required">*</span></div>
|
||||
<a-input size="large" placeholder="如 TOOLBAR、CRUD_HEAD"
|
||||
:readonly="!isEdit || !!data.SecurityHelpFeatureGroup.CreatedBy"
|
||||
v-model:value="data.SecurityHelpFeatureGroup.GroupCode" />
|
||||
</div>
|
||||
<div class="ft-field">
|
||||
<div class="ft-label">组名称</div>
|
||||
<a-input size="large" placeholder="便于后台维护时识别" :readonly="!isEdit"
|
||||
v-model:value="data.SecurityHelpFeatureGroup.GroupName" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 组内功能点 -->
|
||||
<div class="ft-card">
|
||||
<div class="ft-card-title">组内功能点</div>
|
||||
<div class="ft-list">
|
||||
<div v-for="(record, index) in data.SecurityHelpFeatures" :key="index" class="ft-item">
|
||||
<div class="ft-item-head">
|
||||
<span class="ft-item-index">{{ index + 1 }}</span>
|
||||
<div class="ft-item-title">
|
||||
<span class="ft-item-name">
|
||||
{{ record.Name || "未填写功能点名称" }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="isEdit" class="ft-item-actions">
|
||||
<UpSquareTwoTone class="ft-action" @click="upFeature(index)" />
|
||||
<DownSquareTwoTone class="ft-action" @click="downFeature(index)" />
|
||||
<DeleteOutlined class="ft-action ft-action-delete"
|
||||
@click="deleteFeature(index)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ft-item-body">
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">名称</span>
|
||||
<a-input v-if="isEdit" size="large" v-model:value="record.Name"
|
||||
placeholder="一般就是按钮上的字" />
|
||||
<span v-else class="ft-item-text">{{ record.Name || "-" }}</span>
|
||||
</div>
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">说明</span>
|
||||
<a-input v-if="isEdit" size="large" v-model:value="record.Description"
|
||||
placeholder="这个按钮 / 图标的作用" />
|
||||
<span v-else class="ft-item-text">{{ record.Description || "-" }}</span>
|
||||
</div>
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">图标</span>
|
||||
<a-input v-if="isEdit" size="large" v-model:value="record.Icon"
|
||||
placeholder="如 DeleteOutlined" />
|
||||
<span v-else class="ft-item-text">{{ record.Icon || "-" }}</span>
|
||||
</div>
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">颜色</span>
|
||||
<a-input v-if="isEdit" size="large" v-model:value="record.Color"
|
||||
placeholder="页面上的真实颜色,如 #faad14 / red" />
|
||||
<span v-else class="ft-item-text">{{ record.Color || "-" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!data.SecurityHelpFeatures || !data.SecurityHelpFeatures.length" class="ft-empty">
|
||||
暂无功能点
|
||||
</div>
|
||||
<a-button class="ft-add-btn" type="dashed" block v-if="isEdit" @click="addFeature">
|
||||
<PlusSquareTwoTone /> 新增功能点
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-footer">
|
||||
<div style="">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<div>
|
||||
<a-row v-if="isEdit" :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-popconfirm v-if="data.SecurityHelpFeatureGroup.CreatedBy"
|
||||
title="确定是否取消修改?" ok-text="是" cancel-text="否" @confirm="onCancel">
|
||||
<a-button type="primary" ghost :icon="h(UndoOutlined)">取消</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button v-if="!data.SecurityHelpFeatureGroup.CreatedBy" type="primary" ghost
|
||||
:icon="h(UndoOutlined)" @click.prevent="onCancel">取消</a-button>
|
||||
<a-button type="primary" ghost :icon="h(SaveOutlined)"
|
||||
@click.prevent="onSave">保存</a-button>
|
||||
</a-space>
|
||||
</a-row>
|
||||
<a-row v-else :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!hasData" @click.prevent="onAmend">修改</a-button>
|
||||
<a-popconfirm :disabled="!hasData" title="确定是否删除这组功能点?" ok-text="是"
|
||||
cancel-text="否" @confirm="onDelete">
|
||||
<a-button type="primary" danger :icon="h(DeleteOutlined)"
|
||||
:disabled="!hasData" v-if="canDelete">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<dragModal v-model:open="modelOption.isModalHelpFunction" title="功能点查询" @cancel="handleCance"
|
||||
:fullscreen="width < 640" :mask-closable="false" @ok="handleSelect">
|
||||
<SecurityHelpFeatureEnquiry ref="enquiry" @on-row-dblclick="handleSelect"></SecurityHelpFeatureEnquiry>
|
||||
</dragModal>
|
||||
</a-spin>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, unref, onBeforeMount, inject, provide, h, onMounted } from "vue";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import {
|
||||
DeleteOutlined, EditOutlined, ClearOutlined, FileSearchOutlined, FileAddOutlined, UndoOutlined,
|
||||
SaveOutlined, PlusSquareTwoTone, DownSquareTwoTone, UpSquareTwoTone, AppstoreOutlined
|
||||
} from "@ant-design/icons-vue";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import dragModal from "@/components/basic/DragModal.vue"
|
||||
import SecurityHelpFeatureEnquiry from "./SecurityHelpFeatureEnquiry.vue";
|
||||
import { SecurityHelpFeatureData } from "@/data/auto/securityHelpFeatureData";
|
||||
import { SecurityHelpFeatureEntity } from "@/data/auto/securityHelpFeatureEntity";
|
||||
import { SecurityHelpFeatureGroupEntity } from "@/data/auto/securityHelpFeatureGroupEntity";
|
||||
import securityHelpFunctionService from "@/service/security/securityHelpFunctionService";
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { OperationToEnquiryModelOption, operationToEnquiryMethodKey } from "@/injections"
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const { width, height } = useWindowSize()
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const groupCode = ref<string>(route.params.id as string)
|
||||
const mode = ref<string>(route.params.mode as string)
|
||||
|
||||
const isEdit = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
|
||||
const data = ref<SecurityHelpFeatureData>(new SecurityHelpFeatureData());
|
||||
const hasData = ref<boolean>(false);
|
||||
|
||||
const resultH = ref('');
|
||||
const oldGroupCode = ref<string>(groupCode.value);
|
||||
|
||||
/** 功能点组,弹窗选中的是功能点,需要它把组主键翻译成组编码 */
|
||||
const groups = ref<SecurityHelpFeatureGroupEntity[]>([]);
|
||||
|
||||
interface HelpFeatureEnquiry {
|
||||
keys: SecurityHelpFeatureEntity[],
|
||||
setBindOptionValue(bindValue: string, value: string, value1: string, values: string[]): void,
|
||||
}
|
||||
const enquiry = ref<HelpFeatureEnquiry | null>(null)
|
||||
|
||||
//================provide================
|
||||
const modelOption = ref<OperationToEnquiryModelOption>(new OperationToEnquiryModelOption());
|
||||
modelOption.value.isModalHelpFunction = false;
|
||||
|
||||
const getOperationToEnquiryModelOption = () => {
|
||||
return modelOption.value
|
||||
}
|
||||
provide(
|
||||
operationToEnquiryMethodKey,
|
||||
{
|
||||
getOperationToEnquiryModelOption,
|
||||
}
|
||||
);
|
||||
//================provide================
|
||||
|
||||
onBeforeMount(async () => {
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
computResultTableHeight();
|
||||
|
||||
try {
|
||||
const all = await securityHelpFunctionService.FindAll();
|
||||
groups.value = all.SecurityHelpFeatureGroups ?? [];
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
if (groupCode.value && groupCode.value.trim().length > 0) {
|
||||
await onSearch();
|
||||
}
|
||||
if (mode.value && mode.value == 'create') {
|
||||
onCreate();
|
||||
isEdit.value = true;
|
||||
}
|
||||
else if (mode.value && mode.value == 'amend') {
|
||||
isEdit.value = true;
|
||||
}
|
||||
})
|
||||
|
||||
const computResultTableHeight = () => {
|
||||
resultH.value = width.value > 640 ? 'calc(100vh - 220px)' : 'calc(100vh - 250px)';
|
||||
}
|
||||
|
||||
const onModalSearch = (() => {
|
||||
modelOption.value.isModalHelpFunction = true;
|
||||
})
|
||||
|
||||
const onSearch = (async () => {
|
||||
|
||||
if (!groupCode.value || groupCode.value.trim().length == 0) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '请输入组编码',
|
||||
placement: "topRight",
|
||||
});
|
||||
hasData.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
data.value = await securityHelpFunctionService.FindByGroupCode(groupCode.value.trim());
|
||||
|
||||
if (!data.value.SecurityHelpFeatureGroup || !data.value.SecurityHelpFeatureGroup.GroupCode) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '记录不存在',
|
||||
placement: "topRight",
|
||||
});
|
||||
data.value = new SecurityHelpFeatureData();
|
||||
hasData.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.value.SecurityHelpFeatures) data.value.SecurityHelpFeatures = [];
|
||||
|
||||
hasData.value = true;
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
data.value = new SecurityHelpFeatureData();
|
||||
data.value.SecurityHelpFeatures = [];
|
||||
groupCode.value = '';
|
||||
hasData.value = false;
|
||||
})
|
||||
|
||||
const onCreate = (() => {
|
||||
onReset();
|
||||
isEdit.value = true;
|
||||
})
|
||||
|
||||
const onAmend = (() => {
|
||||
isEdit.value = true;
|
||||
oldGroupCode.value = unref(data.value.SecurityHelpFeatureGroup.GroupCode);
|
||||
})
|
||||
|
||||
const onSave = (async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
|
||||
if (!data.value.SecurityHelpFeatureGroup.GroupCode) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '请输入组编码',
|
||||
placement: "topRight",
|
||||
});
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 组内顺序按界面顺序重排
|
||||
(data.value.SecurityHelpFeatures ?? []).forEach((f, i) => f.SortNo = i + 1);
|
||||
(data.value.SecurityHelpFeatures ?? []).forEach((f) => {
|
||||
f.HelpFeatureGroupId = data.value.SecurityHelpFeatureGroup.HelpFeatureGroupId;
|
||||
});
|
||||
|
||||
data.value = await securityHelpFunctionService.SaveFeatureGroup(data.value);
|
||||
|
||||
groupCode.value = data.value.SecurityHelpFeatureGroup.GroupCode;
|
||||
|
||||
loading.value = false;
|
||||
hasData.value = true;
|
||||
isEdit.value = false;
|
||||
|
||||
} catch (error) {
|
||||
loading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
|
||||
const onCancel = (() => {
|
||||
onReset();
|
||||
if (oldGroupCode.value && oldGroupCode.value.length > 0) {
|
||||
groupCode.value = oldGroupCode.value;
|
||||
onSearch();
|
||||
}
|
||||
isEdit.value = false;
|
||||
})
|
||||
|
||||
const onDelete = (async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
|
||||
await securityHelpFunctionService.DeleteByGroupCode(data.value.SecurityHelpFeatureGroup.GroupCode);
|
||||
|
||||
onReset();
|
||||
loading.value = false;
|
||||
|
||||
} catch (error) {
|
||||
loading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
|
||||
//==================== 组内功能点操作 ====================
|
||||
const addFeature = (() => {
|
||||
if (!data.value.SecurityHelpFeatures) data.value.SecurityHelpFeatures = [];
|
||||
let feature: SecurityHelpFeatureEntity = new SecurityHelpFeatureEntity();
|
||||
feature.SortNo = data.value.SecurityHelpFeatures.length + 1;
|
||||
data.value.SecurityHelpFeatures.push(feature);
|
||||
})
|
||||
|
||||
const deleteFeature = ((index: number) => {
|
||||
data.value.SecurityHelpFeatures.splice(index, 1);
|
||||
})
|
||||
|
||||
const swap = ((arr: any[], index: number, offset: number) => {
|
||||
const target = index + offset;
|
||||
if (target < 0 || target >= arr.length) return;
|
||||
const item = arr.splice(index, 1)[0];
|
||||
arr.splice(target, 0, item);
|
||||
})
|
||||
|
||||
const upFeature = ((index: number) => swap(data.value.SecurityHelpFeatures, index, -1))
|
||||
const downFeature = ((index: number) => swap(data.value.SecurityHelpFeatures, index, 1))
|
||||
|
||||
const handleCance = (async () => {
|
||||
|
||||
})
|
||||
|
||||
/** 弹窗里选中的是功能点,要换算成它所属组的编码再查询 */
|
||||
const handleSelect = (async () => {
|
||||
if (enquiry.value) {
|
||||
if (enquiry.value.keys.length > 0) {
|
||||
const record = enquiry.value.keys[0];
|
||||
const g = groups.value.find(x => x.HelpFeatureGroupId == record.HelpFeatureGroupId);
|
||||
groupCode.value = g ? g.GroupCode : "";
|
||||
await onSearch();
|
||||
modelOption.value.isModalHelpFunction = false;
|
||||
}
|
||||
else {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '请选择一条记录',
|
||||
placement: "topRight",
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<search-card @on-submit="onSubmit" @on-reset="onReset" @use-pagination="onPagination" :is-modal="isModal"
|
||||
:loading="loading" :pagination="result" :rowSelectionType="selectionType"
|
||||
:card-title-keys="[SecurityHelpFunctionEntity.FUNCTION_NAME]" @on-row-dblclick="onRowDblclick"
|
||||
@on-select-change="onSelectChange">
|
||||
<template #control>
|
||||
<a-button type="primary" v-if="canCreate && !isModal" :icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate">新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === SecurityHelpFunctionEntity.ENABLED_INDC">
|
||||
<span v-if="record.EnabledIndc == 'Y'">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div v-if="!isModal" class="page-footer">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length == 1)" @click.prevent="onView">查看</a-button>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!(keys && keys.length == 1)" @click.prevent="onAmend">修改</a-button>
|
||||
<a-popconfirm title="确定是否删除这条记录?" ok-text="是" cancel-text="否" @confirm="onDelete">
|
||||
<a-button type="primary" danger :icon="h(DeleteOutlined)" v-if="canDelete"
|
||||
:disabled="!(keys && keys.length > 0)">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
</search-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, inject, onMounted, ref, unref, provide, h } from "vue";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import searchCard from "@/components/basic/SearchCard.vue";
|
||||
import { DeleteOutlined, EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue";
|
||||
|
||||
import { SecurityHelpFunctionResultData } from "@/data/auto/securityHelpFunctionResultData";
|
||||
import { SecurityHelpFunctionEntity } from "@/data/auto/securityHelpFunctionEntity";
|
||||
import { SearchFilter } from "@/data/auto/searchFilter"
|
||||
import securityHelpFunctionService from "@/service/security/securityHelpFunctionService";
|
||||
import { SecurityHelpFunctionSearchCriteria } from "@/data/auto/securityHelpFunctionSearchCriteria";
|
||||
|
||||
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { useBindOption } from "@/hooks/useBindOption";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy"
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy"
|
||||
import { OperationToEnquiryModelOption, operationToEnquiryMethodKey, enquiryMethodKey, searchCriteriaManagerKey } from "@/injections";
|
||||
import { useOrderedChildren } from "@/hooks/use-ordered-children";
|
||||
import { SearchCriteriaContext } from "@/injections";
|
||||
|
||||
//================inject================
|
||||
const operationMethod = inject(operationToEnquiryMethodKey, undefined);
|
||||
const modelOption = operationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
|
||||
|
||||
const isModal = ref(modelOption ? !!modelOption.isModalHelpFunction : false);
|
||||
const selectionType = modelOption ? modelOption.selectionTypeHelpFunction ?? 'radio' : 'checkbox';
|
||||
const initBindOptions = ref((modelOption ? modelOption.initBindOptionsHelpFunction : []) as BindOption[]);
|
||||
//================inject================
|
||||
|
||||
const emit = defineEmits(['onRowDblclick']);
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const canView = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
width: '5%',
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
sequence: 0,
|
||||
hidden: 'N',
|
||||
format: ''
|
||||
},
|
||||
{
|
||||
title: "功能名称",
|
||||
dataIndex: SecurityHelpFunctionEntity.FUNCTION_NAME,
|
||||
sorter: true,
|
||||
width: '20%',
|
||||
sequence: 1,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "功能说明",
|
||||
dataIndex: SecurityHelpFunctionEntity.INTRO,
|
||||
sorter: true,
|
||||
width: '45%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "启用?",
|
||||
dataIndex: SecurityHelpFunctionEntity.ENABLED_INDC,
|
||||
sorter: true,
|
||||
width: '10%',
|
||||
sequence: 3,
|
||||
hidden: 'N'
|
||||
},
|
||||
]);
|
||||
|
||||
const viewOption = {
|
||||
Value: 'default',
|
||||
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: 'default', BindColumn: columns }]
|
||||
};
|
||||
|
||||
const bindOptions = ref<BindOption[]>([]);
|
||||
|
||||
const datas = ref<SecurityHelpFunctionEntity[]>([]);
|
||||
const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 });
|
||||
const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
|
||||
|
||||
const data = ref<SecurityHelpFunctionResultData>(new SecurityHelpFunctionResultData());
|
||||
|
||||
const isSearched = ref<boolean>(false);
|
||||
const currentSearchCriteria = ref<SecurityHelpFunctionSearchCriteria>(new SecurityHelpFunctionSearchCriteria());
|
||||
|
||||
const keys = ref<SecurityHelpFunctionEntity[]>([]);
|
||||
|
||||
const {
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
} = useOrderedChildren<SearchCriteriaContext>();
|
||||
|
||||
//================provide================
|
||||
provide(enquiryMethodKey, {
|
||||
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; },
|
||||
getBindOptions: () => { return unref(bindOptions); },
|
||||
getViewOption: () => { return unref(viewOption); },
|
||||
getDatas: () => { return datas; },
|
||||
});
|
||||
|
||||
provide(
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
})
|
||||
);
|
||||
//================provide================
|
||||
|
||||
defineExpose({
|
||||
keys,
|
||||
initBindOptions,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
initBindOption();
|
||||
onSearch();
|
||||
})
|
||||
|
||||
const onSelectChange = ((selected: SecurityHelpFunctionEntity[]) => {
|
||||
keys.value = selected;
|
||||
})
|
||||
|
||||
const onRowDblclick = ((e: any, record: SecurityHelpFunctionEntity) => {
|
||||
if (isModal.value) {
|
||||
emit('onRowDblclick', record);
|
||||
}
|
||||
else {
|
||||
router.push({ name: "SecurityHelpFunctionOperation", params: { id: record.FunctionName, mode: 'view' } });
|
||||
}
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
})
|
||||
|
||||
const onView = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "SecurityHelpFunctionOperation", params: { id: keys.value[0].FunctionName, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onCreate = (() => {
|
||||
router.push({ name: "SecurityHelpFunctionOperation", params: { id: '', mode: 'create' } });
|
||||
})
|
||||
|
||||
const onAmend = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "SecurityHelpFunctionOperation", params: { id: keys.value[0].FunctionName, mode: 'amend' } });
|
||||
})
|
||||
|
||||
const onDelete = (async () => {
|
||||
for (let i = 0; i < keys.value.length; i++) {
|
||||
await securityHelpFunctionService.DeleteByFunctionName(keys.value[i].FunctionName);
|
||||
}
|
||||
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '记录删除成功',
|
||||
placement: "topRight",
|
||||
});
|
||||
onReload();
|
||||
})
|
||||
|
||||
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
})
|
||||
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(SecurityHelpFunctionEntity.DB_FUNCTION_NAME, '功能名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
bindOption = ubo.getBindOption(SecurityHelpFunctionEntity.DB_INTRO, '功能说明', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
initBindOptions.value.forEach(element => {
|
||||
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled);
|
||||
});
|
||||
})
|
||||
|
||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
result.value.Page = pagingParams.value.page ?? 1;
|
||||
result.value.Limit = pagingParams.value.pageSize;
|
||||
|
||||
const onSubmit = (async (filters: SearchFilter[]) => {
|
||||
|
||||
let c: SecurityHelpFunctionSearchCriteria = new SecurityHelpFunctionSearchCriteria();
|
||||
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
})
|
||||
|
||||
const onSearch = (async () => {
|
||||
onSubmit(items.value[0].getFilter());
|
||||
})
|
||||
|
||||
const findBySearchCriteria = (async (c: SecurityHelpFunctionSearchCriteria) => {
|
||||
try {
|
||||
data.value = await securityHelpFunctionService.FindBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Datas;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
|
||||
const onPagination = (async (params: PagingParams) => {
|
||||
|
||||
if (!isSearched.value) return;
|
||||
let c: SecurityHelpFunctionSearchCriteria = new SecurityHelpFunctionSearchCriteria();
|
||||
|
||||
c.Filter = items.value[0].getFilter();
|
||||
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField)
|
||||
c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
});
|
||||
|
||||
const onReload = (async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
})
|
||||
//table end-----------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@@ -0,0 +1,515 @@
|
||||
<template>
|
||||
<a-spin size="large" :spinning="loading">
|
||||
<div class="page-container">
|
||||
<div class="page-header">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-col :lg="8" :sm="24">
|
||||
<a-row :wrap="false">
|
||||
<a-col flex="none">
|
||||
<div style="padding: 0 "><a-input flex="none" readonly value="功能名称"
|
||||
class="site-input-split" style="width: 160px;border-radius:0; border-top-left-radius: 5pt 5pt;
|
||||
border-bottom-left-radius: 5pt 5pt;
|
||||
pointer-events: none" /></div>
|
||||
</a-col>
|
||||
<a-col flex="auto">
|
||||
<a-input-search :disabled="isEdit" v-model:value="functionName" flex="auto"
|
||||
@search="onModalSearch" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
<a-col :lg="12" :sm="24">
|
||||
<a-space>
|
||||
<a-button type="primary" :disabled="isEdit" :icon="h(FileSearchOutlined)"
|
||||
@click.prevent="onSearch">查询</a-button>
|
||||
<a-button type="primary" :disabled="isEdit" :icon="h(ClearOutlined)"
|
||||
@click.prevent="onReset">重置</a-button>
|
||||
<a-button type="primary" :disabled="isEdit" :icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate">新增</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<div class="page-main ft-page" :class="{ 'ft-readonly': !isEdit }" :style="{ height: resultH }">
|
||||
<!-- 顶部信息卡 -->
|
||||
<div class="ft-hero">
|
||||
<div class="ft-hero-icon">
|
||||
<AppstoreOutlined />
|
||||
</div>
|
||||
<div class="ft-hero-main">
|
||||
<div class="ft-hero-name">
|
||||
{{ data.SecurityHelpFunction.FunctionName || "未选择功能" }}
|
||||
</div>
|
||||
<div class="ft-hero-meta">
|
||||
<span class="ft-chip">编号 {{ data.SecurityHelpFunction.HelpFunctionId || "-" }}</span>
|
||||
<span v-if="data.SecurityHelpFunction.EnabledIndc == 'Y'" class="ft-chip">启用</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 帮助信息 -->
|
||||
<div class="ft-card">
|
||||
<div class="ft-card-title">帮助信息</div>
|
||||
<div class="ft-grid">
|
||||
<div class="ft-field">
|
||||
<div class="ft-label">功能名称<span class="ft-required">*</span></div>
|
||||
<a-select v-if="isEdit && !data.SecurityHelpFunction.CreatedBy" size="large"
|
||||
style="width: 100%" show-search placeholder="请选择要给哪个功能写帮助"
|
||||
v-model:value="data.SecurityHelpFunction.FunctionName"
|
||||
:options="functionNameOptions" :filter-option="filterOption" />
|
||||
<a-input v-else size="large" readonly
|
||||
v-model:value="data.SecurityHelpFunction.FunctionName" />
|
||||
</div>
|
||||
<div class="ft-field">
|
||||
<div class="ft-label">启用?</div>
|
||||
<a-select size="large" style="width: 100%" placeholder="请选择"
|
||||
v-model:value="data.SecurityHelpFunction.EnabledIndc" :disabled="!isEdit">
|
||||
<a-select-option v-for="o in yesNoPolicy" :value="o.BindValue">{{
|
||||
o.DisplayName }}</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
<div class="ft-field ft-field-full">
|
||||
<div class="ft-label">功能说明</div>
|
||||
<a-textarea :auto-size="{ minRows: 3, maxRows: 10 }" :maxlength="1000"
|
||||
placeholder="一句话说明这个功能是什么" :readonly="!isEdit"
|
||||
v-model:value="data.SecurityHelpFunction.Intro" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 明细 -->
|
||||
<div class="ft-card">
|
||||
<a-collapse v-model:activeKey="activeKey" class="ft-collapse">
|
||||
<!-- 操作步骤 -->
|
||||
<a-collapse-panel key="1" header="操作步骤">
|
||||
<div class="ft-list">
|
||||
<div v-for="(record, index) in data.SecurityHelpSteps" :key="index" class="ft-item">
|
||||
<div class="ft-item-head">
|
||||
<span class="ft-item-index">{{ index + 1 }}</span>
|
||||
<div class="ft-item-title">
|
||||
<span class="ft-item-name">
|
||||
{{ record.Title || "未填写步骤标题" }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="isEdit" class="ft-item-actions">
|
||||
<UpSquareTwoTone class="ft-action" @click="upStep(index)" />
|
||||
<DownSquareTwoTone class="ft-action" @click="downStep(index)" />
|
||||
<DeleteOutlined class="ft-action ft-action-delete"
|
||||
@click="deleteStep(index)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ft-item-body">
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">标题</span>
|
||||
<a-input v-if="isEdit" size="large" v-model:value="record.Title"
|
||||
placeholder="这一步先做什么" />
|
||||
<span v-else class="ft-item-text">{{ record.Title || "-" }}</span>
|
||||
</div>
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">说明</span>
|
||||
<a-textarea v-if="isEdit" :auto-size="{ minRows: 2, maxRows: 6 }"
|
||||
v-model:value="record.Description" placeholder="这一步具体怎么做" />
|
||||
<span v-else class="ft-item-text">{{ record.Description || "-" }}</span>
|
||||
</div>
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">提示</span>
|
||||
<a-input v-if="isEdit" size="large" v-model:value="record.Tips"
|
||||
placeholder="补充说明,可留空" />
|
||||
<span v-else class="ft-item-text">{{ record.Tips || "-" }}</span>
|
||||
</div>
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">图标</span>
|
||||
<a-input v-if="isEdit" size="large" v-model:value="record.Icon"
|
||||
placeholder="页面上的图标名,如 DeleteOutlined" />
|
||||
<span v-else class="ft-item-text">{{ record.Icon || "-" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!data.SecurityHelpSteps || !data.SecurityHelpSteps.length" class="ft-empty">
|
||||
暂无操作步骤
|
||||
</div>
|
||||
<a-button class="ft-add-btn" type="dashed" block v-if="isEdit" @click="addStep">
|
||||
<PlusSquareTwoTone /> 新增步骤
|
||||
</a-button>
|
||||
</div>
|
||||
</a-collapse-panel>
|
||||
|
||||
<!-- 引用的功能点组 -->
|
||||
<a-collapse-panel key="2" header="引用的功能点组">
|
||||
<div class="ft-list">
|
||||
<div v-for="(record, index) in data.SecurityHelpFunctionFeatures" :key="index"
|
||||
class="ft-item">
|
||||
<div class="ft-item-head">
|
||||
<span class="ft-item-index">{{ index + 1 }}</span>
|
||||
<div class="ft-item-title">
|
||||
<span class="ft-item-name">
|
||||
{{ groupNameOf(record.GroupCode) }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="isEdit" class="ft-item-actions">
|
||||
<UpSquareTwoTone class="ft-action" @click="upFeature(index)" />
|
||||
<DownSquareTwoTone class="ft-action" @click="downFeature(index)" />
|
||||
<DeleteOutlined class="ft-action ft-action-delete"
|
||||
@click="deleteFeature(index)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ft-item-body">
|
||||
<div class="ft-item-field">
|
||||
<span class="ft-item-label">功能点组</span>
|
||||
<a-select v-if="isEdit" size="large" style="width: 100%" show-search
|
||||
placeholder="请选择要引用哪一组功能点" v-model:value="record.GroupCode"
|
||||
:options="groupOptions" :filter-option="filterOption" />
|
||||
<span v-else class="ft-item-text">{{ record.GroupCode || "-" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!data.SecurityHelpFunctionFeatures || !data.SecurityHelpFunctionFeatures.length"
|
||||
class="ft-empty">
|
||||
暂未引用功能点组
|
||||
</div>
|
||||
<a-button class="ft-add-btn" type="dashed" block v-if="isEdit" @click="addFeature">
|
||||
<PlusSquareTwoTone /> 引用功能点组
|
||||
</a-button>
|
||||
</div>
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-footer">
|
||||
<div style="">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<div>
|
||||
<a-row v-if="isEdit" :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-popconfirm v-if="data.SecurityHelpFunction.CreatedBy" title="确定是否取消修改?"
|
||||
ok-text="是" cancel-text="否" @confirm="onCancel">
|
||||
<a-button type="primary" ghost :icon="h(UndoOutlined)">取消</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button v-if="!data.SecurityHelpFunction.CreatedBy" type="primary" ghost
|
||||
:icon="h(UndoOutlined)" @click.prevent="onCancel">取消</a-button>
|
||||
<a-button type="primary" ghost :icon="h(SaveOutlined)"
|
||||
@click.prevent="onSave">保存</a-button>
|
||||
</a-space>
|
||||
</a-row>
|
||||
<a-row v-else :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!hasData" @click.prevent="onAmend">修改</a-button>
|
||||
<a-popconfirm :disabled="!hasData" title="确定是否删除这条记录?" ok-text="是"
|
||||
cancel-text="否" @confirm="onDelete">
|
||||
<a-button type="primary" danger :icon="h(DeleteOutlined)"
|
||||
:disabled="!hasData" v-if="canDelete">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<dragModal v-model:open="modelOption.isModalHelpFunction" title="帮助功能查询" @cancel="handleCance"
|
||||
:fullscreen="width < 640" :mask-closable="false" @ok="handleSelect">
|
||||
<SecurityHelpFunctionEnquiry ref="enquiry" @on-row-dblclick="handleSelect"></SecurityHelpFunctionEnquiry>
|
||||
</dragModal>
|
||||
</a-spin>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, unref, onBeforeMount, inject, provide, h, onMounted, computed } from "vue";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import {
|
||||
DeleteOutlined, EditOutlined, ClearOutlined, FileSearchOutlined, FileAddOutlined, UndoOutlined,
|
||||
SaveOutlined, PlusSquareTwoTone, DownSquareTwoTone, UpSquareTwoTone, AppstoreOutlined
|
||||
} from "@ant-design/icons-vue";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import dragModal from "@/components/basic/DragModal.vue"
|
||||
import SecurityHelpFunctionEnquiry from "./SecurityHelpFunctionEnquiry.vue";
|
||||
import { SecurityHelpFunctionData } from "@/data/auto/securityHelpFunctionData";
|
||||
import { SecurityHelpStepEntity } from "@/data/auto/securityHelpStepEntity";
|
||||
import { SecurityHelpFunctionFeatureEntity } from "@/data/auto/securityHelpFunctionFeatureEntity";
|
||||
import { SecurityHelpFeatureGroupEntity } from "@/data/auto/securityHelpFeatureGroupEntity";
|
||||
import { SecurityFunctionDisplayData } from "@/data/auto/securityFunctionDisplayData";
|
||||
import securityHelpFunctionService from "@/service/security/securityHelpFunctionService";
|
||||
import { useYesNoPolicy } from "@/hooks/useYesNoPolicy"
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { OperationToEnquiryModelOption, operationToEnquiryMethodKey } from "@/injections"
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const { width, height } = useWindowSize()
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const functionName = ref<string>(route.params.id as string)
|
||||
const mode = ref<string>(route.params.mode as string)
|
||||
|
||||
const isEdit = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
|
||||
const data = ref<SecurityHelpFunctionData>(new SecurityHelpFunctionData());
|
||||
const hasData = ref<boolean>(false);
|
||||
|
||||
const yesNoPolicy = ref<SelectOption[]>([]);
|
||||
const resultH = ref('');
|
||||
const oldFunctionName = ref<string>(functionName.value);
|
||||
|
||||
const activeKey = ref(['1', '2']);
|
||||
|
||||
/** 可引用的功能点组(整块表取回来做下拉) */
|
||||
const groups = ref<SecurityHelpFeatureGroupEntity[]>([]);
|
||||
const groupOptions = computed(() => groups.value.map(g => ({
|
||||
value: g.GroupCode,
|
||||
label: `${g.GroupCode}${g.GroupName ? "(" + g.GroupName + ")" : ""}`
|
||||
})));
|
||||
|
||||
/** 新增时供选择的「给哪个功能写帮助」 */
|
||||
const functionOptions = ref<SecurityFunctionDisplayData[]>([]);
|
||||
const functionNameOptions = computed(() => functionOptions.value.map(f => ({
|
||||
value: f.FunctionName,
|
||||
label: `${f.FunctionLocalName || f.FunctionName}(${f.FunctionName})`
|
||||
})));
|
||||
|
||||
const groupNameOf = (groupCode?: string) => {
|
||||
if (!groupCode) return "未选择功能点组";
|
||||
const g = groups.value.find(x => x.GroupCode == groupCode);
|
||||
return g ? `${g.GroupCode}${g.GroupName ? "(" + g.GroupName + ")" : ""}` : groupCode;
|
||||
};
|
||||
|
||||
const filterOption = (input: string, option: any) =>
|
||||
String(option.label ?? "").toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
|
||||
interface HelpFunctionEnquiry {
|
||||
keys: SecurityHelpFunctionData[],
|
||||
setBindOptionValue(bindValue: string, value: string, value1: string, values: string[]): void,
|
||||
}
|
||||
const enquiry = ref<HelpFunctionEnquiry | null>(null)
|
||||
|
||||
//================provide================
|
||||
const modelOption = ref<OperationToEnquiryModelOption>(new OperationToEnquiryModelOption());
|
||||
modelOption.value.isModalHelpFunction = false;
|
||||
|
||||
const getOperationToEnquiryModelOption = () => {
|
||||
return modelOption.value
|
||||
}
|
||||
provide(
|
||||
operationToEnquiryMethodKey,
|
||||
{
|
||||
getOperationToEnquiryModelOption,
|
||||
}
|
||||
);
|
||||
//================provide================
|
||||
|
||||
onBeforeMount(async () => {
|
||||
yesNoPolicy.value = await useYesNoPolicy().getSelectOption(false);
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
computResultTableHeight();
|
||||
|
||||
// 下拉数据:功能点组 + 可选功能名
|
||||
try {
|
||||
const all = await securityHelpFunctionService.FindAll();
|
||||
groups.value = all.SecurityHelpFeatureGroups ?? [];
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
try {
|
||||
functionOptions.value = await securityHelpFunctionService.FindFunctionNameOptions();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
if (functionName.value && functionName.value.trim().length > 0) {
|
||||
await onSearch();
|
||||
}
|
||||
if (mode.value && mode.value == 'create') {
|
||||
onCreate();
|
||||
isEdit.value = true;
|
||||
}
|
||||
else if (mode.value && mode.value == 'amend') {
|
||||
isEdit.value = true;
|
||||
}
|
||||
})
|
||||
|
||||
const computResultTableHeight = () => {
|
||||
resultH.value = width.value > 640 ? 'calc(100vh - 220px)' : 'calc(100vh - 250px)';
|
||||
}
|
||||
|
||||
const onModalSearch = (() => {
|
||||
modelOption.value.isModalHelpFunction = true;
|
||||
})
|
||||
|
||||
const onSearch = (async () => {
|
||||
|
||||
if (!functionName.value || functionName.value.trim().length == 0) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '请输入功能名称',
|
||||
placement: "topRight",
|
||||
});
|
||||
hasData.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
data.value = await securityHelpFunctionService.FindByFunctionName(functionName.value.trim());
|
||||
|
||||
if (!data.value.SecurityHelpFunction || !data.value.SecurityHelpFunction.FunctionName) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '记录不存在',
|
||||
placement: "topRight",
|
||||
});
|
||||
data.value = new SecurityHelpFunctionData();
|
||||
hasData.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 后端未返回时也要保证明细是数组,避免模板报错
|
||||
if (!data.value.SecurityHelpSteps) data.value.SecurityHelpSteps = [];
|
||||
if (!data.value.SecurityHelpFunctionFeatures) data.value.SecurityHelpFunctionFeatures = [];
|
||||
|
||||
hasData.value = true;
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
data.value = new SecurityHelpFunctionData();
|
||||
data.value.SecurityHelpSteps = [];
|
||||
data.value.SecurityHelpFunctionFeatures = [];
|
||||
functionName.value = '';
|
||||
hasData.value = false;
|
||||
})
|
||||
|
||||
const onCreate = (() => {
|
||||
onReset();
|
||||
data.value.SecurityHelpFunction.EnabledIndc = 'Y';
|
||||
isEdit.value = true;
|
||||
})
|
||||
|
||||
const onAmend = (() => {
|
||||
isEdit.value = true;
|
||||
oldFunctionName.value = unref(data.value.SecurityHelpFunction.FunctionName);
|
||||
})
|
||||
|
||||
const onSave = (async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
|
||||
if (!data.value.SecurityHelpFunction.FunctionName) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '请选择功能名称',
|
||||
placement: "topRight",
|
||||
});
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 明细序号按界面顺序重排,顺序即显示顺序
|
||||
(data.value.SecurityHelpSteps ?? []).forEach((s, i) => s.StepNo = i + 1);
|
||||
(data.value.SecurityHelpFunctionFeatures ?? []).forEach((f, i) => f.SortNo = i + 1);
|
||||
|
||||
data.value = await securityHelpFunctionService.SaveFunction(data.value);
|
||||
|
||||
functionName.value = data.value.SecurityHelpFunction.FunctionName;
|
||||
|
||||
loading.value = false;
|
||||
hasData.value = true;
|
||||
isEdit.value = false;
|
||||
|
||||
} catch (error) {
|
||||
loading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
|
||||
const onCancel = (() => {
|
||||
onReset();
|
||||
if (oldFunctionName.value && oldFunctionName.value.length > 0) {
|
||||
functionName.value = oldFunctionName.value;
|
||||
onSearch();
|
||||
}
|
||||
isEdit.value = false;
|
||||
})
|
||||
|
||||
const onDelete = (async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
|
||||
await securityHelpFunctionService.DeleteByFunctionName(data.value.SecurityHelpFunction.FunctionName);
|
||||
|
||||
onReset();
|
||||
loading.value = false;
|
||||
|
||||
} catch (error) {
|
||||
loading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
|
||||
//==================== 步骤明细操作 ====================
|
||||
const addStep = (() => {
|
||||
if (!data.value.SecurityHelpSteps) data.value.SecurityHelpSteps = [];
|
||||
let step: SecurityHelpStepEntity = new SecurityHelpStepEntity();
|
||||
step.StepNo = data.value.SecurityHelpSteps.length + 1;
|
||||
data.value.SecurityHelpSteps.push(step);
|
||||
})
|
||||
|
||||
const deleteStep = ((index: number) => {
|
||||
data.value.SecurityHelpSteps.splice(index, 1);
|
||||
})
|
||||
|
||||
const swap = ((arr: any[], index: number, offset: number) => {
|
||||
const target = index + offset;
|
||||
if (target < 0 || target >= arr.length) return;
|
||||
const item = arr.splice(index, 1)[0];
|
||||
arr.splice(target, 0, item);
|
||||
})
|
||||
|
||||
const upStep = ((index: number) => swap(data.value.SecurityHelpSteps, index, -1))
|
||||
const downStep = ((index: number) => swap(data.value.SecurityHelpSteps, index, 1))
|
||||
|
||||
//==================== 引用的功能点组操作 ====================
|
||||
const addFeature = (() => {
|
||||
if (!data.value.SecurityHelpFunctionFeatures) data.value.SecurityHelpFunctionFeatures = [];
|
||||
let feature: SecurityHelpFunctionFeatureEntity = new SecurityHelpFunctionFeatureEntity();
|
||||
feature.FunctionName = data.value.SecurityHelpFunction.FunctionName;
|
||||
feature.SortNo = data.value.SecurityHelpFunctionFeatures.length + 1;
|
||||
data.value.SecurityHelpFunctionFeatures.push(feature);
|
||||
})
|
||||
|
||||
const deleteFeature = ((index: number) => {
|
||||
data.value.SecurityHelpFunctionFeatures.splice(index, 1);
|
||||
})
|
||||
|
||||
const upFeature = ((index: number) => swap(data.value.SecurityHelpFunctionFeatures, index, -1))
|
||||
const downFeature = ((index: number) => swap(data.value.SecurityHelpFunctionFeatures, index, 1))
|
||||
|
||||
const handleCance = (async () => {
|
||||
|
||||
})
|
||||
|
||||
const handleSelect = (async () => {
|
||||
if (enquiry.value) {
|
||||
if (enquiry.value.keys.length > 0) {
|
||||
functionName.value = enquiry.value.keys[0].SecurityHelpFunction.FunctionName;
|
||||
await onSearch();
|
||||
modelOption.value.isModalHelpFunction = false;
|
||||
}
|
||||
else {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '请选择一条记录',
|
||||
placement: "topRight",
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
Reference in new issue
Block a user