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

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

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