@epie/bi-crud 2.0.15 → 2.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bi-crud.esm.js +158 -58
- package/lib/bi-crud.umd.js +159 -57
- package/lib/components/duration/duration.d.ts +73 -0
- package/lib/components/duration/index.d.ts +5 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/inline-search/helper.d.ts +3 -5
- package/lib/components/inline-search/index.d.ts +3 -41
- package/lib/components/inline-search/inlinesearch.d.ts +66 -0
- package/lib/utils/test.d.ts +3 -0
- package/package.json +1 -1
package/lib/bi-crud.esm.js
CHANGED
|
@@ -13149,7 +13149,7 @@ function useRender$1(ctx) {
|
|
|
13149
13149
|
let _slot;
|
|
13150
13150
|
|
|
13151
13151
|
// 表单项列表
|
|
13152
|
-
const children = ctx.items
|
|
13152
|
+
const children = ctx.items?.map(e => {
|
|
13153
13153
|
// 是否隐藏
|
|
13154
13154
|
e._hidden = Parse("hidden", {
|
|
13155
13155
|
value: e.hidden,
|
|
@@ -13205,7 +13205,7 @@ function useRender$1(ctx) {
|
|
|
13205
13205
|
}, e), _isSlot$2(FormItem) ? FormItem : {
|
|
13206
13206
|
default: () => [FormItem]
|
|
13207
13207
|
});
|
|
13208
|
-
});
|
|
13208
|
+
}).filter(Boolean);
|
|
13209
13209
|
|
|
13210
13210
|
const op = createVNode(resolveComponent("el-col"), {
|
|
13211
13211
|
"span": 6,
|
|
@@ -13235,7 +13235,11 @@ function useRender$1(ctx) {
|
|
|
13235
13235
|
"label-width": "100px",
|
|
13236
13236
|
"inline": true,
|
|
13237
13237
|
"model": ctx.form
|
|
13238
|
-
}, null);
|
|
13238
|
+
}, null);
|
|
13239
|
+
|
|
13240
|
+
if ((children?.length > 0 || 0) === 0) {
|
|
13241
|
+
return createVNode("span", null, null);
|
|
13242
|
+
} //TODO:: 支持props
|
|
13239
13243
|
|
|
13240
13244
|
|
|
13241
13245
|
return h(ElForm, {}, {
|
|
@@ -13254,7 +13258,7 @@ function useRender$1(ctx) {
|
|
|
13254
13258
|
search: "搜索",
|
|
13255
13259
|
reset: "重置"
|
|
13256
13260
|
};
|
|
13257
|
-
return ctx.op
|
|
13261
|
+
return ctx.op?.map(e => {
|
|
13258
13262
|
if (ButtonText[e]) {
|
|
13259
13263
|
return createVNode(resolveComponent("el-button"), {
|
|
13260
13264
|
size: "default",
|
|
@@ -13271,37 +13275,32 @@ function useRender$1(ctx) {
|
|
|
13271
13275
|
});
|
|
13272
13276
|
}
|
|
13273
13277
|
});
|
|
13274
|
-
}
|
|
13278
|
+
}
|
|
13275
13279
|
|
|
13276
13280
|
return {
|
|
13277
|
-
renderForm
|
|
13278
|
-
|
|
13281
|
+
renderForm // renderOp
|
|
13282
|
+
|
|
13279
13283
|
};
|
|
13280
13284
|
}
|
|
13281
13285
|
|
|
13282
|
-
|
|
13283
|
-
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
type: Array,
|
|
13295
|
-
default: () => []
|
|
13296
|
-
},
|
|
13297
|
-
// 操作按钮 ['search', 'reset', 'clear', 'close']
|
|
13298
|
-
op: {
|
|
13299
|
-
type: Array,
|
|
13300
|
-
default: () => ["search", "reset"]
|
|
13301
|
-
},
|
|
13302
|
-
// 搜索钩子 { data, { next, close } }
|
|
13303
|
-
onSearch: Function
|
|
13286
|
+
const epieInlineSearchProps = () => ({
|
|
13287
|
+
data: {
|
|
13288
|
+
type: Object,
|
|
13289
|
+
default: () => {}
|
|
13290
|
+
},
|
|
13291
|
+
items: {
|
|
13292
|
+
type: Array,
|
|
13293
|
+
default: () => []
|
|
13294
|
+
},
|
|
13295
|
+
op: {
|
|
13296
|
+
type: Array,
|
|
13297
|
+
default: () => ["search", "reset"]
|
|
13304
13298
|
},
|
|
13299
|
+
onSearch: Function
|
|
13300
|
+
});
|
|
13301
|
+
var EpieInlineSearch = defineComponent({
|
|
13302
|
+
name: "epie-inline-search",
|
|
13303
|
+
props: epieInlineSearchProps(),
|
|
13305
13304
|
|
|
13306
13305
|
setup(props, {
|
|
13307
13306
|
emit
|
|
@@ -13353,7 +13352,7 @@ var InlineSearch = defineComponent({
|
|
|
13353
13352
|
const {
|
|
13354
13353
|
renderForm
|
|
13355
13354
|
} = useRender$1(ctx);
|
|
13356
|
-
return ctx.items
|
|
13355
|
+
return (ctx.items?.length || 0) > 0 && createVNode("div", {
|
|
13357
13356
|
"class": "epie-inline-search"
|
|
13358
13357
|
}, [createVNode("div", {
|
|
13359
13358
|
"class": "epie-inline-search__form"
|
|
@@ -13495,31 +13494,6 @@ function useRender({
|
|
|
13495
13494
|
};
|
|
13496
13495
|
}
|
|
13497
13496
|
|
|
13498
|
-
// export const formItemProps = () => ({
|
|
13499
|
-
// htmlFor: String,
|
|
13500
|
-
// prefixCls: String,
|
|
13501
|
-
// label: PropTypes.any,
|
|
13502
|
-
// help: PropTypes.any,
|
|
13503
|
-
// extra: PropTypes.any,
|
|
13504
|
-
// labelCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
|
13505
|
-
// wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
|
13506
|
-
// hasFeedback: { type: Boolean, default: false },
|
|
13507
|
-
// colon: { type: Boolean, default: undefined },
|
|
13508
|
-
// labelAlign: PropTypes.oneOf(tuple('left', 'right')),
|
|
13509
|
-
// prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
|
13510
|
-
// name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
|
13511
|
-
// rules: [Array, Object] as PropType<Rule[] | Rule>,
|
|
13512
|
-
// autoLink: { type: Boolean, default: true },
|
|
13513
|
-
// required: { type: Boolean, default: undefined },
|
|
13514
|
-
// validateFirst: { type: Boolean, default: undefined },
|
|
13515
|
-
// validateStatus: PropTypes.oneOf(tuple('', 'success', 'warning', 'error', 'validating')),
|
|
13516
|
-
// validateTrigger: { type: [String, Array] as PropType<string | string[]> },
|
|
13517
|
-
// messageVariables: { type: Object as PropType<Record<string, string>> },
|
|
13518
|
-
// hidden: Boolean,
|
|
13519
|
-
// noStyle: Boolean,
|
|
13520
|
-
// });
|
|
13521
|
-
// export type EpieDescriptionsProps = Partial<ExtractPropTypes<ReturnType<typeof epieDescriptionsProps>>>;
|
|
13522
|
-
|
|
13523
13497
|
function _isSlot(s) {
|
|
13524
13498
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
13525
13499
|
}
|
|
@@ -13784,6 +13758,131 @@ var EpieDescriptions = defineComponent({
|
|
|
13784
13758
|
// }
|
|
13785
13759
|
// });
|
|
13786
13760
|
|
|
13761
|
+
const epieDurationProps = () => ({
|
|
13762
|
+
modelValue: {
|
|
13763
|
+
type: Number,
|
|
13764
|
+
default: 0
|
|
13765
|
+
},
|
|
13766
|
+
unit: {
|
|
13767
|
+
type: String,
|
|
13768
|
+
default: 'second'
|
|
13769
|
+
},
|
|
13770
|
+
max: {
|
|
13771
|
+
type: Number,
|
|
13772
|
+
default: 0
|
|
13773
|
+
},
|
|
13774
|
+
min: {
|
|
13775
|
+
type: Number,
|
|
13776
|
+
default: 0
|
|
13777
|
+
}
|
|
13778
|
+
});
|
|
13779
|
+
var Unit;
|
|
13780
|
+
|
|
13781
|
+
(function (Unit) {
|
|
13782
|
+
Unit[Unit["Second"] = 1] = "Second";
|
|
13783
|
+
Unit[Unit["Minute"] = 2] = "Minute";
|
|
13784
|
+
Unit[Unit["Hour"] = 3] = "Hour";
|
|
13785
|
+
Unit[Unit["Day"] = 4] = "Day";
|
|
13786
|
+
})(Unit || (Unit = {}));
|
|
13787
|
+
|
|
13788
|
+
const calcDisplayValue = (realValue, unit) => {
|
|
13789
|
+
let ret = realValue;
|
|
13790
|
+
|
|
13791
|
+
if (unit == Unit.Minute) {
|
|
13792
|
+
ret = Math.round(ret / 60);
|
|
13793
|
+
} else if (unit == Unit.Hour) {
|
|
13794
|
+
ret = Math.round(ret / 60 / 60);
|
|
13795
|
+
} else if (unit == Unit.Day) {
|
|
13796
|
+
ret = Math.round(ret / 60 / 60 / 24);
|
|
13797
|
+
}
|
|
13798
|
+
|
|
13799
|
+
return ret;
|
|
13800
|
+
};
|
|
13801
|
+
|
|
13802
|
+
const calcRealValue = (display, unit) => {
|
|
13803
|
+
let ret = display;
|
|
13804
|
+
|
|
13805
|
+
if (unit == Unit.Minute) {
|
|
13806
|
+
ret = ret * 60;
|
|
13807
|
+
} else if (unit == Unit.Hour) {
|
|
13808
|
+
ret = ret * 60 * 60;
|
|
13809
|
+
} else if (unit == Unit.Day) {
|
|
13810
|
+
ret = ret * 60 * 60 * 24;
|
|
13811
|
+
}
|
|
13812
|
+
|
|
13813
|
+
return ret;
|
|
13814
|
+
};
|
|
13815
|
+
|
|
13816
|
+
var EpieDuration = defineComponent({
|
|
13817
|
+
name: "epie-duration",
|
|
13818
|
+
props: epieDurationProps(),
|
|
13819
|
+
emits: ["update:modelValue"],
|
|
13820
|
+
|
|
13821
|
+
setup(props, {
|
|
13822
|
+
emit
|
|
13823
|
+
}) {
|
|
13824
|
+
const defUnit = (() => {
|
|
13825
|
+
if (props.unit == 'day') {
|
|
13826
|
+
return Unit.Day;
|
|
13827
|
+
} else if (props.unit == 'hour') {
|
|
13828
|
+
return Unit.Hour;
|
|
13829
|
+
} else if (props.unit == 'minute') {
|
|
13830
|
+
return Unit.Minute;
|
|
13831
|
+
} else if (props.unit == 'second') {
|
|
13832
|
+
return Unit.Second;
|
|
13833
|
+
}
|
|
13834
|
+
|
|
13835
|
+
return Unit.Second;
|
|
13836
|
+
})();
|
|
13837
|
+
|
|
13838
|
+
const realValue = computed(() => props.modelValue);
|
|
13839
|
+
const unitValue = ref(defUnit); // display value 只有在修改输入框的时候才生效, 其他时候不生效
|
|
13840
|
+
|
|
13841
|
+
const displayValue = ref(calcDisplayValue(realValue.value, unitValue.value));
|
|
13842
|
+
watch(() => realValue.value, v => {
|
|
13843
|
+
displayValue.value = calcDisplayValue(realValue.value, unitValue.value);
|
|
13844
|
+
});
|
|
13845
|
+
watch([displayValue, unitValue], ([newDisplayValue, newUnitValue], [oldDisplayValue, oldUnitValue]) => {
|
|
13846
|
+
emit("update:modelValue", calcRealValue(displayValue.value, unitValue.value)); // console.log(`old ${oldDisplayValue}${UnitName[oldUnitValue]}, new ${newDisplayValue}${UnitName[newUnitValue]}`)
|
|
13847
|
+
});
|
|
13848
|
+
return {
|
|
13849
|
+
unitValue,
|
|
13850
|
+
displayValue,
|
|
13851
|
+
realValue
|
|
13852
|
+
};
|
|
13853
|
+
},
|
|
13854
|
+
|
|
13855
|
+
render(ctx) {
|
|
13856
|
+
return h(createVNode(resolveComponent("el-input"), {
|
|
13857
|
+
"modelValue": ctx.displayValue,
|
|
13858
|
+
"onUpdate:modelValue": $event => ctx.displayValue = $event
|
|
13859
|
+
}, null), {}, {
|
|
13860
|
+
default: () => createVNode(Fragment, null, null),
|
|
13861
|
+
append: () => createVNode(resolveComponent("el-select"), {
|
|
13862
|
+
"modelValue": ctx.unitValue,
|
|
13863
|
+
"onUpdate:modelValue": $event => ctx.unitValue = $event,
|
|
13864
|
+
"placeholder": "单位",
|
|
13865
|
+
"style": "width: 60px"
|
|
13866
|
+
}, {
|
|
13867
|
+
default: () => [createVNode(resolveComponent("el-option"), {
|
|
13868
|
+
"label": "秒",
|
|
13869
|
+
"value": 1
|
|
13870
|
+
}, null), createVNode(resolveComponent("el-option"), {
|
|
13871
|
+
"label": "分",
|
|
13872
|
+
"value": 2
|
|
13873
|
+
}, null), createVNode(resolveComponent("el-option"), {
|
|
13874
|
+
"label": "时",
|
|
13875
|
+
"value": 3
|
|
13876
|
+
}, null), createVNode(resolveComponent("el-option"), {
|
|
13877
|
+
"label": "天",
|
|
13878
|
+
"value": 4
|
|
13879
|
+
}, null)]
|
|
13880
|
+
})
|
|
13881
|
+
});
|
|
13882
|
+
}
|
|
13883
|
+
|
|
13884
|
+
});
|
|
13885
|
+
|
|
13787
13886
|
const components = {
|
|
13788
13887
|
Crud: Crud$1,
|
|
13789
13888
|
AddBtn,
|
|
@@ -13803,9 +13902,10 @@ const components = {
|
|
|
13803
13902
|
Filter,
|
|
13804
13903
|
FilterGroup,
|
|
13805
13904
|
ErrorMessage,
|
|
13806
|
-
|
|
13905
|
+
EpieInlineSearch,
|
|
13807
13906
|
ExportBtn,
|
|
13808
|
-
EpieDescriptions
|
|
13907
|
+
EpieDescriptions,
|
|
13908
|
+
EpieDuration
|
|
13809
13909
|
};
|
|
13810
13910
|
function useComponent(app) {
|
|
13811
13911
|
for (const i in components) {
|
|
@@ -13844,4 +13944,4 @@ const Crud = {
|
|
|
13844
13944
|
};
|
|
13845
13945
|
// export { ContextMenu } from "./components/context-menu";
|
|
13846
13946
|
|
|
13847
|
-
export { EpieDescriptions, components, crudList, Crud as default, emitter$1 as emitter, epieDescriptionsProps, useAdvSearch, useBrowser, useComponent, useCore, useCrud, useDescriptions, useDialog, useForm, useProxy, useRefs, useTable, useTools, useUpsert };
|
|
13947
|
+
export { EpieDescriptions, EpieInlineSearch, components, crudList, Crud as default, emitter$1 as emitter, epieDescriptionsProps, epieInlineSearchProps, useAdvSearch, useBrowser, useComponent, useCore, useCrud, useDescriptions, useDialog, useForm, useProxy, useRefs, useTable, useTools, useUpsert };
|
package/lib/bi-crud.umd.js
CHANGED
|
@@ -13152,7 +13152,7 @@
|
|
|
13152
13152
|
let _slot;
|
|
13153
13153
|
|
|
13154
13154
|
// 表单项列表
|
|
13155
|
-
const children = ctx.items
|
|
13155
|
+
const children = ctx.items?.map(e => {
|
|
13156
13156
|
// 是否隐藏
|
|
13157
13157
|
e._hidden = Parse("hidden", {
|
|
13158
13158
|
value: e.hidden,
|
|
@@ -13208,7 +13208,7 @@
|
|
|
13208
13208
|
}, e), _isSlot$2(FormItem) ? FormItem : {
|
|
13209
13209
|
default: () => [FormItem]
|
|
13210
13210
|
});
|
|
13211
|
-
});
|
|
13211
|
+
}).filter(Boolean);
|
|
13212
13212
|
|
|
13213
13213
|
const op = vue.createVNode(vue.resolveComponent("el-col"), {
|
|
13214
13214
|
"span": 6,
|
|
@@ -13238,7 +13238,11 @@
|
|
|
13238
13238
|
"label-width": "100px",
|
|
13239
13239
|
"inline": true,
|
|
13240
13240
|
"model": ctx.form
|
|
13241
|
-
}, null);
|
|
13241
|
+
}, null);
|
|
13242
|
+
|
|
13243
|
+
if ((children?.length > 0 || 0) === 0) {
|
|
13244
|
+
return vue.createVNode("span", null, null);
|
|
13245
|
+
} //TODO:: 支持props
|
|
13242
13246
|
|
|
13243
13247
|
|
|
13244
13248
|
return vue.h(ElForm, {}, {
|
|
@@ -13257,7 +13261,7 @@
|
|
|
13257
13261
|
search: "搜索",
|
|
13258
13262
|
reset: "重置"
|
|
13259
13263
|
};
|
|
13260
|
-
return ctx.op
|
|
13264
|
+
return ctx.op?.map(e => {
|
|
13261
13265
|
if (ButtonText[e]) {
|
|
13262
13266
|
return vue.createVNode(vue.resolveComponent("el-button"), {
|
|
13263
13267
|
size: "default",
|
|
@@ -13274,37 +13278,32 @@
|
|
|
13274
13278
|
});
|
|
13275
13279
|
}
|
|
13276
13280
|
});
|
|
13277
|
-
}
|
|
13281
|
+
}
|
|
13278
13282
|
|
|
13279
13283
|
return {
|
|
13280
|
-
renderForm
|
|
13281
|
-
|
|
13284
|
+
renderForm // renderOp
|
|
13285
|
+
|
|
13282
13286
|
};
|
|
13283
13287
|
}
|
|
13284
13288
|
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13296
|
-
|
|
13297
|
-
type: Array,
|
|
13298
|
-
default: () => []
|
|
13299
|
-
},
|
|
13300
|
-
// 操作按钮 ['search', 'reset', 'clear', 'close']
|
|
13301
|
-
op: {
|
|
13302
|
-
type: Array,
|
|
13303
|
-
default: () => ["search", "reset"]
|
|
13304
|
-
},
|
|
13305
|
-
// 搜索钩子 { data, { next, close } }
|
|
13306
|
-
onSearch: Function
|
|
13289
|
+
const epieInlineSearchProps = () => ({
|
|
13290
|
+
data: {
|
|
13291
|
+
type: Object,
|
|
13292
|
+
default: () => {}
|
|
13293
|
+
},
|
|
13294
|
+
items: {
|
|
13295
|
+
type: Array,
|
|
13296
|
+
default: () => []
|
|
13297
|
+
},
|
|
13298
|
+
op: {
|
|
13299
|
+
type: Array,
|
|
13300
|
+
default: () => ["search", "reset"]
|
|
13307
13301
|
},
|
|
13302
|
+
onSearch: Function
|
|
13303
|
+
});
|
|
13304
|
+
var EpieInlineSearch = vue.defineComponent({
|
|
13305
|
+
name: "epie-inline-search",
|
|
13306
|
+
props: epieInlineSearchProps(),
|
|
13308
13307
|
|
|
13309
13308
|
setup(props, {
|
|
13310
13309
|
emit
|
|
@@ -13356,7 +13355,7 @@
|
|
|
13356
13355
|
const {
|
|
13357
13356
|
renderForm
|
|
13358
13357
|
} = useRender$1(ctx);
|
|
13359
|
-
return ctx.items
|
|
13358
|
+
return (ctx.items?.length || 0) > 0 && vue.createVNode("div", {
|
|
13360
13359
|
"class": "epie-inline-search"
|
|
13361
13360
|
}, [vue.createVNode("div", {
|
|
13362
13361
|
"class": "epie-inline-search__form"
|
|
@@ -13498,31 +13497,6 @@
|
|
|
13498
13497
|
};
|
|
13499
13498
|
}
|
|
13500
13499
|
|
|
13501
|
-
// export const formItemProps = () => ({
|
|
13502
|
-
// htmlFor: String,
|
|
13503
|
-
// prefixCls: String,
|
|
13504
|
-
// label: PropTypes.any,
|
|
13505
|
-
// help: PropTypes.any,
|
|
13506
|
-
// extra: PropTypes.any,
|
|
13507
|
-
// labelCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
|
13508
|
-
// wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
|
13509
|
-
// hasFeedback: { type: Boolean, default: false },
|
|
13510
|
-
// colon: { type: Boolean, default: undefined },
|
|
13511
|
-
// labelAlign: PropTypes.oneOf(tuple('left', 'right')),
|
|
13512
|
-
// prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
|
13513
|
-
// name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
|
13514
|
-
// rules: [Array, Object] as PropType<Rule[] | Rule>,
|
|
13515
|
-
// autoLink: { type: Boolean, default: true },
|
|
13516
|
-
// required: { type: Boolean, default: undefined },
|
|
13517
|
-
// validateFirst: { type: Boolean, default: undefined },
|
|
13518
|
-
// validateStatus: PropTypes.oneOf(tuple('', 'success', 'warning', 'error', 'validating')),
|
|
13519
|
-
// validateTrigger: { type: [String, Array] as PropType<string | string[]> },
|
|
13520
|
-
// messageVariables: { type: Object as PropType<Record<string, string>> },
|
|
13521
|
-
// hidden: Boolean,
|
|
13522
|
-
// noStyle: Boolean,
|
|
13523
|
-
// });
|
|
13524
|
-
// export type EpieDescriptionsProps = Partial<ExtractPropTypes<ReturnType<typeof epieDescriptionsProps>>>;
|
|
13525
|
-
|
|
13526
13500
|
function _isSlot(s) {
|
|
13527
13501
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
13528
13502
|
}
|
|
@@ -13787,6 +13761,131 @@
|
|
|
13787
13761
|
// }
|
|
13788
13762
|
// });
|
|
13789
13763
|
|
|
13764
|
+
const epieDurationProps = () => ({
|
|
13765
|
+
modelValue: {
|
|
13766
|
+
type: Number,
|
|
13767
|
+
default: 0
|
|
13768
|
+
},
|
|
13769
|
+
unit: {
|
|
13770
|
+
type: String,
|
|
13771
|
+
default: 'second'
|
|
13772
|
+
},
|
|
13773
|
+
max: {
|
|
13774
|
+
type: Number,
|
|
13775
|
+
default: 0
|
|
13776
|
+
},
|
|
13777
|
+
min: {
|
|
13778
|
+
type: Number,
|
|
13779
|
+
default: 0
|
|
13780
|
+
}
|
|
13781
|
+
});
|
|
13782
|
+
var Unit;
|
|
13783
|
+
|
|
13784
|
+
(function (Unit) {
|
|
13785
|
+
Unit[Unit["Second"] = 1] = "Second";
|
|
13786
|
+
Unit[Unit["Minute"] = 2] = "Minute";
|
|
13787
|
+
Unit[Unit["Hour"] = 3] = "Hour";
|
|
13788
|
+
Unit[Unit["Day"] = 4] = "Day";
|
|
13789
|
+
})(Unit || (Unit = {}));
|
|
13790
|
+
|
|
13791
|
+
const calcDisplayValue = (realValue, unit) => {
|
|
13792
|
+
let ret = realValue;
|
|
13793
|
+
|
|
13794
|
+
if (unit == Unit.Minute) {
|
|
13795
|
+
ret = Math.round(ret / 60);
|
|
13796
|
+
} else if (unit == Unit.Hour) {
|
|
13797
|
+
ret = Math.round(ret / 60 / 60);
|
|
13798
|
+
} else if (unit == Unit.Day) {
|
|
13799
|
+
ret = Math.round(ret / 60 / 60 / 24);
|
|
13800
|
+
}
|
|
13801
|
+
|
|
13802
|
+
return ret;
|
|
13803
|
+
};
|
|
13804
|
+
|
|
13805
|
+
const calcRealValue = (display, unit) => {
|
|
13806
|
+
let ret = display;
|
|
13807
|
+
|
|
13808
|
+
if (unit == Unit.Minute) {
|
|
13809
|
+
ret = ret * 60;
|
|
13810
|
+
} else if (unit == Unit.Hour) {
|
|
13811
|
+
ret = ret * 60 * 60;
|
|
13812
|
+
} else if (unit == Unit.Day) {
|
|
13813
|
+
ret = ret * 60 * 60 * 24;
|
|
13814
|
+
}
|
|
13815
|
+
|
|
13816
|
+
return ret;
|
|
13817
|
+
};
|
|
13818
|
+
|
|
13819
|
+
var EpieDuration = vue.defineComponent({
|
|
13820
|
+
name: "epie-duration",
|
|
13821
|
+
props: epieDurationProps(),
|
|
13822
|
+
emits: ["update:modelValue"],
|
|
13823
|
+
|
|
13824
|
+
setup(props, {
|
|
13825
|
+
emit
|
|
13826
|
+
}) {
|
|
13827
|
+
const defUnit = (() => {
|
|
13828
|
+
if (props.unit == 'day') {
|
|
13829
|
+
return Unit.Day;
|
|
13830
|
+
} else if (props.unit == 'hour') {
|
|
13831
|
+
return Unit.Hour;
|
|
13832
|
+
} else if (props.unit == 'minute') {
|
|
13833
|
+
return Unit.Minute;
|
|
13834
|
+
} else if (props.unit == 'second') {
|
|
13835
|
+
return Unit.Second;
|
|
13836
|
+
}
|
|
13837
|
+
|
|
13838
|
+
return Unit.Second;
|
|
13839
|
+
})();
|
|
13840
|
+
|
|
13841
|
+
const realValue = vue.computed(() => props.modelValue);
|
|
13842
|
+
const unitValue = vue.ref(defUnit); // display value 只有在修改输入框的时候才生效, 其他时候不生效
|
|
13843
|
+
|
|
13844
|
+
const displayValue = vue.ref(calcDisplayValue(realValue.value, unitValue.value));
|
|
13845
|
+
vue.watch(() => realValue.value, v => {
|
|
13846
|
+
displayValue.value = calcDisplayValue(realValue.value, unitValue.value);
|
|
13847
|
+
});
|
|
13848
|
+
vue.watch([displayValue, unitValue], ([newDisplayValue, newUnitValue], [oldDisplayValue, oldUnitValue]) => {
|
|
13849
|
+
emit("update:modelValue", calcRealValue(displayValue.value, unitValue.value)); // console.log(`old ${oldDisplayValue}${UnitName[oldUnitValue]}, new ${newDisplayValue}${UnitName[newUnitValue]}`)
|
|
13850
|
+
});
|
|
13851
|
+
return {
|
|
13852
|
+
unitValue,
|
|
13853
|
+
displayValue,
|
|
13854
|
+
realValue
|
|
13855
|
+
};
|
|
13856
|
+
},
|
|
13857
|
+
|
|
13858
|
+
render(ctx) {
|
|
13859
|
+
return vue.h(vue.createVNode(vue.resolveComponent("el-input"), {
|
|
13860
|
+
"modelValue": ctx.displayValue,
|
|
13861
|
+
"onUpdate:modelValue": $event => ctx.displayValue = $event
|
|
13862
|
+
}, null), {}, {
|
|
13863
|
+
default: () => vue.createVNode(vue.Fragment, null, null),
|
|
13864
|
+
append: () => vue.createVNode(vue.resolveComponent("el-select"), {
|
|
13865
|
+
"modelValue": ctx.unitValue,
|
|
13866
|
+
"onUpdate:modelValue": $event => ctx.unitValue = $event,
|
|
13867
|
+
"placeholder": "单位",
|
|
13868
|
+
"style": "width: 60px"
|
|
13869
|
+
}, {
|
|
13870
|
+
default: () => [vue.createVNode(vue.resolveComponent("el-option"), {
|
|
13871
|
+
"label": "秒",
|
|
13872
|
+
"value": 1
|
|
13873
|
+
}, null), vue.createVNode(vue.resolveComponent("el-option"), {
|
|
13874
|
+
"label": "分",
|
|
13875
|
+
"value": 2
|
|
13876
|
+
}, null), vue.createVNode(vue.resolveComponent("el-option"), {
|
|
13877
|
+
"label": "时",
|
|
13878
|
+
"value": 3
|
|
13879
|
+
}, null), vue.createVNode(vue.resolveComponent("el-option"), {
|
|
13880
|
+
"label": "天",
|
|
13881
|
+
"value": 4
|
|
13882
|
+
}, null)]
|
|
13883
|
+
})
|
|
13884
|
+
});
|
|
13885
|
+
}
|
|
13886
|
+
|
|
13887
|
+
});
|
|
13888
|
+
|
|
13790
13889
|
const components = {
|
|
13791
13890
|
Crud: Crud$1,
|
|
13792
13891
|
AddBtn,
|
|
@@ -13806,9 +13905,10 @@
|
|
|
13806
13905
|
Filter,
|
|
13807
13906
|
FilterGroup,
|
|
13808
13907
|
ErrorMessage,
|
|
13809
|
-
|
|
13908
|
+
EpieInlineSearch,
|
|
13810
13909
|
ExportBtn,
|
|
13811
|
-
EpieDescriptions
|
|
13910
|
+
EpieDescriptions,
|
|
13911
|
+
EpieDuration
|
|
13812
13912
|
};
|
|
13813
13913
|
function useComponent(app) {
|
|
13814
13914
|
for (const i in components) {
|
|
@@ -13848,11 +13948,13 @@
|
|
|
13848
13948
|
// export { ContextMenu } from "./components/context-menu";
|
|
13849
13949
|
|
|
13850
13950
|
exports.EpieDescriptions = EpieDescriptions;
|
|
13951
|
+
exports.EpieInlineSearch = EpieInlineSearch;
|
|
13851
13952
|
exports.components = components;
|
|
13852
13953
|
exports.crudList = crudList;
|
|
13853
13954
|
exports["default"] = Crud;
|
|
13854
13955
|
exports.emitter = emitter$1;
|
|
13855
13956
|
exports.epieDescriptionsProps = epieDescriptionsProps;
|
|
13957
|
+
exports.epieInlineSearchProps = epieInlineSearchProps;
|
|
13856
13958
|
exports.useAdvSearch = useAdvSearch;
|
|
13857
13959
|
exports.useBrowser = useBrowser;
|
|
13858
13960
|
exports.useComponent = useComponent;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from "vue";
|
|
2
|
+
export declare const epieDurationProps: () => {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: NumberConstructor;
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
unit: {
|
|
8
|
+
type: PropType<"day" | "hour" | "minute" | "second">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
max: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
min: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare type EpieDurationProps = Partial<ExtractPropTypes<ReturnType<typeof epieDurationProps>>>;
|
|
21
|
+
declare enum Unit {
|
|
22
|
+
Second = 1,
|
|
23
|
+
Minute = 2,
|
|
24
|
+
Hour = 3,
|
|
25
|
+
Day = 4
|
|
26
|
+
}
|
|
27
|
+
declare const _default: import("vue").DefineComponent<{
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
unit: {
|
|
33
|
+
type: PropType<"day" | "hour" | "minute" | "second">;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
max: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
default: number;
|
|
39
|
+
};
|
|
40
|
+
min: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: number;
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
45
|
+
unitValue: import("vue").Ref<Unit>;
|
|
46
|
+
displayValue: import("vue").Ref<number>;
|
|
47
|
+
realValue: import("vue").ComputedRef<number>;
|
|
48
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
49
|
+
modelValue: {
|
|
50
|
+
type: NumberConstructor;
|
|
51
|
+
default: number;
|
|
52
|
+
};
|
|
53
|
+
unit: {
|
|
54
|
+
type: PropType<"day" | "hour" | "minute" | "second">;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
max: {
|
|
58
|
+
type: NumberConstructor;
|
|
59
|
+
default: number;
|
|
60
|
+
};
|
|
61
|
+
min: {
|
|
62
|
+
type: NumberConstructor;
|
|
63
|
+
default: number;
|
|
64
|
+
};
|
|
65
|
+
}>> & {
|
|
66
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
modelValue: number;
|
|
69
|
+
unit: "day" | "hour" | "minute" | "second";
|
|
70
|
+
max: number;
|
|
71
|
+
min: number;
|
|
72
|
+
}>;
|
|
73
|
+
export default _default;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}>;
|
|
5
|
-
renderOp: () => any;
|
|
1
|
+
import { EpieRenderCtx } from ".";
|
|
2
|
+
export declare function useRender(ctx: EpieRenderCtx & any): {
|
|
3
|
+
renderForm: () => JSX.Element;
|
|
6
4
|
};
|
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
data: {
|
|
5
|
-
type: ObjectConstructor;
|
|
6
|
-
default: () => {};
|
|
7
|
-
};
|
|
8
|
-
items: {
|
|
9
|
-
type: PropType<EpieForm.Item[]>;
|
|
10
|
-
default: () => never[];
|
|
11
|
-
};
|
|
12
|
-
op: {
|
|
13
|
-
type: ArrayConstructor;
|
|
14
|
-
default: () => string[];
|
|
15
|
-
};
|
|
16
|
-
onSearch: FunctionConstructor;
|
|
17
|
-
}, {
|
|
18
|
-
form: any;
|
|
19
|
-
reset: () => void;
|
|
20
|
-
loading: import("vue").Ref<boolean>;
|
|
21
|
-
search: () => void;
|
|
22
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
-
data: {
|
|
24
|
-
type: ObjectConstructor;
|
|
25
|
-
default: () => {};
|
|
26
|
-
};
|
|
27
|
-
items: {
|
|
28
|
-
type: PropType<EpieForm.Item[]>;
|
|
29
|
-
default: () => never[];
|
|
30
|
-
};
|
|
31
|
-
op: {
|
|
32
|
-
type: ArrayConstructor;
|
|
33
|
-
default: () => string[];
|
|
34
|
-
};
|
|
35
|
-
onSearch: FunctionConstructor;
|
|
36
|
-
}>>, {
|
|
37
|
-
data: Record<string, any>;
|
|
38
|
-
items: EpieForm.Item[];
|
|
39
|
-
op: unknown[];
|
|
40
|
-
}>;
|
|
41
|
-
export default _default;
|
|
1
|
+
export * from "./inlinesearch";
|
|
2
|
+
import EpieInlineSearch from "./inlinesearch";
|
|
3
|
+
export { EpieInlineSearch };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from "vue";
|
|
2
|
+
import { EpieForm } from "../form/form";
|
|
3
|
+
export interface EpieInlineSearchItem extends EpieForm.Item {
|
|
4
|
+
hide: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const epieInlineSearchProps: () => {
|
|
7
|
+
data: {
|
|
8
|
+
type: ObjectConstructor;
|
|
9
|
+
default: () => void;
|
|
10
|
+
};
|
|
11
|
+
items: {
|
|
12
|
+
type: PropType<EpieInlineSearchItem[]>;
|
|
13
|
+
default: () => never[];
|
|
14
|
+
};
|
|
15
|
+
op: {
|
|
16
|
+
type: PropType<string[]>;
|
|
17
|
+
default: () => string[];
|
|
18
|
+
};
|
|
19
|
+
onSearch: FunctionConstructor;
|
|
20
|
+
};
|
|
21
|
+
export declare type EpieInlineSearchProps = Partial<ExtractPropTypes<ReturnType<typeof epieInlineSearchProps>>>;
|
|
22
|
+
export declare type EpieRenderCtx = EpieInlineSearchProps & {
|
|
23
|
+
form: any;
|
|
24
|
+
reset: any;
|
|
25
|
+
loading: any;
|
|
26
|
+
search: any;
|
|
27
|
+
};
|
|
28
|
+
declare const _default: import("vue").DefineComponent<{
|
|
29
|
+
data: {
|
|
30
|
+
type: ObjectConstructor;
|
|
31
|
+
default: () => void;
|
|
32
|
+
};
|
|
33
|
+
items: {
|
|
34
|
+
type: PropType<EpieInlineSearchItem[]>;
|
|
35
|
+
default: () => never[];
|
|
36
|
+
};
|
|
37
|
+
op: {
|
|
38
|
+
type: PropType<string[]>;
|
|
39
|
+
default: () => string[];
|
|
40
|
+
};
|
|
41
|
+
onSearch: FunctionConstructor;
|
|
42
|
+
}, {
|
|
43
|
+
form: any;
|
|
44
|
+
reset: () => void;
|
|
45
|
+
loading: import("vue").Ref<boolean>;
|
|
46
|
+
search: () => void;
|
|
47
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
48
|
+
data: {
|
|
49
|
+
type: ObjectConstructor;
|
|
50
|
+
default: () => void;
|
|
51
|
+
};
|
|
52
|
+
items: {
|
|
53
|
+
type: PropType<EpieInlineSearchItem[]>;
|
|
54
|
+
default: () => never[];
|
|
55
|
+
};
|
|
56
|
+
op: {
|
|
57
|
+
type: PropType<string[]>;
|
|
58
|
+
default: () => string[];
|
|
59
|
+
};
|
|
60
|
+
onSearch: FunctionConstructor;
|
|
61
|
+
}>>, {
|
|
62
|
+
data: Record<string, any>;
|
|
63
|
+
items: EpieInlineSearchItem[];
|
|
64
|
+
op: string[];
|
|
65
|
+
}>;
|
|
66
|
+
export default _default;
|
package/lib/utils/test.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const UserList: ({
|
|
|
4
4
|
createTime: string;
|
|
5
5
|
price: number;
|
|
6
6
|
status: number;
|
|
7
|
+
duration: number;
|
|
7
8
|
statusx: string;
|
|
8
9
|
hook: string;
|
|
9
10
|
} | {
|
|
@@ -13,6 +14,7 @@ export declare const UserList: ({
|
|
|
13
14
|
price: number;
|
|
14
15
|
status: number;
|
|
15
16
|
statusx: string;
|
|
17
|
+
duration?: undefined;
|
|
16
18
|
hook?: undefined;
|
|
17
19
|
} | {
|
|
18
20
|
id: number;
|
|
@@ -20,6 +22,7 @@ export declare const UserList: ({
|
|
|
20
22
|
createTime: string;
|
|
21
23
|
price: number;
|
|
22
24
|
status: number;
|
|
25
|
+
duration?: undefined;
|
|
23
26
|
statusx?: undefined;
|
|
24
27
|
hook?: undefined;
|
|
25
28
|
})[];
|