@vipl520/dk-ui 1.0.54 → 1.0.55

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/dist/index.js +25 -4
  2. package/dist/index.min.js +2 -2
  3. package/dist/index.min.js.map +1 -1
  4. package/dist/index.min.mjs +1 -1
  5. package/dist/index.min.mjs.map +1 -1
  6. package/dist/index.mjs +25 -4
  7. package/dist/web-types.json +1 -1
  8. package/es/attachment/src/attachment.vue2.mjs +7 -1
  9. package/es/attachment/src/attachment.vue2.mjs.map +1 -1
  10. package/es/attachment-dialog/src/attachment-dialog.vue2.mjs +2 -0
  11. package/es/attachment-dialog/src/attachment-dialog.vue2.mjs.map +1 -1
  12. package/es/group/src/group.vue2.mjs +13 -1
  13. package/es/group/src/group.vue2.mjs.map +1 -1
  14. package/es/hot-area-input/src/component/hot-area-content.vue2.mjs +1 -1
  15. package/es/hot-area-input/src/component/hot-area-content.vue2.mjs.map +1 -1
  16. package/es/page-diy/src/views/min/DkMinGrid.vue.mjs +2 -1
  17. package/es/page-diy/src/views/min/DkMinGrid.vue.mjs.map +1 -1
  18. package/es/url-input/style/index.scss +26 -27
  19. package/lib/attachment/src/attachment.vue2.js +7 -1
  20. package/lib/attachment/src/attachment.vue2.js.map +1 -1
  21. package/lib/attachment-dialog/src/attachment-dialog.vue2.js +2 -0
  22. package/lib/attachment-dialog/src/attachment-dialog.vue2.js.map +1 -1
  23. package/lib/group/src/group.vue2.js +13 -1
  24. package/lib/group/src/group.vue2.js.map +1 -1
  25. package/lib/hot-area-input/src/component/hot-area-content.vue2.js +1 -1
  26. package/lib/hot-area-input/src/component/hot-area-content.vue2.js.map +1 -1
  27. package/lib/page-diy/src/views/min/DkMinGrid.vue.js +2 -1
  28. package/lib/page-diy/src/views/min/DkMinGrid.vue.js.map +1 -1
  29. package/lib/url-input/style/index.scss +26 -27
  30. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.vue2.js","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","computed","getAttachmentType","ref","getGlobalConfig","reactive","groupId","moveAttachment","ElMessage","_accept","ElMessageBox","deleteAttachment","delAttachmentGroup","getAttachmentGroupList","getAttachmentList","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,cAAA;AACR,CAAC,CAAA,CAAA;;;;;;AA+JD,IAAM,MAAA,KAAA,GAAQC,aAAS,MAAM;AAC3B,MAAO,OAAAC,uBAAA,CAAkB,MAAM,IAAI,CAAA,CAAA;AAAA,KACpC,CAAA,CAAA;AAID,IAAM,MAAA,cAAA,GAAiBC,QAAI,EAAE,CAAA,CAAA;AAE7B,IAAM,MAAA,aAAA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L,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,IAAAC,aAAA,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
