fangdawei 1 year ago
parent
commit
d90d2a1374
  1. 6
      docs/demo/src/WTA.Application/Identity/Controllers/UserController.cs
  2. 1
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/User.cs
  3. 1
      docs/demo/src/WTA.Shared/Domain/BaseEntity.cs
  4. 11
      docs/demo/src/WTA.Shared/Extensions/JsonSchemaExtensions.cs
  5. 3
      docs/demo/src/WTA/wwwroot/app.js
  6. 1
      docs/demo/src/WTA/wwwroot/assets/icons/loading.svg
  7. 3
      docs/demo/src/WTA/wwwroot/components/form/form-input.js
  8. 5
      docs/demo/src/WTA/wwwroot/components/form/form-item.js
  9. 2
      docs/demo/src/WTA/wwwroot/components/list/index.js
  10. 27
      docs/demo/src/WTA/wwwroot/index.html
  11. BIN
      docs/结算系统概要规格说明(V1.1).docx

6
docs/demo/src/WTA.Application/Identity/Controllers/UserController.cs

@ -19,6 +19,12 @@ public class UserController : GenericController<User, User, User, User, User, Us
this.Repository.DisableTenantFilter();
}
[HttpPost, Display(Name = "密码重置")]
public virtual IActionResult ResetPassword()
{
return null;
}
[HttpPost, Hidden]
public AuthenticateResult Authenticate(string name, string operation)
{

1
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/User.cs

@ -32,5 +32,6 @@ public class User : BaseEntity
public Department? Department { get; set; }
public Post? Post { get; set; }
[UIHint("select")]
public List<UserRole> UserRoles { get; set; } = new List<UserRole>();
}

1
docs/demo/src/WTA.Shared/Domain/BaseEntity.cs

@ -59,5 +59,6 @@ public abstract class BaseEntity : IResource, IBaseEntity, ISoftDeleteEntity, IA
[ScaffoldColumn(false)]
public string? TenantId { get; set; }
[ScaffoldColumn(false)]
public Dictionary<string, string> Properties { get; set; } = new Dictionary<string, string>();
}

11
docs/demo/src/WTA.Shared/Extensions/JsonSchemaExtensions.cs

@ -66,7 +66,8 @@ public static class JsonSchemaExtensions
if (modelType != meta.ElementMetadata!.ModelType.UnderlyingSystemType)
{
schema.Add("type", "array");
//schema.Add("items", meta.ElementMetadata!.ModelType.GetMetadataForType(serviceProvider));
schema.TryAdd("multiple", true);
schema.TryAdd("url", "url");
schema.Add("items", meta.ElementMetadata.GetSchema(serviceProvider, meta));
}
}
@ -184,7 +185,12 @@ public static class JsonSchemaExtensions
var actionContext = new ActionContext { HttpContext = serviceProvider.GetRequiredService<IHttpContextAccessor>().HttpContext! };
var provider = new EmptyModelMetadataProvider();
var modelValidationContextBase = new ModelValidationContextBase(actionContext, meta, new EmptyModelMetadataProvider());
if (pm.IsRequired && !pm.IsNullableValueType && !pm.UnderlyingOrModelType.IsValueType && !pm.Attributes.Attributes.Any(o => o.GetType() == typeof(RequiredAttribute)))
if (pm.IsRequired &&
!pm.IsNullableValueType &&
!pm.UnderlyingOrModelType.IsValueType &&
!pm.IsEnumerableType &&
!pm.Attributes.Attributes.Any(o => o.GetType() == typeof(RequiredAttribute))
)
{
var message = string.Format(CultureInfo.InvariantCulture, localizer.GetString(nameof(RequiredAttribute)).Value, title);
rules.Add(new Dictionary<string, object> { { "required", true }, { "message", message } });
@ -234,7 +240,6 @@ public static class JsonSchemaExtensions
else if (attribute is RequiredAttribute)
{
rule.Add("required", true);
//message = string.Format(CultureInfo.InvariantCulture, localizer.GetString(nameof(RequiredAttribute)).Value, title);
}
else if (attribute is CompareAttribute compare)//??
{

3
docs/demo/src/WTA/wwwroot/app.js

@ -2,7 +2,7 @@ import html from "html";
import { ElConfigProvider } from "element-plus";
import zh from "./lib/element-plus/locale/zh-cn.min.mjs";
import en from "./lib/element-plus/locale/en.min.mjs";
import { Suspense, reactive } from "vue";
import { Suspense, reactive, onMounted } from "vue";
export default {
components: { ElConfigProvider, Suspense },
@ -19,6 +19,7 @@ export default {
["en", en],
])
);
onMounted(() => document.querySelector("#loading.loading").classList.remove("loading"));
return {
localeMap,
};

1
docs/demo/src/WTA/wwwroot/assets/icons/loading.svg

@ -0,0 +1 @@
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg>

After

Width:  |  Height:  |  Size: 856 B

3
docs/demo/src/WTA/wwwroot/components/form/form-input.js

@ -83,6 +83,9 @@ export default {
return schema.input ?? schema.type;
};
/*end*/
// if (props.schema.url && !props.schema.options) {
// props.schema.options = (await post(props.schema.url)).map((o) => ({ label: o.name, value: o }));
// }
return {
model,
getDisabled,

5
docs/demo/src/WTA/wwwroot/components/form/form-item.js

@ -3,13 +3,14 @@ import { ref, reactive, watch } from "vue";
import AppFormInput from "./form-input.js";
export default {
name: "formItem",
components: { AppFormInput },
template: html`
<template v-if="showItem()">
<template v-if="schema.type==='object'"></template>
<template v-else-if="schema.type==='array'"></template>
<template v-else>
<template v-if="schema.type!=='array'||(schema.items.type!=='object'&&schema.items.type!=='array')"> </template>
<el-form-item
:title="getProp(prop)"
:label="schema.title"
:prop="getProp(prop)"
:rules="getRules(parentSchema,schema,model)"

2
docs/demo/src/WTA/wwwroot/components/list/index.js

@ -295,7 +295,7 @@ export default {
const vm = (await get(url)).data;
Object.assign(editFormSchema, vm.schema);
Object.assign(editFormModel, vm.model);
editFormTitle.value = `${t("update")}${schema.title}`;
editFormTitle.value = `${t("create")}${schema.title}`;
dialogVisible.value = true;
} else if (item.path === "update") {
//update

27
docs/demo/src/WTA/wwwroot/index.html

@ -5,12 +5,37 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<style>
@keyframes loading-rotate {
to {
transform: rotate(360deg)
}
}
#loading {
display: none;
animation: loading-rotate 2s linear infinite;
}
#loading.loading {
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
width: 50px;
height: 50px;
}
</style>
<link rel="stylesheet" href="./main.css" />
<title></title>
</head>
<body>
<div id="app"></div>
<img src="./assets/icons/loading.svg" id="loading" class="loading">
<script type="importmap">
{
"imports": {
@ -44,4 +69,4 @@
<script type="module" src="./main.js"></script>
</body>
</html>
</html>

BIN
docs/结算系统概要规格说明(V1.1).docx

Binary file not shown.
Loading…
Cancel
Save