提交 51e5b5a1 编写于 作者: ibizdev's avatar ibizdev

zhujiamin 发布系统代码 [TrainSys,网页端]

上级 6c565e98
......@@ -13,13 +13,13 @@
"dependencies": {
"@floating-ui/dom": "^1.0.11",
"@ibiz-template/command": "^0.0.1-beta.50",
"@ibiz-template/controller": "^0.0.1-beta.131",
"@ibiz-template/core": "^0.0.1-beta.131",
"@ibiz-template/model": "^0.0.1-beta.131",
"@ibiz-template/runtime": "^0.0.1-beta.131",
"@ibiz-template/service": "^0.0.1-beta.131",
"@ibiz-template/theme": "^0.0.1-beta.131",
"@ibiz-template/vue-util": "^0.0.1-beta.131",
"@ibiz-template/controller": "^0.0.1-beta.132",
"@ibiz-template/core": "^0.0.1-beta.132",
"@ibiz-template/model": "^0.0.1-beta.132",
"@ibiz-template/runtime": "^0.0.1-beta.132",
"@ibiz-template/service": "^0.0.1-beta.132",
"@ibiz-template/theme": "^0.0.1-beta.132",
"@ibiz-template/vue-util": "^0.0.1-beta.132",
"@ibiz/dynamic-model-api": "^2.1.28",
"@riophae/vue-treeselect": "^0.4.0",
"dayjs": "^1.11.7",
......@@ -34,7 +34,8 @@
"view-design": "^4.7.0",
"vite-plugin-style-import": "1.4.1",
"vue": "^2.7.14",
"vue-router": "^3.6.5"
"vue-router": "^3.6.5",
"vue-text-format": "^3.1.2"
},
"devDependencies": {
"@commitlint/cli": "^17.3.0",
......
此差异已折叠。
......@@ -39,10 +39,10 @@ export const AppCol = defineComponent({
} = gridLayoutPos;
const multiplier = gridLayoutPos.layout === 'TABLE_24COL' ? 1 : 2;
return {
xs: { span: colXS * multiplier, offset: colXSOffset * multiplier },
sm: { span: colSM * multiplier, offset: colSMOffset * multiplier },
md: { span: colMD * multiplier, offset: colMDOffset * multiplier },
lg: { span: colLG * multiplier, offset: colLGOffset * multiplier },
md: { span: colXS * multiplier, offset: colXSOffset * multiplier },
lg: { span: colSM * multiplier, offset: colSMOffset * multiplier },
xl: { span: colMD * multiplier, offset: colMDOffset * multiplier },
xxl: { span: colLG * multiplier, offset: colLGOffset * multiplier },
};
});
......
......@@ -3,6 +3,7 @@ import { getSpanProps, useNamespace } from '@ibiz-template/vue-util';
import dayjs from 'dayjs';
import '@ibiz-template/theme/style/components/editor/ibiz-span/ibiz-span.scss';
import { CodeListItem } from '@ibiz-template/service';
import { DataTypes } from '@ibiz-template/core';
export const IBizSpan = defineComponent({
name: 'IBizSpan',
......@@ -28,8 +29,18 @@ export const IBizSpan = defineComponent({
text.value = '';
return;
}
const { dataType } = c.parent;
if (c.valueFormat) {
text.value = dayjs(newVal).format(c.valueFormat);
try {
if (dataType != null && DataTypes.isDate(dataType)) {
text.value = dayjs(newVal).format(c.valueFormat);
} else {
text.value = ibiz.util.text.format(`${newVal}`, c.valueFormat);
}
} catch (error) {
text.value = `${newVal}`;
ibiz.log.error(`${newVal} 值格式化错误`);
}
} else {
text.value = `${newVal}`;
}
......
import { computed, defineComponent, ref, watch } from 'vue';
import { debounce, isNaN } from 'lodash-es';
import { debounce } from 'lodash-es';
import {
getEditorEmits,
getInputProps,
......@@ -93,22 +93,7 @@ export const IBizInput = defineComponent({
(e: IData) => {
// 拦截掉blur触发后change
if (blurCacheValue !== e.target.value) {
if (c.model.precision !== -1) {
const num = Number(e.target.value);
if (!isNaN(num)) {
const number = fomatFloat(num, c.model.precision);
currentVal.value = e.target.value; // 1.001
setTimeout(() => {
currentVal.value = number;
// 1.00 1.001
if (number !== props.value) {
emit('change', number);
}
});
}
} else {
emit('change', e.target.value);
}
emit('change', e.target.value);
}
blurCacheValue = undefined;
isDebounce = false;
......@@ -119,10 +104,25 @@ export const IBizInput = defineComponent({
300,
{ leading: true },
);
const matchNum = (e: IData) => {
const newValue = e.target.value;
const regexString = `^(\\d+\\.?\\d{0,${c.model.precision}})$`;
const match = new RegExp(regexString).exec(newValue);
return match;
};
// 值变更
const handleChange = (e: IData) => {
isDebounce = true;
debounceChange(e);
if (c.model.precision !== -1) {
const match = matchNum(e);
if (match) {
debounceChange(e);
}
} else {
debounceChange(e);
}
};
const handleKeyUp = (e: KeyboardEvent) => {
......@@ -142,8 +142,12 @@ export const IBizInput = defineComponent({
*/
const handleBlur = () => {
blurCacheValue = inputRef.value.currentValue;
const number = fomatFloat(Number(blurCacheValue), c.model.precision);
if (c.model.precision !== -1) {
const multiplier = 10 ** c.model.precision;
const num =
Math.floor(Number(blurCacheValue) * multiplier) / multiplier;
const number = blurCacheValue ? fomatFloat(num, c.model.precision) : '';
currentVal.value = number;
emit('change', number);
} else {
emit('change', blurCacheValue);
......@@ -163,6 +167,22 @@ export const IBizInput = defineComponent({
});
}
const input = (e: IData) => {
if (c.model.precision !== -1) {
const match = matchNum(e);
if (!match) {
if (!e.target.value) {
e.target.value = '';
} else {
const multiplier = 10 ** c.model.precision;
const num =
Math.floor(Number(e.target.value) * multiplier) / multiplier;
e.target.value = num;
}
}
}
};
return {
ns,
rows,
......@@ -173,6 +193,7 @@ export const IBizInput = defineComponent({
handleBlur,
inputRef,
autoSize,
input,
c,
};
},
......@@ -209,6 +230,7 @@ export const IBizInput = defineComponent({
},
nativeOn: {
keyup: this.handleKeyUp,
input: this.input,
},
},
[
......
......@@ -2,6 +2,7 @@ import '@ibiz-template/theme/style/index.scss';
import Vue from 'vue';
import Router from 'vue-router';
import { PiniaVuePlugin } from 'pinia';
import { textFormat } from 'vue-text-format';
import router from './router';
import App from './App';
import { AppRegister } from './app-register';
......@@ -64,6 +65,7 @@ async function createApp(): Promise<void> {
ibiz.loading = new LoadingUtil();
ibiz.overlay = new OverlayController();
ibiz.plugin = new PluginFactory();
ibiz.util.text.format = textFormat;
installDefaultPluginRegister();
Vue.use(UserRegister);
},
......
......@@ -942,6 +942,12 @@
"queryCodeExp" : "t1.`CREATEDATE`",
"standardColumnName" : "`CREATEDATE`"
} ],
"getAllPSDEFSearchModes" : [ {
"codeName" : "N_CREATEDATE_LTANDEQ",
"name" : "N_CREATEDATE_LTANDEQ",
"stdDataType" : 5,
"valueOP" : "LTANDEQ"
} ],
"getAllPSDEFUIModes" : [ {
"codeName" : "Default",
"name" : "[CREATEDATE][建立时间]",
......@@ -1183,6 +1189,12 @@
"queryCodeExp" : "t1.`UPDATEDATE`",
"standardColumnName" : "`UPDATEDATE`"
} ],
"getAllPSDEFSearchModes" : [ {
"codeName" : "N_UPDATEDATE_GTANDEQ",
"name" : "N_UPDATEDATE_GTANDEQ",
"stdDataType" : 5,
"valueOP" : "GTANDEQ"
} ],
"getAllPSDEFUIModes" : [ {
"codeName" : "Default",
"name" : "[UPDATEDATE][更新时间]",
......@@ -2856,6 +2868,21 @@
}, {
"name" : "PhoneFilterDTO",
"getPSDEFilterDTOFields" : [ {
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "建立时间",
"name" : "N_CREATEDATE_LTANDEQ",
"getPSDEFSearchMode" : {
"modelref" : true,
"id" : "N_CREATEDATE_LTANDEQ"
},
"getPSDEField" : {
"name" : "CREATEDATE",
"codeName" : "CreateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
}, {
"logicName" : "手机标识",
"name" : "N_PHONEID_EQ",
"getPSDEFSearchMode" : {
......@@ -2939,6 +2966,21 @@
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 25,
"type" : "SIMPLE"
}, {
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "更新时间",
"name" : "N_UPDATEDATE_GTANDEQ",
"getPSDEFSearchMode" : {
"modelref" : true,
"id" : "N_UPDATEDATE_GTANDEQ"
},
"getPSDEField" : {
"name" : "UPDATEDATE",
"codeName" : "UpdateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
} ],
"sourceType" : "DE",
"type" : "DEFILTER",
......
......@@ -1718,6 +1718,18 @@
"codeName" : "PhoneFilterDTO",
"name" : "PhoneFilterDTO",
"getPSAppDEMethodDTOFields" : [ {
"codeName" : "N_CREATEDATE_LTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "建立时间",
"name" : "N_CREATEDATE_LTANDEQ",
"getPSAppDEField" : {
"name" : "CREATEDATE",
"codeName" : "CreateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
}, {
"codeName" : "N_PHONEID_EQ",
"logicName" : "手机标识",
"name" : "N_PHONEID_EQ",
......@@ -1783,6 +1795,18 @@
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 25,
"type" : "SIMPLE"
}, {
"codeName" : "N_UPDATEDATE_GTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "更新时间",
"name" : "N_UPDATEDATE_GTANDEQ",
"getPSAppDEField" : {
"name" : "UPDATEDATE",
"codeName" : "UpdateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
} ],
"sourceType" : "DE",
"type" : "DEFILTER"
......
......@@ -23905,6 +23905,18 @@
"codeName" : "PhoneFilterDTO",
"name" : "PhoneFilterDTO",
"getPSAppDEMethodDTOFields" : [ {
"codeName" : "N_CREATEDATE_LTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "建立时间",
"name" : "N_CREATEDATE_LTANDEQ",
"getPSAppDEField" : {
"name" : "CREATEDATE",
"codeName" : "CreateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
}, {
"codeName" : "N_PHONEID_EQ",
"logicName" : "手机标识",
"name" : "N_PHONEID_EQ",
......@@ -23970,6 +23982,18 @@
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 25,
"type" : "SIMPLE"
}, {
"codeName" : "N_UPDATEDATE_GTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "更新时间",
"name" : "N_UPDATEDATE_GTANDEQ",
"getPSAppDEField" : {
"name" : "UPDATEDATE",
"codeName" : "UpdateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
} ],
"sourceType" : "DE",
"type" : "DEFILTER"
......@@ -1718,6 +1718,18 @@
"codeName" : "PhoneFilterDTO",
"name" : "PhoneFilterDTO",
"getPSAppDEMethodDTOFields" : [ {
"codeName" : "N_CREATEDATE_LTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "建立时间",
"name" : "N_CREATEDATE_LTANDEQ",
"getPSAppDEField" : {
"name" : "CREATEDATE",
"codeName" : "CreateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
}, {
"codeName" : "N_PHONEID_EQ",
"logicName" : "手机标识",
"name" : "N_PHONEID_EQ",
......@@ -1783,6 +1795,18 @@
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 25,
"type" : "SIMPLE"
}, {
"codeName" : "N_UPDATEDATE_GTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "更新时间",
"name" : "N_UPDATEDATE_GTANDEQ",
"getPSAppDEField" : {
"name" : "UPDATEDATE",
"codeName" : "UpdateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
} ],
"sourceType" : "DE",
"type" : "DEFILTER"
......
......@@ -1481,16 +1481,16 @@
"codeName" : "VMGroup2",
"name" : "视图消息组2",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "视图消息",
"name" : "视图消息2",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg2"
"id" : "ViewMsg3"
}
}, {
"name" : "视图消息2",
"name" : "视图消息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg3"
"id" : "ViewMsg2"
}
} ]
}, {
......@@ -6386,6 +6386,18 @@
"codeName" : "PhoneFilterDTO",
"name" : "PhoneFilterDTO",
"getPSAppDEMethodDTOFields" : [ {
"codeName" : "N_CREATEDATE_LTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "建立时间",
"name" : "N_CREATEDATE_LTANDEQ",
"getPSAppDEField" : {
"name" : "CREATEDATE",
"codeName" : "CreateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
}, {
"codeName" : "N_PHONEID_EQ",
"logicName" : "手机标识",
"name" : "N_PHONEID_EQ",
......@@ -6451,6 +6463,18 @@
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 25,
"type" : "SIMPLE"
}, {
"codeName" : "N_UPDATEDATE_GTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "更新时间",
"name" : "N_UPDATEDATE_GTANDEQ",
"getPSAppDEField" : {
"name" : "UPDATEDATE",
"codeName" : "UpdateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
} ],
"sourceType" : "DE",
"type" : "DEFILTER"
......
......@@ -1718,6 +1718,18 @@
"codeName" : "PhoneFilterDTO",
"name" : "PhoneFilterDTO",
"getPSAppDEMethodDTOFields" : [ {
"codeName" : "N_CREATEDATE_LTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "建立时间",
"name" : "N_CREATEDATE_LTANDEQ",
"getPSAppDEField" : {
"name" : "CREATEDATE",
"codeName" : "CreateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
}, {
"codeName" : "N_PHONEID_EQ",
"logicName" : "手机标识",
"name" : "N_PHONEID_EQ",
......@@ -1783,6 +1795,18 @@
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 25,
"type" : "SIMPLE"
}, {
"codeName" : "N_UPDATEDATE_GTANDEQ",
"jsonFormat" : "yyyy-MM-dd HH:mm:ss",
"logicName" : "更新时间",
"name" : "N_UPDATEDATE_GTANDEQ",
"getPSAppDEField" : {
"name" : "UPDATEDATE",
"codeName" : "UpdateDate"
},
"sourceType" : "DEFSEARCHMODE",
"stdDataType" : 5,
"type" : "SIMPLE"
} ],
"sourceType" : "DE",
"type" : "DEFILTER"
......
......@@ -11857,16 +11857,16 @@
"codeName" : "VMGroup2",
"name" : "视图消息组2",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "视图消息",
"name" : "视图消息2",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg2"
"id" : "ViewMsg3"
}
}, {
"name" : "视图消息2",
"name" : "视图消息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg3"
"id" : "ViewMsg2"
}
} ]
}, {
......@@ -11927,16 +11927,16 @@
"codeName" : "VMGroup4",
"name" : "视图消息位置测试",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息位置-视图上方",
"name" : "消息位置-视图内容区",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg7"
"id" : "ViewMsg9"
}
}, {
"name" : "消息位置-弹出",
"name" : "消息位置-视图上方",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg10"
"id" : "ViewMsg7"
}
}, {
"name" : "消息位置-视图下方",
......@@ -11945,48 +11945,40 @@
"id" : "ViewMsg8"
}
}, {
"name" : "消息位置-视图内容区",
"name" : "消息位置-弹出",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg9"
"id" : "ViewMsg10"
}
} ]
}, {
"codeName" : "VMGroup8",
"name" : "【静态测试】",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "关闭模式-本次删除-上方-警告",
"name" : "关闭模式-无删除-上方-常规",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg13"
"id" : "ViewMsg11"
}
}, {
"name" : "消息类型-警告信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg5"
},
"position" : "POPUP"
}, {
"name" : "消息类型-错误信息",
"name" : "消息类型-常规信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg6"
"id" : "ViewMsg4"
},
"position" : "POPUP"
}, {
"name" : "关闭模式-无删除-上方-常规",
"name" : "消息位置-视图下方",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg11"
"id" : "ViewMsg8"
}
}, {
"name" : "消息类型-常规信息",
"name" : "消息位置-视图内容区",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg4"
},
"position" : "POPUP"
"id" : "ViewMsg9"
}
}, {
"name" : "关闭模式-默认删除-上方-错误",
"getPSAppViewMsg" : {
......@@ -11994,17 +11986,25 @@
"id" : "ViewMsg12"
}
}, {
"name" : "消息位置-视图内容区",
"name" : "消息类型-警告信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg9"
}
"id" : "ViewMsg5"
},
"position" : "POPUP"
}, {
"name" : "消息位置-视图下方",
"name" : "关闭模式-本次删除-上方-警告",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg8"
"id" : "ViewMsg13"
}
}, {
"name" : "消息类型-错误信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg6"
},
"position" : "POPUP"
} ]
}, {
"codeName" : "VMGroup5",
......@@ -12016,16 +12016,16 @@
"id" : "ViewMsg12"
}
}, {
"name" : "关闭模式-删除",
"name" : "关闭模式-本次删除",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg11"
"id" : "ViewMsg13"
}
}, {
"name" : "关闭模式-本次删除",
"name" : "关闭模式-删除",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg13"
"id" : "ViewMsg11"
}
} ]
}, {
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册