easybill-ui 1.2.13 → 1.2.15

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.
@@ -14,8 +14,6 @@
14
14
  </template>
15
15
  </component>
16
16
 
17
- <!-- <FormCompose v-model="modelRef[props.formItem.prop || '']" :props="formItemProps" :form-item="props.formItem" :form-model="modelRef" :event-object="eventObject" /> -->
18
-
19
17
  <FormTooltip v-if="props.formItem.tooltip" :tooltip="props.formItem.tooltip" :form-item="props.formItem" :form-model="props.formModel" />
20
18
  <slot name="suffix"></slot>
21
19
  <div v-if="props.formItem.suffix && isString(props.formItem.suffix)" class="form-item-suffix" v-html="props.formItem.suffix"></div>
@@ -25,7 +23,6 @@
25
23
  <script lang="ts" setup>
26
24
  import { computed, type PropType, ref, type Ref } from "vue"
27
25
  import { getComponent } from "./components"
28
- import FormCompose from "./FormCompose.vue"
29
26
  import FormTooltip from "./FormTooltip.vue"
30
27
  import { useForm } from "./hooks"
31
28
  import type { Fields, FormItem } from "./types"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <el-input-number v-model="model" v-bind="props.props" v-on="eventObject">
3
3
  <template v-for="(item, key) in props.formItem?.slots" :key="key" #[key]="slotScope">
4
- <component :is="item" v-model="modelRef[props.formItem.prop || '']" :form-item="props.formItem" :form-model="modelRef" :props="formItemProps" :event-object="eventObject" />
4
+ <component :is="item" v-model="model" :form-item="props.formItem" :form-model="props.formModel" :props="formItemProps" :event-object="eventObject" />
5
5
  </template>
6
6
  </el-input-number>
7
7
  </template>
@@ -91,11 +91,10 @@
91
91
 
92
92
  <script lang="ts" setup>
93
93
  import { ArrowDown, Delete, Document, Edit, Plus } from "@element-plus/icons-vue"
94
- import { useGlobalConfig, useLocale } from "easybill-ui"
94
+ import { FormDialog, useGlobalConfig, useLocale } from "easybill-ui"
95
95
  import { ElLoading, ElMessage, ElMessageBox, ElTable } from "element-plus"
96
96
  import { computed, getCurrentInstance, onActivated, onMounted, type PropType, provide, reactive, ref, type Ref, watch } from "vue"
97
97
  import type { Fields, FormItem, FormSchema } from "../../CurdForm"
98
- import FormDialog from "../../FormDialog"
99
98
  import type { FilterItem, ListQuery } from "../../TableFilter"
100
99
  import { deepClone } from "../utils/common"
101
100
  import { exportExcel } from "../utils/tabelToExcel"
@@ -15,7 +15,7 @@ export interface DetailDataItem extends Record<string, unknown> {
15
15
  props?: Record<string, string>
16
16
  slot?: string
17
17
  tooltip?: string | import("element-plus/es/components/tooltip").ElTooltipProps
18
- labelPosition?: "left" | "right" | "center"
18
+ labelPosition?: "string" | "left" | "right" | "center"
19
19
  labelStyle?: string | Record<string, string | number>
20
20
  showOverflowTooltip?: boolean | string | Partial<ElTooltipProps>
21
21
  rawContent?: boolean
@@ -21,7 +21,7 @@
21
21
 
22
22
  <script lang="ts">
23
23
  import { useLocale } from "easybill-ui"
24
- import { computed, defineComponent, type PropType, reactive, ref, type Ref, shallowRef, toRefs } from "vue"
24
+ import { computed, defineComponent, type PropType, provide, reactive, ref, type Ref, shallowRef, toRefs } from "vue"
25
25
  import { type Fields, type FormSchema } from "../../CurdForm"
26
26
  export default defineComponent({
27
27
  name: "FormDialog",
@@ -88,7 +88,7 @@ export default defineComponent({
88
88
  visible: true,
89
89
  confirmLoading: false,
90
90
  })
91
- const { t, locale } = useLocale()
91
+ const { t } = useLocale()
92
92
  const stepSchemaList = props.stepSchema?.length ? shallowRef(props.stepSchema) : shallowRef([{ name: "step1", description: "", formSchema: props.formSchema }])
93
93
  const prev = () => {
94
94
  if (state.step > 0) {
@@ -156,7 +156,16 @@ export default defineComponent({
156
156
  }
157
157
  const confirmBtnTextLabel = computed(() => props.confirmBtnText || t("el.formDialog.confirm"))
158
158
  const cancelBtnTextLabel = computed(() => props.cancelBtnText || t("el.formDialog.cancel"))
159
-
159
+ const formDialogContext = reactive({
160
+ form,
161
+ state,
162
+ loadOptions,
163
+ prev,
164
+ next,
165
+ close: onBeforeClose,
166
+ handleOk: onOk,
167
+ })
168
+ provide("formDialogContext", formDialogContext)
160
169
  return {
161
170
  ...toRefs(state),
162
171
  onOk,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easybill-ui",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "A component library for easybill",
5
5
  "author": "tuchongyang <779311998@qq.com>",
6
6
  "private": false,
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "a31099789b92ed5e6b45ecfbd4a81aa311466950"
17
+ "gitHead": "7b32f2606de729a1c90dedb105801267ab60f591"
18
18
  }
@@ -1,24 +0,0 @@
1
- <script setup lang="ts">
2
- import { useLocale } from "easybill-ui"
3
- import { type Component, computed, getCurrentInstance, h } from "vue"
4
- import { getComponent } from "./components"
5
- import { useForm } from "./hooks"
6
- import { FormItemProps } from "./types"
7
- const props = defineProps(FormItemProps)
8
- const model = defineModel()
9
- const { t } = useLocale()
10
- const vm = getCurrentInstance()
11
- function changeRef(el: Component) {
12
- // console.log(el, "el")
13
- vm.exposed = el || {}
14
- vm.exposedProxy = el || {}
15
- }
16
- const { formContext } = useForm()
17
- const comp = computed(() => (formContext.components && formContext.components[props.formItem.type]) || getComponent(props.formItem.type))
18
-
19
- // console.log(props, "==========props")
20
- </script>
21
- <template>
22
- <component style="width: 100%" :ref="changeRef" :is="typeof comp === 'string' ? comp : h(comp, { ...$attrs, ...props, ref: changeRef, modelValue: model }, props.formItem?.slots)" v-model="model" v-bind="props.props" />
23
- </template>
24
- <style scoped lang="scss"></style>