@vipl520/dk-ui 1.0.44 → 1.0.45
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 +1361 -228
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +4 -4
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +1361 -228
- package/es/animate-select/src/animate-select.vue2.mjs.map +1 -1
- package/es/api/attachment.mjs.map +1 -1
- package/es/attachment/src/attachment.vue2.mjs +1 -7
- package/es/attachment/src/attachment.vue2.mjs.map +1 -1
- package/es/audio-list-input/src/audio-list-input.vue2.mjs.map +1 -1
- package/es/dialog/src/dialog.vue2.mjs +1 -3
- package/es/dialog/src/dialog.vue2.mjs.map +1 -1
- package/es/dialog/style/index.css +1 -1
- package/es/dialog/style/index.scss +1 -1
- package/es/file-input/src/file-input.vue2.mjs.map +1 -1
- package/es/file-list-input/src/file-list-input.vue2.mjs.map +1 -1
- package/es/form/src/form.vue2.mjs.map +1 -1
- package/es/hot-area-input/src/component/hot-area-content.vue2.mjs.map +1 -1
- package/es/hot-area-input/src/hot-area-input.vue2.mjs.map +1 -1
- package/es/icon/src/icon.vue2.mjs.map +1 -1
- package/es/icon-input/src/icon-content.vue2.mjs +1 -1
- package/es/icon-input/src/icon-content.vue2.mjs.map +1 -1
- package/es/image-list-input/src/image-list-input.vue2.mjs.map +1 -1
- package/es/page-diy/src/components/DiyCloud.vue.mjs.map +1 -1
- package/es/page-diy/src/components/DragTool.vue.mjs +1 -5
- package/es/page-diy/src/components/DragTool.vue.mjs.map +1 -1
- package/es/page-diy/src/components/PreviewPhone.vue2.mjs.map +1 -1
- package/es/page-diy/src/components/forms/DkEventSelectInput.vue.mjs +9 -11
- package/es/page-diy/src/components/forms/DkEventSelectInput.vue.mjs.map +1 -1
- package/es/page-diy/src/config/base/dkSetting.mjs.map +1 -1
- package/es/page-diy/src/config/rule/min/common/DkMinVideo.mjs +1 -3
- package/es/page-diy/src/config/rule/min/common/DkMinVideo.mjs.map +1 -1
- package/es/page-diy/src/config/rule/min/common/index.mjs +1 -8
- package/es/page-diy/src/config/rule/min/common/index.mjs.map +1 -1
- package/es/page-diy/src/config/rule/web/common/DkPosterBtn.mjs +1 -3
- package/es/page-diy/src/config/rule/web/common/DkPosterBtn.mjs.map +1 -1
- package/es/page-diy/src/config/rule/web/common/DkViewBulletChat.mjs.map +1 -1
- package/es/page-diy/src/config/rule/web/common/DkViewVideo.mjs +3 -9
- package/es/page-diy/src/config/rule/web/common/DkViewVideo.mjs.map +1 -1
- package/es/page-diy/src/utils/eventData.mjs.map +1 -1
- package/es/page-diy/src/views/min/DkMinHotArea.vue.mjs +5 -18
- package/es/page-diy/src/views/min/DkMinHotArea.vue.mjs.map +1 -1
- package/es/page-diy/src/views/min/DkMinSwiperImage.vue.mjs.map +1 -1
- package/es/page-diy/src/views/min/DkMinTitle.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewBulletChat.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewCell.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewCommonBtn.vue.mjs +1 -3
- package/es/page-diy/src/views/web/DkViewCommonBtn.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewGridCellList.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewImage.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewMusic.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewNoticeBar.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewSwipe.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewTitle.vue.mjs.map +1 -1
- package/es/poster-input/src/component/poster.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewAvatar.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewImage.vue2.mjs +1 -1
- package/es/poster-input/src/component/views/DkPosterViewImage.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewName.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewQrcode.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewText.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/quick-action.vue2.mjs.map +1 -1
- package/es/poster-input/src/poster-input.vue2.mjs.map +1 -1
- package/es/poster-input/style/index.scss +2 -4
- package/es/select/src/select.vue2.mjs +1 -9
- package/es/select/src/select.vue2.mjs.map +1 -1
- package/es/style-animation-input/src/props.mjs.map +1 -1
- package/es/style-animation-input/src/style-animation-input.vue2.mjs +1 -1
- package/es/style-animation-input/src/style-animation-input.vue2.mjs.map +1 -1
- package/es/style-font-input/src/style-font-input.vue2.mjs +1 -1
- package/es/style-font-input/src/style-font-input.vue2.mjs.map +1 -1
- package/es/style-number-input/src/style-number-input.vue2.mjs.map +1 -1
- package/es/style-position-input/src/style-position-input.vue2.mjs +1 -4
- package/es/style-position-input/src/style-position-input.vue2.mjs.map +1 -1
- package/es/table/src/components/ComSearch.vue2.mjs.map +1 -1
- package/es/table/src/components/FieldRender.vue2.mjs.map +1 -1
- package/es/table/src/components/RecycleDialog.vue2.mjs +1 -3
- package/es/table/src/components/RecycleDialog.vue2.mjs.map +1 -1
- package/es/table/src/components/header.vue2.mjs +3 -17
- package/es/table/src/components/header.vue2.mjs.map +1 -1
- package/es/table/src/props.mjs +1 -11
- package/es/table/src/props.mjs.map +1 -1
- package/es/table/src/table.vue2.mjs +3 -13
- package/es/table/src/table.vue2.mjs.map +1 -1
- package/es/table/utils/dkTable.mjs +8 -31
- package/es/table/utils/dkTable.mjs.map +1 -1
- package/es/table/utils/dkTableApi.mjs.map +1 -1
- package/es/tiny-editor/src/tiny-editor.vue2.mjs +1 -1
- package/es/tiny-editor/src/tiny-editor.vue2.mjs.map +1 -1
- package/es/video-list-input/src/video-list-input.vue2.mjs.map +1 -1
- package/lib/animate-select/src/animate-select.vue2.js.map +1 -1
- package/lib/api/attachment.js.map +1 -1
- package/lib/attachment/src/attachment.vue2.js +1 -7
- package/lib/attachment/src/attachment.vue2.js.map +1 -1
- package/lib/audio-list-input/src/audio-list-input.vue2.js.map +1 -1
- package/lib/dialog/src/dialog.vue2.js +1 -3
- package/lib/dialog/src/dialog.vue2.js.map +1 -1
- package/lib/dialog/style/index.css +1 -1
- package/lib/dialog/style/index.scss +1 -1
- package/lib/file-input/src/file-input.vue2.js.map +1 -1
- package/lib/file-list-input/src/file-list-input.vue2.js.map +1 -1
- package/lib/form/src/form.vue2.js.map +1 -1
- package/lib/hot-area-input/src/component/hot-area-content.vue2.js.map +1 -1
- package/lib/hot-area-input/src/hot-area-input.vue2.js.map +1 -1
- package/lib/icon/src/icon.vue2.js.map +1 -1
- package/lib/icon-input/src/icon-content.vue2.js +1 -1
- package/lib/icon-input/src/icon-content.vue2.js.map +1 -1
- package/lib/image-list-input/src/image-list-input.vue2.js.map +1 -1
- package/lib/page-diy/src/components/DiyCloud.vue.js.map +1 -1
- package/lib/page-diy/src/components/DragTool.vue.js +1 -5
- package/lib/page-diy/src/components/DragTool.vue.js.map +1 -1
- package/lib/page-diy/src/components/PreviewPhone.vue2.js.map +1 -1
- package/lib/page-diy/src/components/forms/DkEventSelectInput.vue.js +9 -11
- package/lib/page-diy/src/components/forms/DkEventSelectInput.vue.js.map +1 -1
- package/lib/page-diy/src/config/base/dkSetting.js.map +1 -1
- package/lib/page-diy/src/config/rule/min/common/DkMinVideo.js +1 -3
- package/lib/page-diy/src/config/rule/min/common/DkMinVideo.js.map +1 -1
- package/lib/page-diy/src/config/rule/min/common/index.js +1 -8
- package/lib/page-diy/src/config/rule/min/common/index.js.map +1 -1
- package/lib/page-diy/src/config/rule/web/common/DkPosterBtn.js +1 -3
- package/lib/page-diy/src/config/rule/web/common/DkPosterBtn.js.map +1 -1
- package/lib/page-diy/src/config/rule/web/common/DkViewBulletChat.js.map +1 -1
- package/lib/page-diy/src/config/rule/web/common/DkViewVideo.js +3 -9
- package/lib/page-diy/src/config/rule/web/common/DkViewVideo.js.map +1 -1
- package/lib/page-diy/src/utils/eventData.js.map +1 -1
- package/lib/page-diy/src/views/min/DkMinHotArea.vue.js +5 -18
- package/lib/page-diy/src/views/min/DkMinHotArea.vue.js.map +1 -1
- package/lib/page-diy/src/views/min/DkMinSwiperImage.vue.js.map +1 -1
- package/lib/page-diy/src/views/min/DkMinTitle.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewBulletChat.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewCell.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewCommonBtn.vue.js +1 -3
- package/lib/page-diy/src/views/web/DkViewCommonBtn.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewGridCellList.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewImage.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewMusic.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewNoticeBar.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewSwipe.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewTitle.vue.js.map +1 -1
- package/lib/poster-input/src/component/poster.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewAvatar.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewImage.vue2.js +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewImage.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewName.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewQrcode.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewText.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/quick-action.vue2.js.map +1 -1
- package/lib/poster-input/src/poster-input.vue2.js.map +1 -1
- package/lib/poster-input/style/index.scss +2 -4
- package/lib/select/src/select.vue2.js +1 -9
- package/lib/select/src/select.vue2.js.map +1 -1
- package/lib/style-animation-input/src/props.js.map +1 -1
- package/lib/style-animation-input/src/style-animation-input.vue2.js +1 -1
- package/lib/style-animation-input/src/style-animation-input.vue2.js.map +1 -1
- package/lib/style-font-input/src/style-font-input.vue2.js +1 -1
- package/lib/style-font-input/src/style-font-input.vue2.js.map +1 -1
- package/lib/style-number-input/src/style-number-input.vue2.js.map +1 -1
- package/lib/style-position-input/src/style-position-input.vue2.js +1 -4
- package/lib/style-position-input/src/style-position-input.vue2.js.map +1 -1
- package/lib/table/src/components/ComSearch.vue2.js.map +1 -1
- package/lib/table/src/components/FieldRender.vue2.js.map +1 -1
- package/lib/table/src/components/RecycleDialog.vue2.js +1 -3
- package/lib/table/src/components/RecycleDialog.vue2.js.map +1 -1
- package/lib/table/src/components/header.vue2.js +3 -17
- package/lib/table/src/components/header.vue2.js.map +1 -1
- package/lib/table/src/props.js +1 -11
- package/lib/table/src/props.js.map +1 -1
- package/lib/table/src/table.vue2.js +3 -13
- package/lib/table/src/table.vue2.js.map +1 -1
- package/lib/table/utils/dkTable.js +8 -31
- package/lib/table/utils/dkTable.js.map +1 -1
- package/lib/table/utils/dkTableApi.js.map +1 -1
- package/lib/tiny-editor/src/tiny-editor.vue2.js +1 -1
- package/lib/tiny-editor/src/tiny-editor.vue2.js.map +1 -1
- package/lib/video-list-input/src/video-list-input.vue2.js.map +1 -1
- package/package.json +3 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"animate-select.vue2.mjs","sources":["../../../src/animate-select/src/animate-select.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkAnimateSelect',\n});\n</script>\n<template>\n <div class=\"dk-animate-select\">\n <el-button-group>\n <el-button
|
1
|
+
{"version":3,"file":"animate-select.vue2.mjs","sources":["../../../src/animate-select/src/animate-select.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkAnimateSelect',\n});\n</script>\n<template>\n <div class=\"dk-animate-select\">\n <el-button-group>\n <el-button :type=\"!value ? 'primary' : 'danger'\" plain @click=\"show = true\">{{\n !value ? '请选择动画' : '已选择动画'\n }}</el-button>\n <el-button\n icon=\"Delete\"\n :disabled=\"!value\"\n :type=\"!value ? 'primary' : 'danger'\"\n plain\n @click=\"value = ''\"\n ></el-button>\n </el-button-group>\n\n <dk-dialog v-model=\"show\" title=\"选择动画\" width=\"800px\">\n <div class=\"dk-animate-content\">\n <!--预览区-->\n <div class=\"animate-preview\">\n <el-card\n :class=\"['animate__' + value]\"\n :style=\"{\n animationDelay: '0s',\n animationDuration: '1s',\n animationIterationCount: '1',\n }\"\n >\n 预览区\n </el-card>\n </div>\n <!--选择区-->\n <div class=\"animate-list\">\n <el-tabs v-model=\"tabType\" class=\"demo-tabs\">\n <el-tab-pane v-for=\"(item, key) in Animates\" :key=\"key\" :label=\"item.label\" :name=\"item.name\">\n <ul class=\"cl\">\n <li\n v-for=\"(a, k) in item.animate\"\n :key=\"k\"\n :class=\"value == a.value ? 'choose' : ''\"\n @click=\"chooseAnimate(a.value)\"\n >\n {{ a.label }}\n </li>\n </ul>\n </el-tab-pane>\n </el-tabs>\n </div>\n </div>\n <div class=\"text-center p10px\">\n <el-button type=\"primary\" style=\"width: 220px\" @click=\"show = false\">确定</el-button>\n </div>\n </dk-dialog>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { animateSelectProps } from './props'\nimport Animates from './animates'\nimport { ref, watch } from 'vue'\n\n\nconst props = defineProps(animateSelectProps)\nconst tabType = ref('loop')\nconst show = ref(false)\nconst value = ref(props.modelValue)\nconst chooseAnimate = (val: any) => {\n value.value = val\n}\n\nconst emit = defineEmits(['input', 'update:modelValue', 'change'])\nwatch(\n () => props.modelValue,\n (val) => {\n value.value = val\n }\n)\nwatch(\n () => value.value,\n (val) => {\n emit('change', val)\n emit('update:modelValue', val)\n emit('input', val)\n }\n)\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,iBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAgED,IAAM,MAAA,OAAA,GAAU,IAAI,MAAM,CAAA,CAAA;AAC1B,IAAM,MAAA,IAAA,GAAO,IAAI,KAAK,CAAA,CAAA;AACtB,IAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAClC,IAAM,MAAA,aAAA,GAAgB,CAAC,GAAa,KAAA;AAClC,MAAA,KAAA,CAAM,KAAQ,GAAA,GAAA,CAAA;AAAA,KAChB,CAAA;AAGA,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,CAAC,GAAQ,KAAA;AACP,QAAA,KAAA,CAAM,KAAQ,GAAA,GAAA,CAAA;AAAA,OAChB;AAAA,KACF,CAAA;AACA,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,KAAA;AAAA,MACZ,CAAC,GAAQ,KAAA;AACP,QAAA,IAAA,CAAK,UAAU,GAAG,CAAA,CAAA;AAClB,QAAA,IAAA,CAAK,qBAAqB,GAAG,CAAA,CAAA;AAC7B,QAAA,IAAA,CAAK,SAAS,GAAG,CAAA,CAAA;AAAA,OACnB;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"attachment.mjs","sources":["../../src/api/attachment.ts"],"sourcesContent":["import { request } from '@vipl520/utils'\n\n/** ************************************************************** 附件 ***************************************************************/\n\n// 获取附件列表\nexport function getAttachmentList(
|
1
|
+
{"version":3,"file":"attachment.mjs","sources":["../../src/api/attachment.ts"],"sourcesContent":["import { request } from '@vipl520/utils'\n\n/** ************************************************************** 附件 ***************************************************************/\n\n// 获取附件列表\nexport function getAttachmentList(page: number, size: number, type: number = 1, groupId: number, search: any) {\n search.group_id = groupId\n search.type = type\n return request({\n method: 'post',\n url: '/adminapi/attachment/list',\n data: { page, size, search },\n })\n}\n\n// 上传附件\n// export function UploadAttachment(page, size, type = 1, groupId, search) {\n// return request({\n// method: 'post',\n// url: '/adminapi/attachment/upload',\n// data: { page, size, type, groupId, search }\n// })\n// }\n\n// 上传附件\nexport function UploadAttachment(file: any, type = 1, groupId = 0) {\n const formData = new FormData()\n formData.append('file', file)\n formData.append('type', type.toString())\n formData.append('file', 'file')\n formData.append('group_id', groupId.toString())\n return request({\n method: 'post',\n url: '/adminapi/attachment/upload',\n data: formData,\n })\n}\n\n// 获取编辑表单\nexport function getAttachmentEdit(id: number) {\n return request({\n method: 'get',\n url: '/adminapi/attachment/index/' + id + '/edit',\n })\n}\n\nexport function deleteAttachment(ids: number[]) {\n return request(\n {\n method: 'post',\n url: '/adminapi/attachment/delete',\n data: { ids },\n },\n {\n code_success_show: true,\n }\n )\n}\n\nexport function moveAttachment(ids: number[], groupId: number) {\n return request({\n method: 'post',\n url: '/adminapi/attachment/move',\n data: { ids, group_id: groupId },\n })\n}\n\n/** ************************************************************** 附件分组 ***************************************************************/\n\n// 获取附件分组\nexport function getAttachmentGroupList(type: number) {\n return request(\n {\n method: 'get',\n url: '/adminapi/attachment/group',\n params: { type },\n },\n {\n code_error_show: true,\n }\n )\n}\n\n// 获取表单\nexport function getAttachmentGroupForm(id: number) {\n if (id) {\n return request({\n method: 'get',\n url: '/adminapi/attachment/group/' + id + '/edit',\n })\n } else {\n return request({\n method: 'get',\n url: '/adminapi/attachment/group/create',\n })\n }\n}\n\n// 删除分组\nexport function delAttachmentGroup(id: number) {\n return request(\n {\n method: 'delete',\n url: '/adminapi/attachment/group/' + id,\n },\n {\n code_error_show: true,\n }\n )\n}\n"],"names":[],"mappings":";;AAKO,SAAS,k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;;;;"}
|
@@ -210,13 +210,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
210
210
|
const onGetAttachmentList = async (search = {}) => {
|
211
211
|
clearChoose();
|
212
212
|
try {
|
213
|
-
const res = await getAttachmentList(
|
214
|
-
page.value,
|
215
|
-
size.value,
|
216
|
-
_type.value,
|
217
|
-
groupId.value,
|
218
|
-
search
|
219
|
-
);
|
213
|
+
const res = await getAttachmentList(page.value, size.value, _type.value, groupId.value, search);
|
220
214
|
list.value = res.data;
|
221
215
|
count.value = res.msg;
|
222
216
|
loading.value = false;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"attachment.vue2.mjs","sources":["../../../src/attachment/src/attachment.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkAttachment',\n});\n</script>\n<template>\n <div class=\"dk-attachment attachment\">\n <!-- 顶部-->\n <div class=\"attachment-header flex justify-between pt-5px pb-5px\">\n <div class=\"header-form z\">\n <el-input\n v-model=\"searchFileName\"\n placeholder=\"请输入附件名称\"\n class=\"input-with-select\"\n >\n <template #append>\n <el-button :icon=\"Search\" />\n </template>\n </el-input>\n </div>\n <div class=\"header-button y\">\n <el-dropdown class=\"mr\" trigger=\"click\" @command=\"handleMoveAttachment\">\n <el-button type=\"info\" :disabled=\"chooseFileKey.length <= 0\">\n 移动\n </el-button>\n <template #dropdown>\n <el-dropdown-menu>\n <el-dropdown-item\n v-for=\"(item, key) in groupList\"\n :key=\"key\"\n :command=\"item.id\"\n >\n {{ item.name }}\n </el-dropdown-item>\n </el-dropdown-menu>\n </template>\n </el-dropdown>\n <el-button\n type=\"danger\"\n :disabled=\"chooseFileKey.length <= 0\"\n @click=\"onDelete\"\n >删除<i class=\"el-icon-delete el-icon--right\"></i\n ></el-button>\n <el-upload\n ref=\"upload\"\n class=\"dk-upload-button\"\n :action=\"uploadUrl\"\n multiple\n :data=\"data\"\n :show-file-list=\"false\"\n :headers=\"headers\"\n :on-success=\"handleUploadSuccess\"\n :accept=\"_accept\"\n list-type=\"text\"\n >\n <el-button type=\"primary\"\n >上传<i class=\"el-icon-upload el-icon--right\"></i\n ></el-button>\n </el-upload>\n </div>\n </div>\n <!--内部-->\n <div class=\"attachment-content flex\">\n <!-- 分组-->\n <div class=\"attachment-group\">\n <h5\n class=\"cursor-pointer flex items-center content-center\"\n @click=\"addGroup()\"\n >\n 附件分组\n <el-icon class=\"m-l-5px\"><CirclePlusFilled /></el-icon>\n </h5>\n <ul class=\"group_list\">\n <li\n v-for=\"(item, key) in groupList\"\n :key=\"key\"\n :class=\"{ active: groupId === item.id }\"\n @click=\"selectGroup(item.id)\"\n >\n <dk-icon\n v-if=\"item.id === groupId\"\n icon=\"flat-color-icons:opened-folder\"\n />\n <dk-icon v-else icon=\"flat-color-icons:folder\" />\n\n <span class=\"ml-10px\">{{ item.name }}</span>\n\n <el-popover placement=\"right\" trigger=\"click\">\n <template #reference>\n <div class=\"op\">\n <el-icon v-if=\"item.id > 0\">\n <Tools />\n </el-icon>\n </div>\n </template>\n <template #default>\n <el-button size=\"small\" type=\"primary\" @click.stop=\"editGroup()\"\n >编辑\n </el-button>\n <el-button size=\"small\" type=\"danger\" @click=\"delGroup(item.id)\"\n >删除</el-button\n >\n </template>\n </el-popover>\n </li>\n </ul>\n </div>\n <!-- 列表-->\n <div class=\"attachment-container\">\n <div v-if=\"loading || list.length > 0\" v-loading=\"loading\" class=\"p2\">\n <ul\n class=\"attachment-list cl\"\n :style=\"{ overflow: list.length > 10 ? 'auto' : '' }\"\n >\n <li\n v-for=\"(item, key) in list\"\n :key=\"key\"\n :class=\"{ choose: chooseFileKey.indexOf(key) > -1 }\"\n @click=\"chooseAttachment(item, key)\"\n @contextmenu.prevent=\"contextMenuId = item.id\"\n >\n <div class=\"file\">\n <el-image\n v-if=\"item.type === 1\"\n class=\"file\"\n :src=\"item.url\"\n fit=\"contain\"\n >\n <template #placeholder>\n <div class=\"u-m-t-30\">\n <i class=\"el-icon-loading\"></i>\n <span>加载中</span>\n </div>\n </template>\n </el-image>\n <div v-if=\"item.type === 2\">\n <dk-file-icon :file-name=\"item.filename\" :type=\"item.type\" />\n </div>\n <div v-if=\"item.type === 3\">\n <dk-file-icon :file-name=\"item.filename\" :type=\"item.type\" />\n </div>\n <div v-if=\"item.type === 0\">\n <dk-file-icon :file-name=\"item.filename\" />\n </div>\n </div>\n <div class=\"file-name over\">{{ item.name }}</div>\n <div class=\"right\">\n <el-icon>\n <Check />\n </el-icon>\n </div>\n </li>\n </ul>\n <div class=\"block p-10px\">\n <el-pagination\n :current-page=\"page\"\n layout=\"total, prev, pager, next, jumper,sizes\"\n :total=\"count\"\n :page-size=\"size\"\n @size-change=\"handleSizeChange\"\n @current-change=\"handleCurrentChange\"\n />\n </div>\n </div>\n <div\n v-else\n style=\"\n display: flex;\n align-items: center;\n justify-content: center;\n height: 340px;\n \"\n >\n <el-empty description=\"暂无数据\" />\n </div>\n <dk-form\n ref=\"groupForm\"\n :key=\"groupId\"\n :form-url=\"groupFormUrl\"\n :is-dialog=\"true\"\n @submit=\"onsubmit()\"\n />\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, reactive, onMounted, computed } from 'vue'\nimport {\n deleteAttachment,\n getAttachmentGroupList,\n getAttachmentList,\n moveAttachment,\n delAttachmentGroup,\n} from '../../api'\n\nimport { ElMessage, ElMessageBox } from 'element-plus'\nimport DkFileIcon from './file-icon.vue'\n\nimport { Search } from '@element-plus/icons-vue'\n\nimport { getAttachmentType, getGlobalConfig } from '@vipl520/utils'\nimport { attachmentProps } from './props'\n\n\n\nconst props = defineProps(attachmentProps)\n\nconst _type = computed(() => {\n return getAttachmentType(props.type)\n})\n\n/** ****************顶部data****************/\n// 搜索的文件名\nconst searchFileName = ref('')\n// 选择文件Key\nconst chooseFileKey = ref<number[]>([])\n// 选中文件列表\nconst chooseFileList = ref<any[]>([])\n// 选中文件ID\nconst chooseFileId = ref<number[]>([])\nconst globalConfig = getGlobalConfig()\n// 上传的地址\nconst uploadUrl = globalConfig.ApiUrl + '/adminapi/attachment/upload'\nconst headers = {\n 'Access-Token': globalConfig.AccessToken,\n}\n// 上传的ref\nconst upload = ref()\n// 上传的数据\nconst data = reactive({\n type: _type.value,\n file: 'file',\n group_id: 0,\n})\n\n/** *****顶部的函数****************/\n\nconst handleMoveAttachment = (groupId: number) => {\n moveAttachment(chooseFileId.value, groupId).then((res) => {\n ElMessage.success(res.msg)\n onGetAttachmentList()\n })\n}\n\nconst handleUploadSuccess = (res: any) => {\n console.log('res', res)\n if (res.code === 0) {\n ElMessage.success(res.msg)\n // upload.value.clearFiles()\n onGetAttachmentList()\n } else {\n ElMessage.error(res.msg)\n }\n}\n\nconst _accept = computed(() => {\n let _accept = ''\n if (props.accept) {\n return props.accept\n } else {\n switch (_type.value) {\n case 0:\n break\n case 1:\n _accept = 'image/*'\n break\n case 2:\n _accept = 'audio/*'\n break\n case 3:\n _accept = 'video/*'\n break\n }\n return _accept\n }\n})\n\nconst onDelete = () => {\n // 改成element-plus\n ElMessageBox.confirm('此操作将永久删除文件, 是否继续?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n }).then(() => {\n try {\n deleteAttachment(chooseFileId.value)\n .then((res) => {\n console.log(res)\n onGetAttachmentList()\n })\n .catch((res) => {\n console.log('deleteAttachment error', res)\n })\n } catch (e) {\n console.log(e)\n }\n })\n}\n/** ****************分组data****************/\n// 分组列表\nconst groupList = ref<any>([])\n// 选中分组\n/** **********分组的函数****************/\n\nconst groupFormUrl = computed(() => {\n if (groupId.value === 0) {\n return {\n url: globalConfig.ApiUrl + '/adminapi/attachment/group/create',\n method: 'get',\n }\n } else {\n return {\n url:\n globalConfig.ApiUrl +\n '/adminapi/attachment/group/' +\n groupId.value +\n '/edit',\n method: 'get',\n }\n }\n})\n\nconst groupForm = ref()\n\nconst addGroup = () => {\n // TODO 添加文件分组\n groupId.value = 0\n groupForm.value.show()\n}\n\nconst delGroup = (id: number) => {\n // 改为Vue3\n ElMessageBox.confirm('此操作将永久删除该分组, 是否继续?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning',\n }).then(() => {\n try {\n delAttachmentGroup(id)\n .then((res) => {\n ElMessage.success(res.msg)\n onsubmit()\n })\n .catch(() => {})\n } catch (e) {\n console.log(e)\n }\n })\n}\n\nconst editGroup = () => {\n groupForm.value.show()\n}\n\nconst onsubmit = () => {\n getGroupList()\n onGetAttachmentList()\n}\n\nconst selectGroup = (id: number) => {\n groupId.value = id\n page.value = 1\n onGetAttachmentList()\n}\n\nconst getGroupList = async () => {\n try {\n const res = await getAttachmentGroupList(_type.value)\n groupList.value = res.data\n } catch (e) {}\n}\n\n/** ****************附件列表*********************/\nconst loading = ref(true)\nconst list = ref<any>([])\nconst page = ref(1)\nconst count = ref(0)\nconst size = ref(10)\nconst contextMenuId = ref(0)\nconst groupId = ref(0)\n\n/** ***************列表函数*******************/\n\n// const editAttachment = () => {\n// // TODO 编辑附件\n// }\n\nconst handleSizeChange = (val: number) => {\n size.value = val\n onGetAttachmentList()\n}\n\n// 改变页码\nconst handleCurrentChange = (val: number) => {\n page.value = val\n onGetAttachmentList()\n}\nconst onGetAttachmentList = async (search = {}) => {\n clearChoose()\n try {\n const res = await getAttachmentList(\n page.value,\n size.value,\n _type.value,\n groupId.value,\n search\n )\n list.value = res.data\n count.value = res.msg\n loading.value = false\n } catch (e) {}\n}\n\nconst clearChoose = () => {\n chooseFileKey.value = []\n chooseFileId.value = []\n chooseFileList.value = []\n}\n\nconst chooseAttachment = (item: any, key: number) => {\n const index = chooseFileKey.value.indexOf(key)\n if (index > -1) {\n chooseFileKey.value.splice(index, 1)\n chooseFileId.value.splice(index, 1)\n chooseFileList.value.splice(index, 1)\n } else {\n chooseFileKey.value.push(key)\n chooseFileId.value.push(item.id)\n chooseFileList.value.push(item)\n }\n}\n\nonMounted(() => {\n getGroupList()\n onGetAttachmentList()\n})\n\ndefineExpose({\n chooseFileId,\n chooseFileKey,\n chooseFileList,\n clearChoose,\n})\n</script>\n"],"names":["__MACROS_defineComponent","groupId","_accept"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,cAAA;AACR,CAAC,CAAA,CAAA;;;;;;AA8MD,IAAM,MAAA,KAAA,GAAQ,SAAS,MAAM;AAC3B,MAAO,OAAA,iBAAA,CAAkB,MAAM,IAAI,CAAA,CAAA;AAAA,KACpC,CAAA,CAAA;AAID,IAAM,MAAA,cAAA,GAAiB,IAAI,EAAE,CAAA,CAAA;AAE7B,IAAM,MAAA,aAAA,GAAgB,GAAc,CAAA,EAAE,CAAA,CAAA;AAEtC,IAAM,MAAA,cAAA,GAAiB,GAAW,CAAA,EAAE,CAAA,CAAA;AAEpC,IAAM,MAAA,YAAA,GAAe,GAAc,CAAA,EAAE,CAAA,CAAA;AACrC,IAAA,MAAM,eAAe,eAAgB,EAAA,CAAA;AAErC,IAAM,MAAA,SAAA,GAAY,aAAa,MAAS,GAAA,6BAAA,CAAA;AACxC,IAAA,MAAM,OAAU,GAAA;AAAA,MACd,gBAAgB,YAAa,CAAA,WAAA;AAAA,KAC/B,CAAA;AAEA,IAAA,MAAM,SAAS,GAAI,EAAA,CAAA;AAEnB,IAAA,MAAM,OAAO,QAAS,CAAA;AAAA,MACpB,MAAM,KAAM,CAAA,KAAA;AAAA,MACZ,IAAM,EAAA,MAAA;AAAA,MACN,QAAU,EAAA,CAAA;AAAA,KACX,CAAA,CAAA;AAID,IAAM,MAAA,oBAAA,GAAuB,CAACC,QAAoB,KAAA;AAChD,MAAA,cAAA,CAAe,aAAa,KAAOA,EAAAA,QAAO,CAAE,CAAA,IAAA,CAAK,CAAC,GAAQ,KAAA;AACxD,QAAU,SAAA,CAAA,OAAA,CAAQ,IAAI,GAAG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"attachment.vue2.mjs","sources":["../../../src/attachment/src/attachment.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkAttachment',\n});\n</script>\n<template>\n <div class=\"dk-attachment attachment\">\n <!-- 顶部-->\n <div class=\"attachment-header flex justify-between pt-5px pb-5px\">\n <div class=\"header-form z\">\n <el-input v-model=\"searchFileName\" placeholder=\"请输入附件名称\" class=\"input-with-select\">\n <template #append>\n <el-button :icon=\"Search\" />\n </template>\n </el-input>\n </div>\n <div class=\"header-button y\">\n <el-dropdown class=\"mr\" trigger=\"click\" @command=\"handleMoveAttachment\">\n <el-button type=\"info\" :disabled=\"chooseFileKey.length <= 0\"> 移动 </el-button>\n <template #dropdown>\n <el-dropdown-menu>\n <el-dropdown-item v-for=\"(item, key) in groupList\" :key=\"key\" :command=\"item.id\">\n {{ item.name }}\n </el-dropdown-item>\n </el-dropdown-menu>\n </template>\n </el-dropdown>\n <el-button type=\"danger\" :disabled=\"chooseFileKey.length <= 0\" @click=\"onDelete\"\n >删除<i class=\"el-icon-delete el-icon--right\"></i\n ></el-button>\n <el-upload\n ref=\"upload\"\n class=\"dk-upload-button\"\n :action=\"uploadUrl\"\n multiple\n :data=\"data\"\n :show-file-list=\"false\"\n :headers=\"headers\"\n :on-success=\"handleUploadSuccess\"\n :accept=\"_accept\"\n list-type=\"text\"\n >\n <el-button type=\"primary\">上传<i class=\"el-icon-upload el-icon--right\"></i></el-button>\n </el-upload>\n </div>\n </div>\n <!--内部-->\n <div class=\"attachment-content flex\">\n <!-- 分组-->\n <div class=\"attachment-group\">\n <h5 class=\"cursor-pointer flex items-center content-center\" @click=\"addGroup()\">\n 附件分组\n <el-icon class=\"m-l-5px\"><CirclePlusFilled /></el-icon>\n </h5>\n <ul class=\"group_list\">\n <li\n v-for=\"(item, key) in groupList\"\n :key=\"key\"\n :class=\"{ active: groupId === item.id }\"\n @click=\"selectGroup(item.id)\"\n >\n <dk-icon v-if=\"item.id === groupId\" icon=\"flat-color-icons:opened-folder\" />\n <dk-icon v-else icon=\"flat-color-icons:folder\" />\n\n <span class=\"ml-10px\">{{ item.name }}</span>\n\n <el-popover placement=\"right\" trigger=\"click\">\n <template #reference>\n <div class=\"op\">\n <el-icon v-if=\"item.id > 0\">\n <Tools />\n </el-icon>\n </div>\n </template>\n <template #default>\n <el-button size=\"small\" type=\"primary\" @click.stop=\"editGroup()\">编辑 </el-button>\n <el-button size=\"small\" type=\"danger\" @click=\"delGroup(item.id)\">删除</el-button>\n </template>\n </el-popover>\n </li>\n </ul>\n </div>\n <!-- 列表-->\n <div class=\"attachment-container\">\n <div v-if=\"loading || list.length > 0\" v-loading=\"loading\" class=\"p2\">\n <ul class=\"attachment-list cl\" :style=\"{ overflow: list.length > 10 ? 'auto' : '' }\">\n <li\n v-for=\"(item, key) in list\"\n :key=\"key\"\n :class=\"{ choose: chooseFileKey.indexOf(key) > -1 }\"\n @click=\"chooseAttachment(item, key)\"\n @contextmenu.prevent=\"contextMenuId = item.id\"\n >\n <div class=\"file\">\n <el-image v-if=\"item.type === 1\" class=\"file\" :src=\"item.url\" fit=\"contain\">\n <template #placeholder>\n <div class=\"u-m-t-30\">\n <i class=\"el-icon-loading\"></i>\n <span>加载中</span>\n </div>\n </template>\n </el-image>\n <div v-if=\"item.type === 2\">\n <dk-file-icon :file-name=\"item.filename\" :type=\"item.type\" />\n </div>\n <div v-if=\"item.type === 3\">\n <dk-file-icon :file-name=\"item.filename\" :type=\"item.type\" />\n </div>\n <div v-if=\"item.type === 0\">\n <dk-file-icon :file-name=\"item.filename\" />\n </div>\n </div>\n <div class=\"file-name over\">{{ item.name }}</div>\n <div class=\"right\">\n <el-icon>\n <Check />\n </el-icon>\n </div>\n </li>\n </ul>\n <div class=\"block p-10px\">\n <el-pagination\n :current-page=\"page\"\n layout=\"total, prev, pager, next, jumper,sizes\"\n :total=\"count\"\n :page-size=\"size\"\n @size-change=\"handleSizeChange\"\n @current-change=\"handleCurrentChange\"\n />\n </div>\n </div>\n <div v-else style=\"display: flex; align-items: center; justify-content: center; height: 340px\">\n <el-empty description=\"暂无数据\" />\n </div>\n <dk-form ref=\"groupForm\" :key=\"groupId\" :form-url=\"groupFormUrl\" :is-dialog=\"true\" @submit=\"onsubmit()\" />\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, reactive, onMounted, computed } from 'vue'\nimport {\n deleteAttachment,\n getAttachmentGroupList,\n getAttachmentList,\n moveAttachment,\n delAttachmentGroup,\n} from '../../api'\n\nimport { ElMessage, ElMessageBox } from 'element-plus'\nimport DkFileIcon from './file-icon.vue'\n\nimport { Search } from '@element-plus/icons-vue'\n\nimport { getAttachmentType, getGlobalConfig } from '@vipl520/utils'\nimport { attachmentProps } from './props'\n\n\n\nconst props = defineProps(attachmentProps)\n\nconst _type = computed(() => {\n return getAttachmentType(props.type)\n})\n\n/** ****************顶部data****************/\n// 搜索的文件名\nconst searchFileName = ref('')\n// 选择文件Key\nconst chooseFileKey = ref<number[]>([])\n// 选中文件列表\nconst chooseFileList = ref<any[]>([])\n// 选中文件ID\nconst chooseFileId = ref<number[]>([])\nconst globalConfig = getGlobalConfig()\n// 上传的地址\nconst uploadUrl = globalConfig.ApiUrl + '/adminapi/attachment/upload'\nconst headers = {\n 'Access-Token': globalConfig.AccessToken,\n}\n// 上传的ref\nconst upload = ref()\n// 上传的数据\nconst data = reactive({\n type: _type.value,\n file: 'file',\n group_id: 0,\n})\n\n/** *****顶部的函数****************/\n\nconst handleMoveAttachment = (groupId: number) => {\n moveAttachment(chooseFileId.value, groupId).then((res) => {\n ElMessage.success(res.msg)\n onGetAttachmentList()\n })\n}\n\nconst handleUploadSuccess = (res: any) => {\n console.log('res', res)\n if (res.code === 0) {\n ElMessage.success(res.msg)\n // upload.value.clearFiles()\n onGetAttachmentList()\n } else {\n ElMessage.error(res.msg)\n }\n}\n\nconst _accept = computed(() => {\n let _accept = ''\n if (props.accept) {\n return props.accept\n } else {\n switch (_type.value) {\n case 0:\n break\n case 1:\n _accept = 'image/*'\n break\n case 2:\n _accept = 'audio/*'\n break\n case 3:\n _accept = 'video/*'\n break\n }\n return _accept\n }\n})\n\nconst onDelete = () => {\n // 改成element-plus\n ElMessageBox.confirm('此操作将永久删除文件, 是否继续?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n }).then(() => {\n try {\n deleteAttachment(chooseFileId.value)\n .then((res) => {\n console.log(res)\n onGetAttachmentList()\n })\n .catch((res) => {\n console.log('deleteAttachment error', res)\n })\n } catch (e) {\n console.log(e)\n }\n })\n}\n/** ****************分组data****************/\n// 分组列表\nconst groupList = ref<any>([])\n// 选中分组\n/** **********分组的函数****************/\n\nconst groupFormUrl = computed(() => {\n if (groupId.value === 0) {\n return {\n url: globalConfig.ApiUrl + '/adminapi/attachment/group/create',\n method: 'get',\n }\n } else {\n return {\n url: globalConfig.ApiUrl + '/adminapi/attachment/group/' + groupId.value + '/edit',\n method: 'get',\n }\n }\n})\n\nconst groupForm = ref()\n\nconst addGroup = () => {\n // TODO 添加文件分组\n groupId.value = 0\n groupForm.value.show()\n}\n\nconst delGroup = (id: number) => {\n // 改为Vue3\n ElMessageBox.confirm('此操作将永久删除该分组, 是否继续?', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning',\n }).then(() => {\n try {\n delAttachmentGroup(id)\n .then((res) => {\n ElMessage.success(res.msg)\n onsubmit()\n })\n .catch(() => {})\n } catch (e) {\n console.log(e)\n }\n })\n}\n\nconst editGroup = () => {\n groupForm.value.show()\n}\n\nconst onsubmit = () => {\n getGroupList()\n onGetAttachmentList()\n}\n\nconst selectGroup = (id: number) => {\n groupId.value = id\n page.value = 1\n onGetAttachmentList()\n}\n\nconst getGroupList = async () => {\n try {\n const res = await getAttachmentGroupList(_type.value)\n groupList.value = res.data\n } catch (e) {}\n}\n\n/** ****************附件列表*********************/\nconst loading = ref(true)\nconst list = ref<any>([])\nconst page = ref(1)\nconst count = ref(0)\nconst size = ref(10)\nconst contextMenuId = ref(0)\nconst groupId = ref(0)\n\n/** ***************列表函数*******************/\n\n// const editAttachment = () => {\n// // TODO 编辑附件\n// }\n\nconst handleSizeChange = (val: number) => {\n size.value = val\n onGetAttachmentList()\n}\n\n// 改变页码\nconst handleCurrentChange = (val: number) => {\n page.value = val\n onGetAttachmentList()\n}\nconst onGetAttachmentList = async (search = {}) => {\n clearChoose()\n try {\n const res = await getAttachmentList(page.value, size.value, _type.value, groupId.value, search)\n list.value = res.data\n count.value = res.msg\n loading.value = false\n } catch (e) {}\n}\n\nconst clearChoose = () => {\n chooseFileKey.value = []\n chooseFileId.value = []\n chooseFileList.value = []\n}\n\nconst chooseAttachment = (item: any, key: number) => {\n const index = chooseFileKey.value.indexOf(key)\n if (index > -1) {\n chooseFileKey.value.splice(index, 1)\n chooseFileId.value.splice(index, 1)\n chooseFileList.value.splice(index, 1)\n } else {\n chooseFileKey.value.push(key)\n chooseFileId.value.push(item.id)\n chooseFileList.value.push(item)\n }\n}\n\nonMounted(() => {\n getGroupList()\n onGetAttachmentList()\n})\n\ndefineExpose({\n chooseFileId,\n chooseFileKey,\n chooseFileList,\n clearChoose,\n})\n</script>\n"],"names":["__MACROS_defineComponent","groupId","_accept"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,cAAA;AACR,CAAC,CAAA,CAAA;;;;;;AA+JD,IAAM,MAAA,KAAA,GAAQ,SAAS,MAAM;AAC3B,MAAO,OAAA,iBAAA,CAAkB,MAAM,IAAI,CAAA,CAAA;AAAA,KACpC,CAAA,CAAA;AAID,IAAM,MAAA,cAAA,GAAiB,IAA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ACL,QAAc,aAAA,CAAA,KAAA,CAAM,KAAK,GAAG,CAAA,CAAA;AAC5B,QAAa,YAAA,CAAA,KAAA,CAAM,IAAK,CAAA,IAAA,CAAK,EAAE,CAAA,CAAA;AAC/B,QAAe,cAAA,CAAA,KAAA,CAAM,KAAK,IAAI,CAAA,CAAA;AAAA,OAChC;AAAA,KACF,CAAA;AAEA,IAAA,SAAA,CAAU,MAAM;AACd,MAAa,YAAA,EAAA,CAAA;AACb,MAAoB,mBAAA,EAAA,CAAA;AAAA,KACrB,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,YAAA;AAAA,MACA,aAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"audio-list-input.vue2.mjs","sources":["../../../src/audio-list-input/src/audio-list-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkAudioListInput',\n});\n</script>\n<template>\n <dk-file-list-input
|
1
|
+
{"version":3,"file":"audio-list-input.vue2.mjs","sources":["../../../src/audio-list-input/src/audio-list-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkAudioListInput',\n});\n</script>\n<template>\n <dk-file-list-input v-bind=\"$props\" v-model=\"input\" :class=\"bem()\" :type=\"2\" @change=\"handleInput(input)\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace } from '@vipl520/utils'\nimport { audioListInputProps } from './props'\nimport { ref, watch } from 'vue'\nconst [_, bem] = createNamespace('audio-list-input')\n\n\n\nconst props = defineProps(audioListInputProps)\nconst input = ref(props.modelValue)\n\nconst emit = defineEmits(['input', 'update:modelValue', 'change'])\nwatch(\n () => props.modelValue,\n (val) => {\n input.value = val\n }\n)\n\nwatch(\n () => input.value,\n (val) => {\n handleInput(val)\n }\n)\n\nconst handleInput = (val: any) => {\n emit('update:modelValue', val)\n emit('input', val)\n emit('change', val)\n}\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,kBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAUD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,kBAAkB,CAAA,CAAA;AAKnD,IAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAGlC,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,CAAC,GAAQ,KAAA;AACP,QAAA,KAAA,CAAM,KAAQ,GAAA,GAAA,CAAA;AAAA,OAChB;AAAA,KACF,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,KAAA;AAAA,MACZ,CAAC,GAAQ,KAAA;AACP,QAAA,WAAA,CAAY,GAAG,CAAA,CAAA;AAAA,OACjB;AAAA,KACF,CAAA;AAEA,IAAM,MAAA,WAAA,GAAc,CAAC,GAAa,KAAA;AAChC,MAAA,IAAA,CAAK,qBAAqB,GAAG,CAAA,CAAA;AAC7B,MAAA,IAAA,CAAK,SAAS,GAAG,CAAA,CAAA;AACjB,MAAA,IAAA,CAAK,UAAU,GAAG,CAAA,CAAA;AAAA,KACpB,CAAA;;;;;;;;;;;;;;;;"}
|
@@ -35,9 +35,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
35
35
|
const toggleFull = () => {
|
36
36
|
isFullscreen.value = !unref(isFullscreen);
|
37
37
|
};
|
38
|
-
const dialogHeight = ref(
|
39
|
-
isNumber(props.maxHeight) ? `${props.maxHeight}px` : props.maxHeight
|
40
|
-
);
|
38
|
+
const dialogHeight = ref(isNumber(props.maxHeight) ? `${props.maxHeight}px` : props.maxHeight);
|
41
39
|
watch(
|
42
40
|
() => isFullscreen.value,
|
43
41
|
async (val) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dialog.vue2.mjs","sources":["../../../src/dialog/src/dialog.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkDialog',\n});\n</script>\n<template>\n <ElDialog\n v-bind=\"getBindValue\"\n :fullscreen=\"isFullscreen\"\n destroy-on-close\n append-to-body\n lock-scroll\n :draggable=\"draggable\"\n :close-on-click-modal=\"false\"\n :show-close=\"false\"\n class=\"dk-dialog\"\n :z-index=\"props.zIndex\"\n >\n <template #header=\"{ close }\">\n <slot name=\"header\">\n <div class=\"flex justify-between items-center relative\">\n <span>{{ props.title }}</span>\n <div
|
1
|
+
{"version":3,"file":"dialog.vue2.mjs","sources":["../../../src/dialog/src/dialog.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkDialog',\n});\n</script>\n<template>\n <ElDialog\n v-bind=\"getBindValue\"\n :fullscreen=\"isFullscreen\"\n destroy-on-close\n append-to-body\n lock-scroll\n :draggable=\"draggable\"\n :close-on-click-modal=\"false\"\n :show-close=\"false\"\n class=\"dk-dialog\"\n :z-index=\"props.zIndex\"\n >\n <template #header=\"{ close }\">\n <slot name=\"header\">\n <div class=\"flex justify-between items-center relative\">\n <span>{{ props.title }}</span>\n <div class=\"flex justify-between items-center absolute top-[50%] right-0 translate-y-[-50%]\">\n <dk-icon\n v-if=\"fullscreen\"\n class=\"cursor-pointer is-hover mr-10px\"\n :icon=\"isFullscreen ? 'radix-icons:exit-full-screen' : 'radix-icons:enter-full-screen'\"\n color=\"var(--el-color-info)\"\n hover-color=\"var(--el-color-primary)\"\n @click=\"toggleFull\"\n />\n <dk-icon\n class=\"cursor-pointer is-hover\"\n icon=\"ep:close\"\n hover-color=\"var(--el-color-primary)\"\n color=\"var(--el-color-info)\"\n @click=\"close\"\n />\n </div>\n </div>\n </slot>\n </template>\n\n <ElScrollbar :style=\"dialogStyle\">\n <slot></slot>\n </ElScrollbar>\n\n <template v-if=\"slots.footer\" #footer>\n <slot name=\"footer\"></slot>\n </template>\n </ElDialog>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, isNumber } from '@vipl520/utils'\nimport { dialogProps } from './props'\nimport { computed, useAttrs, ref, unref, useSlots, watch, nextTick } from 'vue'\n\nconst [_, bem] = createNamespace('dialog')\n\n\nconst slots = useSlots()\n\nconst props = defineProps(dialogProps)\n\nconst getBindValue = computed(() => {\n const delArr: string[] = ['fullscreen', 'title', 'maxHeight']\n const attrs = useAttrs()\n const obj: { [key: string]: any } = { ...attrs, ...props }\n for (const key in obj) {\n if (delArr.indexOf(key) !== -1) {\n delete obj[key] as any\n }\n }\n return obj\n})\nconst isFullscreen = ref(props.defaultFullscreen)\n\nwatch(\n () => props.defaultFullscreen,\n () => {\n isFullscreen.value = props.defaultFullscreen\n }\n)\n\nconst toggleFull = () => {\n isFullscreen.value = !unref(isFullscreen)\n}\n\nconst dialogHeight = ref(isNumber(props.maxHeight) ? `${props.maxHeight}px` : props.maxHeight)\n\nwatch(\n () => isFullscreen.value,\n async (val: boolean) => {\n await nextTick()\n if (val) {\n const windowHeight = document.documentElement.offsetHeight\n dialogHeight.value = `${windowHeight - 55 - 60 - (slots.footer ? 63 : 0)}px`\n } else {\n dialogHeight.value = isNumber(props.maxHeight) ? `${props.maxHeight}px` : props.maxHeight\n }\n },\n {\n immediate: true,\n }\n)\n\nconst dialogStyle = computed(() => {\n return {\n maxHeight: unref(dialogHeight),\n }\n})\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,UAAA;AACR,CAAC,CAAA,CAAA;;;;;;AAuDD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,QAAQ,CAAA,CAAA;AAGzC,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAIvB,IAAM,MAAA,YAAA,GAAe,SAAS,MAAM;AAClC,MAAA,MAAM,MAAmB,GAAA,CAAC,YAAc,EAAA,OAAA,EAAS,WAAW,CAAA,CAAA;AAC5D,MAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,MAAA,MAAM,GAA8B,GAAA,EAAE,GAAG,KAAA,EAAO,GAAG,KAAM,EAAA,CAAA;AACzD,MAAA,KAAA,MAAW,OAAO,GAAK,EAAA;AACrB,QAAA,IAAI,MAAO,CAAA,OAAA,CAAQ,GAAG,CAAA,KAAM,CAAI,CAAA,EAAA;AAC9B,UAAA,OAAO,IAAI,GAAG,CAAA,CAAA;AAAA,SAChB;AAAA,OACF;AACA,MAAO,OAAA,GAAA,CAAA;AAAA,KACR,CAAA,CAAA;AACD,IAAM,MAAA,YAAA,GAAe,GAAI,CAAA,KAAA,CAAM,iBAAiB,CAAA,CAAA;AAEhD,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,iBAAA;AAAA,MACZ,MAAM;AACJ,QAAA,YAAA,CAAa,QAAQ,KAAM,CAAA,iBAAA,CAAA;AAAA,OAC7B;AAAA,KACF,CAAA;AAE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ialog__header{margin-right:0}.dk-dialog .el-dialog__body{padding:10px 0}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"file-input.vue2.mjs","sources":["../../../src/file-input/src/file-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkFileInput',\n});\n</script>\n<template>\n <div :class=\"bem()\">\n <!--↓↓↓↓显示input框↓↓↓↓-->\n <template v-if=\"showInput\">\n <el-input v-model=\"input\" :placeholder=\"placeholder\" clearable>\n <template #append>\n <el-button @click=\"onClick\">选择</el-button>\n </template>\n </el-input>\n <!--选择的是图片-->\n <div class=\"show m-t-5px\">\n <el-image
|
1
|
+
{"version":3,"file":"file-input.vue2.mjs","sources":["../../../src/file-input/src/file-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkFileInput',\n});\n</script>\n<template>\n <div :class=\"bem()\">\n <!--↓↓↓↓显示input框↓↓↓↓-->\n <template v-if=\"showInput\">\n <el-input v-model=\"input\" :placeholder=\"placeholder\" clearable>\n <template #append>\n <el-button @click=\"onClick\">选择</el-button>\n </template>\n </el-input>\n <!--选择的是图片-->\n <div class=\"show m-t-5px\">\n <el-image v-if=\"type === 1\" :src=\"input\" alt=\"\" fit=\"contain\" class=\"file rd-4px\" :preview-src-list=\"[input]\">\n <template #error>\n <div class=\"image-error\">\n <dk-icon icon=\"Picture\"></dk-icon>\n </div>\n </template>\n </el-image>\n <dk-file-icon v-else :file-url=\"input\" class=\"file rd-4px\" :type=\"type\" />\n <em @click=\"input = ''\">\n <dk-icon icon=\"Close\"></dk-icon>\n </em>\n </div>\n </template>\n <!--↓↓↓↓不显示input框↓↓↓↓-->\n <template v-else>\n <div\n class=\"only-img flex justify-center items-center\"\n style=\"position: relative\"\n :style=\"{ width: imgSize + 'px', height: imgSize + 'px' }\"\n @click=\"onClick\"\n >\n <template v-if=\"input\">\n <!--图片附件-->\n <el-image v-if=\"type === 1\" :src=\"input\" alt=\"\" fit=\"contain\" style=\"width: 100%; height: 100%\">\n <template #error>\n <div class=\"image-slot\">\n <div class=\"no-image\">\n <el-icon><Picture /></el-icon>\n </div>\n </div>\n </template>\n </el-image>\n <!--其他附件-->\n <template v-if=\"type !== 1 && input\">\n <dk-file-icon :file-url=\"input\" class=\"file rd-4px\" :type=\"type\" />\n </template>\n <div class=\"close\" @click.stop=\"onClear()\">\n <el-icon><Close /></el-icon>\n </div>\n </template>\n <!--没有上传的时候-->\n <template v-else>\n <div\n class=\"media\"\n :style=\"{\n lineHeight: imgSize + 'px',\n fontSize: imgSize / 2 + 'px',\n }\"\n >\n <el-icon><Plus /></el-icon>\n </div>\n </template>\n </div>\n </template>\n <dk-attachment-dialog ref=\"attachmentDialog\" :type=\"type\" @confirm=\"onConfirm\" />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace } from '@vipl520/utils'\nimport { fileInputProps } from './props'\nimport { ref, watch } from 'vue'\nimport DkFileIcon from '../../attachment/src/file-icon.vue'\n\nconst [_, bem] = createNamespace('file-input')\n\n\n\nconst props = defineProps(fileInputProps)\nconst input = ref(props.modelValue)\nconst attachmentDialog = ref()\n\nconst emit = defineEmits(['input', 'update:modelValue', 'change'])\nwatch(\n () => props.modelValue,\n (val) => {\n input.value = val\n }\n)\n\nwatch(\n () => input.value,\n (val) => {\n handleInput(val)\n }\n)\n\nconst handleInput = (val: any) => {\n emit('update:modelValue', val)\n emit('input', val)\n emit('change', val)\n}\n\nconst onClear = () => {\n input.value = ''\n}\n\nconst onClick = () => {\n attachmentDialog.value.open()\n}\n// 确认选中附件\nconst onConfirm = (chooseFileList: any) => {\n input.value = chooseFileList[0].url\n}\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"file-list-input.vue2.mjs","sources":["../../../src/file-list-input/src/file-list-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkFileListInput',\n});\n</script>\n<template>\n <div :class=\"bem()\">\n <div class=\"dk-image-list\">\n <ul>\n <li v-for=\"(item, key) in input\" :key=\"key\">\n <div class=\"file\" :style=\"_style\">\n <el-image
|
1
|
+
{"version":3,"file":"file-list-input.vue2.mjs","sources":["../../../src/file-list-input/src/file-list-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkFileListInput',\n});\n</script>\n<template>\n <div :class=\"bem()\">\n <div class=\"dk-image-list\">\n <ul>\n <li v-for=\"(item, key) in input\" :key=\"key\">\n <div class=\"file\" :style=\"_style\">\n <el-image v-if=\"type === 1\" :src=\"item\" fit=\"contain\" :style=\"_style\" />\n <dk-file-icon v-else :file-url=\"item\" class=\"file rd-4px\" :type=\"type\" />\n <div v-if=\"!disabled\" class=\"close\" @click=\"deleteFile(key)\">\n <el-icon><Close /></el-icon>\n </div>\n </div>\n </li>\n <li v-if=\"limit > input.length && !disabled\">\n <div class=\"chooseImage\" :style=\"_style\" @click=\"onClick()\">\n <el-icon><Plus /></el-icon>\n </div>\n </li>\n </ul>\n </div>\n <dk-attachment-dialog ref=\"attachment\" :type=\"type\" @confirm=\"onConfirm\" />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace } from '@vipl520/utils'\nimport { fileListInputProps } from './props'\nimport { computed, ref, watch } from 'vue'\nimport DkFileIcon from '../../attachment/src/file-icon.vue'\n\nconst [_, bem] = createNamespace('file-list-input')\n\n\n\nconst props = defineProps(fileListInputProps)\nconst emit = defineEmits(['input', 'update:modelValue', 'change'])\nconst input: any = ref(props.modelValue)\nconst _style = computed(() => {\n return {\n width: props.imgSize + 'px',\n height: props.imgSize + 'px',\n lineHeight: props.imgSize + 'px',\n }\n})\n\nconst attachment = ref()\n\nconst onClick = () => {\n attachment.value.open()\n}\nconst onConfirm = (chooseFileList: any) => {\n chooseFileList.forEach((item: any) => {\n if (input.value.length < props.limit) {\n input.value.push(item.url)\n handleInput(input.value)\n }\n })\n}\nconst deleteFile = (index: number) => {\n input.value.splice(index, 1)\n}\n\nwatch(\n () => props.modelValue,\n (val) => {\n input.value = val\n }\n)\n\nwatch(\n () => input.value,\n (val) => {\n handleInput(val)\n }\n)\n\nconst handleInput = (val: any) => {\n emit('update:modelValue', val)\n emit('input', val)\n emit('change', val)\n}\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,iBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAgCD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,iBAAiB,CAAA,CAAA;AAMlD,IAAM,MAAA,KAAA,GAAa,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AACvC,IAAM,MAAA,MAAA,GAAS,SAAS,MAAM;AAC5B,MAAO,OAAA;AAAA,QACL,KAAA,EAAO,MAAM,OAAU,GAAA,IAAA;AAAA,QACvB,MAAA,EAAQ,MAAM,OAAU,GAAA,IAAA;AAAA,QACxB,UAAA,EAAY,MAAM,OAAU,GAAA,IAAA;AAAA,OAC9B,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,MAAM,aAAa,GAAI,EAAA,CAAA;AAEvB,IAAA,MAAM,UAAU,MAAM;AACpB,MAAA,UAAA,CAAW,MAAM,IAAK,EAAA,CAAA;AA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../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\">\n 提交</el-button\n >\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\">\n 提交</el-button\n >\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,CA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Q,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
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;;;;;;;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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A,SACvB,CAAA,CACA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hot-area-content.vue2.mjs","sources":["../../../../src/hot-area-input/src/component/hot-area-content.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'HotAreaContent',\n});\n</script>\n<template>\n <div class=\"hot-area-content\">\n <div class=\"hot-area-draggable\">\n <div\n v-if=\"hotData.background\"\n :style=\"{\n width: hotData.width + 'px',\n height: hotData.height + 'px',\n backgroundImage: 'url(' + hotData.background + ')',\n }\"\n style=\"background-size: 100% 100%\"\n @contextmenu.prevent\n >\n <vue3-draggable-resizable\n v-for=\"(item, key) in hotData.views\"\n :key=\"key\"\n ref=\"draggables\"\n v-model:h=\"item.css.height\"\n v-model:x=\"item.css.left\"\n v-model:y=\"item.css.top\"\n v-model:w=\"item.css.width\"\n :init-w=\"item.css.width\"\n :init-h=\"item.css.height\"\n :parent=\"true\"\n style=\"cursor: move\"\n :min-width=\"20\"\n :min-height=\"20\"\n @resizing=\"onResize\"\n @dragging=\"onDrag\"\n @mousedown=\"index = key\"\n >\n <div
|
1
|
+
{"version":3,"file":"hot-area-content.vue2.mjs","sources":["../../../../src/hot-area-input/src/component/hot-area-content.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'HotAreaContent',\n});\n</script>\n<template>\n <div class=\"hot-area-content\">\n <div class=\"hot-area-draggable\">\n <div\n v-if=\"hotData.background\"\n :style=\"{\n width: hotData.width + 'px',\n height: hotData.height + 'px',\n backgroundImage: 'url(' + hotData.background + ')',\n }\"\n style=\"background-size: 100% 100%\"\n @contextmenu.prevent\n >\n <vue3-draggable-resizable\n v-for=\"(item, key) in hotData.views\"\n :key=\"key\"\n ref=\"draggables\"\n v-model:h=\"item.css.height\"\n v-model:x=\"item.css.left\"\n v-model:y=\"item.css.top\"\n v-model:w=\"item.css.width\"\n :init-w=\"item.css.width\"\n :init-h=\"item.css.height\"\n :parent=\"true\"\n style=\"cursor: move\"\n :min-width=\"20\"\n :min-height=\"20\"\n @resizing=\"onResize\"\n @dragging=\"onDrag\"\n @mousedown=\"index = key\"\n >\n <div class=\"hot-item-content\" style=\"position: relative; width: 100%; height: 100%; background: #0003\">\n {{ key + 1 }}\n </div>\n </vue3-draggable-resizable>\n </div>\n <div v-else style=\"width: 500px; height: 500px\">\n <el-empty description=\"请上传图片\"></el-empty>\n </div>\n </div>\n <div class=\"hot-area-form\">\n <h3 style=\"margin-top: 0; font-size: 16px; font-weight: 500\">热区管理</h3>\n <el-form label-width=\"80px\" label-position=\"left\">\n <el-form-item label=\"背景图 \">\n <dk-image-input v-model=\"hotData.background\" />\n </el-form-item>\n <el-form-item v-for=\"(item, key) in hotData.views\" :key=\"key\" :label=\"'热区' + (key + 1)\">\n <el-input v-model=\"hotData.views[key].url\" placeholder=\"填写跳转地址\">\n <template #append>\n <el-button @click=\"delView(key)\">删除</el-button>\n </template>\n </el-input>\n </el-form-item>\n </el-form>\n <el-button :disabled=\"!hotData.background\" type=\"primary\" @click=\"addView()\">{{\n hotData.background ? '添加热区' : '请先上传图片'\n }}</el-button>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\n// import Vue3DraggableResizable, { DraggableContainer } from 'vue3-draggable-resizable'\nimport { reactive, ref, watch, onMounted } from 'vue'\n\n\nconst props = defineProps({\n hotDataValue: {\n default: () => {\n return {\n views: [],\n width: 400,\n height: 400,\n background: null,\n }\n },\n type: Object,\n },\n})\nconst index = ref(0)\nconst hotData = reactive(props.hotDataValue)\nconst addView = () => {\n // 这里hotData可以能没有views,如果没有就添加上views\n if (!Array.isArray(hotData.views)) {\n hotData.views = []\n }\n hotData.views.push({\n css: {\n left: 0,\n top: 0,\n width: 80,\n height: 80,\n borderRadius: 0,\n borderColor: '#fff',\n },\n url: '',\n })\n}\n\nconst delView = (indexToDelete: any) => {\n if (indexToDelete >= 0 && indexToDelete < hotData.views.length) {\n hotData.views.splice(indexToDelete, 1)\n }\n}\n\nconst onDrag = (p: any) => {\n const css = hotData.views[index.value].css\n css.left = p.x\n css.top = p.y\n}\nconst onResize = (p: any) => {\n const css = hotData.views[index.value].css\n css.left = p.x\n css.top = p.y\n css.width = p.w\n css.height = p.h\n}\n\nonMounted(() => {\n resetSize()\n})\n\nwatch(\n () => hotData?.background,\n () => {\n resetSize()\n }\n)\n\nconst resetSize = () => {\n if (hotData.background) {\n getImageSize(hotData.background)\n .then((image: any) => {\n hotData.width = 500\n hotData.height = (image.height * 500) / image.width\n setTimeout(() => {\n // checkParentSize()\n }, 200)\n })\n .catch(() => {})\n }\n}\n\nconst getImageSize = (url: any) => {\n return new Promise(function (resolve, reject) {\n const image = new Image()\n image.onload = function () {\n resolve({\n width: image.width,\n height: image.height,\n })\n }\n image.onerror = function () {\n reject(new Error('error'))\n }\n image.src = url\n })\n}\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,gBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;;;;;;;;AAgFD,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,OAAA,GAAU,QAAS,CAAA,KAAA,CAAM,YAAY,CAAA,CAAA;AAC3C,IAAA,MAAM,UAAU,MAAM;AAEpB,MAAA,IAAI,CAAC,KAAA,CAAM,OAAQ,CAAA,OAAA,CAAQ,KAAK,CAAG,EAAA;AACjC,QAAA,OAAA,CAAQ,QAAQ,EAAC,CAAA;AAAA,OACnB;AACA,MAAA,OAAA,CAAQ,MAAM,IAAK,CAAA;AAAA,QACjB,GAAK,EAAA;AAAA,UACH,IAAM,EAAA,CAAA;AAAA,UACN,GAAK,EAAA,CAAA;AAAA,UACL,KAAO,EAAA,EAAA;AAAA,UACP,MAAQ,EAAA,EAAA;AAAA,UACR,YAAc,EAAA,CAAA;AAAA,UACd,WAAa,EAAA,MAAA;AAAA,SACf;AAAA,QACA,GAAK,EAAA,EAAA;AAAA,OACN,CAAA,CAAA;AAAA,KACH,CAAA;AAEA,IAAM,MAAA,OAAA,GAAU,CAAC,aAAuB,KAAA;AACtC,MAAA,IAAI,aAAiB,IAAA,CAAA,IAAK,aAAgB,GAAA,OAAA,CAAQ,MAAM,MAAQ,EAA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AA,GAAA,GAAO,KAAM,CAAA,KAAA,CAAA;AAC9C,UAAA,UAAA,CAAW,MAAM;AAAA,aAEd,GAAG,CAAA,CAAA;AAAA,SACP,CACA,CAAA,KAAA,CAAM,MAAM;AAAA,SAAE,CAAA,CAAA;AAAA,OACnB;AAAA,KACF,CAAA;AAEA,IAAM,MAAA,YAAA,GAAe,CAAC,GAAa,KAAA;AACjC,MAAA,OAAO,IAAI,OAAA,CAAQ,SAAU,OAAA,EAAS,MAAQ,EAAA;AAC5C,QAAM,MAAA,KAAA,GAAQ,IAAI,KAAM,EAAA,CAAA;AACxB,QAAA,KAAA,CAAM,SAAS,WAAY;AACzB,UAAQ,OAAA,CAAA;AAAA,YACN,OAAO,KAAM,CAAA,KAAA;AAAA,YACb,QAAQ,KAAM,CAAA,MAAA;AAAA,WACf,CAAA,CAAA;AAAA,SACH,CAAA;AACA,QAAA,KAAA,CAAM,UAAU,WAAY;AAC1B,UAAO,MAAA,CAAA,IAAI,KAAM,CAAA,OAAO,CAAC,CAAA,CAAA;AAAA,SAC3B,CAAA;AACA,QAAA,KAAA,CAAM,GAAM,GAAA,GAAA,CAAA;AAAA,OACb,CAAA,CAAA;AAAA,KACH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hot-area-input.vue2.mjs","sources":["../../../src/hot-area-input/src/hot-area-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkHotAreaInput',\n});\n</script>\n<template>\n <div class=\"dk-hot-area-input\">\n <el-button type=\"primary\" @click=\"dialog = true\">设置热区</el-button>\n <dk-dialog v-model=\"dialog\" width=\"1000px\" title=\"设置热区\">\n <hot-area-content :hot-data-value=\"input\"></hot-area-content>\n <template #footer>\n <div class=\"text-center\">\n <el-button
|
1
|
+
{"version":3,"file":"hot-area-input.vue2.mjs","sources":["../../../src/hot-area-input/src/hot-area-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkHotAreaInput',\n});\n</script>\n<template>\n <div class=\"dk-hot-area-input\">\n <el-button type=\"primary\" @click=\"dialog = true\">设置热区</el-button>\n <dk-dialog v-model=\"dialog\" width=\"1000px\" title=\"设置热区\">\n <hot-area-content :hot-data-value=\"input\"></hot-area-content>\n <template #footer>\n <div class=\"text-center\">\n <el-button size=\"default\" style=\"width: 200px\" type=\"primary\" @click=\"dialog = false\">确定</el-button>\n </div>\n </template>\n </dk-dialog>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { hotAreaInputProps } from './props'\nimport { ref, reactive } from 'vue'\nimport HotAreaContent from './component/hot-area-content.vue'\n\n\nconst props = defineProps(hotAreaInputProps)\nconst input = reactive(props.modelValue)\nconst dialog = ref(false)\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,gBAAA;AACR,CAAC,CAAA,CAAA;;;;;;AAuBD,IAAM,MAAA,KAAA,GAAQ,QAAS,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AACvC,IAAM,MAAA,MAAA,GAAS,IAAI,KAAK,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icon.vue2.mjs","sources":["../../../src/icon/src/icon.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkIcon',\n});\n</script>\n<template>\n <el-icon :class=\"bem()\" :style=\"getIconifyStyle\">\n <slot>\n <Icon v-if=\"iconType === 'cloud'\" :icon=\"props.icon\" />\n <component :is=\"props.icon\" v-if=\"iconType === 'el'\" />\n <van-icon
|
1
|
+
{"version":3,"file":"icon.vue2.mjs","sources":["../../../src/icon/src/icon.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkIcon',\n});\n</script>\n<template>\n <el-icon :class=\"bem()\" :style=\"getIconifyStyle\">\n <slot>\n <Icon v-if=\"iconType === 'cloud'\" :icon=\"props.icon\" />\n <component :is=\"props.icon\" v-if=\"iconType === 'el'\" />\n <van-icon v-if=\"iconType === 'vant'\" :class=\"bem()\" :name=\"props.icon\" :style=\"getIconifyStyle\"></van-icon>\n </slot>\n </el-icon>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Icon } from '@iconify/vue'\nimport { computed } from 'vue'\nimport { createNamespace } from '@vipl520/utils'\nimport { iconProps } from './props'\nimport * as ElementPlusIconsVue from '@element-plus/icons-vue'\nimport icons from '@vant/icons'\n\nconst [_, bem] = createNamespace('icon')\n\n\nconst props = defineProps(iconProps)\n// 获取element-plus所有图标\nconst elIcons = Object.keys(ElementPlusIconsVue).map((key) => {\n return key\n})\nconst getIconifyStyle = computed(() => {\n const { color, size, hoverColor } = props\n const style: any = {}\n if (color) style.color = color\n if (size) style.fontSize = `${size}px`\n if (hoverColor) style['--hover-color'] = hoverColor\n return style\n})\n\nconst iconType = computed(() => {\n let type = 'cloud'\n if (elIcons.includes(props.icon) && props.showEl) {\n type = 'el'\n }\n if (props.showVant) {\n // 这里类型有些问题\n if (icons.basic.includes(props.icon)) {\n type = 'vant'\n }\n if (icons.outline.includes(props.icon)) {\n type = 'vant'\n }\n if (icons.filled.includes(props.icon)) {\n type = 'vant'\n }\n }\n return type\n})\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AAM,CAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,CAAM,IAAI,CAAG,EAAA;AACtC,UAAO,IAAA,GAAA,MAAA,CAAA;AAAA,SACT;AACA,QAAA,IAAI,KAAM,CAAA,MAAA,CAAO,QAAS,CAAA,KAAA,CAAM,IAAI,CAAG,EAAA;AACrC,UAAO,IAAA,GAAA,MAAA,CAAA;AAAA,SACT;AAAA,OACF;AACA,MAAO,OAAA,IAAA,CAAA;AAAA,KACR,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -210,7 +210,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
210
210
|
128
|
211
211
|
/* KEYED_FRAGMENT */
|
212
212
|
)),
|
213
|
-
!searchIcon.value ? (openBlock(), createElementBlock("p", _hoisted_2, "
|
213
|
+
!searchIcon.value ? (openBlock(), createElementBlock("p", _hoisted_2, "\u5F53\u524D\u663E\u793A\u5DF2\u7F13\u5B58\u7684\u56FE\u6807")) : createCommentVNode("v-if", true)
|
214
214
|
],
|
215
215
|
64
|
216
216
|
/* STABLE_FRAGMENT */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icon-content.vue2.mjs","sources":["../../../src/icon-input/src/icon-content.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkIconContent',\n});\n</script>\n<template>\n <div class=\"dk-icon-content\">\n <el-tabs v-model=\"activeName\">\n <el-tab-pane
|
1
|
+
{"version":3,"file":"icon-content.vue2.mjs","sources":["../../../src/icon-input/src/icon-content.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkIconContent',\n});\n</script>\n<template>\n <div class=\"dk-icon-content\">\n <el-tabs v-model=\"activeName\">\n <el-tab-pane v-if=\"props.showTab.el\" label=\"element图标\" name=\"element\" class=\"dk-tab-pane\">\n <dk-icon\n v-for=\"(item, key) in _elIcons\"\n :key=\"key\"\n :size=\"36\"\n :color=\"item == chooseIcon ? 'var(--el-color-primary)' : ''\"\n :class=\"item == chooseIcon ? 'choose-icon' : 'dk-icon'\"\n class=\"cursor-pointer\"\n hover-color=\"var(--el-color-primary)\"\n @click=\"onChooseIcon(item)\"\n >\n <component :is=\"item\" />\n </dk-icon>\n </el-tab-pane>\n <el-tab-pane v-if=\"props.showTab.vant\" label=\"vant图标\" name=\"vant\" class=\"dk-tab-pane\">\n <dk-icon\n v-for=\"(item, key) in _vantIcons\"\n :key=\"key\"\n :size=\"36\"\n :color=\"item == chooseIcon ? '#409eff' : ''\"\n :class=\"item == chooseIcon ? 'choose-icon' : 'dk-icon'\"\n class=\"cursor-pointer\"\n hover-color=\"var(--el-color-primary)\"\n :icon=\"item\"\n @click=\"onChooseIcon(item)\"\n >\n </dk-icon>\n </el-tab-pane>\n <el-tab-pane v-if=\"props.showTab.cloud\" label=\"云端图标\" name=\"cloud\" class=\"dk-tab-pane\">\n <template v-if=\"_iconifyIcons.length > 0\">\n <dk-icon\n v-for=\"(item, key) in _iconifyIcons\"\n :key=\"key\"\n :icon=\"item\"\n :size=\"36\"\n hover-color=\"var(--el-color-primary)\"\n :color=\"item == chooseIcon ? '#409eff' : ''\"\n :class=\"item == chooseIcon ? 'choose-icon' : 'dk-icon'\"\n class=\"cursor-pointer\"\n @click=\"onChooseIcon(item)\"\n >\n </dk-icon>\n <p v-if=\"!searchIcon\" class=\"text-center\" style=\"font-size: 12px; color: #999\">当前显示已缓存的图标</p>\n </template>\n <el-empty v-else description=\"暂无图标,请搜索\"></el-empty>\n </el-tab-pane>\n </el-tabs>\n <div class=\"search-icon\">\n <el-input v-model=\"searchIcon\" clearable :placeholder=\"searchPlaceholder\" @clear=\"onClear\">\n <template #append>\n <el-button :icon=\"Search\" @click=\"onSearch()\" />\n </template>\n </el-input>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, ref, watch, watchEffect } from 'vue'\nimport * as ElementPlusIconsVue from '@element-plus/icons-vue'\nimport { Search } from '@element-plus/icons-vue'\nimport { listIcons, disableCache } from '@iconify/vue'\nimport { getIcons } from '../../api/common'\nimport icons from '@vant/icons'\nimport { iconContentProps } from './props'\n\n// Disable all caching\ndisableCache('all')\n// List all icons\n\nconst props = defineProps(iconContentProps)\n\nfunction convertIconsToArray(iconsObj: any) {\n let iconArray: any = []\n for (const key in iconsObj) {\n // eslint-disable-next-line no-prototype-builtins\n if (iconsObj.hasOwnProperty(key) && Array.isArray(iconsObj[key])) {\n iconArray = iconArray.concat(iconsObj[key])\n }\n }\n return iconArray\n}\n\n// 获取element-plus所有图标\nconst elIcons = Object.keys(ElementPlusIconsVue).map((key) => {\n return key\n})\n\nconst vantIcons = convertIconsToArray(icons)\n\nconst _elIcons = ref(elIcons)\nconst _vantIcons = ref(vantIcons)\n\nconst iconifyIcons = listIcons()\nconst _iconifyIcons = ref(iconifyIcons)\n\n// 选中的tab\n// const activeName = ref(props.type)\nconst determineActiveName = () => {\n const { el, vant, cloud } = props.showTab\n\n if (el) {\n return 'element'\n } else if (vant) {\n return 'vant'\n } else if (cloud) {\n return 'cloud'\n }\n\n return props.type // 如果所有的选项都是 false,使用 type 的默认值\n}\n\n// 初始化 activeName\nconst activeName = ref(determineActiveName())\n\nconst searchIcon = ref('')\nconst searchPlaceholder = computed(() => {\n if (activeName.value === 'element') {\n return '搜索element-plus图标'\n } else if (activeName.value === 'vant') {\n return '搜索vant图标'\n } else {\n return '搜索云端图标'\n }\n})\n// 选中的图标\nconst chooseIcon = ref('')\nconst emit = defineEmits(['choose'])\n\n// 选择图标\nconst onChooseIcon = (icon: string) => {\n chooseIcon.value = icon\n emit('choose', icon)\n}\nconst onSearch = () => {\n if (activeName.value === 'element') {\n const searchTerm = searchIcon.value.toLowerCase() // 将搜索关键字转换为小写\n console.log(searchTerm)\n _elIcons.value = elIcons.filter((item) => {\n if (searchTerm) {\n const lowerItem = item.toLowerCase() // 将图标名转换为小写\n // 模糊查询匹配\n if (lowerItem.includes(searchTerm)) {\n return true // 匹配成功,返回 true\n }\n }\n return false // 没有匹配,返回 false\n })\n } else if (activeName.value === 'vant') {\n console.log('use')\n _vantIcons.value = vantIcons.filter((item: any) => {\n if (searchIcon.value) {\n const lowerItem = item.toLowerCase() // 将图标名转换为小写\n // 模糊查询匹配\n if (lowerItem.includes(searchIcon.value)) {\n return true // 匹配成功,返回 true\n }\n }\n return false // 没有匹配,返回 false\n })\n } else {\n // 云端\n getIcons(searchIcon.value)\n .then((res) => {\n _iconifyIcons.value = res.data\n })\n .catch((res) => {\n console.log(res)\n })\n }\n}\n\nconst onClear = () => {\n searchIcon.value = ''\n _elIcons.value = elIcons\n _iconifyIcons.value = iconifyIcons\n _vantIcons.value = vantIcons\n}\n\n// 导出ref\ndefineExpose({\n chooseIcon,\n})\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAuED,IAAA,YAAA,CAAa,KAAK,CAAA,CAAA;AAKlB,IAAA,SAAS,oBAAoB,QAAe,EAAA;AAC1C,MAAA,IAAI,YAAiB,EAAC,CAAA;AACtB,MAAA,KAAA,MAAW,OAAO,QAAU,EAAA;AAE1B,QAAI,IAAA,QAAA,CAAS,eAAe,GAAG,CAAA,IAAK,MAAM,OAAQ,CAAA,QAAA,CAAS,GAAG,CAAC,CAAG,EAAA;AAChE,UAAA,SAAA,GAAY,SAAU,CAAA,MAAA,CAAO,QAAS,CAAA,GAAG,CAAC,CAAA,CAAA;AAAA,SAC5C;AAAA,OACF;AACA,MAAO,OAAA,SAAA,CAAA;AAAA,KACT;AAGA,IAAA,MAAM,UAAU,MAAO,CAAA,IAAA,CAAK,mBAAmB,CAAE,CAAA,GAAA,CAAI,CAAC,GAAQ,KA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3B,CAAA,CACA,KAAM,CAAA,CAAC,GAAQ,KAAA;AACd,UAAA,OAAA,CAAQ,IAAI,GAAG,CAAA,CAAA;AAAA,SAChB,CAAA,CAAA;AAAA,OACL;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,UAAU,MAAM;AACpB,MAAA,UAAA,CAAW,KAAQ,GAAA,EAAA,CAAA;AACnB,MAAA,QAAA,CAAS,KAAQ,GAAA,OAAA,CAAA;AACjB,MAAA,aAAA,CAAc,KAAQ,GAAA,YAAA,CAAA;AACtB,MAAA,UAAA,CAAW,KAAQ,GAAA,SAAA,CAAA;AAAA,KACrB,CAAA;AAGA,IAAa,QAAA,CAAA;AAAA,MACX,UAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"image-list-input.vue2.mjs","sources":["../../../src/image-list-input/src/image-list-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkImageListInput',\n});\n</script>\n<template>\n <dk-file-list-input
|
1
|
+
{"version":3,"file":"image-list-input.vue2.mjs","sources":["../../../src/image-list-input/src/image-list-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkImageListInput',\n});\n</script>\n<template>\n <dk-file-list-input v-bind=\"$props\" v-model=\"input\" :class=\"bem()\" :type=\"1\" @change=\"handleInput(input)\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace } from '@vipl520/utils'\nimport { imageListInputProps } from './props'\nimport { ref, watch } from 'vue'\nconst [_, bem] = createNamespace('image-list-input')\n\n\n\nconst props = defineProps(imageListInputProps)\nconst input = ref(props.modelValue)\n\nconst emit = defineEmits(['input', 'update:modelValue', 'change'])\nwatch(\n () => props.modelValue,\n (val) => {\n input.value = val\n }\n)\n\nwatch(\n () => input.value,\n (val) => {\n handleInput(val)\n }\n)\n\nconst handleInput = (val: any) => {\n emit('update:modelValue', val)\n emit('input', val)\n emit('change', val)\n}\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,kBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAUD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,kBAAkB,CAAA,CAAA;AAKnD,IAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAGlC,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,CAAC,GAAQ,KAAA;AACP,QAAA,KAAA,CAAM,KAAQ,GAAA,GAAA,CAAA;AAAA,OAChB;AAAA,KACF,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,KAAA;AAAA,MACZ,CAAC,GAAQ,KAAA;AACP,QAAA,WAAA,CAAY,GAAG,CAAA,CAAA;AAAA,OACjB;AAAA,KACF,CAAA;AAEA,IAAM,MAAA,WAAA,GAAc,CAAC,GAAa,KAAA;AAChC,MAAA,IAAA,CAAK,qBAAqB,GAAG,CAAA,CAAA;AAC7B,MAAA,IAAA,CAAK,SAAS,GAAG,CAAA,CAAA;AACjB,MAAA,IAAA,CAAK,UAAU,GAAG,CAAA,CAAA;AAAA,KACpB,CAAA;;;;;;;;;;;;;;;;"}
|