UNPKG

mt-ui-components-vue3

Version:

玛果添实UI组件库(Vue3)

114 lines 5.72 kB
/* Analyzed bindings: { "range": "props", "value": "props", "JPopconfirmModal": "setup-maybe-ref", "JButton": "setup-maybe-ref", "JForm": "setup-maybe-ref", "JFormItem": "setup-maybe-ref", "JInputNumber": "setup-maybe-ref", "reactive": "setup-const", "props": "setup-reactive-const", "emit": "setup-const", "formData": "setup-reactive-const", "confirm": "setup-const" } */ import { defineComponent as _defineComponent } from 'vue'; import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock } from "vue"; const _hoisted_1 = { key: 1, class: "data-table-boolean-item" }; const _hoisted_2 = { class: "data-table-boolean-item--value" }; const _hoisted_3 = /*#__PURE__*/ _createElementVNode("div", null, "-", -1 /* HOISTED */); const _hoisted_4 = { class: "data-table-boolean-item--value" }; import { PopconfirmModal as JPopconfirmModal, Button as JButton, Form as JForm, FormItem as JFormItem, InputNumber as JInputNumber, } from '../../../components'; import { reactive } from 'vue'; const __sfc_main__ = _defineComponent({ props: { range: { type: Boolean, default: false, }, value: { type: [Number, Array], default: undefined, }, }, emits: ["update:value"], setup(__props, { emit }) { const props = __props; const formData = reactive({ value: props.range === false ? props.value : undefined, rangeValue: props.range ? props.value || [undefined, undefined] : [undefined, undefined], }); const confirm = () => { emit('update:value', props.range ? formData.rangeValue : formData.value); }; return (_ctx, _cache) => { return (_openBlock(), _createBlock(_unref(JPopconfirmModal), { "show-cancel": false, "body-style": "width: 300px", onConfirm: confirm }, { content: _withCtx(() => [ _createVNode(_unref(JForm), { modal: formData }, { default: _withCtx(() => [ (__props.range === false) ? (_openBlock(), _createBlock(_unref(JFormItem), { key: 0 }, { default: _withCtx(() => [ _createVNode(_unref(JInputNumber), { value: formData.value, "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((formData.value) = $event)), precision: 0, style: { "width": "100%" } }, null, 8 /* PROPS */, ["value"]) ]), _: 1 /* STABLE */ })) : (_openBlock(), _createElementBlock("div", _hoisted_1, [ _createElementVNode("div", _hoisted_2, [ _createVNode(_unref(JFormItem), { name: "trueText" }, { default: _withCtx(() => [ _createVNode(_unref(JInputNumber), { value: formData.rangeValue[0], "onUpdate:value": _cache[1] || (_cache[1] = ($event) => ((formData.rangeValue[0]) = $event)), precision: 0, style: { "width": "100%" } }, null, 8 /* PROPS */, ["value"]) ]), _: 1 /* STABLE */ }) ]), _hoisted_3, _createElementVNode("div", _hoisted_4, [ _createVNode(_unref(JFormItem), { name: "trueValue" }, { default: _withCtx(() => [ _createVNode(_unref(JInputNumber), { value: formData.rangeValue[1], "onUpdate:value": _cache[2] || (_cache[2] = ($event) => ((formData.rangeValue[1]) = $event)), precision: 0, style: { "width": "100%" } }, null, 8 /* PROPS */, ["value"]) ]), _: 1 /* STABLE */ }) ]) ])) ]), _: 1 /* STABLE */ }, 8 /* PROPS */, ["modal"]) ]), default: _withCtx(() => [ _createVNode(_unref(JButton), { "my-icon": "EditOutlined", style: { "padding": "4px 8px" } }) ]), _: 1 /* STABLE */ })); }; } }); export default __sfc_main__;