ow
This commit is contained in:
1 parent
5d0b0c751a
commit
d2278826fb
6 files changed
+83
-31
No files matched your search
@@ -145,6 +145,13 @@ namespace CloudBuilder.Master.Service
|
||||
|
||||
ObjectCopyHelper.Copy(data.FamilyPerson, d);
|
||||
|
||||
var has = new FamilyTreePermissionHelper(service).HasPermission(d.TreeId, d.PersonId);
|
||||
|
||||
if (!has)
|
||||
{
|
||||
throw new ValidatedException("您没有修改权限.");
|
||||
}
|
||||
|
||||
repository.UpdateNow(d);
|
||||
|
||||
return FindByKey(data.FamilyPerson.PersonId);
|
||||
|
||||
@@ -490,6 +490,13 @@ namespace CloudBuilder.Master.Service
|
||||
|
||||
Validate(data.FamilyTree);
|
||||
|
||||
var has = new FamilyTreePermissionHelper(service).HasPermission(d.TreeId, d.AncestorPersonId);
|
||||
|
||||
if (!has)
|
||||
{
|
||||
throw new ValidatedException("您没有修改权限.");
|
||||
}
|
||||
|
||||
ObjectCopyHelper.Copy(data.FamilyTree, d);
|
||||
|
||||
repository.UpdateNow(d);
|
||||
@@ -517,6 +524,14 @@ namespace CloudBuilder.Master.Service
|
||||
{
|
||||
var ent = repository.DetachedEntities.Where(x => x.TreeId == key).FirstOrDefault()!;
|
||||
if (ent == null) return;
|
||||
|
||||
var has = new FamilyTreePermissionHelper(service).HasPermission(ent.TreeId, ent.AncestorPersonId);
|
||||
|
||||
if(!has)
|
||||
{
|
||||
throw new ValidatedException("您没有删除权限.");
|
||||
}
|
||||
|
||||
repository.DeleteNow(ent);
|
||||
|
||||
IRepository<FamilyPersonEntity> repositoryPerson = repository.GetRepository<IRepository<FamilyPersonEntity>>();
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>C:\inetpub\wwwroot\dockwebapi2</_PublishTargetUrl>
|
||||
<History>True|2026-09-13T11:02:59.5654245Z||;True|2026-09-10T09:14:56.2914193+08:00||;True|2026-09-09T16:40:16.6461154+08:00||;True|2026-09-08T13:55:23.1502435+08:00||;True|2026-09-08T08:04:53.4279263+08:00||;True|2026-09-07T08:48:17.4682304+08:00||;True|2026-09-04T14:39:08.7878670+08:00||;True|2026-09-04T14:35:48.2937877+08:00||;True|2026-09-04T11:45:16.1372876+08:00||;True|2026-09-04T11:42:59.9356436+08:00||;True|2026-09-03T16:05:52.5270232+08:00||;True|2026-09-03T14:52:56.8559144+08:00||;True|2026-09-02T11:08:23.8720038+08:00||;True|2026-09-02T10:58:16.8081797+08:00||;True|2026-08-26T13:34:12.3805892+08:00||;True|2026-08-25T08:31:30.7787234+08:00||;True|2026-08-20T13:10:46.4725468+08:00||;True|2026-08-20T13:10:28.3142576+08:00||;True|2026-08-19T16:10:27.3362887+08:00||;True|2026-08-19T16:01:12.6234971+08:00||;True|2026-08-19T15:42:46.6576265+08:00||;True|2026-08-19T13:39:59.9363522+08:00||;True|2026-08-19T13:36:53.0379313+08:00||;True|2026-08-19T13:31:36.0841398+08:00||;True|2026-08-19T11:44:37.5319626+08:00||;True|2026-08-19T09:36:45.6000047+08:00||;True|2026-08-19T09:34:36.8468631+08:00||;True|2026-08-19T08:35:41.2202300+08:00||;True|2026-08-18T16:20:59.0170916+08:00||;</History>
|
||||
<History>True|2026-09-15T12:44:46.6559899Z||;True|2026-09-13T19:02:59.5654245+08:00||;True|2026-09-10T09:14:56.2914193+08:00||;True|2026-09-09T16:40:16.6461154+08:00||;True|2026-09-08T13:55:23.1502435+08:00||;True|2026-09-08T08:04:53.4279263+08:00||;True|2026-09-07T08:48:17.4682304+08:00||;True|2026-09-04T14:39:08.7878670+08:00||;True|2026-09-04T14:35:48.2937877+08:00||;True|2026-09-04T11:45:16.1372876+08:00||;True|2026-09-04T11:42:59.9356436+08:00||;True|2026-09-03T16:05:52.5270232+08:00||;True|2026-09-03T14:52:56.8559144+08:00||;True|2026-09-02T11:08:23.8720038+08:00||;True|2026-09-02T10:58:16.8081797+08:00||;True|2026-08-26T13:34:12.3805892+08:00||;True|2026-08-25T08:31:30.7787234+08:00||;True|2026-08-20T13:10:46.4725468+08:00||;True|2026-08-20T13:10:28.3142576+08:00||;True|2026-08-19T16:10:27.3362887+08:00||;True|2026-08-19T16:01:12.6234971+08:00||;True|2026-08-19T15:42:46.6576265+08:00||;True|2026-08-19T13:39:59.9363522+08:00||;True|2026-08-19T13:36:53.0379313+08:00||;True|2026-08-19T13:31:36.0841398+08:00||;True|2026-08-19T11:44:37.5319626+08:00||;True|2026-08-19T09:36:45.6000047+08:00||;True|2026-08-19T09:34:36.8468631+08:00||;True|2026-08-19T08:35:41.2202300+08:00||;True|2026-08-18T16:20:59.0170916+08:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -529,6 +529,17 @@ const onSearch = async () => {
|
||||
? dayjs(data.value.FamilyPerson.DeathDate)
|
||||
: null;
|
||||
hasData.value = true;
|
||||
|
||||
// 无权限且未公开(Privacy='N'):强制回到查看模式,只显示基本资料
|
||||
if (readonlyBasicOnly.value && mode.value == "amend") {
|
||||
mode.value = "view";
|
||||
isEdit.value = false;
|
||||
notification.info({
|
||||
message: "系统提示:",
|
||||
description: "该族员资料未公开,您仅有查看基本资料的权限",
|
||||
placement: "topRight",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const onReset = () => {
|
||||
|
||||
@@ -91,7 +91,7 @@ const visible = computed<boolean>({
|
||||
|
||||
const { width } = useWindowSize();
|
||||
const { getPolicyOptionsComputed } = useLocalePolicy();
|
||||
const genderOptions = getPolicyOptionsComputed("GenderPolicy") as SelectOption[];
|
||||
const genderOptions = getPolicyOptionsComputed("GenderPolicy");
|
||||
|
||||
const surnameInputRef = ref<any>(null);
|
||||
const saving = ref<boolean>(false);
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
<span class="ft-item-label">当前?</span>
|
||||
<a-select v-if="isEdit" size="large" style="width: 100%" v-model:value="record.IsCurrent">
|
||||
<a-select-option v-for="o in yesNoPolicy" :value="o.BindValue">{{ o.DisplayName
|
||||
}}</a-select-option>
|
||||
}}</a-select-option>
|
||||
</a-select>
|
||||
<span v-else class="ft-item-text">{{
|
||||
getPolicyText(yesNoPolicy, record.IsCurrent) || "-"
|
||||
@@ -315,8 +315,7 @@
|
||||
</div>
|
||||
<div v-if="data.IsManager && !isEdit" class="ft-item-actions">
|
||||
<CheckCircleTwoTone class="ft-action" @click="approvePermission(record, 'N')" />
|
||||
<CrownOutlined class="ft-action" style="color: #faad14"
|
||||
@click="approvePermission(record, 'Y')" />
|
||||
<CrownOutlined class="ft-action" style="color: #faad14" @click="approvePermission(record, 'Y')" />
|
||||
<CloseCircleOutlined class="ft-action ft-action-delete" @click="rejectPermission(record)" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -730,11 +729,11 @@ onMounted(() => {
|
||||
if (treeId.value && treeId.value.trim().length > 0) {
|
||||
onSearch();
|
||||
}
|
||||
isCreate.value=false;
|
||||
isCreate.value = false;
|
||||
if (mode.value && mode.value == "create") {
|
||||
onCreate();
|
||||
isEdit.value = true;
|
||||
isCreate.value=true;
|
||||
isCreate.value = true;
|
||||
} else if (mode.value && mode.value == "amend") {
|
||||
isEdit.value = true;
|
||||
}
|
||||
@@ -903,33 +902,53 @@ const onChartSelectChild = async (personId: string) => {
|
||||
};
|
||||
|
||||
const onSearch = async () => {
|
||||
if (!treeId.value || treeId.value.trim().length == 0) {
|
||||
notification.info({
|
||||
message: "系统提示:",
|
||||
description: "请输入族谱编号",
|
||||
placement: "topRight",
|
||||
try {
|
||||
loading.value = true;
|
||||
if (!treeId.value || treeId.value.trim().length == 0) {
|
||||
notification.info({
|
||||
message: "系统提示:",
|
||||
description: "请输入族谱编号",
|
||||
placement: "topRight",
|
||||
});
|
||||
hasData.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
data.value = await familyTreeService.FindByCurrentPerson({
|
||||
key: treeId.value.trim(),
|
||||
personId: data.value.CurrentPerson.FamilyPerson.PersonId,
|
||||
});
|
||||
hasData.value = false;
|
||||
return;
|
||||
|
||||
if (data.value.FamilyTree == null) {
|
||||
notification.info({
|
||||
message: "系统提示:",
|
||||
description: "记录不存在",
|
||||
placement: "topRight",
|
||||
});
|
||||
data.value = new FamilyTreeData();
|
||||
hasData.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
hasData.value = true;
|
||||
|
||||
// 无修改权限:强制回到查看模式
|
||||
if (!data.value.IsCanAmend && mode.value == "amend") {
|
||||
mode.value = "view";
|
||||
isEdit.value = false;
|
||||
notification.info({
|
||||
message: "系统提示:",
|
||||
description: "您没有该族谱的修改权限",
|
||||
placement: "topRight",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
loading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
data.value = await familyTreeService.FindByCurrentPerson({
|
||||
key: treeId.value.trim(),
|
||||
personId: data.value.CurrentPerson.FamilyPerson.PersonId,
|
||||
});
|
||||
|
||||
if (data.value.FamilyTree == null) {
|
||||
notification.info({
|
||||
message: "系统提示:",
|
||||
description: "记录不存在",
|
||||
placement: "topRight",
|
||||
});
|
||||
data.value = new FamilyTreeData();
|
||||
hasData.value = false;
|
||||
return;
|
||||
finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
hasData.value = true;
|
||||
};
|
||||
|
||||
const onReset = () => {
|
||||
|
||||
Reference in new issue
Block a user