@vipl520/dk-ui 1.0.60 → 1.0.61
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.css +1 -1
- package/dist/index.js +2 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +3 -3
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/web-types.json +1 -1
- package/es/form/src/form.vue2.mjs +1 -1
- package/es/form/src/form.vue2.mjs.map +1 -1
- package/es/form/style/index.css +1 -1
- package/es/form/style/index.scss +3 -3
- package/es/page-diy/src/views/web/DkViewNavBar.vue.d.ts +1 -1
- package/es/page-diy/src/views/web/DkViewTitle.vue.d.ts +1 -1
- package/lib/form/src/form.vue2.js +1 -1
- package/lib/form/src/form.vue2.js.map +1 -1
- package/lib/form/style/index.css +1 -1
- package/lib/form/style/index.scss +3 -3
- package/lib/page-diy/src/views/web/DkViewNavBar.vue.d.ts +1 -1
- package/lib/page-diy/src/views/web/DkViewTitle.vue.d.ts +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
@@ -2588,7 +2588,7 @@ var _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
2588
2588
|
"div",
|
2589
2589
|
{
|
2590
2590
|
style: normalizeStyle(dialogStyle.value),
|
2591
|
-
class: "dk-form"
|
2591
|
+
class: "dk-form p10px"
|
2592
2592
|
},
|
2593
2593
|
[
|
2594
2594
|
createVNode(unref(FormCreate), {
|
@@ -24119,6 +24119,7 @@ const SelectProps = buildProps({
|
|
24119
24119
|
default: ["bottom-start", "top-start", "right", "left"]
|
24120
24120
|
},
|
24121
24121
|
tagType: { ...tagProps.type, default: "info" },
|
24122
|
+
tagEffect: { ...tagProps.effect, default: "light" },
|
24122
24123
|
...useEmptyValuesProps,
|
24123
24124
|
...useAriaProps(["ariaLabel"])
|
24124
24125
|
});
|
package/dist/web-types.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"form.vue2.mjs","sources":["../../../src/form/src/form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkForm',\n});\n</script>\n<template>\n <DkDialog\n v-if=\"props.isDialog\"\n v-model=\"showDialog\"\n :title=\"_formData?.title ? _formData?.title : '表单'\"\n :width=\"dialogWidth\"\n :default-fullscreen=\"isFullscreen\"\n min-height=\"200px\"\n v-bind=\"dialogProps\"\n append-to-body\n >\n <div :style=\"dialogStyle\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交</el-button>\n </slot>\n </div>\n </div>\n </DkDialog>\n <div v-else>\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交</el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, isArray, isObject, request } from '@vipl520/utils'\nimport formCreate from '@form-create/element-ui'\nimport { formProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport _config from './config'\nimport { ElButton, ElMessage } from 'element-plus'\nimport { useWindowSize } from '@vueuse/core'\n\nconst [_, bem] = createNamespace('form')\n\nformCreate.register({\n name: 'help',\n init({ value }, rule) {\n // 判断value是字符串还是数组,如果是字符串则转换为数组,如果是数组则不变\n if (!isArray(value)) {\n value = [value]\n }\n rule.suffix = {\n type: 'p',\n children: value,\n class: 'form-help',\n }\n },\n})\n\n\nconst FormCreate = formCreate.$form()\n\nconst props = defineProps(formProps)\n\nconst config = reactive(_config)\nconst fApi = ref()\nconst loading = ref(true)\nconst buttonLoading = ref(false)\n\nconst showDialog = ref(false)\nconst formConfig = computed(() => ({ ...config, ...props.extraConfig }))\nconst { width } = useWindowSize()\nconst value = ref(null)\nconst _formData = ref(props.formData || {})\n\nconst emit = defineEmits(['submit', 'fail', 'update:modelValue'])\nwatch(\n () => props.formData,\n () => {\n _formData.value = props.formData\n },\n {\n deep: true,\n }\n)\nwatch(\n () => value.value,\n (val) => {\n emit('update:modelValue', val || {})\n }\n)\n// 弹窗宽度\nconst dialogWidth = computed(() => {\n let defaultWidth = '800px'\n const config = _formData.value?.config || {}\n if (config?.width) {\n return config?.width\n }\n if (props.dialog?.width) {\n defaultWidth = props.dialog?.width\n }\n if (config?.defaultWidth) {\n defaultWidth = config?.defaultWidth\n }\n let minWidth = 768\n // 判断是否为百分比\n if (!defaultWidth.endsWith('%')) {\n minWidth = parseInt(defaultWidth)\n }\n return width.value < minWidth ? '100%' : defaultWidth\n})\n// 弹窗内样式\nconst dialogStyle = computed(() => {\n if (_formData.value?.config?.style) {\n return _formData.value?.config?.style\n }\n if (props.dialog?.style) {\n return props.dialog?.style\n }\n return {}\n})\n// const draggable = computed(() => {\n// let draggable = false\n// if (props.dialog?.draggable) {\n// draggable = props.dialog?.draggable\n// }\n// if (_formData.value?.config?.draggable !== undefined) {\n// draggable = _formData.value?.config?.draggable\n// }\n// return draggable\n// })\n// 是否全屏\nconst isFullscreen = computed(() => {\n let defaultFullscreen = false\n const autoFullscreen = _formData.value?.config?.autoFullscreen !== false\n if (props.dialog?.width) {\n defaultFullscreen = props.dialog?.fullscreen\n }\n if (_formData.value?.config?.fullscreen) {\n defaultFullscreen = _formData.value?.config?.fullscreen\n }\n\n if (width.value < 768 && autoFullscreen) {\n defaultFullscreen = true\n }\n\n return defaultFullscreen\n})\n\nconst dialogProps = computed(() => {\n return Object.assign(props.dialog, _formData.value?.config?.dialog)\n})\nconst setFormData = (formData: any) => {\n value.value = null\n _formData.value = formData\n}\n\nconst initFormData = (formUrl?: string | object) => {\n if (!formUrl) {\n formUrl = props.formUrl\n }\n\n if (props.formData) {\n loading.value = false\n } else if (formUrl) {\n let data: {}\n if (isObject(formUrl)) {\n data = formUrl\n } else {\n data = {\n url: formUrl,\n method: 'post',\n }\n }\n request(data)\n .then((res) => {\n _formData.value = res.data\n loading.value = false\n })\n .catch((res) => {\n loading.value = false\n })\n }\n}\n\nconst checkForm = () => {\n fApi.value\n .validate()\n .then(() => {\n fApi.value\n .submit((data: any) => {\n onSubmit(data)\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n}\n\nconst onSubmit = (data: any) => {\n if (props.isLoading) {\n buttonLoading.value = true\n }\n if (props.isSubmit) {\n request({\n url: props.path + _formData.value.action,\n method: _formData.value.method,\n data: { formData: data },\n })\n .then((res) => {\n ElMessage.success(res.msg)\n emit('submit', data, res)\n buttonLoading.value = false\n })\n .catch((res) => {\n ElMessage.error(res.msg)\n emit('fail', data, res)\n buttonLoading.value = false\n })\n } else {\n emit('submit', data)\n buttonLoading.value = false\n }\n showDialog.value = false\n}\n\nconst show = () => {\n showDialog.value = true\n}\nonMounted(() => {\n initFormData()\n})\n// 导出\ndefineExpose({\n showDialog,\n buttonLoading,\n fApi,\n value,\n show,\n checkForm,\n onSubmit,\n initFormData,\n setFormData,\n})\n</script>\n"],"names":["__MACROS_defineComponent","value","config","_config"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA4D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;AAAA,KACrB,CAAA;AACA,IAAA,SAAA,CAAU,MAAM;AACd,MAAa,YAAA,EAAA,CAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"form.vue2.mjs","sources":["../../../src/form/src/form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkForm',\n});\n</script>\n<template>\n <DkDialog\n v-if=\"props.isDialog\"\n v-model=\"showDialog\"\n :title=\"_formData?.title ? _formData?.title : '表单'\"\n :width=\"dialogWidth\"\n :default-fullscreen=\"isFullscreen\"\n min-height=\"200px\"\n v-bind=\"dialogProps\"\n append-to-body\n >\n <div :style=\"dialogStyle\" class=\"dk-form p10px\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交</el-button>\n </slot>\n </div>\n </div>\n </DkDialog>\n <div v-else>\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交</el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, isArray, isObject, request } from '@vipl520/utils'\nimport formCreate from '@form-create/element-ui'\nimport { formProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport _config from './config'\nimport { ElButton, ElMessage } from 'element-plus'\nimport { useWindowSize } from '@vueuse/core'\n\nconst [_, bem] = createNamespace('form')\n\nformCreate.register({\n name: 'help',\n init({ value }, rule) {\n // 判断value是字符串还是数组,如果是字符串则转换为数组,如果是数组则不变\n if (!isArray(value)) {\n value = [value]\n }\n rule.suffix = {\n type: 'p',\n children: value,\n class: 'form-help',\n }\n },\n})\n\n\nconst FormCreate = formCreate.$form()\n\nconst props = defineProps(formProps)\n\nconst config = reactive(_config)\nconst fApi = ref()\nconst loading = ref(true)\nconst buttonLoading = ref(false)\n\nconst showDialog = ref(false)\nconst formConfig = computed(() => ({ ...config, ...props.extraConfig }))\nconst { width } = useWindowSize()\nconst value = ref(null)\nconst _formData = ref(props.formData || {})\n\nconst emit = defineEmits(['submit', 'fail', 'update:modelValue'])\nwatch(\n () => props.formData,\n () => {\n _formData.value = props.formData\n },\n {\n deep: true,\n }\n)\nwatch(\n () => value.value,\n (val) => {\n emit('update:modelValue', val || {})\n }\n)\n// 弹窗宽度\nconst dialogWidth = computed(() => {\n let defaultWidth = '800px'\n const config = _formData.value?.config || {}\n if (config?.width) {\n return config?.width\n }\n if (props.dialog?.width) {\n defaultWidth = props.dialog?.width\n }\n if (config?.defaultWidth) {\n defaultWidth = config?.defaultWidth\n }\n let minWidth = 768\n // 判断是否为百分比\n if (!defaultWidth.endsWith('%')) {\n minWidth = parseInt(defaultWidth)\n }\n return width.value < minWidth ? '100%' : defaultWidth\n})\n// 弹窗内样式\nconst dialogStyle = computed(() => {\n if (_formData.value?.config?.style) {\n return _formData.value?.config?.style\n }\n if (props.dialog?.style) {\n return props.dialog?.style\n }\n return {}\n})\n// const draggable = computed(() => {\n// let draggable = false\n// if (props.dialog?.draggable) {\n// draggable = props.dialog?.draggable\n// }\n// if (_formData.value?.config?.draggable !== undefined) {\n// draggable = _formData.value?.config?.draggable\n// }\n// return draggable\n// })\n// 是否全屏\nconst isFullscreen = computed(() => {\n let defaultFullscreen = false\n const autoFullscreen = _formData.value?.config?.autoFullscreen !== false\n if (props.dialog?.width) {\n defaultFullscreen = props.dialog?.fullscreen\n }\n if (_formData.value?.config?.fullscreen) {\n defaultFullscreen = _formData.value?.config?.fullscreen\n }\n\n if (width.value < 768 && autoFullscreen) {\n defaultFullscreen = true\n }\n\n return defaultFullscreen\n})\n\nconst dialogProps = computed(() => {\n return Object.assign(props.dialog, _formData.value?.config?.dialog)\n})\nconst setFormData = (formData: any) => {\n value.value = null\n _formData.value = formData\n}\n\nconst initFormData = (formUrl?: string | object) => {\n if (!formUrl) {\n formUrl = props.formUrl\n }\n\n if (props.formData) {\n loading.value = false\n } else if (formUrl) {\n let data: {}\n if (isObject(formUrl)) {\n data = formUrl\n } else {\n data = {\n url: formUrl,\n method: 'post',\n }\n }\n request(data)\n .then((res) => {\n _formData.value = res.data\n loading.value = false\n })\n .catch((res) => {\n loading.value = false\n })\n }\n}\n\nconst checkForm = () => {\n fApi.value\n .validate()\n .then(() => {\n fApi.value\n .submit((data: any) => {\n onSubmit(data)\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n}\n\nconst onSubmit = (data: any) => {\n if (props.isLoading) {\n buttonLoading.value = true\n }\n if (props.isSubmit) {\n request({\n url: props.path + _formData.value.action,\n method: _formData.value.method,\n data: { formData: data },\n })\n .then((res) => {\n ElMessage.success(res.msg)\n emit('submit', data, res)\n buttonLoading.value = false\n })\n .catch((res) => {\n ElMessage.error(res.msg)\n emit('fail', data, res)\n buttonLoading.value = false\n })\n } else {\n emit('submit', data)\n buttonLoading.value = false\n }\n showDialog.value = false\n}\n\nconst show = () => {\n showDialog.value = true\n}\nonMounted(() => {\n initFormData()\n})\n// 导出\ndefineExpose({\n showDialog,\n buttonLoading,\n fApi,\n value,\n show,\n checkForm,\n onSubmit,\n initFormData,\n setFormData,\n})\n</script>\n"],"names":["__MACROS_defineComponent","value","config","_config"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA4DD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,MAAM,CAAA,CAAA;AAEvC,IAAA,UAAA,CAAW,QAAS,CAAA;AAAA,MAClB,IAAM,EAAA,MAAA;AAAA,MACN,IAAK,CAAA,EAAE,KAAAC,EAAAA,MAAAA,IAAS,IAAM,EAAA;AAEpB,QAAI,IAAA,CAAC,OAAQA,CAAAA,MAAK,CAAG,EAAA;AACnB,UAAAA,MAAAA,GAAQ,CAACA,MAAK,CAAA,CAAA;AAAA,SAChB;AACA,QAAA,IAAA,CAAK,MAAS,GAAA;AAAA,UACZ,IAAM,EAAA,GAAA;AAAA,UACN,QAAUA,EAAAA,MAAAA;AAAA,UACV,KAAO,EAAA,WAAA;AAAA,SACT,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAGD,IAAM,MAAA,UAAA,GAAa,WAAW,KAAM,EAAA,CAAA;AAIpC,IAAM,MAAAC,QAAA,GAAS,SAASC,MAAO,CAAA,CAAA;AAC/B,IAAA,MAAM,OAAO,GAAI,EAAA,CAAA;AACjB,IAAM,MAAA,OAAA,GAAU,IAAI,IAAI,CAAA,CAAA;AACxB,IAAM,MAA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A,KAAM,CAAA,CAAC,GAAQ,KAAA;AACd,UAAU,SAAA,CAAA,KAAA,CAAM,IAAI,GAAG,CAAA,CAAA;AACvB,UAAK,IAAA,CAAA,MAAA,EAAQ,MAAM,GAAG,CAAA,CAAA;AACtB,UAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,SACvB,CAAA,CAAA;AAAA,OACE,MAAA;AACL,QAAA,IAAA,CAAK,UAAU,IAAI,CAAA,CAAA;AACnB,QAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,OACxB;AACA,MAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AAAA,KACrB,CAAA;AAEA,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AAAA,KACrB,CAAA;AACA,IAAA,SAAA,CAAU,MAAM;AACd,MAAa,YAAA,EAAA,CAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/es/form/style/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.dk-form .form-help{margin-top:4px;margin-bottom:0;font-size:12px;line-height:1.5;color:#888}
|
1
|
+
.dk-form .form-help{margin-top:4px;margin-bottom:0;font-size:12px;line-height:1.5;color:#888}
|
package/es/form/style/index.scss
CHANGED
@@ -59,10 +59,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
59
59
|
}>>, {
|
60
60
|
title: string;
|
61
61
|
placeholder: boolean;
|
62
|
+
fixed: boolean;
|
62
63
|
border: boolean;
|
63
64
|
leftText: string;
|
64
65
|
rightText: string;
|
65
66
|
leftArrow: boolean;
|
66
|
-
fixed: boolean;
|
67
67
|
}, {}>;
|
68
68
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"form.vue2.js","sources":["../../../src/form/src/form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkForm',\n});\n</script>\n<template>\n <DkDialog\n v-if=\"props.isDialog\"\n v-model=\"showDialog\"\n :title=\"_formData?.title ? _formData?.title : '表单'\"\n :width=\"dialogWidth\"\n :default-fullscreen=\"isFullscreen\"\n min-height=\"200px\"\n v-bind=\"dialogProps\"\n append-to-body\n >\n <div :style=\"dialogStyle\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交</el-button>\n </slot>\n </div>\n </div>\n </DkDialog>\n <div v-else>\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交</el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, isArray, isObject, request } from '@vipl520/utils'\nimport formCreate from '@form-create/element-ui'\nimport { formProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport _config from './config'\nimport { ElButton, ElMessage } from 'element-plus'\nimport { useWindowSize } from '@vueuse/core'\n\nconst [_, bem] = createNamespace('form')\n\nformCreate.register({\n name: 'help',\n init({ value }, rule) {\n // 判断value是字符串还是数组,如果是字符串则转换为数组,如果是数组则不变\n if (!isArray(value)) {\n value = [value]\n }\n rule.suffix = {\n type: 'p',\n children: value,\n class: 'form-help',\n }\n },\n})\n\n\nconst FormCreate = formCreate.$form()\n\nconst props = defineProps(formProps)\n\nconst config = reactive(_config)\nconst fApi = ref()\nconst loading = ref(true)\nconst buttonLoading = ref(false)\n\nconst showDialog = ref(false)\nconst formConfig = computed(() => ({ ...config, ...props.extraConfig }))\nconst { width } = useWindowSize()\nconst value = ref(null)\nconst _formData = ref(props.formData || {})\n\nconst emit = defineEmits(['submit', 'fail', 'update:modelValue'])\nwatch(\n () => props.formData,\n () => {\n _formData.value = props.formData\n },\n {\n deep: true,\n }\n)\nwatch(\n () => value.value,\n (val) => {\n emit('update:modelValue', val || {})\n }\n)\n// 弹窗宽度\nconst dialogWidth = computed(() => {\n let defaultWidth = '800px'\n const config = _formData.value?.config || {}\n if (config?.width) {\n return config?.width\n }\n if (props.dialog?.width) {\n defaultWidth = props.dialog?.width\n }\n if (config?.defaultWidth) {\n defaultWidth = config?.defaultWidth\n }\n let minWidth = 768\n // 判断是否为百分比\n if (!defaultWidth.endsWith('%')) {\n minWidth = parseInt(defaultWidth)\n }\n return width.value < minWidth ? '100%' : defaultWidth\n})\n// 弹窗内样式\nconst dialogStyle = computed(() => {\n if (_formData.value?.config?.style) {\n return _formData.value?.config?.style\n }\n if (props.dialog?.style) {\n return props.dialog?.style\n }\n return {}\n})\n// const draggable = computed(() => {\n// let draggable = false\n// if (props.dialog?.draggable) {\n// draggable = props.dialog?.draggable\n// }\n// if (_formData.value?.config?.draggable !== undefined) {\n// draggable = _formData.value?.config?.draggable\n// }\n// return draggable\n// })\n// 是否全屏\nconst isFullscreen = computed(() => {\n let defaultFullscreen = false\n const autoFullscreen = _formData.value?.config?.autoFullscreen !== false\n if (props.dialog?.width) {\n defaultFullscreen = props.dialog?.fullscreen\n }\n if (_formData.value?.config?.fullscreen) {\n defaultFullscreen = _formData.value?.config?.fullscreen\n }\n\n if (width.value < 768 && autoFullscreen) {\n defaultFullscreen = true\n }\n\n return defaultFullscreen\n})\n\nconst dialogProps = computed(() => {\n return Object.assign(props.dialog, _formData.value?.config?.dialog)\n})\nconst setFormData = (formData: any) => {\n value.value = null\n _formData.value = formData\n}\n\nconst initFormData = (formUrl?: string | object) => {\n if (!formUrl) {\n formUrl = props.formUrl\n }\n\n if (props.formData) {\n loading.value = false\n } else if (formUrl) {\n let data: {}\n if (isObject(formUrl)) {\n data = formUrl\n } else {\n data = {\n url: formUrl,\n method: 'post',\n }\n }\n request(data)\n .then((res) => {\n _formData.value = res.data\n loading.value = false\n })\n .catch((res) => {\n loading.value = false\n })\n }\n}\n\nconst checkForm = () => {\n fApi.value\n .validate()\n .then(() => {\n fApi.value\n .submit((data: any) => {\n onSubmit(data)\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n}\n\nconst onSubmit = (data: any) => {\n if (props.isLoading) {\n buttonLoading.value = true\n }\n if (props.isSubmit) {\n request({\n url: props.path + _formData.value.action,\n method: _formData.value.method,\n data: { formData: data },\n })\n .then((res) => {\n ElMessage.success(res.msg)\n emit('submit', data, res)\n buttonLoading.value = false\n })\n .catch((res) => {\n ElMessage.error(res.msg)\n emit('fail', data, res)\n buttonLoading.value = false\n })\n } else {\n emit('submit', data)\n buttonLoading.value = false\n }\n showDialog.value = false\n}\n\nconst show = () => {\n showDialog.value = true\n}\nonMounted(() => {\n initFormData()\n})\n// 导出\ndefineExpose({\n showDialog,\n buttonLoading,\n fApi,\n value,\n show,\n checkForm,\n onSubmit,\n initFormData,\n setFormData,\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","value","isArray","config","reactive","_config","ref","computed","useWindowSize","watch","isObject","request","ElMessage","onMounted"],"mappings":";;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA4DD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAIC,sBAAgB,MAAM,CAAA,CAAA;AAEvC,IAAA,UAAA,CAAW,QAAS,CAAA;AAAA,MAClB,IAAM,EAAA,MAAA;AAAA,MACN,IAAK,CAAA,EAAE,KAAAC,EAAAA,MAAAA,IAAS,IAAM,EAAA;AAEpB,QAAI,IAAA,CAACC,aAAQD,CAAAA,MAAK,CAAG,EAAA;AACnB,UAAAA,MAAAA,GAAQ,CAACA,MAAK,CAAA,CAAA;AAAA,SAChB;AACA,QAAA,IAAA,CAAK,MAAS,GAAA;AAAA,UACZ,IAAM,EAAA,GAAA;AAAA,UACN,QAAUA,EAAAA,MAAAA;AAAA,UACV,KAAO,EAAA,WAAA;AAAA,SACT,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAGD,IAAM,MAAA,UAAA,GAAa,WAAW,KAAM,EAAA,CAAA;AAIpC,IAAM,MAAAE,QAAA,GAASC,aAASC,cAAO,CAAA,CAAA;AAC/B,IAAA,MAAM,OAAOC,OAAI,EAAA,CAAA;AACjB,IAAM,MAAA,OAAA,GAAUA,QAAI,IAAI,CAAA,CAAA;AACxB,IAAM,MAAA,aAAA,GAAgBA,QAAI,KAAK,CAAA,CAAA;AAE/B,IAAM,MAAA,UAAA,GAAaA,QAAI,KAAK,CAAA,CAAA;AAC5B,IAAM,MAAA,UAAA,GAAaC,aAAS,OAAO,EAAE,GAAGJ,QAAQ,EAAA,GAAG,KAAM,CAAA,WAAA,EAAc,CA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AAc,KAAQ,GAAA,KAAA,CAAA;AAAA,SACvB,CAAA,CAAA;AAAA,OACE,MAAA;AACL,QAAA,IAAA,CAAK,UAAU,IAAI,CAAA,CAAA;AACnB,QAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,OACxB;AACA,MAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AAAA,KACrB,CAAA;AAEA,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AAAA,KACrB,CAAA;AACA,IAAAC,aAAA,CAAU,MAAM;AACd,MAAa,YAAA,EAAA,CAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"form.vue2.js","sources":["../../../src/form/src/form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkForm',\n});\n</script>\n<template>\n <DkDialog\n v-if=\"props.isDialog\"\n v-model=\"showDialog\"\n :title=\"_formData?.title ? _formData?.title : '表单'\"\n :width=\"dialogWidth\"\n :default-fullscreen=\"isFullscreen\"\n min-height=\"200px\"\n v-bind=\"dialogProps\"\n append-to-body\n >\n <div :style=\"dialogStyle\" class=\"dk-form p10px\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交</el-button>\n </slot>\n </div>\n </div>\n </DkDialog>\n <div v-else>\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交</el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, isArray, isObject, request } from '@vipl520/utils'\nimport formCreate from '@form-create/element-ui'\nimport { formProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport _config from './config'\nimport { ElButton, ElMessage } from 'element-plus'\nimport { useWindowSize } from '@vueuse/core'\n\nconst [_, bem] = createNamespace('form')\n\nformCreate.register({\n name: 'help',\n init({ value }, rule) {\n // 判断value是字符串还是数组,如果是字符串则转换为数组,如果是数组则不变\n if (!isArray(value)) {\n value = [value]\n }\n rule.suffix = {\n type: 'p',\n children: value,\n class: 'form-help',\n }\n },\n})\n\n\nconst FormCreate = formCreate.$form()\n\nconst props = defineProps(formProps)\n\nconst config = reactive(_config)\nconst fApi = ref()\nconst loading = ref(true)\nconst buttonLoading = ref(false)\n\nconst showDialog = ref(false)\nconst formConfig = computed(() => ({ ...config, ...props.extraConfig }))\nconst { width } = useWindowSize()\nconst value = ref(null)\nconst _formData = ref(props.formData || {})\n\nconst emit = defineEmits(['submit', 'fail', 'update:modelValue'])\nwatch(\n () => props.formData,\n () => {\n _formData.value = props.formData\n },\n {\n deep: true,\n }\n)\nwatch(\n () => value.value,\n (val) => {\n emit('update:modelValue', val || {})\n }\n)\n// 弹窗宽度\nconst dialogWidth = computed(() => {\n let defaultWidth = '800px'\n const config = _formData.value?.config || {}\n if (config?.width) {\n return config?.width\n }\n if (props.dialog?.width) {\n defaultWidth = props.dialog?.width\n }\n if (config?.defaultWidth) {\n defaultWidth = config?.defaultWidth\n }\n let minWidth = 768\n // 判断是否为百分比\n if (!defaultWidth.endsWith('%')) {\n minWidth = parseInt(defaultWidth)\n }\n return width.value < minWidth ? '100%' : defaultWidth\n})\n// 弹窗内样式\nconst dialogStyle = computed(() => {\n if (_formData.value?.config?.style) {\n return _formData.value?.config?.style\n }\n if (props.dialog?.style) {\n return props.dialog?.style\n }\n return {}\n})\n// const draggable = computed(() => {\n// let draggable = false\n// if (props.dialog?.draggable) {\n// draggable = props.dialog?.draggable\n// }\n// if (_formData.value?.config?.draggable !== undefined) {\n// draggable = _formData.value?.config?.draggable\n// }\n// return draggable\n// })\n// 是否全屏\nconst isFullscreen = computed(() => {\n let defaultFullscreen = false\n const autoFullscreen = _formData.value?.config?.autoFullscreen !== false\n if (props.dialog?.width) {\n defaultFullscreen = props.dialog?.fullscreen\n }\n if (_formData.value?.config?.fullscreen) {\n defaultFullscreen = _formData.value?.config?.fullscreen\n }\n\n if (width.value < 768 && autoFullscreen) {\n defaultFullscreen = true\n }\n\n return defaultFullscreen\n})\n\nconst dialogProps = computed(() => {\n return Object.assign(props.dialog, _formData.value?.config?.dialog)\n})\nconst setFormData = (formData: any) => {\n value.value = null\n _formData.value = formData\n}\n\nconst initFormData = (formUrl?: string | object) => {\n if (!formUrl) {\n formUrl = props.formUrl\n }\n\n if (props.formData) {\n loading.value = false\n } else if (formUrl) {\n let data: {}\n if (isObject(formUrl)) {\n data = formUrl\n } else {\n data = {\n url: formUrl,\n method: 'post',\n }\n }\n request(data)\n .then((res) => {\n _formData.value = res.data\n loading.value = false\n })\n .catch((res) => {\n loading.value = false\n })\n }\n}\n\nconst checkForm = () => {\n fApi.value\n .validate()\n .then(() => {\n fApi.value\n .submit((data: any) => {\n onSubmit(data)\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n}\n\nconst onSubmit = (data: any) => {\n if (props.isLoading) {\n buttonLoading.value = true\n }\n if (props.isSubmit) {\n request({\n url: props.path + _formData.value.action,\n method: _formData.value.method,\n data: { formData: data },\n })\n .then((res) => {\n ElMessage.success(res.msg)\n emit('submit', data, res)\n buttonLoading.value = false\n })\n .catch((res) => {\n ElMessage.error(res.msg)\n emit('fail', data, res)\n buttonLoading.value = false\n })\n } else {\n emit('submit', data)\n buttonLoading.value = false\n }\n showDialog.value = false\n}\n\nconst show = () => {\n showDialog.value = true\n}\nonMounted(() => {\n initFormData()\n})\n// 导出\ndefineExpose({\n showDialog,\n buttonLoading,\n fApi,\n value,\n show,\n checkForm,\n onSubmit,\n initFormData,\n setFormData,\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","value","isArray","config","reactive","_config","ref","computed","useWindowSize","watch","isObject","request","ElMessage","onMounted"],"mappings":";;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA4DD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAIC,sBAAgB,MAAM,CAAA,CAAA;AAEvC,IAAA,UAAA,CAAW,QAAS,CAAA;AAAA,MAClB,IAAM,EAAA,MAAA;AAAA,MACN,IAAK,CAAA,EAAE,KAAAC,EAAAA,MAAAA,IAAS,IAAM,EAAA;AAEpB,QAAI,IAAA,CAACC,aAAQD,CAAAA,MAAK,CAAG,EAAA;AACnB,UAAAA,MAAAA,GAAQ,CAACA,MAAK,CAAA,CAAA;AAAA,SAChB;AACA,QAAA,IAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/form/style/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.dk-form .form-help{margin-top:4px;margin-bottom:0;font-size:12px;line-height:1.5;color:#888}
|
1
|
+
.dk-form .form-help{margin-top:4px;margin-bottom:0;font-size:12px;line-height:1.5;color:#888}
|
@@ -59,10 +59,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
59
59
|
}>>, {
|
60
60
|
title: string;
|
61
61
|
placeholder: boolean;
|
62
|
+
fixed: boolean;
|
62
63
|
border: boolean;
|
63
64
|
leftText: string;
|
64
65
|
rightText: string;
|
65
66
|
leftArrow: boolean;
|
66
|
-
fixed: boolean;
|
67
67
|
}, {}>;
|
68
68
|
export default _default;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vipl520/dk-ui",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.61",
|
4
4
|
"description": "多客怪兽框架核心组件,支持diy、crud动态表格、上传组件等",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "es/index.mjs",
|
@@ -26,14 +26,14 @@
|
|
26
26
|
},
|
27
27
|
"peerDependencies": {
|
28
28
|
"@element-plus/icons-vue": "^2.1.0",
|
29
|
-
"@form-create/element-ui": "^3.
|
29
|
+
"@form-create/element-ui": "^3.2.0",
|
30
30
|
"@form-create/utils": "^3.1.15",
|
31
31
|
"@iconify/vue": "^4.1.1",
|
32
32
|
"@tinymce/tinymce-vue": "^5.1.1",
|
33
33
|
"@vant/icons": "^3.0.2",
|
34
34
|
"@vueuse/core": "^10.0.0",
|
35
35
|
"axios": "^1.4.0",
|
36
|
-
"element-plus": "^2.7.
|
36
|
+
"element-plus": "^2.7.7",
|
37
37
|
"unocss": "^0.58.0",
|
38
38
|
"vant": "^4.7.0",
|
39
39
|
"vue": "^3.2.0",
|
@@ -58,8 +58,8 @@
|
|
58
58
|
"@codemirror/lang-css": "^6.2.1",
|
59
59
|
"@element-plus/icons-vue": "^2.1.0",
|
60
60
|
"@esbuild-kit/cjs-loader": "^2.4.2",
|
61
|
-
"@form-create/core": "^3.
|
62
|
-
"@form-create/element-ui": "^3.
|
61
|
+
"@form-create/core": "^3.2.0",
|
62
|
+
"@form-create/element-ui": "^3.2.0",
|
63
63
|
"@iconify/iconify": "^3.1.1",
|
64
64
|
"@iconify/vue": "^4.1.1",
|
65
65
|
"@rollup/plugin-commonjs": "^25.0.3",
|
@@ -86,7 +86,7 @@
|
|
86
86
|
"codemirror": "^6.0.1",
|
87
87
|
"components-helper": "^2.1.5",
|
88
88
|
"default-passive-events": "^2.0.0",
|
89
|
-
"element-plus": "^2.7.
|
89
|
+
"element-plus": "^2.7.7",
|
90
90
|
"esbuild": "^0.18.16",
|
91
91
|
"execa": "^7.1.1",
|
92
92
|
"fast-glob": "^3.3.1",
|