+ {"version":3,"file":"attachment.vue2.js","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\" size=\"default\" 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 size=\"default\" 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 size=\"default\" 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\" size=\"default\">上传<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","computed","getAttachmentType","ref","getGlobalConfig","reactive","groupId","moveAttachment","ElMessage","_accept","ElMessageBox","deleteAttachment","delAttachmentGroup","getAttachmentGroupList","getAttachmentList","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,cAAA;AACR,CAAC,CAAA,CAAA;;;;;;AA+JD,IAAM,MAAA,KAAA,GAAQC,aAAS,MAAM;AAC3B,MAAO,OAAAC,uBAAA,CAAkB,MAAM,IAAI,CAAA,CAAA;AAAA,KACpC,CAAA,CAAA;AAID,IAAM,MAAA,cAAA,GAAiBC,QAAI,EAAE,CAAA,CAAA;AAE7B,IAAM,MAAA,aAAA,GAAgBA,OAAc,CAAA,EAAE,CAAA,CAAA;AAEtC,IAAM,MAAA,cAAA,GAAiBA,OAAW,CAAA,EAAE,CAAA,CAAA;AAEpC,IAAM,MAAA,YAAA,GAAeA,OAAc,CAAA,EAAE,CAAA,CAAA;AACrC,IAAA,MAAM,eAAeC,qBAAgB,EAAA,CAAA;AAErC,IAAM,MAAA,SAAA,GAAY,aAAa,MAAS,GAAA,6BAAA,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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -64,6 +64,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
64
64
  vue.createElementVNode("div", _hoisted_1, [
65
65
  vue.createVNode(_component_el_button, {
66
66
  type: "primary",
67
+ size: "default",
67
68
  onClick: _cache[0] || (_cache[0] = ($event) => confirm())
68
69
  }, {
69
70
  default: vue.withCtx(() => [
@@ -73,6 +74,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
73
74
  /* STABLE */
74
75
  }),
75
76
  vue.createVNode(_component_el_button, {
77
+ size: "default",
76
78
  onClick: _cache[1] || (_cache[1] = ($event) => cancel())
77
79
  }, {
78
80
  default: vue.withCtx(() => [
@@ -1 +1 @@
1
- {"version":3,"file":"attachment-dialog.vue2.js","sources":["../../../src/attachment-dialog/src/attachment-dialog.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkAttachmentDialog',\n});\n</script>\n<template>\n <DkDialog v-model=\"dialogVisible\" :class=\"bem()\" :title=\"title\" width=\"1040px\" :fullscreen=\"false\" :z-index=\"zIndex\">\n <dk-attachment ref=\"attachment\" :type=\"_type\" />\n <div class=\"text-center m2\">\n <el-button type=\"primary\" @click=\"confirm()\">确定</el-button>\n <el-button @click=\"cancel()\">关闭</el-button>\n </div>\n </DkDialog>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, getAttachmentTitle, getAttachmentType } from '@vipl520/utils'\nimport { attachmentDialogProps } from './props'\nimport { ref } from 'vue'\nimport { ElMessage } from 'element-plus'\nconst [_, bem] = createNamespace('attachment-dialog')\n\n\n\nconst props = defineProps(attachmentDialogProps)\nconst attachment = ref()\nconst dialogVisible = ref(false)\nconst title = ref(props.title || getAttachmentTitle(props.type))\n\nconst _type = ref(getAttachmentType(props.type))\n\nconst emit = defineEmits(['confirm'])\n\nconst confirm = () => {\n if (attachment.value.chooseFileList.length > 0) {\n emit('confirm', attachment.value.chooseFileList || [])\n dialogVisible.value = false\n } else {\n ElMessage.warning({ message: '请先选择文件' })\n }\n}\n\n// 关闭\nconst cancel = () => {\n dialogVisible.value = false\n}\n\nconst open = () => {\n dialogVisible.value = true\n}\n\ndefineExpose({\n dialogVisible,\n attachment,\n cancel,\n open,\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","ref","getAttachmentTitle","getAttachmentType","ElMessage"],"mappings":";;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,oBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAiBD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAIC,sBAAgB,mBAAmB,CAAA,CAAA;AAKpD,IAAA,MAAM,aAAaC,OAAI,EAAA,CAAA;AACvB,IAAM,MAAA,aAAA,GAAgBA,QAAI,KAAK,CAAA,CAAA;AAC/B,IAAA,MAAM,QAAQA,OAAI,CAAA,KAAA,CAAM,SAASC,wBAAmB,CAAA,KAAA,CAAM,IAAI,CAAC,CAAA,CAAA;AAE/D,IAAA,MAAM,KAAQ,GAAAD,OAAA,CAAIE,uBAAkB,CAAA,KAAA,CAAM,IAAI,CAAC,CAAA,CAAA;AAI/C,IAAA,MAAM,UAAU,MAAM;AACpB,MAAA,IAAI,UAAW,CAAA,KAAA,CAAM,cAAe,CAAA,MAAA,GAAS,CAAG,EAAA;AAC9C,QAAA,IAAA,CAAK,SAAW,EAAA,UAAA,CAAW,KAAM,CAAA,cAAA,IAAkB,EAAE,CAAA,CAAA;AACrD,QAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,OACjB,MAAA;AACL,QAAAC,qBAAA,CAAU,OAAQ,CAAA,EAAE,OAAS,EAAA,sCAAA,EAAU,CAAA,CAAA;AAAA,OACzC;AAAA,KACF,CAAA;AAGA,IAAA,MAAM,SAAS,MAAM;AACnB,MAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,KACxB,CAAA;AAEA,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,aAAA,CAAc,KAAQ,GAAA,IAAA,CAAA;AAAA,KACxB,CAAA;AAEA,IAAa,QAAA,CAAA;AAAA,MACX,aAAA;AAAA,MACA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,IAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"attachment-dialog.vue2.js","sources":["../../../src/attachment-dialog/src/attachment-dialog.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkAttachmentDialog',\n});\n</script>\n<template>\n <DkDialog v-model=\"dialogVisible\" :class=\"bem()\" :title=\"title\" width=\"1040px\" :fullscreen=\"false\" :z-index=\"zIndex\">\n <dk-attachment ref=\"attachment\" :type=\"_type\" />\n <div class=\"text-center m2\">\n <el-button type=\"primary\" size=\"default\" @click=\"confirm()\">确定</el-button>\n <el-button size=\"default\" @click=\"cancel()\">关闭</el-button>\n </div>\n </DkDialog>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, getAttachmentTitle, getAttachmentType } from '@vipl520/utils'\nimport { attachmentDialogProps } from './props'\nimport { ref } from 'vue'\nimport { ElMessage } from 'element-plus'\nconst [_, bem] = createNamespace('attachment-dialog')\n\n\n\nconst props = defineProps(attachmentDialogProps)\nconst attachment = ref()\nconst dialogVisible = ref(false)\nconst title = ref(props.title || getAttachmentTitle(props.type))\n\nconst _type = ref(getAttachmentType(props.type))\n\nconst emit = defineEmits(['confirm'])\n\nconst confirm = () => {\n if (attachment.value.chooseFileList.length > 0) {\n emit('confirm', attachment.value.chooseFileList || [])\n dialogVisible.value = false\n } else {\n ElMessage.warning({ message: '请先选择文件' })\n }\n}\n\n// 关闭\nconst cancel = () => {\n dialogVisible.value = false\n}\n\nconst open = () => {\n dialogVisible.value = true\n}\n\ndefineExpose({\n dialogVisible,\n attachment,\n cancel,\n open,\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","ref","getAttachmentTitle","getAttachmentType","ElMessage"],"mappings":";;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,oBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAiBD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAIC,sBAAgB,mBAAmB,CAAA,CAAA;AAKpD,IAAA,MAAM,aAAaC,OAAI,EAAA,CAAA;AACvB,IAAM,MAAA,aAAA,GAAgBA,QAAI,KAAK,CAAA,CAAA;AAC/B,IAAA,MAAM,QAAQA,OAAI,CAAA,KAAA,CAAM,SAASC,wBAAmB,CAAA,KAAA,CAAM,IAAI,CAAC,CAAA,CAAA;AAE/D,IAAA,MAAM,KAAQ,GAAAD,OAAA,CAAIE,uBAAkB,CAAA,KAAA,CAAM,IAAI,CAAC,CAAA,CAAA;AAI/C,IAAA,MAAM,UAAU,MAAM;AACpB,MAAA,IAAI,UAAW,CAAA,KAAA,CAAM,cAAe,CAAA,MAAA,GAAS,CAAG,EAAA;AAC9C,QAAA,IAAA,CAAK,SAAW,EAAA,UAAA,CAAW,KAAM,CAAA,cAAA,IAAkB,EAAE,CAAA,CAAA;AACrD,QAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,OACjB,MAAA;AACL,QAAAC,qBAAA,CAAU,OAAQ,CAAA,EAAE,OAAS,EAAA,sCAAA,EAAU,CAAA,CAAA;AAAA,OACzC;AAAA,KACF,CAAA;AAGA,IAAA,MAAM,SAAS,MAAM;AACnB,MAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,KACxB,CAAA;AAEA,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,aAAA,CAAc,KAAQ,GAAA,IAAA,CAAA;AAAA,KACxB,CAAA;AAEA,IAAa,QAAA,CAAA;AAAA,MACX,aAAA;AAAA,MACA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,IAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -324,12 +324,24 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
324
324
  icon: "Plus",
325
325
  plain: "",
326
326
  onClick: add
327
+ }, {
328
+ default: vue.withCtx(() => [
329
+ vue.createTextVNode("\u589E\u52A0")
330
+ ]),
331
+ _: 1
332
+ /* STABLE */
327
333
  }),
328
334
  vue.createVNode(_component_el_button, {
329
335
  icon: "Delete",
330
336
  plain: "",
331
337
  onClick: ($event) => del(index, index + 1)
332
- }, null, 8, ["onClick"])
338
+ }, {
339
+ default: vue.withCtx(() => [
340
+ vue.createTextVNode("\u5220\u9664")
341
+ ]),
342
+ _: 2
343
+ /* DYNAMIC */
344
+ }, 1032, ["onClick"])
333
345
  ]),
334
346
  _: 2
335
347
  /* DYNAMIC */
@@ -1 +1 @@
1
- {"version":3,"file":"group.vue2.js","sources":["../../../src/group/src/group.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkGroup',\n});\n</script>\n<template>\n <div :class=\"'dk-group _fc-group ' + (disabled ? '_fc-group-disabled' : '')\">\n <el-divider v-if=\"props.title\">{{ props.title }}</el-divider>\n <div v-if=\"data.sort.length === 0\">\n <el-button :key=\"'a_def'\" style=\"width: 100%\" type=\"primary\" @click=\"add\"> 添加数据 </el-button>\n </div>\n <draggable\n tag=\"el-collapse\"\n :list=\"props.modelValue\"\n :component-data=\"collapseComponentData\"\n item-key=\"id\"\n handle=\".collapse-title-rank\"\n >\n <template #item=\"{ element, index }\">\n <el-collapse-item :title=\"element.title\" :name=\"index\">\n <template #title>\n <div class=\"collapse-title\">\n <dk-icon icon=\"Rank\" class=\"collapse-title-rank\"></dk-icon>\n <span>{{ getTitle(index) }}</span>\n </div>\n </template>\n <template #default>\n <div :key=\"index\" class=\"_dk-group-container\">\n <Type\n :key=\"index\"\n :in-for=\"true\"\n :model-value=\"getFieldValue(index)\"\n :rule=\"data.cacheRule[index].rule\"\n :option=\"data.cacheRule[index].options\"\n :extend-option=\"true\"\n @update:modelValue=\"formData(index, $event)\"\n @emit-event=\"(name: any, ...args: any) => emitEvent(name, args, index)\"\n @update:api=\"($f: any) => add$f(index, $f)\"\n />\n <div class=\"_dk-group-handle\">\n <el-button-group>\n <el-button icon=\"Plus\" plain @click=\"add\" />\n <el-button icon=\"Delete\" plain @click=\"del(index, index + 1)\" />\n </el-button-group>\n </div>\n </div>\n </template>\n </el-collapse-item>\n </template>\n </draggable>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { markRaw, nextTick, reactive, watch, onMounted } from 'vue'\nimport { deepCopy, deepExtend, hasProperty } from '../utils/utils'\nimport extend from '../utils/extend'\n// import draggable from 'vuedraggable'\nimport { groupProps } from './props'\n\n\n\nconst props = defineProps(groupProps)\nconst emit = defineEmits(['update:modelValue', 'change', 'itemMounted', 'remove', 'add'])\nconst data: any = reactive({\n len: 0,\n cacheRule: {},\n cacheValue: {},\n sort: [],\n form: markRaw(props.formCreateInject.form.$form()),\n loading: true,\n})\n\nconst collapseComponentData = reactive({\n modelValue: [0],\n})\n\nconst Type = data.form\n\nwatch(\n () => props.rule, // 侦听 rule 属性\n (n, o) => {\n // 您原来的 handler 逻辑\n Object.keys(data.cacheRule).forEach((v) => {\n const item = data.cacheRule[v]\n if (item.$f) {\n const val = item.$f.formData()\n if (n === o) {\n item.$f.deferSyncValue(() => {\n deepExtend(item.rule, n, false)\n item.$f.setValue(val)\n }, true)\n } else {\n const val = item.$f.formData()\n item.$f.once('reloading', () => {\n item.$f.setValue(val)\n })\n item.rule = deepCopy(n)\n }\n }\n })\n },\n { deep: true } // 深度侦听\n)\n\nwatch(\n () => props.disabled, // 侦听 disabled 属性\n (n) => {\n // 您原来的 disabled 逻辑\n if (props.syncDisabled) {\n const lst = data.cacheRule\n Object.keys(lst).forEach((k) => {\n lst[k].$f.disabled(n)\n })\n }\n }\n)\n\nwatch(\n () => props.expand, // 侦听 expand 属性\n (n) => {\n // 您原来的 expand 逻辑\n const d = n - props.modelValue.length\n if (d > 0) {\n expandRule(d)\n }\n }\n)\n\nwatch(\n () => props.modelValue, // 侦听 modelValue 属性\n (n) => {\n // 您原来的 modelValue 逻辑\n n = n || []\n const keys = Object.keys(data.cacheRule)\n const total = keys.length // 缓存数\n const len = total - n.length // 缓存数-value数\n if (len < 0) {\n for (let i = len; i < 0; i++) {\n addRule(n.length - 1, true)\n }\n for (let i = 0; i < total; i++) {\n setValue(keys[i], n[i])\n }\n } else {\n if (len > 0) {\n for (let i = 0; i < len; i++) {\n console.log('keys[total - i - 1]', keys[total - i - 1])\n removeRule(keys[total - i - 1])\n }\n }\n n.forEach((val, i) => {\n setValue(keys[i], n[i])\n })\n }\n },\n { deep: true } // 深度侦听\n)\n\nwatch(\n () => ({ ...data.cacheRule }),\n (n) => {\n data.sort = Object.keys(n)\n },\n { immediate: true }\n)\n\nconst getFieldValue = (index: number) => {\n if (props.field) {\n return { [props.field]: _value(props.modelValue[index]) }\n } else {\n return props.modelValue[index]\n }\n}\n\nconst getTitle = (index: number) => {\n if (data.cacheRule[index]) {\n const { rule } = data.cacheRule[index]\n const defaultField = props.titleField ? props.titleField : rule[0]?.field\n return data.cacheRule[index].$f?.getValue(defaultField) || '点击展开'\n } else {\n return '点击展开'\n }\n}\nconst _value = (v: any) => {\n return v && hasProperty(v, props.field) ? v[props.field] : v\n}\nconst cache = (k: any, val: any) => {\n data.cacheValue[k] = JSON.stringify(val)\n}\nconst input = (value: any) => {\n emit('update:modelValue', value)\n emit('change', value)\n}\nconst formData = (index: any, formData: any) => {\n nextTick(() => {\n const keys = Object.keys(data.cacheRule)\n const value = keys.map((k: any) => {\n const _data = index === k ? formData : { ...data.cacheRule[k].$f.form }\n const value = props.field ? _data[props.field] || null : _data\n cache(k, value)\n return value\n })\n input(value)\n })\n}\n\nconst add$f = (index: any, $f: any) => {\n data.cacheRule[index].$f = $f\n nextTick(() => {\n if (props.syncDisabled) {\n $f.disabled(props.disabled)\n }\n emit('itemMounted', $f, Object.keys(data.cacheRule).indexOf(index))\n })\n}\n\nonMounted(() => {\n data.loading = false\n})\n\nconst setValue = (key: any, value: any) => {\n const field = props.field\n if (field) {\n value = { [field]: _value(value) }\n }\n if (data.cacheValue[key] === JSON.stringify(field ? value[field] : value)) {\n return\n }\n cache(key, value)\n}\nconst addRule = (index: any, isEmit = false) => {\n const rule = props.formCreateInject.form.copyRules(props.rule || [])\n const options: any = props.options\n ? { ...props.options }\n : {\n submitBtn: false,\n resetBtn: false,\n }\n if (props.defaultValue) {\n if (!options.formData) options.formData = {}\n const defVal = deepCopy(props.defaultValue)\n extend(options.formData, props.field ? { [props.field]: defVal } : defVal)\n }\n props.parse && props.parse({ rule, options, index: data.sort.length })\n data.cacheRule[index] = { rule, options }\n if (isEmit) {\n nextTick(() => emit('add', rule, Object.keys(data.cacheRule).length - 1))\n }\n}\n\nconst removeRule = (index: any, isEmit = false) => {\n delete data.cacheRule[index]\n delete data.cacheValue[index]\n if (isEmit) {\n nextTick(() => emit('remove', index))\n }\n}\nconst add = () => {\n if (props.disabled || props.onBeforeAdd(props.modelValue) === false) {\n return\n }\n const value = [...props.modelValue]\n value.push(props.defaultValue ? deepCopy(props.defaultValue) : props.field ? null : {})\n input(value)\n collapseComponentData.modelValue = [value.length - 1]\n}\nconst del = (index: number, key: number) => {\n if (props.disabled || props.onBeforeRemove(props.modelValue, index) === false) {\n return\n }\n const value = [...props.modelValue]\n value.splice(index, 1)\n input(value)\n}\n\nconst emitEvent = (name: any, args: any, index: any) => {\n emit(name, ...args, data.cacheRule[index].$f, index)\n}\n\nconst expandRule = (n: any) => {\n for (let i = 0; i < n; i++) {\n // eslint-disable-next-line vue/no-mutating-props\n props.modelValue.push(props.field ? null : {})\n }\n}\n\nconst d = (props.expand || 0) - props.modelValue.length\nfor (let i = 0; i < props.modelValue.length; i++) {\n addRule(i)\n}\nif (d > 0) {\n expandRule(d)\n}\n</script>\n"],"names":["__MACROS_defineComponent","reactive","markRaw","watch","deepExtend","val","deepCopy","d","hasProperty","formData","nextTick","value","onMounted","extend"],"mappings":";;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,SAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA6DD,IAAA,MAAM,OAAYC,YAAS,CAAA;AAAA,MACzB,GAAK,EAAA,CAAA;AAAA,MACL,WAAW,EAAC;AAAA,MACZ,YAAY,EAAC;AAAA,MACb,MAAM,EAAC;AAAA,MACP,MAAMC,WAAQ,CAAA,KAAA,CAAM,gBAAiB,CAAA,IAAA,CAAK,OAAO,CAAA;AAAA,MACjD,OAAS,EAAA,IAAA;AAAA,KACV,CAAA,CAAA;AAED,IAAA,MAAM,wBAAwBD,YAAS,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
1
+ {"version":3,"file":"group.vue2.js","sources":["../../../src/group/src/group.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkGroup',\n});\n</script>\n<template>\n <div :class=\"'dk-group _fc-group ' + (disabled ? '_fc-group-disabled' : '')\">\n <el-divider v-if=\"props.title\">{{ props.title }}</el-divider>\n <div v-if=\"data.sort.length === 0\">\n <el-button :key=\"'a_def'\" style=\"width: 100%\" type=\"primary\" @click=\"add\"> 添加数据 </el-button>\n </div>\n <draggable\n tag=\"el-collapse\"\n :list=\"props.modelValue\"\n :component-data=\"collapseComponentData\"\n item-key=\"id\"\n handle=\".collapse-title-rank\"\n >\n <template #item=\"{ element, index }\">\n <el-collapse-item :title=\"element.title\" :name=\"index\">\n <template #title>\n <div class=\"collapse-title\">\n <dk-icon icon=\"Rank\" class=\"collapse-title-rank\"></dk-icon>\n <span>{{ getTitle(index) }}</span>\n </div>\n </template>\n <template #default>\n <div :key=\"index\" class=\"_dk-group-container\">\n <Type\n :key=\"index\"\n :in-for=\"true\"\n :model-value=\"getFieldValue(index)\"\n :rule=\"data.cacheRule[index].rule\"\n :option=\"data.cacheRule[index].options\"\n :extend-option=\"true\"\n @update:modelValue=\"formData(index, $event)\"\n @emit-event=\"(name: any, ...args: any) => emitEvent(name, args, index)\"\n @update:api=\"($f: any) => add$f(index, $f)\"\n />\n <div class=\"_dk-group-handle\">\n <el-button-group>\n <el-button icon=\"Plus\" plain @click=\"add\">增加</el-button>\n <el-button icon=\"Delete\" plain @click=\"del(index, index + 1)\">删除</el-button>\n </el-button-group>\n </div>\n </div>\n </template>\n </el-collapse-item>\n </template>\n </draggable>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { markRaw, nextTick, reactive, watch, onMounted } from 'vue'\nimport { deepCopy, deepExtend, hasProperty } from '../utils/utils'\nimport extend from '../utils/extend'\n// import draggable from 'vuedraggable'\nimport { groupProps } from './props'\n\n\n\nconst props = defineProps(groupProps)\nconst emit = defineEmits(['update:modelValue', 'change', 'itemMounted', 'remove', 'add'])\nconst data: any = reactive({\n len: 0,\n cacheRule: {},\n cacheValue: {},\n sort: [],\n form: markRaw(props.formCreateInject.form.$form()),\n loading: true,\n})\n\nconst collapseComponentData = reactive({\n modelValue: [0],\n})\n\nconst Type = data.form\n\nwatch(\n () => props.rule, // 侦听 rule 属性\n (n, o) => {\n // 您原来的 handler 逻辑\n Object.keys(data.cacheRule).forEach((v) => {\n const item = data.cacheRule[v]\n if (item.$f) {\n const val = item.$f.formData()\n if (n === o) {\n item.$f.deferSyncValue(() => {\n deepExtend(item.rule, n, false)\n item.$f.setValue(val)\n }, true)\n } else {\n const val = item.$f.formData()\n item.$f.once('reloading', () => {\n item.$f.setValue(val)\n })\n item.rule = deepCopy(n)\n }\n }\n })\n },\n { deep: true } // 深度侦听\n)\n\nwatch(\n () => props.disabled, // 侦听 disabled 属性\n (n) => {\n // 您原来的 disabled 逻辑\n if (props.syncDisabled) {\n const lst = data.cacheRule\n Object.keys(lst).forEach((k) => {\n lst[k].$f.disabled(n)\n })\n }\n }\n)\n\nwatch(\n () => props.expand, // 侦听 expand 属性\n (n) => {\n // 您原来的 expand 逻辑\n const d = n - props.modelValue.length\n if (d > 0) {\n expandRule(d)\n }\n }\n)\n\nwatch(\n () => props.modelValue, // 侦听 modelValue 属性\n (n) => {\n // 您原来的 modelValue 逻辑\n n = n || []\n const keys = Object.keys(data.cacheRule)\n const total = keys.length // 缓存数\n const len = total - n.length // 缓存数-value数\n if (len < 0) {\n for (let i = len; i < 0; i++) {\n addRule(n.length - 1, true)\n }\n for (let i = 0; i < total; i++) {\n setValue(keys[i], n[i])\n }\n } else {\n if (len > 0) {\n for (let i = 0; i < len; i++) {\n console.log('keys[total - i - 1]', keys[total - i - 1])\n removeRule(keys[total - i - 1])\n }\n }\n n.forEach((val, i) => {\n setValue(keys[i], n[i])\n })\n }\n },\n { deep: true } // 深度侦听\n)\n\nwatch(\n () => ({ ...data.cacheRule }),\n (n) => {\n data.sort = Object.keys(n)\n },\n { immediate: true }\n)\n\nconst getFieldValue = (index: number) => {\n if (props.field) {\n return { [props.field]: _value(props.modelValue[index]) }\n } else {\n return props.modelValue[index]\n }\n}\n\nconst getTitle = (index: number) => {\n if (data.cacheRule[index]) {\n const { rule } = data.cacheRule[index]\n const defaultField = props.titleField ? props.titleField : rule[0]?.field\n return data.cacheRule[index].$f?.getValue(defaultField) || '点击展开'\n } else {\n return '点击展开'\n }\n}\nconst _value = (v: any) => {\n return v && hasProperty(v, props.field) ? v[props.field] : v\n}\nconst cache = (k: any, val: any) => {\n data.cacheValue[k] = JSON.stringify(val)\n}\nconst input = (value: any) => {\n emit('update:modelValue', value)\n emit('change', value)\n}\nconst formData = (index: any, formData: any) => {\n nextTick(() => {\n const keys = Object.keys(data.cacheRule)\n const value = keys.map((k: any) => {\n const _data = index === k ? formData : { ...data.cacheRule[k].$f.form }\n const value = props.field ? _data[props.field] || null : _data\n cache(k, value)\n return value\n })\n input(value)\n })\n}\n\nconst add$f = (index: any, $f: any) => {\n data.cacheRule[index].$f = $f\n nextTick(() => {\n if (props.syncDisabled) {\n $f.disabled(props.disabled)\n }\n emit('itemMounted', $f, Object.keys(data.cacheRule).indexOf(index))\n })\n}\n\nonMounted(() => {\n data.loading = false\n})\n\nconst setValue = (key: any, value: any) => {\n const field = props.field\n if (field) {\n value = { [field]: _value(value) }\n }\n if (data.cacheValue[key] === JSON.stringify(field ? value[field] : value)) {\n return\n }\n cache(key, value)\n}\nconst addRule = (index: any, isEmit = false) => {\n const rule = props.formCreateInject.form.copyRules(props.rule || [])\n const options: any = props.options\n ? { ...props.options }\n : {\n submitBtn: false,\n resetBtn: false,\n }\n if (props.defaultValue) {\n if (!options.formData) options.formData = {}\n const defVal = deepCopy(props.defaultValue)\n extend(options.formData, props.field ? { [props.field]: defVal } : defVal)\n }\n props.parse && props.parse({ rule, options, index: data.sort.length })\n data.cacheRule[index] = { rule, options }\n if (isEmit) {\n nextTick(() => emit('add', rule, Object.keys(data.cacheRule).length - 1))\n }\n}\n\nconst removeRule = (index: any, isEmit = false) => {\n delete data.cacheRule[index]\n delete data.cacheValue[index]\n if (isEmit) {\n nextTick(() => emit('remove', index))\n }\n}\nconst add = () => {\n if (props.disabled || props.onBeforeAdd(props.modelValue) === false) {\n return\n }\n const value = [...props.modelValue]\n value.push(props.defaultValue ? deepCopy(props.defaultValue) : props.field ? null : {})\n input(value)\n collapseComponentData.modelValue = [value.length - 1]\n}\nconst del = (index: number, key: number) => {\n if (props.disabled || props.onBeforeRemove(props.modelValue, index) === false) {\n return\n }\n const value = [...props.modelValue]\n value.splice(index, 1)\n input(value)\n}\n\nconst emitEvent = (name: any, args: any, index: any) => {\n emit(name, ...args, data.cacheRule[index].$f, index)\n}\n\nconst expandRule = (n: any) => {\n for (let i = 0; i < n; i++) {\n // eslint-disable-next-line vue/no-mutating-props\n props.modelValue.push(props.field ? null : {})\n }\n}\n\nconst d = (props.expand || 0) - props.modelValue.length\nfor (let i = 0; i < props.modelValue.length; i++) {\n addRule(i)\n}\nif (d > 0) {\n expandRule(d)\n}\n</script>\n"],"names":["__MACROS_defineComponent","reactive","markRaw","watch","deepExtend","val","deepCopy","d","hasProperty","formData","nextTick","value","onMounted","extend"],"mappings":";;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,SAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA6DD,IAAA,MAAM,OAAYC,YAAS,CAAA;AAAA,MACzB,GAAK,EAAA,CAAA;AAAA,MACL,WAAW,EAAC;AAAA,MACZ,YAAY,EAAC;AAAA,MACb,MAAM,EAAC;AAAA,MACP,MAAMC,WAAQ,CAAA,KAAA,CAAM,gBAAiB,CAAA,IAAA,CAAK,OAAO,CAAA;AAAA,MACjD,OAAS,EAAA,IAAA;AAAA,KACV,CAAA,CAAA;AAED,IAAA,MAAM,wBAAwBD,YA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;;;;;;;;;;;;;"}
@@ -22,7 +22,7 @@ const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode(
22
22
  -1
23
23
  /* HOISTED */
24
24
  );
25
- const _hoisted_7 = { style: { "width": "100%", "display": "flex", "justify-content": "space-between" } };
25
+ const _hoisted_7 = { style: { "display": "flex", "justify-content": "space-between", "width": "100%" } };
26
26
  const __default__ = vue.defineComponent({
27
27
  name: "HotAreaContent"
28
28
  });
@@ -1 +1 @@
1
- {"version":3,"file":"hot-area-content.vue2.js","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 <div style=\"width: 100%; display: flex; justify-content: space-between\">\n <dk-url-input\n v-model=\"hotData.views[key].url\"\n placeholder=\"填写跳转地址\"\n style=\"width: 100%; margin-right: 5px\"\n />\n <el-button type=\"danger\" plain @click=\"delView(key)\">\n <dk-icon icon=\"Delete\"></dk-icon>\n </el-button>\n </div>\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","ref","reactive","onMounted","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,gBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;;;;;;;;AAqFD,IAAM,MAAA,KAAA,GAAQC,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,OAAA,GAAUC,YAAS,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,EAAA;AAC9D,QAAQ,OAAA,CA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AAA,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
+ {"version":3,"file":"hot-area-content.vue2.js","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 <div style=\"display: flex; justify-content: space-between; width: 100%\">\n <dk-url-input\n v-model=\"hotData.views[key].url\"\n placeholder=\"填写跳转地址\"\n style=\"width: 100%; margin-right: 5px\"\n />\n <el-button type=\"danger\" plain @click=\"delView(key)\">\n <dk-icon icon=\"Delete\"></dk-icon>\n </el-button>\n </div>\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","ref","reactive","onMounted","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,gBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;;;;;;;;AAqFD,IAAM,MAAA,KAAA,GAAQC,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,OAAA,GAAUC,YAAS,CAAA,KAAA,CAAM,YAAY,CAAA,CAAA;AAC3C,IAAA,MAAM,UAAU,MA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AA,CAAA;AAAA,SAC3B,CAAA;AACA,QAAA,KAAA,CAAM,GAAM,GAAA,GAAA,CAAA;AAAA,OACb,CAAA,CAAA;AAAA,KACH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -28,7 +28,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
28
28
  key: 0,
29
29
  border: false,
30
30
  "column-num": $props.columnNum,
31
- class: "min-h-30px dk-app-gold-grid"
31
+ class: "min-h-30px dk-app-gold-grid",
32
+ style: {"--van-grid-item-content-background":"none"}
32
33
  }, {
33
34
  default: vue.withCtx(() => [
34
35
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.list, (item, key) => {
@@ -1 +1 @@
1
- {"version":3,"file":"DkMinGrid.vue.js","sources":["../../../../../src/page-diy/src/views/min/DkMinGrid.vue"],"sourcesContent":["<template>\n <van-grid v-if=\"list?.length > 0\" :border=\"false\" :column-num=\"columnNum\" class=\"min-h-30px dk-app-gold-grid\">\n <van-grid-item v-for=\"(item, key) in list\" :key=\"key\">\n <img v-if=\"item.image\" :src=\"item.image\" alt=\"\" :style=\"imageStyle\" />\n <div\n v-else\n class=\"flex justify-center items-center\"\n style=\"display: flex; background: #f3f5f7\"\n :style=\"imageStyle\"\n >\n <dk-icon icon=\"PictureFilled\" color=\"#BBBFC8\"></dk-icon>\n </div>\n <span :style=\"{ ...fontStyle }\">{{ item.title }}</span>\n </van-grid-item>\n </van-grid>\n <el-empty v-else></el-empty>\n</template>\n<script>\nexport default {\n name: 'DkMinGrid',\n props: ['list', 'columnNum', 'imageStyle', 'useImageStyle', 'fontStyle'],\n data: () => {\n return {\n value: '',\n }\n },\n}\n</script>\n"],"names":["_createBlock","_openBlock","_create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AAA;AAA/C,wBAAA,IAAI,EAAC,eAAe;AAAC,wBAAA,KAAK,EAAC,SAAS;;;gBAE/CC,sBAAuD,CAAA,MAAA,EAAA;AAAhD,kBAAA,KAAK,0BAAO,MAAS,CAAA,SAAA,EAAA,CAAA;AAAO,iBAAA,EAAAC,mBAAA,CAAA,IAAI,CAAC,KAAK,CAAA,EAAA,CAAA,mBAAA;;;;;;;;wBAGjDR,eAA4B,CAAA,mBAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"DkMinGrid.vue.js","sources":["../../../../../src/page-diy/src/views/min/DkMinGrid.vue"],"sourcesContent":["<template>\n <van-grid\n v-if=\"list?.length > 0\"\n :border=\"false\"\n :column-num=\"columnNum\"\n class=\"min-h-30px dk-app-gold-grid\"\n style=\"--van-grid-item-content-background: none\"\n >\n <van-grid-item v-for=\"(item, key) in list\" :key=\"key\">\n <img v-if=\"item.image\" :src=\"item.image\" alt=\"\" :style=\"imageStyle\" />\n <div\n v-else\n class=\"flex justify-center items-center\"\n style=\"display: flex; background: #f3f5f7\"\n :style=\"imageStyle\"\n >\n <dk-icon icon=\"PictureFilled\" color=\"#BBBFC8\"></dk-icon>\n </div>\n <span :style=\"{ ...fontStyle }\">{{ item.title }}</span>\n </van-grid-item>\n </van-grid>\n <el-empty v-else></el-empty>\n</template>\n<script>\nexport default {\n name: 'DkMinGrid',\n props: ['list', 'columnNum', 'imageStyle', 'useImageStyle', 'fontStyle'],\n data: () => {\n return {\n value: '',\n }\n },\n}\n</script>\n"],"names":["_createBlock","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeStyle","_createVNode","_createElementVNode","_toDisplayString"],"mappings":";;;;;;;AAwBA,MAAK,SAAU,GAAA;AACb,EAAA,IAAI,EAAE,WAAW;AACjB,EAAA,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,CAAC;AACxE,EAAA,IAAI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EAAAC,mBAAA,CAAA,IAAI,CAAC,KAAK,CAAA,EAAA,CAAA,mBAAA;;;;;;;;wBAGjDR,eAA4B,CAAA,mBAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;;;;;"}
@@ -2,38 +2,37 @@
2
2
  .dk-url-input {
3
3
  }
4
4
 
5
- .dk-url-input-content{
5
+ .dk-url-input-content {
6
+ .url-list {
7
+ display: -webkit-box;
8
+ display: -ms-flexbox;
9
+ display: flex;
10
+ flex-wrap: wrap;
6
11
 
7
- .url-list {
8
- display: -webkit-box;
9
- display: -ms-flexbox;
10
- display: flex;
11
- flex-wrap: wrap;
12
+ .url-box {
13
+ padding: 7px 30px;
14
+ margin-right: 10px;
15
+ margin-bottom: 10px;
16
+ font-size: 13px;
17
+ font-weight: 400;
18
+ color: rgb(0 0 0 / 85%);
19
+ text-align: center;
20
+ cursor: pointer;
21
+ user-select: none;
22
+ background: #fafafa;
23
+ border-radius: 3px;
12
24
 
13
- .url-box {
14
- padding: 7px 30px;
15
- margin-right: 10px;
16
- margin-bottom: 10px;
17
- font-size: 13px;
18
- font-weight: 400;
19
- color: rgb(0 0 0 / 85%);
20
- text-align: center;
21
- cursor: pointer;
22
- user-select: none;
23
- background: #fafafa;
24
- border-radius: 3px;
25
+ &:hover {
26
+ color: #333;
27
+ background-color: var(--el-color-primary-light-9);
28
+ }
25
29
 
26
- &:hover {
27
- color: #333;
28
- background-color: var(--el-color-primary-light-9);
29
- }
30
-
31
- &.choose {
32
- color: #fff;
33
- background-color: var(--el-color-primary);
30
+ &.choose {
31
+ color: #fff;
32
+ background-color: var(--el-color-primary);
33
+ }
34
34
  }
35
35
  }
36
36
  }
37
- }
38
37
 
39
38
  /* stylelint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vipl520/dk-ui",
3
- "version": "1.0.54",
3
+ "version": "1.0.55",
4
4
  "description": "多客怪兽框架核心组件,支持diy、crud动态表格、上传组件等",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.mjs",