学 赵 1 year ago
parent
commit
e12745a504
  1. 7
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance.js
  2. 25
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/log.js
  3. 14
      code/src/Shared/Win.Sfs.Shared/Filter/FilterExtensions.cs

7
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance.js

@ -14,10 +14,9 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
let notify = null; const showMessage = async (data) => {
const showMessage = (data) => { await ElNotification.closeAll();
notify?.close(); ElNotification({
notify = ElNotification({
position: "bottom-right", position: "bottom-right",
title: "提示", title: "提示",
message: `待同步库存数量: ${data}`, message: `待同步库存数量: ${data}`,

25
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/log.js

@ -1,10 +1,11 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/vmi/log.js"; import useConfig from "../../../models/vmi/log.js";
import { ref } from "vue"; import { ref, onMounted, onUnmounted } from "vue";
import { schemaToModel } from "../../utils/index.js"; import { schemaToModel } from "../../utils/index.js";
import AppForm from "../../../components/form/index.js"; import AppForm from "../../../components/form/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import { ElNotification } from "element-plus";
import request, { getUrl } from "../../request/index.js"; import request, { getUrl } from "../../request/index.js";
export default { export default {
@ -79,6 +80,28 @@ export default {
addDialogVisible.value = true; addDialogVisible.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
const showMessage = async (data) => {
await ElNotification.closeAll();
ElNotification({
position: "bottom-right",
title: "提示",
message: `待同步库存数量: ${data}`,
duration: 0,
});
};
const event = "VmiBalance";
onMounted(async () => {
const result = await request("settleaccount/vmi-async-message/get-message-count", null, { method: "POST" });
if (!result.errors) {
showMessage(result.data);
}
PubSub.subscribe(event, async (_, data) => {
if (route.path === "/vmi/log") {
showMessage(data);
}
});
});
onUnmounted(() => PubSub.unsubscribe(event));
return { return {
appListRef, appListRef,
loading, loading,

14
code/src/Shared/Win.Sfs.Shared/Filter/FilterExtensions.cs

@ -78,7 +78,6 @@ namespace Win.Sfs.Shared.Filter
//var constant = Expression.Constant(filterCondition.Value);//创建常数 //var constant = Expression.Constant(filterCondition.Value);//创建常数
ConstantExpression constant = null; ConstantExpression constant = null;
if (filterCondition.Action != EnumFilterAction.In && filterCondition.Action != EnumFilterAction.NotIn) if (filterCondition.Action != EnumFilterAction.In && filterCondition.Action != EnumFilterAction.NotIn)
{ {
constant = CreateConstantExpression(member.Type, filterCondition.Value); constant = CreateConstantExpression(member.Type, filterCondition.Value);
@ -152,13 +151,12 @@ namespace Win.Sfs.Shared.Filter
if (propertyType.IsGenericType && if (propertyType.IsGenericType &&
propertyType.GetGenericTypeDefinition() == typeof(Nullable<>)) propertyType.GetGenericTypeDefinition() == typeof(Nullable<>))
{ {
var type = propertyType.GetGenericArguments()[0]; var objValue = new NullableConverter(propertyType).ConvertFromString(value);
var objValue = type.IsEnum ? (Enum)Enum.Parse(type, value, true) : Convert.ChangeType(value, type); constant = Expression.Constant(objValue, propertyType);
constant = Expression.Constant(new NullableConverter(propertyType).ConvertFrom(objValue));
} }
else if (propertyType.IsEnum) else if (propertyType.IsEnum)
{ {
var enumValue = (Enum?)Enum.Parse(propertyType, value, true); var enumValue = (Enum)Enum.Parse(propertyType, value, true);
constant = Expression.Constant(enumValue); constant = Expression.Constant(enumValue);
} }
else else
@ -177,11 +175,7 @@ namespace Win.Sfs.Shared.Filter
return constant; return constant;
} }
public static T? CreateNullable<T>(this T item) where T : struct
{
T? v = (T?)(new NullableConverter(typeof(T?))).ConvertFrom(item);
return v;
}
private static Expression<Func<T, bool>> GetExpressionLikeMethod<T>(string methodName, private static Expression<Func<T, bool>> GetExpressionLikeMethod<T>(string methodName,
FilterCondition filterCondition) FilterCondition filterCondition)
{ {

Loading…
Cancel
Save