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

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

上级 01626366
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
"dependencies": { "dependencies": {
"@floating-ui/dom": "^1.0.11", "@floating-ui/dom": "^1.0.11",
"@ibiz-template/command": "^0.0.1-beta.50", "@ibiz-template/command": "^0.0.1-beta.50",
"@ibiz-template/controller": "^0.0.1-beta.129", "@ibiz-template/controller": "^0.0.1-beta.130",
"@ibiz-template/core": "^0.0.1-beta.129", "@ibiz-template/core": "^0.0.1-beta.130",
"@ibiz-template/model": "^0.0.1-beta.129", "@ibiz-template/model": "^0.0.1-beta.130",
"@ibiz-template/runtime": "^0.0.1-beta.129", "@ibiz-template/runtime": "^0.0.1-beta.130",
"@ibiz-template/service": "^0.0.1-beta.129", "@ibiz-template/service": "^0.0.1-beta.130",
"@ibiz-template/theme": "^0.0.1-beta.129", "@ibiz-template/theme": "^0.0.1-beta.130",
"@ibiz-template/vue-util": "^0.0.1-beta.129", "@ibiz-template/vue-util": "^0.0.1-beta.130",
"@ibiz/dynamic-model-api": "^2.1.28", "@ibiz/dynamic-model-api": "^2.1.28",
"@riophae/vue-treeselect": "^0.4.0", "@riophae/vue-treeselect": "^0.4.0",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
......
此差异已折叠。
...@@ -119,7 +119,12 @@ export const ViewToolbar = defineComponent({ ...@@ -119,7 +119,12 @@ export const ViewToolbar = defineComponent({
return ( return (
<div <div
key={item.id} key={item.id}
class={[this.ns.e('item'), this.ns.e('item-deuiaction')]} class={[
this.ns.e('item'),
this.ns.e('item-deuiaction'),
this.ns.is('loading', this.toolbarState[item.id].loading),
this.ns.is('caption', !!(item.showCaption && item.caption)),
]}
> >
<i-button <i-button
title={item.tooltip} title={item.tooltip}
......
...@@ -137,9 +137,10 @@ export const IBizCheckbox = defineComponent({ ...@@ -137,9 +137,10 @@ export const IBizCheckbox = defineComponent({
selectArray, selectArray,
valueText, valueText,
onSelectArrayChange, onSelectArrayChange,
c,
}; };
}, },
render() { render(h) {
return ( return (
<div <div
class={[ class={[
...@@ -148,14 +149,22 @@ export const IBizCheckbox = defineComponent({ ...@@ -148,14 +149,22 @@ export const IBizCheckbox = defineComponent({
this.readonly ? this.ns.m('readonly') : '', this.readonly ? this.ns.m('readonly') : '',
]} ]}
> >
{this.readonly ? ( {[
this.valueText this.readonly && this.valueText,
) : ( !this.readonly &&
<i-checkbox-group h(
value={this.selectArray} 'ICheckboxGroup',
on-on-change={this.onSelectArrayChange} {
> props: {
{this.items.map((item, index: number) => ( ...this.c.customProps,
value: this.selectArray,
},
on: {
'on-change': this.onSelectArrayChange,
},
},
[
this.items.map((item, index: number) => (
<i-checkbox <i-checkbox
key={index} key={index}
label={item.value} label={item.value}
...@@ -163,9 +172,10 @@ export const IBizCheckbox = defineComponent({ ...@@ -163,9 +172,10 @@ export const IBizCheckbox = defineComponent({
> >
<span class={this.ns.e('text')}>{item.text}</span> <span class={this.ns.e('text')}>{item.text}</span>
</i-checkbox> </i-checkbox>
))} )),
</i-checkbox-group> ],
)} ),
]}
</div> </div>
); );
}, },
......
...@@ -199,7 +199,7 @@ export const IBizMPicker = defineComponent({ ...@@ -199,7 +199,7 @@ export const IBizMPicker = defineComponent({
setDefaultOptions, setDefaultOptions,
}; };
}, },
render() { render(h) {
return ( return (
<div <div
class={[ class={[
...@@ -209,22 +209,30 @@ export const IBizMPicker = defineComponent({ ...@@ -209,22 +209,30 @@ export const IBizMPicker = defineComponent({
]} ]}
> >
{this.readonly && this.valueText} {this.readonly && this.valueText}
{!this.readonly && ( {!this.readonly &&
<i-select h(
ref='selectRef' 'iSelect',
value={this.curValue} {
filterable ref: 'selectRef',
transfer props: {
multiple ...this.c.customProps,
default-label={this.defaultLabel} value: this.curValue,
loading={this.loading} filterable: true,
placeholder={this.c.placeHolder} transfer: true,
remote-method={this.onSearch} multiple: true,
on-on-open-change={this.onOpenChange} defaultLabel: this.defaultLabel,
on-on-change={this.onSelect} loading: this.loading,
disabled={this.disabled} placeholder: this.c.placeHolder,
> disabled: this.disabled,
{this.items.map(item => { remoteMethod: this.onSearch,
},
on: {
'on-change': this.onSelect,
'on-open-change': this.onOpenChange,
},
},
[
this.items.map(item => {
return ( return (
<i-option <i-option
key={item.srfkey} key={item.srfkey}
...@@ -234,8 +242,8 @@ export const IBizMPicker = defineComponent({ ...@@ -234,8 +242,8 @@ export const IBizMPicker = defineComponent({
{item.srfmajortext} {item.srfmajortext}
</i-option> </i-option>
); );
})} }),
</i-select> ],
)} )}
{!this.readonly && ( {!this.readonly && (
<div class={this.ns.e('buns-position')}> <div class={this.ns.e('buns-position')}>
......
...@@ -182,7 +182,7 @@ export const IBizPickerDropDown = defineComponent({ ...@@ -182,7 +182,7 @@ export const IBizPickerDropDown = defineComponent({
onSearch, onSearch,
}; };
}, },
render() { render(h) {
if (this.readonly) { if (this.readonly) {
return ( return (
<div class={(this.ns.b(), this.ns.m('readonly'))}>{this.value}</div> <div class={(this.ns.b(), this.ns.m('readonly'))}>{this.value}</div>
...@@ -190,34 +190,43 @@ export const IBizPickerDropDown = defineComponent({ ...@@ -190,34 +190,43 @@ export const IBizPickerDropDown = defineComponent({
} }
return ( return (
<div class={[this.ns.b(), this.disabled ? this.ns.m('disabled') : '']}> <div class={[this.ns.b(), this.disabled ? this.ns.m('disabled') : '']}>
{this.readonly ? ( {[
this.value this.readonly && this.value,
) : ( !this.readonly &&
<i-select h(
value={this.refValue} 'iSelect',
filterable {
remote props: {
allow-clear ...this.c.customProps,
clearable value: this.refValue,
transfer filterable: true,
loading={this.loading} remote: true,
placeholder={this.c.placeHolder} allowClear: true,
remote-method={this.onSearch} clearable: true,
on-on-open-change={this.onOpenChange} transfer: true,
on-on-query-change={this.onQueryChange} loading: this.loading,
on-on-change={this.onSelect} placeholder: this.c.placeHolder,
on-on-clear={this.onClear} remoteMethod: this.onSearch,
disabled={this.disabled} disabled: this.disabled,
> },
{this.items.map((item, index) => { on: {
'on-change': this.onSelect,
'on-open-change': this.onOpenChange,
'on-query-change': this.onQueryChange,
'on-on-clear': this.onClear,
},
},
[
this.items.map((item, index) => {
return ( return (
<i-option value={item[this.c.keyName]} key={index}> <i-option value={item[this.c.keyName]} key={index}>
{item[this.c.textName]} {item[this.c.textName]}
</i-option> </i-option>
); );
})} }),
</i-select> ],
)} ),
]}
</div> </div>
); );
}, },
......
...@@ -141,7 +141,7 @@ export const IBizPicker = defineComponent({ ...@@ -141,7 +141,7 @@ export const IBizPicker = defineComponent({
onBlur, onBlur,
}; };
}, },
render() { render(h) {
if (this.readonly) { if (this.readonly) {
return ( return (
<div class={(this.ns.b(), this.ns.m('readonly'))}>{this.value}</div> <div class={(this.ns.b(), this.ns.m('readonly'))}>{this.value}</div>
...@@ -149,50 +149,69 @@ export const IBizPicker = defineComponent({ ...@@ -149,50 +149,69 @@ export const IBizPicker = defineComponent({
} }
return ( return (
<div class={[this.ns.b(), this.disabled ? this.ns.m('disabled') : '']}> <div class={[this.ns.b(), this.disabled ? this.ns.m('disabled') : '']}>
{this.c.noAC ? ( {[
<i-input this.c.noAC &&
value={this.curValue} h(
clearable 'IInput',
placeholder={this.c.placeHolder} {
on-on-clear={this.onClear} props: {
disabled={this.disabled} ...this.c.customProps,
> value: this.curValue,
{this.$slots.append} clearable: true,
{!this.$slots.append && this.c.pickupView ? ( placeholder: this.c.placeHolder,
disabled: this.disabled,
},
on: {
'on-clear': this.onClear,
},
},
[
this.$slots.append,
!this.$slots.append && this.c.pickupView && (
<i-button <i-button
key='ios-search' key='ios-search'
icon='ios-search' icon='ios-search'
on-click={this.openPickUpView} on-click={this.openPickUpView}
></i-button> ></i-button>
) : null} ),
{!this.$slots.append && this.c.linkView ? ( !this.$slots.append && this.c.linkView && (
<i-button <i-button
key='ios-search-outline' key='ios-search-outline'
icon='ios-search-outline' icon='ios-search-outline'
on-click='openLinkView' on-click='openLinkView'
></i-button> ></i-button>
) : null} ),
</i-input> ],
) : ( ),
!this.c.noAC && (
<div <div
class={[ class={[
this.ns.e('autocomplete'), this.ns.e('autocomplete'),
this.ns.m(this.closeCircle.toString()), this.ns.m(this.closeCircle.toString()),
]} ]}
> >
<i-auto-complete {[
value={this.curValue} h(
placeholder={this.c.placeHolder} 'IAutoComplete',
placement='bottom' {
clearable props: {
transfer-class-name={this.ns.e('transfer')} ...this.c.customProps,
on-on-focus={this.onFocus} value: this.curValue,
on-on-search={this.onSearch} placeholder: this.c.placeHolder,
on-on-clear={this.onClear} placement: 'bottom',
on-on-blur={this.onBlur} clearable: true,
disabled={this.disabled} transferClassName: this.ns.e('transfer'),
> disabled: this.disabled,
{this.items.map(item => { },
on: {
'on-focus': this.onFocus,
'on-search': this.onSearch,
'on-clear': this.onClear,
'on-blur': this.onBlur,
},
},
[
this.items.map(item => {
return ( return (
<div <div
class={this.ns.e('transfer-item')} class={this.ns.e('transfer-item')}
...@@ -203,8 +222,9 @@ export const IBizPicker = defineComponent({ ...@@ -203,8 +222,9 @@ export const IBizPicker = defineComponent({
{item[this.c.textName]} {item[this.c.textName]}
</div> </div>
); );
})} }),
</i-auto-complete> ],
),
<div class={this.ns.e('buns-position')}> <div class={this.ns.e('buns-position')}>
<div class={this.ns.e('btns')}> <div class={this.ns.e('btns')}>
{this.c.pickupView ? ( {this.c.pickupView ? (
...@@ -224,9 +244,11 @@ export const IBizPicker = defineComponent({ ...@@ -224,9 +244,11 @@ export const IBizPicker = defineComponent({
</i-button> </i-button>
) : null} ) : null}
</div> </div>
</div>,
]}
</div> </div>
</div> ),
)} ]}
</div> </div>
); );
}, },
......
...@@ -99,7 +99,7 @@ export const IBizDatePicker = defineComponent({ ...@@ -99,7 +99,7 @@ export const IBizDatePicker = defineComponent({
isTimePicker, isTimePicker,
}; };
}, },
render() { render(h) {
return ( return (
<div <div
class={[ class={[
...@@ -108,33 +108,45 @@ export const IBizDatePicker = defineComponent({ ...@@ -108,33 +108,45 @@ export const IBizDatePicker = defineComponent({
this.readonly ? this.ns.m('readonly') : '', this.readonly ? this.ns.m('readonly') : '',
]} ]}
> >
{this.readonly ? ( {[
this.formatValue this.readonly && this.formatValue,
) : this.isTimePicker ? ( !this.readonly &&
<i-time-picker this.isTimePicker &&
ref='inputRef' h('ITimePicker', {
transfer ref: 'inputRef',
type={this.type} props: {
format={this.format} ...this.c.customProps,
placeholder={this.c!.placeHolder} value: this.value,
value={this.value} type: this.type,
on-on-open-change={this.onOpenChange} format: this.format,
on-on-change={this.handleChange} placeholder: this.c!.placeHolder,
disabled={this.disabled} disabled: this.disabled,
></i-time-picker> transfer: true,
) : ( },
<i-CalendarPicker on: {
ref='inputRef' 'on-change': this.handleChange,
transfer 'on-open-change': this.onOpenChange,
type={this.type} },
format={this.format} }),
placeholder={this.c!.placeHolder} !this.readonly &&
value={this.value} !this.isTimePicker &&
on-on-open-change={this.onOpenChange} h('ICalendarPicker', {
on-on-change={this.handleChange} ref: 'inputRef',
disabled={this.disabled} props: {
></i-CalendarPicker> ...this.c.customProps,
)} value: this.value,
type: this.type,
format: this.format,
placeholder: this.c!.placeHolder,
disabled: this.disabled,
transfer: true,
},
on: {
'on-change': this.handleChange,
'on-open-change': this.onOpenChange,
},
}),
]}
</div> </div>
); );
}, },
......
...@@ -141,7 +141,7 @@ export const IBizDateRange = defineComponent({ ...@@ -141,7 +141,7 @@ export const IBizDateRange = defineComponent({
unlinkPanels, unlinkPanels,
}; };
}, },
render() { render(h) {
return ( return (
<div <div
class={[ class={[
...@@ -150,20 +150,25 @@ export const IBizDateRange = defineComponent({ ...@@ -150,20 +150,25 @@ export const IBizDateRange = defineComponent({
this.readonly ? this.ns.m('readonly') : '', this.readonly ? this.ns.m('readonly') : '',
]} ]}
> >
<i-date-picker {h('IDatePicker', {
ref='inputRef' ref: 'inputRef',
value={this.curValue} props: {
transfer ...this.c.customProps,
type={this.type} value: this.curValue,
format={this.format} transfer: true,
placeholder={this.c!.placeHolder} type: this.type,
disabled={this.disabled} format: this.format,
readonly={this.readonly} placeholder: this.c!.placeHolder,
separator={this.rangeSeparator} disabled: this.disabled,
split-panels={this.unlinkPanels} readonly: this.readonly,
on-on-open-change={this.onOpenChange} // 弹出日历和关闭日历时触发 separator: this.rangeSeparator,
on-on-change={this.handleChange} // 日期发生变化时触发 splitPanels: this.unlinkPanels,
></i-date-picker> },
on: {
'on-change': this.handleChange,
'on-open-change': this.onOpenChange,
},
})}
</div> </div>
); );
}, },
......
...@@ -69,6 +69,10 @@ export const IBizDropdown = defineComponent({ ...@@ -69,6 +69,10 @@ export const IBizDropdown = defineComponent({
}); });
} }
const onSelect = (value: string | Array<string> | undefined) => {
curValue.value = value;
};
const onOpenChange = (isOpen: boolean) => { const onOpenChange = (isOpen: boolean) => {
emit('operate', isOpen); emit('operate', isOpen);
}; };
...@@ -82,12 +86,22 @@ export const IBizDropdown = defineComponent({ ...@@ -82,12 +86,22 @@ export const IBizDropdown = defineComponent({
hasChildren, hasChildren,
onOpenChange, onOpenChange,
inputRef, inputRef,
onSelect,
}; };
}, },
render() { render(h) {
// 编辑态内容 return (
const editContent = this.hasChildren ? ( <div
class={[
this.ns.b(),
this.disabled ? this.ns.m('disabled') : '',
this.readonly ? this.ns.m('readonly') : '',
]}
>
{[
this.readonly && this.valueText,
!this.readonly && this.hasChildren && (
<app-select-tree <app-select-tree
class={[this.ns.e('tree-select')]} class={[this.ns.e('tree-select')]}
value={this.curValue} value={this.curValue}
...@@ -95,33 +109,36 @@ export const IBizDropdown = defineComponent({ ...@@ -95,33 +109,36 @@ export const IBizDropdown = defineComponent({
disabled={this.disabled} disabled={this.disabled}
multiple={this.c!.multiple} multiple={this.c!.multiple}
></app-select-tree> ></app-select-tree>
) : ( ),
<i-select !this.readonly &&
ref='inputRef' !this.hasChildren &&
v-model={this.curValue} h(
allow-clear 'iSelect',
transfer {
clearable ref: 'inputRef',
class={[this.ns.e('select')]} class: this.ns.e('select'),
multiple={this.c!.multiple} props: {
placeholder={this.c!.placeHolder} ...this.c.customProps,
disabled={this.disabled} value: this.curValue,
on-on-open-change={this.onOpenChange} allowClear: true,
> transfer: true,
{this.items.map(item => { clearable: true,
multiple: this.c!.multiple,
placeholder: this.c.placeHolder,
disabled: this.disabled,
},
on: {
'on-change': this.onSelect,
'on-open-change': this.onOpenChange,
},
},
[
this.items.map(item => {
return <i-option value={item.value}>{item.text}</i-option>; return <i-option value={item.value}>{item.text}</i-option>;
})} }),
</i-select> ],
); ),
return (
<div
class={[
this.ns.b(),
this.disabled ? this.ns.m('disabled') : '',
this.readonly ? this.ns.m('readonly') : '',
]} ]}
>
{this.readonly ? this.valueText : editContent}
</div> </div>
); );
}, },
......
...@@ -38,9 +38,10 @@ export const IBizRadio = defineComponent({ ...@@ -38,9 +38,10 @@ export const IBizRadio = defineComponent({
items, items,
valueText, valueText,
onSelectValueChange, onSelectValueChange,
c,
}; };
}, },
render() { render(h) {
return ( return (
<div <div
class={[ class={[
...@@ -49,21 +50,34 @@ export const IBizRadio = defineComponent({ ...@@ -49,21 +50,34 @@ export const IBizRadio = defineComponent({
this.readonly ? this.ns.m('readonly') : '', this.readonly ? this.ns.m('readonly') : '',
]} ]}
> >
{this.readonly ? ( {[
this.valueText this.readonly && this.valueText,
) : ( !this.readonly &&
<i-radio-group h(
class={this.ns.e('group')} 'IRadioGroup',
value={this.value} {
on-on-change={this.onSelectValueChange} class: this.ns.e('group'),
props: {
...this.c.customProps,
value: this.value,
},
on: {
'on-change': this.onSelectValueChange,
},
},
[
this.items.map((_item, index: number) => (
<i-radio
key={index}
label={_item.value}
disabled={this.disabled}
> >
{this.items.map((_item, index: number) => (
<i-radio key={index} label={_item.value} disabled={this.disabled}>
<span class={this.ns.e('text')}>{_item.text}</span> <span class={this.ns.e('text')}>{_item.text}</span>
</i-radio> </i-radio>
))} )),
</i-radio-group> ],
)} ),
]}
</div> </div>
); );
}, },
......
...@@ -28,6 +28,18 @@ export const IBizInputNumber = defineComponent({ ...@@ -28,6 +28,18 @@ export const IBizInputNumber = defineComponent({
{ immediate: true }, { immediate: true },
); );
let hiddenupdownbutton = false;
if (c.editorParams) {
if (c.editorParams.hiddenupdownbutton) {
try {
hiddenupdownbutton = JSON.parse(c.editorParams.hiddenupdownbutton);
} catch {
hiddenupdownbutton = false;
}
}
}
const handleChange = (e: number | null) => { const handleChange = (e: number | null) => {
emit('change', e); emit('change', e);
}; };
...@@ -49,35 +61,48 @@ export const IBizInputNumber = defineComponent({ ...@@ -49,35 +61,48 @@ export const IBizInputNumber = defineComponent({
currentVal, currentVal,
handleChange, handleChange,
inputRef, inputRef,
hiddenupdownbutton,
}; };
}, },
render() { render(h) {
return ( return (
<div <div
class={[ class={[
this.ns.b(), this.ns.b(),
this.disabled ? this.ns.m('disabled') : '', this.disabled ? this.ns.m('disabled') : '',
this.readonly ? this.ns.m('readonly') : '', this.readonly ? this.ns.m('readonly') : '',
this.hiddenupdownbutton ? this.ns.m('hiddenupdownbutton') : '',
]} ]}
> >
{this.readonly ? ( {[
this.currentVal this.readonly && this.currentVal,
) : ( !this.readonly &&
<i-input-number h(
ref='inputRef' 'IInputNumber',
value={this.currentVal} {
placeholder={this.c.placeHolder} ref: 'inputRef',
precision={this.c.model.precision} props: {
disabled={this.disabled} ...this.c.customProps,
on-on-change={this.handleChange} value: this.currentVal,
> placeholder: this.controller.placeHolder,
{this.c.model.unitName && ( precision:
<i class={this.ns.e('unit')} slot='suffix'> this.c.model.precision === -1
{this.c.model.unitName} ? undefined
</i> : this.c.model.precision,
)} disabled: this.disabled,
</i-input-number> },
)} on: {
'on-change': this.handleChange,
},
},
[
this.controller.model.unitName &&
h('i', { class: this.ns.e('unit'), slot: 'suffix' }, [
this.controller.model.unitName,
]),
],
),
]}
</div> </div>
); );
}, },
......
...@@ -173,9 +173,10 @@ export const IBizInput = defineComponent({ ...@@ -173,9 +173,10 @@ export const IBizInput = defineComponent({
handleBlur, handleBlur,
inputRef, inputRef,
autoSize, autoSize,
c,
}; };
}, },
render() { render(h) {
return ( return (
<div <div
class={[ class={[
...@@ -185,29 +186,39 @@ export const IBizInput = defineComponent({ ...@@ -185,29 +186,39 @@ export const IBizInput = defineComponent({
this.readonly ? this.ns.m('readonly') : '', this.readonly ? this.ns.m('readonly') : '',
]} ]}
> >
{this.readonly ? ( {[
this.currentVal this.readonly && this.currentVal,
) : ( !this.readonly &&
<i-input h(
ref='inputRef' 'IInput',
value={this.currentVal} {
placeholder={this.controller.placeHolder} ref: 'inputRef',
type={this.type} class: this.ns.b('input'),
rows={this.rows} props: {
on-on-change={this.handleChange} ...this.c.customProps,
on-on-blur={this.handleBlur} value: this.currentVal,
nativeOnkeyup={this.handleKeyUp} placeholder: this.controller.placeHolder,
class={this.ns.b('input')} type: this.type,
disabled={this.disabled} rows: this.rows,
autosize={this.autoSize} disabled: this.disabled,
> autosize: this.autoSize,
{this.controller.model.unitName && ( },
<i class={this.ns.e('unit')} slot='suffix'> on: {
{this.controller.model.unitName} 'on-change': this.handleChange,
</i> 'on-blur': this.handleBlur,
)} },
</i-input> nativeOn: {
)} keyup: this.handleKeyUp,
},
},
[
this.controller.model.unitName &&
h('i', { class: this.ns.e('unit'), slot: 'suffix' }, [
this.controller.model.unitName,
]),
],
),
]}
</div> </div>
); );
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册