提交 8c4aeb57 编写于 作者: ibizdev's avatar ibizdev

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

上级 992dad6e
......@@ -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.125",
"@ibiz-template/core": "^0.0.1-beta.125",
"@ibiz-template/model": "^0.0.1-beta.125",
"@ibiz-template/runtime": "^0.0.1-beta.125",
"@ibiz-template/service": "^0.0.1-beta.125",
"@ibiz-template/theme": "^0.0.1-beta.125",
"@ibiz-template/vue-util": "^0.0.1-beta.125",
"@ibiz-template/controller": "^0.0.1-beta.126",
"@ibiz-template/core": "^0.0.1-beta.126",
"@ibiz-template/model": "^0.0.1-beta.126",
"@ibiz-template/runtime": "^0.0.1-beta.126",
"@ibiz-template/service": "^0.0.1-beta.126",
"@ibiz-template/theme": "^0.0.1-beta.126",
"@ibiz-template/vue-util": "^0.0.1-beta.126",
"@ibiz/dynamic-model-api": "^2.1.28",
"@riophae/vue-treeselect": "^0.4.0",
"dayjs": "^1.11.7",
......
此差异已折叠。
import { computed, defineComponent, ref, watch } from 'vue';
import { debounce } from 'lodash-es';
import { debounce, isNaN } from 'lodash-es';
import {
getEditorEmits,
getInputProps,
......@@ -7,6 +7,19 @@ import {
} from '@ibiz-template/vue-util';
import '@ibiz-template/theme/style/components/editor/ibiz-input/ibiz-input.scss';
const fomatFloat = function (value: number, n: number) {
const f = Math.round(value * 10 ** n) / 10 ** n;
let s = f.toString();
const rs = s.indexOf('.');
if (rs < 0) {
s += '.';
}
for (let i = s.length - s.indexOf('.'); i <= n; i++) {
s += '0';
}
return s;
};
export const IBizInput = defineComponent({
name: 'IBizInput',
props: getInputProps(),
......@@ -31,6 +44,9 @@ export const IBizInput = defineComponent({
// 类型
const type = computed(() => {
if (c.model.precision !== -1) {
return 'number';
}
switch (editorModel.editorType) {
case 'TEXTBOX':
return 'text';
......@@ -77,7 +93,22 @@ export const IBizInput = defineComponent({
(e: IData) => {
// 拦截掉blur触发后change
if (blurCacheValue !== e.target.value) {
emit('change', 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);
}
}
blurCacheValue = undefined;
isDebounce = false;
......@@ -111,7 +142,12 @@ export const IBizInput = defineComponent({
*/
const handleBlur = () => {
blurCacheValue = inputRef.value.currentValue;
emit('change', blurCacheValue);
const number = fomatFloat(Number(blurCacheValue), c.model.precision);
if (c.model.precision !== -1) {
emit('change', number);
} else {
emit('change', blurCacheValue);
}
};
// 自动聚焦
......
......@@ -53,6 +53,12 @@ export const GridControl = defineComponent({
const { onPageChange, onPageReset, onPageSizeChange } =
useAppGridPagination(c);
const highlight = computed(() => {
const ctrlParams =
props.modelData?.source.getPSControlParam()?.ctrlParams;
return ctrlParams?.HIGHLIGHT !== 'false';
});
// iView表格单击行选中没有,必须手动调用选中方法
const onUIRowClick = (data: IData, index: number) => {
const gridInstance: IData | undefined = proxy.$refs.grid;
......@@ -60,8 +66,14 @@ export const GridControl = defineComponent({
if (gridInstance.toggleSelect) {
gridInstance.toggleSelect(index);
}
if (gridInstance.highlightCurrentRow) {
gridInstance.highlightCurrentRow(index);
const objData = gridInstance.objData;
const rowData = objData?.[index];
if (rowData) {
if (rowData._isChecked) {
gridInstance.highlightCurrentRow(index);
} else {
gridInstance.clearCurrentRow();
}
}
}
onRowClick(data);
......@@ -147,6 +159,7 @@ export const GridControl = defineComponent({
tableHeight,
gridRef,
girdPaginationRef,
highlight,
};
},
render() {
......@@ -198,7 +211,7 @@ export const GridControl = defineComponent({
height={this.tableHeight}
class={this.ns.b('content')}
show-header={!this.c.model.source.hideHeader}
highlight-row
highlight-row={this.highlight}
data={this.tableData}
columns={this.columns}
on-on-row-click={this.onUIRowClick}
......
......@@ -31,7 +31,7 @@ export function generateColumnData(column: GridColumnModel, c: GridController) {
sortable: !c.noSort && column.source.enableSort ? 'custom' : false,
columnType: column.source.columnType,
userParams: column.source.userParams,
className: column.codeName,
className: column.source.getCellPSSysCss()?.cssName,
};
if (columnChildren.length > 0) {
Object.assign(columnData, { children: columnChildren });
......@@ -139,7 +139,10 @@ export function useITableEvent(c: GridController) {
const origin = getOriginData(data);
// 单选的时候选中效果靠这个回调
if (c.singleSelect) {
c.onSelectionChange([origin]);
const selectedItem = c.selectedData.find(
item => item.srfkey === data.srfkey,
);
c.onSelectionChange(selectedItem ? [] : [origin]);
}
c.onRowClick(origin);
}
......
......@@ -9830,16 +9830,16 @@
"id" : "ViewMsg4"
}
}, {
"name" : "消息类型-警告信息",
"name" : "消息类型-错误信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg5"
"id" : "ViewMsg6"
}
}, {
"name" : "消息类型-错误信息",
"name" : "消息类型-警告信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg6"
"id" : "ViewMsg5"
}
} ]
}, {
......@@ -9856,12 +9856,6 @@
"codeName" : "VMGroup4",
"name" : "视图消息位置测试",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息位置-视图下方",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg8"
}
}, {
"name" : "消息位置-弹出",
"getPSAppViewMsg" : {
"modelref" : true,
......@@ -9879,23 +9873,17 @@
"modelref" : true,
"id" : "ViewMsg9"
}
}, {
"name" : "消息位置-视图下方",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg8"
}
} ]
}, {
"codeName" : "VMGroup8",
"name" : "【静态测试】",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息位置-视图内容区",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg9"
}
}, {
"name" : "关闭模式-默认删除-上方-错误",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg12"
}
}, {
"name" : "关闭模式-本次删除-上方-警告",
"getPSAppViewMsg" : {
"modelref" : true,
......@@ -9934,17 +9922,23 @@
"modelref" : true,
"id" : "ViewMsg11"
}
}, {
"name" : "消息位置-视图内容区",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg9"
}
}, {
"name" : "关闭模式-默认删除-上方-错误",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg12"
}
} ]
}, {
"codeName" : "VMGroup5",
"name" : "视图消息关闭模式",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "关闭模式-本次删除",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg13"
}
}, {
"name" : "关闭模式-无删除",
"getPSAppViewMsg" : {
"modelref" : true,
......@@ -9956,6 +9950,12 @@
"modelref" : true,
"id" : "ViewMsg12"
}
}, {
"name" : "关闭模式-本次删除",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg13"
}
} ]
}, {
"codeName" : "VMGroup6",
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册