liyu-pc-base 1.0.396 → 1.0.398

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/components/FormRender/GeneralFilter/AddConditionModal/index.vue","../../src/components/FormRender/GeneralFilter/AddConditionModal/index.vue","../../src/components/FormRender/GeneralFilter/AddConditionGroupModal/index.vue","../../src/components/FormRender/GeneralFilter/AddConditionGroupModal/index.vue","../../src/components/FormRender/GeneralFilter/data.ts","../../src/components/FormRender/GeneralFilter/index.vue","../../src/components/FormRender/GeneralFilter/index.vue","../../src/components/FormRender/FormRender.vue","../../src/components/FormRender/FormRender.vue","../../src/components/FormRender/FormRender2.vue","../../src/components/FormRender/FormRender2.vue","../../src/constants.ts","../../src/components/SideSearchRender/viewManage.vue","../../src/components/SideSearchRender/viewManage.vue","../../src/components/SideSearchRender/SideSearchRender.vue","../../src/components/SideSearchRender/SideSearchRender.vue","../../src/components/fullLayout/fullLayoutUtils.ts","../../src/components/fullLayout/fullLayout.vue","../../src/components/fullLayout/fullLayout.vue","../../src/components/grid-layout/helpers/dom.ts","../../src/components/grid-layout/helpers/utils.ts","../../src/components/grid-layout/helpers/responsive-utils.ts","../../src/components/grid-layout/helpers/draggable-utils.ts","../../src/components/grid-layout/components/grid-item.vue","../../src/components/grid-layout/components/grid-item.vue","../../src/components/grid-layout/components/grid-layout.vue","../../src/components/grid-layout/components/grid-layout.vue","../../src/components/gridPage/gridView.vue","../../src/components/gridPage/gridView.vue","../../src/components/gridPage/index.ts","../../src/components/gridPage/gridPage.vue","../../src/components/gridPage/gridPage.vue"],"sourcesContent":["<template>\n <a-modal\n title=\"添加过滤条件\"\n width=\"800px\"\n :open=\"open\"\n transitionName=\"\"\n maskTransitionName=\"\"\n :destroyOnClose=\"true\"\n :confirmLoading=\"loading\"\n centered\n @ok=\"handleSubmit\"\n @cancel=\"\n () => {\n $emit('cancel');\n }\n \"\n >\n <a-tabs v-model:activeKey=\"activeKey\">\n <a-tab-pane\n class=\"my-card\"\n v-for=\"item in tab_list\"\n :key=\"item.key\"\n :tab=\"item.tab_name\"\n >\n <div\n v-for=\"base_search_item in item.base_search_list\"\n :key=\"base_search_item.name\"\n >\n <div style=\"font-size: 14px\">{{ base_search_item.name }}</div>\n <a-space\n wrap\n style=\"padding-left: 10px; margin-bottom: 0\"\n >\n <div\n v-for=\"obj in base_search_item.group\"\n :key=\"obj.field_name\"\n >\n <a-checkbox v-model:checked=\"obj.checked\">\n <span style=\"color: #7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n </a-tabs>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, reactive, ref } from 'vue';\n\nexport default defineComponent({\n name: 'AddConditionModal',\n props: {\n open: {\n type: Boolean,\n required: true,\n },\n loading: {\n type: Boolean,\n required: false,\n },\n default_search_condition_config_list: {\n type: Array,\n required: false,\n },\n base_search_condition_config_list: {\n type: Array,\n required: false,\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const activeKey = ref('condition_tab_0');\n const tab_list = ref([]);\n props.default_search_condition_config_list.forEach((item_list: any, index: number) => {\n const base_search_list: any = JSON.parse(\n JSON.stringify(props.base_search_condition_config_list),\n );\n if (base_search_list) {\n base_search_list.forEach((base_search_list: any) => {\n base_search_list.group.forEach(i => {\n item_list.forEach((k: any) => {\n if (i.field_name == k.field_name) {\n i.operator = k.operator;\n i.checked = true;\n }\n });\n });\n });\n }\n tab_list.value.push({\n tab_name: `条件组${index + 1}`,\n key: `condition_tab_${index}`,\n base_search_list: base_search_list,\n });\n });\n const handleSubmit = (e: Event) => {\n e.preventDefault();\n const list = [];\n tab_list.value.forEach(item => {\n const selected_group_list: any = [];\n item.base_search_list.forEach(i => {\n i.group.forEach((temp: any) => {\n if (temp.checked) {\n if (!temp.operator) {\n const operator_list_selected = get_operator_list_selected(temp);\n if (operator_list_selected.length > 0) {\n const [first] = operator_list_selected;\n temp.operator = first;\n }\n }\n selected_group_list.push(temp);\n }\n });\n });\n list.push(selected_group_list);\n });\n emit('ok', { new_list: list });\n };\n const get_operator_list_selected = (condition) => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n }\n else if (condition.operator_list) {\n return condition.operator_list;\n }\n else {\n return [];\n }\n };\n\n return {\n props,\n activeKey,\n tab_list,\n handleSubmit,\n };\n },\n});\n</script>\n<style scoped>\n.my-card {\n padding: 20px;\n background-color: #f6f7f9;\n}\n</style>\n","<template>\n <a-modal\n title=\"添加过滤条件\"\n width=\"800px\"\n :open=\"open\"\n transitionName=\"\"\n maskTransitionName=\"\"\n :destroyOnClose=\"true\"\n :confirmLoading=\"loading\"\n centered\n @ok=\"handleSubmit\"\n @cancel=\"\n () => {\n $emit('cancel');\n }\n \"\n >\n <a-tabs v-model:activeKey=\"activeKey\">\n <a-tab-pane\n class=\"my-card\"\n v-for=\"item in tab_list\"\n :key=\"item.key\"\n :tab=\"item.tab_name\"\n >\n <div\n v-for=\"base_search_item in item.base_search_list\"\n :key=\"base_search_item.name\"\n >\n <div style=\"font-size: 14px\">{{ base_search_item.name }}</div>\n <a-space\n wrap\n style=\"padding-left: 10px; margin-bottom: 0\"\n >\n <div\n v-for=\"obj in base_search_item.group\"\n :key=\"obj.field_name\"\n >\n <a-checkbox v-model:checked=\"obj.checked\">\n <span style=\"color: #7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n </a-tabs>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, reactive, ref } from 'vue';\n\nexport default defineComponent({\n name: 'AddConditionModal',\n props: {\n open: {\n type: Boolean,\n required: true,\n },\n loading: {\n type: Boolean,\n required: false,\n },\n default_search_condition_config_list: {\n type: Array,\n required: false,\n },\n base_search_condition_config_list: {\n type: Array,\n required: false,\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const activeKey = ref('condition_tab_0');\n const tab_list = ref([]);\n props.default_search_condition_config_list.forEach((item_list: any, index: number) => {\n const base_search_list: any = JSON.parse(\n JSON.stringify(props.base_search_condition_config_list),\n );\n if (base_search_list) {\n base_search_list.forEach((base_search_list: any) => {\n base_search_list.group.forEach(i => {\n item_list.forEach((k: any) => {\n if (i.field_name == k.field_name) {\n i.operator = k.operator;\n i.checked = true;\n }\n });\n });\n });\n }\n tab_list.value.push({\n tab_name: `条件组${index + 1}`,\n key: `condition_tab_${index}`,\n base_search_list: base_search_list,\n });\n });\n const handleSubmit = (e: Event) => {\n e.preventDefault();\n const list = [];\n tab_list.value.forEach(item => {\n const selected_group_list: any = [];\n item.base_search_list.forEach(i => {\n i.group.forEach((temp: any) => {\n if (temp.checked) {\n if (!temp.operator) {\n const operator_list_selected = get_operator_list_selected(temp);\n if (operator_list_selected.length > 0) {\n const [first] = operator_list_selected;\n temp.operator = first;\n }\n }\n selected_group_list.push(temp);\n }\n });\n });\n list.push(selected_group_list);\n });\n emit('ok', { new_list: list });\n };\n const get_operator_list_selected = (condition) => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n }\n else if (condition.operator_list) {\n return condition.operator_list;\n }\n else {\n return [];\n }\n };\n\n return {\n props,\n activeKey,\n tab_list,\n handleSubmit,\n };\n },\n});\n</script>\n<style scoped>\n.my-card {\n padding: 20px;\n background-color: #f6f7f9;\n}\n</style>\n","<template>\n <a-modal\n title=\"添加过滤条件组\"\n width=\"800px\"\n :open=\"open\"\n transitionName=\"\"\n maskTransitionName=\"\"\n :destroyOnClose=\"true\"\n :confirmLoading=\"loading\"\n centered\n @ok=\"handleSubmit\"\n @cancel=\"\n () => {\n $emit('cancel');\n }\n \"\n >\n\n <a-tab-pane class=\"my-card\" v-for=\"item in tab_list\"\n :key=\"item.key\" :tab=\"item.tab_name\">\n <div v-for=\"base_search_item in item.base_search_list\" :key=\"base_search_item.name\">\n <div style=\"font-size: 14px;\">{{base_search_item.name}}</div>\n <a-space wrap>\n <div v-for=\"obj in base_search_item.group\" :key=\"obj.field_name\">\n <a-checkbox v-model:checked=\"obj.checked\" >\n <span style=\"color:#7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n\n <a-tabs v-model:activeKey=\"activeKey\">\n <a-tab-pane class=\"my-card\" v-for=\"item in tab_list\"\n :key=\"item.key\" :tab=\"item.tab_name\">\n <div v-for=\"base_search_item in item.base_search_list\" :key=\"base_search_item.name\">\n <div style=\"font-size: 14px;\">{{base_search_item.name}}</div>\n <a-space wrap style=\"padding-left: 10px; margin-bottom:0\">\n <div v-for=\"obj in base_search_item.group\" :key=\"obj.field_name\">\n <a-checkbox v-model:checked=\"obj.checked\" >\n <span style=\"color:#7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n </a-tabs>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, reactive, ref } from 'vue';\nimport { message } from 'ant-design-vue';\nexport default defineComponent({\n name: 'AddConditionGroupModal',\n props: {\n open: {\n type: Boolean,\n required: true,\n },\n loading: {\n type: Boolean,\n required: false,\n },\n default_search_condition_config_list: {\n type: Array,\n required: false,\n },\n base_search_condition_config_list: {\n type: Array,\n required: false,\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const tab_list = ref([]);\n const get_operator_list_selected = (condition) => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n }\n else if (condition.operator_list) {\n return condition.operator_list;\n }\n else {\n return [];\n }\n };\n props.default_search_condition_config_list?.forEach((item_list:any, index:number)=>{\n const base_search_list:any = JSON.parse(JSON.stringify(props.base_search_condition_config_list));\n if(base_search_list){\n base_search_list.forEach((base_search_list:any)=>{\n base_search_list.group.forEach(i=>{\n item_list.forEach((k:any)=>{\n if(i.field_name == k.field_name){\n i.checked = true;\n }\n });\n });\n });\n }\n tab_list.value.push({\n tab_name:`条件组${index+1}`,\n key:`condition_tab_${index}`,\n base_search_list: base_search_list,\n });\n });\n const index = props.default_search_condition_config_list?.length || 0;\n const new_search_list = [];\n props.base_search_condition_config_list.forEach((item:any)=>{\n const new_group = [];\n item.group.forEach(i=>{\n const operator_list_selected = get_operator_list_selected(i);\n if(i.default_operator){\n i.operator = i.default_operator;\n }\n if(!operator_list_selected.includes(i.operator)){\n i.operator = null;\n }\n if(!i.operator && operator_list_selected.length>0){\n const [first] = operator_list_selected;\n i.operator = first;\n }\n const new_i = { ...i, checked:false };\n new_group.push(new_i);\n });\n new_search_list.push({\n name:item.name,\n group:new_group,\n });\n });\n tab_list.value.push({\n tab_name:`条件组${index+1}`,\n key:`condition_tab_${index}`,\n base_search_list: new_search_list,\n });\n const activeKey = ref(`condition_tab_${index}`);\n\n const handleSubmit = (e: Event) => {\n e.preventDefault();\n const list = [];\n tab_list.value.forEach(item=>{\n const selected_group_list:any = [];\n item.base_search_list.forEach(i=>{\n i.group.forEach((temp:any)=>{\n if(temp.checked){\n selected_group_list.push(temp);\n }\n });\n });\n if(selected_group_list.length>0){\n list.push(selected_group_list);\n }\n });\n if(list.length==0){\n message.error('新增条件组未增加新的字段,自动取消');\n emit('cancel');//关闭对话框\n }else{\n emit('ok', { new_list: list });\n }\n };\n\n return {\n props,\n activeKey,\n tab_list,\n handleSubmit,\n get_operator_list_selected,\n };\n },\n});\n</script>\n<style scoped>\n.my-card{\n padding:20px;\n background-color: #f6f7f9;\n}\n</style>","<template>\n <a-modal\n title=\"添加过滤条件组\"\n width=\"800px\"\n :open=\"open\"\n transitionName=\"\"\n maskTransitionName=\"\"\n :destroyOnClose=\"true\"\n :confirmLoading=\"loading\"\n centered\n @ok=\"handleSubmit\"\n @cancel=\"\n () => {\n $emit('cancel');\n }\n \"\n >\n\n <a-tab-pane class=\"my-card\" v-for=\"item in tab_list\"\n :key=\"item.key\" :tab=\"item.tab_name\">\n <div v-for=\"base_search_item in item.base_search_list\" :key=\"base_search_item.name\">\n <div style=\"font-size: 14px;\">{{base_search_item.name}}</div>\n <a-space wrap>\n <div v-for=\"obj in base_search_item.group\" :key=\"obj.field_name\">\n <a-checkbox v-model:checked=\"obj.checked\" >\n <span style=\"color:#7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n\n <a-tabs v-model:activeKey=\"activeKey\">\n <a-tab-pane class=\"my-card\" v-for=\"item in tab_list\"\n :key=\"item.key\" :tab=\"item.tab_name\">\n <div v-for=\"base_search_item in item.base_search_list\" :key=\"base_search_item.name\">\n <div style=\"font-size: 14px;\">{{base_search_item.name}}</div>\n <a-space wrap style=\"padding-left: 10px; margin-bottom:0\">\n <div v-for=\"obj in base_search_item.group\" :key=\"obj.field_name\">\n <a-checkbox v-model:checked=\"obj.checked\" >\n <span style=\"color:#7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n </a-tabs>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, reactive, ref } from 'vue';\nimport { message } from 'ant-design-vue';\nexport default defineComponent({\n name: 'AddConditionGroupModal',\n props: {\n open: {\n type: Boolean,\n required: true,\n },\n loading: {\n type: Boolean,\n required: false,\n },\n default_search_condition_config_list: {\n type: Array,\n required: false,\n },\n base_search_condition_config_list: {\n type: Array,\n required: false,\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const tab_list = ref([]);\n const get_operator_list_selected = (condition) => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n }\n else if (condition.operator_list) {\n return condition.operator_list;\n }\n else {\n return [];\n }\n };\n props.default_search_condition_config_list?.forEach((item_list:any, index:number)=>{\n const base_search_list:any = JSON.parse(JSON.stringify(props.base_search_condition_config_list));\n if(base_search_list){\n base_search_list.forEach((base_search_list:any)=>{\n base_search_list.group.forEach(i=>{\n item_list.forEach((k:any)=>{\n if(i.field_name == k.field_name){\n i.checked = true;\n }\n });\n });\n });\n }\n tab_list.value.push({\n tab_name:`条件组${index+1}`,\n key:`condition_tab_${index}`,\n base_search_list: base_search_list,\n });\n });\n const index = props.default_search_condition_config_list?.length || 0;\n const new_search_list = [];\n props.base_search_condition_config_list.forEach((item:any)=>{\n const new_group = [];\n item.group.forEach(i=>{\n const operator_list_selected = get_operator_list_selected(i);\n if(i.default_operator){\n i.operator = i.default_operator;\n }\n if(!operator_list_selected.includes(i.operator)){\n i.operator = null;\n }\n if(!i.operator && operator_list_selected.length>0){\n const [first] = operator_list_selected;\n i.operator = first;\n }\n const new_i = { ...i, checked:false };\n new_group.push(new_i);\n });\n new_search_list.push({\n name:item.name,\n group:new_group,\n });\n });\n tab_list.value.push({\n tab_name:`条件组${index+1}`,\n key:`condition_tab_${index}`,\n base_search_list: new_search_list,\n });\n const activeKey = ref(`condition_tab_${index}`);\n\n const handleSubmit = (e: Event) => {\n e.preventDefault();\n const list = [];\n tab_list.value.forEach(item=>{\n const selected_group_list:any = [];\n item.base_search_list.forEach(i=>{\n i.group.forEach((temp:any)=>{\n if(temp.checked){\n selected_group_list.push(temp);\n }\n });\n });\n if(selected_group_list.length>0){\n list.push(selected_group_list);\n }\n });\n if(list.length==0){\n message.error('新增条件组未增加新的字段,自动取消');\n emit('cancel');//关闭对话框\n }else{\n emit('ok', { new_list: list });\n }\n };\n\n return {\n props,\n activeKey,\n tab_list,\n handleSubmit,\n get_operator_list_selected,\n };\n },\n});\n</script>\n<style scoped>\n.my-card{\n padding:20px;\n background-color: #f6f7f9;\n}\n</style>","export const get_options_eq = t => {\n const options_eq = [\n { value: '上月', label: '上月' },\n { value: '本月', label: '本月' },\n { value: '今日', label: '今日' },\n { value: '昨日', label: '昨日' },\n { value: '期初', label: '期初' },\n ];\n return {\n options_eq,\n };\n};\n","<template>\n <a-space v-if=\"!is_massage_default\">\n <a-button\n type=\"link\"\n v-if=\"is_show_normal_search\"\n @click=\"handleShowSearchRender\"\n >\n {{ $t('普通') }}\n </a-button>\n <a-button\n v-if=\"!isShowForm\"\n type=\"link\"\n @click=\"\n () => {\n isShowForm = true;\n $emit('resize');\n }\n \"\n >\n <span class=\"expand-btn\">{{ $t('展开') }}</span>\n </a-button>\n <a-button\n v-else\n type=\"link\"\n @click=\"\n () => {\n isShowForm = false;\n $emit('resize');\n }\n \"\n >\n {{ $t('隐藏') }}\n </a-button>\n </a-space>\n <span v-show=\"!isShowForm\">\n <span\n v-for=\"(item, index) in default_search_condition_config_list\"\n :key=\"index\"\n >\n <a-tag>{{ $t('条件组') }}{{ index + 1 }}:</a-tag>\n <span\n v-for=\"condition in item\"\n :key=\"condition.field_name\"\n >\n <a-tag\n v-show=\"isShowSearchTag(index, condition)\"\n color=\"green\"\n >\n {{ condition.label }}: {{ transferValueFunc(index, condition) }}\n <close-outlined\n style=\"cursor: pointer; margin-left: 5px\"\n @click=\"handleDelSearch(index, condition.field_name)\"\n />\n </a-tag>\n </span>\n </span>\n </span>\n <div\n v-if=\"delayShow || isShowForm\"\n class=\"card\"\n v-show=\"isShowForm\"\n >\n <div\n v-for=\"(group_item, group_index) in default_search_condition_config_list\"\n :key=\"group_index\"\n >\n <div\n class=\"condition-group\"\n v-if=\"default_search_condition_config_list.length > 1\"\n >\n {{ $t('条件组') }} {{ group_index + 1 }}\n </div>\n <a-space\n :wrap=\"true\"\n align=\"center\"\n :size=\"0\"\n >\n <a-space-compact\n block\n v-for=\"(condition, k) in group_item\"\n :key=\"condition.field_name\"\n size=\"middle\"\n @mouseenter=\"handleMouseEnter(group_index, condition)\"\n @mouseleave=\"handleMouseLeave(group_index, condition)\"\n >\n <a-input-group compact>\n <a-tooltip :title=\"condition.label\">\n <a-cascader\n :value=\"condition.label\"\n style=\"width: 125px\"\n :options=\"searchItemOptionsDict[group_index]\"\n showSearch\n :allowClear=\"false\"\n :placeholder=\"$t('请选择...')\"\n @change=\"value => onChangeSearchItem(value, group_index, condition, k)\"\n />\n </a-tooltip>\n <a-tooltip :title=\"get_operator_type_map(condition.format, condition.operator)\">\n <a-select\n v-if=\"get_operator_list_selected(condition).length > 0\"\n :dropdownMatchSelectWidth=\"false\"\n v-model:value=\"condition.operator\"\n @change=\"value => onChangeOperator(value, group_index, condition)\"\n style=\"width: 100px\"\n >\n <a-select-option\n v-for=\"item in get_operator_list_selected(condition)\"\n :value=\"item\"\n :key=\"item\"\n >\n {{ get_operator_type_map(condition.format, item) }}\n </a-select-option>\n </a-select>\n </a-tooltip>\n <span\n style=\"width: 315px; height: 40px\"\n v-if=\"condition_model_dict && condition_model_dict[group_index]\"\n >\n <template\n v-if=\"['is_or_not_blank_or_null', 'is_or_not_null'].includes(condition.operator)\"\n >\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'select',\n mode: 'default',\n format: 'choices',\n class_name: 'str',\n placeholder: '',\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"is_or_not_blank_or_null_options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"['input'].includes(condition.format)\">\n <template\n v-if=\"condition.operator === 'between' || condition.operator === 'notbetween'\"\n >\n <template v-if=\"condition.type === 'datepicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, type: 'rangepicker', format: condition.dateFormat }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.type === 'monthpicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'monthrangepicker',\n format: condition.dateFormat,\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.type === 'timepicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'timerangepicker',\n format: condition.dateFormat,\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else>\n <a-flex>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name][0]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n <div class=\"range\">~</div>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name][1]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </a-flex>\n </template>\n </template>\n <template v-else-if=\"condition.operator === '_eq'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'select',\n mode: 'default',\n format: 'choices',\n class_name: 'str',\n placeholder: '',\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"options_eq\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template\n v-else-if=\"\n condition.type === 'datepicker' ||\n condition.type === 'monthpicker' ||\n condition.type === 'timepicker'\n \"\n >\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, format: condition.dateFormat }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n </template>\n <template v-else-if=\"['choices', 'remote'].includes(condition.format)\">\n <template v-if=\"condition.format === 'choices'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.format === 'remote'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, name: condition?.field_name }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n </template>\n </span>\n <span\n class=\"close-icon\"\n v-if=\"deleteBtnDict && deleteBtnDict[group_index]\"\n >\n <a-tooltip\n title=\"删除此条件\"\n v-if=\"\n deleteBtnDict[group_index][condition.field_name] &&\n (default_search_condition_config_list[0].length > 1 ||\n default_search_condition_config_list.length > 1) &&\n !is_massage_default\n \"\n >\n <close-circle-outlined @click=\"handleDeleteFormItem(group_index, condition)\" />\n </a-tooltip>\n </span>\n </a-input-group>\n </a-space-compact>\n </a-space>\n <a-divider\n class=\"divider\"\n style=\"margin: 0\"\n v-if=\"\n default_search_condition_config_list.length > 1 &&\n group_index != default_search_condition_config_list.length - 1\n \"\n >\n 或\n </a-divider>\n </div>\n </div>\n <div\n class=\"search-bar\"\n v-if=\"isShowForm && !is_massage_default\"\n >\n <a-space>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleAddConditions\"\n >\n {{ $t('添加条件') }}\n </a-button>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleAddGroupCondition\"\n >\n {{ $t('添加条件组') }}\n </a-button>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleSearch\"\n >\n {{ $t('查询') }}\n </a-button>\n </a-space>\n </div>\n\n <add-condition-modal\n v-if=\"addConditionModal.open\"\n :open=\"addConditionModal.open\"\n :default_search_condition_config_list=\"default_search_condition_config_list\"\n :base_search_condition_config_list=\"base_search_condition_config_list\"\n @ok=\"handleAddConditionOk\"\n @cancel=\"handleAddConditionCancel\"\n />\n\n <add-condition-group-modal\n v-if=\"addConditionGroupModal.open\"\n :open=\"addConditionGroupModal.open\"\n :default_search_condition_config_list=\"default_search_condition_config_list\"\n :base_search_condition_config_list=\"base_search_condition_config_list\"\n @ok=\"handleAddGroupConditionOK\"\n @cancel=\"handleAddGroupConditionCancel\"\n />\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n onMounted,\n reactive,\n ref,\n computed,\n watch,\n PropType,\n nextTick,\n onUnmounted,\n} from 'vue';\nimport FieldRender from 'liyu-pc-base/components/FormRender/FieldRender.vue';\nimport AddConditionModal from 'liyu-pc-base/components/FormRender/GeneralFilter/AddConditionModal/index.vue';\nimport AddConditionGroupModal from 'liyu-pc-base/components/FormRender/GeneralFilter/AddConditionGroupModal/index.vue';\nimport { isNotEmpty } from 'liyu-pc-base/utils/function';\nimport {\n CloseCircleOutlined,\n CloseOutlined,\n LeftOutlined,\n RightOutlined,\n} from '@ant-design/icons-vue';\nimport { useI18n } from 'vue-i18n';\nimport { get_options_eq } from 'liyu-pc-base/components/FormRender/GeneralFilter/data';\nimport moment from 'moment';\nimport FieldRender2 from 'liyu-pc-base/components/FormRender/FieldRender2.vue';\nimport { get_operator_type_map } from 'liyu-pc-base/utils/function';\n\nexport default defineComponent({\n name: 'GeneralFilter',\n props: {\n base_search_condition_config_list: {\n type: Array as PropType<any[]>,\n },\n default_search_condition_config_list: {\n type: Array as PropType<any[]>,\n },\n is_show_normal_search: {\n type: Boolean,\n default: () => false,\n },\n is_clear_model: {\n type: Boolean,\n default: () => false,\n },\n is_show_advantage: {\n type: Boolean,\n default: () => false,\n },\n is_massage_default: {\n type: Boolean,\n default: () => false,\n },\n eventBus: {\n type: Object,\n required: false,\n },\n delayShow: {\n type: Boolean,\n default: () => true,\n },\n },\n components: {\n FieldRender2,\n CloseOutlined,\n LeftOutlined,\n RightOutlined,\n FieldRender,\n AddConditionGroupModal,\n AddConditionModal,\n CloseCircleOutlined,\n },\n emits: [\n 'search',\n 'resize',\n 'update_default_search_condition_config_list',\n 'onShowSearchRender',\n 'delSearch',\n 'onChangeValue',\n 'update:is_clear_model',\n ],\n setup(props, { emit }) {\n const isShowForm = ref(props.is_massage_default);\n const labelModel = ref({});\n const { t } = useI18n();\n const { options_eq } = get_options_eq(t);\n //条件组-->\n const condition_model_dict = ref([]);\n const validateInfos = {};\n const source_default_search_condition_config_list = ref(null);\n const is_or_not_blank_or_null_options = ref([\n { value: 'yes', label: t('is_or_not_blank_or_null.yes') },\n { value: 'no', label: t('is_or_not_blank_or_null.no') },\n ]);\n if (!source_default_search_condition_config_list.value) {\n source_default_search_condition_config_list.value = JSON.parse(\n JSON.stringify(props.default_search_condition_config_list),\n );\n }\n\n const operator_type_count_map = {\n between: 2,\n gt: 1,\n lt: 1,\n gte: 1,\n lte: 1,\n in: 0,\n eq: 1,\n _eq: 1,\n contains: 1,\n icontains: 1,\n startswith: 1,\n istartswith: 1,\n endswith: 1,\n iendswith: 1,\n notbetween: 2,\n notin: 0,\n notcontains: 1,\n noticontains: 1,\n notstartswith: 1,\n notistartswith: 1,\n notendswith: 1,\n notiendswith: 1,\n not_eq: 1,\n not_blank_not_null: 1,\n json_list_not_blank_not_null: 1,\n json_list_is_blank_is_null: 1,\n is_or_not_blank_or_null: 1,\n is_or_not_null: 1,\n };\n const is2DArray = arr => {\n const [first] = [arr];\n return Array.isArray(first) && arr.every(subArray => Array.isArray(subArray));\n };\n let old_operator = null;\n const onChangeOperator = (operator, index, condition) => {\n //不同操作类型,设置不同的默认值\n // if (condition_model_dict.value[index][condition.field_name]) {\n // return;\n // }\n const value = condition_model_dict.value[index][condition.field_name];\n if (get_operator_list_selected(condition).includes('_eq')) {\n if (operator == '_eq') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == '_eq') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (get_operator_list_selected(condition).includes('not_blank_not_null')) {\n if (operator == 'not_blank_not_null') {\n condition_model_dict.value[index][condition.field_name] = '是';\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == 'not_blank_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (\n get_operator_list_selected(condition).includes('is_or_not_blank_or_null') ||\n get_operator_list_selected(condition).includes('is_or_not_null')\n ) {\n if (operator == 'is_or_not_blank_or_null' || operator == 'is_or_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == 'is_or_not_blank_or_null' || old_operator == 'is_or_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (value instanceof Array && is2DArray(value)) {\n // 级联类型,默认值默认清空\n condition_model_dict.value[index][condition.field_name] = null;\n } else if (operator_type_count_map[operator] == 1) {\n if (value instanceof Array) {\n const [first] = condition_model_dict.value[index][condition.field_name];\n if (isNotEmpty(first)) {\n condition_model_dict.value[index][condition.field_name] = first;\n } else {\n condition_model_dict.value[index][condition.field_name] = null;\n }\n } else {\n condition_model_dict.value[index][condition.field_name] = value ? value : null;\n }\n const is = options_eq.some(\n obj => obj.value === condition_model_dict.value[index][condition.field_name],\n );\n if (is) {\n condition_model_dict.value[index][condition.field_name] = null;\n }\n } else if (operator_type_count_map[operator] == 2) {\n if (condition_model_dict.value[index][condition.field_name] instanceof Array) {\n const [first, seconds] = condition_model_dict.value[index][condition.field_name];\n condition_model_dict.value[index][condition.field_name] = [first, seconds];\n } else if (condition_model_dict.value[index][condition.field_name]) {\n const first = condition_model_dict.value[index][condition.field_name];\n condition_model_dict.value[index][condition.field_name] = [first, null];\n } else {\n condition_model_dict.value[index][condition.field_name] = [null, null];\n }\n const is = options_eq.some(\n obj => obj.value === condition_model_dict.value[index][condition.field_name][0],\n );\n if (is) {\n condition_model_dict.value[index][condition.field_name] = [null, null];\n }\n }\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n // console.log('onChangeValue');\n };\n\n const addConditionModal = reactive({\n open: false,\n });\n const handleAddConditions = () => {\n addConditionModal.open = true;\n };\n const handleAddConditionOk = (data: any) => {\n props.default_search_condition_config_list.forEach((item: any, index: any) => {\n data.new_list.forEach((item1: any, index1: any) => {\n if (index == index1) {\n item.forEach((item2: any) => {\n item1.forEach((item3: any) => {\n if (item2.field_name == item3.field_name) {\n item3.value = item2.value;\n item3.operator = item2.operator;\n }\n });\n });\n }\n });\n });\n //保存后处理 new_list\n emit('update_default_search_condition_config_list', { new_list: data.new_list });\n // refreshCondition();\n addConditionModal.open = false;\n };\n const handleAddConditionCancel = () => {\n addConditionModal.open = false;\n };\n\n const addConditionGroupModal = reactive({\n open: false,\n });\n const handleAddGroupCondition = () => {\n addConditionGroupModal.open = true;\n };\n const handleAddGroupConditionOK = (data: any) => {\n props.default_search_condition_config_list.forEach((item: any, index: any) => {\n data.new_list.forEach((item1: any, index1: any) => {\n if (index == index1) {\n item.forEach((item2: any) => {\n item1.forEach((item3: any) => {\n if (item2.field_name == item3.field_name) {\n item3.value = item2.value;\n item3.operator = item2.operator;\n }\n });\n });\n }\n });\n });\n emit('update_default_search_condition_config_list', { new_list: data.new_list });\n // refreshCondition();\n addConditionGroupModal.open = false;\n };\n const handleAddGroupConditionCancel = () => {\n addConditionGroupModal.open = false;\n };\n const handleSearch = () => {\n isShowForm.value = false;\n console.log('condition_model_dict.value', condition_model_dict.value);\n emit('search', { model: condition_model_dict.value });\n };\n const refreshCondition = (update_all = false) => {\n if (props.base_search_condition_config_list.length == 0) {\n return;\n }\n props.default_search_condition_config_list?.forEach((item_list: any, index: number) => {\n deleteBtnDict[index] = {};\n if (!condition_model_dict.value[index]) {\n condition_model_dict.value[index] = {};\n }\n props.base_search_condition_config_list.forEach((i: any) => {\n i.group?.forEach((group_item: any) => {\n item_list.forEach((k: any) => {\n if (group_item.field_name == k.field_name) {\n const value = condition_model_dict.value[index][k.field_name];\n if (value == undefined || update_all) {\n if (operator_type_count_map[k.operator] == 1) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = null;\n }\n } else if (operator_type_count_map[k.operator] == 2) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = [null, null];\n }\n } else if (operator_type_count_map[k.operator] == 0) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = [];\n }\n }\n }\n Object.assign(k, { ...group_item, operator: k.operator }); // 保持表单项原有选择的查询条件\n if (k.operator == 'eq' && k.mode != 'default') {\n group_item.mode = 'default';\n Object.assign(k, { model: 'default' });\n } else if (['in', 'notin'].includes(k.operator) && k.mode != 'multiple') {\n group_item.mode = 'multiple';\n Object.assign(k, { model: 'multiple' });\n }\n }\n });\n });\n });\n });\n };\n const onFilterChanged = () => {\n refreshCondition(true);\n };\n\n const deleteBtnDict = reactive({}); // 表单项的删除按钮是否显示\n const handleMouseEnter = (index: any, form_item: any) => {\n deleteBtnDict[index][form_item.field_name] = true;\n };\n const handleMouseLeave = (index: any, form_item: any) => {\n deleteBtnDict[index][form_item.field_name] = false;\n };\n const handleDeleteFormItem = (index: any, condition: any) => {\n //default_search_condition_config_list 不允许删除最后一个条件组的条件项\n const new_list = [];\n props.default_search_condition_config_list.forEach((item_list: any, index_: number) => {\n if (index_ !== index) {\n new_list.push(item_list);\n } else {\n const list = [];\n item_list.forEach((k: any) => {\n if (k.field_name !== condition.field_name) {\n list.push(k);\n }\n });\n if (list.length > 0) {\n new_list.push(list);\n }\n }\n });\n emit('update_default_search_condition_config_list', { new_list: new_list });\n // refreshCondition();\n };\n const handleDelSearch = (index, filed_name) => {\n if (condition_model_dict.value[index][filed_name] instanceof Array) {\n condition_model_dict.value[index][filed_name].length = 0;\n } else {\n condition_model_dict.value[index][filed_name] = null;\n }\n emit('onChangeValue', { model: condition_model_dict.value });\n emit('delSearch', { model: JSON.parse(JSON.stringify(condition_model_dict.value)) });\n };\n\n const onChangeSearchItem = (value: any, group_index, condition: any, condition_index) => {\n if (value instanceof Array && value.length > 0) {\n const selected_field_name = value[value.length - 1];\n let new_condition = null;\n props.base_search_condition_config_list.forEach(item_list => {\n item_list.group.forEach(i => {\n if (i.field_name === selected_field_name) {\n new_condition = JSON.parse(JSON.stringify(i));\n if (new_condition.default_operator) {\n new_condition.operator = new_condition.default_operator;\n } else if (get_operator_list_selected(new_condition).length > 0) {\n const [first] = get_operator_list_selected(new_condition);\n new_condition.operator = first;\n }\n }\n });\n });\n\n if (new_condition) {\n const new_list = JSON.parse(JSON.stringify(props.default_search_condition_config_list));\n new_list.forEach((item_list, i) => {\n if (i === group_index) {\n item_list.forEach((item, k) => {\n if (item.field_name == condition.field_name && k == condition_index) {\n item_list.splice(k, 1, new_condition);\n delete condition_model_dict.value[group_index][item.field_name];\n }\n });\n }\n });\n emit('update_default_search_condition_config_list', {\n new_list: new_list,\n });\n }\n refreshCondition();\n }\n };\n\n const searchItemOptionsDict: any = computed(() => {\n const dict = {};\n props.default_search_condition_config_list.forEach((group_item, index) => {\n dict[index] = [];\n const filter_field_name_list = group_item.map(item => item.field_name);\n props.base_search_condition_config_list.forEach(item => {\n const filter_list = item.group.filter(\n i => !filter_field_name_list.includes(i.field_name),\n );\n const o = {\n value: item.name,\n label: item.name,\n children: filter_list.map(i => {\n return {\n value: i.field_name,\n label: i.label,\n };\n }),\n };\n dict[index].push(o);\n });\n });\n return dict;\n });\n\n const isShowSearchTag = (index, condition) => {\n const value = condition_model_dict.value[index]?.[condition.field_name];\n if (value instanceof Array) {\n const [first] = value;\n if (isNotEmpty(first)) {\n return true;\n }\n } else if (isNotEmpty(value)) {\n return true;\n }\n return false;\n };\n\n const transferValueFunc = (index, condition) => {\n const str_list: any = [];\n const value = condition_model_dict.value[index]?.[condition.field_name];\n if (\n condition.operator === 'is_or_not_blank_or_null' ||\n condition.operator === 'is_or_not_null'\n ) {\n if (value === 'yes') {\n return t('is_or_not_blank_or_null.yes');\n } else {\n return t('is_or_not_blank_or_null.no');\n }\n } else if (condition.operator === '_eq') {\n if (['上月', '本月', '今日', '昨日', '期初'].includes(value)) {\n return t(value);\n }\n } else if (labelModel.value[condition.field_name] != undefined) {\n return `${get_operator_type_map(condition.format, condition.operator)} ${\n labelModel.value[condition.field_name]\n }`;\n } else if (value instanceof Array && condition.field_name_list instanceof Array) {\n let transfer_value;\n if (condition.field_name_list) {\n if (value instanceof Array) {\n transfer_value = value.join(',');\n } else {\n transfer_value = value;\n }\n }\n return `${get_operator_type_map(condition.format, condition.operator)} ${transfer_value}`;\n } else if (value instanceof Array && condition.options instanceof Array) {\n value.forEach(item => {\n condition.options.forEach(i => {\n if (item == i.value) {\n str_list.push(i.label);\n }\n });\n });\n return `${get_operator_type_map(condition.format, condition.operator)} ${str_list.join(\n ',',\n )}`;\n } else {\n let transfer_value;\n if (condition.options) {\n condition.options.forEach(i => {\n if (value == i.value) {\n transfer_value = i.label;\n }\n });\n } else if (condition.type == 'monthpicker' && condition.dateFormat) {\n if (value instanceof Array) {\n const str_list = [];\n value.forEach(i => {\n if (i) {\n str_list.push(moment(i).format(condition.dateFormat));\n } else {\n str_list.push(i);\n }\n });\n transfer_value = str_list.join(',');\n } else {\n transfer_value = moment(value).format(condition.dateFormat);\n }\n } else {\n transfer_value = value;\n }\n return `${get_operator_type_map(condition.format, condition.operator)} ${transfer_value}`;\n }\n };\n\n const handleShowSearchRender = () => {\n emit('onShowSearchRender');\n };\n\n const get_operator_list_selected = condition => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n } else if (condition.operator_list) {\n return condition.operator_list;\n } else {\n return [];\n }\n };\n\n watch(\n () => condition_model_dict.value,\n () => {\n emit('onChangeValue', { model: condition_model_dict.value });\n // console.log('onChangeValue_watch');\n },\n { deep: true },\n );\n watch(\n () => props.default_search_condition_config_list,\n () => {\n if (props.default_search_condition_config_list?.length == 0) {\n emit('update_default_search_condition_config_list', {\n new_list: source_default_search_condition_config_list.value,\n });\n return;\n }\n refreshCondition();\n },\n { deep: true },\n );\n watch(\n () => props.base_search_condition_config_list,\n () => {\n refreshCondition();\n },\n { deep: true },\n );\n\n watch(\n () => props.is_clear_model,\n () => {\n if (props.is_clear_model) {\n condition_model_dict.value = {};\n refreshCondition();\n emit('update:is_clear_model', false);\n }\n },\n );\n onMounted(() => {\n refreshCondition();\n if (props.eventBus) {\n props.eventBus.on('filterChange', onFilterChanged);\n }\n });\n onUnmounted(() => {\n if (props.eventBus) {\n props.eventBus.off('filterChange', onFilterChanged);\n }\n });\n return {\n props,\n t,\n isShowForm,\n labelModel,\n get_operator_type_map,\n condition_model_dict,\n addConditionModal,\n handleAddConditions,\n handleAddConditionOk,\n handleAddConditionCancel,\n onChangeOperator,\n handleAddGroupCondition,\n handleSearch,\n\n addConditionGroupModal,\n handleAddGroupConditionOK,\n handleAddGroupConditionCancel,\n validateInfos,\n\n deleteBtnDict,\n handleMouseEnter,\n handleMouseLeave,\n handleDeleteFormItem,\n handleDelSearch,\n\n searchItemOptionsDict,\n onChangeSearchItem,\n transferValueFunc,\n isShowSearchTag,\n handleShowSearchRender,\n options_eq,\n get_operator_list_selected,\n is_or_not_blank_or_null_options,\n };\n },\n});\n</script>\n<style lang=\"less\" scoped>\n.card {\n overflow: auto;\n max-height: 300px;\n background: #f2f5f7;\n}\n\n.condition-group {\n padding: 5px;\n}\n\n.range {\n margin-top: 5px;\n}\n\n.close-icon {\n width: 15px;\n margin-top: 5px;\n margin-left: 5px;\n color: red;\n}\n\n.search-bar {\n background: #f2f5f7;\n text-align: right;\n}\n\n:deep(.divider .ant-divider) {\n margin: 0;\n}\n</style>\n","<template>\n <a-space v-if=\"!is_massage_default\">\n <a-button\n type=\"link\"\n v-if=\"is_show_normal_search\"\n @click=\"handleShowSearchRender\"\n >\n {{ $t('普通') }}\n </a-button>\n <a-button\n v-if=\"!isShowForm\"\n type=\"link\"\n @click=\"\n () => {\n isShowForm = true;\n $emit('resize');\n }\n \"\n >\n <span class=\"expand-btn\">{{ $t('展开') }}</span>\n </a-button>\n <a-button\n v-else\n type=\"link\"\n @click=\"\n () => {\n isShowForm = false;\n $emit('resize');\n }\n \"\n >\n {{ $t('隐藏') }}\n </a-button>\n </a-space>\n <span v-show=\"!isShowForm\">\n <span\n v-for=\"(item, index) in default_search_condition_config_list\"\n :key=\"index\"\n >\n <a-tag>{{ $t('条件组') }}{{ index + 1 }}:</a-tag>\n <span\n v-for=\"condition in item\"\n :key=\"condition.field_name\"\n >\n <a-tag\n v-show=\"isShowSearchTag(index, condition)\"\n color=\"green\"\n >\n {{ condition.label }}: {{ transferValueFunc(index, condition) }}\n <close-outlined\n style=\"cursor: pointer; margin-left: 5px\"\n @click=\"handleDelSearch(index, condition.field_name)\"\n />\n </a-tag>\n </span>\n </span>\n </span>\n <div\n v-if=\"delayShow || isShowForm\"\n class=\"card\"\n v-show=\"isShowForm\"\n >\n <div\n v-for=\"(group_item, group_index) in default_search_condition_config_list\"\n :key=\"group_index\"\n >\n <div\n class=\"condition-group\"\n v-if=\"default_search_condition_config_list.length > 1\"\n >\n {{ $t('条件组') }} {{ group_index + 1 }}\n </div>\n <a-space\n :wrap=\"true\"\n align=\"center\"\n :size=\"0\"\n >\n <a-space-compact\n block\n v-for=\"(condition, k) in group_item\"\n :key=\"condition.field_name\"\n size=\"middle\"\n @mouseenter=\"handleMouseEnter(group_index, condition)\"\n @mouseleave=\"handleMouseLeave(group_index, condition)\"\n >\n <a-input-group compact>\n <a-tooltip :title=\"condition.label\">\n <a-cascader\n :value=\"condition.label\"\n style=\"width: 125px\"\n :options=\"searchItemOptionsDict[group_index]\"\n showSearch\n :allowClear=\"false\"\n :placeholder=\"$t('请选择...')\"\n @change=\"value => onChangeSearchItem(value, group_index, condition, k)\"\n />\n </a-tooltip>\n <a-tooltip :title=\"get_operator_type_map(condition.format, condition.operator)\">\n <a-select\n v-if=\"get_operator_list_selected(condition).length > 0\"\n :dropdownMatchSelectWidth=\"false\"\n v-model:value=\"condition.operator\"\n @change=\"value => onChangeOperator(value, group_index, condition)\"\n style=\"width: 100px\"\n >\n <a-select-option\n v-for=\"item in get_operator_list_selected(condition)\"\n :value=\"item\"\n :key=\"item\"\n >\n {{ get_operator_type_map(condition.format, item) }}\n </a-select-option>\n </a-select>\n </a-tooltip>\n <span\n style=\"width: 315px; height: 40px\"\n v-if=\"condition_model_dict && condition_model_dict[group_index]\"\n >\n <template\n v-if=\"['is_or_not_blank_or_null', 'is_or_not_null'].includes(condition.operator)\"\n >\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'select',\n mode: 'default',\n format: 'choices',\n class_name: 'str',\n placeholder: '',\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"is_or_not_blank_or_null_options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"['input'].includes(condition.format)\">\n <template\n v-if=\"condition.operator === 'between' || condition.operator === 'notbetween'\"\n >\n <template v-if=\"condition.type === 'datepicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, type: 'rangepicker', format: condition.dateFormat }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.type === 'monthpicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'monthrangepicker',\n format: condition.dateFormat,\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.type === 'timepicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'timerangepicker',\n format: condition.dateFormat,\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else>\n <a-flex>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name][0]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n <div class=\"range\">~</div>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name][1]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </a-flex>\n </template>\n </template>\n <template v-else-if=\"condition.operator === '_eq'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'select',\n mode: 'default',\n format: 'choices',\n class_name: 'str',\n placeholder: '',\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"options_eq\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template\n v-else-if=\"\n condition.type === 'datepicker' ||\n condition.type === 'monthpicker' ||\n condition.type === 'timepicker'\n \"\n >\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, format: condition.dateFormat }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n </template>\n <template v-else-if=\"['choices', 'remote'].includes(condition.format)\">\n <template v-if=\"condition.format === 'choices'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.format === 'remote'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, name: condition?.field_name }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n </template>\n </span>\n <span\n class=\"close-icon\"\n v-if=\"deleteBtnDict && deleteBtnDict[group_index]\"\n >\n <a-tooltip\n title=\"删除此条件\"\n v-if=\"\n deleteBtnDict[group_index][condition.field_name] &&\n (default_search_condition_config_list[0].length > 1 ||\n default_search_condition_config_list.length > 1) &&\n !is_massage_default\n \"\n >\n <close-circle-outlined @click=\"handleDeleteFormItem(group_index, condition)\" />\n </a-tooltip>\n </span>\n </a-input-group>\n </a-space-compact>\n </a-space>\n <a-divider\n class=\"divider\"\n style=\"margin: 0\"\n v-if=\"\n default_search_condition_config_list.length > 1 &&\n group_index != default_search_condition_config_list.length - 1\n \"\n >\n 或\n </a-divider>\n </div>\n </div>\n <div\n class=\"search-bar\"\n v-if=\"isShowForm && !is_massage_default\"\n >\n <a-space>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleAddConditions\"\n >\n {{ $t('添加条件') }}\n </a-button>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleAddGroupCondition\"\n >\n {{ $t('添加条件组') }}\n </a-button>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleSearch\"\n >\n {{ $t('查询') }}\n </a-button>\n </a-space>\n </div>\n\n <add-condition-modal\n v-if=\"addConditionModal.open\"\n :open=\"addConditionModal.open\"\n :default_search_condition_config_list=\"default_search_condition_config_list\"\n :base_search_condition_config_list=\"base_search_condition_config_list\"\n @ok=\"handleAddConditionOk\"\n @cancel=\"handleAddConditionCancel\"\n />\n\n <add-condition-group-modal\n v-if=\"addConditionGroupModal.open\"\n :open=\"addConditionGroupModal.open\"\n :default_search_condition_config_list=\"default_search_condition_config_list\"\n :base_search_condition_config_list=\"base_search_condition_config_list\"\n @ok=\"handleAddGroupConditionOK\"\n @cancel=\"handleAddGroupConditionCancel\"\n />\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n onMounted,\n reactive,\n ref,\n computed,\n watch,\n PropType,\n nextTick,\n onUnmounted,\n} from 'vue';\nimport FieldRender from 'liyu-pc-base/components/FormRender/FieldRender.vue';\nimport AddConditionModal from 'liyu-pc-base/components/FormRender/GeneralFilter/AddConditionModal/index.vue';\nimport AddConditionGroupModal from 'liyu-pc-base/components/FormRender/GeneralFilter/AddConditionGroupModal/index.vue';\nimport { isNotEmpty } from 'liyu-pc-base/utils/function';\nimport {\n CloseCircleOutlined,\n CloseOutlined,\n LeftOutlined,\n RightOutlined,\n} from '@ant-design/icons-vue';\nimport { useI18n } from 'vue-i18n';\nimport { get_options_eq } from 'liyu-pc-base/components/FormRender/GeneralFilter/data';\nimport moment from 'moment';\nimport FieldRender2 from 'liyu-pc-base/components/FormRender/FieldRender2.vue';\nimport { get_operator_type_map } from 'liyu-pc-base/utils/function';\n\nexport default defineComponent({\n name: 'GeneralFilter',\n props: {\n base_search_condition_config_list: {\n type: Array as PropType<any[]>,\n },\n default_search_condition_config_list: {\n type: Array as PropType<any[]>,\n },\n is_show_normal_search: {\n type: Boolean,\n default: () => false,\n },\n is_clear_model: {\n type: Boolean,\n default: () => false,\n },\n is_show_advantage: {\n type: Boolean,\n default: () => false,\n },\n is_massage_default: {\n type: Boolean,\n default: () => false,\n },\n eventBus: {\n type: Object,\n required: false,\n },\n delayShow: {\n type: Boolean,\n default: () => true,\n },\n },\n components: {\n FieldRender2,\n CloseOutlined,\n LeftOutlined,\n RightOutlined,\n FieldRender,\n AddConditionGroupModal,\n AddConditionModal,\n CloseCircleOutlined,\n },\n emits: [\n 'search',\n 'resize',\n 'update_default_search_condition_config_list',\n 'onShowSearchRender',\n 'delSearch',\n 'onChangeValue',\n 'update:is_clear_model',\n ],\n setup(props, { emit }) {\n const isShowForm = ref(props.is_massage_default);\n const labelModel = ref({});\n const { t } = useI18n();\n const { options_eq } = get_options_eq(t);\n //条件组-->\n const condition_model_dict = ref([]);\n const validateInfos = {};\n const source_default_search_condition_config_list = ref(null);\n const is_or_not_blank_or_null_options = ref([\n { value: 'yes', label: t('is_or_not_blank_or_null.yes') },\n { value: 'no', label: t('is_or_not_blank_or_null.no') },\n ]);\n if (!source_default_search_condition_config_list.value) {\n source_default_search_condition_config_list.value = JSON.parse(\n JSON.stringify(props.default_search_condition_config_list),\n );\n }\n\n const operator_type_count_map = {\n between: 2,\n gt: 1,\n lt: 1,\n gte: 1,\n lte: 1,\n in: 0,\n eq: 1,\n _eq: 1,\n contains: 1,\n icontains: 1,\n startswith: 1,\n istartswith: 1,\n endswith: 1,\n iendswith: 1,\n notbetween: 2,\n notin: 0,\n notcontains: 1,\n noticontains: 1,\n notstartswith: 1,\n notistartswith: 1,\n notendswith: 1,\n notiendswith: 1,\n not_eq: 1,\n not_blank_not_null: 1,\n json_list_not_blank_not_null: 1,\n json_list_is_blank_is_null: 1,\n is_or_not_blank_or_null: 1,\n is_or_not_null: 1,\n };\n const is2DArray = arr => {\n const [first] = [arr];\n return Array.isArray(first) && arr.every(subArray => Array.isArray(subArray));\n };\n let old_operator = null;\n const onChangeOperator = (operator, index, condition) => {\n //不同操作类型,设置不同的默认值\n // if (condition_model_dict.value[index][condition.field_name]) {\n // return;\n // }\n const value = condition_model_dict.value[index][condition.field_name];\n if (get_operator_list_selected(condition).includes('_eq')) {\n if (operator == '_eq') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == '_eq') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (get_operator_list_selected(condition).includes('not_blank_not_null')) {\n if (operator == 'not_blank_not_null') {\n condition_model_dict.value[index][condition.field_name] = '是';\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == 'not_blank_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (\n get_operator_list_selected(condition).includes('is_or_not_blank_or_null') ||\n get_operator_list_selected(condition).includes('is_or_not_null')\n ) {\n if (operator == 'is_or_not_blank_or_null' || operator == 'is_or_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == 'is_or_not_blank_or_null' || old_operator == 'is_or_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (value instanceof Array && is2DArray(value)) {\n // 级联类型,默认值默认清空\n condition_model_dict.value[index][condition.field_name] = null;\n } else if (operator_type_count_map[operator] == 1) {\n if (value instanceof Array) {\n const [first] = condition_model_dict.value[index][condition.field_name];\n if (isNotEmpty(first)) {\n condition_model_dict.value[index][condition.field_name] = first;\n } else {\n condition_model_dict.value[index][condition.field_name] = null;\n }\n } else {\n condition_model_dict.value[index][condition.field_name] = value ? value : null;\n }\n const is = options_eq.some(\n obj => obj.value === condition_model_dict.value[index][condition.field_name],\n );\n if (is) {\n condition_model_dict.value[index][condition.field_name] = null;\n }\n } else if (operator_type_count_map[operator] == 2) {\n if (condition_model_dict.value[index][condition.field_name] instanceof Array) {\n const [first, seconds] = condition_model_dict.value[index][condition.field_name];\n condition_model_dict.value[index][condition.field_name] = [first, seconds];\n } else if (condition_model_dict.value[index][condition.field_name]) {\n const first = condition_model_dict.value[index][condition.field_name];\n condition_model_dict.value[index][condition.field_name] = [first, null];\n } else {\n condition_model_dict.value[index][condition.field_name] = [null, null];\n }\n const is = options_eq.some(\n obj => obj.value === condition_model_dict.value[index][condition.field_name][0],\n );\n if (is) {\n condition_model_dict.value[index][condition.field_name] = [null, null];\n }\n }\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n // console.log('onChangeValue');\n };\n\n const addConditionModal = reactive({\n open: false,\n });\n const handleAddConditions = () => {\n addConditionModal.open = true;\n };\n const handleAddConditionOk = (data: any) => {\n props.default_search_condition_config_list.forEach((item: any, index: any) => {\n data.new_list.forEach((item1: any, index1: any) => {\n if (index == index1) {\n item.forEach((item2: any) => {\n item1.forEach((item3: any) => {\n if (item2.field_name == item3.field_name) {\n item3.value = item2.value;\n item3.operator = item2.operator;\n }\n });\n });\n }\n });\n });\n //保存后处理 new_list\n emit('update_default_search_condition_config_list', { new_list: data.new_list });\n // refreshCondition();\n addConditionModal.open = false;\n };\n const handleAddConditionCancel = () => {\n addConditionModal.open = false;\n };\n\n const addConditionGroupModal = reactive({\n open: false,\n });\n const handleAddGroupCondition = () => {\n addConditionGroupModal.open = true;\n };\n const handleAddGroupConditionOK = (data: any) => {\n props.default_search_condition_config_list.forEach((item: any, index: any) => {\n data.new_list.forEach((item1: any, index1: any) => {\n if (index == index1) {\n item.forEach((item2: any) => {\n item1.forEach((item3: any) => {\n if (item2.field_name == item3.field_name) {\n item3.value = item2.value;\n item3.operator = item2.operator;\n }\n });\n });\n }\n });\n });\n emit('update_default_search_condition_config_list', { new_list: data.new_list });\n // refreshCondition();\n addConditionGroupModal.open = false;\n };\n const handleAddGroupConditionCancel = () => {\n addConditionGroupModal.open = false;\n };\n const handleSearch = () => {\n isShowForm.value = false;\n console.log('condition_model_dict.value', condition_model_dict.value);\n emit('search', { model: condition_model_dict.value });\n };\n const refreshCondition = (update_all = false) => {\n if (props.base_search_condition_config_list.length == 0) {\n return;\n }\n props.default_search_condition_config_list?.forEach((item_list: any, index: number) => {\n deleteBtnDict[index] = {};\n if (!condition_model_dict.value[index]) {\n condition_model_dict.value[index] = {};\n }\n props.base_search_condition_config_list.forEach((i: any) => {\n i.group?.forEach((group_item: any) => {\n item_list.forEach((k: any) => {\n if (group_item.field_name == k.field_name) {\n const value = condition_model_dict.value[index][k.field_name];\n if (value == undefined || update_all) {\n if (operator_type_count_map[k.operator] == 1) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = null;\n }\n } else if (operator_type_count_map[k.operator] == 2) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = [null, null];\n }\n } else if (operator_type_count_map[k.operator] == 0) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = [];\n }\n }\n }\n Object.assign(k, { ...group_item, operator: k.operator }); // 保持表单项原有选择的查询条件\n if (k.operator == 'eq' && k.mode != 'default') {\n group_item.mode = 'default';\n Object.assign(k, { model: 'default' });\n } else if (['in', 'notin'].includes(k.operator) && k.mode != 'multiple') {\n group_item.mode = 'multiple';\n Object.assign(k, { model: 'multiple' });\n }\n }\n });\n });\n });\n });\n };\n const onFilterChanged = () => {\n refreshCondition(true);\n };\n\n const deleteBtnDict = reactive({}); // 表单项的删除按钮是否显示\n const handleMouseEnter = (index: any, form_item: any) => {\n deleteBtnDict[index][form_item.field_name] = true;\n };\n const handleMouseLeave = (index: any, form_item: any) => {\n deleteBtnDict[index][form_item.field_name] = false;\n };\n const handleDeleteFormItem = (index: any, condition: any) => {\n //default_search_condition_config_list 不允许删除最后一个条件组的条件项\n const new_list = [];\n props.default_search_condition_config_list.forEach((item_list: any, index_: number) => {\n if (index_ !== index) {\n new_list.push(item_list);\n } else {\n const list = [];\n item_list.forEach((k: any) => {\n if (k.field_name !== condition.field_name) {\n list.push(k);\n }\n });\n if (list.length > 0) {\n new_list.push(list);\n }\n }\n });\n emit('update_default_search_condition_config_list', { new_list: new_list });\n // refreshCondition();\n };\n const handleDelSearch = (index, filed_name) => {\n if (condition_model_dict.value[index][filed_name] instanceof Array) {\n condition_model_dict.value[index][filed_name].length = 0;\n } else {\n condition_model_dict.value[index][filed_name] = null;\n }\n emit('onChangeValue', { model: condition_model_dict.value });\n emit('delSearch', { model: JSON.parse(JSON.stringify(condition_model_dict.value)) });\n };\n\n const onChangeSearchItem = (value: any, group_index, condition: any, condition_index) => {\n if (value instanceof Array && value.length > 0) {\n const selected_field_name = value[value.length - 1];\n let new_condition = null;\n props.base_search_condition_config_list.forEach(item_list => {\n item_list.group.forEach(i => {\n if (i.field_name === selected_field_name) {\n new_condition = JSON.parse(JSON.stringify(i));\n if (new_condition.default_operator) {\n new_condition.operator = new_condition.default_operator;\n } else if (get_operator_list_selected(new_condition).length > 0) {\n const [first] = get_operator_list_selected(new_condition);\n new_condition.operator = first;\n }\n }\n });\n });\n\n if (new_condition) {\n const new_list = JSON.parse(JSON.stringify(props.default_search_condition_config_list));\n new_list.forEach((item_list, i) => {\n if (i === group_index) {\n item_list.forEach((item, k) => {\n if (item.field_name == condition.field_name && k == condition_index) {\n item_list.splice(k, 1, new_condition);\n delete condition_model_dict.value[group_index][item.field_name];\n }\n });\n }\n });\n emit('update_default_search_condition_config_list', {\n new_list: new_list,\n });\n }\n refreshCondition();\n }\n };\n\n const searchItemOptionsDict: any = computed(() => {\n const dict = {};\n props.default_search_condition_config_list.forEach((group_item, index) => {\n dict[index] = [];\n const filter_field_name_list = group_item.map(item => item.field_name);\n props.base_search_condition_config_list.forEach(item => {\n const filter_list = item.group.filter(\n i => !filter_field_name_list.includes(i.field_name),\n );\n const o = {\n value: item.name,\n label: item.name,\n children: filter_list.map(i => {\n return {\n value: i.field_name,\n label: i.label,\n };\n }),\n };\n dict[index].push(o);\n });\n });\n return dict;\n });\n\n const isShowSearchTag = (index, condition) => {\n const value = condition_model_dict.value[index]?.[condition.field_name];\n if (value instanceof Array) {\n const [first] = value;\n if (isNotEmpty(first)) {\n return true;\n }\n } else if (isNotEmpty(value)) {\n return true;\n }\n return false;\n };\n\n const transferValueFunc = (index, condition) => {\n const str_list: any = [];\n const value = condition_model_dict.value[index]?.[condition.field_name];\n if (\n condition.operator === 'is_or_not_blank_or_null' ||\n condition.operator === 'is_or_not_null'\n ) {\n if (value === 'yes') {\n return t('is_or_not_blank_or_null.yes');\n } else {\n return t('is_or_not_blank_or_null.no');\n }\n } else if (condition.operator === '_eq') {\n if (['上月', '本月', '今日', '昨日', '期初'].includes(value)) {\n return t(value);\n }\n } else if (labelModel.value[condition.field_name] != undefined) {\n return `${get_operator_type_map(condition.format, condition.operator)} ${\n labelModel.value[condition.field_name]\n }`;\n } else if (value instanceof Array && condition.field_name_list instanceof Array) {\n let transfer_value;\n if (condition.field_name_list) {\n if (value instanceof Array) {\n transfer_value = value.join(',');\n } else {\n transfer_value = value;\n }\n }\n return `${get_operator_type_map(condition.format, condition.operator)} ${transfer_value}`;\n } else if (value instanceof Array && condition.options instanceof Array) {\n value.forEach(item => {\n condition.options.forEach(i => {\n if (item == i.value) {\n str_list.push(i.label);\n }\n });\n });\n return `${get_operator_type_map(condition.format, condition.operator)} ${str_list.join(\n ',',\n )}`;\n } else {\n let transfer_value;\n if (condition.options) {\n condition.options.forEach(i => {\n if (value == i.value) {\n transfer_value = i.label;\n }\n });\n } else if (condition.type == 'monthpicker' && condition.dateFormat) {\n if (value instanceof Array) {\n const str_list = [];\n value.forEach(i => {\n if (i) {\n str_list.push(moment(i).format(condition.dateFormat));\n } else {\n str_list.push(i);\n }\n });\n transfer_value = str_list.join(',');\n } else {\n transfer_value = moment(value).format(condition.dateFormat);\n }\n } else {\n transfer_value = value;\n }\n return `${get_operator_type_map(condition.format, condition.operator)} ${transfer_value}`;\n }\n };\n\n const handleShowSearchRender = () => {\n emit('onShowSearchRender');\n };\n\n const get_operator_list_selected = condition => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n } else if (condition.operator_list) {\n return condition.operator_list;\n } else {\n return [];\n }\n };\n\n watch(\n () => condition_model_dict.value,\n () => {\n emit('onChangeValue', { model: condition_model_dict.value });\n // console.log('onChangeValue_watch');\n },\n { deep: true },\n );\n watch(\n () => props.default_search_condition_config_list,\n () => {\n if (props.default_search_condition_config_list?.length == 0) {\n emit('update_default_search_condition_config_list', {\n new_list: source_default_search_condition_config_list.value,\n });\n return;\n }\n refreshCondition();\n },\n { deep: true },\n );\n watch(\n () => props.base_search_condition_config_list,\n () => {\n refreshCondition();\n },\n { deep: true },\n );\n\n watch(\n () => props.is_clear_model,\n () => {\n if (props.is_clear_model) {\n condition_model_dict.value = {};\n refreshCondition();\n emit('update:is_clear_model', false);\n }\n },\n );\n onMounted(() => {\n refreshCondition();\n if (props.eventBus) {\n props.eventBus.on('filterChange', onFilterChanged);\n }\n });\n onUnmounted(() => {\n if (props.eventBus) {\n props.eventBus.off('filterChange', onFilterChanged);\n }\n });\n return {\n props,\n t,\n isShowForm,\n labelModel,\n get_operator_type_map,\n condition_model_dict,\n addConditionModal,\n handleAddConditions,\n handleAddConditionOk,\n handleAddConditionCancel,\n onChangeOperator,\n handleAddGroupCondition,\n handleSearch,\n\n addConditionGroupModal,\n handleAddGroupConditionOK,\n handleAddGroupConditionCancel,\n validateInfos,\n\n deleteBtnDict,\n handleMouseEnter,\n handleMouseLeave,\n handleDeleteFormItem,\n handleDelSearch,\n\n searchItemOptionsDict,\n onChangeSearchItem,\n transferValueFunc,\n isShowSearchTag,\n handleShowSearchRender,\n options_eq,\n get_operator_list_selected,\n is_or_not_blank_or_null_options,\n };\n },\n});\n</script>\n<style lang=\"less\" scoped>\n.card {\n overflow: auto;\n max-height: 300px;\n background: #f2f5f7;\n}\n\n.condition-group {\n padding: 5px;\n}\n\n.range {\n margin-top: 5px;\n}\n\n.close-icon {\n width: 15px;\n margin-top: 5px;\n margin-left: 5px;\n color: red;\n}\n\n.search-bar {\n background: #f2f5f7;\n text-align: right;\n}\n\n:deep(.divider .ant-divider) {\n margin: 0;\n}\n</style>\n","<template>\n <a-form\n ref=\"form\"\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n :layout=\"form.settings.layout\"\n :validateTrigger=\"false\"\n :label-col=\"\n form.settings.layout == 'vertical'\n ? undefined\n : form.settings.labelCol\n ? form.settings.labelCol\n : form.settings.col && form.settings.col.length > 0\n ? { span: 6 }\n : { span: 4 }\n \"\n :wrapper-col=\"\n form.settings.layout == 'vertical'\n ? undefined\n : form.settings.wrapperCol\n ? form.settings.wrapperCol\n : form.settings.col && form.settings.col.length > 0\n ? { span: 18 }\n : { span: 20 }\n \"\n :labelAlign=\"form.settings.labelAlign\"\n scrollToFirstError\n >\n <a-row\n :gutter=\"20\"\n style=\"margin: 0\"\n >\n <template v-if=\"form.settings.col && form.settings.col.length > 0\">\n <a-col\n v-for=\"col in fieldList\"\n :xl=\"24 / fieldList.length\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <field-render\n v-for=\"field in form.fields.slice(col[0], col[1])\"\n v-model:value=\"model[field.name]\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </a-col>\n </template>\n <a-col\n v-if=\"!form.settings.col || form.settings.col.length === 0\"\n :xl=\"24\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <template v-for=\"field in form.fields\">\n <field-render\n v-model:value=\"model[field.name]\"\n v-model:label=\"model[field.name2]\"\n v-if=\"field.name2\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n <field-render\n v-model:value=\"model[field.name]\"\n v-else\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </template>\n </a-col>\n </a-row>\n </a-form>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, watch } from 'vue';\n\nexport default defineComponent({\n name: 'FormRender',\n components: {},\n props: {\n model: {\n type: Object,\n required: true,\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n },\n setup(props) {\n if (props.form.watch) {\n for (const k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n },\n\n data() {\n return {\n fieldList: [] as any[],\n };\n },\n methods: {\n validate() {\n return (this.$refs.form as any).validate();\n },\n reset() {\n (this.$refs.form as any).resetFields();\n },\n disable(name: string | number) {\n // eslint-disable-next-line vue/no-mutating-props\n this.form.fields[name].disabled = true;\n },\n disableAll() {\n this.form.fields.forEach((item: any) => {\n item.disabled = true;\n });\n },\n },\n created() {\n let a = 0;\n if (this.form.settings.col && this.form.settings.col.length > 0) {\n this.form.settings.col.forEach((item: number, i: number) => {\n a = a + item;\n if (i === 0) {\n this.fieldList.push([0, a]);\n } else {\n this.fieldList.push([a - item, a]);\n }\n });\n }\n },\n});\n</script>\n","<template>\n <a-form\n ref=\"form\"\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n :layout=\"form.settings.layout\"\n :validateTrigger=\"false\"\n :label-col=\"\n form.settings.layout == 'vertical'\n ? undefined\n : form.settings.labelCol\n ? form.settings.labelCol\n : form.settings.col && form.settings.col.length > 0\n ? { span: 6 }\n : { span: 4 }\n \"\n :wrapper-col=\"\n form.settings.layout == 'vertical'\n ? undefined\n : form.settings.wrapperCol\n ? form.settings.wrapperCol\n : form.settings.col && form.settings.col.length > 0\n ? { span: 18 }\n : { span: 20 }\n \"\n :labelAlign=\"form.settings.labelAlign\"\n scrollToFirstError\n >\n <a-row\n :gutter=\"20\"\n style=\"margin: 0\"\n >\n <template v-if=\"form.settings.col && form.settings.col.length > 0\">\n <a-col\n v-for=\"col in fieldList\"\n :xl=\"24 / fieldList.length\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <field-render\n v-for=\"field in form.fields.slice(col[0], col[1])\"\n v-model:value=\"model[field.name]\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </a-col>\n </template>\n <a-col\n v-if=\"!form.settings.col || form.settings.col.length === 0\"\n :xl=\"24\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <template v-for=\"field in form.fields\">\n <field-render\n v-model:value=\"model[field.name]\"\n v-model:label=\"model[field.name2]\"\n v-if=\"field.name2\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n <field-render\n v-model:value=\"model[field.name]\"\n v-else\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </template>\n </a-col>\n </a-row>\n </a-form>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, watch } from 'vue';\n\nexport default defineComponent({\n name: 'FormRender',\n components: {},\n props: {\n model: {\n type: Object,\n required: true,\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n },\n setup(props) {\n if (props.form.watch) {\n for (const k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n },\n\n data() {\n return {\n fieldList: [] as any[],\n };\n },\n methods: {\n validate() {\n return (this.$refs.form as any).validate();\n },\n reset() {\n (this.$refs.form as any).resetFields();\n },\n disable(name: string | number) {\n // eslint-disable-next-line vue/no-mutating-props\n this.form.fields[name].disabled = true;\n },\n disableAll() {\n this.form.fields.forEach((item: any) => {\n item.disabled = true;\n });\n },\n },\n created() {\n let a = 0;\n if (this.form.settings.col && this.form.settings.col.length > 0) {\n this.form.settings.col.forEach((item: number, i: number) => {\n a = a + item;\n if (i === 0) {\n this.fieldList.push([0, a]);\n } else {\n this.fieldList.push([a - item, a]);\n }\n });\n }\n },\n});\n</script>\n","<template>\n <a-form\n ref=\"form\"\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n scrollToFirstError\n >\n <a-row\n gutter=\"5\"\n v-for=\"row in form.fieldList\"\n type=\"flex\"\n >\n <a-col\n v-for=\"field in row\"\n :span=\"field.span\"\n >\n <template v-for=\"field in form.fields\">\n <field-render\n v-model:value=\"model[field.name]\"\n v-model:label=\"model[field.name2]\"\n v-if=\"field.name2\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n <field-render\n v-model:value=\"model[field.name]\"\n v-else\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </template>\n </a-col>\n </a-row>\n </a-form>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, watch } from 'vue';\n\nexport default defineComponent({\n name: 'FormRender2',\n components: {},\n props: {\n model: {\n type: Object,\n required: true,\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n },\n setup(props) {\n if (props.form.watch) {\n for (const k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n },\n\n data() {\n return {};\n },\n methods: {\n validate() {\n return (this.$refs.form as any).validate();\n },\n reset() {\n (this.$refs.form as any).resetFields();\n },\n disable(name: string | number) {\n // eslint-disable-next-line vue/no-mutating-props\n this.form.fields[name].disabled = true;\n },\n disableAll() {\n this.form.fields.forEach((item: any) => {\n item.disabled = true;\n });\n },\n },\n created() {},\n});\n</script>\n","<template>\n <a-form\n ref=\"form\"\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n scrollToFirstError\n >\n <a-row\n gutter=\"5\"\n v-for=\"row in form.fieldList\"\n type=\"flex\"\n >\n <a-col\n v-for=\"field in row\"\n :span=\"field.span\"\n >\n <template v-for=\"field in form.fields\">\n <field-render\n v-model:value=\"model[field.name]\"\n v-model:label=\"model[field.name2]\"\n v-if=\"field.name2\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n <field-render\n v-model:value=\"model[field.name]\"\n v-else\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </template>\n </a-col>\n </a-row>\n </a-form>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, watch } from 'vue';\n\nexport default defineComponent({\n name: 'FormRender2',\n components: {},\n props: {\n model: {\n type: Object,\n required: true,\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n },\n setup(props) {\n if (props.form.watch) {\n for (const k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n },\n\n data() {\n return {};\n },\n methods: {\n validate() {\n return (this.$refs.form as any).validate();\n },\n reset() {\n (this.$refs.form as any).resetFields();\n },\n disable(name: string | number) {\n // eslint-disable-next-line vue/no-mutating-props\n this.form.fields[name].disabled = true;\n },\n disableAll() {\n this.form.fields.forEach((item: any) => {\n item.disabled = true;\n });\n },\n },\n created() {},\n});\n</script>\n","export const CUSTOM_VIEW_DATA_USER = 'customviewdatauser';\n","<template>\n <a-card :body-style=\"{ padding: 0, height: height + 87 + 'px', overflowY: 'auto' }\">\n <a-collapse\n v-model:activeKey=\"viewKey\"\n :bordered=\"false\"\n class=\"collapses\"\n style=\"background: rgb(255, 255, 255)\"\n >\n <template #expandIcon=\"{ isActive }\">\n <caret-right-outlined :rotate=\"isActive ? 90 : 0\" />\n </template>\n <a-collapse-panel\n :key=\"'1'\"\n :style=\"customStyle\"\n >\n <template #header>\n <span style=\"font-weight: 700\">{{ $t('个人视图') }}</span>\n </template>\n <template #extra>\n <a-tooltip>\n <template #title>{{ $t('个人视图管理') }}</template>\n <setting-outlined\n style=\"margin-right: 10px\"\n @click.stop=\"editView('personal')\"\n />\n </a-tooltip>\n <a-tooltip>\n <template #title>{{ $t('新建个人视图') }}</template>\n <plus-outlined @click.stop=\"addView('personal')\" />\n </a-tooltip>\n </template>\n <a-table\n v-if=\"personData.length > 0\"\n :columns=\"columns\"\n :customRow=\"customRow\"\n :dataSource=\"personData\"\n :pagination=\"false\"\n :showHeader=\"false\"\n :size=\"'small'\"\n >\n <template #bodyCell=\"{ column, record }\">\n <div\n class=\"table\"\n v-if=\"column.dataIndex === 'name'\"\n style=\"width: 100%; cursor: pointer\"\n @click=\"changeView(record)\"\n >\n <a-tooltip\n :title=\"record.name\"\n :color=\"appStore.primaryColor\"\n placement=\"left\"\n :destroyTooltipOnHide=\"true\"\n :overlayStyle=\"{ maxWidth: '200px' }\"\n >\n <div style=\"max-width: 130px; float: left; white-space: nowrap; overflow: hidden\">\n {{ record.name }}\n </div>\n </a-tooltip>\n <span\n class=\"num\"\n style=\"float: right\"\n :style=\"\n currentViewObj.id === record.id ? { color: '#1890ff', fontWeight: 'bold' } : {}\n \"\n >\n {{ record.num }}\n </span>\n <a-dropdown class=\"dropdown\">\n <span\n style=\"float: right; font-weight: 800\"\n @click.stop=\"\"\n >\n · · ·\n </span>\n <template #overlay>\n <a-menu>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleSubmit(record, 'personal')\"\n >\n {{ $t('编辑') }}\n </a>\n </a-menu-item>\n <a-menu-item>\n <a\n href=\"javascript:;\"\n @click=\"handleShare(record)\"\n >\n {{ $t('分享视图') }}\n </a>\n </a-menu-item>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleDelet(record)\"\n >\n {{ $t('删除') }}\n </a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n </template>\n </a-table>\n </a-collapse-panel>\n <a-collapse-panel\n :key=\"'2'\"\n :style=\"customStyle\"\n >\n <template #header>\n <span style=\"font-weight: 700\">{{ $t('公共视图') }}</span>\n </template>\n <template #extra>\n <a-tooltip>\n <template #title>{{ $t('公共视图管理') }}</template>\n <setting-outlined\n style=\"margin-right: 10px\"\n @click.stop=\"editView('public')\"\n />\n </a-tooltip>\n <a-tooltip>\n <template #title>{{ $t('新建公共视图') }}</template>\n <plus-outlined @click.stop=\"addView('public')\" />\n </a-tooltip>\n </template>\n <a-table\n v-if=\"publicData.length > 0\"\n :columns=\"columns\"\n :customRow=\"customRow\"\n :dataSource=\"publicData\"\n :pagination=\"false\"\n :showHeader=\"false\"\n :size=\"'small'\"\n >\n <template #bodyCell=\"{ column, record }\">\n <div\n class=\"table\"\n v-if=\"column.dataIndex === 'name'\"\n style=\"width: 100%; cursor: pointer\"\n @click=\"changeView(record)\"\n >\n <a-tooltip\n :title=\"record.name\"\n :color=\"appStore.primaryColor\"\n placement=\"left\"\n :destroyTooltipOnHide=\"true\"\n :overlayStyle=\"{ maxWidth: '200px' }\"\n >\n <div style=\"max-width: 130px; float: left; white-space: nowrap; overflow: hidden\">\n {{ record.name }}\n </div>\n </a-tooltip>\n <span\n class=\"num\"\n style=\"float: right\"\n :style=\"\n currentViewObj.id === record.id ? { color: '#1890ff', fontWeight: 'bold' } : {}\n \"\n >\n {{ record.num }}\n </span>\n <a-dropdown class=\"dropdown\">\n <span\n style=\"float: right; font-weight: 800\"\n @click.stop=\"\"\n >\n · · ·\n </span>\n <template #overlay>\n <a-menu>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleSubmit(record, 'public')\"\n >\n {{ $t('编辑') }}\n </a>\n </a-menu-item>\n <a-menu-item>\n <a\n href=\"javascript:;\"\n @click=\"handleShare(record)\"\n >\n {{ $t('分享视图') }}\n </a>\n </a-menu-item>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleDelet(record)\"\n >\n {{ $t('删除') }}\n </a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n </template>\n </a-table>\n </a-collapse-panel>\n </a-collapse>\n </a-card>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n createVNode,\n defineComponent,\n onActivated,\n onMounted,\n onUnmounted,\n PropType,\n reactive,\n ref,\n watch,\n} from 'vue';\nimport {\n CaretRightOutlined,\n ExclamationCircleOutlined,\n PlusOutlined,\n SettingOutlined,\n} from '@ant-design/icons-vue';\nimport modalBox from 'liyu-pc-base/components/form-modal/modal-tools';\nimport { message, Modal } from 'ant-design-vue';\nimport { useUserStore } from 'liyu-pc-base/init-plugin';\nimport { useAppStore } from 'liyu-pc-base/init-plugin';\nimport {\n change_view_settings_sort,\n create_view_settings,\n delete_view_settings,\n query_view_settings_list,\n refresh_view_settings_cache,\n set_view_settings_default,\n update_view_settings,\n} from 'liyu-pc-base/api/view-model';\nimport { sourceStore } from 'liyu-pc-base/init-plugin';\nimport { copyValue } from 'liyu-pc-base/utils/function';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\nimport { getPageConfig } from 'liyu-pc-base/components/remotePages/index';\nimport { useI18n } from 'vue-i18n';\nimport { useRequiredConditionStore } from 'liyu-pc-base/init-plugin';\nimport { required_condition_event_obj } from 'liyu-pc-base/init-plugin';\nimport { useEnv } from 'liyu-pc-base/init-plugin';\nimport { CUSTOM_VIEW_DATA_USER } from 'liyu-pc-base/constants';\n\nconst VIEW_SYSTEM_EDIT = 'view_system_edit';\nconst columns = [\n {\n title: '',\n dataIndex: 'name',\n key: 'name',\n },\n];\nexport default defineComponent({\n name: 'ViewManage',\n components: {\n CaretRightOutlined,\n PlusOutlined,\n SettingOutlined,\n },\n props: {\n currentViewObj: {\n type: Object,\n required: true,\n },\n menu_flag: {\n type: String,\n required: true,\n },\n menu_name: {\n type: String,\n required: true,\n },\n countData: {\n type: String,\n required: true,\n },\n create_num: {\n type: Number,\n required: true,\n },\n current_num: {\n type: Number,\n required: true,\n },\n count_num: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n modalType: {\n type: String,\n },\n app_flag: {\n type: String,\n },\n allBaseConfigMap: {\n type: Object,\n required: true,\n },\n searchConfigFields: {\n type: Array as PropType<any[]>,\n required: true,\n },\n },\n emits: ['change'],\n setup(props, { emit }) {\n const env = useEnv();\n const requiredConditionStore = useRequiredConditionStore();\n const userStore = useUserStore();\n const appStore = useAppStore();\n const current_org = userStore.currentOrg;\n const userid = userStore.userid;\n const is_auth = ref(userStore.CHECK_AUTH(VIEW_SYSTEM_EDIT));\n const viewData = ref([]); // 视图数据\n const { t } = useI18n();\n let mergedConfig: any;\n const personData = computed(() => {\n const list = viewData.value\n .filter((item: any) => !!item.user_id && item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n const list1 = viewData.value\n .filter((item: any) => !!item.user_id && !item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n return list.concat(list1);\n }); // 个人视图数据\n const publicData = computed(() => {\n const list = viewData.value\n .filter((item: any) => !item.user_id && item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n const list1 = viewData.value\n .filter((item: any) => !item.user_id && !item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n return list.concat(list1);\n }); // 公共视图数据\n const viewNameList = computed(() => {\n return viewData.value.map((item: any) => {\n return item.name;\n });\n }); // 视图名称列表,用于创建、修改时查重\n const filterConditions = (conditions: any) => {\n const res = [];\n for (const group of conditions) {\n const group_item = [];\n for (const item of group) {\n if (props.allBaseConfigMap[item.field_name]) {\n group_item.push(item);\n }\n }\n if (group_item.length > 0) {\n res.push(group_item);\n }\n }\n return res;\n };\n const filter_search_model = (search_model: any) => {\n const res = {};\n const fieldMap = {};\n if (!search_model) {\n return res;\n }\n if (props.searchConfigFields?.length) {\n for (const item of props.searchConfigFields) {\n fieldMap[item.name] = item;\n }\n }\n for (const key of Object.keys(search_model)) {\n if (fieldMap[key]) {\n res[key] = search_model[key];\n }\n }\n return res;\n };\n const fetchData = async ({\n id,\n search_model,\n filter_map,\n sort_fields,\n group_condition,\n conditions,\n isShowGeneralFilter,\n }) => {\n return new Promise(resolve => {\n if (!props.countData && !mergedConfig?.countData) {\n console.error('无count接口');\n resolve(null);\n }\n const obj: any = {\n org_id: current_org.id,\n ...filter_search_model(search_model || {}),\n ...filter_map,\n sort_fields: sort_fields,\n };\n if (isShowGeneralFilter) {\n obj.group_condition = group_condition;\n obj.conditions = filterConditions(conditions);\n }\n obj.required_condition = getRequiredConditionObj();\n let db_alias = null;\n const page_config = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (page_config.get_db_alias) {\n db_alias = page_config.get_db_alias();\n }\n obj.db_alias = db_alias;\n getApiData(obj, mergedConfig?.countData ? mergedConfig.countData : props.countData)\n .then((res: any) => {\n viewData.value.forEach((item: any) => {\n if (item.id == id) {\n item.num = res;\n }\n });\n resolve(null);\n })\n .catch(error => {\n console.log('error', error);\n message.error(t('获取数据失败, 请刷新页面'));\n });\n });\n };\n const setCount = async (list: any) => {\n for (const item of list) {\n try {\n await fetchData(item);\n } catch (error) {\n console.log('error', error);\n message.error(t('获取数据失败, 请刷新页面'));\n }\n }\n };\n // 查询视图、刷新count\n const viewRefresh = async () => {\n const res = await getApiData(\n {\n org_id: current_org.id,\n user_id: userid,\n view_project__flag: env.VITE_APP_VIEW_PROJECT_FLAG,\n view_menu__flag: props.modalType,\n history_id: null,\n sort_fields: ['sort', 'create_time'],\n is_cache: false,\n },\n '/view/get_view_settings_for_user',\n );\n mergedConfig = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (mergedConfig?.isView === false) {\n window.location.hash = '';\n emit('change', null, {}, true, true);\n return;\n }\n requiredConditionStore.set_required_condition(\n props.modalType,\n mergedConfig.required_condition,\n );\n viewData.value.length = 0;\n let list: any = [];\n const count_search_list: any = [];\n if (res && res.system_user_datas && res.system_user_datas.length > 0) {\n list = list.concat(res.system_user_datas);\n }\n if (res && res.system_public_datas && res.system_public_datas.length > 0) {\n list = list.concat(res.system_public_datas);\n }\n if (res && res.public_datas && res.public_datas.length > 0) {\n list = list.concat(res.public_datas);\n }\n if (res && res.user_datas && res.user_datas.length > 0) {\n list = list.concat(res.user_datas);\n }\n list.forEach((item: any) => {\n let search_model: any = null;\n let filter_map: any = null;\n let group_condition: any = null;\n let conditions: any = null;\n if (item.data.isShowGeneralFilter) {\n search_model = {};\n filter_map = {};\n group_condition = item.data.group_condition;\n conditions = item.data.conditions;\n } else {\n search_model = item.data.search_model;\n filter_map = item.data.filter_map;\n group_condition = {};\n conditions = [];\n }\n viewData.value.push({\n ...item,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition: group_condition,\n conditions: conditions,\n });\n count_search_list.push({\n id: item.id,\n isShowGeneralFilter: item.data.isShowGeneralFilter,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition,\n conditions,\n });\n });\n if (count_search_list.length > 0) {\n setCount(count_search_list);\n }\n handleHashChange(null);\n };\n // 根据hash选定当前视图数据 event返回(视图数据,是否刷新页面,是否可自我保存)\n const handleHashChange = (uid: any) => {\n let hash = null;\n if (uid) {\n hash = uid;\n } else if (window.location.hash) {\n hash = window.location.hash.substring(1); // 去掉 # 符号\n }\n if (hash) {\n // 分享的视图链接打开\n const list = viewData.value.filter((item: any) => item.uid == hash);\n if (list && list.length > 0) {\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n } else {\n query_view_settings_list({\n org_id: current_org.id,\n conditions: [\n [\n {\n field_name: 'is_active',\n operator: 'in',\n value: [true],\n format: 'choices',\n class_name: 'bool',\n },\n {\n field_name: 'view_menu__flag',\n operator: 'eq',\n value: [props.menu_flag],\n format: 'input',\n class_name: 'str',\n },\n {\n field_name: 'uid',\n operator: 'eq',\n value: [hash],\n format: 'input',\n class_name: 'str',\n },\n ],\n ],\n }).then((res: any) => {\n if (res && res.data && res.data.length > 0) {\n emit(\n 'change',\n null,\n {\n ...res.data[0],\n ...res.data[0].data,\n },\n true,\n false,\n );\n } else {\n const list = viewData.value.filter((item: any) => !item.user_id && item.is_default);\n if (list && list.length > 0) {\n window.location.hash = list[0].uid;\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n return;\n }\n let obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => !item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n const obj = {\n uid: null,\n view_menu__flag: props.menu_flag,\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n };\n emit('change', null, obj, true, false);\n window.location.hash = '';\n }\n }\n }\n });\n }\n } else {\n let current_uid = '';\n if (sourceStore().get(CUSTOM_VIEW_DATA_USER)) {\n current_uid = sourceStore().get(CUSTOM_VIEW_DATA_USER)?.[props.menu_flag]; // 菜单当前视图uid\n }\n if (current_uid) {\n window.location.hash = current_uid;\n handleHashChange(current_uid);\n } else {\n // 优先选择非系统视图的默认视图\n const list = viewData.value.filter(\n (item: any) => !item.user_id && item.is_default && !item.is_system,\n );\n if (list && list.length > 0) {\n window.location.hash = list[0].uid;\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n return;\n }\n // 其次选择系统视图默认视图(多个默认选择第一个)\n const list_is_system = viewData.value.filter(\n (item: any) => !item.user_id && item.is_default && item.is_system,\n );\n if (list_is_system && list_is_system.length > 0) {\n window.location.hash = list_is_system[0].uid;\n emit('change', null, { ...list_is_system[0], ...list_is_system[0].data }, true, true);\n return;\n }\n let obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => !item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n window.location.hash = '';\n const obj = {\n uid: null,\n view_menu__flag: props.menu_flag,\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n };\n emit('change', null, obj, true, false);\n }\n }\n }\n }\n };\n const viewKey = ref(['1', '2']); // 视图数据展开控制key\n const customStyle =\n 'background: #ffffff;border-radius: 4px;margin-bottom: 2px;border: 0;overflow: hidden;';\n const customRow = (record: any) => {\n return props.currentViewObj && record && record.id === props.currentViewObj.id\n ? { style: { backgroundColor: '#ddf1ff' } }\n : { style: {} };\n };\n // 切换视图\n const changeView = (record: any) => {\n window.location.hash = record.uid;\n handleHashChange(record.uid);\n refreshCount([record]);\n };\n const process_default_search_for_view = (data: any) => {\n const res = [];\n for (const gropu of data) {\n const group_item = [];\n for (const item of gropu) {\n group_item.push({\n field_name: item.field_name,\n format: item.format,\n operator: item.operator,\n class_name: item.class_name,\n value: item.value,\n });\n }\n res.push(group_item);\n }\n return res;\n };\n // 保存修改视图\n const viewSubmit = ({ updateView, record }) => {\n if (record.name != updateView.name && viewNameList.value.includes(updateView.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n if (record?.id) {\n const list = viewData.value.filter((item: any) => record?.id == item.id);\n if (updateView.is_submit?.[0]) {\n const view = {\n ...list[0].data,\n search_model: { ...props.currentViewObj.search_model, current: 1 },\n filter_map: props.currentViewObj.filter_map,\n sort_fields: props.currentViewObj.sort_fields,\n filtered_value: props.currentViewObj.filtered_value,\n sort_orders: props.currentViewObj.sort_orders,\n column: props.currentViewObj.column,\n isShowGeneralFilter: props.currentViewObj.isShowGeneralFilter,\n conditions: props.currentViewObj.conditions,\n group_condition: props.currentViewObj.group_condition,\n group_record: props.currentViewObj.group_record,\n default_search_condition_config_list: process_default_search_for_view(\n props.currentViewObj.default_search_condition_config_list,\n ),\n };\n delete view.is_system; // 存储时不记录is_system,防止后端直接修改,前端不起效\n update_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n is_system: updateView.is_system?.[0],\n name: updateView.name,\n data: JSON.stringify(view),\n }).then((res: any) => {\n if (updateView.is_default?.[0]) {\n set_view_settings_default({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n });\n } else {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n }\n });\n } else {\n update_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n is_system: updateView.is_system?.[0],\n name: updateView.name,\n }).then((res: any) => {\n if (updateView.is_default?.[0]) {\n set_view_settings_default({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n });\n } else {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n }\n });\n }\n } else {\n let view: any = {};\n if (updateView.is_submit?.[0]) {\n view = {\n search_model: { ...props.currentViewObj.search_model, current: 1 },\n filter_map: props.currentViewObj.filter_map,\n sort_fields: props.currentViewObj.sort_fields,\n filtered_value: props.currentViewObj.filtered_value,\n sort_orders: props.currentViewObj.sort_orders,\n column: props.currentViewObj.column,\n isShowGeneralFilter: props.currentViewObj.isShowGeneralFilter,\n conditions: props.currentViewObj.conditions,\n group_condition: props.currentViewObj.group_condition,\n group_record: props.currentViewObj.group_record,\n default_search_condition_config_list: process_default_search_for_view(\n props.currentViewObj.default_search_condition_config_list,\n ),\n };\n delete view.is_system; // 存储时不记录is_system,防止后端直接修改,前端不起效\n } else {\n view = {\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n isShowGeneralFilter: null,\n conditions: [],\n group_condition: {},\n group_record: {},\n };\n }\n create_view_settings({\n org_id: current_org.id,\n user_id: updateView.view_type == 'personal' ? userid : null,\n name: updateView.name,\n view_project__flag: env.VITE_APP_VIEW_PROJECT_FLAG,\n view_menu__flag: props.menu_flag,\n view_menu__name: props.menu_name,\n is_system: false,\n data: JSON.stringify(view),\n }).then((res: any) => {\n emit('change', null, { ...res, ...res.data }, true, true);\n if (res.id) {\n viewData.value = viewData.value.concat([\n {\n ...res,\n },\n ]);\n setCount([\n {\n id: res.id,\n search_model: view.search_model,\n filter_map: view.filter_map,\n sort_fields: view.sort_fields,\n group_condition: view.group_condition,\n conditions: view.conditions,\n isShowGeneralFilter: view.isShowGeneralFilter,\n },\n ]);\n window.location.hash = res.uid;\n handleHashChange(res.uid);\n }\n });\n }\n };\n // 视图编辑按钮\n const handleSubmit = (record: any, view_type: string) => {\n let is_submit: any = [false];\n if (props.currentViewObj.id == record.id) {\n is_submit = [true];\n }\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('编辑视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'checkbox',\n name: 'is_submit',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: record.name,\n is_submit: is_submit,\n is_default: [record?.is_default ? record?.is_default : false],\n is_system: [record?.is_system ? record?.is_system : false],\n }),\n },\n options: {\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n is_default: [\n {\n name: t('设为默认视图'),\n value: true,\n },\n ],\n is_system: [\n {\n name: t('设为系统视图'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n viewSubmit({ updateView: data, record: record });\n resolve(null);\n });\n },\n });\n if (view_type == 'public') {\n tempModal.form.fields.push({\n type: 'checkbox',\n name: 'is_default',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n });\n if (is_auth.value) {\n tempModal.form.fields.push({\n type: 'checkbox',\n name: 'is_system',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n });\n }\n }\n modalBox(tempModal);\n };\n // 添加视图\n const addView = (view_type: any) => {\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('新建视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'radio',\n name: 'view_type',\n label: t('视图可见范围'),\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: '',\n placeholder: '',\n },\n {\n type: 'checkbox',\n name: 'is_submit',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: null,\n view_type: view_type,\n is_submit: [true],\n }),\n },\n options: {\n view_type: [\n { name: t('个人视图(仅自己可见)'), value: 'personal' },\n { name: t('公共视图(项目成员均可见)'), value: 'public' },\n ],\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n if (viewNameList.value.includes(data.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n viewSubmit({ updateView: data, record: data });\n resolve(null);\n });\n },\n });\n modalBox(tempModal);\n };\n // 管理视图\n const editView = (view_type: any) => {\n const tempModal = reactive({\n open: true,\n component: 'ViewEditModal',\n compObj: {\n title: view_type == 'personal' ? t('个人视图管理') : t('公共视图管理'),\n data: view_type == 'personal' ? personData.value : publicData.value,\n },\n ok: (ids: any) => {\n if (ids && ids.length > 0) {\n change_view_settings_sort({\n org_id: current_org.id,\n view_settings_ids: ids,\n }).then(() => {\n message.success(t('保存成功'));\n viewRefresh();\n });\n } else {\n message.success(t('保存成功'));\n viewRefresh();\n }\n },\n cancel: (isEdit: any) => {\n if (isEdit) {\n viewRefresh();\n }\n },\n });\n modalBox(tempModal);\n };\n // 分享视图\n const handleShare = (record: any) => {\n let url = '';\n const index = window.location.href.indexOf('#');\n if (index !== -1) {\n // 如果找到了 #,则截取它之前的部分\n url = window.location.href.substring(0, index) + '#' + record.uid;\n } else {\n // 如果没有找到 #,则返回原始字符串\n url = window.location.href + '#' + record.uid;\n }\n copyValue({ val: url, message: t('复制成功') });\n };\n // 删除视图\n const handleDelet = (record: any) => {\n Modal.confirm({\n title: () =>\n `${t('确认删除此')}【${record.name}】${record?.user_id ? t('个人视图') : t('公共视图')}?`,\n content: t('视图删除后不可恢复,视图下工作项不受影响,是否确认删除?'),\n icon: () => createVNode(ExclamationCircleOutlined),\n okText: t('确定'),\n onOk() {\n return new Promise(resolve => {\n delete_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n })\n .then(() => {\n viewData.value = viewData.value.filter((item: any) => item.id != record.id);\n handleHashChange(null);\n message.success(t('删除成功'));\n })\n .finally(() => {\n resolve(null);\n });\n }).catch(() => console.log('Oops errors!'));\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onCancel() {},\n });\n };\n const getRequiredConditionObj = () => {\n const page_config = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n const required_condition = page_config.required_condition;\n const required_condition_obj = {};\n if (required_condition) {\n required_condition.forEach((item: any) => {\n const value = requiredConditionStore.value_map[item.key];\n if (value !== undefined && value !== null) {\n required_condition_obj[item.field_name] = value;\n }\n });\n }\n return required_condition_obj;\n };\n // 刷新Count (视图record,uid) => {}\n const refreshCount = (list: any) => {\n const count_search_list = [];\n list.forEach((item: any) => {\n let search_model: any = null;\n let filter_map: any = null;\n let group_condition: any = null;\n let conditions: any = null;\n if (item.data.isShowGeneralFilter) {\n search_model = {};\n filter_map = {};\n group_condition = item.data.group_condition;\n conditions = item.data.conditions;\n } else {\n search_model = item.data.search_model;\n filter_map = item.data.filter_map;\n group_condition = {};\n conditions = [];\n }\n\n count_search_list.push({\n id: item.id,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition,\n conditions,\n isShowGeneralFilter: item.data.isShowGeneralFilter,\n });\n });\n setCount(count_search_list);\n };\n watch(\n () => props.current_num, // 监听保存当前视图\n () => {\n Modal.confirm({\n title: () => t('确定覆盖视图吗?'),\n content: t('当前视图原有的数据会被覆盖'),\n icon: () => createVNode(ExclamationCircleOutlined),\n okText: t('确定'),\n onOk() {\n return new Promise(resolve => {\n viewSubmit({\n updateView: {\n is_submit: [true],\n is_system: [props.currentViewObj.is_system],\n name: props.currentViewObj.name,\n },\n record: props.currentViewObj,\n });\n resolve(null);\n }).catch(() => console.log('Oops errors!'));\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onCancel() {},\n });\n },\n );\n watch(\n () => props.create_num, // 监听另存为\n () => {\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('新建视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'radio',\n name: 'view_type',\n label: t('视图可见范围'),\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: '',\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: null,\n view_type: 'personal',\n is_submit: [true],\n }),\n },\n options: {\n view_type: [\n { name: t('个人视图(仅自己可见)'), value: 'personal' },\n { name: t('公共视图(项目成员均可见)'), value: 'public' },\n ],\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n const viewNameList = viewData.value.map((item: any) => item.name);\n if (viewNameList.includes(data.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n viewSubmit({ updateView: data, record: data });\n resolve(null);\n });\n },\n });\n modalBox(tempModal);\n },\n );\n\n watch(\n () => props.count_num, // 监听刷新当前视图count\n () => {\n refreshCount(viewData.value);\n },\n );\n const handleRequiredConditionChange = (key: string) => {\n const page_config = getPageConfig(props.currentViewObj.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (page_config.required_condition) {\n const item = page_config.required_condition.find((item: any) => item.key === key);\n if (item) {\n viewRefresh();\n }\n }\n };\n onMounted(() => {\n viewRefresh();\n required_condition_event_obj().on('change', handleRequiredConditionChange);\n });\n onUnmounted(() => {\n required_condition_event_obj().off('change', handleRequiredConditionChange);\n });\n // 页面重新进入刷新count\n onActivated(() => {\n refreshCount(viewData.value);\n });\n return {\n props,\n viewKey,\n customStyle,\n columns,\n personData,\n publicData,\n is_auth,\n addView,\n editView,\n customRow,\n changeView,\n handleSubmit,\n handleShare,\n handleDelet,\n appStore,\n };\n },\n});\n</script>\n<style lang=\"less\">\n.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box {\n padding: 0;\n}\n\n.num {\n display: inline-block;\n}\n\n.dropdown {\n display: none;\n}\n\n.table:hover .dropdown {\n display: inline-block;\n}\n\n.table:hover .num {\n display: none;\n}\n</style>\n","<template>\n <a-card :body-style=\"{ padding: 0, height: height + 87 + 'px', overflowY: 'auto' }\">\n <a-collapse\n v-model:activeKey=\"viewKey\"\n :bordered=\"false\"\n class=\"collapses\"\n style=\"background: rgb(255, 255, 255)\"\n >\n <template #expandIcon=\"{ isActive }\">\n <caret-right-outlined :rotate=\"isActive ? 90 : 0\" />\n </template>\n <a-collapse-panel\n :key=\"'1'\"\n :style=\"customStyle\"\n >\n <template #header>\n <span style=\"font-weight: 700\">{{ $t('个人视图') }}</span>\n </template>\n <template #extra>\n <a-tooltip>\n <template #title>{{ $t('个人视图管理') }}</template>\n <setting-outlined\n style=\"margin-right: 10px\"\n @click.stop=\"editView('personal')\"\n />\n </a-tooltip>\n <a-tooltip>\n <template #title>{{ $t('新建个人视图') }}</template>\n <plus-outlined @click.stop=\"addView('personal')\" />\n </a-tooltip>\n </template>\n <a-table\n v-if=\"personData.length > 0\"\n :columns=\"columns\"\n :customRow=\"customRow\"\n :dataSource=\"personData\"\n :pagination=\"false\"\n :showHeader=\"false\"\n :size=\"'small'\"\n >\n <template #bodyCell=\"{ column, record }\">\n <div\n class=\"table\"\n v-if=\"column.dataIndex === 'name'\"\n style=\"width: 100%; cursor: pointer\"\n @click=\"changeView(record)\"\n >\n <a-tooltip\n :title=\"record.name\"\n :color=\"appStore.primaryColor\"\n placement=\"left\"\n :destroyTooltipOnHide=\"true\"\n :overlayStyle=\"{ maxWidth: '200px' }\"\n >\n <div style=\"max-width: 130px; float: left; white-space: nowrap; overflow: hidden\">\n {{ record.name }}\n </div>\n </a-tooltip>\n <span\n class=\"num\"\n style=\"float: right\"\n :style=\"\n currentViewObj.id === record.id ? { color: '#1890ff', fontWeight: 'bold' } : {}\n \"\n >\n {{ record.num }}\n </span>\n <a-dropdown class=\"dropdown\">\n <span\n style=\"float: right; font-weight: 800\"\n @click.stop=\"\"\n >\n · · ·\n </span>\n <template #overlay>\n <a-menu>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleSubmit(record, 'personal')\"\n >\n {{ $t('编辑') }}\n </a>\n </a-menu-item>\n <a-menu-item>\n <a\n href=\"javascript:;\"\n @click=\"handleShare(record)\"\n >\n {{ $t('分享视图') }}\n </a>\n </a-menu-item>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleDelet(record)\"\n >\n {{ $t('删除') }}\n </a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n </template>\n </a-table>\n </a-collapse-panel>\n <a-collapse-panel\n :key=\"'2'\"\n :style=\"customStyle\"\n >\n <template #header>\n <span style=\"font-weight: 700\">{{ $t('公共视图') }}</span>\n </template>\n <template #extra>\n <a-tooltip>\n <template #title>{{ $t('公共视图管理') }}</template>\n <setting-outlined\n style=\"margin-right: 10px\"\n @click.stop=\"editView('public')\"\n />\n </a-tooltip>\n <a-tooltip>\n <template #title>{{ $t('新建公共视图') }}</template>\n <plus-outlined @click.stop=\"addView('public')\" />\n </a-tooltip>\n </template>\n <a-table\n v-if=\"publicData.length > 0\"\n :columns=\"columns\"\n :customRow=\"customRow\"\n :dataSource=\"publicData\"\n :pagination=\"false\"\n :showHeader=\"false\"\n :size=\"'small'\"\n >\n <template #bodyCell=\"{ column, record }\">\n <div\n class=\"table\"\n v-if=\"column.dataIndex === 'name'\"\n style=\"width: 100%; cursor: pointer\"\n @click=\"changeView(record)\"\n >\n <a-tooltip\n :title=\"record.name\"\n :color=\"appStore.primaryColor\"\n placement=\"left\"\n :destroyTooltipOnHide=\"true\"\n :overlayStyle=\"{ maxWidth: '200px' }\"\n >\n <div style=\"max-width: 130px; float: left; white-space: nowrap; overflow: hidden\">\n {{ record.name }}\n </div>\n </a-tooltip>\n <span\n class=\"num\"\n style=\"float: right\"\n :style=\"\n currentViewObj.id === record.id ? { color: '#1890ff', fontWeight: 'bold' } : {}\n \"\n >\n {{ record.num }}\n </span>\n <a-dropdown class=\"dropdown\">\n <span\n style=\"float: right; font-weight: 800\"\n @click.stop=\"\"\n >\n · · ·\n </span>\n <template #overlay>\n <a-menu>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleSubmit(record, 'public')\"\n >\n {{ $t('编辑') }}\n </a>\n </a-menu-item>\n <a-menu-item>\n <a\n href=\"javascript:;\"\n @click=\"handleShare(record)\"\n >\n {{ $t('分享视图') }}\n </a>\n </a-menu-item>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleDelet(record)\"\n >\n {{ $t('删除') }}\n </a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n </template>\n </a-table>\n </a-collapse-panel>\n </a-collapse>\n </a-card>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n createVNode,\n defineComponent,\n onActivated,\n onMounted,\n onUnmounted,\n PropType,\n reactive,\n ref,\n watch,\n} from 'vue';\nimport {\n CaretRightOutlined,\n ExclamationCircleOutlined,\n PlusOutlined,\n SettingOutlined,\n} from '@ant-design/icons-vue';\nimport modalBox from 'liyu-pc-base/components/form-modal/modal-tools';\nimport { message, Modal } from 'ant-design-vue';\nimport { useUserStore } from 'liyu-pc-base/init-plugin';\nimport { useAppStore } from 'liyu-pc-base/init-plugin';\nimport {\n change_view_settings_sort,\n create_view_settings,\n delete_view_settings,\n query_view_settings_list,\n refresh_view_settings_cache,\n set_view_settings_default,\n update_view_settings,\n} from 'liyu-pc-base/api/view-model';\nimport { sourceStore } from 'liyu-pc-base/init-plugin';\nimport { copyValue } from 'liyu-pc-base/utils/function';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\nimport { getPageConfig } from 'liyu-pc-base/components/remotePages/index';\nimport { useI18n } from 'vue-i18n';\nimport { useRequiredConditionStore } from 'liyu-pc-base/init-plugin';\nimport { required_condition_event_obj } from 'liyu-pc-base/init-plugin';\nimport { useEnv } from 'liyu-pc-base/init-plugin';\nimport { CUSTOM_VIEW_DATA_USER } from 'liyu-pc-base/constants';\n\nconst VIEW_SYSTEM_EDIT = 'view_system_edit';\nconst columns = [\n {\n title: '',\n dataIndex: 'name',\n key: 'name',\n },\n];\nexport default defineComponent({\n name: 'ViewManage',\n components: {\n CaretRightOutlined,\n PlusOutlined,\n SettingOutlined,\n },\n props: {\n currentViewObj: {\n type: Object,\n required: true,\n },\n menu_flag: {\n type: String,\n required: true,\n },\n menu_name: {\n type: String,\n required: true,\n },\n countData: {\n type: String,\n required: true,\n },\n create_num: {\n type: Number,\n required: true,\n },\n current_num: {\n type: Number,\n required: true,\n },\n count_num: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n modalType: {\n type: String,\n },\n app_flag: {\n type: String,\n },\n allBaseConfigMap: {\n type: Object,\n required: true,\n },\n searchConfigFields: {\n type: Array as PropType<any[]>,\n required: true,\n },\n },\n emits: ['change'],\n setup(props, { emit }) {\n const env = useEnv();\n const requiredConditionStore = useRequiredConditionStore();\n const userStore = useUserStore();\n const appStore = useAppStore();\n const current_org = userStore.currentOrg;\n const userid = userStore.userid;\n const is_auth = ref(userStore.CHECK_AUTH(VIEW_SYSTEM_EDIT));\n const viewData = ref([]); // 视图数据\n const { t } = useI18n();\n let mergedConfig: any;\n const personData = computed(() => {\n const list = viewData.value\n .filter((item: any) => !!item.user_id && item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n const list1 = viewData.value\n .filter((item: any) => !!item.user_id && !item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n return list.concat(list1);\n }); // 个人视图数据\n const publicData = computed(() => {\n const list = viewData.value\n .filter((item: any) => !item.user_id && item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n const list1 = viewData.value\n .filter((item: any) => !item.user_id && !item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n return list.concat(list1);\n }); // 公共视图数据\n const viewNameList = computed(() => {\n return viewData.value.map((item: any) => {\n return item.name;\n });\n }); // 视图名称列表,用于创建、修改时查重\n const filterConditions = (conditions: any) => {\n const res = [];\n for (const group of conditions) {\n const group_item = [];\n for (const item of group) {\n if (props.allBaseConfigMap[item.field_name]) {\n group_item.push(item);\n }\n }\n if (group_item.length > 0) {\n res.push(group_item);\n }\n }\n return res;\n };\n const filter_search_model = (search_model: any) => {\n const res = {};\n const fieldMap = {};\n if (!search_model) {\n return res;\n }\n if (props.searchConfigFields?.length) {\n for (const item of props.searchConfigFields) {\n fieldMap[item.name] = item;\n }\n }\n for (const key of Object.keys(search_model)) {\n if (fieldMap[key]) {\n res[key] = search_model[key];\n }\n }\n return res;\n };\n const fetchData = async ({\n id,\n search_model,\n filter_map,\n sort_fields,\n group_condition,\n conditions,\n isShowGeneralFilter,\n }) => {\n return new Promise(resolve => {\n if (!props.countData && !mergedConfig?.countData) {\n console.error('无count接口');\n resolve(null);\n }\n const obj: any = {\n org_id: current_org.id,\n ...filter_search_model(search_model || {}),\n ...filter_map,\n sort_fields: sort_fields,\n };\n if (isShowGeneralFilter) {\n obj.group_condition = group_condition;\n obj.conditions = filterConditions(conditions);\n }\n obj.required_condition = getRequiredConditionObj();\n let db_alias = null;\n const page_config = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (page_config.get_db_alias) {\n db_alias = page_config.get_db_alias();\n }\n obj.db_alias = db_alias;\n getApiData(obj, mergedConfig?.countData ? mergedConfig.countData : props.countData)\n .then((res: any) => {\n viewData.value.forEach((item: any) => {\n if (item.id == id) {\n item.num = res;\n }\n });\n resolve(null);\n })\n .catch(error => {\n console.log('error', error);\n message.error(t('获取数据失败, 请刷新页面'));\n });\n });\n };\n const setCount = async (list: any) => {\n for (const item of list) {\n try {\n await fetchData(item);\n } catch (error) {\n console.log('error', error);\n message.error(t('获取数据失败, 请刷新页面'));\n }\n }\n };\n // 查询视图、刷新count\n const viewRefresh = async () => {\n const res = await getApiData(\n {\n org_id: current_org.id,\n user_id: userid,\n view_project__flag: env.VITE_APP_VIEW_PROJECT_FLAG,\n view_menu__flag: props.modalType,\n history_id: null,\n sort_fields: ['sort', 'create_time'],\n is_cache: false,\n },\n '/view/get_view_settings_for_user',\n );\n mergedConfig = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (mergedConfig?.isView === false) {\n window.location.hash = '';\n emit('change', null, {}, true, true);\n return;\n }\n requiredConditionStore.set_required_condition(\n props.modalType,\n mergedConfig.required_condition,\n );\n viewData.value.length = 0;\n let list: any = [];\n const count_search_list: any = [];\n if (res && res.system_user_datas && res.system_user_datas.length > 0) {\n list = list.concat(res.system_user_datas);\n }\n if (res && res.system_public_datas && res.system_public_datas.length > 0) {\n list = list.concat(res.system_public_datas);\n }\n if (res && res.public_datas && res.public_datas.length > 0) {\n list = list.concat(res.public_datas);\n }\n if (res && res.user_datas && res.user_datas.length > 0) {\n list = list.concat(res.user_datas);\n }\n list.forEach((item: any) => {\n let search_model: any = null;\n let filter_map: any = null;\n let group_condition: any = null;\n let conditions: any = null;\n if (item.data.isShowGeneralFilter) {\n search_model = {};\n filter_map = {};\n group_condition = item.data.group_condition;\n conditions = item.data.conditions;\n } else {\n search_model = item.data.search_model;\n filter_map = item.data.filter_map;\n group_condition = {};\n conditions = [];\n }\n viewData.value.push({\n ...item,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition: group_condition,\n conditions: conditions,\n });\n count_search_list.push({\n id: item.id,\n isShowGeneralFilter: item.data.isShowGeneralFilter,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition,\n conditions,\n });\n });\n if (count_search_list.length > 0) {\n setCount(count_search_list);\n }\n handleHashChange(null);\n };\n // 根据hash选定当前视图数据 event返回(视图数据,是否刷新页面,是否可自我保存)\n const handleHashChange = (uid: any) => {\n let hash = null;\n if (uid) {\n hash = uid;\n } else if (window.location.hash) {\n hash = window.location.hash.substring(1); // 去掉 # 符号\n }\n if (hash) {\n // 分享的视图链接打开\n const list = viewData.value.filter((item: any) => item.uid == hash);\n if (list && list.length > 0) {\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n } else {\n query_view_settings_list({\n org_id: current_org.id,\n conditions: [\n [\n {\n field_name: 'is_active',\n operator: 'in',\n value: [true],\n format: 'choices',\n class_name: 'bool',\n },\n {\n field_name: 'view_menu__flag',\n operator: 'eq',\n value: [props.menu_flag],\n format: 'input',\n class_name: 'str',\n },\n {\n field_name: 'uid',\n operator: 'eq',\n value: [hash],\n format: 'input',\n class_name: 'str',\n },\n ],\n ],\n }).then((res: any) => {\n if (res && res.data && res.data.length > 0) {\n emit(\n 'change',\n null,\n {\n ...res.data[0],\n ...res.data[0].data,\n },\n true,\n false,\n );\n } else {\n const list = viewData.value.filter((item: any) => !item.user_id && item.is_default);\n if (list && list.length > 0) {\n window.location.hash = list[0].uid;\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n return;\n }\n let obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => !item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n const obj = {\n uid: null,\n view_menu__flag: props.menu_flag,\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n };\n emit('change', null, obj, true, false);\n window.location.hash = '';\n }\n }\n }\n });\n }\n } else {\n let current_uid = '';\n if (sourceStore().get(CUSTOM_VIEW_DATA_USER)) {\n current_uid = sourceStore().get(CUSTOM_VIEW_DATA_USER)?.[props.menu_flag]; // 菜单当前视图uid\n }\n if (current_uid) {\n window.location.hash = current_uid;\n handleHashChange(current_uid);\n } else {\n // 优先选择非系统视图的默认视图\n const list = viewData.value.filter(\n (item: any) => !item.user_id && item.is_default && !item.is_system,\n );\n if (list && list.length > 0) {\n window.location.hash = list[0].uid;\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n return;\n }\n // 其次选择系统视图默认视图(多个默认选择第一个)\n const list_is_system = viewData.value.filter(\n (item: any) => !item.user_id && item.is_default && item.is_system,\n );\n if (list_is_system && list_is_system.length > 0) {\n window.location.hash = list_is_system[0].uid;\n emit('change', null, { ...list_is_system[0], ...list_is_system[0].data }, true, true);\n return;\n }\n let obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => !item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n window.location.hash = '';\n const obj = {\n uid: null,\n view_menu__flag: props.menu_flag,\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n };\n emit('change', null, obj, true, false);\n }\n }\n }\n }\n };\n const viewKey = ref(['1', '2']); // 视图数据展开控制key\n const customStyle =\n 'background: #ffffff;border-radius: 4px;margin-bottom: 2px;border: 0;overflow: hidden;';\n const customRow = (record: any) => {\n return props.currentViewObj && record && record.id === props.currentViewObj.id\n ? { style: { backgroundColor: '#ddf1ff' } }\n : { style: {} };\n };\n // 切换视图\n const changeView = (record: any) => {\n window.location.hash = record.uid;\n handleHashChange(record.uid);\n refreshCount([record]);\n };\n const process_default_search_for_view = (data: any) => {\n const res = [];\n for (const gropu of data) {\n const group_item = [];\n for (const item of gropu) {\n group_item.push({\n field_name: item.field_name,\n format: item.format,\n operator: item.operator,\n class_name: item.class_name,\n value: item.value,\n });\n }\n res.push(group_item);\n }\n return res;\n };\n // 保存修改视图\n const viewSubmit = ({ updateView, record }) => {\n if (record.name != updateView.name && viewNameList.value.includes(updateView.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n if (record?.id) {\n const list = viewData.value.filter((item: any) => record?.id == item.id);\n if (updateView.is_submit?.[0]) {\n const view = {\n ...list[0].data,\n search_model: { ...props.currentViewObj.search_model, current: 1 },\n filter_map: props.currentViewObj.filter_map,\n sort_fields: props.currentViewObj.sort_fields,\n filtered_value: props.currentViewObj.filtered_value,\n sort_orders: props.currentViewObj.sort_orders,\n column: props.currentViewObj.column,\n isShowGeneralFilter: props.currentViewObj.isShowGeneralFilter,\n conditions: props.currentViewObj.conditions,\n group_condition: props.currentViewObj.group_condition,\n group_record: props.currentViewObj.group_record,\n default_search_condition_config_list: process_default_search_for_view(\n props.currentViewObj.default_search_condition_config_list,\n ),\n };\n delete view.is_system; // 存储时不记录is_system,防止后端直接修改,前端不起效\n update_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n is_system: updateView.is_system?.[0],\n name: updateView.name,\n data: JSON.stringify(view),\n }).then((res: any) => {\n if (updateView.is_default?.[0]) {\n set_view_settings_default({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n });\n } else {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n }\n });\n } else {\n update_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n is_system: updateView.is_system?.[0],\n name: updateView.name,\n }).then((res: any) => {\n if (updateView.is_default?.[0]) {\n set_view_settings_default({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n });\n } else {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n }\n });\n }\n } else {\n let view: any = {};\n if (updateView.is_submit?.[0]) {\n view = {\n search_model: { ...props.currentViewObj.search_model, current: 1 },\n filter_map: props.currentViewObj.filter_map,\n sort_fields: props.currentViewObj.sort_fields,\n filtered_value: props.currentViewObj.filtered_value,\n sort_orders: props.currentViewObj.sort_orders,\n column: props.currentViewObj.column,\n isShowGeneralFilter: props.currentViewObj.isShowGeneralFilter,\n conditions: props.currentViewObj.conditions,\n group_condition: props.currentViewObj.group_condition,\n group_record: props.currentViewObj.group_record,\n default_search_condition_config_list: process_default_search_for_view(\n props.currentViewObj.default_search_condition_config_list,\n ),\n };\n delete view.is_system; // 存储时不记录is_system,防止后端直接修改,前端不起效\n } else {\n view = {\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n isShowGeneralFilter: null,\n conditions: [],\n group_condition: {},\n group_record: {},\n };\n }\n create_view_settings({\n org_id: current_org.id,\n user_id: updateView.view_type == 'personal' ? userid : null,\n name: updateView.name,\n view_project__flag: env.VITE_APP_VIEW_PROJECT_FLAG,\n view_menu__flag: props.menu_flag,\n view_menu__name: props.menu_name,\n is_system: false,\n data: JSON.stringify(view),\n }).then((res: any) => {\n emit('change', null, { ...res, ...res.data }, true, true);\n if (res.id) {\n viewData.value = viewData.value.concat([\n {\n ...res,\n },\n ]);\n setCount([\n {\n id: res.id,\n search_model: view.search_model,\n filter_map: view.filter_map,\n sort_fields: view.sort_fields,\n group_condition: view.group_condition,\n conditions: view.conditions,\n isShowGeneralFilter: view.isShowGeneralFilter,\n },\n ]);\n window.location.hash = res.uid;\n handleHashChange(res.uid);\n }\n });\n }\n };\n // 视图编辑按钮\n const handleSubmit = (record: any, view_type: string) => {\n let is_submit: any = [false];\n if (props.currentViewObj.id == record.id) {\n is_submit = [true];\n }\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('编辑视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'checkbox',\n name: 'is_submit',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: record.name,\n is_submit: is_submit,\n is_default: [record?.is_default ? record?.is_default : false],\n is_system: [record?.is_system ? record?.is_system : false],\n }),\n },\n options: {\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n is_default: [\n {\n name: t('设为默认视图'),\n value: true,\n },\n ],\n is_system: [\n {\n name: t('设为系统视图'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n viewSubmit({ updateView: data, record: record });\n resolve(null);\n });\n },\n });\n if (view_type == 'public') {\n tempModal.form.fields.push({\n type: 'checkbox',\n name: 'is_default',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n });\n if (is_auth.value) {\n tempModal.form.fields.push({\n type: 'checkbox',\n name: 'is_system',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n });\n }\n }\n modalBox(tempModal);\n };\n // 添加视图\n const addView = (view_type: any) => {\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('新建视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'radio',\n name: 'view_type',\n label: t('视图可见范围'),\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: '',\n placeholder: '',\n },\n {\n type: 'checkbox',\n name: 'is_submit',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: null,\n view_type: view_type,\n is_submit: [true],\n }),\n },\n options: {\n view_type: [\n { name: t('个人视图(仅自己可见)'), value: 'personal' },\n { name: t('公共视图(项目成员均可见)'), value: 'public' },\n ],\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n if (viewNameList.value.includes(data.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n viewSubmit({ updateView: data, record: data });\n resolve(null);\n });\n },\n });\n modalBox(tempModal);\n };\n // 管理视图\n const editView = (view_type: any) => {\n const tempModal = reactive({\n open: true,\n component: 'ViewEditModal',\n compObj: {\n title: view_type == 'personal' ? t('个人视图管理') : t('公共视图管理'),\n data: view_type == 'personal' ? personData.value : publicData.value,\n },\n ok: (ids: any) => {\n if (ids && ids.length > 0) {\n change_view_settings_sort({\n org_id: current_org.id,\n view_settings_ids: ids,\n }).then(() => {\n message.success(t('保存成功'));\n viewRefresh();\n });\n } else {\n message.success(t('保存成功'));\n viewRefresh();\n }\n },\n cancel: (isEdit: any) => {\n if (isEdit) {\n viewRefresh();\n }\n },\n });\n modalBox(tempModal);\n };\n // 分享视图\n const handleShare = (record: any) => {\n let url = '';\n const index = window.location.href.indexOf('#');\n if (index !== -1) {\n // 如果找到了 #,则截取它之前的部分\n url = window.location.href.substring(0, index) + '#' + record.uid;\n } else {\n // 如果没有找到 #,则返回原始字符串\n url = window.location.href + '#' + record.uid;\n }\n copyValue({ val: url, message: t('复制成功') });\n };\n // 删除视图\n const handleDelet = (record: any) => {\n Modal.confirm({\n title: () =>\n `${t('确认删除此')}【${record.name}】${record?.user_id ? t('个人视图') : t('公共视图')}?`,\n content: t('视图删除后不可恢复,视图下工作项不受影响,是否确认删除?'),\n icon: () => createVNode(ExclamationCircleOutlined),\n okText: t('确定'),\n onOk() {\n return new Promise(resolve => {\n delete_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n })\n .then(() => {\n viewData.value = viewData.value.filter((item: any) => item.id != record.id);\n handleHashChange(null);\n message.success(t('删除成功'));\n })\n .finally(() => {\n resolve(null);\n });\n }).catch(() => console.log('Oops errors!'));\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onCancel() {},\n });\n };\n const getRequiredConditionObj = () => {\n const page_config = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n const required_condition = page_config.required_condition;\n const required_condition_obj = {};\n if (required_condition) {\n required_condition.forEach((item: any) => {\n const value = requiredConditionStore.value_map[item.key];\n if (value !== undefined && value !== null) {\n required_condition_obj[item.field_name] = value;\n }\n });\n }\n return required_condition_obj;\n };\n // 刷新Count (视图record,uid) => {}\n const refreshCount = (list: any) => {\n const count_search_list = [];\n list.forEach((item: any) => {\n let search_model: any = null;\n let filter_map: any = null;\n let group_condition: any = null;\n let conditions: any = null;\n if (item.data.isShowGeneralFilter) {\n search_model = {};\n filter_map = {};\n group_condition = item.data.group_condition;\n conditions = item.data.conditions;\n } else {\n search_model = item.data.search_model;\n filter_map = item.data.filter_map;\n group_condition = {};\n conditions = [];\n }\n\n count_search_list.push({\n id: item.id,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition,\n conditions,\n isShowGeneralFilter: item.data.isShowGeneralFilter,\n });\n });\n setCount(count_search_list);\n };\n watch(\n () => props.current_num, // 监听保存当前视图\n () => {\n Modal.confirm({\n title: () => t('确定覆盖视图吗?'),\n content: t('当前视图原有的数据会被覆盖'),\n icon: () => createVNode(ExclamationCircleOutlined),\n okText: t('确定'),\n onOk() {\n return new Promise(resolve => {\n viewSubmit({\n updateView: {\n is_submit: [true],\n is_system: [props.currentViewObj.is_system],\n name: props.currentViewObj.name,\n },\n record: props.currentViewObj,\n });\n resolve(null);\n }).catch(() => console.log('Oops errors!'));\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onCancel() {},\n });\n },\n );\n watch(\n () => props.create_num, // 监听另存为\n () => {\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('新建视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'radio',\n name: 'view_type',\n label: t('视图可见范围'),\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: '',\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: null,\n view_type: 'personal',\n is_submit: [true],\n }),\n },\n options: {\n view_type: [\n { name: t('个人视图(仅自己可见)'), value: 'personal' },\n { name: t('公共视图(项目成员均可见)'), value: 'public' },\n ],\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n const viewNameList = viewData.value.map((item: any) => item.name);\n if (viewNameList.includes(data.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n viewSubmit({ updateView: data, record: data });\n resolve(null);\n });\n },\n });\n modalBox(tempModal);\n },\n );\n\n watch(\n () => props.count_num, // 监听刷新当前视图count\n () => {\n refreshCount(viewData.value);\n },\n );\n const handleRequiredConditionChange = (key: string) => {\n const page_config = getPageConfig(props.currentViewObj.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (page_config.required_condition) {\n const item = page_config.required_condition.find((item: any) => item.key === key);\n if (item) {\n viewRefresh();\n }\n }\n };\n onMounted(() => {\n viewRefresh();\n required_condition_event_obj().on('change', handleRequiredConditionChange);\n });\n onUnmounted(() => {\n required_condition_event_obj().off('change', handleRequiredConditionChange);\n });\n // 页面重新进入刷新count\n onActivated(() => {\n refreshCount(viewData.value);\n });\n return {\n props,\n viewKey,\n customStyle,\n columns,\n personData,\n publicData,\n is_auth,\n addView,\n editView,\n customRow,\n changeView,\n handleSubmit,\n handleShare,\n handleDelet,\n appStore,\n };\n },\n});\n</script>\n<style lang=\"less\">\n.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box {\n padding: 0;\n}\n\n.num {\n display: inline-block;\n}\n\n.dropdown {\n display: none;\n}\n\n.table:hover .dropdown {\n display: inline-block;\n}\n\n.table:hover .num {\n display: none;\n}\n</style>\n","<template>\n <a-card :body-style=\"{ padding: 0, height: selectObj.height + 96 + 'px', overflowY: 'auto' }\">\n <view-manage\n :select-obj=\"selectObj\"\n @change=\"change\"\n />\n </a-card>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue';\n// import SideFieldRender from 'liyu-pc-base/components/SideSearchRender/SideFieldRender.vue';\n// import { ReloadOutlined } from '@ant-design/icons-vue';\nimport ViewManage from 'liyu-pc-base/components/SideSearchRender/viewManage.vue';\n\nexport default defineComponent({\n name: 'SideSearchRender',\n components: {\n ViewManage,\n },\n props: {\n selectObj: {\n type: Object,\n required: true,\n },\n },\n emits: ['change'],\n setup(props, { emit }) {\n const change = (data: any, is_refresh: any, is_ownView: any) => {\n emit('change', data, is_refresh, is_ownView);\n };\n return {\n props,\n change,\n };\n },\n});\n</script>\n<style lang=\"less\">\n.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box {\n padding: 0;\n}\n</style>\n","<template>\n <a-card :body-style=\"{ padding: 0, height: selectObj.height + 96 + 'px', overflowY: 'auto' }\">\n <view-manage\n :select-obj=\"selectObj\"\n @change=\"change\"\n />\n </a-card>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue';\n// import SideFieldRender from 'liyu-pc-base/components/SideSearchRender/SideFieldRender.vue';\n// import { ReloadOutlined } from '@ant-design/icons-vue';\nimport ViewManage from 'liyu-pc-base/components/SideSearchRender/viewManage.vue';\n\nexport default defineComponent({\n name: 'SideSearchRender',\n components: {\n ViewManage,\n },\n props: {\n selectObj: {\n type: Object,\n required: true,\n },\n },\n emits: ['change'],\n setup(props, { emit }) {\n const change = (data: any, is_refresh: any, is_ownView: any) => {\n emit('change', data, is_refresh, is_ownView);\n };\n return {\n props,\n change,\n };\n },\n});\n</script>\n<style lang=\"less\">\n.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box {\n padding: 0;\n}\n</style>\n","import { inject, Ref } from 'vue';\nexport const fullLayoutStateSymbol = Symbol('fullLayoutState');\nexport interface FullLayoutState {\n fullLayoutRef: Ref<HTMLElement | null>;\n}\nexport const useFullLayoutState = (): FullLayoutState => {\n const state = inject<FullLayoutState>(fullLayoutStateSymbol);\n return state;\n};\n","<template>\n <div\n ref=\"fullLayoutRef\"\n class=\"full-layout\"\n :style=\"{ '--current-top': currentTop + 'px' }\"\n >\n <slot></slot>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { useAppStore } from 'liyu-pc-base/init-plugin';\nimport { debounce } from 'lodash';\nimport { nextTick, onMounted, onUnmounted, provide, ref, shallowRef, watch } from 'vue';\nimport { FullLayoutState, fullLayoutStateSymbol } from './fullLayoutUtils';\nconst appStore = useAppStore();\nconst fullLayoutRef = shallowRef<HTMLElement | null>(null);\nconst currentTop = ref(0);\n\nprovide<FullLayoutState>(fullLayoutStateSymbol, {\n fullLayoutRef,\n});\nconst syncCurrentTop = () => {\n const layout = fullLayoutRef.value;\n if (layout) {\n const top = layout.getBoundingClientRect().top;\n currentTop.value = top;\n }\n};\nconst syncCurrentTopDebounce = debounce(syncCurrentTop, 100);\nonMounted(() => {\n window.addEventListener('resize', syncCurrentTopDebounce);\n syncCurrentTop();\n});\nonUnmounted(() => {\n window.removeEventListener('resize', syncCurrentTop);\n});\nwatch(\n () => appStore.multiTab,\n () => {\n nextTick(() => {\n syncCurrentTop();\n });\n },\n);\nwatch(\n () => appStore.layout,\n () => {\n nextTick(() => {\n syncCurrentTop();\n });\n },\n);\n</script>\n<style lang=\"less\">\n.full-layout {\n margin: -24px -24px 0px -24px;\n height: calc(100vh - var(--current-top, 0px));\n overflow: auto;\n position: relative;\n}\n</style>\n","<template>\n <div\n ref=\"fullLayoutRef\"\n class=\"full-layout\"\n :style=\"{ '--current-top': currentTop + 'px' }\"\n >\n <slot></slot>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { useAppStore } from 'liyu-pc-base/init-plugin';\nimport { debounce } from 'lodash';\nimport { nextTick, onMounted, onUnmounted, provide, ref, shallowRef, watch } from 'vue';\nimport { FullLayoutState, fullLayoutStateSymbol } from './fullLayoutUtils';\nconst appStore = useAppStore();\nconst fullLayoutRef = shallowRef<HTMLElement | null>(null);\nconst currentTop = ref(0);\n\nprovide<FullLayoutState>(fullLayoutStateSymbol, {\n fullLayoutRef,\n});\nconst syncCurrentTop = () => {\n const layout = fullLayoutRef.value;\n if (layout) {\n const top = layout.getBoundingClientRect().top;\n currentTop.value = top;\n }\n};\nconst syncCurrentTopDebounce = debounce(syncCurrentTop, 100);\nonMounted(() => {\n window.addEventListener('resize', syncCurrentTopDebounce);\n syncCurrentTop();\n});\nonUnmounted(() => {\n window.removeEventListener('resize', syncCurrentTop);\n});\nwatch(\n () => appStore.multiTab,\n () => {\n nextTick(() => {\n syncCurrentTop();\n });\n },\n);\nwatch(\n () => appStore.layout,\n () => {\n nextTick(() => {\n syncCurrentTop();\n });\n },\n);\n</script>\n<style lang=\"less\">\n.full-layout {\n margin: -24px -24px 0px -24px;\n height: calc(100vh - var(--current-top, 0px));\n overflow: auto;\n position: relative;\n}\n</style>\n","let currentDir = 'auto';\n\n// let currentDir = 'auto'\n\nfunction hasDocument() {\n return typeof document !== 'undefined';\n}\n\nfunction hasWindow() {\n return typeof window !== 'undefined';\n}\n\nexport function getDocumentDir() {\n if (!hasDocument()) {\n return currentDir;\n }\n const direction =\n typeof document.dir !== 'undefined'\n ? document.dir\n : document.getElementsByTagName('html')[0].getAttribute('dir');\n return direction;\n}\n\nexport function setDocumentDir(dir: string) {\n // export function setDocumentDir(dir){\n if (!hasDocument) {\n currentDir = dir;\n return;\n }\n\n const html = document.getElementsByTagName('html')[0];\n html.setAttribute('dir', dir);\n}\n\nexport function addWindowEventListener(event: string, callback: () => void) {\n if (!hasWindow) {\n callback();\n return;\n }\n window.addEventListener(event, callback);\n}\n\nexport function removeWindowEventListener(event: string, callback: () => void) {\n if (!hasWindow) {\n return;\n }\n window.removeEventListener(event, callback);\n}\n","export type LayoutItem = {\n i: string;\n x?: number | string;\n y?: number | string;\n h: number | string;\n w: number | string;\n top_i?: string;\n left_i?: string;\n minW?: number;\n minH?: number;\n maxW?: number;\n maxH?: number;\n static?: boolean;\n moved?: boolean;\n isDraggable?: boolean;\n isResizable?: boolean;\n};\nexport type Layout = Array<LayoutItem>;\n\nconst getNum = (v: number | string): number => (typeof v === 'number' ? v : parseFloat(v) || 0);\n\nconst isAbsoluteValue = (v: number | string): boolean =>\n typeof v === 'string' &&\n (v.includes('px') || v.includes('calc') || v.includes('grow') || v.includes('%'));\n\n/**\n * Return the bottom coordinate of the layout.\n *\n * @param {Array} layout Layout array.\n * @return {Number} Bottom coordinate.\n */\nexport function bottom(layout: Layout): number {\n let max = 0;\n for (let i = 0, len = layout.length; i < len; i++) {\n const l = layout[i];\n const valY = l.y ?? 0;\n const valH = l.h ?? 0;\n const bottomY = getNum(valY) + getNum(valH);\n if (bottomY > max) max = bottomY;\n }\n return max;\n}\n\n// Fast path to cloning, since this is monomorphic\nexport function cloneLayoutItem(layoutItem: LayoutItem): LayoutItem {\n return JSON.parse(JSON.stringify(layoutItem));\n}\n\nexport function cloneLayout(layout: Layout): Layout {\n const newLayout = Array(layout.length);\n for (let i = 0, len = layout.length; i < len; i++) {\n newLayout[i] = cloneLayoutItem(layout[i]);\n }\n return newLayout;\n}\n\n/**\n * Given two layoutitems, check if they collide.\n *\n * @return {Boolean} True if colliding.\n */\nexport function collides(l1: LayoutItem, l2: LayoutItem): boolean {\n if (l1 === l2) return false; // same element\n const x1 = getNum(l1.x),\n y1 = getNum(l1.y),\n w1 = getNum(l1.w),\n h1 = getNum(l1.h);\n const x2 = getNum(l2.x),\n y2 = getNum(l2.y),\n w2 = getNum(l2.w),\n h2 = getNum(l2.h);\n if (x1 + w1 <= x2) return false; // l1 is left of l2\n if (x1 >= x2 + w2) return false; // l1 is right of l2\n if (y1 + h1 <= y2) return false; // l1 is above l2\n if (y1 >= y2 + h2) return false; // l1 is below l2\n return true; // boxes overlap\n}\n\n/**\n * Given a layout, compact it. This involves going down each y coordinate and removing gaps\n * between items.\n *\n * @param {Array} layout Layout.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} Compacted Layout.\n */\nexport function compact(layout: Layout, verticalCompact: boolean): Layout {\n const compareWith = getStatics(layout);\n const sorted = sortLayoutItemsByRowCol(layout);\n const out = Array(layout.length);\n\n for (let i = 0, len = sorted.length; i < len; i++) {\n let l = sorted[i];\n\n if (!l.static) {\n l = compactItem(compareWith, l, verticalCompact);\n compareWith.push(l);\n }\n\n out[layout.indexOf(l)] = l;\n l.moved = false;\n }\n\n return out;\n}\n\n/**\n * Compact an item in the layout.\n */\nexport function compactItem(\n compareWith: Layout,\n l: LayoutItem,\n verticalCompact: boolean,\n): LayoutItem {\n if (verticalCompact && !isAbsoluteValue(l.y) && l.top_i === undefined && l.left_i === undefined) {\n while (getNum(l.y) > 0 && !getFirstCollision(compareWith, l)) {\n l.y = getNum(l.y) - 1;\n }\n }\n\n let collides = {} as LayoutItem | void;\n while ((collides = getFirstCollision(compareWith, l))) {\n if (isAbsoluteValue(l.y) || l.top_i !== undefined || l.left_i !== undefined) break;\n l.y = getNum(collides.y) + getNum(collides.h);\n }\n return l;\n}\n\n/**\n * Given a layout, make sure all elements fit within its bounds.\n *\n * @param {Array} layout Layout array.\n * @param {Number} bounds Number of columns.\n */\nexport function correctBounds(layout: Layout, bounds: { cols: number }): Layout {\n const collidesWith = getStatics(layout);\n for (let i = 0, len = layout.length; i < len; i++) {\n const l = layout[i];\n const lx = getNum(l.x);\n const lw = getNum(l.w);\n\n if (\n lx + lw > bounds.cols &&\n !isAbsoluteValue(l.x) &&\n !isAbsoluteValue(l.w) &&\n l.left_i === undefined\n ) {\n l.x = bounds.cols - lw;\n }\n if (lx < 0 && !isAbsoluteValue(l.x) && l.left_i === undefined) {\n l.x = 0;\n l.w = bounds.cols;\n }\n if (!l.static) collidesWith.push(l);\n else {\n while (getFirstCollision(collidesWith, l)) {\n if (isAbsoluteValue(l.y) || l.top_i !== undefined || l.left_i !== undefined) break;\n l.y = getNum(l.y) + 1;\n }\n }\n }\n return layout;\n}\n\n/**\n * Get a layout item by ID. Used so we can override later on if necessary.\n *\n * @param {Array} layout Layout array.\n * @param {String} id ID\n * @return {LayoutItem} Item at ID.\n */\nexport function getLayoutItem(layout: Layout, id: string): LayoutItem | undefined {\n for (let i = 0, len = layout.length; i < len; i++) {\n if (layout[i].i === id) return layout[i];\n }\n}\n\n/**\n * Returns the first item this layout collides with.\n * It doesn't appear to matter which order we approach this from, although\n * perhaps that is the wrong thing to do.\n *\n * @param {Object} layoutItem Layout item.\n * @return {Object|undefined} A colliding layout item, or undefined.\n */\nexport function getFirstCollision(layout: Layout, layoutItem: LayoutItem): LayoutItem | void {\n for (let i = 0, len = layout.length; i < len; i++) {\n if (collides(layout[i], layoutItem)) return layout[i];\n }\n}\n\nexport function getAllCollisions(layout: Layout, layoutItem: LayoutItem): Layout {\n return layout.filter(l => collides(l, layoutItem));\n}\n\n/**\n * Get all static elements.\n * @param {Array} layout Array of layout objects.\n * @return {Array} Array of static layout items..\n */\nexport function getStatics(layout: Layout): Layout {\n return layout.filter(l => l.static);\n}\n\n/**\n * Move an element. Responsible for doing cascading movements of other elements.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} l element to move.\n * @param {Number} [x] X position in grid units.\n * @param {Number} [y] Y position in grid units.\n * @param {Boolean} [isUserAction] If true, designates that the item we're moving is\n * being dragged/resized by th euser.\n */\nexport function moveElement(\n layout: Layout,\n l: LayoutItem,\n x: number | void,\n y: number,\n isUserAction: boolean,\n preventCollision = false,\n) {\n if (l.static) return layout;\n\n const oldX = l.x;\n const oldY = l.y;\n\n const movingUp = y && getNum(l.y) > y;\n if (typeof x === 'number') l.x = x;\n if (typeof y === 'number') l.y = y;\n l.moved = true;\n\n let sorted = sortLayoutItemsByRowCol(layout);\n if (movingUp) sorted = sorted.reverse();\n const collisions = getAllCollisions(sorted, l);\n\n if (preventCollision && collisions.length) {\n l.x = oldX;\n l.y = oldY;\n l.moved = false;\n return layout;\n }\n\n for (let i = 0, len = collisions.length; i < len; i++) {\n const collision = collisions[i];\n if (collision.moved) continue;\n if (\n getNum(l.y) > getNum(collision.y) &&\n getNum(l.y) - getNum(collision.y) > getNum(collision.h) / 4\n )\n continue;\n\n if (collision.static) {\n layout = moveElementAwayFromCollision(layout, collision, l, isUserAction);\n } else {\n layout = moveElementAwayFromCollision(layout, l, collision, isUserAction);\n }\n }\n\n return layout;\n}\n\n/**\n * This is where the magic needs to happen - given a collision, move an element away from the collision.\n * We attempt to move it up if there's room, otherwise it goes below.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} collidesWith Layout item we're colliding with.\n * @param {LayoutItem} itemToMove Layout item we're moving.\n * @param {Boolean} [isUserAction] If true, designates that the item we're moving is being dragged/resized\n * by the user.\n */\nexport function moveElementAwayFromCollision(\n layout: Layout,\n collidesWith: LayoutItem,\n itemToMove: LayoutItem,\n isUserAction: boolean,\n) {\n const preventCollision = false;\n if (isUserAction) {\n const fakeItem: LayoutItem = {\n x: itemToMove.x,\n y: itemToMove.y,\n w: itemToMove.w,\n h: itemToMove.h,\n i: '-1',\n };\n fakeItem.y = Math.max(getNum(collidesWith.y) - getNum(itemToMove.h), 0);\n if (!getFirstCollision(layout, fakeItem)) {\n return moveElement(layout, itemToMove, undefined, fakeItem.y as number, preventCollision);\n }\n }\n\n return moveElement(\n layout,\n itemToMove,\n undefined,\n (getNum(itemToMove.y) + 1) as number,\n preventCollision,\n );\n}\n\nexport function setTransform(\n top: number | string,\n left: number | string,\n width: number | string,\n height: number | string,\n) {\n const leftStr = typeof left === 'number' ? left + 'px' : left;\n const topStr = typeof top === 'number' ? (top < 0 ? 0 : top) + 'px' : top;\n const translate = 'translate3d(' + leftStr + ',' + topStr + ', 0)';\n return {\n transform: translate,\n WebkitTransform: translate,\n MozTransform: translate,\n msTransform: translate,\n OTransform: translate,\n width: typeof width === 'number' ? width + 'px' : width,\n height: typeof height === 'number' ? height + 'px' : height,\n position: 'absolute' as const,\n };\n}\n\nexport function setTransformRtl(\n top: number | string,\n right: number | string,\n width: number | string,\n height: number | string,\n) {\n const rightStr = typeof right === 'number' ? right * -1 + 'px' : 'calc(' + right + ' * -1)';\n const topStr = typeof top === 'number' ? (top < 0 ? 0 : top) + 'px' : top;\n const translate = 'translate3d(' + rightStr + ',' + topStr + ', 0)';\n return {\n transform: translate,\n WebkitTransform: translate,\n MozTransform: translate,\n msTransform: translate,\n OTransform: translate,\n width: typeof width === 'number' ? width + 'px' : width,\n height: typeof height === 'number' ? height + 'px' : height,\n position: 'absolute' as const,\n };\n}\n\nexport function setTopLeft(\n top: number | string,\n left: number | string,\n width: number | string,\n height: number | string,\n) {\n return {\n top: typeof top === 'number' ? top + 'px' : top,\n left: typeof left === 'number' ? left + 'px' : left,\n width: typeof width === 'number' ? width + 'px' : width,\n height: typeof height === 'number' ? height + 'px' : height,\n position: 'absolute' as const,\n };\n}\n\nexport function setTopRight(\n top: number | string,\n right: number | string,\n width: number | string,\n height: number | string,\n) {\n return {\n top: typeof top === 'number' ? top + 'px' : top,\n right: typeof right === 'number' ? right + 'px' : right,\n width: typeof width === 'number' ? width + 'px' : width,\n height: typeof height === 'number' ? height + 'px' : height,\n position: 'absolute' as const,\n };\n}\n\nexport function sortLayoutItemsByRowCol(layout: Layout): Layout {\n return [...layout].sort((a, b) => {\n const ax = getNum(a.x);\n const ay = getNum(a.y);\n const bx = getNum(b.x);\n const by = getNum(b.y);\n\n if (ay === by && ax === bx) {\n return 0;\n }\n\n if (ay > by || (ay === by && ax > bx)) {\n return 1;\n }\n\n return -1;\n });\n}\n\nexport function validateLayout(layout: Layout, contextName = 'Layout'): void {\n const subProps = ['x', 'y', 'w', 'h'];\n if (!Array.isArray(layout)) throw new Error(contextName + ' must be an array!');\n for (let i = 0, len = layout.length; i < len; i++) {\n const item = layout[i];\n for (let j = 0; j < subProps.length; j++) {\n const key = subProps[j] as keyof LayoutItem;\n\n if (key === 'y' && 'top_i' in item) continue;\n if (key === 'x' && 'left_i' in item) continue;\n const val = item[key];\n if (typeof val !== 'number' && typeof val !== 'string') {\n throw new Error(\n 'VueGridLayout: ' +\n contextName +\n '[' +\n i +\n '].' +\n subProps[j] +\n ' must be a number or string!',\n );\n }\n }\n if (item.static !== undefined && typeof item.static !== 'boolean') {\n throw new Error('VueGridLayout: ' + contextName + '[' + i + '].static must be a boolean!');\n }\n }\n}\n","import { cloneLayout, compact, correctBounds } from './utils';\n\n/**\n * Given breakpoints, return an array of breakpoints sorted by width. This is usually\n * e.g. ['xxs', 'xs', 'sm', ...]\n *\n * @param {Object} breakpoints Key/value pair of breakpoint names to widths.\n * @return {Array} Sorted breakpoints.\n */\nexport function sortBreakpoints(breakpoints: any) {\n const keys = Object.keys(breakpoints);\n return keys.sort((a, b) => {\n return breakpoints[a] - breakpoints[b];\n });\n}\n\n/**\n * Given a width, find the highest breakpoint that matches is valid for it (width > breakpoint).\n *\n * @param {Object} breakpoints Breakpoints object (e.g. {lg: 1200, md: 960, ...})\n * @param {Number} width Screen width.\n * @return {String} Highest breakpoint that is less than width.\n */\nexport function getBreakpointFromWidth(breakpoints: any, width: number) {\n const sorted = sortBreakpoints(breakpoints);\n let matching = sorted[0];\n for (let i = 1, len = sorted.length; i < len; i++) {\n const breakpointName = sorted[i];\n if (width > breakpoints[breakpointName]) matching = breakpointName;\n }\n return matching;\n}\n\n/**\n * Given a breakpoint, get the # of cols set for it.\n * @param {String} breakpoint Breakpoint name.\n * @param {Object} cols Map of breakpoints to cols.\n * @return {Number} Number of cols.\n */\nexport function getColsFromBreakpoint(breakpoint: string, cols: any): number {\n if (!cols[breakpoint]) {\n throw new Error(\n 'ResponsiveGridLayout: `cols` entry for breakpoint ' + breakpoint + ' is missing!',\n );\n }\n return cols[breakpoint];\n}\n\n/**\n * Given existing layouts and a new breakpoint, find or generate a new layout.\n *\n * This finds the layout above the new one and generates from it, if it exists.\n *\n * @param {Array} orgLayout Original layout.\n * @param {Object} layouts Existing layouts.\n * @param {Array} breakpoints All breakpoints.\n * @param {String} breakpoint New breakpoint.\n * @param {String} breakpoint Last breakpoint (for fallback).\n * @param {Number} cols Column count at new breakpoint.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} New layout.\n */\nexport function findOrGenerateResponsiveLayout(\n orgLayout: any[],\n layouts: any,\n breakpoints: any[],\n breakpoint: string,\n lastBreakpoint: number,\n cols: number,\n verticalCompact: boolean,\n) {\n // If it already exists, just return it.\n if (layouts[breakpoint]) return cloneLayout(layouts[breakpoint]);\n // Find or generate the next layout\n let layout = orgLayout;\n\n const breakpointsSorted = sortBreakpoints(breakpoints);\n const breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));\n for (let i = 0, len = breakpointsAbove.length; i < len; i++) {\n const b = breakpointsAbove[i];\n if (layouts[b]) {\n layout = layouts[b];\n break;\n }\n }\n layout = cloneLayout(layout || []); // clone layout so we don't modify existing items\n return compact(correctBounds(layout, { cols }), verticalCompact);\n}\n\nexport function generateResponsiveLayout(\n layout: any,\n breakpoints: any,\n breakpoint: any,\n lastBreakpoint: any,\n cols: any,\n verticalCompact: any,\n) {\n // If it already exists, just return it.\n /* if (layouts[breakpoint]) return cloneLayout(layouts[breakpoint]);\n // Find or generate the next layout\n let layout = layouts[lastBreakpoint];*/\n /* const breakpointsSorted = sortBreakpoints(breakpoints);\nconst breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));\nfor (let i = 0, len = breakpointsAbove.length; i < len; i++) {\n const b = breakpointsAbove[i];\n if (layouts[b]) {\n layout = layouts[b];\n break;\n }\n}*/\n layout = cloneLayout(layout || []); // clone layout so we don't modify existing items\n return compact(correctBounds(layout, { cols }), verticalCompact);\n}\n","// Get from offsetParent\nexport function offsetXYFromParentOf(evt: MouseEvent): { x: number; y: number } {\n const offsetParent = (evt.target as HTMLElement).offsetParent || document.body;\n const offsetParentRect =\n offsetParent === document.body ? { left: 0, top: 0 } : offsetParent.getBoundingClientRect();\n\n const x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;\n const y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;\n\n /* const x = Math.round(evt.clientX + offsetParent.scrollLeft - offsetParentRect.left);\n const y = Math.round(evt.clientY + offsetParent.scrollTop - offsetParentRect.top);*/\n\n return { x, y };\n}\n\n// Get {x, y} positions from event.\nexport function getControlPosition(e: MouseEvent): { x: number; y: number } {\n return offsetXYFromParentOf(e);\n}\n\nfunction isNum(num: any): boolean {\n return typeof num === 'number' && !isNaN(num);\n}\n\n// Create an data object exposed by <DraggableCore>'s events\nexport function createCoreData(\n lastX: number,\n lastY: number,\n x: number,\n y: number,\n): { deltaX: number; deltaY: number; lastX: number; lastY: number; x: number; y: number } {\n // State changes are often (but not always!) async. We want the latest value.\n const isStart = !isNum(lastX);\n\n if (isStart) {\n // If this is our first move, use the x and y as last coords.\n return {\n deltaX: 0,\n deltaY: 0,\n lastX: x,\n lastY: y,\n x,\n y,\n };\n }\n // Otherwise calculate proper values.\n return {\n deltaX: x - lastX,\n deltaY: y - lastY,\n lastX,\n lastY,\n x,\n y,\n };\n}\n","<template>\n <div\n ref=\"item\"\n class=\"vue-grid-item\"\n :class=\"classObj\"\n :style=\"style\"\n >\n <slot></slot>\n <span\n v-if=\"resizableAndNotStatic\"\n ref=\"handle\"\n :class=\"resizableHandleClass\"\n ></span>\n <!--<span v-if=\"draggable\" ref=\"dragHandle\" class=\"vue-draggable-handle\"></span>-->\n </div>\n</template>\n<script setup lang=\"ts\">\nimport interact from 'interactjs';\nimport { computed, getCurrentInstance, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue';\nimport { getDocumentDir } from '../helpers/dom';\nimport { createCoreData, getControlPosition } from '../helpers/draggable-utils';\nimport { setTopLeft, setTopRight, setTransform, setTransformRtl } from '../helpers/utils';\nimport type { Layout, LayoutItem } from '../helpers/utils';\ndefineOptions({\n name: 'GridItem',\n});\n\nconst props = withDefaults(defineProps<LayoutItem & { usePercentages?: boolean }>(), {\n isDraggable: null,\n isResizable: null,\n static: false,\n minH: 1,\n minW: 1,\n maxH: Infinity,\n maxW: Infinity,\n dragIgnoreFrom: 'a, button',\n dragAllowFrom: null,\n resizeIgnoreFrom: 'a, button',\n usePercentages: null,\n});\n\nconst emit = defineEmits<{\n (\n e: 'container-resized',\n i: string | number,\n h: number | string,\n w: number | string,\n height: string,\n width: string,\n ): void;\n (\n e: 'resize',\n i: string | number,\n h: number | string,\n w: number | string,\n height: number,\n width: number,\n ): void;\n (\n e: 'resized',\n i: string | number,\n h: number | string,\n w: number | string,\n height: number,\n width: number,\n ): void;\n (e: 'move', i: string | number, x: number | string, y: number | string): void;\n (e: 'moved', i: string | number, x: number | string, y: number | string): void;\n}>();\n\nconst eventBus = inject<any>('eventBus');\nconst injectedUsePercentages = inject<boolean>('usePercentages', false);\nconst layout = inject<Layout>('layout');\n\nconst item = ref<HTMLElement | null>(null);\nconst handle = ref<HTMLElement | null>(null);\n\nconst cols = ref(1);\nconst containerWidth = ref(100);\nconst containerHeight = ref(100);\nconst rowHeight = ref(10);\nconst margin = ref([10, 10]);\nconst maxRows = ref(Infinity);\nconst draggable = ref<boolean | null>(null);\nconst resizable = ref<boolean | null>(null);\nconst useCssTransforms = ref(true);\nconst isDragging = ref(false);\nconst dragging = ref<any>(null);\nconst isResizing = ref(false);\nconst resizing = ref<any>(null);\nconst lastX = ref(NaN);\nconst lastY = ref(NaN);\nconst lastW = ref(NaN);\nconst lastH = ref(NaN);\nconst style = ref<Record<string, any>>({});\nconst rtl = ref(false);\nconst dragEventSet = ref(false);\nconst resizeEventSet = ref(false);\nconst previousW = ref<number | string | null>(null);\nconst previousH = ref<number | string | null>(null);\nconst previousX = ref<number | string | null>(null);\nconst previousY = ref<number | string | null>(null);\nconst innerX = ref<number | string>(props.x);\nconst innerY = ref<number | string>(props.y);\nconst innerW = ref<number | string>(props.w);\nconst innerH = ref<number | string>(props.h);\nconst interactObj = ref<any>(null);\n\nconst getVal = (v: number | string): number => (typeof v === 'number' ? v : parseFloat(v) || 0);\n\nconst parseUnit = (val: string | number | undefined, pos?: string | number): string => {\n if (val === undefined || val === null) return '0%';\n if (typeof val === 'number') return val + '%';\n if (val.endsWith('%') || val.endsWith('px') || val.includes('calc')) return val;\n if (val === 'grow') {\n if (pos !== undefined) {\n const p = typeof pos === 'number' ? pos + '%' : pos;\n return `calc(100% - ${p})`;\n }\n return '100%';\n }\n return val.includes('%') || val.includes('px') || val.includes('calc') ? val : val + '%';\n};\n\nconst usePercentagesInternal = computed(() => {\n return props.usePercentages !== null ? props.usePercentages : injectedUsePercentages;\n});\n\nconst resizableAndNotStatic = computed(() => {\n return resizable.value && !props.static;\n});\n\nconst draggableOrResizableAndNotStatic = computed(() => {\n return (draggable.value || resizable.value) && !props.static;\n});\n\nconst isAndroid = computed(() => {\n return navigator.userAgent.toLowerCase().indexOf('android') !== -1;\n});\n\nconst renderRtl = computed(() => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n return parent?.isMirrored ? !rtl.value : rtl.value;\n});\n\nconst classObj = computed(() => {\n return {\n 'vue-resizable': resizableAndNotStatic.value,\n static: props.static,\n resizing: isResizing.value,\n 'vue-draggable-dragging': isDragging.value,\n cssTransforms: useCssTransforms.value,\n 'render-rtl': renderRtl.value,\n 'disable-userselect': isDragging.value,\n 'no-touch': isAndroid.value && draggableOrResizableAndNotStatic.value,\n };\n});\n\nconst resizableHandleClass = computed(() => {\n if (renderRtl.value) {\n return 'vue-resizable-handle vue-rtl-resizable-handle';\n }\n return 'vue-resizable-handle';\n});\n\nconst calcColWidth = () => {\n return (containerWidth.value - (margin.value[0] || 10) * (cols.value + 1)) / cols.value;\n};\n\nconst calcPosition = (\n x: number | string,\n y: number | string,\n w: number | string,\n h: number | string,\n) => {\n if (usePercentagesInternal.value) {\n const out: any = {\n width: parseUnit(w, x),\n height: parseUnit(h, y),\n top: parseUnit(y),\n };\n if (renderRtl.value) {\n out.right = parseUnit(x);\n } else {\n out.left = parseUnit(x);\n }\n return out;\n }\n\n const colWidth = calcColWidth();\n let out: any = null;\n const nx = getVal(x);\n const ny = getVal(y);\n const nw = getVal(w);\n const nh = getVal(h);\n\n if (renderRtl.value) {\n out = {\n right:\n typeof x === 'string' && (x.includes('calc') || x.includes('px'))\n ? x\n : Math.round(colWidth * nx + (nx + 1) * margin.value[0]),\n top:\n typeof y === 'string' && (y.includes('calc') || y.includes('px'))\n ? y\n : Math.round(rowHeight.value * ny + (ny + 1) * margin.value[1]),\n width:\n typeof w === 'string' && (w.includes('calc') || w.includes('px'))\n ? w\n : nw === Infinity\n ? nw\n : Math.round(colWidth * nw + Math.max(0, nw - 1) * margin.value[0]),\n height:\n typeof h === 'string' && (h.includes('calc') || h.includes('px'))\n ? h\n : nh === Infinity\n ? nh\n : Math.round(rowHeight.value * nh + Math.max(0, nh - 1) * margin.value[1]),\n };\n } else {\n out = {\n left:\n typeof x === 'string' && (x.includes('calc') || x.includes('px'))\n ? x\n : Math.round(colWidth * nx + (nx + 1) * margin.value[0]),\n top:\n typeof y === 'string' && (y.includes('calc') || y.includes('px'))\n ? y\n : Math.round(rowHeight.value * ny + (ny + 1) * margin.value[1]),\n width:\n typeof w === 'string' && (w.includes('calc') || w.includes('px'))\n ? w\n : nw === Infinity\n ? nw\n : Math.round(colWidth * nw + Math.max(0, nw - 1) * margin.value[0]),\n height:\n typeof h === 'string' && (h.includes('calc') || h.includes('px'))\n ? h\n : nh === Infinity\n ? nh\n : Math.round(rowHeight.value * nh + Math.max(0, nh - 1) * margin.value[1]),\n };\n }\n return out;\n};\n\nconst resolveItemValue = (id: string, prop: 'x' | 'y'): string | number => {\n if (!layout) return 0;\n const item = (layout as any).find((l: any) => l.i === id);\n if (!item) return 0;\n\n if (prop === 'y') {\n if (item.top_i !== undefined && item.top_i !== null) {\n const refItem = (layout as any).find((l: any) => l.i === item.top_i);\n const refY = resolveItemValue(item.top_i, 'y');\n return `calc(${parseUnit(refY)} + ${parseUnit(refItem?.h ?? 0)})`;\n }\n return item.y ?? 0;\n } else {\n if (item.left_i !== undefined && item.left_i !== null) {\n const refItem = (layout as any).find((l: any) => l.i === item.left_i);\n const refX = resolveItemValue(item.left_i, 'x');\n return `calc(${parseUnit(refX)} + ${parseUnit(refItem?.w ?? 0)})`;\n }\n return item.x ?? 0;\n }\n};\n\nconst createStyle = () => {\n if (!usePercentagesInternal.value) {\n const px = getVal(props.x);\n const pw = getVal(props.w);\n if (px + pw > cols.value) {\n innerX.value = 0;\n innerW.value = pw > cols.value ? cols.value : pw;\n } else {\n innerX.value = props.x;\n innerW.value = props.w;\n }\n } else {\n innerX.value = props.x;\n innerW.value = props.w;\n }\n\n const actualX = resolveItemValue(String(props.i), 'x');\n const actualY = resolveItemValue(String(props.i), 'y');\n\n const pos = calcPosition(actualX, actualY, innerW.value, innerH.value);\n if (isDragging.value) {\n pos.top = dragging.value.top;\n if (typeof pos.top === 'number') pos.top += 'px';\n if (renderRtl.value) {\n pos.right = dragging.value.left;\n if (typeof pos.right === 'number') pos.right += 'px';\n } else {\n pos.left = dragging.value.left;\n if (typeof pos.left === 'number') pos.left += 'px';\n }\n }\n if (isResizing.value) {\n pos.width = resizing.value.width;\n if (typeof pos.width === 'number') pos.width += 'px';\n pos.height = resizing.value.height;\n if (typeof pos.height === 'number') pos.height += 'px';\n }\n let s: any = null;\n\n if (useCssTransforms.value && (isDragging.value || isResizing.value)) {\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n if (v.includes('calc')) {\n // Simple heuristic for calc(100% - pos)\n if (v.includes('100%')) {\n const parts = v.split('-');\n if (parts.length > 1) {\n return containerSize - getPx(parts[1].trim().replace(')', ''), containerSize);\n }\n }\n }\n return parseFloat(v) || 0;\n };\n\n const topPx = getPx(pos.top, containerHeight.value);\n const widthPx = getPx(pos.width, containerWidth.value);\n const heightPx = getPx(pos.height, containerHeight.value);\n\n if (renderRtl.value) {\n const rightPx = getPx(pos.right, containerWidth.value);\n s = setTransformRtl(topPx, rightPx, widthPx, heightPx);\n } else {\n const leftPx = getPx(pos.left, containerWidth.value);\n s = setTransform(topPx, leftPx, widthPx, heightPx);\n }\n } else if (useCssTransforms.value && !usePercentagesInternal.value) {\n if (renderRtl.value) {\n s = setTransformRtl(pos.top, pos.right!, pos.width, pos.height);\n } else {\n s = setTransform(pos.top, pos.left!, pos.width, pos.height);\n }\n } else {\n if (renderRtl.value) {\n s = setTopRight(pos.top, pos.right!, pos.width, pos.height);\n } else {\n s = setTopLeft(pos.top, pos.left!, pos.width, pos.height);\n }\n }\n\n for (const key of ['top', 'left', 'right', 'width', 'height']) {\n if (s[key] !== undefined && typeof s[key] === 'number') {\n s[key] += 'px';\n }\n }\n\n style.value = s;\n};\n\nconst emitContainerResized = () => {\n const styleProps: any = {};\n for (const prop of ['width', 'height']) {\n let val = style.value[prop];\n if (typeof val === 'string' && (val.includes('calc') || val.includes('%'))) {\n if (item.value) {\n val = prop === 'width' ? item.value.offsetWidth + 'px' : item.value.offsetHeight + 'px';\n } else {\n return;\n }\n }\n const matches = String(val).match(/^(\\d+(\\.\\d+)?)px$/);\n if (!matches) return;\n styleProps[prop] = matches[1];\n }\n emit('container-resized', props.i, props.h, props.w, styleProps.height, styleProps.width);\n};\n\nconst calcXY = (top: number, left: number) => {\n if (usePercentagesInternal.value) {\n let x = (left / containerWidth.value) * 100;\n let y = (top / containerHeight.value) * 100;\n\n x = Math.max(Math.min(x, 100 - getVal(innerW.value)), 0);\n y = Math.max(Math.min(y, 100 - getVal(innerH.value)), 0);\n return { x, y };\n }\n\n const colWidth = calcColWidth();\n let x = Math.round((left - margin.value[0]) / (colWidth + margin.value[0]));\n let y = Math.round((top - margin.value[1]) / (rowHeight.value + margin.value[1]));\n x = Math.max(Math.min(x, cols.value - getVal(innerW.value)), 0);\n y = Math.max(Math.min(y, maxRows.value - getVal(innerH.value)), 0);\n return { x, y };\n};\n\nconst calcWH = (height: number, width: number, autoSizeFlag = false) => {\n if (usePercentagesInternal.value) {\n let w = (width / containerWidth.value) * 100;\n let h = (height / containerHeight.value) * 100;\n\n w = Math.max(Math.min(w, 100 - getVal(innerX.value)), 0);\n h = Math.max(Math.min(h, 100 - getVal(innerY.value)), 0);\n return { w, h };\n }\n\n const colWidth = calcColWidth();\n let w = Math.round((width + margin.value[0]) / (colWidth + margin.value[0]));\n let h = 0;\n if (!autoSizeFlag) {\n h = Math.round((height + margin.value[1]) / (rowHeight.value + margin.value[1]));\n } else {\n h = Math.ceil((height + margin.value[1]) / (rowHeight.value + margin.value[1]));\n }\n w = Math.max(Math.min(w, cols.value - getVal(innerX.value)), 0);\n h = Math.max(Math.min(h, maxRows.value - getVal(innerY.value)), 0);\n return { w, h };\n};\n\nconst handleDrag = (event: any) => {\n if (props.static) return;\n if (isResizing.value) return;\n const position = getControlPosition(event);\n if (position === null) return;\n const { x, y } = position;\n const newPosition = { top: 0, left: 0 };\n switch (event.type) {\n case 'dragstart': {\n previousX.value = innerX.value;\n previousY.value = innerY.value;\n const parentRect = event.target.offsetParent.getBoundingClientRect();\n const clientRect = event.target.getBoundingClientRect();\n if (renderRtl.value) {\n newPosition.left = (clientRect.right - parentRect.right) * -1;\n } else {\n newPosition.left = clientRect.left - parentRect.left;\n }\n newPosition.top = clientRect.top - parentRect.top;\n dragging.value = newPosition;\n isDragging.value = true;\n break;\n }\n case 'dragend': {\n if (!isDragging.value) return;\n const parentRect = event.target.offsetParent.getBoundingClientRect();\n const clientRect = event.target.getBoundingClientRect();\n if (renderRtl.value) {\n newPosition.left = (clientRect.right - parentRect.right) * -1;\n } else {\n newPosition.left = clientRect.left - parentRect.left;\n }\n newPosition.top = clientRect.top - parentRect.top;\n dragging.value = null;\n isDragging.value = false;\n break;\n }\n case 'dragmove': {\n const coreEvent = createCoreData(lastX.value, lastY.value, x, y);\n if (renderRtl.value) {\n newPosition.left = dragging.value.left - coreEvent.deltaX;\n } else {\n newPosition.left = dragging.value.left + coreEvent.deltaX;\n }\n newPosition.top = dragging.value.top + coreEvent.deltaY;\n dragging.value = newPosition;\n break;\n }\n }\n let pos = calcXY(newPosition.top, newPosition.left);\n lastX.value = x;\n lastY.value = y;\n if (getVal(innerX.value) !== pos.x || getVal(innerY.value) !== pos.y) {\n emit('move', props.i, pos.x, pos.y);\n }\n if (\n event.type === 'dragend' &&\n (getVal(previousX.value!) !== pos.x || getVal(previousY.value!) !== pos.y)\n ) {\n emit('moved', props.i, pos.x, pos.y);\n }\n if (usePercentagesInternal.value) {\n eventBus.emit('dragEvent', {\n eventType: event.type,\n i: props.i,\n x: pos.x,\n y: pos.y,\n h: innerH.value,\n w: innerW.value,\n });\n } else {\n eventBus.emit('dragEvent', {\n eventType: event.type,\n i: props.i,\n x: pos.x,\n y: pos.y,\n h: getVal(innerH.value),\n w: getVal(innerW.value),\n });\n }\n};\n\nconst handleResize = (event: any) => {\n if (props.static) return;\n const position = getControlPosition(event);\n if (position == null) return;\n const { x, y } = position;\n const newSize = { width: 0, height: 0 };\n let posStyle: any = null;\n switch (event.type) {\n case 'resizestart': {\n previousW.value = innerW.value;\n previousH.value = innerH.value;\n posStyle = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);\n\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n return parseFloat(v) || 0;\n };\n\n newSize.width = getPx(posStyle.width, containerWidth.value);\n newSize.height = getPx(posStyle.height, containerHeight.value);\n\n resizing.value = newSize;\n isResizing.value = true;\n break;\n }\n case 'resizemove': {\n const coreEvent = createCoreData(lastW.value, lastH.value, x, y);\n if (renderRtl.value) {\n newSize.width = resizing.value.width - coreEvent.deltaX;\n } else {\n newSize.width = resizing.value.width + coreEvent.deltaX;\n }\n newSize.height = resizing.value.height + coreEvent.deltaY;\n resizing.value = newSize;\n break;\n }\n case 'resizeend': {\n posStyle = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);\n\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n return parseFloat(v) || 0;\n };\n\n newSize.width = getPx(posStyle.width, containerWidth.value);\n newSize.height = getPx(posStyle.height, containerHeight.value);\n\n resizing.value = null;\n isResizing.value = false;\n break;\n }\n }\n const pos = calcWH(newSize.height, newSize.width);\n if (!usePercentagesInternal.value) {\n if (pos.w < props.minW) pos.w = props.minW;\n if (pos.w > props.maxW) pos.w = props.maxW;\n if (pos.h < props.minH) pos.h = props.minH;\n if (pos.h > props.maxH) pos.h = props.maxH;\n if (pos.h < 1) pos.h = 1;\n if (pos.w < 1) pos.w = 1;\n }\n lastW.value = x;\n lastH.value = y;\n if (getVal(innerW.value) !== pos.w || getVal(innerH.value) !== pos.h) {\n emit('resize', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n if (\n event.type === 'resizeend' &&\n (getVal(previousW.value!) !== pos.w || getVal(previousH.value!) !== pos.h)\n ) {\n emit('resized', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n eventBus.emit('resizeEvent', {\n eventType: event.type,\n i: props.i,\n x: getVal(innerX.value),\n y: getVal(innerY.value),\n h: pos.h,\n w: pos.w,\n });\n};\n\nconst tryMakeDraggable = () => {\n if (interactObj.value === null || interactObj.value === undefined) {\n interactObj.value = interact(item.value as any);\n }\n if (draggable.value && !props.static) {\n const opts = {\n ignoreFrom: props.dragIgnoreFrom,\n allowFrom: props.dragAllowFrom,\n };\n interactObj.value.draggable(opts);\n if (!dragEventSet.value) {\n dragEventSet.value = true;\n interactObj.value.on('dragstart dragmove dragend', (event: any) => {\n handleDrag(event);\n });\n }\n } else {\n interactObj.value.draggable({\n enabled: false,\n });\n }\n};\n\nconst tryMakeResizable = () => {\n if (interactObj.value === null || interactObj.value === undefined) {\n interactObj.value = interact(item.value as any);\n }\n if (resizable.value && !props.static) {\n let maximumPx: any;\n let minimumPx: any;\n\n if (usePercentagesInternal.value) {\n maximumPx = {\n width: (props.maxW / 100) * containerWidth.value,\n height: (props.maxH / 100) * containerHeight.value,\n };\n minimumPx = {\n width: (props.minW / 100) * containerWidth.value,\n height: (props.minH / 100) * containerHeight.value,\n };\n } else {\n const maximum = calcPosition(0, 0, props.maxW, props.maxH);\n const minimum = calcPosition(0, 0, props.minW, props.minH);\n maximumPx = {\n width: parseFloat(maximum.width),\n height: parseFloat(maximum.height),\n };\n minimumPx = {\n width: parseFloat(minimum.width),\n height: parseFloat(minimum.height),\n };\n }\n\n const opts = {\n preserveAspectRatio: true,\n edges: {\n left: false,\n right: '.' + resizableHandleClass.value,\n bottom: '.' + resizableHandleClass.value,\n top: false,\n },\n ignoreFrom: props.resizeIgnoreFrom,\n restrictSize: {\n min: minimumPx,\n max: maximumPx,\n },\n };\n interactObj.value.resizable(opts);\n if (!resizeEventSet.value) {\n resizeEventSet.value = true;\n interactObj.value.on('resizestart resizemove resizeend', (event: any) => {\n handleResize(event);\n });\n }\n } else {\n interactObj.value.resizable({\n enabled: false,\n });\n }\n};\n\nconst updateWidth = (width: number, colNum?: number) => {\n containerWidth.value = width || 100;\n if (colNum !== undefined && colNum !== null) {\n cols.value = colNum;\n }\n if (item.value && item.value.parentElement) {\n containerHeight.value = item.value.parentElement.offsetHeight || 100;\n }\n};\n\nconst compact = () => {\n createStyle();\n};\n\nconst autoSize = () => {\n previousW.value = innerW.value;\n previousH.value = innerH.value;\n if (item.value && item.value.firstElementChild) {\n const newSize = item.value.firstElementChild.getBoundingClientRect();\n const pos = calcWH(newSize.height, newSize.width, true);\n if (!usePercentagesInternal.value) {\n if (pos.w < props.minW) pos.w = props.minW;\n if (pos.w > props.maxW) pos.w = props.maxW;\n if (pos.h < props.minH) pos.h = props.minH;\n if (pos.h > props.maxH) pos.h = props.maxH;\n if (pos.h < 1) pos.h = 1;\n if (pos.w < 1) pos.w = 1;\n }\n if (getVal(innerW.value) !== pos.w || getVal(innerH.value) !== pos.h) {\n emit('resize', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n if (getVal(previousW.value!) !== pos.w || getVal(previousH.value!) !== pos.h) {\n emit('resized', props.i, pos.h, pos.w, newSize.height, newSize.width);\n eventBus.emit('resizeEvent', {\n eventType: 'resizeend',\n i: props.i,\n x: getVal(innerX.value),\n y: getVal(innerY.value),\n h: pos.h,\n w: pos.w,\n });\n }\n }\n};\n\nconst updateWidthHandler = (width: number) => {\n updateWidth(width);\n};\nconst compactHandler = () => {\n compact();\n};\nconst setDraggableHandler = (isDraggable: boolean) => {\n if (props.isDraggable === null) {\n draggable.value = isDraggable;\n }\n};\nconst setResizableHandler = (isResizable: boolean) => {\n if (props.isResizable === null) {\n resizable.value = isResizable;\n }\n};\nconst setRowHeightHandler = (val: number) => {\n rowHeight.value = val;\n};\nconst setMaxRowsHandler = (val: number) => {\n maxRows.value = val;\n};\nconst directionchangeHandler = () => {\n rtl.value = getDocumentDir() === 'rtl';\n compact();\n};\nconst setColNum = (colNum: any) => {\n cols.value = parseInt(colNum, 10);\n};\n\nonMounted(() => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n\n cols.value = parent.colNum;\n rowHeight.value = parent.rowHeight;\n containerWidth.value = parent.width !== null && parent.width !== 0 ? parent.width : 100;\n margin.value = parent.margin !== undefined ? parent.margin : [10, 10];\n maxRows.value = parent.maxRows;\n\n if (item.value && item.value.parentElement) {\n containerHeight.value = item.value.parentElement.offsetHeight || 100;\n if (containerWidth.value === 100) {\n containerWidth.value = item.value.parentElement.offsetWidth || 100;\n }\n }\n\n if (props.isDraggable === null) {\n draggable.value = parent.isDraggable;\n } else {\n draggable.value = props.isDraggable;\n }\n if (props.isResizable === null) {\n resizable.value = parent.isResizable;\n } else {\n resizable.value = props.isResizable;\n }\n useCssTransforms.value = parent.useCssTransforms;\n\n eventBus.on('updateWidth', updateWidthHandler);\n eventBus.on('compact', compactHandler);\n eventBus.on('setDraggable', setDraggableHandler);\n eventBus.on('setResizable', setResizableHandler);\n eventBus.on('setRowHeight', setRowHeightHandler);\n eventBus.on('setMaxRows', setMaxRowsHandler);\n eventBus.on('directionchange', directionchangeHandler);\n eventBus.on('setColNum', setColNum);\n rtl.value = getDocumentDir() === 'rtl';\n\n createStyle();\n});\n\nonBeforeUnmount(() => {\n eventBus.off('updateWidth', updateWidthHandler);\n eventBus.off('compact', compactHandler);\n eventBus.off('setDraggable', setDraggableHandler);\n eventBus.off('setResizable', setResizableHandler);\n eventBus.off('setRowHeight', setRowHeightHandler);\n eventBus.off('setMaxRows', setMaxRowsHandler);\n eventBus.off('directionchange', directionchangeHandler);\n eventBus.off('setColNum', setColNum);\n if (interactObj.value) {\n interactObj.value.unset();\n }\n});\n\nwatch(\n () => props.isDraggable,\n () => {\n draggable.value = props.isDraggable;\n },\n);\n\nwatch(\n () => props.static,\n () => {\n tryMakeDraggable();\n tryMakeResizable();\n },\n);\n\nwatch(draggable, () => {\n tryMakeDraggable();\n});\n\nwatch(\n () => props.isResizable,\n () => {\n resizable.value = props.isResizable;\n },\n);\n\nwatch(resizable, () => {\n tryMakeResizable();\n});\n\nwatch(rowHeight, () => {\n createStyle();\n emitContainerResized();\n});\n\nwatch(cols, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(containerWidth, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(containerHeight, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(\n () => props.x,\n newVal => {\n innerX.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.y,\n newVal => {\n innerY.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.h,\n newVal => {\n innerH.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.w,\n newVal => {\n innerW.value = newVal;\n createStyle();\n },\n);\n\nwatch(renderRtl, () => {\n tryMakeResizable();\n createStyle();\n});\n\nwatch(\n () => props.minH,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.maxH,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.minW,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.maxW,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n return parent?.margin;\n },\n val => {\n if (!val || (val[0] === margin.value[0] && val[1] === margin.value[1])) {\n return;\n }\n margin.value = val.map((m: any) => Number(m));\n createStyle();\n emitContainerResized();\n },\n);\n\ndefineExpose({\n autoSize,\n compact,\n updateWidth,\n});\n</script>\n\n<style>\n.vue-grid-item {\n transition: none;\n transition-property: left, top, right;\n /* add right for rtl */\n}\n.vue-grid-item.no-touch {\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.vue-grid-item.cssTransforms {\n right: auto;\n left: 0;\n transition-property: transform;\n}\n\n.vue-grid-item.cssTransforms.render-rtl {\n right: 0;\n left: auto;\n}\n\n.vue-grid-item.resizing {\n z-index: 3;\n opacity: 0.6;\n}\n\n.vue-grid-item.vue-draggable-dragging {\n z-index: 3;\n transition: none;\n}\n\n.vue-grid-item.vue-grid-placeholder {\n z-index: 2;\n background: pink;\n transition-duration: 100ms;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n}\n\n.vue-grid-item > .vue-resizable-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 20px;\n height: 20px;\n padding: 0 3px 3px 0;\n background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: bottom right;\n background-origin: content-box;\n cursor: se-resize;\n}\n\n.vue-grid-item > .vue-rtl-resizable-handle {\n right: auto;\n bottom: 0;\n left: 0;\n padding-left: 3px;\n background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAuMDAwMDAwMDAwMDAwMDAyIiBoZWlnaHQ9IjEwLjAwMDAwMDAwMDAwMDAwMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDwhLS0gQ3JlYXRlZCB3aXRoIE1ldGhvZCBEcmF3IC0gaHR0cDovL2dpdGh1Yi5jb20vZHVvcGl4ZWwvTWV0aG9kLURyYXcvIC0tPgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9Im5vbmUiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSIxMiIgd2lkdGg9IjEyIiB5PSItMSIgeD0iLTEiLz4KICA8ZyBkaXNwbGF5PSJub25lIiBvdmVyZmxvdz0idmlzaWJsZSIgeT0iMCIgeD0iMCIgaGVpZ2h0PSIxMDAlIiB3aWR0aD0iMTAwJSIgaWQ9ImNhbnZhc0dyaWQiPgogICA8cmVjdCBmaWxsPSJ1cmwoI2dyaWRwYXR0ZXJuKSIgc3Ryb2tlLXdpZHRoPSIwIiB5PSIwIiB4PSIwIiBoZWlnaHQ9IjEwMCUiIHdpZHRoPSIxMDAlIi8+CiAgPC9nPgogPC9nPgogPGc+CiAgPHRpdGxlPkxheWVyIDE8L3RpdGxlPgogIDxsaW5lIGNhbnZhcz0iI2ZmZmZmZiIgY2FudmFzLW9wYWNpdHk9IjEiIHN0cm9rZS1saW5lY2FwPSJ1bmRlZmluZWQiIHN0cm9rZS1saW5lam9pbj0idW5kZWZpbmVkIiBpZD0ic3ZnXzEiIHkyPSItNzAuMTc4NDA3IiB4Mj0iMTI0LjQ2NDA3NSIgeTE9Ii0zOC4zOTI3MzciIHgxPSIxNDQuODIxMjg5IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlPSIjMDAwIiBmaWxsPSJub25lIi8+CiAgPGxpbmUgc3Ryb2tlPSIjNjY2NjY2IiBzdHJva2UtbGluZWNhcD0idW5kZWZpbmVkIiBzdHJva2UtbGluZWpvaW49InVuZGVmaW5lZCIgaWQ9InN2Z181IiB5Mj0iOS4xMDY5NTciIHgyPSIwLjk0NzI0NyIgeTE9Ii0wLjAxODEyOCIgeDE9IjAuOTQ3MjQ3IiBzdHJva2Utd2lkdGg9IjIiIGZpbGw9Im5vbmUiLz4KICA8bGluZSBzdHJva2UtbGluZWNhcD0idW5kZWZpbmVkIiBzdHJva2UtbGluZWpvaW49InVuZGVmaW5lZCIgaWQ9InN2Z183IiB5Mj0iOSIgeDI9IjEwLjA3MzUyOSIgeTE9IjkiIHgxPSItMC42NTU2NCIgc3Ryb2tlLXdpZHRoPSIwIiBzdHJva2U9IiM2NjY2NjYiIGZpbGw9Im5vbmUiLz4KIDwvZz4KPC9zdmc+);\n background-repeat: no-repeat;\n background-position: bottom left;\n background-origin: content-box;\n cursor: sw-resize;\n}\n\n.vue-grid-item.disable-userselect {\n user-select: none;\n}\n</style>\n","<template>\n <div\n ref=\"item\"\n class=\"vue-grid-item\"\n :class=\"classObj\"\n :style=\"style\"\n >\n <slot></slot>\n <span\n v-if=\"resizableAndNotStatic\"\n ref=\"handle\"\n :class=\"resizableHandleClass\"\n ></span>\n <!--<span v-if=\"draggable\" ref=\"dragHandle\" class=\"vue-draggable-handle\"></span>-->\n </div>\n</template>\n<script setup lang=\"ts\">\nimport interact from 'interactjs';\nimport { computed, getCurrentInstance, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue';\nimport { getDocumentDir } from '../helpers/dom';\nimport { createCoreData, getControlPosition } from '../helpers/draggable-utils';\nimport { setTopLeft, setTopRight, setTransform, setTransformRtl } from '../helpers/utils';\nimport type { Layout, LayoutItem } from '../helpers/utils';\ndefineOptions({\n name: 'GridItem',\n});\n\nconst props = withDefaults(defineProps<LayoutItem & { usePercentages?: boolean }>(), {\n isDraggable: null,\n isResizable: null,\n static: false,\n minH: 1,\n minW: 1,\n maxH: Infinity,\n maxW: Infinity,\n dragIgnoreFrom: 'a, button',\n dragAllowFrom: null,\n resizeIgnoreFrom: 'a, button',\n usePercentages: null,\n});\n\nconst emit = defineEmits<{\n (\n e: 'container-resized',\n i: string | number,\n h: number | string,\n w: number | string,\n height: string,\n width: string,\n ): void;\n (\n e: 'resize',\n i: string | number,\n h: number | string,\n w: number | string,\n height: number,\n width: number,\n ): void;\n (\n e: 'resized',\n i: string | number,\n h: number | string,\n w: number | string,\n height: number,\n width: number,\n ): void;\n (e: 'move', i: string | number, x: number | string, y: number | string): void;\n (e: 'moved', i: string | number, x: number | string, y: number | string): void;\n}>();\n\nconst eventBus = inject<any>('eventBus');\nconst injectedUsePercentages = inject<boolean>('usePercentages', false);\nconst layout = inject<Layout>('layout');\n\nconst item = ref<HTMLElement | null>(null);\nconst handle = ref<HTMLElement | null>(null);\n\nconst cols = ref(1);\nconst containerWidth = ref(100);\nconst containerHeight = ref(100);\nconst rowHeight = ref(10);\nconst margin = ref([10, 10]);\nconst maxRows = ref(Infinity);\nconst draggable = ref<boolean | null>(null);\nconst resizable = ref<boolean | null>(null);\nconst useCssTransforms = ref(true);\nconst isDragging = ref(false);\nconst dragging = ref<any>(null);\nconst isResizing = ref(false);\nconst resizing = ref<any>(null);\nconst lastX = ref(NaN);\nconst lastY = ref(NaN);\nconst lastW = ref(NaN);\nconst lastH = ref(NaN);\nconst style = ref<Record<string, any>>({});\nconst rtl = ref(false);\nconst dragEventSet = ref(false);\nconst resizeEventSet = ref(false);\nconst previousW = ref<number | string | null>(null);\nconst previousH = ref<number | string | null>(null);\nconst previousX = ref<number | string | null>(null);\nconst previousY = ref<number | string | null>(null);\nconst innerX = ref<number | string>(props.x);\nconst innerY = ref<number | string>(props.y);\nconst innerW = ref<number | string>(props.w);\nconst innerH = ref<number | string>(props.h);\nconst interactObj = ref<any>(null);\n\nconst getVal = (v: number | string): number => (typeof v === 'number' ? v : parseFloat(v) || 0);\n\nconst parseUnit = (val: string | number | undefined, pos?: string | number): string => {\n if (val === undefined || val === null) return '0%';\n if (typeof val === 'number') return val + '%';\n if (val.endsWith('%') || val.endsWith('px') || val.includes('calc')) return val;\n if (val === 'grow') {\n if (pos !== undefined) {\n const p = typeof pos === 'number' ? pos + '%' : pos;\n return `calc(100% - ${p})`;\n }\n return '100%';\n }\n return val.includes('%') || val.includes('px') || val.includes('calc') ? val : val + '%';\n};\n\nconst usePercentagesInternal = computed(() => {\n return props.usePercentages !== null ? props.usePercentages : injectedUsePercentages;\n});\n\nconst resizableAndNotStatic = computed(() => {\n return resizable.value && !props.static;\n});\n\nconst draggableOrResizableAndNotStatic = computed(() => {\n return (draggable.value || resizable.value) && !props.static;\n});\n\nconst isAndroid = computed(() => {\n return navigator.userAgent.toLowerCase().indexOf('android') !== -1;\n});\n\nconst renderRtl = computed(() => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n return parent?.isMirrored ? !rtl.value : rtl.value;\n});\n\nconst classObj = computed(() => {\n return {\n 'vue-resizable': resizableAndNotStatic.value,\n static: props.static,\n resizing: isResizing.value,\n 'vue-draggable-dragging': isDragging.value,\n cssTransforms: useCssTransforms.value,\n 'render-rtl': renderRtl.value,\n 'disable-userselect': isDragging.value,\n 'no-touch': isAndroid.value && draggableOrResizableAndNotStatic.value,\n };\n});\n\nconst resizableHandleClass = computed(() => {\n if (renderRtl.value) {\n return 'vue-resizable-handle vue-rtl-resizable-handle';\n }\n return 'vue-resizable-handle';\n});\n\nconst calcColWidth = () => {\n return (containerWidth.value - (margin.value[0] || 10) * (cols.value + 1)) / cols.value;\n};\n\nconst calcPosition = (\n x: number | string,\n y: number | string,\n w: number | string,\n h: number | string,\n) => {\n if (usePercentagesInternal.value) {\n const out: any = {\n width: parseUnit(w, x),\n height: parseUnit(h, y),\n top: parseUnit(y),\n };\n if (renderRtl.value) {\n out.right = parseUnit(x);\n } else {\n out.left = parseUnit(x);\n }\n return out;\n }\n\n const colWidth = calcColWidth();\n let out: any = null;\n const nx = getVal(x);\n const ny = getVal(y);\n const nw = getVal(w);\n const nh = getVal(h);\n\n if (renderRtl.value) {\n out = {\n right:\n typeof x === 'string' && (x.includes('calc') || x.includes('px'))\n ? x\n : Math.round(colWidth * nx + (nx + 1) * margin.value[0]),\n top:\n typeof y === 'string' && (y.includes('calc') || y.includes('px'))\n ? y\n : Math.round(rowHeight.value * ny + (ny + 1) * margin.value[1]),\n width:\n typeof w === 'string' && (w.includes('calc') || w.includes('px'))\n ? w\n : nw === Infinity\n ? nw\n : Math.round(colWidth * nw + Math.max(0, nw - 1) * margin.value[0]),\n height:\n typeof h === 'string' && (h.includes('calc') || h.includes('px'))\n ? h\n : nh === Infinity\n ? nh\n : Math.round(rowHeight.value * nh + Math.max(0, nh - 1) * margin.value[1]),\n };\n } else {\n out = {\n left:\n typeof x === 'string' && (x.includes('calc') || x.includes('px'))\n ? x\n : Math.round(colWidth * nx + (nx + 1) * margin.value[0]),\n top:\n typeof y === 'string' && (y.includes('calc') || y.includes('px'))\n ? y\n : Math.round(rowHeight.value * ny + (ny + 1) * margin.value[1]),\n width:\n typeof w === 'string' && (w.includes('calc') || w.includes('px'))\n ? w\n : nw === Infinity\n ? nw\n : Math.round(colWidth * nw + Math.max(0, nw - 1) * margin.value[0]),\n height:\n typeof h === 'string' && (h.includes('calc') || h.includes('px'))\n ? h\n : nh === Infinity\n ? nh\n : Math.round(rowHeight.value * nh + Math.max(0, nh - 1) * margin.value[1]),\n };\n }\n return out;\n};\n\nconst resolveItemValue = (id: string, prop: 'x' | 'y'): string | number => {\n if (!layout) return 0;\n const item = (layout as any).find((l: any) => l.i === id);\n if (!item) return 0;\n\n if (prop === 'y') {\n if (item.top_i !== undefined && item.top_i !== null) {\n const refItem = (layout as any).find((l: any) => l.i === item.top_i);\n const refY = resolveItemValue(item.top_i, 'y');\n return `calc(${parseUnit(refY)} + ${parseUnit(refItem?.h ?? 0)})`;\n }\n return item.y ?? 0;\n } else {\n if (item.left_i !== undefined && item.left_i !== null) {\n const refItem = (layout as any).find((l: any) => l.i === item.left_i);\n const refX = resolveItemValue(item.left_i, 'x');\n return `calc(${parseUnit(refX)} + ${parseUnit(refItem?.w ?? 0)})`;\n }\n return item.x ?? 0;\n }\n};\n\nconst createStyle = () => {\n if (!usePercentagesInternal.value) {\n const px = getVal(props.x);\n const pw = getVal(props.w);\n if (px + pw > cols.value) {\n innerX.value = 0;\n innerW.value = pw > cols.value ? cols.value : pw;\n } else {\n innerX.value = props.x;\n innerW.value = props.w;\n }\n } else {\n innerX.value = props.x;\n innerW.value = props.w;\n }\n\n const actualX = resolveItemValue(String(props.i), 'x');\n const actualY = resolveItemValue(String(props.i), 'y');\n\n const pos = calcPosition(actualX, actualY, innerW.value, innerH.value);\n if (isDragging.value) {\n pos.top = dragging.value.top;\n if (typeof pos.top === 'number') pos.top += 'px';\n if (renderRtl.value) {\n pos.right = dragging.value.left;\n if (typeof pos.right === 'number') pos.right += 'px';\n } else {\n pos.left = dragging.value.left;\n if (typeof pos.left === 'number') pos.left += 'px';\n }\n }\n if (isResizing.value) {\n pos.width = resizing.value.width;\n if (typeof pos.width === 'number') pos.width += 'px';\n pos.height = resizing.value.height;\n if (typeof pos.height === 'number') pos.height += 'px';\n }\n let s: any = null;\n\n if (useCssTransforms.value && (isDragging.value || isResizing.value)) {\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n if (v.includes('calc')) {\n // Simple heuristic for calc(100% - pos)\n if (v.includes('100%')) {\n const parts = v.split('-');\n if (parts.length > 1) {\n return containerSize - getPx(parts[1].trim().replace(')', ''), containerSize);\n }\n }\n }\n return parseFloat(v) || 0;\n };\n\n const topPx = getPx(pos.top, containerHeight.value);\n const widthPx = getPx(pos.width, containerWidth.value);\n const heightPx = getPx(pos.height, containerHeight.value);\n\n if (renderRtl.value) {\n const rightPx = getPx(pos.right, containerWidth.value);\n s = setTransformRtl(topPx, rightPx, widthPx, heightPx);\n } else {\n const leftPx = getPx(pos.left, containerWidth.value);\n s = setTransform(topPx, leftPx, widthPx, heightPx);\n }\n } else if (useCssTransforms.value && !usePercentagesInternal.value) {\n if (renderRtl.value) {\n s = setTransformRtl(pos.top, pos.right!, pos.width, pos.height);\n } else {\n s = setTransform(pos.top, pos.left!, pos.width, pos.height);\n }\n } else {\n if (renderRtl.value) {\n s = setTopRight(pos.top, pos.right!, pos.width, pos.height);\n } else {\n s = setTopLeft(pos.top, pos.left!, pos.width, pos.height);\n }\n }\n\n for (const key of ['top', 'left', 'right', 'width', 'height']) {\n if (s[key] !== undefined && typeof s[key] === 'number') {\n s[key] += 'px';\n }\n }\n\n style.value = s;\n};\n\nconst emitContainerResized = () => {\n const styleProps: any = {};\n for (const prop of ['width', 'height']) {\n let val = style.value[prop];\n if (typeof val === 'string' && (val.includes('calc') || val.includes('%'))) {\n if (item.value) {\n val = prop === 'width' ? item.value.offsetWidth + 'px' : item.value.offsetHeight + 'px';\n } else {\n return;\n }\n }\n const matches = String(val).match(/^(\\d+(\\.\\d+)?)px$/);\n if (!matches) return;\n styleProps[prop] = matches[1];\n }\n emit('container-resized', props.i, props.h, props.w, styleProps.height, styleProps.width);\n};\n\nconst calcXY = (top: number, left: number) => {\n if (usePercentagesInternal.value) {\n let x = (left / containerWidth.value) * 100;\n let y = (top / containerHeight.value) * 100;\n\n x = Math.max(Math.min(x, 100 - getVal(innerW.value)), 0);\n y = Math.max(Math.min(y, 100 - getVal(innerH.value)), 0);\n return { x, y };\n }\n\n const colWidth = calcColWidth();\n let x = Math.round((left - margin.value[0]) / (colWidth + margin.value[0]));\n let y = Math.round((top - margin.value[1]) / (rowHeight.value + margin.value[1]));\n x = Math.max(Math.min(x, cols.value - getVal(innerW.value)), 0);\n y = Math.max(Math.min(y, maxRows.value - getVal(innerH.value)), 0);\n return { x, y };\n};\n\nconst calcWH = (height: number, width: number, autoSizeFlag = false) => {\n if (usePercentagesInternal.value) {\n let w = (width / containerWidth.value) * 100;\n let h = (height / containerHeight.value) * 100;\n\n w = Math.max(Math.min(w, 100 - getVal(innerX.value)), 0);\n h = Math.max(Math.min(h, 100 - getVal(innerY.value)), 0);\n return { w, h };\n }\n\n const colWidth = calcColWidth();\n let w = Math.round((width + margin.value[0]) / (colWidth + margin.value[0]));\n let h = 0;\n if (!autoSizeFlag) {\n h = Math.round((height + margin.value[1]) / (rowHeight.value + margin.value[1]));\n } else {\n h = Math.ceil((height + margin.value[1]) / (rowHeight.value + margin.value[1]));\n }\n w = Math.max(Math.min(w, cols.value - getVal(innerX.value)), 0);\n h = Math.max(Math.min(h, maxRows.value - getVal(innerY.value)), 0);\n return { w, h };\n};\n\nconst handleDrag = (event: any) => {\n if (props.static) return;\n if (isResizing.value) return;\n const position = getControlPosition(event);\n if (position === null) return;\n const { x, y } = position;\n const newPosition = { top: 0, left: 0 };\n switch (event.type) {\n case 'dragstart': {\n previousX.value = innerX.value;\n previousY.value = innerY.value;\n const parentRect = event.target.offsetParent.getBoundingClientRect();\n const clientRect = event.target.getBoundingClientRect();\n if (renderRtl.value) {\n newPosition.left = (clientRect.right - parentRect.right) * -1;\n } else {\n newPosition.left = clientRect.left - parentRect.left;\n }\n newPosition.top = clientRect.top - parentRect.top;\n dragging.value = newPosition;\n isDragging.value = true;\n break;\n }\n case 'dragend': {\n if (!isDragging.value) return;\n const parentRect = event.target.offsetParent.getBoundingClientRect();\n const clientRect = event.target.getBoundingClientRect();\n if (renderRtl.value) {\n newPosition.left = (clientRect.right - parentRect.right) * -1;\n } else {\n newPosition.left = clientRect.left - parentRect.left;\n }\n newPosition.top = clientRect.top - parentRect.top;\n dragging.value = null;\n isDragging.value = false;\n break;\n }\n case 'dragmove': {\n const coreEvent = createCoreData(lastX.value, lastY.value, x, y);\n if (renderRtl.value) {\n newPosition.left = dragging.value.left - coreEvent.deltaX;\n } else {\n newPosition.left = dragging.value.left + coreEvent.deltaX;\n }\n newPosition.top = dragging.value.top + coreEvent.deltaY;\n dragging.value = newPosition;\n break;\n }\n }\n let pos = calcXY(newPosition.top, newPosition.left);\n lastX.value = x;\n lastY.value = y;\n if (getVal(innerX.value) !== pos.x || getVal(innerY.value) !== pos.y) {\n emit('move', props.i, pos.x, pos.y);\n }\n if (\n event.type === 'dragend' &&\n (getVal(previousX.value!) !== pos.x || getVal(previousY.value!) !== pos.y)\n ) {\n emit('moved', props.i, pos.x, pos.y);\n }\n if (usePercentagesInternal.value) {\n eventBus.emit('dragEvent', {\n eventType: event.type,\n i: props.i,\n x: pos.x,\n y: pos.y,\n h: innerH.value,\n w: innerW.value,\n });\n } else {\n eventBus.emit('dragEvent', {\n eventType: event.type,\n i: props.i,\n x: pos.x,\n y: pos.y,\n h: getVal(innerH.value),\n w: getVal(innerW.value),\n });\n }\n};\n\nconst handleResize = (event: any) => {\n if (props.static) return;\n const position = getControlPosition(event);\n if (position == null) return;\n const { x, y } = position;\n const newSize = { width: 0, height: 0 };\n let posStyle: any = null;\n switch (event.type) {\n case 'resizestart': {\n previousW.value = innerW.value;\n previousH.value = innerH.value;\n posStyle = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);\n\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n return parseFloat(v) || 0;\n };\n\n newSize.width = getPx(posStyle.width, containerWidth.value);\n newSize.height = getPx(posStyle.height, containerHeight.value);\n\n resizing.value = newSize;\n isResizing.value = true;\n break;\n }\n case 'resizemove': {\n const coreEvent = createCoreData(lastW.value, lastH.value, x, y);\n if (renderRtl.value) {\n newSize.width = resizing.value.width - coreEvent.deltaX;\n } else {\n newSize.width = resizing.value.width + coreEvent.deltaX;\n }\n newSize.height = resizing.value.height + coreEvent.deltaY;\n resizing.value = newSize;\n break;\n }\n case 'resizeend': {\n posStyle = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);\n\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n return parseFloat(v) || 0;\n };\n\n newSize.width = getPx(posStyle.width, containerWidth.value);\n newSize.height = getPx(posStyle.height, containerHeight.value);\n\n resizing.value = null;\n isResizing.value = false;\n break;\n }\n }\n const pos = calcWH(newSize.height, newSize.width);\n if (!usePercentagesInternal.value) {\n if (pos.w < props.minW) pos.w = props.minW;\n if (pos.w > props.maxW) pos.w = props.maxW;\n if (pos.h < props.minH) pos.h = props.minH;\n if (pos.h > props.maxH) pos.h = props.maxH;\n if (pos.h < 1) pos.h = 1;\n if (pos.w < 1) pos.w = 1;\n }\n lastW.value = x;\n lastH.value = y;\n if (getVal(innerW.value) !== pos.w || getVal(innerH.value) !== pos.h) {\n emit('resize', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n if (\n event.type === 'resizeend' &&\n (getVal(previousW.value!) !== pos.w || getVal(previousH.value!) !== pos.h)\n ) {\n emit('resized', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n eventBus.emit('resizeEvent', {\n eventType: event.type,\n i: props.i,\n x: getVal(innerX.value),\n y: getVal(innerY.value),\n h: pos.h,\n w: pos.w,\n });\n};\n\nconst tryMakeDraggable = () => {\n if (interactObj.value === null || interactObj.value === undefined) {\n interactObj.value = interact(item.value as any);\n }\n if (draggable.value && !props.static) {\n const opts = {\n ignoreFrom: props.dragIgnoreFrom,\n allowFrom: props.dragAllowFrom,\n };\n interactObj.value.draggable(opts);\n if (!dragEventSet.value) {\n dragEventSet.value = true;\n interactObj.value.on('dragstart dragmove dragend', (event: any) => {\n handleDrag(event);\n });\n }\n } else {\n interactObj.value.draggable({\n enabled: false,\n });\n }\n};\n\nconst tryMakeResizable = () => {\n if (interactObj.value === null || interactObj.value === undefined) {\n interactObj.value = interact(item.value as any);\n }\n if (resizable.value && !props.static) {\n let maximumPx: any;\n let minimumPx: any;\n\n if (usePercentagesInternal.value) {\n maximumPx = {\n width: (props.maxW / 100) * containerWidth.value,\n height: (props.maxH / 100) * containerHeight.value,\n };\n minimumPx = {\n width: (props.minW / 100) * containerWidth.value,\n height: (props.minH / 100) * containerHeight.value,\n };\n } else {\n const maximum = calcPosition(0, 0, props.maxW, props.maxH);\n const minimum = calcPosition(0, 0, props.minW, props.minH);\n maximumPx = {\n width: parseFloat(maximum.width),\n height: parseFloat(maximum.height),\n };\n minimumPx = {\n width: parseFloat(minimum.width),\n height: parseFloat(minimum.height),\n };\n }\n\n const opts = {\n preserveAspectRatio: true,\n edges: {\n left: false,\n right: '.' + resizableHandleClass.value,\n bottom: '.' + resizableHandleClass.value,\n top: false,\n },\n ignoreFrom: props.resizeIgnoreFrom,\n restrictSize: {\n min: minimumPx,\n max: maximumPx,\n },\n };\n interactObj.value.resizable(opts);\n if (!resizeEventSet.value) {\n resizeEventSet.value = true;\n interactObj.value.on('resizestart resizemove resizeend', (event: any) => {\n handleResize(event);\n });\n }\n } else {\n interactObj.value.resizable({\n enabled: false,\n });\n }\n};\n\nconst updateWidth = (width: number, colNum?: number) => {\n containerWidth.value = width || 100;\n if (colNum !== undefined && colNum !== null) {\n cols.value = colNum;\n }\n if (item.value && item.value.parentElement) {\n containerHeight.value = item.value.parentElement.offsetHeight || 100;\n }\n};\n\nconst compact = () => {\n createStyle();\n};\n\nconst autoSize = () => {\n previousW.value = innerW.value;\n previousH.value = innerH.value;\n if (item.value && item.value.firstElementChild) {\n const newSize = item.value.firstElementChild.getBoundingClientRect();\n const pos = calcWH(newSize.height, newSize.width, true);\n if (!usePercentagesInternal.value) {\n if (pos.w < props.minW) pos.w = props.minW;\n if (pos.w > props.maxW) pos.w = props.maxW;\n if (pos.h < props.minH) pos.h = props.minH;\n if (pos.h > props.maxH) pos.h = props.maxH;\n if (pos.h < 1) pos.h = 1;\n if (pos.w < 1) pos.w = 1;\n }\n if (getVal(innerW.value) !== pos.w || getVal(innerH.value) !== pos.h) {\n emit('resize', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n if (getVal(previousW.value!) !== pos.w || getVal(previousH.value!) !== pos.h) {\n emit('resized', props.i, pos.h, pos.w, newSize.height, newSize.width);\n eventBus.emit('resizeEvent', {\n eventType: 'resizeend',\n i: props.i,\n x: getVal(innerX.value),\n y: getVal(innerY.value),\n h: pos.h,\n w: pos.w,\n });\n }\n }\n};\n\nconst updateWidthHandler = (width: number) => {\n updateWidth(width);\n};\nconst compactHandler = () => {\n compact();\n};\nconst setDraggableHandler = (isDraggable: boolean) => {\n if (props.isDraggable === null) {\n draggable.value = isDraggable;\n }\n};\nconst setResizableHandler = (isResizable: boolean) => {\n if (props.isResizable === null) {\n resizable.value = isResizable;\n }\n};\nconst setRowHeightHandler = (val: number) => {\n rowHeight.value = val;\n};\nconst setMaxRowsHandler = (val: number) => {\n maxRows.value = val;\n};\nconst directionchangeHandler = () => {\n rtl.value = getDocumentDir() === 'rtl';\n compact();\n};\nconst setColNum = (colNum: any) => {\n cols.value = parseInt(colNum, 10);\n};\n\nonMounted(() => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n\n cols.value = parent.colNum;\n rowHeight.value = parent.rowHeight;\n containerWidth.value = parent.width !== null && parent.width !== 0 ? parent.width : 100;\n margin.value = parent.margin !== undefined ? parent.margin : [10, 10];\n maxRows.value = parent.maxRows;\n\n if (item.value && item.value.parentElement) {\n containerHeight.value = item.value.parentElement.offsetHeight || 100;\n if (containerWidth.value === 100) {\n containerWidth.value = item.value.parentElement.offsetWidth || 100;\n }\n }\n\n if (props.isDraggable === null) {\n draggable.value = parent.isDraggable;\n } else {\n draggable.value = props.isDraggable;\n }\n if (props.isResizable === null) {\n resizable.value = parent.isResizable;\n } else {\n resizable.value = props.isResizable;\n }\n useCssTransforms.value = parent.useCssTransforms;\n\n eventBus.on('updateWidth', updateWidthHandler);\n eventBus.on('compact', compactHandler);\n eventBus.on('setDraggable', setDraggableHandler);\n eventBus.on('setResizable', setResizableHandler);\n eventBus.on('setRowHeight', setRowHeightHandler);\n eventBus.on('setMaxRows', setMaxRowsHandler);\n eventBus.on('directionchange', directionchangeHandler);\n eventBus.on('setColNum', setColNum);\n rtl.value = getDocumentDir() === 'rtl';\n\n createStyle();\n});\n\nonBeforeUnmount(() => {\n eventBus.off('updateWidth', updateWidthHandler);\n eventBus.off('compact', compactHandler);\n eventBus.off('setDraggable', setDraggableHandler);\n eventBus.off('setResizable', setResizableHandler);\n eventBus.off('setRowHeight', setRowHeightHandler);\n eventBus.off('setMaxRows', setMaxRowsHandler);\n eventBus.off('directionchange', directionchangeHandler);\n eventBus.off('setColNum', setColNum);\n if (interactObj.value) {\n interactObj.value.unset();\n }\n});\n\nwatch(\n () => props.isDraggable,\n () => {\n draggable.value = props.isDraggable;\n },\n);\n\nwatch(\n () => props.static,\n () => {\n tryMakeDraggable();\n tryMakeResizable();\n },\n);\n\nwatch(draggable, () => {\n tryMakeDraggable();\n});\n\nwatch(\n () => props.isResizable,\n () => {\n resizable.value = props.isResizable;\n },\n);\n\nwatch(resizable, () => {\n tryMakeResizable();\n});\n\nwatch(rowHeight, () => {\n createStyle();\n emitContainerResized();\n});\n\nwatch(cols, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(containerWidth, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(containerHeight, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(\n () => props.x,\n newVal => {\n innerX.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.y,\n newVal => {\n innerY.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.h,\n newVal => {\n innerH.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.w,\n newVal => {\n innerW.value = newVal;\n createStyle();\n },\n);\n\nwatch(renderRtl, () => {\n tryMakeResizable();\n createStyle();\n});\n\nwatch(\n () => props.minH,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.maxH,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.minW,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.maxW,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n return parent?.margin;\n },\n val => {\n if (!val || (val[0] === margin.value[0] && val[1] === margin.value[1])) {\n return;\n }\n margin.value = val.map((m: any) => Number(m));\n createStyle();\n emitContainerResized();\n },\n);\n\ndefineExpose({\n autoSize,\n compact,\n updateWidth,\n});\n</script>\n\n<style>\n.vue-grid-item {\n transition: none;\n transition-property: left, top, right;\n /* add right for rtl */\n}\n.vue-grid-item.no-touch {\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.vue-grid-item.cssTransforms {\n right: auto;\n left: 0;\n transition-property: transform;\n}\n\n.vue-grid-item.cssTransforms.render-rtl {\n right: 0;\n left: auto;\n}\n\n.vue-grid-item.resizing {\n z-index: 3;\n opacity: 0.6;\n}\n\n.vue-grid-item.vue-draggable-dragging {\n z-index: 3;\n transition: none;\n}\n\n.vue-grid-item.vue-grid-placeholder {\n z-index: 2;\n background: pink;\n transition-duration: 100ms;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n}\n\n.vue-grid-item > .vue-resizable-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 20px;\n height: 20px;\n padding: 0 3px 3px 0;\n background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: bottom right;\n background-origin: content-box;\n cursor: se-resize;\n}\n\n.vue-grid-item > .vue-rtl-resizable-handle {\n right: auto;\n bottom: 0;\n left: 0;\n padding-left: 3px;\n background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAuMDAwMDAwMDAwMDAwMDAyIiBoZWlnaHQ9IjEwLjAwMDAwMDAwMDAwMDAwMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDwhLS0gQ3JlYXRlZCB3aXRoIE1ldGhvZCBEcmF3IC0gaHR0cDovL2dpdGh1Yi5jb20vZHVvcGl4ZWwvTWV0aG9kLURyYXcvIC0tPgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9Im5vbmUiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSIxMiIgd2lkdGg9IjEyIiB5PSItMSIgeD0iLTEiLz4KICA8ZyBkaXNwbGF5PSJub25lIiBvdmVyZmxvdz0idmlzaWJsZSIgeT0iMCIgeD0iMCIgaGVpZ2h0PSIxMDAlIiB3aWR0aD0iMTAwJSIgaWQ9ImNhbnZhc0dyaWQiPgogICA8cmVjdCBmaWxsPSJ1cmwoI2dyaWRwYXR0ZXJuKSIgc3Ryb2tlLXdpZHRoPSIwIiB5PSIwIiB4PSIwIiBoZWlnaHQ9IjEwMCUiIHdpZHRoPSIxMDAlIi8+CiAgPC9nPgogPC9nPgogPGc+CiAgPHRpdGxlPkxheWVyIDE8L3RpdGxlPgogIDxsaW5lIGNhbnZhcz0iI2ZmZmZmZiIgY2FudmFzLW9wYWNpdHk9IjEiIHN0cm9rZS1saW5lY2FwPSJ1bmRlZmluZWQiIHN0cm9rZS1saW5lam9pbj0idW5kZWZpbmVkIiBpZD0ic3ZnXzEiIHkyPSItNzAuMTc4NDA3IiB4Mj0iMTI0LjQ2NDA3NSIgeTE9Ii0zOC4zOTI3MzciIHgxPSIxNDQuODIxMjg5IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlPSIjMDAwIiBmaWxsPSJub25lIi8+CiAgPGxpbmUgc3Ryb2tlPSIjNjY2NjY2IiBzdHJva2UtbGluZWNhcD0idW5kZWZpbmVkIiBzdHJva2UtbGluZWpvaW49InVuZGVmaW5lZCIgaWQ9InN2Z181IiB5Mj0iOS4xMDY5NTciIHgyPSIwLjk0NzI0NyIgeTE9Ii0wLjAxODEyOCIgeDE9IjAuOTQ3MjQ3IiBzdHJva2Utd2lkdGg9IjIiIGZpbGw9Im5vbmUiLz4KICA8bGluZSBzdHJva2UtbGluZWNhcD0idW5kZWZpbmVkIiBzdHJva2UtbGluZWpvaW49InVuZGVmaW5lZCIgaWQ9InN2Z183IiB5Mj0iOSIgeDI9IjEwLjA3MzUyOSIgeTE9IjkiIHgxPSItMC42NTU2NCIgc3Ryb2tlLXdpZHRoPSIwIiBzdHJva2U9IiM2NjY2NjYiIGZpbGw9Im5vbmUiLz4KIDwvZz4KPC9zdmc+);\n background-repeat: no-repeat;\n background-position: bottom left;\n background-origin: content-box;\n cursor: sw-resize;\n}\n\n.vue-grid-item.disable-userselect {\n user-select: none;\n}\n</style>\n","<template>\n <div\n ref=\"item\"\n class=\"vue-grid-layout\"\n :style=\"mergedStyle\"\n >\n <slot></slot>\n <grid-item\n ref=\"gridItem\"\n class=\"vue-grid-placeholder\"\n v-show=\"isDragging\"\n :x=\"placeholder.x\"\n :y=\"placeholder.y\"\n :w=\"placeholder.w\"\n :h=\"placeholder.h\"\n :i=\"placeholder.i\"\n ></grid-item>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport elementResizeDetectorMaker from 'element-resize-detector';\nimport mitt from 'mitt';\nimport {\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue';\nimport { addWindowEventListener, removeWindowEventListener } from '../helpers/dom';\nimport {\n findOrGenerateResponsiveLayout,\n getBreakpointFromWidth,\n getColsFromBreakpoint,\n} from '../helpers/responsive-utils';\nimport type { Layout } from '../helpers/utils';\nimport {\n bottom,\n cloneLayout,\n compact,\n getAllCollisions,\n getLayoutItem,\n moveElement,\n validateLayout,\n} from '../helpers/utils';\nimport GridItem from './grid-item.vue';\n\ndefineOptions({\n name: 'GridLayout',\n});\n\nconst props = withDefaults(\n defineProps<{\n // If true, the container height swells and contracts to fit contents\n autoSize?: boolean;\n colNum?: number;\n rowHeight?: number;\n maxRows?: number;\n margin?: number[];\n isDraggable?: boolean;\n isResizable?: boolean;\n isMirrored?: boolean;\n useCssTransforms?: boolean;\n verticalCompact?: boolean;\n layout: Layout;\n responsive?: boolean;\n responsiveLayouts?: Record<string, any>;\n breakpoints?: Record<string, number>;\n cols?: Record<string, number>;\n preventCollision?: boolean;\n usePercentages?: boolean;\n }>(),\n {\n autoSize: true,\n colNum: 12,\n rowHeight: 10,\n maxRows: Infinity,\n margin: () => [10, 10],\n isDraggable: false,\n isResizable: false,\n isMirrored: false,\n useCssTransforms: true,\n verticalCompact: true,\n responsive: false,\n responsiveLayouts: () => ({}),\n breakpoints: () => ({ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }),\n cols: () => ({ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }),\n preventCollision: false,\n usePercentages: false,\n },\n);\n\nconst emit = defineEmits<{\n (e: 'layout-created', layout: Layout): void;\n (e: 'layout-mounted', layout: Layout): void;\n (e: 'layout-before-mount', layout: Layout): void;\n (e: 'layout-updated', layout: Layout): void;\n (e: 'layout-ready', layout: Layout): void;\n (e: 'update:layout', layout: Layout): void;\n (e: 'breakpoint-changed', breakpoint: string | null, layout: Layout): void;\n}>();\n\nconst eventBus = mitt();\nprovide('eventBus', eventBus);\nprovide('usePercentages', props.usePercentages);\nprovide('layout', props.layout);\n\nconst item = ref<HTMLElement | null>(null);\nconst gridItem = ref(null);\nconst width = ref<number | null>(null);\nconst mergedStyle = ref<Record<string, any>>({});\nconst lastLayoutLength = ref(0);\nconst isDragging = ref(false);\nconst placeholder = reactive({\n x: 0 as string | number,\n y: 0 as string | number,\n w: 0 as string | number,\n h: 0 as string | number,\n i: -1 as string | number,\n});\nconst layouts = ref<Record<string, Layout>>({}); // array to store all layouts from different breakpoints\nconst lastBreakpoint = ref<string | null>(null); // store last active breakpoint\nconst originalLayout = ref<Layout | null>(null); // store original Layout\nconst erd = ref<any>(null);\n\nconst getLayoutEl = () => {\n return item.value;\n};\n\nconst updateHeight = () => {\n mergedStyle.value = {\n height: containerHeight(),\n };\n if (props.usePercentages) {\n mergedStyle.value.width = '100%';\n }\n};\n\nconst onWindowResize = () => {\n if (item.value !== null && item.value !== undefined) {\n width.value = item.value.offsetWidth;\n }\n eventBus.emit('resizeEvent', {});\n};\n\nconst containerHeight = () => {\n if (props.usePercentages) return '100%';\n if (!props.autoSize) return;\n return bottom(props.layout) * (props.rowHeight + props.margin[1]) + props.margin[1] + 'px';\n};\n\nconst dragEvent = (\n eventName: string,\n id: string | number,\n x: number,\n y: number,\n h: number,\n w: number,\n) => {\n let l = getLayoutItem(props.layout, String(id));\n if (l === undefined || l === null) {\n l = { x: 0, y: 0, w: 0, h: 0, i: String(id) };\n }\n if (eventName === 'dragmove' || eventName === 'dragstart') {\n placeholder.i = id;\n placeholder.x = l.x;\n placeholder.y = l.y;\n placeholder.w = w;\n placeholder.h = h;\n nextTick(() => {\n isDragging.value = true;\n });\n eventBus.emit('updateWidth', width.value);\n } else {\n nextTick(() => {\n isDragging.value = false;\n });\n }\n // Move the element to the dragged location.\n moveElement(props.layout, l, x, y, true, props.preventCollision);\n compact(props.layout, props.verticalCompact);\n // needed because vue can't detect changes on array element properties\n eventBus.emit('compact');\n updateHeight();\n if (eventName === 'dragend') emit('layout-updated', props.layout);\n};\n\nconst responsiveGridLayout = () => {\n if (!width.value) return;\n const newBreakpoint = getBreakpointFromWidth(props.breakpoints, width.value);\n const newCols = getColsFromBreakpoint(newBreakpoint, props.cols);\n // save actual layout in layouts\n if (lastBreakpoint.value != null && !layouts.value[lastBreakpoint.value])\n layouts.value[lastBreakpoint.value] = cloneLayout(props.layout);\n // Find or generate a new layout.\n const layout = findOrGenerateResponsiveLayout(\n originalLayout.value!,\n layouts.value,\n props.breakpoints as any,\n newBreakpoint,\n lastBreakpoint.value as any,\n newCols,\n props.verticalCompact,\n );\n // Store the new layout.\n layouts.value[newBreakpoint] = layout;\n if (lastBreakpoint.value !== newBreakpoint) {\n emit('breakpoint-changed', newBreakpoint, layout);\n }\n // new prop sync\n emit('update:layout', layout);\n lastBreakpoint.value = newBreakpoint;\n eventBus.emit('setColNum', getColsFromBreakpoint(newBreakpoint, props.cols));\n};\n\nconst resizeEvent = (\n eventName: string,\n id: string | number,\n x: number,\n y: number,\n h: number,\n w: number,\n) => {\n let l = getLayoutItem(props.layout, String(id));\n if (l === undefined || l === null) {\n l = { h: 0, w: 0, x: 0, y: 0, i: String(id) };\n }\n let hasCollisions = false;\n if (props.preventCollision) {\n const collisions = getAllCollisions(props.layout, { ...l, w, h }).filter(\n layoutItem => layoutItem.i !== l!.i,\n );\n hasCollisions = collisions.length > 0;\n // If we're colliding, we need adjust the placeholder.\n if (hasCollisions) {\n // adjust w && h to maximum allowed space\n let leastX = Infinity;\n let leastY = Infinity;\n collisions.forEach(layoutItem => {\n if (layoutItem.x > l!.x) leastX = Math.min(leastX, layoutItem.x);\n if (layoutItem.y > l!.y) leastY = Math.min(leastY, layoutItem.y);\n });\n if (Number.isFinite(leastX)) l.w = leastX - l.x;\n if (Number.isFinite(leastY)) l.h = leastY - l.y;\n }\n }\n if (!hasCollisions) {\n // Set new width and height.\n l.w = w;\n l.h = h;\n }\n if (eventName === 'resizestart' || eventName === 'resizemove') {\n placeholder.i = id;\n placeholder.x = x;\n placeholder.y = y;\n placeholder.w = l.w;\n placeholder.h = l.h;\n nextTick(() => {\n isDragging.value = true;\n });\n eventBus.emit('updateWidth', width.value);\n } else {\n nextTick(() => {\n isDragging.value = false;\n });\n }\n if (props.responsive) responsiveGridLayout();\n compact(props.layout, props.verticalCompact);\n eventBus.emit('compact');\n updateHeight();\n if (eventName === 'resizeend') emit('layout-updated', props.layout);\n};\n\nconst initResponsiveFeatures = () => {\n layouts.value = Object.assign({}, props.responsiveLayouts);\n};\n\nconst findDifference = (layout: Layout, originalLayout: Layout) => {\n const uniqueResultOne = layout.filter(obj => {\n return !originalLayout.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n const uniqueResultTwo = originalLayout.filter(obj => {\n return !layout.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n return uniqueResultOne.concat(uniqueResultTwo);\n};\n\nconst layoutUpdate = () => {\n if (props.layout !== undefined && originalLayout.value !== null) {\n if (props.layout.length !== originalLayout.value.length) {\n const diff = findDifference(props.layout, originalLayout.value);\n if (diff.length > 0) {\n if (props.layout.length > originalLayout.value.length) {\n originalLayout.value = originalLayout.value.concat(diff);\n } else {\n originalLayout.value = originalLayout.value.filter(obj => {\n return !diff.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n }\n }\n lastLayoutLength.value = props.layout.length;\n initResponsiveFeatures();\n }\n if (props.usePercentages) {\n // Skip correctBounds on layout update to keep original values\n }\n compact(props.layout, props.verticalCompact);\n eventBus.emit('updateWidth', width.value);\n updateHeight();\n emit('layout-updated', props.layout);\n }\n};\n\nconst resizeEventHandler = ({ eventType, i, x, y, h, w }: any) => {\n resizeEvent(eventType, i, x, y, h, w);\n};\nconst dragEventHandler = ({ eventType, i, x, y, h, w }: any) => {\n dragEvent(eventType, i, x, y, h, w);\n};\n\nonBeforeMount(() => {\n emit('layout-before-mount', props.layout);\n});\n\nonMounted(() => {\n eventBus.on('resizeEvent', resizeEventHandler);\n eventBus.on('dragEvent', dragEventHandler);\n emit('layout-created', props.layout);\n\n emit('layout-mounted', props.layout);\n nextTick(() => {\n validateLayout(props.layout);\n originalLayout.value = props.layout;\n if (props.usePercentages) {\n // Skip correctBounds on initialization to keep original values\n }\n nextTick(() => {\n onWindowResize();\n initResponsiveFeatures();\n addWindowEventListener('resize', onWindowResize);\n compact(props.layout, props.verticalCompact);\n emit('layout-updated', props.layout);\n updateHeight();\n nextTick(() => {\n erd.value = elementResizeDetectorMaker({\n strategy: 'scroll',\n callOnAdd: false,\n });\n erd.value.listenTo(item.value, () => {\n onWindowResize();\n });\n });\n });\n });\n});\n\nonBeforeUnmount(() => {\n eventBus.off('resizeEvent', resizeEventHandler);\n eventBus.off('dragEvent', dragEventHandler);\n removeWindowEventListener('resize', onWindowResize);\n if (erd.value && item.value) {\n erd.value.uninstall(item.value);\n }\n});\n\nwatch(width, (_newval, oldval) => {\n nextTick(() => {\n eventBus.emit('updateWidth', width.value);\n if (oldval === null) {\n nextTick(() => {\n emit('layout-ready', props.layout);\n });\n }\n updateHeight();\n });\n});\n\nwatch(\n () => props.layout.length,\n () => {\n layoutUpdate();\n },\n);\n\nwatch(\n () => props.layout,\n () => {\n layoutUpdate();\n },\n);\n\nwatch(\n () => props.colNum,\n val => {\n eventBus.emit('setColNum', val);\n },\n);\n\nwatch(\n () => props.rowHeight,\n () => {\n eventBus.emit('setRowHeight', props.rowHeight);\n },\n);\n\nwatch(\n () => props.isDraggable,\n () => {\n eventBus.emit('setDraggable', props.isDraggable);\n },\n);\n\nwatch(\n () => props.isResizable,\n () => {\n eventBus.emit('setResizable', props.isResizable);\n },\n);\n\nwatch(\n () => props.responsive,\n () => {\n if (!props.responsive) {\n emit('update:layout', originalLayout.value!);\n eventBus.emit('setColNum', props.colNum);\n }\n onWindowResize();\n },\n);\n\nwatch(\n () => props.maxRows,\n () => {\n eventBus.emit('setMaxRows', props.maxRows);\n },\n);\n\nwatch(\n () => props.margin,\n () => {\n updateHeight();\n },\n);\n\ndefineExpose({\n getLayoutEl,\n});\n</script>\n<style>\n.vue-grid-layout {\n position: relative;\n}\n</style>\n","<template>\n <div\n ref=\"item\"\n class=\"vue-grid-layout\"\n :style=\"mergedStyle\"\n >\n <slot></slot>\n <grid-item\n ref=\"gridItem\"\n class=\"vue-grid-placeholder\"\n v-show=\"isDragging\"\n :x=\"placeholder.x\"\n :y=\"placeholder.y\"\n :w=\"placeholder.w\"\n :h=\"placeholder.h\"\n :i=\"placeholder.i\"\n ></grid-item>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport elementResizeDetectorMaker from 'element-resize-detector';\nimport mitt from 'mitt';\nimport {\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue';\nimport { addWindowEventListener, removeWindowEventListener } from '../helpers/dom';\nimport {\n findOrGenerateResponsiveLayout,\n getBreakpointFromWidth,\n getColsFromBreakpoint,\n} from '../helpers/responsive-utils';\nimport type { Layout } from '../helpers/utils';\nimport {\n bottom,\n cloneLayout,\n compact,\n getAllCollisions,\n getLayoutItem,\n moveElement,\n validateLayout,\n} from '../helpers/utils';\nimport GridItem from './grid-item.vue';\n\ndefineOptions({\n name: 'GridLayout',\n});\n\nconst props = withDefaults(\n defineProps<{\n // If true, the container height swells and contracts to fit contents\n autoSize?: boolean;\n colNum?: number;\n rowHeight?: number;\n maxRows?: number;\n margin?: number[];\n isDraggable?: boolean;\n isResizable?: boolean;\n isMirrored?: boolean;\n useCssTransforms?: boolean;\n verticalCompact?: boolean;\n layout: Layout;\n responsive?: boolean;\n responsiveLayouts?: Record<string, any>;\n breakpoints?: Record<string, number>;\n cols?: Record<string, number>;\n preventCollision?: boolean;\n usePercentages?: boolean;\n }>(),\n {\n autoSize: true,\n colNum: 12,\n rowHeight: 10,\n maxRows: Infinity,\n margin: () => [10, 10],\n isDraggable: false,\n isResizable: false,\n isMirrored: false,\n useCssTransforms: true,\n verticalCompact: true,\n responsive: false,\n responsiveLayouts: () => ({}),\n breakpoints: () => ({ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }),\n cols: () => ({ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }),\n preventCollision: false,\n usePercentages: false,\n },\n);\n\nconst emit = defineEmits<{\n (e: 'layout-created', layout: Layout): void;\n (e: 'layout-mounted', layout: Layout): void;\n (e: 'layout-before-mount', layout: Layout): void;\n (e: 'layout-updated', layout: Layout): void;\n (e: 'layout-ready', layout: Layout): void;\n (e: 'update:layout', layout: Layout): void;\n (e: 'breakpoint-changed', breakpoint: string | null, layout: Layout): void;\n}>();\n\nconst eventBus = mitt();\nprovide('eventBus', eventBus);\nprovide('usePercentages', props.usePercentages);\nprovide('layout', props.layout);\n\nconst item = ref<HTMLElement | null>(null);\nconst gridItem = ref(null);\nconst width = ref<number | null>(null);\nconst mergedStyle = ref<Record<string, any>>({});\nconst lastLayoutLength = ref(0);\nconst isDragging = ref(false);\nconst placeholder = reactive({\n x: 0 as string | number,\n y: 0 as string | number,\n w: 0 as string | number,\n h: 0 as string | number,\n i: -1 as string | number,\n});\nconst layouts = ref<Record<string, Layout>>({}); // array to store all layouts from different breakpoints\nconst lastBreakpoint = ref<string | null>(null); // store last active breakpoint\nconst originalLayout = ref<Layout | null>(null); // store original Layout\nconst erd = ref<any>(null);\n\nconst getLayoutEl = () => {\n return item.value;\n};\n\nconst updateHeight = () => {\n mergedStyle.value = {\n height: containerHeight(),\n };\n if (props.usePercentages) {\n mergedStyle.value.width = '100%';\n }\n};\n\nconst onWindowResize = () => {\n if (item.value !== null && item.value !== undefined) {\n width.value = item.value.offsetWidth;\n }\n eventBus.emit('resizeEvent', {});\n};\n\nconst containerHeight = () => {\n if (props.usePercentages) return '100%';\n if (!props.autoSize) return;\n return bottom(props.layout) * (props.rowHeight + props.margin[1]) + props.margin[1] + 'px';\n};\n\nconst dragEvent = (\n eventName: string,\n id: string | number,\n x: number,\n y: number,\n h: number,\n w: number,\n) => {\n let l = getLayoutItem(props.layout, String(id));\n if (l === undefined || l === null) {\n l = { x: 0, y: 0, w: 0, h: 0, i: String(id) };\n }\n if (eventName === 'dragmove' || eventName === 'dragstart') {\n placeholder.i = id;\n placeholder.x = l.x;\n placeholder.y = l.y;\n placeholder.w = w;\n placeholder.h = h;\n nextTick(() => {\n isDragging.value = true;\n });\n eventBus.emit('updateWidth', width.value);\n } else {\n nextTick(() => {\n isDragging.value = false;\n });\n }\n // Move the element to the dragged location.\n moveElement(props.layout, l, x, y, true, props.preventCollision);\n compact(props.layout, props.verticalCompact);\n // needed because vue can't detect changes on array element properties\n eventBus.emit('compact');\n updateHeight();\n if (eventName === 'dragend') emit('layout-updated', props.layout);\n};\n\nconst responsiveGridLayout = () => {\n if (!width.value) return;\n const newBreakpoint = getBreakpointFromWidth(props.breakpoints, width.value);\n const newCols = getColsFromBreakpoint(newBreakpoint, props.cols);\n // save actual layout in layouts\n if (lastBreakpoint.value != null && !layouts.value[lastBreakpoint.value])\n layouts.value[lastBreakpoint.value] = cloneLayout(props.layout);\n // Find or generate a new layout.\n const layout = findOrGenerateResponsiveLayout(\n originalLayout.value!,\n layouts.value,\n props.breakpoints as any,\n newBreakpoint,\n lastBreakpoint.value as any,\n newCols,\n props.verticalCompact,\n );\n // Store the new layout.\n layouts.value[newBreakpoint] = layout;\n if (lastBreakpoint.value !== newBreakpoint) {\n emit('breakpoint-changed', newBreakpoint, layout);\n }\n // new prop sync\n emit('update:layout', layout);\n lastBreakpoint.value = newBreakpoint;\n eventBus.emit('setColNum', getColsFromBreakpoint(newBreakpoint, props.cols));\n};\n\nconst resizeEvent = (\n eventName: string,\n id: string | number,\n x: number,\n y: number,\n h: number,\n w: number,\n) => {\n let l = getLayoutItem(props.layout, String(id));\n if (l === undefined || l === null) {\n l = { h: 0, w: 0, x: 0, y: 0, i: String(id) };\n }\n let hasCollisions = false;\n if (props.preventCollision) {\n const collisions = getAllCollisions(props.layout, { ...l, w, h }).filter(\n layoutItem => layoutItem.i !== l!.i,\n );\n hasCollisions = collisions.length > 0;\n // If we're colliding, we need adjust the placeholder.\n if (hasCollisions) {\n // adjust w && h to maximum allowed space\n let leastX = Infinity;\n let leastY = Infinity;\n collisions.forEach(layoutItem => {\n if (layoutItem.x > l!.x) leastX = Math.min(leastX, layoutItem.x);\n if (layoutItem.y > l!.y) leastY = Math.min(leastY, layoutItem.y);\n });\n if (Number.isFinite(leastX)) l.w = leastX - l.x;\n if (Number.isFinite(leastY)) l.h = leastY - l.y;\n }\n }\n if (!hasCollisions) {\n // Set new width and height.\n l.w = w;\n l.h = h;\n }\n if (eventName === 'resizestart' || eventName === 'resizemove') {\n placeholder.i = id;\n placeholder.x = x;\n placeholder.y = y;\n placeholder.w = l.w;\n placeholder.h = l.h;\n nextTick(() => {\n isDragging.value = true;\n });\n eventBus.emit('updateWidth', width.value);\n } else {\n nextTick(() => {\n isDragging.value = false;\n });\n }\n if (props.responsive) responsiveGridLayout();\n compact(props.layout, props.verticalCompact);\n eventBus.emit('compact');\n updateHeight();\n if (eventName === 'resizeend') emit('layout-updated', props.layout);\n};\n\nconst initResponsiveFeatures = () => {\n layouts.value = Object.assign({}, props.responsiveLayouts);\n};\n\nconst findDifference = (layout: Layout, originalLayout: Layout) => {\n const uniqueResultOne = layout.filter(obj => {\n return !originalLayout.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n const uniqueResultTwo = originalLayout.filter(obj => {\n return !layout.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n return uniqueResultOne.concat(uniqueResultTwo);\n};\n\nconst layoutUpdate = () => {\n if (props.layout !== undefined && originalLayout.value !== null) {\n if (props.layout.length !== originalLayout.value.length) {\n const diff = findDifference(props.layout, originalLayout.value);\n if (diff.length > 0) {\n if (props.layout.length > originalLayout.value.length) {\n originalLayout.value = originalLayout.value.concat(diff);\n } else {\n originalLayout.value = originalLayout.value.filter(obj => {\n return !diff.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n }\n }\n lastLayoutLength.value = props.layout.length;\n initResponsiveFeatures();\n }\n if (props.usePercentages) {\n // Skip correctBounds on layout update to keep original values\n }\n compact(props.layout, props.verticalCompact);\n eventBus.emit('updateWidth', width.value);\n updateHeight();\n emit('layout-updated', props.layout);\n }\n};\n\nconst resizeEventHandler = ({ eventType, i, x, y, h, w }: any) => {\n resizeEvent(eventType, i, x, y, h, w);\n};\nconst dragEventHandler = ({ eventType, i, x, y, h, w }: any) => {\n dragEvent(eventType, i, x, y, h, w);\n};\n\nonBeforeMount(() => {\n emit('layout-before-mount', props.layout);\n});\n\nonMounted(() => {\n eventBus.on('resizeEvent', resizeEventHandler);\n eventBus.on('dragEvent', dragEventHandler);\n emit('layout-created', props.layout);\n\n emit('layout-mounted', props.layout);\n nextTick(() => {\n validateLayout(props.layout);\n originalLayout.value = props.layout;\n if (props.usePercentages) {\n // Skip correctBounds on initialization to keep original values\n }\n nextTick(() => {\n onWindowResize();\n initResponsiveFeatures();\n addWindowEventListener('resize', onWindowResize);\n compact(props.layout, props.verticalCompact);\n emit('layout-updated', props.layout);\n updateHeight();\n nextTick(() => {\n erd.value = elementResizeDetectorMaker({\n strategy: 'scroll',\n callOnAdd: false,\n });\n erd.value.listenTo(item.value, () => {\n onWindowResize();\n });\n });\n });\n });\n});\n\nonBeforeUnmount(() => {\n eventBus.off('resizeEvent', resizeEventHandler);\n eventBus.off('dragEvent', dragEventHandler);\n removeWindowEventListener('resize', onWindowResize);\n if (erd.value && item.value) {\n erd.value.uninstall(item.value);\n }\n});\n\nwatch(width, (_newval, oldval) => {\n nextTick(() => {\n eventBus.emit('updateWidth', width.value);\n if (oldval === null) {\n nextTick(() => {\n emit('layout-ready', props.layout);\n });\n }\n updateHeight();\n });\n});\n\nwatch(\n () => props.layout.length,\n () => {\n layoutUpdate();\n },\n);\n\nwatch(\n () => props.layout,\n () => {\n layoutUpdate();\n },\n);\n\nwatch(\n () => props.colNum,\n val => {\n eventBus.emit('setColNum', val);\n },\n);\n\nwatch(\n () => props.rowHeight,\n () => {\n eventBus.emit('setRowHeight', props.rowHeight);\n },\n);\n\nwatch(\n () => props.isDraggable,\n () => {\n eventBus.emit('setDraggable', props.isDraggable);\n },\n);\n\nwatch(\n () => props.isResizable,\n () => {\n eventBus.emit('setResizable', props.isResizable);\n },\n);\n\nwatch(\n () => props.responsive,\n () => {\n if (!props.responsive) {\n emit('update:layout', originalLayout.value!);\n eventBus.emit('setColNum', props.colNum);\n }\n onWindowResize();\n },\n);\n\nwatch(\n () => props.maxRows,\n () => {\n eventBus.emit('setMaxRows', props.maxRows);\n },\n);\n\nwatch(\n () => props.margin,\n () => {\n updateHeight();\n },\n);\n\ndefineExpose({\n getLayoutEl,\n});\n</script>\n<style>\n.vue-grid-layout {\n position: relative;\n}\n</style>\n","<template>\n <grid-layout\n v-model:layout=\"layout\"\n :is-draggable=\"config.isDraggable\"\n :is-resizable=\"config.isResizable\"\n :is-mirrored=\"false\"\n :vertical-compact=\"false\"\n use-css-transforms\n :use-percentages=\"true\"\n >\n <grid-item\n v-for=\"item in layout\"\n :x=\"item.x\"\n :y=\"item.y\"\n :w=\"item.w\"\n :h=\"item.h\"\n :i=\"item.i\"\n :key=\"item.i\"\n :dragAllowFrom=\"'span'\"\n :class=\"{ item: true, border: hasBorder }\"\n :style=\"{ padding: config.itemPadding || '0' }\"\n >\n <div class=\"item-content\">\n <template v-if=\"item.config.component\">\n <component\n :is=\"item.config.component\"\n :itemKey=\"item.config.key\"\n v-bind=\"item.config.props || {}\"\n />\n </template>\n <template v-else>\n <span class=\"text\">Layout: {{ item.i }}</span>\n </template>\n </div>\n </grid-item>\n </grid-layout>\n</template>\n<script setup lang=\"ts\">\nimport { GridConfig } from 'liyu-pc-base/typing';\nimport { computed, onMounted } from 'vue';\nimport { GridItem, GridLayout } from '../grid-layout';\n\nconst props = withDefaults(\n defineProps<{\n config: GridConfig;\n }>(),\n {},\n);\n\nconst layout = computed(() => {\n const keyMap = {};\n return props.config.items.map((item, index) => {\n let i = item.key;\n if (!i) {\n i = `index_${index}`;\n }\n if (keyMap[i]) {\n throw new Error('key: ${i}重复');\n }\n\n return {\n ...item.layout,\n i: i,\n config: item,\n };\n });\n});\nconst hasBorder = computed(() => {\n return !!props.config.isBorder;\n});\nonMounted(() => {});\n</script>\n\n<style scoped lang=\"less\">\n.item {\n position: relative;\n}\n.border {\n border: 1px solid #ccc;\n}\n.item-content {\n width: 100%;\n height: 100%;\n background: #fff;\n border-radius: 2px;\n overflow: hidden;\n}\n</style>\n","<template>\n <grid-layout\n v-model:layout=\"layout\"\n :is-draggable=\"config.isDraggable\"\n :is-resizable=\"config.isResizable\"\n :is-mirrored=\"false\"\n :vertical-compact=\"false\"\n use-css-transforms\n :use-percentages=\"true\"\n >\n <grid-item\n v-for=\"item in layout\"\n :x=\"item.x\"\n :y=\"item.y\"\n :w=\"item.w\"\n :h=\"item.h\"\n :i=\"item.i\"\n :key=\"item.i\"\n :dragAllowFrom=\"'span'\"\n :class=\"{ item: true, border: hasBorder }\"\n :style=\"{ padding: config.itemPadding || '0' }\"\n >\n <div class=\"item-content\">\n <template v-if=\"item.config.component\">\n <component\n :is=\"item.config.component\"\n :itemKey=\"item.config.key\"\n v-bind=\"item.config.props || {}\"\n />\n </template>\n <template v-else>\n <span class=\"text\">Layout: {{ item.i }}</span>\n </template>\n </div>\n </grid-item>\n </grid-layout>\n</template>\n<script setup lang=\"ts\">\nimport { GridConfig } from 'liyu-pc-base/typing';\nimport { computed, onMounted } from 'vue';\nimport { GridItem, GridLayout } from '../grid-layout';\n\nconst props = withDefaults(\n defineProps<{\n config: GridConfig;\n }>(),\n {},\n);\n\nconst layout = computed(() => {\n const keyMap = {};\n return props.config.items.map((item, index) => {\n let i = item.key;\n if (!i) {\n i = `index_${index}`;\n }\n if (keyMap[i]) {\n throw new Error('key: ${i}重复');\n }\n\n return {\n ...item.layout,\n i: i,\n config: item,\n };\n });\n});\nconst hasBorder = computed(() => {\n return !!props.config.isBorder;\n});\nonMounted(() => {});\n</script>\n\n<style scoped lang=\"less\">\n.item {\n position: relative;\n}\n.border {\n border: 1px solid #ccc;\n}\n.item-content {\n width: 100%;\n height: 100%;\n background: #fff;\n border-radius: 2px;\n overflow: hidden;\n}\n</style>\n","import { useGlobMap } from 'liyu-pc-base/init-plugin';\nimport type { GridConfig } from 'liyu-pc-base/typing';\nimport { markRaw } from 'vue';\nconst custom_config: { [key: string]: any } = {};\n\nconst get_custom_config = async (key: string) => {\n if (Object.keys(custom_config).length > 0) {\n if (custom_config[key]) {\n const obj = await custom_config[key]();\n return obj.default;\n } else {\n const obj = await custom_config['default']();\n return obj.default;\n }\n }\n const allComponents: any = import.meta.glob('liyu-pc-base/components/gridPage/config/*/*.ts', {\n eager: false,\n });\n const customComponents = useGlobMap('gridPage');\n Object.assign(allComponents, customComponents);\n for (const full_file_name in allComponents) {\n const file_name_list = full_file_name.split('/');\n const file_name = file_name_list[file_name_list.length - 1].replace('.ts', '');\n custom_config[file_name] = allComponents[full_file_name];\n }\n\n if (custom_config[key]) {\n const obj = await custom_config[key]();\n return obj.default;\n } else {\n const obj = await custom_config['default']();\n return obj.default;\n }\n};\nconst process_config = (config: any) => {\n if (config.items) {\n for (const item of config.items) {\n if (item.component) {\n item.component = markRaw(item.component);\n }\n }\n }\n};\nexport const getGridConfig = async (\n key: string,\n { context, eventBus },\n): Promise<{ config: GridConfig }> => {\n const configFunc = await get_custom_config(key);\n const local_config = configFunc({ menu_flag: key, context, eventBus });\n process_config(local_config);\n\n return { config: local_config };\n};\n","<template>\n <fullLayout>\n <div\n class=\"grid-page-wraper\"\n :style=\"{ minWidth: minWidth, minHeight: minHeight }\"\n >\n <div class=\"grid-page-content\">\n <gridView\n v-if=\"config\"\n :config=\"config\"\n ></gridView>\n </div>\n </div>\n </fullLayout>\n</template>\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, provide, ref } from 'vue';\nimport fullLayout from '../fullLayout/fullLayout.vue';\nimport gridView from './gridView.vue';\nimport mitt from 'mitt';\nimport type { GridConfig } from 'liyu-pc-base/typing';\nimport { getGridConfig } from './index';\nimport { gridPageStateSymbol, GridPageState } from './utils';\nimport { useRoute } from 'vue-router';\nconst route = useRoute();\nconst config = ref<GridConfig>(null);\nconst context = ref<any>({});\nconst eventBus = mitt();\nconst modelType = ref('');\nconst path_arr = route.path.split('/');\nmodelType.value = path_arr[path_arr.length - 1];\n\nprovide<GridPageState>(gridPageStateSymbol, {\n context: context,\n eventBus,\n});\nonMounted(async () => {\n config.value = (\n await getGridConfig(modelType.value, { context: context.value, eventBus })\n ).config;\n if (config.value.onMounted) {\n await config.value.onMounted(context.value, eventBus);\n }\n});\nonUnmounted(() => {\n if (config.value.onUnmounted) {\n config.value.onUnmounted(context.value, eventBus);\n }\n});\nconst minWidth = computed(() => {\n if (config.value?.minWidth != null) {\n return config.value.minWidth;\n } else {\n return undefined;\n }\n});\nconst minHeight = computed(() => {\n if (config.value?.minHeight != null) {\n return config.value.minHeight;\n } else {\n return undefined;\n }\n});\n</script>\n\n<style lang=\"less\">\n.grid-page-wraper {\n height: 100%;\n width: 100%;\n padding: 5px;\n}\n.grid-page-content {\n height: 100%;\n width: 100%;\n border-radius: 4px;\n}\n</style>\n","<template>\n <fullLayout>\n <div\n class=\"grid-page-wraper\"\n :style=\"{ minWidth: minWidth, minHeight: minHeight }\"\n >\n <div class=\"grid-page-content\">\n <gridView\n v-if=\"config\"\n :config=\"config\"\n ></gridView>\n </div>\n </div>\n </fullLayout>\n</template>\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, provide, ref } from 'vue';\nimport fullLayout from '../fullLayout/fullLayout.vue';\nimport gridView from './gridView.vue';\nimport mitt from 'mitt';\nimport type { GridConfig } from 'liyu-pc-base/typing';\nimport { getGridConfig } from './index';\nimport { gridPageStateSymbol, GridPageState } from './utils';\nimport { useRoute } from 'vue-router';\nconst route = useRoute();\nconst config = ref<GridConfig>(null);\nconst context = ref<any>({});\nconst eventBus = mitt();\nconst modelType = ref('');\nconst path_arr = route.path.split('/');\nmodelType.value = path_arr[path_arr.length - 1];\n\nprovide<GridPageState>(gridPageStateSymbol, {\n context: context,\n eventBus,\n});\nonMounted(async () => {\n config.value = (\n await getGridConfig(modelType.value, { context: context.value, eventBus })\n ).config;\n if (config.value.onMounted) {\n await config.value.onMounted(context.value, eventBus);\n }\n});\nonUnmounted(() => {\n if (config.value.onUnmounted) {\n config.value.onUnmounted(context.value, eventBus);\n }\n});\nconst minWidth = computed(() => {\n if (config.value?.minWidth != null) {\n return config.value.minWidth;\n } else {\n return undefined;\n }\n});\nconst minHeight = computed(() => {\n if (config.value?.minHeight != null) {\n return config.value.minHeight;\n } else {\n return undefined;\n }\n});\n</script>\n\n<style lang=\"less\">\n.grid-page-wraper {\n height: 100%;\n width: 100%;\n padding: 5px;\n}\n.grid-page-content {\n height: 100%;\n width: 100%;\n border-radius: 4px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAA,KAAe,EAAgB;CAC7B,MAAM;CACN,OAAO;EACL,MAAM;GACJ,MAAM;GACN,UAAU;GACX;EACD,SAAS;GACP,MAAM;GACN,UAAU;GACX;EACD,sCAAsC;GACpC,MAAM;GACN,UAAU;GACX;EACD,mCAAmC;GACjC,MAAM;GACN,UAAU;GACX;EACF;CACD,OAAO,CAAC,MAAM,SAAS;CACvB,MAAM,GAAO,EAAE,WAAQ;EACrB,IAAM,IAAY,EAAI,kBAAkB,EAClC,IAAW,EAAI,EAAE,CAAC;AACxB,IAAM,qCAAqC,SAAS,GAAgB,MAAkB;GACpF,IAAM,IAAwB,KAAK,MACjC,KAAK,UAAU,EAAM,kCAAkC,CACxD;AAaD,GAZI,KACF,EAAiB,SAAS,MAA0B;AAClD,MAAiB,MAAM,SAAQ,MAAK;AAClC,OAAU,SAAS,MAAW;AAC5B,MAAI,EAAE,cAAc,EAAE,eACpB,EAAE,WAAW,EAAE,UACf,EAAE,UAAU;OAEd;MACF;KACF,EAEJ,EAAS,MAAM,KAAK;IAClB,UAAU,MAAM,IAAQ;IACxB,KAAK,iBAAiB;IACJ;IACnB,CAAC;IACF;EACF,IAAM,KAAgB,MAAa;AACjC,KAAE,gBA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AQ,EAAK,UAAU;GAKnC,KAAgB,OAC3B,GACA,EAAE,YAAS,kBACyB;CAEpC,IAAM,KADa,MAAM,GAAkB,EAAI,EACf;EAAE,WAAW;EAAK;EAAS;EAAU,CAAC;AAGtE,QAFA,GAAe,EAAa,EAErB,EAAE,QAAQ,GAAc;;;;EC3BjC,IAAM,IAAQ,IAAU,EAClB,IAAS,EAAgB,KAAK,EAC9B,IAAU,EAAS,EAAE,CAAC,EACtB,IAAW,IAAM,EACjB,IAAY,EAAI,GAAG,EACnB,IAAW,EAAM,KAAK,MAAM,IAAI;AAetC,EAdA,EAAU,QAAQ,EAAS,EAAS,SAAS,IAE7C,EAAuB,GAAqB;GACjC;GACT;GACD,CAAC,EACF,GAAU,YAAY;AAIpB,GAHA,EAAO,SACL,MAAM,GAAc,EAAU,OAAO;IAAE,SAAS,EAAQ;IAAO;IAAU,CAAC,EAC1E,QACE,EAAO,MAAM,aACf,MAAM,EAAO,MAAM,UAAU,EAAQ,OAAO,EAAS;IAEvD,EACF,SAAkB;AAChB,GAAI,EAAO,MAAM,eACf,EAAO,MAAM,YAAY,EAAQ,OAAO,EAAS;IAEnD;EACF,IAAM,IAAW,QAAe;AAC9B,OAAI,EAAO,OAAO,YAAY,KAC5B,QAAO,EAAO,MAAM;IAItB,EACI,IAAY,QAAe;AAC/B,OAAI,EAAO,OAAO,aAAa,KAC7B,QAAO,EAAO,MAAM;IAItB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/components/FormRender/GeneralFilter/AddConditionModal/index.vue","../../src/components/FormRender/GeneralFilter/AddConditionModal/index.vue","../../src/components/FormRender/GeneralFilter/AddConditionGroupModal/index.vue","../../src/components/FormRender/GeneralFilter/AddConditionGroupModal/index.vue","../../src/components/FormRender/GeneralFilter/data.ts","../../src/components/FormRender/GeneralFilter/index.vue","../../src/components/FormRender/GeneralFilter/index.vue","../../src/components/FormRender/FormRender.vue","../../src/components/FormRender/FormRender.vue","../../src/components/FormRender/FormRender2.vue","../../src/components/FormRender/FormRender2.vue","../../src/constants.ts","../../src/components/SideSearchRender/viewManage.vue","../../src/components/SideSearchRender/viewManage.vue","../../src/components/SideSearchRender/SideSearchRender.vue","../../src/components/SideSearchRender/SideSearchRender.vue","../../src/components/fullLayout/fullLayoutUtils.ts","../../src/components/fullLayout/fullLayout.vue","../../src/components/fullLayout/fullLayout.vue","../../src/components/grid-layout/helpers/dom.ts","../../src/components/grid-layout/helpers/utils.ts","../../src/components/grid-layout/helpers/responsive-utils.ts","../../src/components/grid-layout/helpers/draggable-utils.ts","../../src/components/grid-layout/components/grid-item.vue","../../src/components/grid-layout/components/grid-item.vue","../../src/components/grid-layout/components/grid-layout.vue","../../src/components/grid-layout/components/grid-layout.vue","../../src/components/gridPage/gridView.vue","../../src/components/gridPage/gridView.vue","../../src/components/gridPage/index.ts","../../src/components/gridPage/gridPage.vue","../../src/components/gridPage/gridPage.vue"],"sourcesContent":["<template>\n <a-modal\n title=\"添加过滤条件\"\n width=\"800px\"\n :open=\"open\"\n transitionName=\"\"\n maskTransitionName=\"\"\n :destroyOnClose=\"true\"\n :confirmLoading=\"loading\"\n centered\n @ok=\"handleSubmit\"\n @cancel=\"\n () => {\n $emit('cancel');\n }\n \"\n >\n <a-tabs v-model:activeKey=\"activeKey\">\n <a-tab-pane\n class=\"my-card\"\n v-for=\"item in tab_list\"\n :key=\"item.key\"\n :tab=\"item.tab_name\"\n >\n <div\n v-for=\"base_search_item in item.base_search_list\"\n :key=\"base_search_item.name\"\n >\n <div style=\"font-size: 14px\">{{ base_search_item.name }}</div>\n <a-space\n wrap\n style=\"padding-left: 10px; margin-bottom: 0\"\n >\n <div\n v-for=\"obj in base_search_item.group\"\n :key=\"obj.field_name\"\n >\n <a-checkbox v-model:checked=\"obj.checked\">\n <span style=\"color: #7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n </a-tabs>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, reactive, ref } from 'vue';\n\nexport default defineComponent({\n name: 'AddConditionModal',\n props: {\n open: {\n type: Boolean,\n required: true,\n },\n loading: {\n type: Boolean,\n required: false,\n },\n default_search_condition_config_list: {\n type: Array,\n required: false,\n },\n base_search_condition_config_list: {\n type: Array,\n required: false,\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const activeKey = ref('condition_tab_0');\n const tab_list = ref([]);\n props.default_search_condition_config_list.forEach((item_list: any, index: number) => {\n const base_search_list: any = JSON.parse(\n JSON.stringify(props.base_search_condition_config_list),\n );\n if (base_search_list) {\n base_search_list.forEach((base_search_list: any) => {\n base_search_list.group.forEach(i => {\n item_list.forEach((k: any) => {\n if (i.field_name == k.field_name) {\n i.operator = k.operator;\n i.checked = true;\n }\n });\n });\n });\n }\n tab_list.value.push({\n tab_name: `条件组${index + 1}`,\n key: `condition_tab_${index}`,\n base_search_list: base_search_list,\n });\n });\n const handleSubmit = (e: Event) => {\n e.preventDefault();\n const list = [];\n tab_list.value.forEach(item => {\n const selected_group_list: any = [];\n item.base_search_list.forEach(i => {\n i.group.forEach((temp: any) => {\n if (temp.checked) {\n if (!temp.operator) {\n const operator_list_selected = get_operator_list_selected(temp);\n if (operator_list_selected.length > 0) {\n const [first] = operator_list_selected;\n temp.operator = first;\n }\n }\n selected_group_list.push(temp);\n }\n });\n });\n list.push(selected_group_list);\n });\n emit('ok', { new_list: list });\n };\n const get_operator_list_selected = (condition) => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n }\n else if (condition.operator_list) {\n return condition.operator_list;\n }\n else {\n return [];\n }\n };\n\n return {\n props,\n activeKey,\n tab_list,\n handleSubmit,\n };\n },\n});\n</script>\n<style scoped>\n.my-card {\n padding: 20px;\n background-color: #f6f7f9;\n}\n</style>\n","<template>\n <a-modal\n title=\"添加过滤条件\"\n width=\"800px\"\n :open=\"open\"\n transitionName=\"\"\n maskTransitionName=\"\"\n :destroyOnClose=\"true\"\n :confirmLoading=\"loading\"\n centered\n @ok=\"handleSubmit\"\n @cancel=\"\n () => {\n $emit('cancel');\n }\n \"\n >\n <a-tabs v-model:activeKey=\"activeKey\">\n <a-tab-pane\n class=\"my-card\"\n v-for=\"item in tab_list\"\n :key=\"item.key\"\n :tab=\"item.tab_name\"\n >\n <div\n v-for=\"base_search_item in item.base_search_list\"\n :key=\"base_search_item.name\"\n >\n <div style=\"font-size: 14px\">{{ base_search_item.name }}</div>\n <a-space\n wrap\n style=\"padding-left: 10px; margin-bottom: 0\"\n >\n <div\n v-for=\"obj in base_search_item.group\"\n :key=\"obj.field_name\"\n >\n <a-checkbox v-model:checked=\"obj.checked\">\n <span style=\"color: #7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n </a-tabs>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, reactive, ref } from 'vue';\n\nexport default defineComponent({\n name: 'AddConditionModal',\n props: {\n open: {\n type: Boolean,\n required: true,\n },\n loading: {\n type: Boolean,\n required: false,\n },\n default_search_condition_config_list: {\n type: Array,\n required: false,\n },\n base_search_condition_config_list: {\n type: Array,\n required: false,\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const activeKey = ref('condition_tab_0');\n const tab_list = ref([]);\n props.default_search_condition_config_list.forEach((item_list: any, index: number) => {\n const base_search_list: any = JSON.parse(\n JSON.stringify(props.base_search_condition_config_list),\n );\n if (base_search_list) {\n base_search_list.forEach((base_search_list: any) => {\n base_search_list.group.forEach(i => {\n item_list.forEach((k: any) => {\n if (i.field_name == k.field_name) {\n i.operator = k.operator;\n i.checked = true;\n }\n });\n });\n });\n }\n tab_list.value.push({\n tab_name: `条件组${index + 1}`,\n key: `condition_tab_${index}`,\n base_search_list: base_search_list,\n });\n });\n const handleSubmit = (e: Event) => {\n e.preventDefault();\n const list = [];\n tab_list.value.forEach(item => {\n const selected_group_list: any = [];\n item.base_search_list.forEach(i => {\n i.group.forEach((temp: any) => {\n if (temp.checked) {\n if (!temp.operator) {\n const operator_list_selected = get_operator_list_selected(temp);\n if (operator_list_selected.length > 0) {\n const [first] = operator_list_selected;\n temp.operator = first;\n }\n }\n selected_group_list.push(temp);\n }\n });\n });\n list.push(selected_group_list);\n });\n emit('ok', { new_list: list });\n };\n const get_operator_list_selected = (condition) => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n }\n else if (condition.operator_list) {\n return condition.operator_list;\n }\n else {\n return [];\n }\n };\n\n return {\n props,\n activeKey,\n tab_list,\n handleSubmit,\n };\n },\n});\n</script>\n<style scoped>\n.my-card {\n padding: 20px;\n background-color: #f6f7f9;\n}\n</style>\n","<template>\n <a-modal\n title=\"添加过滤条件组\"\n width=\"800px\"\n :open=\"open\"\n transitionName=\"\"\n maskTransitionName=\"\"\n :destroyOnClose=\"true\"\n :confirmLoading=\"loading\"\n centered\n @ok=\"handleSubmit\"\n @cancel=\"\n () => {\n $emit('cancel');\n }\n \"\n >\n\n <a-tab-pane class=\"my-card\" v-for=\"item in tab_list\"\n :key=\"item.key\" :tab=\"item.tab_name\">\n <div v-for=\"base_search_item in item.base_search_list\" :key=\"base_search_item.name\">\n <div style=\"font-size: 14px;\">{{base_search_item.name}}</div>\n <a-space wrap>\n <div v-for=\"obj in base_search_item.group\" :key=\"obj.field_name\">\n <a-checkbox v-model:checked=\"obj.checked\" >\n <span style=\"color:#7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n\n <a-tabs v-model:activeKey=\"activeKey\">\n <a-tab-pane class=\"my-card\" v-for=\"item in tab_list\"\n :key=\"item.key\" :tab=\"item.tab_name\">\n <div v-for=\"base_search_item in item.base_search_list\" :key=\"base_search_item.name\">\n <div style=\"font-size: 14px;\">{{base_search_item.name}}</div>\n <a-space wrap style=\"padding-left: 10px; margin-bottom:0\">\n <div v-for=\"obj in base_search_item.group\" :key=\"obj.field_name\">\n <a-checkbox v-model:checked=\"obj.checked\" >\n <span style=\"color:#7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n </a-tabs>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, reactive, ref } from 'vue';\nimport { message } from 'ant-design-vue';\nexport default defineComponent({\n name: 'AddConditionGroupModal',\n props: {\n open: {\n type: Boolean,\n required: true,\n },\n loading: {\n type: Boolean,\n required: false,\n },\n default_search_condition_config_list: {\n type: Array,\n required: false,\n },\n base_search_condition_config_list: {\n type: Array,\n required: false,\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const tab_list = ref([]);\n const get_operator_list_selected = (condition) => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n }\n else if (condition.operator_list) {\n return condition.operator_list;\n }\n else {\n return [];\n }\n };\n props.default_search_condition_config_list?.forEach((item_list:any, index:number)=>{\n const base_search_list:any = JSON.parse(JSON.stringify(props.base_search_condition_config_list));\n if(base_search_list){\n base_search_list.forEach((base_search_list:any)=>{\n base_search_list.group.forEach(i=>{\n item_list.forEach((k:any)=>{\n if(i.field_name == k.field_name){\n i.checked = true;\n }\n });\n });\n });\n }\n tab_list.value.push({\n tab_name:`条件组${index+1}`,\n key:`condition_tab_${index}`,\n base_search_list: base_search_list,\n });\n });\n const index = props.default_search_condition_config_list?.length || 0;\n const new_search_list = [];\n props.base_search_condition_config_list.forEach((item:any)=>{\n const new_group = [];\n item.group.forEach(i=>{\n const operator_list_selected = get_operator_list_selected(i);\n if(i.default_operator){\n i.operator = i.default_operator;\n }\n if(!operator_list_selected.includes(i.operator)){\n i.operator = null;\n }\n if(!i.operator && operator_list_selected.length>0){\n const [first] = operator_list_selected;\n i.operator = first;\n }\n const new_i = { ...i, checked:false };\n new_group.push(new_i);\n });\n new_search_list.push({\n name:item.name,\n group:new_group,\n });\n });\n tab_list.value.push({\n tab_name:`条件组${index+1}`,\n key:`condition_tab_${index}`,\n base_search_list: new_search_list,\n });\n const activeKey = ref(`condition_tab_${index}`);\n\n const handleSubmit = (e: Event) => {\n e.preventDefault();\n const list = [];\n tab_list.value.forEach(item=>{\n const selected_group_list:any = [];\n item.base_search_list.forEach(i=>{\n i.group.forEach((temp:any)=>{\n if(temp.checked){\n selected_group_list.push(temp);\n }\n });\n });\n if(selected_group_list.length>0){\n list.push(selected_group_list);\n }\n });\n if(list.length==0){\n message.error('新增条件组未增加新的字段,自动取消');\n emit('cancel');//关闭对话框\n }else{\n emit('ok', { new_list: list });\n }\n };\n\n return {\n props,\n activeKey,\n tab_list,\n handleSubmit,\n get_operator_list_selected,\n };\n },\n});\n</script>\n<style scoped>\n.my-card{\n padding:20px;\n background-color: #f6f7f9;\n}\n</style>","<template>\n <a-modal\n title=\"添加过滤条件组\"\n width=\"800px\"\n :open=\"open\"\n transitionName=\"\"\n maskTransitionName=\"\"\n :destroyOnClose=\"true\"\n :confirmLoading=\"loading\"\n centered\n @ok=\"handleSubmit\"\n @cancel=\"\n () => {\n $emit('cancel');\n }\n \"\n >\n\n <a-tab-pane class=\"my-card\" v-for=\"item in tab_list\"\n :key=\"item.key\" :tab=\"item.tab_name\">\n <div v-for=\"base_search_item in item.base_search_list\" :key=\"base_search_item.name\">\n <div style=\"font-size: 14px;\">{{base_search_item.name}}</div>\n <a-space wrap>\n <div v-for=\"obj in base_search_item.group\" :key=\"obj.field_name\">\n <a-checkbox v-model:checked=\"obj.checked\" >\n <span style=\"color:#7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n\n <a-tabs v-model:activeKey=\"activeKey\">\n <a-tab-pane class=\"my-card\" v-for=\"item in tab_list\"\n :key=\"item.key\" :tab=\"item.tab_name\">\n <div v-for=\"base_search_item in item.base_search_list\" :key=\"base_search_item.name\">\n <div style=\"font-size: 14px;\">{{base_search_item.name}}</div>\n <a-space wrap style=\"padding-left: 10px; margin-bottom:0\">\n <div v-for=\"obj in base_search_item.group\" :key=\"obj.field_name\">\n <a-checkbox v-model:checked=\"obj.checked\" >\n <span style=\"color:#7d8089\">{{ obj.label }}</span>\n </a-checkbox>\n </div>\n </a-space>\n </div>\n </a-tab-pane>\n </a-tabs>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, reactive, ref } from 'vue';\nimport { message } from 'ant-design-vue';\nexport default defineComponent({\n name: 'AddConditionGroupModal',\n props: {\n open: {\n type: Boolean,\n required: true,\n },\n loading: {\n type: Boolean,\n required: false,\n },\n default_search_condition_config_list: {\n type: Array,\n required: false,\n },\n base_search_condition_config_list: {\n type: Array,\n required: false,\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const tab_list = ref([]);\n const get_operator_list_selected = (condition) => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n }\n else if (condition.operator_list) {\n return condition.operator_list;\n }\n else {\n return [];\n }\n };\n props.default_search_condition_config_list?.forEach((item_list:any, index:number)=>{\n const base_search_list:any = JSON.parse(JSON.stringify(props.base_search_condition_config_list));\n if(base_search_list){\n base_search_list.forEach((base_search_list:any)=>{\n base_search_list.group.forEach(i=>{\n item_list.forEach((k:any)=>{\n if(i.field_name == k.field_name){\n i.checked = true;\n }\n });\n });\n });\n }\n tab_list.value.push({\n tab_name:`条件组${index+1}`,\n key:`condition_tab_${index}`,\n base_search_list: base_search_list,\n });\n });\n const index = props.default_search_condition_config_list?.length || 0;\n const new_search_list = [];\n props.base_search_condition_config_list.forEach((item:any)=>{\n const new_group = [];\n item.group.forEach(i=>{\n const operator_list_selected = get_operator_list_selected(i);\n if(i.default_operator){\n i.operator = i.default_operator;\n }\n if(!operator_list_selected.includes(i.operator)){\n i.operator = null;\n }\n if(!i.operator && operator_list_selected.length>0){\n const [first] = operator_list_selected;\n i.operator = first;\n }\n const new_i = { ...i, checked:false };\n new_group.push(new_i);\n });\n new_search_list.push({\n name:item.name,\n group:new_group,\n });\n });\n tab_list.value.push({\n tab_name:`条件组${index+1}`,\n key:`condition_tab_${index}`,\n base_search_list: new_search_list,\n });\n const activeKey = ref(`condition_tab_${index}`);\n\n const handleSubmit = (e: Event) => {\n e.preventDefault();\n const list = [];\n tab_list.value.forEach(item=>{\n const selected_group_list:any = [];\n item.base_search_list.forEach(i=>{\n i.group.forEach((temp:any)=>{\n if(temp.checked){\n selected_group_list.push(temp);\n }\n });\n });\n if(selected_group_list.length>0){\n list.push(selected_group_list);\n }\n });\n if(list.length==0){\n message.error('新增条件组未增加新的字段,自动取消');\n emit('cancel');//关闭对话框\n }else{\n emit('ok', { new_list: list });\n }\n };\n\n return {\n props,\n activeKey,\n tab_list,\n handleSubmit,\n get_operator_list_selected,\n };\n },\n});\n</script>\n<style scoped>\n.my-card{\n padding:20px;\n background-color: #f6f7f9;\n}\n</style>","export const get_options_eq = t => {\n const options_eq = [\n { value: '上月', label: '上月' },\n { value: '本月', label: '本月' },\n { value: '今日', label: '今日' },\n { value: '昨日', label: '昨日' },\n { value: '期初', label: '期初' },\n ];\n return {\n options_eq,\n };\n};\n","<template>\n <a-space v-if=\"!is_massage_default\">\n <a-button\n type=\"link\"\n v-if=\"is_show_normal_search\"\n @click=\"handleShowSearchRender\"\n >\n {{ $t('普通') }}\n </a-button>\n <a-button\n v-if=\"!isShowForm\"\n type=\"link\"\n @click=\"\n () => {\n isShowForm = true;\n $emit('resize');\n }\n \"\n >\n <span class=\"expand-btn\">{{ $t('展开') }}</span>\n </a-button>\n <a-button\n v-else\n type=\"link\"\n @click=\"\n () => {\n isShowForm = false;\n $emit('resize');\n }\n \"\n >\n {{ $t('隐藏') }}\n </a-button>\n </a-space>\n <span v-show=\"!isShowForm\">\n <span\n v-for=\"(item, index) in default_search_condition_config_list\"\n :key=\"index\"\n >\n <a-tag>{{ $t('条件组') }}{{ index + 1 }}:</a-tag>\n <span\n v-for=\"condition in item\"\n :key=\"condition.field_name\"\n >\n <a-tag\n v-show=\"isShowSearchTag(index, condition)\"\n color=\"green\"\n >\n {{ condition.label }}: {{ transferValueFunc(index, condition) }}\n <close-outlined\n style=\"cursor: pointer; margin-left: 5px\"\n @click=\"handleDelSearch(index, condition.field_name)\"\n />\n </a-tag>\n </span>\n </span>\n </span>\n <div\n v-if=\"delayShow || isShowForm\"\n class=\"card\"\n v-show=\"isShowForm\"\n >\n <div\n v-for=\"(group_item, group_index) in default_search_condition_config_list\"\n :key=\"group_index\"\n >\n <div\n class=\"condition-group\"\n v-if=\"default_search_condition_config_list.length > 1\"\n >\n {{ $t('条件组') }} {{ group_index + 1 }}\n </div>\n <a-space\n :wrap=\"true\"\n align=\"center\"\n :size=\"0\"\n >\n <a-space-compact\n block\n v-for=\"(condition, k) in group_item\"\n :key=\"condition.field_name\"\n size=\"middle\"\n @mouseenter=\"handleMouseEnter(group_index, condition)\"\n @mouseleave=\"handleMouseLeave(group_index, condition)\"\n >\n <a-input-group compact>\n <a-tooltip :title=\"condition.label\">\n <a-cascader\n :value=\"condition.label\"\n style=\"width: 125px\"\n :options=\"searchItemOptionsDict[group_index]\"\n showSearch\n :allowClear=\"false\"\n :placeholder=\"$t('请选择...')\"\n @change=\"value => onChangeSearchItem(value, group_index, condition, k)\"\n />\n </a-tooltip>\n <a-tooltip :title=\"get_operator_type_map(condition.format, condition.operator)\">\n <a-select\n v-if=\"get_operator_list_selected(condition).length > 0\"\n :dropdownMatchSelectWidth=\"false\"\n v-model:value=\"condition.operator\"\n @change=\"value => onChangeOperator(value, group_index, condition)\"\n style=\"width: 100px\"\n >\n <a-select-option\n v-for=\"item in get_operator_list_selected(condition)\"\n :value=\"item\"\n :key=\"item\"\n >\n {{ get_operator_type_map(condition.format, item) }}\n </a-select-option>\n </a-select>\n </a-tooltip>\n <span\n style=\"width: 315px; height: 40px\"\n v-if=\"condition_model_dict && condition_model_dict[group_index]\"\n >\n <template\n v-if=\"['is_or_not_blank_or_null', 'is_or_not_null'].includes(condition.operator)\"\n >\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'select',\n mode: 'default',\n format: 'choices',\n class_name: 'str',\n placeholder: '',\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"is_or_not_blank_or_null_options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"['input'].includes(condition.format)\">\n <template\n v-if=\"condition.operator === 'between' || condition.operator === 'notbetween'\"\n >\n <template v-if=\"condition.type === 'datepicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, type: 'rangepicker', format: condition.dateFormat }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.type === 'monthpicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'monthrangepicker',\n format: condition.dateFormat,\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.type === 'timepicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'timerangepicker',\n format: condition.dateFormat,\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else>\n <a-flex>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name][0]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n <div class=\"range\">~</div>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name][1]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </a-flex>\n </template>\n </template>\n <template v-else-if=\"condition.operator === '_eq'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'select',\n mode: 'default',\n format: 'choices',\n class_name: 'str',\n placeholder: '',\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"options_eq\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template\n v-else-if=\"\n condition.type === 'datepicker' ||\n condition.type === 'monthpicker' ||\n condition.type === 'timepicker'\n \"\n >\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, format: condition.dateFormat }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n </template>\n <template v-else-if=\"['choices', 'remote'].includes(condition.format)\">\n <template v-if=\"condition.format === 'choices'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.format === 'remote'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, name: condition?.field_name }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n </template>\n </span>\n <span\n class=\"close-icon\"\n v-if=\"deleteBtnDict && deleteBtnDict[group_index]\"\n >\n <a-tooltip\n title=\"删除此条件\"\n v-if=\"\n deleteBtnDict[group_index][condition.field_name] &&\n (default_search_condition_config_list[0].length > 1 ||\n default_search_condition_config_list.length > 1) &&\n !is_massage_default\n \"\n >\n <close-circle-outlined @click=\"handleDeleteFormItem(group_index, condition)\" />\n </a-tooltip>\n </span>\n </a-input-group>\n </a-space-compact>\n </a-space>\n <a-divider\n class=\"divider\"\n style=\"margin: 0\"\n v-if=\"\n default_search_condition_config_list.length > 1 &&\n group_index != default_search_condition_config_list.length - 1\n \"\n >\n 或\n </a-divider>\n </div>\n </div>\n <div\n class=\"search-bar\"\n v-if=\"isShowForm && !is_massage_default\"\n >\n <a-space>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleAddConditions\"\n >\n {{ $t('添加条件') }}\n </a-button>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleAddGroupCondition\"\n >\n {{ $t('添加条件组') }}\n </a-button>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleSearch\"\n >\n {{ $t('查询') }}\n </a-button>\n </a-space>\n </div>\n\n <add-condition-modal\n v-if=\"addConditionModal.open\"\n :open=\"addConditionModal.open\"\n :default_search_condition_config_list=\"default_search_condition_config_list\"\n :base_search_condition_config_list=\"base_search_condition_config_list\"\n @ok=\"handleAddConditionOk\"\n @cancel=\"handleAddConditionCancel\"\n />\n\n <add-condition-group-modal\n v-if=\"addConditionGroupModal.open\"\n :open=\"addConditionGroupModal.open\"\n :default_search_condition_config_list=\"default_search_condition_config_list\"\n :base_search_condition_config_list=\"base_search_condition_config_list\"\n @ok=\"handleAddGroupConditionOK\"\n @cancel=\"handleAddGroupConditionCancel\"\n />\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n onMounted,\n reactive,\n ref,\n computed,\n watch,\n PropType,\n nextTick,\n onUnmounted,\n} from 'vue';\nimport FieldRender from 'liyu-pc-base/components/FormRender/FieldRender.vue';\nimport AddConditionModal from 'liyu-pc-base/components/FormRender/GeneralFilter/AddConditionModal/index.vue';\nimport AddConditionGroupModal from 'liyu-pc-base/components/FormRender/GeneralFilter/AddConditionGroupModal/index.vue';\nimport { isNotEmpty } from 'liyu-pc-base/utils/function';\nimport {\n CloseCircleOutlined,\n CloseOutlined,\n LeftOutlined,\n RightOutlined,\n} from '@ant-design/icons-vue';\nimport { useI18n } from 'vue-i18n';\nimport { get_options_eq } from 'liyu-pc-base/components/FormRender/GeneralFilter/data';\nimport moment from 'moment';\nimport FieldRender2 from 'liyu-pc-base/components/FormRender/FieldRender2.vue';\nimport { get_operator_type_map } from 'liyu-pc-base/utils/function';\n\nexport default defineComponent({\n name: 'GeneralFilter',\n props: {\n base_search_condition_config_list: {\n type: Array as PropType<any[]>,\n },\n default_search_condition_config_list: {\n type: Array as PropType<any[]>,\n },\n is_show_normal_search: {\n type: Boolean,\n default: () => false,\n },\n is_clear_model: {\n type: Boolean,\n default: () => false,\n },\n is_show_advantage: {\n type: Boolean,\n default: () => false,\n },\n is_massage_default: {\n type: Boolean,\n default: () => false,\n },\n eventBus: {\n type: Object,\n required: false,\n },\n delayShow: {\n type: Boolean,\n default: () => true,\n },\n },\n components: {\n FieldRender2,\n CloseOutlined,\n LeftOutlined,\n RightOutlined,\n FieldRender,\n AddConditionGroupModal,\n AddConditionModal,\n CloseCircleOutlined,\n },\n emits: [\n 'search',\n 'resize',\n 'update_default_search_condition_config_list',\n 'onShowSearchRender',\n 'delSearch',\n 'onChangeValue',\n 'update:is_clear_model',\n ],\n setup(props, { emit }) {\n const isShowForm = ref(props.is_massage_default);\n const labelModel = ref({});\n const { t } = useI18n();\n const { options_eq } = get_options_eq(t);\n //条件组-->\n const condition_model_dict = ref([]);\n const validateInfos = {};\n const source_default_search_condition_config_list = ref(null);\n const is_or_not_blank_or_null_options = ref([\n { value: 'yes', label: t('is_or_not_blank_or_null.yes') },\n { value: 'no', label: t('is_or_not_blank_or_null.no') },\n ]);\n if (!source_default_search_condition_config_list.value) {\n source_default_search_condition_config_list.value = JSON.parse(\n JSON.stringify(props.default_search_condition_config_list),\n );\n }\n\n const operator_type_count_map = {\n between: 2,\n gt: 1,\n lt: 1,\n gte: 1,\n lte: 1,\n in: 0,\n eq: 1,\n _eq: 1,\n contains: 1,\n icontains: 1,\n startswith: 1,\n istartswith: 1,\n endswith: 1,\n iendswith: 1,\n notbetween: 2,\n notin: 0,\n notcontains: 1,\n noticontains: 1,\n notstartswith: 1,\n notistartswith: 1,\n notendswith: 1,\n notiendswith: 1,\n not_eq: 1,\n not_blank_not_null: 1,\n json_list_not_blank_not_null: 1,\n json_list_is_blank_is_null: 1,\n is_or_not_blank_or_null: 1,\n is_or_not_null: 1,\n };\n const is2DArray = arr => {\n const [first] = [arr];\n return Array.isArray(first) && arr.every(subArray => Array.isArray(subArray));\n };\n let old_operator = null;\n const onChangeOperator = (operator, index, condition) => {\n //不同操作类型,设置不同的默认值\n // if (condition_model_dict.value[index][condition.field_name]) {\n // return;\n // }\n const value = condition_model_dict.value[index][condition.field_name];\n if (get_operator_list_selected(condition).includes('_eq')) {\n if (operator == '_eq') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == '_eq') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (get_operator_list_selected(condition).includes('not_blank_not_null')) {\n if (operator == 'not_blank_not_null') {\n condition_model_dict.value[index][condition.field_name] = '是';\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == 'not_blank_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (\n get_operator_list_selected(condition).includes('is_or_not_blank_or_null') ||\n get_operator_list_selected(condition).includes('is_or_not_null')\n ) {\n if (operator == 'is_or_not_blank_or_null' || operator == 'is_or_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == 'is_or_not_blank_or_null' || old_operator == 'is_or_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (value instanceof Array && is2DArray(value)) {\n // 级联类型,默认值默认清空\n condition_model_dict.value[index][condition.field_name] = undefined;\n } else if (operator_type_count_map[operator] == 1) {\n if (value instanceof Array) {\n const [first] = condition_model_dict.value[index][condition.field_name];\n if (isNotEmpty(first)) {\n condition_model_dict.value[index][condition.field_name] = first;\n } else {\n condition_model_dict.value[index][condition.field_name] = null;\n }\n } else {\n condition_model_dict.value[index][condition.field_name] = value ? value : null;\n }\n const is = options_eq.some(\n obj => obj.value === condition_model_dict.value[index][condition.field_name],\n );\n if (is) {\n condition_model_dict.value[index][condition.field_name] = null;\n }\n } else if (operator_type_count_map[operator] == 2) {\n if (condition_model_dict.value[index][condition.field_name] instanceof Array) {\n const [first, seconds] = condition_model_dict.value[index][condition.field_name];\n condition_model_dict.value[index][condition.field_name] = [first, seconds];\n } else if (condition_model_dict.value[index][condition.field_name]) {\n const first = condition_model_dict.value[index][condition.field_name];\n condition_model_dict.value[index][condition.field_name] = [first, null];\n } else {\n condition_model_dict.value[index][condition.field_name] = [null, null];\n }\n const is = options_eq.some(\n obj => obj.value === condition_model_dict.value[index][condition.field_name][0],\n );\n if (is) {\n condition_model_dict.value[index][condition.field_name] = [null, null];\n }\n } else { \n condition_model_dict.value[index][condition.field_name] = undefined;\n }\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n // console.log('onChangeValue');\n };\n\n const addConditionModal = reactive({\n open: false,\n });\n const handleAddConditions = () => {\n addConditionModal.open = true;\n };\n const handleAddConditionOk = (data: any) => {\n props.default_search_condition_config_list.forEach((item: any, index: any) => {\n data.new_list.forEach((item1: any, index1: any) => {\n if (index == index1) {\n item.forEach((item2: any) => {\n item1.forEach((item3: any) => {\n if (item2.field_name == item3.field_name) {\n item3.value = item2.value;\n item3.operator = item2.operator;\n }\n });\n });\n }\n });\n });\n //保存后处理 new_list\n emit('update_default_search_condition_config_list', { new_list: data.new_list });\n // refreshCondition();\n addConditionModal.open = false;\n };\n const handleAddConditionCancel = () => {\n addConditionModal.open = false;\n };\n\n const addConditionGroupModal = reactive({\n open: false,\n });\n const handleAddGroupCondition = () => {\n addConditionGroupModal.open = true;\n };\n const handleAddGroupConditionOK = (data: any) => {\n props.default_search_condition_config_list.forEach((item: any, index: any) => {\n data.new_list.forEach((item1: any, index1: any) => {\n if (index == index1) {\n item.forEach((item2: any) => {\n item1.forEach((item3: any) => {\n if (item2.field_name == item3.field_name) {\n item3.value = item2.value;\n item3.operator = item2.operator;\n }\n });\n });\n }\n });\n });\n emit('update_default_search_condition_config_list', { new_list: data.new_list });\n // refreshCondition();\n addConditionGroupModal.open = false;\n };\n const handleAddGroupConditionCancel = () => {\n addConditionGroupModal.open = false;\n };\n const handleSearch = () => {\n isShowForm.value = false;\n console.log('condition_model_dict.value', condition_model_dict.value);\n emit('search', { model: condition_model_dict.value });\n };\n const refreshCondition = (update_all = false) => {\n if (props.base_search_condition_config_list.length == 0) {\n return;\n }\n props.default_search_condition_config_list?.forEach((item_list: any, index: number) => {\n deleteBtnDict[index] = {};\n if (!condition_model_dict.value[index]) {\n condition_model_dict.value[index] = {};\n }\n props.base_search_condition_config_list.forEach((i: any) => {\n i.group?.forEach((group_item: any) => {\n item_list.forEach((k: any) => {\n if (group_item.field_name == k.field_name) {\n const value = condition_model_dict.value[index][k.field_name];\n if (value == undefined || update_all) {\n if (operator_type_count_map[k.operator] == 1) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = null;\n }\n } else if (operator_type_count_map[k.operator] == 2) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = [null, null];\n }\n } else if (operator_type_count_map[k.operator] == 0) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = [];\n }\n }\n }\n Object.assign(k, { ...group_item, operator: k.operator }); // 保持表单项原有选择的查询条件\n if (k.operator == 'eq' && k.mode != 'default') {\n group_item.mode = 'default';\n Object.assign(k, { model: 'default' });\n } else if (['in', 'notin'].includes(k.operator) && k.mode != 'multiple') {\n group_item.mode = 'multiple';\n Object.assign(k, { model: 'multiple' });\n }\n }\n });\n });\n });\n });\n };\n const onFilterChanged = () => {\n refreshCondition(true);\n };\n\n const deleteBtnDict = reactive({}); // 表单项的删除按钮是否显示\n const handleMouseEnter = (index: any, form_item: any) => {\n deleteBtnDict[index][form_item.field_name] = true;\n };\n const handleMouseLeave = (index: any, form_item: any) => {\n deleteBtnDict[index][form_item.field_name] = false;\n };\n const handleDeleteFormItem = (index: any, condition: any) => {\n //default_search_condition_config_list 不允许删除最后一个条件组的条件项\n const new_list = [];\n props.default_search_condition_config_list.forEach((item_list: any, index_: number) => {\n if (index_ !== index) {\n new_list.push(item_list);\n } else {\n const list = [];\n item_list.forEach((k: any) => {\n if (k.field_name !== condition.field_name) {\n list.push(k);\n }\n });\n if (list.length > 0) {\n new_list.push(list);\n }\n }\n });\n emit('update_default_search_condition_config_list', { new_list: new_list });\n // refreshCondition();\n };\n const handleDelSearch = (index, filed_name) => {\n if (condition_model_dict.value[index][filed_name] instanceof Array) {\n condition_model_dict.value[index][filed_name].length = 0;\n } else {\n condition_model_dict.value[index][filed_name] = null;\n }\n emit('onChangeValue', { model: condition_model_dict.value });\n emit('delSearch', { model: JSON.parse(JSON.stringify(condition_model_dict.value)) });\n };\n\n const onChangeSearchItem = (value: any, group_index, condition: any, condition_index) => {\n if (value instanceof Array && value.length > 0) {\n const selected_field_name = value[value.length - 1];\n let new_condition = null;\n props.base_search_condition_config_list.forEach(item_list => {\n item_list.group.forEach(i => {\n if (i.field_name === selected_field_name) {\n new_condition = JSON.parse(JSON.stringify(i));\n if (new_condition.default_operator) {\n new_condition.operator = new_condition.default_operator;\n } else if (get_operator_list_selected(new_condition).length > 0) {\n const [first] = get_operator_list_selected(new_condition);\n new_condition.operator = first;\n }\n }\n });\n });\n\n if (new_condition) {\n const new_list = JSON.parse(JSON.stringify(props.default_search_condition_config_list));\n new_list.forEach((item_list, i) => {\n if (i === group_index) {\n item_list.forEach((item, k) => {\n if (item.field_name == condition.field_name && k == condition_index) {\n item_list.splice(k, 1, new_condition);\n delete condition_model_dict.value[group_index][item.field_name];\n }\n });\n }\n });\n emit('update_default_search_condition_config_list', {\n new_list: new_list,\n });\n }\n refreshCondition();\n }\n };\n\n const searchItemOptionsDict: any = computed(() => {\n const dict = {};\n props.default_search_condition_config_list.forEach((group_item, index) => {\n dict[index] = [];\n const filter_field_name_list = group_item.map(item => item.field_name);\n props.base_search_condition_config_list.forEach(item => {\n const filter_list = item.group.filter(\n i => !filter_field_name_list.includes(i.field_name),\n );\n const o = {\n value: item.name,\n label: item.name,\n children: filter_list.map(i => {\n return {\n value: i.field_name,\n label: i.label,\n };\n }),\n };\n dict[index].push(o);\n });\n });\n return dict;\n });\n\n const isShowSearchTag = (index, condition) => {\n const value = condition_model_dict.value[index]?.[condition.field_name];\n if (value instanceof Array) {\n const [first] = value;\n if (isNotEmpty(first)) {\n return true;\n }\n } else if (isNotEmpty(value)) {\n return true;\n }\n return false;\n };\n\n const transferValueFunc = (index, condition) => {\n const str_list: any = [];\n const value = condition_model_dict.value[index]?.[condition.field_name];\n if (\n condition.operator === 'is_or_not_blank_or_null' ||\n condition.operator === 'is_or_not_null'\n ) {\n if (value === 'yes') {\n return t('is_or_not_blank_or_null.yes');\n } else {\n return t('is_or_not_blank_or_null.no');\n }\n } else if (condition.operator === '_eq') {\n if (['上月', '本月', '今日', '昨日', '期初'].includes(value)) {\n return t(value);\n }\n } else if (labelModel.value[condition.field_name] != undefined) {\n return `${get_operator_type_map(condition.format, condition.operator)} ${\n labelModel.value[condition.field_name]\n }`;\n } else if (value instanceof Array && condition.field_name_list instanceof Array) {\n let transfer_value;\n if (condition.field_name_list) {\n if (value instanceof Array) {\n transfer_value = value.join(',');\n } else {\n transfer_value = value;\n }\n }\n return `${get_operator_type_map(condition.format, condition.operator)} ${transfer_value}`;\n } else if (value instanceof Array && condition.options instanceof Array) {\n value.forEach(item => {\n condition.options.forEach(i => {\n if (item == i.value) {\n str_list.push(i.label);\n }\n });\n });\n return `${get_operator_type_map(condition.format, condition.operator)} ${str_list.join(\n ',',\n )}`;\n } else {\n let transfer_value;\n if (condition.options) {\n condition.options.forEach(i => {\n if (value == i.value) {\n transfer_value = i.label;\n }\n });\n } else if (condition.type == 'monthpicker' && condition.dateFormat) {\n if (value instanceof Array) {\n const str_list = [];\n value.forEach(i => {\n if (i) {\n str_list.push(moment(i).format(condition.dateFormat));\n } else {\n str_list.push(i);\n }\n });\n transfer_value = str_list.join(',');\n } else {\n transfer_value = moment(value).format(condition.dateFormat);\n }\n } else {\n transfer_value = value;\n }\n return `${get_operator_type_map(condition.format, condition.operator)} ${transfer_value}`;\n }\n };\n\n const handleShowSearchRender = () => {\n emit('onShowSearchRender');\n };\n\n const get_operator_list_selected = condition => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n } else if (condition.operator_list) {\n return condition.operator_list;\n } else {\n return [];\n }\n };\n\n watch(\n () => condition_model_dict.value,\n () => {\n emit('onChangeValue', { model: condition_model_dict.value });\n // console.log('onChangeValue_watch');\n },\n { deep: true },\n );\n watch(\n () => props.default_search_condition_config_list,\n () => {\n if (props.default_search_condition_config_list?.length == 0) {\n emit('update_default_search_condition_config_list', {\n new_list: source_default_search_condition_config_list.value,\n });\n return;\n }\n refreshCondition();\n },\n { deep: true },\n );\n watch(\n () => props.base_search_condition_config_list,\n () => {\n refreshCondition();\n },\n { deep: true },\n );\n\n watch(\n () => props.is_clear_model,\n () => {\n if (props.is_clear_model) {\n condition_model_dict.value = {};\n refreshCondition();\n emit('update:is_clear_model', false);\n }\n },\n );\n onMounted(() => {\n refreshCondition();\n if (props.eventBus) {\n props.eventBus.on('filterChange', onFilterChanged);\n }\n });\n onUnmounted(() => {\n if (props.eventBus) {\n props.eventBus.off('filterChange', onFilterChanged);\n }\n });\n return {\n props,\n t,\n isShowForm,\n labelModel,\n get_operator_type_map,\n condition_model_dict,\n addConditionModal,\n handleAddConditions,\n handleAddConditionOk,\n handleAddConditionCancel,\n onChangeOperator,\n handleAddGroupCondition,\n handleSearch,\n\n addConditionGroupModal,\n handleAddGroupConditionOK,\n handleAddGroupConditionCancel,\n validateInfos,\n\n deleteBtnDict,\n handleMouseEnter,\n handleMouseLeave,\n handleDeleteFormItem,\n handleDelSearch,\n\n searchItemOptionsDict,\n onChangeSearchItem,\n transferValueFunc,\n isShowSearchTag,\n handleShowSearchRender,\n options_eq,\n get_operator_list_selected,\n is_or_not_blank_or_null_options,\n };\n },\n});\n</script>\n<style lang=\"less\" scoped>\n.card {\n overflow: auto;\n max-height: 300px;\n background: #f2f5f7;\n}\n\n.condition-group {\n padding: 5px;\n}\n\n.range {\n margin-top: 5px;\n}\n\n.close-icon {\n width: 15px;\n margin-top: 5px;\n margin-left: 5px;\n color: red;\n}\n\n.search-bar {\n background: #f2f5f7;\n text-align: right;\n}\n\n:deep(.divider .ant-divider) {\n margin: 0;\n}\n</style>\n","<template>\n <a-space v-if=\"!is_massage_default\">\n <a-button\n type=\"link\"\n v-if=\"is_show_normal_search\"\n @click=\"handleShowSearchRender\"\n >\n {{ $t('普通') }}\n </a-button>\n <a-button\n v-if=\"!isShowForm\"\n type=\"link\"\n @click=\"\n () => {\n isShowForm = true;\n $emit('resize');\n }\n \"\n >\n <span class=\"expand-btn\">{{ $t('展开') }}</span>\n </a-button>\n <a-button\n v-else\n type=\"link\"\n @click=\"\n () => {\n isShowForm = false;\n $emit('resize');\n }\n \"\n >\n {{ $t('隐藏') }}\n </a-button>\n </a-space>\n <span v-show=\"!isShowForm\">\n <span\n v-for=\"(item, index) in default_search_condition_config_list\"\n :key=\"index\"\n >\n <a-tag>{{ $t('条件组') }}{{ index + 1 }}:</a-tag>\n <span\n v-for=\"condition in item\"\n :key=\"condition.field_name\"\n >\n <a-tag\n v-show=\"isShowSearchTag(index, condition)\"\n color=\"green\"\n >\n {{ condition.label }}: {{ transferValueFunc(index, condition) }}\n <close-outlined\n style=\"cursor: pointer; margin-left: 5px\"\n @click=\"handleDelSearch(index, condition.field_name)\"\n />\n </a-tag>\n </span>\n </span>\n </span>\n <div\n v-if=\"delayShow || isShowForm\"\n class=\"card\"\n v-show=\"isShowForm\"\n >\n <div\n v-for=\"(group_item, group_index) in default_search_condition_config_list\"\n :key=\"group_index\"\n >\n <div\n class=\"condition-group\"\n v-if=\"default_search_condition_config_list.length > 1\"\n >\n {{ $t('条件组') }} {{ group_index + 1 }}\n </div>\n <a-space\n :wrap=\"true\"\n align=\"center\"\n :size=\"0\"\n >\n <a-space-compact\n block\n v-for=\"(condition, k) in group_item\"\n :key=\"condition.field_name\"\n size=\"middle\"\n @mouseenter=\"handleMouseEnter(group_index, condition)\"\n @mouseleave=\"handleMouseLeave(group_index, condition)\"\n >\n <a-input-group compact>\n <a-tooltip :title=\"condition.label\">\n <a-cascader\n :value=\"condition.label\"\n style=\"width: 125px\"\n :options=\"searchItemOptionsDict[group_index]\"\n showSearch\n :allowClear=\"false\"\n :placeholder=\"$t('请选择...')\"\n @change=\"value => onChangeSearchItem(value, group_index, condition, k)\"\n />\n </a-tooltip>\n <a-tooltip :title=\"get_operator_type_map(condition.format, condition.operator)\">\n <a-select\n v-if=\"get_operator_list_selected(condition).length > 0\"\n :dropdownMatchSelectWidth=\"false\"\n v-model:value=\"condition.operator\"\n @change=\"value => onChangeOperator(value, group_index, condition)\"\n style=\"width: 100px\"\n >\n <a-select-option\n v-for=\"item in get_operator_list_selected(condition)\"\n :value=\"item\"\n :key=\"item\"\n >\n {{ get_operator_type_map(condition.format, item) }}\n </a-select-option>\n </a-select>\n </a-tooltip>\n <span\n style=\"width: 315px; height: 40px\"\n v-if=\"condition_model_dict && condition_model_dict[group_index]\"\n >\n <template\n v-if=\"['is_or_not_blank_or_null', 'is_or_not_null'].includes(condition.operator)\"\n >\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'select',\n mode: 'default',\n format: 'choices',\n class_name: 'str',\n placeholder: '',\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"is_or_not_blank_or_null_options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"['input'].includes(condition.format)\">\n <template\n v-if=\"condition.operator === 'between' || condition.operator === 'notbetween'\"\n >\n <template v-if=\"condition.type === 'datepicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, type: 'rangepicker', format: condition.dateFormat }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.type === 'monthpicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'monthrangepicker',\n format: condition.dateFormat,\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.type === 'timepicker'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'timerangepicker',\n format: condition.dateFormat,\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else>\n <a-flex>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name][0]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n <div class=\"range\">~</div>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name][1]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </a-flex>\n </template>\n </template>\n <template v-else-if=\"condition.operator === '_eq'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{\n ...condition,\n type: 'select',\n mode: 'default',\n format: 'choices',\n class_name: 'str',\n placeholder: '',\n }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"options_eq\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template\n v-else-if=\"\n condition.type === 'datepicker' ||\n condition.type === 'monthpicker' ||\n condition.type === 'timepicker'\n \"\n >\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, format: condition.dateFormat }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else>\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n </template>\n <template v-else-if=\"['choices', 'remote'].includes(condition.format)\">\n <template v-if=\"condition.format === 'choices'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"condition\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n <template v-else-if=\"condition.format === 'remote'\">\n <field-render-2\n :is_show_label=\"false\"\n v-model:label=\"labelModel[condition.field_name]\"\n v-model:value=\"condition_model_dict[group_index][condition.field_name]\"\n :field=\"{ ...condition, name: condition?.field_name }\"\n :formModel=\"condition_model_dict[group_index]\"\n :options=\"condition.options\"\n :validateInfos=\"validateInfos\"\n />\n </template>\n </template>\n </span>\n <span\n class=\"close-icon\"\n v-if=\"deleteBtnDict && deleteBtnDict[group_index]\"\n >\n <a-tooltip\n title=\"删除此条件\"\n v-if=\"\n deleteBtnDict[group_index][condition.field_name] &&\n (default_search_condition_config_list[0].length > 1 ||\n default_search_condition_config_list.length > 1) &&\n !is_massage_default\n \"\n >\n <close-circle-outlined @click=\"handleDeleteFormItem(group_index, condition)\" />\n </a-tooltip>\n </span>\n </a-input-group>\n </a-space-compact>\n </a-space>\n <a-divider\n class=\"divider\"\n style=\"margin: 0\"\n v-if=\"\n default_search_condition_config_list.length > 1 &&\n group_index != default_search_condition_config_list.length - 1\n \"\n >\n 或\n </a-divider>\n </div>\n </div>\n <div\n class=\"search-bar\"\n v-if=\"isShowForm && !is_massage_default\"\n >\n <a-space>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleAddConditions\"\n >\n {{ $t('添加条件') }}\n </a-button>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleAddGroupCondition\"\n >\n {{ $t('添加条件组') }}\n </a-button>\n <a-button\n size=\"small\"\n type=\"primary\"\n @click=\"handleSearch\"\n >\n {{ $t('查询') }}\n </a-button>\n </a-space>\n </div>\n\n <add-condition-modal\n v-if=\"addConditionModal.open\"\n :open=\"addConditionModal.open\"\n :default_search_condition_config_list=\"default_search_condition_config_list\"\n :base_search_condition_config_list=\"base_search_condition_config_list\"\n @ok=\"handleAddConditionOk\"\n @cancel=\"handleAddConditionCancel\"\n />\n\n <add-condition-group-modal\n v-if=\"addConditionGroupModal.open\"\n :open=\"addConditionGroupModal.open\"\n :default_search_condition_config_list=\"default_search_condition_config_list\"\n :base_search_condition_config_list=\"base_search_condition_config_list\"\n @ok=\"handleAddGroupConditionOK\"\n @cancel=\"handleAddGroupConditionCancel\"\n />\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n onMounted,\n reactive,\n ref,\n computed,\n watch,\n PropType,\n nextTick,\n onUnmounted,\n} from 'vue';\nimport FieldRender from 'liyu-pc-base/components/FormRender/FieldRender.vue';\nimport AddConditionModal from 'liyu-pc-base/components/FormRender/GeneralFilter/AddConditionModal/index.vue';\nimport AddConditionGroupModal from 'liyu-pc-base/components/FormRender/GeneralFilter/AddConditionGroupModal/index.vue';\nimport { isNotEmpty } from 'liyu-pc-base/utils/function';\nimport {\n CloseCircleOutlined,\n CloseOutlined,\n LeftOutlined,\n RightOutlined,\n} from '@ant-design/icons-vue';\nimport { useI18n } from 'vue-i18n';\nimport { get_options_eq } from 'liyu-pc-base/components/FormRender/GeneralFilter/data';\nimport moment from 'moment';\nimport FieldRender2 from 'liyu-pc-base/components/FormRender/FieldRender2.vue';\nimport { get_operator_type_map } from 'liyu-pc-base/utils/function';\n\nexport default defineComponent({\n name: 'GeneralFilter',\n props: {\n base_search_condition_config_list: {\n type: Array as PropType<any[]>,\n },\n default_search_condition_config_list: {\n type: Array as PropType<any[]>,\n },\n is_show_normal_search: {\n type: Boolean,\n default: () => false,\n },\n is_clear_model: {\n type: Boolean,\n default: () => false,\n },\n is_show_advantage: {\n type: Boolean,\n default: () => false,\n },\n is_massage_default: {\n type: Boolean,\n default: () => false,\n },\n eventBus: {\n type: Object,\n required: false,\n },\n delayShow: {\n type: Boolean,\n default: () => true,\n },\n },\n components: {\n FieldRender2,\n CloseOutlined,\n LeftOutlined,\n RightOutlined,\n FieldRender,\n AddConditionGroupModal,\n AddConditionModal,\n CloseCircleOutlined,\n },\n emits: [\n 'search',\n 'resize',\n 'update_default_search_condition_config_list',\n 'onShowSearchRender',\n 'delSearch',\n 'onChangeValue',\n 'update:is_clear_model',\n ],\n setup(props, { emit }) {\n const isShowForm = ref(props.is_massage_default);\n const labelModel = ref({});\n const { t } = useI18n();\n const { options_eq } = get_options_eq(t);\n //条件组-->\n const condition_model_dict = ref([]);\n const validateInfos = {};\n const source_default_search_condition_config_list = ref(null);\n const is_or_not_blank_or_null_options = ref([\n { value: 'yes', label: t('is_or_not_blank_or_null.yes') },\n { value: 'no', label: t('is_or_not_blank_or_null.no') },\n ]);\n if (!source_default_search_condition_config_list.value) {\n source_default_search_condition_config_list.value = JSON.parse(\n JSON.stringify(props.default_search_condition_config_list),\n );\n }\n\n const operator_type_count_map = {\n between: 2,\n gt: 1,\n lt: 1,\n gte: 1,\n lte: 1,\n in: 0,\n eq: 1,\n _eq: 1,\n contains: 1,\n icontains: 1,\n startswith: 1,\n istartswith: 1,\n endswith: 1,\n iendswith: 1,\n notbetween: 2,\n notin: 0,\n notcontains: 1,\n noticontains: 1,\n notstartswith: 1,\n notistartswith: 1,\n notendswith: 1,\n notiendswith: 1,\n not_eq: 1,\n not_blank_not_null: 1,\n json_list_not_blank_not_null: 1,\n json_list_is_blank_is_null: 1,\n is_or_not_blank_or_null: 1,\n is_or_not_null: 1,\n };\n const is2DArray = arr => {\n const [first] = [arr];\n return Array.isArray(first) && arr.every(subArray => Array.isArray(subArray));\n };\n let old_operator = null;\n const onChangeOperator = (operator, index, condition) => {\n //不同操作类型,设置不同的默认值\n // if (condition_model_dict.value[index][condition.field_name]) {\n // return;\n // }\n const value = condition_model_dict.value[index][condition.field_name];\n if (get_operator_list_selected(condition).includes('_eq')) {\n if (operator == '_eq') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == '_eq') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (get_operator_list_selected(condition).includes('not_blank_not_null')) {\n if (operator == 'not_blank_not_null') {\n condition_model_dict.value[index][condition.field_name] = '是';\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == 'not_blank_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (\n get_operator_list_selected(condition).includes('is_or_not_blank_or_null') ||\n get_operator_list_selected(condition).includes('is_or_not_null')\n ) {\n if (operator == 'is_or_not_blank_or_null' || operator == 'is_or_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n } else if (old_operator == 'is_or_not_blank_or_null' || old_operator == 'is_or_not_null') {\n condition_model_dict.value[index][condition.field_name] = null;\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n return;\n }\n }\n if (value instanceof Array && is2DArray(value)) {\n // 级联类型,默认值默认清空\n condition_model_dict.value[index][condition.field_name] = undefined;\n } else if (operator_type_count_map[operator] == 1) {\n if (value instanceof Array) {\n const [first] = condition_model_dict.value[index][condition.field_name];\n if (isNotEmpty(first)) {\n condition_model_dict.value[index][condition.field_name] = first;\n } else {\n condition_model_dict.value[index][condition.field_name] = null;\n }\n } else {\n condition_model_dict.value[index][condition.field_name] = value ? value : null;\n }\n const is = options_eq.some(\n obj => obj.value === condition_model_dict.value[index][condition.field_name],\n );\n if (is) {\n condition_model_dict.value[index][condition.field_name] = null;\n }\n } else if (operator_type_count_map[operator] == 2) {\n if (condition_model_dict.value[index][condition.field_name] instanceof Array) {\n const [first, seconds] = condition_model_dict.value[index][condition.field_name];\n condition_model_dict.value[index][condition.field_name] = [first, seconds];\n } else if (condition_model_dict.value[index][condition.field_name]) {\n const first = condition_model_dict.value[index][condition.field_name];\n condition_model_dict.value[index][condition.field_name] = [first, null];\n } else {\n condition_model_dict.value[index][condition.field_name] = [null, null];\n }\n const is = options_eq.some(\n obj => obj.value === condition_model_dict.value[index][condition.field_name][0],\n );\n if (is) {\n condition_model_dict.value[index][condition.field_name] = [null, null];\n }\n } else { \n condition_model_dict.value[index][condition.field_name] = undefined;\n }\n old_operator = operator;\n emit('onChangeValue', { model: condition_model_dict.value });\n // console.log('onChangeValue');\n };\n\n const addConditionModal = reactive({\n open: false,\n });\n const handleAddConditions = () => {\n addConditionModal.open = true;\n };\n const handleAddConditionOk = (data: any) => {\n props.default_search_condition_config_list.forEach((item: any, index: any) => {\n data.new_list.forEach((item1: any, index1: any) => {\n if (index == index1) {\n item.forEach((item2: any) => {\n item1.forEach((item3: any) => {\n if (item2.field_name == item3.field_name) {\n item3.value = item2.value;\n item3.operator = item2.operator;\n }\n });\n });\n }\n });\n });\n //保存后处理 new_list\n emit('update_default_search_condition_config_list', { new_list: data.new_list });\n // refreshCondition();\n addConditionModal.open = false;\n };\n const handleAddConditionCancel = () => {\n addConditionModal.open = false;\n };\n\n const addConditionGroupModal = reactive({\n open: false,\n });\n const handleAddGroupCondition = () => {\n addConditionGroupModal.open = true;\n };\n const handleAddGroupConditionOK = (data: any) => {\n props.default_search_condition_config_list.forEach((item: any, index: any) => {\n data.new_list.forEach((item1: any, index1: any) => {\n if (index == index1) {\n item.forEach((item2: any) => {\n item1.forEach((item3: any) => {\n if (item2.field_name == item3.field_name) {\n item3.value = item2.value;\n item3.operator = item2.operator;\n }\n });\n });\n }\n });\n });\n emit('update_default_search_condition_config_list', { new_list: data.new_list });\n // refreshCondition();\n addConditionGroupModal.open = false;\n };\n const handleAddGroupConditionCancel = () => {\n addConditionGroupModal.open = false;\n };\n const handleSearch = () => {\n isShowForm.value = false;\n console.log('condition_model_dict.value', condition_model_dict.value);\n emit('search', { model: condition_model_dict.value });\n };\n const refreshCondition = (update_all = false) => {\n if (props.base_search_condition_config_list.length == 0) {\n return;\n }\n props.default_search_condition_config_list?.forEach((item_list: any, index: number) => {\n deleteBtnDict[index] = {};\n if (!condition_model_dict.value[index]) {\n condition_model_dict.value[index] = {};\n }\n props.base_search_condition_config_list.forEach((i: any) => {\n i.group?.forEach((group_item: any) => {\n item_list.forEach((k: any) => {\n if (group_item.field_name == k.field_name) {\n const value = condition_model_dict.value[index][k.field_name];\n if (value == undefined || update_all) {\n if (operator_type_count_map[k.operator] == 1) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = null;\n }\n } else if (operator_type_count_map[k.operator] == 2) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = [null, null];\n }\n } else if (operator_type_count_map[k.operator] == 0) {\n if (k.value !== undefined) {\n condition_model_dict.value[index][k.field_name] = k.value;\n } else {\n condition_model_dict.value[index][k.field_name] = [];\n }\n }\n }\n Object.assign(k, { ...group_item, operator: k.operator }); // 保持表单项原有选择的查询条件\n if (k.operator == 'eq' && k.mode != 'default') {\n group_item.mode = 'default';\n Object.assign(k, { model: 'default' });\n } else if (['in', 'notin'].includes(k.operator) && k.mode != 'multiple') {\n group_item.mode = 'multiple';\n Object.assign(k, { model: 'multiple' });\n }\n }\n });\n });\n });\n });\n };\n const onFilterChanged = () => {\n refreshCondition(true);\n };\n\n const deleteBtnDict = reactive({}); // 表单项的删除按钮是否显示\n const handleMouseEnter = (index: any, form_item: any) => {\n deleteBtnDict[index][form_item.field_name] = true;\n };\n const handleMouseLeave = (index: any, form_item: any) => {\n deleteBtnDict[index][form_item.field_name] = false;\n };\n const handleDeleteFormItem = (index: any, condition: any) => {\n //default_search_condition_config_list 不允许删除最后一个条件组的条件项\n const new_list = [];\n props.default_search_condition_config_list.forEach((item_list: any, index_: number) => {\n if (index_ !== index) {\n new_list.push(item_list);\n } else {\n const list = [];\n item_list.forEach((k: any) => {\n if (k.field_name !== condition.field_name) {\n list.push(k);\n }\n });\n if (list.length > 0) {\n new_list.push(list);\n }\n }\n });\n emit('update_default_search_condition_config_list', { new_list: new_list });\n // refreshCondition();\n };\n const handleDelSearch = (index, filed_name) => {\n if (condition_model_dict.value[index][filed_name] instanceof Array) {\n condition_model_dict.value[index][filed_name].length = 0;\n } else {\n condition_model_dict.value[index][filed_name] = null;\n }\n emit('onChangeValue', { model: condition_model_dict.value });\n emit('delSearch', { model: JSON.parse(JSON.stringify(condition_model_dict.value)) });\n };\n\n const onChangeSearchItem = (value: any, group_index, condition: any, condition_index) => {\n if (value instanceof Array && value.length > 0) {\n const selected_field_name = value[value.length - 1];\n let new_condition = null;\n props.base_search_condition_config_list.forEach(item_list => {\n item_list.group.forEach(i => {\n if (i.field_name === selected_field_name) {\n new_condition = JSON.parse(JSON.stringify(i));\n if (new_condition.default_operator) {\n new_condition.operator = new_condition.default_operator;\n } else if (get_operator_list_selected(new_condition).length > 0) {\n const [first] = get_operator_list_selected(new_condition);\n new_condition.operator = first;\n }\n }\n });\n });\n\n if (new_condition) {\n const new_list = JSON.parse(JSON.stringify(props.default_search_condition_config_list));\n new_list.forEach((item_list, i) => {\n if (i === group_index) {\n item_list.forEach((item, k) => {\n if (item.field_name == condition.field_name && k == condition_index) {\n item_list.splice(k, 1, new_condition);\n delete condition_model_dict.value[group_index][item.field_name];\n }\n });\n }\n });\n emit('update_default_search_condition_config_list', {\n new_list: new_list,\n });\n }\n refreshCondition();\n }\n };\n\n const searchItemOptionsDict: any = computed(() => {\n const dict = {};\n props.default_search_condition_config_list.forEach((group_item, index) => {\n dict[index] = [];\n const filter_field_name_list = group_item.map(item => item.field_name);\n props.base_search_condition_config_list.forEach(item => {\n const filter_list = item.group.filter(\n i => !filter_field_name_list.includes(i.field_name),\n );\n const o = {\n value: item.name,\n label: item.name,\n children: filter_list.map(i => {\n return {\n value: i.field_name,\n label: i.label,\n };\n }),\n };\n dict[index].push(o);\n });\n });\n return dict;\n });\n\n const isShowSearchTag = (index, condition) => {\n const value = condition_model_dict.value[index]?.[condition.field_name];\n if (value instanceof Array) {\n const [first] = value;\n if (isNotEmpty(first)) {\n return true;\n }\n } else if (isNotEmpty(value)) {\n return true;\n }\n return false;\n };\n\n const transferValueFunc = (index, condition) => {\n const str_list: any = [];\n const value = condition_model_dict.value[index]?.[condition.field_name];\n if (\n condition.operator === 'is_or_not_blank_or_null' ||\n condition.operator === 'is_or_not_null'\n ) {\n if (value === 'yes') {\n return t('is_or_not_blank_or_null.yes');\n } else {\n return t('is_or_not_blank_or_null.no');\n }\n } else if (condition.operator === '_eq') {\n if (['上月', '本月', '今日', '昨日', '期初'].includes(value)) {\n return t(value);\n }\n } else if (labelModel.value[condition.field_name] != undefined) {\n return `${get_operator_type_map(condition.format, condition.operator)} ${\n labelModel.value[condition.field_name]\n }`;\n } else if (value instanceof Array && condition.field_name_list instanceof Array) {\n let transfer_value;\n if (condition.field_name_list) {\n if (value instanceof Array) {\n transfer_value = value.join(',');\n } else {\n transfer_value = value;\n }\n }\n return `${get_operator_type_map(condition.format, condition.operator)} ${transfer_value}`;\n } else if (value instanceof Array && condition.options instanceof Array) {\n value.forEach(item => {\n condition.options.forEach(i => {\n if (item == i.value) {\n str_list.push(i.label);\n }\n });\n });\n return `${get_operator_type_map(condition.format, condition.operator)} ${str_list.join(\n ',',\n )}`;\n } else {\n let transfer_value;\n if (condition.options) {\n condition.options.forEach(i => {\n if (value == i.value) {\n transfer_value = i.label;\n }\n });\n } else if (condition.type == 'monthpicker' && condition.dateFormat) {\n if (value instanceof Array) {\n const str_list = [];\n value.forEach(i => {\n if (i) {\n str_list.push(moment(i).format(condition.dateFormat));\n } else {\n str_list.push(i);\n }\n });\n transfer_value = str_list.join(',');\n } else {\n transfer_value = moment(value).format(condition.dateFormat);\n }\n } else {\n transfer_value = value;\n }\n return `${get_operator_type_map(condition.format, condition.operator)} ${transfer_value}`;\n }\n };\n\n const handleShowSearchRender = () => {\n emit('onShowSearchRender');\n };\n\n const get_operator_list_selected = condition => {\n if (condition.operator_list_selected) {\n return condition.operator_list_selected;\n } else if (condition.operator_list) {\n return condition.operator_list;\n } else {\n return [];\n }\n };\n\n watch(\n () => condition_model_dict.value,\n () => {\n emit('onChangeValue', { model: condition_model_dict.value });\n // console.log('onChangeValue_watch');\n },\n { deep: true },\n );\n watch(\n () => props.default_search_condition_config_list,\n () => {\n if (props.default_search_condition_config_list?.length == 0) {\n emit('update_default_search_condition_config_list', {\n new_list: source_default_search_condition_config_list.value,\n });\n return;\n }\n refreshCondition();\n },\n { deep: true },\n );\n watch(\n () => props.base_search_condition_config_list,\n () => {\n refreshCondition();\n },\n { deep: true },\n );\n\n watch(\n () => props.is_clear_model,\n () => {\n if (props.is_clear_model) {\n condition_model_dict.value = {};\n refreshCondition();\n emit('update:is_clear_model', false);\n }\n },\n );\n onMounted(() => {\n refreshCondition();\n if (props.eventBus) {\n props.eventBus.on('filterChange', onFilterChanged);\n }\n });\n onUnmounted(() => {\n if (props.eventBus) {\n props.eventBus.off('filterChange', onFilterChanged);\n }\n });\n return {\n props,\n t,\n isShowForm,\n labelModel,\n get_operator_type_map,\n condition_model_dict,\n addConditionModal,\n handleAddConditions,\n handleAddConditionOk,\n handleAddConditionCancel,\n onChangeOperator,\n handleAddGroupCondition,\n handleSearch,\n\n addConditionGroupModal,\n handleAddGroupConditionOK,\n handleAddGroupConditionCancel,\n validateInfos,\n\n deleteBtnDict,\n handleMouseEnter,\n handleMouseLeave,\n handleDeleteFormItem,\n handleDelSearch,\n\n searchItemOptionsDict,\n onChangeSearchItem,\n transferValueFunc,\n isShowSearchTag,\n handleShowSearchRender,\n options_eq,\n get_operator_list_selected,\n is_or_not_blank_or_null_options,\n };\n },\n});\n</script>\n<style lang=\"less\" scoped>\n.card {\n overflow: auto;\n max-height: 300px;\n background: #f2f5f7;\n}\n\n.condition-group {\n padding: 5px;\n}\n\n.range {\n margin-top: 5px;\n}\n\n.close-icon {\n width: 15px;\n margin-top: 5px;\n margin-left: 5px;\n color: red;\n}\n\n.search-bar {\n background: #f2f5f7;\n text-align: right;\n}\n\n:deep(.divider .ant-divider) {\n margin: 0;\n}\n</style>\n","<template>\n <a-form\n ref=\"form\"\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n :layout=\"form.settings.layout\"\n :validateTrigger=\"false\"\n :label-col=\"\n form.settings.layout == 'vertical'\n ? undefined\n : form.settings.labelCol\n ? form.settings.labelCol\n : form.settings.col && form.settings.col.length > 0\n ? { span: 6 }\n : { span: 4 }\n \"\n :wrapper-col=\"\n form.settings.layout == 'vertical'\n ? undefined\n : form.settings.wrapperCol\n ? form.settings.wrapperCol\n : form.settings.col && form.settings.col.length > 0\n ? { span: 18 }\n : { span: 20 }\n \"\n :labelAlign=\"form.settings.labelAlign\"\n scrollToFirstError\n >\n <a-row\n :gutter=\"20\"\n style=\"margin: 0\"\n >\n <template v-if=\"form.settings.col && form.settings.col.length > 0\">\n <a-col\n v-for=\"col in fieldList\"\n :xl=\"24 / fieldList.length\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <field-render\n v-for=\"field in form.fields.slice(col[0], col[1])\"\n v-model:value=\"model[field.name]\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </a-col>\n </template>\n <a-col\n v-if=\"!form.settings.col || form.settings.col.length === 0\"\n :xl=\"24\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <template v-for=\"field in form.fields\">\n <field-render\n v-model:value=\"model[field.name]\"\n v-model:label=\"model[field.name2]\"\n v-if=\"field.name2\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n <field-render\n v-model:value=\"model[field.name]\"\n v-else\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </template>\n </a-col>\n </a-row>\n </a-form>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, watch } from 'vue';\n\nexport default defineComponent({\n name: 'FormRender',\n components: {},\n props: {\n model: {\n type: Object,\n required: true,\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n },\n setup(props) {\n if (props.form.watch) {\n for (const k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n },\n\n data() {\n return {\n fieldList: [] as any[],\n };\n },\n methods: {\n validate() {\n return (this.$refs.form as any).validate();\n },\n reset() {\n (this.$refs.form as any).resetFields();\n },\n disable(name: string | number) {\n // eslint-disable-next-line vue/no-mutating-props\n this.form.fields[name].disabled = true;\n },\n disableAll() {\n this.form.fields.forEach((item: any) => {\n item.disabled = true;\n });\n },\n },\n created() {\n let a = 0;\n if (this.form.settings.col && this.form.settings.col.length > 0) {\n this.form.settings.col.forEach((item: number, i: number) => {\n a = a + item;\n if (i === 0) {\n this.fieldList.push([0, a]);\n } else {\n this.fieldList.push([a - item, a]);\n }\n });\n }\n },\n});\n</script>\n","<template>\n <a-form\n ref=\"form\"\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n :layout=\"form.settings.layout\"\n :validateTrigger=\"false\"\n :label-col=\"\n form.settings.layout == 'vertical'\n ? undefined\n : form.settings.labelCol\n ? form.settings.labelCol\n : form.settings.col && form.settings.col.length > 0\n ? { span: 6 }\n : { span: 4 }\n \"\n :wrapper-col=\"\n form.settings.layout == 'vertical'\n ? undefined\n : form.settings.wrapperCol\n ? form.settings.wrapperCol\n : form.settings.col && form.settings.col.length > 0\n ? { span: 18 }\n : { span: 20 }\n \"\n :labelAlign=\"form.settings.labelAlign\"\n scrollToFirstError\n >\n <a-row\n :gutter=\"20\"\n style=\"margin: 0\"\n >\n <template v-if=\"form.settings.col && form.settings.col.length > 0\">\n <a-col\n v-for=\"col in fieldList\"\n :xl=\"24 / fieldList.length\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <field-render\n v-for=\"field in form.fields.slice(col[0], col[1])\"\n v-model:value=\"model[field.name]\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </a-col>\n </template>\n <a-col\n v-if=\"!form.settings.col || form.settings.col.length === 0\"\n :xl=\"24\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <template v-for=\"field in form.fields\">\n <field-render\n v-model:value=\"model[field.name]\"\n v-model:label=\"model[field.name2]\"\n v-if=\"field.name2\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n <field-render\n v-model:value=\"model[field.name]\"\n v-else\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </template>\n </a-col>\n </a-row>\n </a-form>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, watch } from 'vue';\n\nexport default defineComponent({\n name: 'FormRender',\n components: {},\n props: {\n model: {\n type: Object,\n required: true,\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n },\n setup(props) {\n if (props.form.watch) {\n for (const k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n },\n\n data() {\n return {\n fieldList: [] as any[],\n };\n },\n methods: {\n validate() {\n return (this.$refs.form as any).validate();\n },\n reset() {\n (this.$refs.form as any).resetFields();\n },\n disable(name: string | number) {\n // eslint-disable-next-line vue/no-mutating-props\n this.form.fields[name].disabled = true;\n },\n disableAll() {\n this.form.fields.forEach((item: any) => {\n item.disabled = true;\n });\n },\n },\n created() {\n let a = 0;\n if (this.form.settings.col && this.form.settings.col.length > 0) {\n this.form.settings.col.forEach((item: number, i: number) => {\n a = a + item;\n if (i === 0) {\n this.fieldList.push([0, a]);\n } else {\n this.fieldList.push([a - item, a]);\n }\n });\n }\n },\n});\n</script>\n","<template>\n <a-form\n ref=\"form\"\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n scrollToFirstError\n >\n <a-row\n gutter=\"5\"\n v-for=\"row in form.fieldList\"\n type=\"flex\"\n >\n <a-col\n v-for=\"field in row\"\n :span=\"field.span\"\n >\n <template v-for=\"field in form.fields\">\n <field-render\n v-model:value=\"model[field.name]\"\n v-model:label=\"model[field.name2]\"\n v-if=\"field.name2\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n <field-render\n v-model:value=\"model[field.name]\"\n v-else\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </template>\n </a-col>\n </a-row>\n </a-form>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, watch } from 'vue';\n\nexport default defineComponent({\n name: 'FormRender2',\n components: {},\n props: {\n model: {\n type: Object,\n required: true,\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n },\n setup(props) {\n if (props.form.watch) {\n for (const k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n },\n\n data() {\n return {};\n },\n methods: {\n validate() {\n return (this.$refs.form as any).validate();\n },\n reset() {\n (this.$refs.form as any).resetFields();\n },\n disable(name: string | number) {\n // eslint-disable-next-line vue/no-mutating-props\n this.form.fields[name].disabled = true;\n },\n disableAll() {\n this.form.fields.forEach((item: any) => {\n item.disabled = true;\n });\n },\n },\n created() {},\n});\n</script>\n","<template>\n <a-form\n ref=\"form\"\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n scrollToFirstError\n >\n <a-row\n gutter=\"5\"\n v-for=\"row in form.fieldList\"\n type=\"flex\"\n >\n <a-col\n v-for=\"field in row\"\n :span=\"field.span\"\n >\n <template v-for=\"field in form.fields\">\n <field-render\n v-model:value=\"model[field.name]\"\n v-model:label=\"model[field.name2]\"\n v-if=\"field.name2\"\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n <field-render\n v-model:value=\"model[field.name]\"\n v-else\n :field=\"field\"\n :formModel=\"model\"\n :key=\"field.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field.datasource ? field.datasource : field.name]\"\n />\n </template>\n </a-col>\n </a-row>\n </a-form>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, watch } from 'vue';\n\nexport default defineComponent({\n name: 'FormRender2',\n components: {},\n props: {\n model: {\n type: Object,\n required: true,\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n },\n setup(props) {\n if (props.form.watch) {\n for (const k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n },\n\n data() {\n return {};\n },\n methods: {\n validate() {\n return (this.$refs.form as any).validate();\n },\n reset() {\n (this.$refs.form as any).resetFields();\n },\n disable(name: string | number) {\n // eslint-disable-next-line vue/no-mutating-props\n this.form.fields[name].disabled = true;\n },\n disableAll() {\n this.form.fields.forEach((item: any) => {\n item.disabled = true;\n });\n },\n },\n created() {},\n});\n</script>\n","export const CUSTOM_VIEW_DATA_USER = 'customviewdatauser';\n","<template>\n <a-card :body-style=\"{ padding: 0, height: height + 87 + 'px', overflowY: 'auto' }\">\n <a-collapse\n v-model:activeKey=\"viewKey\"\n :bordered=\"false\"\n class=\"collapses\"\n style=\"background: rgb(255, 255, 255)\"\n >\n <template #expandIcon=\"{ isActive }\">\n <caret-right-outlined :rotate=\"isActive ? 90 : 0\" />\n </template>\n <a-collapse-panel\n :key=\"'1'\"\n :style=\"customStyle\"\n >\n <template #header>\n <span style=\"font-weight: 700\">{{ $t('个人视图') }}</span>\n </template>\n <template #extra>\n <a-tooltip>\n <template #title>{{ $t('个人视图管理') }}</template>\n <setting-outlined\n style=\"margin-right: 10px\"\n @click.stop=\"editView('personal')\"\n />\n </a-tooltip>\n <a-tooltip>\n <template #title>{{ $t('新建个人视图') }}</template>\n <plus-outlined @click.stop=\"addView('personal')\" />\n </a-tooltip>\n </template>\n <a-table\n v-if=\"personData.length > 0\"\n :columns=\"columns\"\n :customRow=\"customRow\"\n :dataSource=\"personData\"\n :pagination=\"false\"\n :showHeader=\"false\"\n :size=\"'small'\"\n >\n <template #bodyCell=\"{ column, record }\">\n <div\n class=\"table\"\n v-if=\"column.dataIndex === 'name'\"\n style=\"width: 100%; cursor: pointer\"\n @click=\"changeView(record)\"\n >\n <a-tooltip\n :title=\"record.name\"\n :color=\"appStore.primaryColor\"\n placement=\"left\"\n :destroyTooltipOnHide=\"true\"\n :overlayStyle=\"{ maxWidth: '200px' }\"\n >\n <div style=\"max-width: 130px; float: left; white-space: nowrap; overflow: hidden\">\n {{ record.name }}\n </div>\n </a-tooltip>\n <span\n class=\"num\"\n style=\"float: right\"\n :style=\"\n currentViewObj.id === record.id ? { color: '#1890ff', fontWeight: 'bold' } : {}\n \"\n >\n {{ record.num }}\n </span>\n <a-dropdown class=\"dropdown\">\n <span\n style=\"float: right; font-weight: 800\"\n @click.stop=\"\"\n >\n · · ·\n </span>\n <template #overlay>\n <a-menu>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleSubmit(record, 'personal')\"\n >\n {{ $t('编辑') }}\n </a>\n </a-menu-item>\n <a-menu-item>\n <a\n href=\"javascript:;\"\n @click=\"handleShare(record)\"\n >\n {{ $t('分享视图') }}\n </a>\n </a-menu-item>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleDelet(record)\"\n >\n {{ $t('删除') }}\n </a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n </template>\n </a-table>\n </a-collapse-panel>\n <a-collapse-panel\n :key=\"'2'\"\n :style=\"customStyle\"\n >\n <template #header>\n <span style=\"font-weight: 700\">{{ $t('公共视图') }}</span>\n </template>\n <template #extra>\n <a-tooltip>\n <template #title>{{ $t('公共视图管理') }}</template>\n <setting-outlined\n style=\"margin-right: 10px\"\n @click.stop=\"editView('public')\"\n />\n </a-tooltip>\n <a-tooltip>\n <template #title>{{ $t('新建公共视图') }}</template>\n <plus-outlined @click.stop=\"addView('public')\" />\n </a-tooltip>\n </template>\n <a-table\n v-if=\"publicData.length > 0\"\n :columns=\"columns\"\n :customRow=\"customRow\"\n :dataSource=\"publicData\"\n :pagination=\"false\"\n :showHeader=\"false\"\n :size=\"'small'\"\n >\n <template #bodyCell=\"{ column, record }\">\n <div\n class=\"table\"\n v-if=\"column.dataIndex === 'name'\"\n style=\"width: 100%; cursor: pointer\"\n @click=\"changeView(record)\"\n >\n <a-tooltip\n :title=\"record.name\"\n :color=\"appStore.primaryColor\"\n placement=\"left\"\n :destroyTooltipOnHide=\"true\"\n :overlayStyle=\"{ maxWidth: '200px' }\"\n >\n <div style=\"max-width: 130px; float: left; white-space: nowrap; overflow: hidden\">\n {{ record.name }}\n </div>\n </a-tooltip>\n <span\n class=\"num\"\n style=\"float: right\"\n :style=\"\n currentViewObj.id === record.id ? { color: '#1890ff', fontWeight: 'bold' } : {}\n \"\n >\n {{ record.num }}\n </span>\n <a-dropdown class=\"dropdown\">\n <span\n style=\"float: right; font-weight: 800\"\n @click.stop=\"\"\n >\n · · ·\n </span>\n <template #overlay>\n <a-menu>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleSubmit(record, 'public')\"\n >\n {{ $t('编辑') }}\n </a>\n </a-menu-item>\n <a-menu-item>\n <a\n href=\"javascript:;\"\n @click=\"handleShare(record)\"\n >\n {{ $t('分享视图') }}\n </a>\n </a-menu-item>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleDelet(record)\"\n >\n {{ $t('删除') }}\n </a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n </template>\n </a-table>\n </a-collapse-panel>\n </a-collapse>\n </a-card>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n createVNode,\n defineComponent,\n onActivated,\n onMounted,\n onUnmounted,\n PropType,\n reactive,\n ref,\n watch,\n} from 'vue';\nimport {\n CaretRightOutlined,\n ExclamationCircleOutlined,\n PlusOutlined,\n SettingOutlined,\n} from '@ant-design/icons-vue';\nimport modalBox from 'liyu-pc-base/components/form-modal/modal-tools';\nimport { message, Modal } from 'ant-design-vue';\nimport { useUserStore } from 'liyu-pc-base/init-plugin';\nimport { useAppStore } from 'liyu-pc-base/init-plugin';\nimport {\n change_view_settings_sort,\n create_view_settings,\n delete_view_settings,\n query_view_settings_list,\n refresh_view_settings_cache,\n set_view_settings_default,\n update_view_settings,\n} from 'liyu-pc-base/api/view-model';\nimport { sourceStore } from 'liyu-pc-base/init-plugin';\nimport { copyValue } from 'liyu-pc-base/utils/function';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\nimport { getPageConfig } from 'liyu-pc-base/components/remotePages/index';\nimport { useI18n } from 'vue-i18n';\nimport { useRequiredConditionStore } from 'liyu-pc-base/init-plugin';\nimport { required_condition_event_obj } from 'liyu-pc-base/init-plugin';\nimport { useEnv } from 'liyu-pc-base/init-plugin';\nimport { CUSTOM_VIEW_DATA_USER } from 'liyu-pc-base/constants';\n\nconst VIEW_SYSTEM_EDIT = 'view_system_edit';\nconst columns = [\n {\n title: '',\n dataIndex: 'name',\n key: 'name',\n },\n];\nexport default defineComponent({\n name: 'ViewManage',\n components: {\n CaretRightOutlined,\n PlusOutlined,\n SettingOutlined,\n },\n props: {\n currentViewObj: {\n type: Object,\n required: true,\n },\n menu_flag: {\n type: String,\n required: true,\n },\n menu_name: {\n type: String,\n required: true,\n },\n countData: {\n type: String,\n required: true,\n },\n create_num: {\n type: Number,\n required: true,\n },\n current_num: {\n type: Number,\n required: true,\n },\n count_num: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n modalType: {\n type: String,\n },\n app_flag: {\n type: String,\n },\n allBaseConfigMap: {\n type: Object,\n required: true,\n },\n searchConfigFields: {\n type: Array as PropType<any[]>,\n required: true,\n },\n },\n emits: ['change'],\n setup(props, { emit }) {\n const env = useEnv();\n const requiredConditionStore = useRequiredConditionStore();\n const userStore = useUserStore();\n const appStore = useAppStore();\n const current_org = userStore.currentOrg;\n const userid = userStore.userid;\n const is_auth = ref(userStore.CHECK_AUTH(VIEW_SYSTEM_EDIT));\n const viewData = ref([]); // 视图数据\n const { t } = useI18n();\n let mergedConfig: any;\n const personData = computed(() => {\n const list = viewData.value\n .filter((item: any) => !!item.user_id && item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n const list1 = viewData.value\n .filter((item: any) => !!item.user_id && !item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n return list.concat(list1);\n }); // 个人视图数据\n const publicData = computed(() => {\n const list = viewData.value\n .filter((item: any) => !item.user_id && item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n const list1 = viewData.value\n .filter((item: any) => !item.user_id && !item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n return list.concat(list1);\n }); // 公共视图数据\n const viewNameList = computed(() => {\n return viewData.value.map((item: any) => {\n return item.name;\n });\n }); // 视图名称列表,用于创建、修改时查重\n const filterConditions = (conditions: any) => {\n const res = [];\n for (const group of conditions) {\n const group_item = [];\n for (const item of group) {\n if (props.allBaseConfigMap[item.field_name]) {\n group_item.push(item);\n }\n }\n if (group_item.length > 0) {\n res.push(group_item);\n }\n }\n return res;\n };\n const filter_search_model = (search_model: any) => {\n const res = {};\n const fieldMap = {};\n if (!search_model) {\n return res;\n }\n if (props.searchConfigFields?.length) {\n for (const item of props.searchConfigFields) {\n fieldMap[item.name] = item;\n }\n }\n for (const key of Object.keys(search_model)) {\n if (fieldMap[key]) {\n res[key] = search_model[key];\n }\n }\n return res;\n };\n const fetchData = async ({\n id,\n search_model,\n filter_map,\n sort_fields,\n group_condition,\n conditions,\n isShowGeneralFilter,\n }) => {\n return new Promise(resolve => {\n if (!props.countData && !mergedConfig?.countData) {\n console.error('无count接口');\n resolve(null);\n }\n const obj: any = {\n org_id: current_org.id,\n ...filter_search_model(search_model || {}),\n ...filter_map,\n sort_fields: sort_fields,\n };\n if (isShowGeneralFilter) {\n obj.group_condition = group_condition;\n obj.conditions = filterConditions(conditions);\n }\n obj.required_condition = getRequiredConditionObj();\n let db_alias = null;\n const page_config = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (page_config.get_db_alias) {\n db_alias = page_config.get_db_alias();\n }\n obj.db_alias = db_alias;\n getApiData(obj, mergedConfig?.countData ? mergedConfig.countData : props.countData)\n .then((res: any) => {\n viewData.value.forEach((item: any) => {\n if (item.id == id) {\n item.num = res;\n }\n });\n resolve(null);\n })\n .catch(error => {\n console.log('error', error);\n message.error(t('获取数据失败, 请刷新页面'));\n });\n });\n };\n const setCount = async (list: any) => {\n for (const item of list) {\n try {\n await fetchData(item);\n } catch (error) {\n console.log('error', error);\n message.error(t('获取数据失败, 请刷新页面'));\n }\n }\n };\n // 查询视图、刷新count\n const viewRefresh = async () => {\n const res = await getApiData(\n {\n org_id: current_org.id,\n user_id: userid,\n view_project__flag: env.VITE_APP_VIEW_PROJECT_FLAG,\n view_menu__flag: props.modalType,\n history_id: null,\n sort_fields: ['sort', 'create_time'],\n is_cache: false,\n },\n '/view/get_view_settings_for_user',\n );\n mergedConfig = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (mergedConfig?.isView === false) {\n window.location.hash = '';\n emit('change', null, {}, true, true);\n return;\n }\n requiredConditionStore.set_required_condition(\n props.modalType,\n mergedConfig.required_condition,\n );\n viewData.value.length = 0;\n let list: any = [];\n const count_search_list: any = [];\n if (res && res.system_user_datas && res.system_user_datas.length > 0) {\n list = list.concat(res.system_user_datas);\n }\n if (res && res.system_public_datas && res.system_public_datas.length > 0) {\n list = list.concat(res.system_public_datas);\n }\n if (res && res.public_datas && res.public_datas.length > 0) {\n list = list.concat(res.public_datas);\n }\n if (res && res.user_datas && res.user_datas.length > 0) {\n list = list.concat(res.user_datas);\n }\n list.forEach((item: any) => {\n let search_model: any = null;\n let filter_map: any = null;\n let group_condition: any = null;\n let conditions: any = null;\n if (item.data.isShowGeneralFilter) {\n search_model = {};\n filter_map = {};\n group_condition = item.data.group_condition;\n conditions = item.data.conditions;\n } else {\n search_model = item.data.search_model;\n filter_map = item.data.filter_map;\n group_condition = {};\n conditions = [];\n }\n viewData.value.push({\n ...item,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition: group_condition,\n conditions: conditions,\n });\n count_search_list.push({\n id: item.id,\n isShowGeneralFilter: item.data.isShowGeneralFilter,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition,\n conditions,\n });\n });\n if (count_search_list.length > 0) {\n setCount(count_search_list);\n }\n handleHashChange(null);\n };\n // 根据hash选定当前视图数据 event返回(视图数据,是否刷新页面,是否可自我保存)\n const handleHashChange = (uid: any) => {\n let hash = null;\n if (uid) {\n hash = uid;\n } else if (window.location.hash) {\n hash = window.location.hash.substring(1); // 去掉 # 符号\n }\n if (hash) {\n // 分享的视图链接打开\n const list = viewData.value.filter((item: any) => item.uid == hash);\n if (list && list.length > 0) {\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n } else {\n query_view_settings_list({\n org_id: current_org.id,\n conditions: [\n [\n {\n field_name: 'is_active',\n operator: 'in',\n value: [true],\n format: 'choices',\n class_name: 'bool',\n },\n {\n field_name: 'view_menu__flag',\n operator: 'eq',\n value: [props.menu_flag],\n format: 'input',\n class_name: 'str',\n },\n {\n field_name: 'uid',\n operator: 'eq',\n value: [hash],\n format: 'input',\n class_name: 'str',\n },\n ],\n ],\n }).then((res: any) => {\n if (res && res.data && res.data.length > 0) {\n emit(\n 'change',\n null,\n {\n ...res.data[0],\n ...res.data[0].data,\n },\n true,\n false,\n );\n } else {\n const list = viewData.value.filter((item: any) => !item.user_id && item.is_default);\n if (list && list.length > 0) {\n window.location.hash = list[0].uid;\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n return;\n }\n let obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => !item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n const obj = {\n uid: null,\n view_menu__flag: props.menu_flag,\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n };\n emit('change', null, obj, true, false);\n window.location.hash = '';\n }\n }\n }\n });\n }\n } else {\n let current_uid = '';\n if (sourceStore().get(CUSTOM_VIEW_DATA_USER)) {\n current_uid = sourceStore().get(CUSTOM_VIEW_DATA_USER)?.[props.menu_flag]; // 菜单当前视图uid\n }\n if (current_uid) {\n window.location.hash = current_uid;\n handleHashChange(current_uid);\n } else {\n // 优先选择非系统视图的默认视图\n const list = viewData.value.filter(\n (item: any) => !item.user_id && item.is_default && !item.is_system,\n );\n if (list && list.length > 0) {\n window.location.hash = list[0].uid;\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n return;\n }\n // 其次选择系统视图默认视图(多个默认选择第一个)\n const list_is_system = viewData.value.filter(\n (item: any) => !item.user_id && item.is_default && item.is_system,\n );\n if (list_is_system && list_is_system.length > 0) {\n window.location.hash = list_is_system[0].uid;\n emit('change', null, { ...list_is_system[0], ...list_is_system[0].data }, true, true);\n return;\n }\n let obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => !item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n window.location.hash = '';\n const obj = {\n uid: null,\n view_menu__flag: props.menu_flag,\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n };\n emit('change', null, obj, true, false);\n }\n }\n }\n }\n };\n const viewKey = ref(['1', '2']); // 视图数据展开控制key\n const customStyle =\n 'background: #ffffff;border-radius: 4px;margin-bottom: 2px;border: 0;overflow: hidden;';\n const customRow = (record: any) => {\n return props.currentViewObj && record && record.id === props.currentViewObj.id\n ? { style: { backgroundColor: '#ddf1ff' } }\n : { style: {} };\n };\n // 切换视图\n const changeView = (record: any) => {\n window.location.hash = record.uid;\n handleHashChange(record.uid);\n refreshCount([record]);\n };\n const process_default_search_for_view = (data: any) => {\n const res = [];\n for (const gropu of data) {\n const group_item = [];\n for (const item of gropu) {\n group_item.push({\n field_name: item.field_name,\n format: item.format,\n operator: item.operator,\n class_name: item.class_name,\n value: item.value,\n });\n }\n res.push(group_item);\n }\n return res;\n };\n // 保存修改视图\n const viewSubmit = ({ updateView, record }) => {\n if (record.name != updateView.name && viewNameList.value.includes(updateView.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n if (record?.id) {\n const list = viewData.value.filter((item: any) => record?.id == item.id);\n if (updateView.is_submit?.[0]) {\n const view = {\n ...list[0].data,\n search_model: { ...props.currentViewObj.search_model, current: 1 },\n filter_map: props.currentViewObj.filter_map,\n sort_fields: props.currentViewObj.sort_fields,\n filtered_value: props.currentViewObj.filtered_value,\n sort_orders: props.currentViewObj.sort_orders,\n column: props.currentViewObj.column,\n isShowGeneralFilter: props.currentViewObj.isShowGeneralFilter,\n conditions: props.currentViewObj.conditions,\n group_condition: props.currentViewObj.group_condition,\n group_record: props.currentViewObj.group_record,\n default_search_condition_config_list: process_default_search_for_view(\n props.currentViewObj.default_search_condition_config_list,\n ),\n };\n delete view.is_system; // 存储时不记录is_system,防止后端直接修改,前端不起效\n update_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n is_system: updateView.is_system?.[0],\n name: updateView.name,\n data: JSON.stringify(view),\n }).then((res: any) => {\n if (updateView.is_default?.[0]) {\n set_view_settings_default({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n });\n } else {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n }\n });\n } else {\n update_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n is_system: updateView.is_system?.[0],\n name: updateView.name,\n }).then((res: any) => {\n if (updateView.is_default?.[0]) {\n set_view_settings_default({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n });\n } else {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n }\n });\n }\n } else {\n let view: any = {};\n if (updateView.is_submit?.[0]) {\n view = {\n search_model: { ...props.currentViewObj.search_model, current: 1 },\n filter_map: props.currentViewObj.filter_map,\n sort_fields: props.currentViewObj.sort_fields,\n filtered_value: props.currentViewObj.filtered_value,\n sort_orders: props.currentViewObj.sort_orders,\n column: props.currentViewObj.column,\n isShowGeneralFilter: props.currentViewObj.isShowGeneralFilter,\n conditions: props.currentViewObj.conditions,\n group_condition: props.currentViewObj.group_condition,\n group_record: props.currentViewObj.group_record,\n default_search_condition_config_list: process_default_search_for_view(\n props.currentViewObj.default_search_condition_config_list,\n ),\n };\n delete view.is_system; // 存储时不记录is_system,防止后端直接修改,前端不起效\n } else {\n view = {\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n isShowGeneralFilter: null,\n conditions: [],\n group_condition: {},\n group_record: {},\n };\n }\n create_view_settings({\n org_id: current_org.id,\n user_id: updateView.view_type == 'personal' ? userid : null,\n name: updateView.name,\n view_project__flag: env.VITE_APP_VIEW_PROJECT_FLAG,\n view_menu__flag: props.menu_flag,\n view_menu__name: props.menu_name,\n is_system: false,\n data: JSON.stringify(view),\n }).then((res: any) => {\n emit('change', null, { ...res, ...res.data }, true, true);\n if (res.id) {\n viewData.value = viewData.value.concat([\n {\n ...res,\n },\n ]);\n setCount([\n {\n id: res.id,\n search_model: view.search_model,\n filter_map: view.filter_map,\n sort_fields: view.sort_fields,\n group_condition: view.group_condition,\n conditions: view.conditions,\n isShowGeneralFilter: view.isShowGeneralFilter,\n },\n ]);\n window.location.hash = res.uid;\n handleHashChange(res.uid);\n }\n });\n }\n };\n // 视图编辑按钮\n const handleSubmit = (record: any, view_type: string) => {\n let is_submit: any = [false];\n if (props.currentViewObj.id == record.id) {\n is_submit = [true];\n }\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('编辑视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'checkbox',\n name: 'is_submit',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: record.name,\n is_submit: is_submit,\n is_default: [record?.is_default ? record?.is_default : false],\n is_system: [record?.is_system ? record?.is_system : false],\n }),\n },\n options: {\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n is_default: [\n {\n name: t('设为默认视图'),\n value: true,\n },\n ],\n is_system: [\n {\n name: t('设为系统视图'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n viewSubmit({ updateView: data, record: record });\n resolve(null);\n });\n },\n });\n if (view_type == 'public') {\n tempModal.form.fields.push({\n type: 'checkbox',\n name: 'is_default',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n });\n if (is_auth.value) {\n tempModal.form.fields.push({\n type: 'checkbox',\n name: 'is_system',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n });\n }\n }\n modalBox(tempModal);\n };\n // 添加视图\n const addView = (view_type: any) => {\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('新建视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'radio',\n name: 'view_type',\n label: t('视图可见范围'),\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: '',\n placeholder: '',\n },\n {\n type: 'checkbox',\n name: 'is_submit',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: null,\n view_type: view_type,\n is_submit: [true],\n }),\n },\n options: {\n view_type: [\n { name: t('个人视图(仅自己可见)'), value: 'personal' },\n { name: t('公共视图(项目成员均可见)'), value: 'public' },\n ],\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n if (viewNameList.value.includes(data.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n viewSubmit({ updateView: data, record: data });\n resolve(null);\n });\n },\n });\n modalBox(tempModal);\n };\n // 管理视图\n const editView = (view_type: any) => {\n const tempModal = reactive({\n open: true,\n component: 'ViewEditModal',\n compObj: {\n title: view_type == 'personal' ? t('个人视图管理') : t('公共视图管理'),\n data: view_type == 'personal' ? personData.value : publicData.value,\n },\n ok: (ids: any) => {\n if (ids && ids.length > 0) {\n change_view_settings_sort({\n org_id: current_org.id,\n view_settings_ids: ids,\n }).then(() => {\n message.success(t('保存成功'));\n viewRefresh();\n });\n } else {\n message.success(t('保存成功'));\n viewRefresh();\n }\n },\n cancel: (isEdit: any) => {\n if (isEdit) {\n viewRefresh();\n }\n },\n });\n modalBox(tempModal);\n };\n // 分享视图\n const handleShare = (record: any) => {\n let url = '';\n const index = window.location.href.indexOf('#');\n if (index !== -1) {\n // 如果找到了 #,则截取它之前的部分\n url = window.location.href.substring(0, index) + '#' + record.uid;\n } else {\n // 如果没有找到 #,则返回原始字符串\n url = window.location.href + '#' + record.uid;\n }\n copyValue({ val: url, message: t('复制成功') });\n };\n // 删除视图\n const handleDelet = (record: any) => {\n Modal.confirm({\n title: () =>\n `${t('确认删除此')}【${record.name}】${record?.user_id ? t('个人视图') : t('公共视图')}?`,\n content: t('视图删除后不可恢复,视图下工作项不受影响,是否确认删除?'),\n icon: () => createVNode(ExclamationCircleOutlined),\n okText: t('确定'),\n onOk() {\n return new Promise(resolve => {\n delete_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n })\n .then(() => {\n viewData.value = viewData.value.filter((item: any) => item.id != record.id);\n handleHashChange(null);\n message.success(t('删除成功'));\n })\n .finally(() => {\n resolve(null);\n });\n }).catch(() => console.log('Oops errors!'));\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onCancel() {},\n });\n };\n const getRequiredConditionObj = () => {\n const page_config = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n const required_condition = page_config.required_condition;\n const required_condition_obj = {};\n if (required_condition) {\n required_condition.forEach((item: any) => {\n const value = requiredConditionStore.value_map[item.key];\n if (value !== undefined && value !== null) {\n required_condition_obj[item.field_name] = value;\n }\n });\n }\n return required_condition_obj;\n };\n // 刷新Count (视图record,uid) => {}\n const refreshCount = (list: any) => {\n const count_search_list = [];\n list.forEach((item: any) => {\n let search_model: any = null;\n let filter_map: any = null;\n let group_condition: any = null;\n let conditions: any = null;\n if (item.data.isShowGeneralFilter) {\n search_model = {};\n filter_map = {};\n group_condition = item.data.group_condition;\n conditions = item.data.conditions;\n } else {\n search_model = item.data.search_model;\n filter_map = item.data.filter_map;\n group_condition = {};\n conditions = [];\n }\n\n count_search_list.push({\n id: item.id,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition,\n conditions,\n isShowGeneralFilter: item.data.isShowGeneralFilter,\n });\n });\n setCount(count_search_list);\n };\n watch(\n () => props.current_num, // 监听保存当前视图\n () => {\n Modal.confirm({\n title: () => t('确定覆盖视图吗?'),\n content: t('当前视图原有的数据会被覆盖'),\n icon: () => createVNode(ExclamationCircleOutlined),\n okText: t('确定'),\n onOk() {\n return new Promise(resolve => {\n viewSubmit({\n updateView: {\n is_submit: [true],\n is_system: [props.currentViewObj.is_system],\n name: props.currentViewObj.name,\n },\n record: props.currentViewObj,\n });\n resolve(null);\n }).catch(() => console.log('Oops errors!'));\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onCancel() {},\n });\n },\n );\n watch(\n () => props.create_num, // 监听另存为\n () => {\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('新建视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'radio',\n name: 'view_type',\n label: t('视图可见范围'),\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: '',\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: null,\n view_type: 'personal',\n is_submit: [true],\n }),\n },\n options: {\n view_type: [\n { name: t('个人视图(仅自己可见)'), value: 'personal' },\n { name: t('公共视图(项目成员均可见)'), value: 'public' },\n ],\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n const viewNameList = viewData.value.map((item: any) => item.name);\n if (viewNameList.includes(data.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n viewSubmit({ updateView: data, record: data });\n resolve(null);\n });\n },\n });\n modalBox(tempModal);\n },\n );\n\n watch(\n () => props.count_num, // 监听刷新当前视图count\n () => {\n refreshCount(viewData.value);\n },\n );\n const handleRequiredConditionChange = (key: string) => {\n const page_config = getPageConfig(props.currentViewObj.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (page_config.required_condition) {\n const item = page_config.required_condition.find((item: any) => item.key === key);\n if (item) {\n viewRefresh();\n }\n }\n };\n onMounted(() => {\n viewRefresh();\n required_condition_event_obj().on('change', handleRequiredConditionChange);\n });\n onUnmounted(() => {\n required_condition_event_obj().off('change', handleRequiredConditionChange);\n });\n // 页面重新进入刷新count\n onActivated(() => {\n refreshCount(viewData.value);\n });\n return {\n props,\n viewKey,\n customStyle,\n columns,\n personData,\n publicData,\n is_auth,\n addView,\n editView,\n customRow,\n changeView,\n handleSubmit,\n handleShare,\n handleDelet,\n appStore,\n };\n },\n});\n</script>\n<style lang=\"less\">\n.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box {\n padding: 0;\n}\n\n.num {\n display: inline-block;\n}\n\n.dropdown {\n display: none;\n}\n\n.table:hover .dropdown {\n display: inline-block;\n}\n\n.table:hover .num {\n display: none;\n}\n</style>\n","<template>\n <a-card :body-style=\"{ padding: 0, height: height + 87 + 'px', overflowY: 'auto' }\">\n <a-collapse\n v-model:activeKey=\"viewKey\"\n :bordered=\"false\"\n class=\"collapses\"\n style=\"background: rgb(255, 255, 255)\"\n >\n <template #expandIcon=\"{ isActive }\">\n <caret-right-outlined :rotate=\"isActive ? 90 : 0\" />\n </template>\n <a-collapse-panel\n :key=\"'1'\"\n :style=\"customStyle\"\n >\n <template #header>\n <span style=\"font-weight: 700\">{{ $t('个人视图') }}</span>\n </template>\n <template #extra>\n <a-tooltip>\n <template #title>{{ $t('个人视图管理') }}</template>\n <setting-outlined\n style=\"margin-right: 10px\"\n @click.stop=\"editView('personal')\"\n />\n </a-tooltip>\n <a-tooltip>\n <template #title>{{ $t('新建个人视图') }}</template>\n <plus-outlined @click.stop=\"addView('personal')\" />\n </a-tooltip>\n </template>\n <a-table\n v-if=\"personData.length > 0\"\n :columns=\"columns\"\n :customRow=\"customRow\"\n :dataSource=\"personData\"\n :pagination=\"false\"\n :showHeader=\"false\"\n :size=\"'small'\"\n >\n <template #bodyCell=\"{ column, record }\">\n <div\n class=\"table\"\n v-if=\"column.dataIndex === 'name'\"\n style=\"width: 100%; cursor: pointer\"\n @click=\"changeView(record)\"\n >\n <a-tooltip\n :title=\"record.name\"\n :color=\"appStore.primaryColor\"\n placement=\"left\"\n :destroyTooltipOnHide=\"true\"\n :overlayStyle=\"{ maxWidth: '200px' }\"\n >\n <div style=\"max-width: 130px; float: left; white-space: nowrap; overflow: hidden\">\n {{ record.name }}\n </div>\n </a-tooltip>\n <span\n class=\"num\"\n style=\"float: right\"\n :style=\"\n currentViewObj.id === record.id ? { color: '#1890ff', fontWeight: 'bold' } : {}\n \"\n >\n {{ record.num }}\n </span>\n <a-dropdown class=\"dropdown\">\n <span\n style=\"float: right; font-weight: 800\"\n @click.stop=\"\"\n >\n · · ·\n </span>\n <template #overlay>\n <a-menu>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleSubmit(record, 'personal')\"\n >\n {{ $t('编辑') }}\n </a>\n </a-menu-item>\n <a-menu-item>\n <a\n href=\"javascript:;\"\n @click=\"handleShare(record)\"\n >\n {{ $t('分享视图') }}\n </a>\n </a-menu-item>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleDelet(record)\"\n >\n {{ $t('删除') }}\n </a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n </template>\n </a-table>\n </a-collapse-panel>\n <a-collapse-panel\n :key=\"'2'\"\n :style=\"customStyle\"\n >\n <template #header>\n <span style=\"font-weight: 700\">{{ $t('公共视图') }}</span>\n </template>\n <template #extra>\n <a-tooltip>\n <template #title>{{ $t('公共视图管理') }}</template>\n <setting-outlined\n style=\"margin-right: 10px\"\n @click.stop=\"editView('public')\"\n />\n </a-tooltip>\n <a-tooltip>\n <template #title>{{ $t('新建公共视图') }}</template>\n <plus-outlined @click.stop=\"addView('public')\" />\n </a-tooltip>\n </template>\n <a-table\n v-if=\"publicData.length > 0\"\n :columns=\"columns\"\n :customRow=\"customRow\"\n :dataSource=\"publicData\"\n :pagination=\"false\"\n :showHeader=\"false\"\n :size=\"'small'\"\n >\n <template #bodyCell=\"{ column, record }\">\n <div\n class=\"table\"\n v-if=\"column.dataIndex === 'name'\"\n style=\"width: 100%; cursor: pointer\"\n @click=\"changeView(record)\"\n >\n <a-tooltip\n :title=\"record.name\"\n :color=\"appStore.primaryColor\"\n placement=\"left\"\n :destroyTooltipOnHide=\"true\"\n :overlayStyle=\"{ maxWidth: '200px' }\"\n >\n <div style=\"max-width: 130px; float: left; white-space: nowrap; overflow: hidden\">\n {{ record.name }}\n </div>\n </a-tooltip>\n <span\n class=\"num\"\n style=\"float: right\"\n :style=\"\n currentViewObj.id === record.id ? { color: '#1890ff', fontWeight: 'bold' } : {}\n \"\n >\n {{ record.num }}\n </span>\n <a-dropdown class=\"dropdown\">\n <span\n style=\"float: right; font-weight: 800\"\n @click.stop=\"\"\n >\n · · ·\n </span>\n <template #overlay>\n <a-menu>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleSubmit(record, 'public')\"\n >\n {{ $t('编辑') }}\n </a>\n </a-menu-item>\n <a-menu-item>\n <a\n href=\"javascript:;\"\n @click=\"handleShare(record)\"\n >\n {{ $t('分享视图') }}\n </a>\n </a-menu-item>\n <a-menu-item v-if=\"!record.is_system || is_auth\">\n <a\n href=\"javascript:;\"\n @click=\"handleDelet(record)\"\n >\n {{ $t('删除') }}\n </a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n </template>\n </a-table>\n </a-collapse-panel>\n </a-collapse>\n </a-card>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n createVNode,\n defineComponent,\n onActivated,\n onMounted,\n onUnmounted,\n PropType,\n reactive,\n ref,\n watch,\n} from 'vue';\nimport {\n CaretRightOutlined,\n ExclamationCircleOutlined,\n PlusOutlined,\n SettingOutlined,\n} from '@ant-design/icons-vue';\nimport modalBox from 'liyu-pc-base/components/form-modal/modal-tools';\nimport { message, Modal } from 'ant-design-vue';\nimport { useUserStore } from 'liyu-pc-base/init-plugin';\nimport { useAppStore } from 'liyu-pc-base/init-plugin';\nimport {\n change_view_settings_sort,\n create_view_settings,\n delete_view_settings,\n query_view_settings_list,\n refresh_view_settings_cache,\n set_view_settings_default,\n update_view_settings,\n} from 'liyu-pc-base/api/view-model';\nimport { sourceStore } from 'liyu-pc-base/init-plugin';\nimport { copyValue } from 'liyu-pc-base/utils/function';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\nimport { getPageConfig } from 'liyu-pc-base/components/remotePages/index';\nimport { useI18n } from 'vue-i18n';\nimport { useRequiredConditionStore } from 'liyu-pc-base/init-plugin';\nimport { required_condition_event_obj } from 'liyu-pc-base/init-plugin';\nimport { useEnv } from 'liyu-pc-base/init-plugin';\nimport { CUSTOM_VIEW_DATA_USER } from 'liyu-pc-base/constants';\n\nconst VIEW_SYSTEM_EDIT = 'view_system_edit';\nconst columns = [\n {\n title: '',\n dataIndex: 'name',\n key: 'name',\n },\n];\nexport default defineComponent({\n name: 'ViewManage',\n components: {\n CaretRightOutlined,\n PlusOutlined,\n SettingOutlined,\n },\n props: {\n currentViewObj: {\n type: Object,\n required: true,\n },\n menu_flag: {\n type: String,\n required: true,\n },\n menu_name: {\n type: String,\n required: true,\n },\n countData: {\n type: String,\n required: true,\n },\n create_num: {\n type: Number,\n required: true,\n },\n current_num: {\n type: Number,\n required: true,\n },\n count_num: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n modalType: {\n type: String,\n },\n app_flag: {\n type: String,\n },\n allBaseConfigMap: {\n type: Object,\n required: true,\n },\n searchConfigFields: {\n type: Array as PropType<any[]>,\n required: true,\n },\n },\n emits: ['change'],\n setup(props, { emit }) {\n const env = useEnv();\n const requiredConditionStore = useRequiredConditionStore();\n const userStore = useUserStore();\n const appStore = useAppStore();\n const current_org = userStore.currentOrg;\n const userid = userStore.userid;\n const is_auth = ref(userStore.CHECK_AUTH(VIEW_SYSTEM_EDIT));\n const viewData = ref([]); // 视图数据\n const { t } = useI18n();\n let mergedConfig: any;\n const personData = computed(() => {\n const list = viewData.value\n .filter((item: any) => !!item.user_id && item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n const list1 = viewData.value\n .filter((item: any) => !!item.user_id && !item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n return list.concat(list1);\n }); // 个人视图数据\n const publicData = computed(() => {\n const list = viewData.value\n .filter((item: any) => !item.user_id && item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n const list1 = viewData.value\n .filter((item: any) => !item.user_id && !item.is_system)\n .map((item: any) => {\n return item;\n })\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort));\n return list.concat(list1);\n }); // 公共视图数据\n const viewNameList = computed(() => {\n return viewData.value.map((item: any) => {\n return item.name;\n });\n }); // 视图名称列表,用于创建、修改时查重\n const filterConditions = (conditions: any) => {\n const res = [];\n for (const group of conditions) {\n const group_item = [];\n for (const item of group) {\n if (props.allBaseConfigMap[item.field_name]) {\n group_item.push(item);\n }\n }\n if (group_item.length > 0) {\n res.push(group_item);\n }\n }\n return res;\n };\n const filter_search_model = (search_model: any) => {\n const res = {};\n const fieldMap = {};\n if (!search_model) {\n return res;\n }\n if (props.searchConfigFields?.length) {\n for (const item of props.searchConfigFields) {\n fieldMap[item.name] = item;\n }\n }\n for (const key of Object.keys(search_model)) {\n if (fieldMap[key]) {\n res[key] = search_model[key];\n }\n }\n return res;\n };\n const fetchData = async ({\n id,\n search_model,\n filter_map,\n sort_fields,\n group_condition,\n conditions,\n isShowGeneralFilter,\n }) => {\n return new Promise(resolve => {\n if (!props.countData && !mergedConfig?.countData) {\n console.error('无count接口');\n resolve(null);\n }\n const obj: any = {\n org_id: current_org.id,\n ...filter_search_model(search_model || {}),\n ...filter_map,\n sort_fields: sort_fields,\n };\n if (isShowGeneralFilter) {\n obj.group_condition = group_condition;\n obj.conditions = filterConditions(conditions);\n }\n obj.required_condition = getRequiredConditionObj();\n let db_alias = null;\n const page_config = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (page_config.get_db_alias) {\n db_alias = page_config.get_db_alias();\n }\n obj.db_alias = db_alias;\n getApiData(obj, mergedConfig?.countData ? mergedConfig.countData : props.countData)\n .then((res: any) => {\n viewData.value.forEach((item: any) => {\n if (item.id == id) {\n item.num = res;\n }\n });\n resolve(null);\n })\n .catch(error => {\n console.log('error', error);\n message.error(t('获取数据失败, 请刷新页面'));\n });\n });\n };\n const setCount = async (list: any) => {\n for (const item of list) {\n try {\n await fetchData(item);\n } catch (error) {\n console.log('error', error);\n message.error(t('获取数据失败, 请刷新页面'));\n }\n }\n };\n // 查询视图、刷新count\n const viewRefresh = async () => {\n const res = await getApiData(\n {\n org_id: current_org.id,\n user_id: userid,\n view_project__flag: env.VITE_APP_VIEW_PROJECT_FLAG,\n view_menu__flag: props.modalType,\n history_id: null,\n sort_fields: ['sort', 'create_time'],\n is_cache: false,\n },\n '/view/get_view_settings_for_user',\n );\n mergedConfig = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (mergedConfig?.isView === false) {\n window.location.hash = '';\n emit('change', null, {}, true, true);\n return;\n }\n requiredConditionStore.set_required_condition(\n props.modalType,\n mergedConfig.required_condition,\n );\n viewData.value.length = 0;\n let list: any = [];\n const count_search_list: any = [];\n if (res && res.system_user_datas && res.system_user_datas.length > 0) {\n list = list.concat(res.system_user_datas);\n }\n if (res && res.system_public_datas && res.system_public_datas.length > 0) {\n list = list.concat(res.system_public_datas);\n }\n if (res && res.public_datas && res.public_datas.length > 0) {\n list = list.concat(res.public_datas);\n }\n if (res && res.user_datas && res.user_datas.length > 0) {\n list = list.concat(res.user_datas);\n }\n list.forEach((item: any) => {\n let search_model: any = null;\n let filter_map: any = null;\n let group_condition: any = null;\n let conditions: any = null;\n if (item.data.isShowGeneralFilter) {\n search_model = {};\n filter_map = {};\n group_condition = item.data.group_condition;\n conditions = item.data.conditions;\n } else {\n search_model = item.data.search_model;\n filter_map = item.data.filter_map;\n group_condition = {};\n conditions = [];\n }\n viewData.value.push({\n ...item,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition: group_condition,\n conditions: conditions,\n });\n count_search_list.push({\n id: item.id,\n isShowGeneralFilter: item.data.isShowGeneralFilter,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition,\n conditions,\n });\n });\n if (count_search_list.length > 0) {\n setCount(count_search_list);\n }\n handleHashChange(null);\n };\n // 根据hash选定当前视图数据 event返回(视图数据,是否刷新页面,是否可自我保存)\n const handleHashChange = (uid: any) => {\n let hash = null;\n if (uid) {\n hash = uid;\n } else if (window.location.hash) {\n hash = window.location.hash.substring(1); // 去掉 # 符号\n }\n if (hash) {\n // 分享的视图链接打开\n const list = viewData.value.filter((item: any) => item.uid == hash);\n if (list && list.length > 0) {\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n } else {\n query_view_settings_list({\n org_id: current_org.id,\n conditions: [\n [\n {\n field_name: 'is_active',\n operator: 'in',\n value: [true],\n format: 'choices',\n class_name: 'bool',\n },\n {\n field_name: 'view_menu__flag',\n operator: 'eq',\n value: [props.menu_flag],\n format: 'input',\n class_name: 'str',\n },\n {\n field_name: 'uid',\n operator: 'eq',\n value: [hash],\n format: 'input',\n class_name: 'str',\n },\n ],\n ],\n }).then((res: any) => {\n if (res && res.data && res.data.length > 0) {\n emit(\n 'change',\n null,\n {\n ...res.data[0],\n ...res.data[0].data,\n },\n true,\n false,\n );\n } else {\n const list = viewData.value.filter((item: any) => !item.user_id && item.is_default);\n if (list && list.length > 0) {\n window.location.hash = list[0].uid;\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n return;\n }\n let obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => !item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n const obj = {\n uid: null,\n view_menu__flag: props.menu_flag,\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n };\n emit('change', null, obj, true, false);\n window.location.hash = '';\n }\n }\n }\n });\n }\n } else {\n let current_uid = '';\n if (sourceStore().get(CUSTOM_VIEW_DATA_USER)) {\n current_uid = sourceStore().get(CUSTOM_VIEW_DATA_USER)?.[props.menu_flag]; // 菜单当前视图uid\n }\n if (current_uid) {\n window.location.hash = current_uid;\n handleHashChange(current_uid);\n } else {\n // 优先选择非系统视图的默认视图\n const list = viewData.value.filter(\n (item: any) => !item.user_id && item.is_default && !item.is_system,\n );\n if (list && list.length > 0) {\n window.location.hash = list[0].uid;\n emit('change', null, { ...list[0], ...list[0].data }, true, true);\n return;\n }\n // 其次选择系统视图默认视图(多个默认选择第一个)\n const list_is_system = viewData.value.filter(\n (item: any) => !item.user_id && item.is_default && item.is_system,\n );\n if (list_is_system && list_is_system.length > 0) {\n window.location.hash = list_is_system[0].uid;\n emit('change', null, { ...list_is_system[0], ...list_is_system[0].data }, true, true);\n return;\n }\n let obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => !item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n obj = viewData.value\n .sort((a, b) => (a.sort == b.sort ? a.id - b.id : a.sort - b.sort))\n .find((item: any) => item.user_id);\n if (obj && obj.uid) {\n window.location.hash = obj.uid;\n emit('change', null, { ...obj, ...obj.data }, true, true);\n } else {\n window.location.hash = '';\n const obj = {\n uid: null,\n view_menu__flag: props.menu_flag,\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n };\n emit('change', null, obj, true, false);\n }\n }\n }\n }\n };\n const viewKey = ref(['1', '2']); // 视图数据展开控制key\n const customStyle =\n 'background: #ffffff;border-radius: 4px;margin-bottom: 2px;border: 0;overflow: hidden;';\n const customRow = (record: any) => {\n return props.currentViewObj && record && record.id === props.currentViewObj.id\n ? { style: { backgroundColor: '#ddf1ff' } }\n : { style: {} };\n };\n // 切换视图\n const changeView = (record: any) => {\n window.location.hash = record.uid;\n handleHashChange(record.uid);\n refreshCount([record]);\n };\n const process_default_search_for_view = (data: any) => {\n const res = [];\n for (const gropu of data) {\n const group_item = [];\n for (const item of gropu) {\n group_item.push({\n field_name: item.field_name,\n format: item.format,\n operator: item.operator,\n class_name: item.class_name,\n value: item.value,\n });\n }\n res.push(group_item);\n }\n return res;\n };\n // 保存修改视图\n const viewSubmit = ({ updateView, record }) => {\n if (record.name != updateView.name && viewNameList.value.includes(updateView.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n if (record?.id) {\n const list = viewData.value.filter((item: any) => record?.id == item.id);\n if (updateView.is_submit?.[0]) {\n const view = {\n ...list[0].data,\n search_model: { ...props.currentViewObj.search_model, current: 1 },\n filter_map: props.currentViewObj.filter_map,\n sort_fields: props.currentViewObj.sort_fields,\n filtered_value: props.currentViewObj.filtered_value,\n sort_orders: props.currentViewObj.sort_orders,\n column: props.currentViewObj.column,\n isShowGeneralFilter: props.currentViewObj.isShowGeneralFilter,\n conditions: props.currentViewObj.conditions,\n group_condition: props.currentViewObj.group_condition,\n group_record: props.currentViewObj.group_record,\n default_search_condition_config_list: process_default_search_for_view(\n props.currentViewObj.default_search_condition_config_list,\n ),\n };\n delete view.is_system; // 存储时不记录is_system,防止后端直接修改,前端不起效\n update_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n is_system: updateView.is_system?.[0],\n name: updateView.name,\n data: JSON.stringify(view),\n }).then((res: any) => {\n if (updateView.is_default?.[0]) {\n set_view_settings_default({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n });\n } else {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n }\n });\n } else {\n update_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n is_system: updateView.is_system?.[0],\n name: updateView.name,\n }).then((res: any) => {\n if (updateView.is_default?.[0]) {\n set_view_settings_default({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n });\n } else {\n refresh_view_settings_cache({\n org_id: current_org.id,\n view_settings_id: record?.id,\n }).then(() => {\n message.success(t('保存成功'));\n if (res.id == props.currentViewObj?.id) {\n emit('change', null, { ...res, ...res.data }, false, true);\n } else {\n viewData.value.forEach((item: any) => {\n if (item.id == res.id) {\n Object.assign(item, { ...res, ...res.data });\n }\n });\n }\n viewRefresh();\n });\n }\n });\n }\n } else {\n let view: any = {};\n if (updateView.is_submit?.[0]) {\n view = {\n search_model: { ...props.currentViewObj.search_model, current: 1 },\n filter_map: props.currentViewObj.filter_map,\n sort_fields: props.currentViewObj.sort_fields,\n filtered_value: props.currentViewObj.filtered_value,\n sort_orders: props.currentViewObj.sort_orders,\n column: props.currentViewObj.column,\n isShowGeneralFilter: props.currentViewObj.isShowGeneralFilter,\n conditions: props.currentViewObj.conditions,\n group_condition: props.currentViewObj.group_condition,\n group_record: props.currentViewObj.group_record,\n default_search_condition_config_list: process_default_search_for_view(\n props.currentViewObj.default_search_condition_config_list,\n ),\n };\n delete view.is_system; // 存储时不记录is_system,防止后端直接修改,前端不起效\n } else {\n view = {\n column: {},\n search_model: {},\n filter_map: {},\n sort_fields: [],\n filtered_value: {},\n sort_orders: [],\n isShowGeneralFilter: null,\n conditions: [],\n group_condition: {},\n group_record: {},\n };\n }\n create_view_settings({\n org_id: current_org.id,\n user_id: updateView.view_type == 'personal' ? userid : null,\n name: updateView.name,\n view_project__flag: env.VITE_APP_VIEW_PROJECT_FLAG,\n view_menu__flag: props.menu_flag,\n view_menu__name: props.menu_name,\n is_system: false,\n data: JSON.stringify(view),\n }).then((res: any) => {\n emit('change', null, { ...res, ...res.data }, true, true);\n if (res.id) {\n viewData.value = viewData.value.concat([\n {\n ...res,\n },\n ]);\n setCount([\n {\n id: res.id,\n search_model: view.search_model,\n filter_map: view.filter_map,\n sort_fields: view.sort_fields,\n group_condition: view.group_condition,\n conditions: view.conditions,\n isShowGeneralFilter: view.isShowGeneralFilter,\n },\n ]);\n window.location.hash = res.uid;\n handleHashChange(res.uid);\n }\n });\n }\n };\n // 视图编辑按钮\n const handleSubmit = (record: any, view_type: string) => {\n let is_submit: any = [false];\n if (props.currentViewObj.id == record.id) {\n is_submit = [true];\n }\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('编辑视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'checkbox',\n name: 'is_submit',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: record.name,\n is_submit: is_submit,\n is_default: [record?.is_default ? record?.is_default : false],\n is_system: [record?.is_system ? record?.is_system : false],\n }),\n },\n options: {\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n is_default: [\n {\n name: t('设为默认视图'),\n value: true,\n },\n ],\n is_system: [\n {\n name: t('设为系统视图'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n viewSubmit({ updateView: data, record: record });\n resolve(null);\n });\n },\n });\n if (view_type == 'public') {\n tempModal.form.fields.push({\n type: 'checkbox',\n name: 'is_default',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n });\n if (is_auth.value) {\n tempModal.form.fields.push({\n type: 'checkbox',\n name: 'is_system',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n });\n }\n }\n modalBox(tempModal);\n };\n // 添加视图\n const addView = (view_type: any) => {\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('新建视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'radio',\n name: 'view_type',\n label: t('视图可见范围'),\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: '',\n placeholder: '',\n },\n {\n type: 'checkbox',\n name: 'is_submit',\n label: '',\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: [false],\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: null,\n view_type: view_type,\n is_submit: [true],\n }),\n },\n options: {\n view_type: [\n { name: t('个人视图(仅自己可见)'), value: 'personal' },\n { name: t('公共视图(项目成员均可见)'), value: 'public' },\n ],\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n if (viewNameList.value.includes(data.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n viewSubmit({ updateView: data, record: data });\n resolve(null);\n });\n },\n });\n modalBox(tempModal);\n };\n // 管理视图\n const editView = (view_type: any) => {\n const tempModal = reactive({\n open: true,\n component: 'ViewEditModal',\n compObj: {\n title: view_type == 'personal' ? t('个人视图管理') : t('公共视图管理'),\n data: view_type == 'personal' ? personData.value : publicData.value,\n },\n ok: (ids: any) => {\n if (ids && ids.length > 0) {\n change_view_settings_sort({\n org_id: current_org.id,\n view_settings_ids: ids,\n }).then(() => {\n message.success(t('保存成功'));\n viewRefresh();\n });\n } else {\n message.success(t('保存成功'));\n viewRefresh();\n }\n },\n cancel: (isEdit: any) => {\n if (isEdit) {\n viewRefresh();\n }\n },\n });\n modalBox(tempModal);\n };\n // 分享视图\n const handleShare = (record: any) => {\n let url = '';\n const index = window.location.href.indexOf('#');\n if (index !== -1) {\n // 如果找到了 #,则截取它之前的部分\n url = window.location.href.substring(0, index) + '#' + record.uid;\n } else {\n // 如果没有找到 #,则返回原始字符串\n url = window.location.href + '#' + record.uid;\n }\n copyValue({ val: url, message: t('复制成功') });\n };\n // 删除视图\n const handleDelet = (record: any) => {\n Modal.confirm({\n title: () =>\n `${t('确认删除此')}【${record.name}】${record?.user_id ? t('个人视图') : t('公共视图')}?`,\n content: t('视图删除后不可恢复,视图下工作项不受影响,是否确认删除?'),\n icon: () => createVNode(ExclamationCircleOutlined),\n okText: t('确定'),\n onOk() {\n return new Promise(resolve => {\n delete_view_settings({\n org_id: current_org.id,\n view_settings_id: record?.id,\n })\n .then(() => {\n viewData.value = viewData.value.filter((item: any) => item.id != record.id);\n handleHashChange(null);\n message.success(t('删除成功'));\n })\n .finally(() => {\n resolve(null);\n });\n }).catch(() => console.log('Oops errors!'));\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onCancel() {},\n });\n };\n const getRequiredConditionObj = () => {\n const page_config = getPageConfig(props.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n const required_condition = page_config.required_condition;\n const required_condition_obj = {};\n if (required_condition) {\n required_condition.forEach((item: any) => {\n const value = requiredConditionStore.value_map[item.key];\n if (value !== undefined && value !== null) {\n required_condition_obj[item.field_name] = value;\n }\n });\n }\n return required_condition_obj;\n };\n // 刷新Count (视图record,uid) => {}\n const refreshCount = (list: any) => {\n const count_search_list = [];\n list.forEach((item: any) => {\n let search_model: any = null;\n let filter_map: any = null;\n let group_condition: any = null;\n let conditions: any = null;\n if (item.data.isShowGeneralFilter) {\n search_model = {};\n filter_map = {};\n group_condition = item.data.group_condition;\n conditions = item.data.conditions;\n } else {\n search_model = item.data.search_model;\n filter_map = item.data.filter_map;\n group_condition = {};\n conditions = [];\n }\n\n count_search_list.push({\n id: item.id,\n search_model,\n filter_map,\n sort_fields: item.data.sort_fields,\n group_condition,\n conditions,\n isShowGeneralFilter: item.data.isShowGeneralFilter,\n });\n });\n setCount(count_search_list);\n };\n watch(\n () => props.current_num, // 监听保存当前视图\n () => {\n Modal.confirm({\n title: () => t('确定覆盖视图吗?'),\n content: t('当前视图原有的数据会被覆盖'),\n icon: () => createVNode(ExclamationCircleOutlined),\n okText: t('确定'),\n onOk() {\n return new Promise(resolve => {\n viewSubmit({\n updateView: {\n is_submit: [true],\n is_system: [props.currentViewObj.is_system],\n name: props.currentViewObj.name,\n },\n record: props.currentViewObj,\n });\n resolve(null);\n }).catch(() => console.log('Oops errors!'));\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onCancel() {},\n });\n },\n );\n watch(\n () => props.create_num, // 监听另存为\n () => {\n const tempModal = reactive({\n open: true,\n loading: false,\n title: t('新建视图'),\n form: {\n settings: {\n labelAlign: 'right',\n layout: 'vertical',\n col: [],\n },\n fields: [\n {\n type: 'input',\n name: 'name',\n label: t('视图名称'),\n disabled: false,\n allowClear: true,\n inputType: 'text',\n defaultValue: '',\n placeholder: t('请输入视图名称'),\n },\n {\n type: 'radio',\n name: 'view_type',\n label: t('视图可见范围'),\n disabled: false,\n allowClear: true,\n labelKey: 'name',\n valueKey: 'value',\n defaultValue: '',\n placeholder: '',\n },\n ],\n rules: reactive({\n name: [\n {\n required: true,\n message: t('请输入视图名称'),\n },\n ],\n }),\n model: reactive({\n name: null,\n view_type: 'personal',\n is_submit: [true],\n }),\n },\n options: {\n view_type: [\n { name: t('个人视图(仅自己可见)'), value: 'personal' },\n { name: t('公共视图(项目成员均可见)'), value: 'public' },\n ],\n is_submit: [\n {\n name: t('将当前过滤条件、排序、显示属性、视图和分组等设置更新到该视图中'),\n value: true,\n },\n ],\n },\n ok: (data: any) => {\n return new Promise(function (resolve) {\n const viewNameList = viewData.value.map((item: any) => item.name);\n if (viewNameList.includes(data.name)) {\n message.error(t('视图名称已存在'));\n return;\n }\n viewSubmit({ updateView: data, record: data });\n resolve(null);\n });\n },\n });\n modalBox(tempModal);\n },\n );\n\n watch(\n () => props.count_num, // 监听刷新当前视图count\n () => {\n refreshCount(viewData.value);\n },\n );\n const handleRequiredConditionChange = (key: string) => {\n const page_config = getPageConfig(props.currentViewObj.app_flag, props.modalType, null, t, {\n use_store: true,\n to_i18n: true,\n enable_btn: false,\n });\n if (page_config.required_condition) {\n const item = page_config.required_condition.find((item: any) => item.key === key);\n if (item) {\n viewRefresh();\n }\n }\n };\n onMounted(() => {\n viewRefresh();\n required_condition_event_obj().on('change', handleRequiredConditionChange);\n });\n onUnmounted(() => {\n required_condition_event_obj().off('change', handleRequiredConditionChange);\n });\n // 页面重新进入刷新count\n onActivated(() => {\n refreshCount(viewData.value);\n });\n return {\n props,\n viewKey,\n customStyle,\n columns,\n personData,\n publicData,\n is_auth,\n addView,\n editView,\n customRow,\n changeView,\n handleSubmit,\n handleShare,\n handleDelet,\n appStore,\n };\n },\n});\n</script>\n<style lang=\"less\">\n.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box {\n padding: 0;\n}\n\n.num {\n display: inline-block;\n}\n\n.dropdown {\n display: none;\n}\n\n.table:hover .dropdown {\n display: inline-block;\n}\n\n.table:hover .num {\n display: none;\n}\n</style>\n","<template>\n <a-card :body-style=\"{ padding: 0, height: selectObj.height + 96 + 'px', overflowY: 'auto' }\">\n <view-manage\n :select-obj=\"selectObj\"\n @change=\"change\"\n />\n </a-card>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue';\n// import SideFieldRender from 'liyu-pc-base/components/SideSearchRender/SideFieldRender.vue';\n// import { ReloadOutlined } from '@ant-design/icons-vue';\nimport ViewManage from 'liyu-pc-base/components/SideSearchRender/viewManage.vue';\n\nexport default defineComponent({\n name: 'SideSearchRender',\n components: {\n ViewManage,\n },\n props: {\n selectObj: {\n type: Object,\n required: true,\n },\n },\n emits: ['change'],\n setup(props, { emit }) {\n const change = (data: any, is_refresh: any, is_ownView: any) => {\n emit('change', data, is_refresh, is_ownView);\n };\n return {\n props,\n change,\n };\n },\n});\n</script>\n<style lang=\"less\">\n.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box {\n padding: 0;\n}\n</style>\n","<template>\n <a-card :body-style=\"{ padding: 0, height: selectObj.height + 96 + 'px', overflowY: 'auto' }\">\n <view-manage\n :select-obj=\"selectObj\"\n @change=\"change\"\n />\n </a-card>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue';\n// import SideFieldRender from 'liyu-pc-base/components/SideSearchRender/SideFieldRender.vue';\n// import { ReloadOutlined } from '@ant-design/icons-vue';\nimport ViewManage from 'liyu-pc-base/components/SideSearchRender/viewManage.vue';\n\nexport default defineComponent({\n name: 'SideSearchRender',\n components: {\n ViewManage,\n },\n props: {\n selectObj: {\n type: Object,\n required: true,\n },\n },\n emits: ['change'],\n setup(props, { emit }) {\n const change = (data: any, is_refresh: any, is_ownView: any) => {\n emit('change', data, is_refresh, is_ownView);\n };\n return {\n props,\n change,\n };\n },\n});\n</script>\n<style lang=\"less\">\n.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box {\n padding: 0;\n}\n</style>\n","import { inject, Ref } from 'vue';\nexport const fullLayoutStateSymbol = Symbol('fullLayoutState');\nexport interface FullLayoutState {\n fullLayoutRef: Ref<HTMLElement | null>;\n}\nexport const useFullLayoutState = (): FullLayoutState => {\n const state = inject<FullLayoutState>(fullLayoutStateSymbol);\n return state;\n};\n","<template>\n <div\n ref=\"fullLayoutRef\"\n class=\"full-layout\"\n :style=\"{ '--current-top': currentTop + 'px' }\"\n >\n <slot></slot>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { useAppStore } from 'liyu-pc-base/init-plugin';\nimport { debounce } from 'lodash';\nimport { nextTick, onMounted, onUnmounted, provide, ref, shallowRef, watch } from 'vue';\nimport { FullLayoutState, fullLayoutStateSymbol } from './fullLayoutUtils';\nconst appStore = useAppStore();\nconst fullLayoutRef = shallowRef<HTMLElement | null>(null);\nconst currentTop = ref(0);\n\nprovide<FullLayoutState>(fullLayoutStateSymbol, {\n fullLayoutRef,\n});\nconst syncCurrentTop = () => {\n const layout = fullLayoutRef.value;\n if (layout) {\n const top = layout.getBoundingClientRect().top;\n currentTop.value = top;\n }\n};\nconst syncCurrentTopDebounce = debounce(syncCurrentTop, 100);\nonMounted(() => {\n window.addEventListener('resize', syncCurrentTopDebounce);\n syncCurrentTop();\n});\nonUnmounted(() => {\n window.removeEventListener('resize', syncCurrentTop);\n});\nwatch(\n () => appStore.multiTab,\n () => {\n nextTick(() => {\n syncCurrentTop();\n });\n },\n);\nwatch(\n () => appStore.layout,\n () => {\n nextTick(() => {\n syncCurrentTop();\n });\n },\n);\n</script>\n<style lang=\"less\">\n.full-layout {\n margin: -24px -24px 0px -24px;\n height: calc(100vh - var(--current-top, 0px));\n overflow: auto;\n position: relative;\n}\n</style>\n","<template>\n <div\n ref=\"fullLayoutRef\"\n class=\"full-layout\"\n :style=\"{ '--current-top': currentTop + 'px' }\"\n >\n <slot></slot>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { useAppStore } from 'liyu-pc-base/init-plugin';\nimport { debounce } from 'lodash';\nimport { nextTick, onMounted, onUnmounted, provide, ref, shallowRef, watch } from 'vue';\nimport { FullLayoutState, fullLayoutStateSymbol } from './fullLayoutUtils';\nconst appStore = useAppStore();\nconst fullLayoutRef = shallowRef<HTMLElement | null>(null);\nconst currentTop = ref(0);\n\nprovide<FullLayoutState>(fullLayoutStateSymbol, {\n fullLayoutRef,\n});\nconst syncCurrentTop = () => {\n const layout = fullLayoutRef.value;\n if (layout) {\n const top = layout.getBoundingClientRect().top;\n currentTop.value = top;\n }\n};\nconst syncCurrentTopDebounce = debounce(syncCurrentTop, 100);\nonMounted(() => {\n window.addEventListener('resize', syncCurrentTopDebounce);\n syncCurrentTop();\n});\nonUnmounted(() => {\n window.removeEventListener('resize', syncCurrentTop);\n});\nwatch(\n () => appStore.multiTab,\n () => {\n nextTick(() => {\n syncCurrentTop();\n });\n },\n);\nwatch(\n () => appStore.layout,\n () => {\n nextTick(() => {\n syncCurrentTop();\n });\n },\n);\n</script>\n<style lang=\"less\">\n.full-layout {\n margin: -24px -24px 0px -24px;\n height: calc(100vh - var(--current-top, 0px));\n overflow: auto;\n position: relative;\n}\n</style>\n","let currentDir = 'auto';\n\n// let currentDir = 'auto'\n\nfunction hasDocument() {\n return typeof document !== 'undefined';\n}\n\nfunction hasWindow() {\n return typeof window !== 'undefined';\n}\n\nexport function getDocumentDir() {\n if (!hasDocument()) {\n return currentDir;\n }\n const direction =\n typeof document.dir !== 'undefined'\n ? document.dir\n : document.getElementsByTagName('html')[0].getAttribute('dir');\n return direction;\n}\n\nexport function setDocumentDir(dir: string) {\n // export function setDocumentDir(dir){\n if (!hasDocument) {\n currentDir = dir;\n return;\n }\n\n const html = document.getElementsByTagName('html')[0];\n html.setAttribute('dir', dir);\n}\n\nexport function addWindowEventListener(event: string, callback: () => void) {\n if (!hasWindow) {\n callback();\n return;\n }\n window.addEventListener(event, callback);\n}\n\nexport function removeWindowEventListener(event: string, callback: () => void) {\n if (!hasWindow) {\n return;\n }\n window.removeEventListener(event, callback);\n}\n","export type LayoutItem = {\n i: string;\n x?: number | string;\n y?: number | string;\n h: number | string;\n w: number | string;\n top_i?: string;\n left_i?: string;\n minW?: number;\n minH?: number;\n maxW?: number;\n maxH?: number;\n static?: boolean;\n moved?: boolean;\n isDraggable?: boolean;\n isResizable?: boolean;\n};\nexport type Layout = Array<LayoutItem>;\n\nconst getNum = (v: number | string): number => (typeof v === 'number' ? v : parseFloat(v) || 0);\n\nconst isAbsoluteValue = (v: number | string): boolean =>\n typeof v === 'string' &&\n (v.includes('px') || v.includes('calc') || v.includes('grow') || v.includes('%'));\n\n/**\n * Return the bottom coordinate of the layout.\n *\n * @param {Array} layout Layout array.\n * @return {Number} Bottom coordinate.\n */\nexport function bottom(layout: Layout): number {\n let max = 0;\n for (let i = 0, len = layout.length; i < len; i++) {\n const l = layout[i];\n const valY = l.y ?? 0;\n const valH = l.h ?? 0;\n const bottomY = getNum(valY) + getNum(valH);\n if (bottomY > max) max = bottomY;\n }\n return max;\n}\n\n// Fast path to cloning, since this is monomorphic\nexport function cloneLayoutItem(layoutItem: LayoutItem): LayoutItem {\n return JSON.parse(JSON.stringify(layoutItem));\n}\n\nexport function cloneLayout(layout: Layout): Layout {\n const newLayout = Array(layout.length);\n for (let i = 0, len = layout.length; i < len; i++) {\n newLayout[i] = cloneLayoutItem(layout[i]);\n }\n return newLayout;\n}\n\n/**\n * Given two layoutitems, check if they collide.\n *\n * @return {Boolean} True if colliding.\n */\nexport function collides(l1: LayoutItem, l2: LayoutItem): boolean {\n if (l1 === l2) return false; // same element\n const x1 = getNum(l1.x),\n y1 = getNum(l1.y),\n w1 = getNum(l1.w),\n h1 = getNum(l1.h);\n const x2 = getNum(l2.x),\n y2 = getNum(l2.y),\n w2 = getNum(l2.w),\n h2 = getNum(l2.h);\n if (x1 + w1 <= x2) return false; // l1 is left of l2\n if (x1 >= x2 + w2) return false; // l1 is right of l2\n if (y1 + h1 <= y2) return false; // l1 is above l2\n if (y1 >= y2 + h2) return false; // l1 is below l2\n return true; // boxes overlap\n}\n\n/**\n * Given a layout, compact it. This involves going down each y coordinate and removing gaps\n * between items.\n *\n * @param {Array} layout Layout.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} Compacted Layout.\n */\nexport function compact(layout: Layout, verticalCompact: boolean): Layout {\n const compareWith = getStatics(layout);\n const sorted = sortLayoutItemsByRowCol(layout);\n const out = Array(layout.length);\n\n for (let i = 0, len = sorted.length; i < len; i++) {\n let l = sorted[i];\n\n if (!l.static) {\n l = compactItem(compareWith, l, verticalCompact);\n compareWith.push(l);\n }\n\n out[layout.indexOf(l)] = l;\n l.moved = false;\n }\n\n return out;\n}\n\n/**\n * Compact an item in the layout.\n */\nexport function compactItem(\n compareWith: Layout,\n l: LayoutItem,\n verticalCompact: boolean,\n): LayoutItem {\n if (verticalCompact && !isAbsoluteValue(l.y) && l.top_i === undefined && l.left_i === undefined) {\n while (getNum(l.y) > 0 && !getFirstCollision(compareWith, l)) {\n l.y = getNum(l.y) - 1;\n }\n }\n\n let collides = {} as LayoutItem | void;\n while ((collides = getFirstCollision(compareWith, l))) {\n if (isAbsoluteValue(l.y) || l.top_i !== undefined || l.left_i !== undefined) break;\n l.y = getNum(collides.y) + getNum(collides.h);\n }\n return l;\n}\n\n/**\n * Given a layout, make sure all elements fit within its bounds.\n *\n * @param {Array} layout Layout array.\n * @param {Number} bounds Number of columns.\n */\nexport function correctBounds(layout: Layout, bounds: { cols: number }): Layout {\n const collidesWith = getStatics(layout);\n for (let i = 0, len = layout.length; i < len; i++) {\n const l = layout[i];\n const lx = getNum(l.x);\n const lw = getNum(l.w);\n\n if (\n lx + lw > bounds.cols &&\n !isAbsoluteValue(l.x) &&\n !isAbsoluteValue(l.w) &&\n l.left_i === undefined\n ) {\n l.x = bounds.cols - lw;\n }\n if (lx < 0 && !isAbsoluteValue(l.x) && l.left_i === undefined) {\n l.x = 0;\n l.w = bounds.cols;\n }\n if (!l.static) collidesWith.push(l);\n else {\n while (getFirstCollision(collidesWith, l)) {\n if (isAbsoluteValue(l.y) || l.top_i !== undefined || l.left_i !== undefined) break;\n l.y = getNum(l.y) + 1;\n }\n }\n }\n return layout;\n}\n\n/**\n * Get a layout item by ID. Used so we can override later on if necessary.\n *\n * @param {Array} layout Layout array.\n * @param {String} id ID\n * @return {LayoutItem} Item at ID.\n */\nexport function getLayoutItem(layout: Layout, id: string): LayoutItem | undefined {\n for (let i = 0, len = layout.length; i < len; i++) {\n if (layout[i].i === id) return layout[i];\n }\n}\n\n/**\n * Returns the first item this layout collides with.\n * It doesn't appear to matter which order we approach this from, although\n * perhaps that is the wrong thing to do.\n *\n * @param {Object} layoutItem Layout item.\n * @return {Object|undefined} A colliding layout item, or undefined.\n */\nexport function getFirstCollision(layout: Layout, layoutItem: LayoutItem): LayoutItem | void {\n for (let i = 0, len = layout.length; i < len; i++) {\n if (collides(layout[i], layoutItem)) return layout[i];\n }\n}\n\nexport function getAllCollisions(layout: Layout, layoutItem: LayoutItem): Layout {\n return layout.filter(l => collides(l, layoutItem));\n}\n\n/**\n * Get all static elements.\n * @param {Array} layout Array of layout objects.\n * @return {Array} Array of static layout items..\n */\nexport function getStatics(layout: Layout): Layout {\n return layout.filter(l => l.static);\n}\n\n/**\n * Move an element. Responsible for doing cascading movements of other elements.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} l element to move.\n * @param {Number} [x] X position in grid units.\n * @param {Number} [y] Y position in grid units.\n * @param {Boolean} [isUserAction] If true, designates that the item we're moving is\n * being dragged/resized by th euser.\n */\nexport function moveElement(\n layout: Layout,\n l: LayoutItem,\n x: number | void,\n y: number,\n isUserAction: boolean,\n preventCollision = false,\n) {\n if (l.static) return layout;\n\n const oldX = l.x;\n const oldY = l.y;\n\n const movingUp = y && getNum(l.y) > y;\n if (typeof x === 'number') l.x = x;\n if (typeof y === 'number') l.y = y;\n l.moved = true;\n\n let sorted = sortLayoutItemsByRowCol(layout);\n if (movingUp) sorted = sorted.reverse();\n const collisions = getAllCollisions(sorted, l);\n\n if (preventCollision && collisions.length) {\n l.x = oldX;\n l.y = oldY;\n l.moved = false;\n return layout;\n }\n\n for (let i = 0, len = collisions.length; i < len; i++) {\n const collision = collisions[i];\n if (collision.moved) continue;\n if (\n getNum(l.y) > getNum(collision.y) &&\n getNum(l.y) - getNum(collision.y) > getNum(collision.h) / 4\n )\n continue;\n\n if (collision.static) {\n layout = moveElementAwayFromCollision(layout, collision, l, isUserAction);\n } else {\n layout = moveElementAwayFromCollision(layout, l, collision, isUserAction);\n }\n }\n\n return layout;\n}\n\n/**\n * This is where the magic needs to happen - given a collision, move an element away from the collision.\n * We attempt to move it up if there's room, otherwise it goes below.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} collidesWith Layout item we're colliding with.\n * @param {LayoutItem} itemToMove Layout item we're moving.\n * @param {Boolean} [isUserAction] If true, designates that the item we're moving is being dragged/resized\n * by the user.\n */\nexport function moveElementAwayFromCollision(\n layout: Layout,\n collidesWith: LayoutItem,\n itemToMove: LayoutItem,\n isUserAction: boolean,\n) {\n const preventCollision = false;\n if (isUserAction) {\n const fakeItem: LayoutItem = {\n x: itemToMove.x,\n y: itemToMove.y,\n w: itemToMove.w,\n h: itemToMove.h,\n i: '-1',\n };\n fakeItem.y = Math.max(getNum(collidesWith.y) - getNum(itemToMove.h), 0);\n if (!getFirstCollision(layout, fakeItem)) {\n return moveElement(layout, itemToMove, undefined, fakeItem.y as number, preventCollision);\n }\n }\n\n return moveElement(\n layout,\n itemToMove,\n undefined,\n (getNum(itemToMove.y) + 1) as number,\n preventCollision,\n );\n}\n\nexport function setTransform(\n top: number | string,\n left: number | string,\n width: number | string,\n height: number | string,\n) {\n const leftStr = typeof left === 'number' ? left + 'px' : left;\n const topStr = typeof top === 'number' ? (top < 0 ? 0 : top) + 'px' : top;\n const translate = 'translate3d(' + leftStr + ',' + topStr + ', 0)';\n return {\n transform: translate,\n WebkitTransform: translate,\n MozTransform: translate,\n msTransform: translate,\n OTransform: translate,\n width: typeof width === 'number' ? width + 'px' : width,\n height: typeof height === 'number' ? height + 'px' : height,\n position: 'absolute' as const,\n };\n}\n\nexport function setTransformRtl(\n top: number | string,\n right: number | string,\n width: number | string,\n height: number | string,\n) {\n const rightStr = typeof right === 'number' ? right * -1 + 'px' : 'calc(' + right + ' * -1)';\n const topStr = typeof top === 'number' ? (top < 0 ? 0 : top) + 'px' : top;\n const translate = 'translate3d(' + rightStr + ',' + topStr + ', 0)';\n return {\n transform: translate,\n WebkitTransform: translate,\n MozTransform: translate,\n msTransform: translate,\n OTransform: translate,\n width: typeof width === 'number' ? width + 'px' : width,\n height: typeof height === 'number' ? height + 'px' : height,\n position: 'absolute' as const,\n };\n}\n\nexport function setTopLeft(\n top: number | string,\n left: number | string,\n width: number | string,\n height: number | string,\n) {\n return {\n top: typeof top === 'number' ? top + 'px' : top,\n left: typeof left === 'number' ? left + 'px' : left,\n width: typeof width === 'number' ? width + 'px' : width,\n height: typeof height === 'number' ? height + 'px' : height,\n position: 'absolute' as const,\n };\n}\n\nexport function setTopRight(\n top: number | string,\n right: number | string,\n width: number | string,\n height: number | string,\n) {\n return {\n top: typeof top === 'number' ? top + 'px' : top,\n right: typeof right === 'number' ? right + 'px' : right,\n width: typeof width === 'number' ? width + 'px' : width,\n height: typeof height === 'number' ? height + 'px' : height,\n position: 'absolute' as const,\n };\n}\n\nexport function sortLayoutItemsByRowCol(layout: Layout): Layout {\n return [...layout].sort((a, b) => {\n const ax = getNum(a.x);\n const ay = getNum(a.y);\n const bx = getNum(b.x);\n const by = getNum(b.y);\n\n if (ay === by && ax === bx) {\n return 0;\n }\n\n if (ay > by || (ay === by && ax > bx)) {\n return 1;\n }\n\n return -1;\n });\n}\n\nexport function validateLayout(layout: Layout, contextName = 'Layout'): void {\n const subProps = ['x', 'y', 'w', 'h'];\n if (!Array.isArray(layout)) throw new Error(contextName + ' must be an array!');\n for (let i = 0, len = layout.length; i < len; i++) {\n const item = layout[i];\n for (let j = 0; j < subProps.length; j++) {\n const key = subProps[j] as keyof LayoutItem;\n\n if (key === 'y' && 'top_i' in item) continue;\n if (key === 'x' && 'left_i' in item) continue;\n const val = item[key];\n if (typeof val !== 'number' && typeof val !== 'string') {\n throw new Error(\n 'VueGridLayout: ' +\n contextName +\n '[' +\n i +\n '].' +\n subProps[j] +\n ' must be a number or string!',\n );\n }\n }\n if (item.static !== undefined && typeof item.static !== 'boolean') {\n throw new Error('VueGridLayout: ' + contextName + '[' + i + '].static must be a boolean!');\n }\n }\n}\n","import { cloneLayout, compact, correctBounds } from './utils';\n\n/**\n * Given breakpoints, return an array of breakpoints sorted by width. This is usually\n * e.g. ['xxs', 'xs', 'sm', ...]\n *\n * @param {Object} breakpoints Key/value pair of breakpoint names to widths.\n * @return {Array} Sorted breakpoints.\n */\nexport function sortBreakpoints(breakpoints: any) {\n const keys = Object.keys(breakpoints);\n return keys.sort((a, b) => {\n return breakpoints[a] - breakpoints[b];\n });\n}\n\n/**\n * Given a width, find the highest breakpoint that matches is valid for it (width > breakpoint).\n *\n * @param {Object} breakpoints Breakpoints object (e.g. {lg: 1200, md: 960, ...})\n * @param {Number} width Screen width.\n * @return {String} Highest breakpoint that is less than width.\n */\nexport function getBreakpointFromWidth(breakpoints: any, width: number) {\n const sorted = sortBreakpoints(breakpoints);\n let matching = sorted[0];\n for (let i = 1, len = sorted.length; i < len; i++) {\n const breakpointName = sorted[i];\n if (width > breakpoints[breakpointName]) matching = breakpointName;\n }\n return matching;\n}\n\n/**\n * Given a breakpoint, get the # of cols set for it.\n * @param {String} breakpoint Breakpoint name.\n * @param {Object} cols Map of breakpoints to cols.\n * @return {Number} Number of cols.\n */\nexport function getColsFromBreakpoint(breakpoint: string, cols: any): number {\n if (!cols[breakpoint]) {\n throw new Error(\n 'ResponsiveGridLayout: `cols` entry for breakpoint ' + breakpoint + ' is missing!',\n );\n }\n return cols[breakpoint];\n}\n\n/**\n * Given existing layouts and a new breakpoint, find or generate a new layout.\n *\n * This finds the layout above the new one and generates from it, if it exists.\n *\n * @param {Array} orgLayout Original layout.\n * @param {Object} layouts Existing layouts.\n * @param {Array} breakpoints All breakpoints.\n * @param {String} breakpoint New breakpoint.\n * @param {String} breakpoint Last breakpoint (for fallback).\n * @param {Number} cols Column count at new breakpoint.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} New layout.\n */\nexport function findOrGenerateResponsiveLayout(\n orgLayout: any[],\n layouts: any,\n breakpoints: any[],\n breakpoint: string,\n lastBreakpoint: number,\n cols: number,\n verticalCompact: boolean,\n) {\n // If it already exists, just return it.\n if (layouts[breakpoint]) return cloneLayout(layouts[breakpoint]);\n // Find or generate the next layout\n let layout = orgLayout;\n\n const breakpointsSorted = sortBreakpoints(breakpoints);\n const breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));\n for (let i = 0, len = breakpointsAbove.length; i < len; i++) {\n const b = breakpointsAbove[i];\n if (layouts[b]) {\n layout = layouts[b];\n break;\n }\n }\n layout = cloneLayout(layout || []); // clone layout so we don't modify existing items\n return compact(correctBounds(layout, { cols }), verticalCompact);\n}\n\nexport function generateResponsiveLayout(\n layout: any,\n breakpoints: any,\n breakpoint: any,\n lastBreakpoint: any,\n cols: any,\n verticalCompact: any,\n) {\n // If it already exists, just return it.\n /* if (layouts[breakpoint]) return cloneLayout(layouts[breakpoint]);\n // Find or generate the next layout\n let layout = layouts[lastBreakpoint];*/\n /* const breakpointsSorted = sortBreakpoints(breakpoints);\nconst breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));\nfor (let i = 0, len = breakpointsAbove.length; i < len; i++) {\n const b = breakpointsAbove[i];\n if (layouts[b]) {\n layout = layouts[b];\n break;\n }\n}*/\n layout = cloneLayout(layout || []); // clone layout so we don't modify existing items\n return compact(correctBounds(layout, { cols }), verticalCompact);\n}\n","// Get from offsetParent\nexport function offsetXYFromParentOf(evt: MouseEvent): { x: number; y: number } {\n const offsetParent = (evt.target as HTMLElement).offsetParent || document.body;\n const offsetParentRect =\n offsetParent === document.body ? { left: 0, top: 0 } : offsetParent.getBoundingClientRect();\n\n const x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;\n const y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;\n\n /* const x = Math.round(evt.clientX + offsetParent.scrollLeft - offsetParentRect.left);\n const y = Math.round(evt.clientY + offsetParent.scrollTop - offsetParentRect.top);*/\n\n return { x, y };\n}\n\n// Get {x, y} positions from event.\nexport function getControlPosition(e: MouseEvent): { x: number; y: number } {\n return offsetXYFromParentOf(e);\n}\n\nfunction isNum(num: any): boolean {\n return typeof num === 'number' && !isNaN(num);\n}\n\n// Create an data object exposed by <DraggableCore>'s events\nexport function createCoreData(\n lastX: number,\n lastY: number,\n x: number,\n y: number,\n): { deltaX: number; deltaY: number; lastX: number; lastY: number; x: number; y: number } {\n // State changes are often (but not always!) async. We want the latest value.\n const isStart = !isNum(lastX);\n\n if (isStart) {\n // If this is our first move, use the x and y as last coords.\n return {\n deltaX: 0,\n deltaY: 0,\n lastX: x,\n lastY: y,\n x,\n y,\n };\n }\n // Otherwise calculate proper values.\n return {\n deltaX: x - lastX,\n deltaY: y - lastY,\n lastX,\n lastY,\n x,\n y,\n };\n}\n","<template>\n <div\n ref=\"item\"\n class=\"vue-grid-item\"\n :class=\"classObj\"\n :style=\"style\"\n >\n <slot></slot>\n <span\n v-if=\"resizableAndNotStatic\"\n ref=\"handle\"\n :class=\"resizableHandleClass\"\n ></span>\n <!--<span v-if=\"draggable\" ref=\"dragHandle\" class=\"vue-draggable-handle\"></span>-->\n </div>\n</template>\n<script setup lang=\"ts\">\nimport interact from 'interactjs';\nimport { computed, getCurrentInstance, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue';\nimport { getDocumentDir } from '../helpers/dom';\nimport { createCoreData, getControlPosition } from '../helpers/draggable-utils';\nimport { setTopLeft, setTopRight, setTransform, setTransformRtl } from '../helpers/utils';\nimport type { Layout, LayoutItem } from '../helpers/utils';\ndefineOptions({\n name: 'GridItem',\n});\n\nconst props = withDefaults(defineProps<LayoutItem & { usePercentages?: boolean }>(), {\n isDraggable: null,\n isResizable: null,\n static: false,\n minH: 1,\n minW: 1,\n maxH: Infinity,\n maxW: Infinity,\n dragIgnoreFrom: 'a, button',\n dragAllowFrom: null,\n resizeIgnoreFrom: 'a, button',\n usePercentages: null,\n});\n\nconst emit = defineEmits<{\n (\n e: 'container-resized',\n i: string | number,\n h: number | string,\n w: number | string,\n height: string,\n width: string,\n ): void;\n (\n e: 'resize',\n i: string | number,\n h: number | string,\n w: number | string,\n height: number,\n width: number,\n ): void;\n (\n e: 'resized',\n i: string | number,\n h: number | string,\n w: number | string,\n height: number,\n width: number,\n ): void;\n (e: 'move', i: string | number, x: number | string, y: number | string): void;\n (e: 'moved', i: string | number, x: number | string, y: number | string): void;\n}>();\n\nconst eventBus = inject<any>('eventBus');\nconst injectedUsePercentages = inject<boolean>('usePercentages', false);\nconst layout = inject<Layout>('layout');\n\nconst item = ref<HTMLElement | null>(null);\nconst handle = ref<HTMLElement | null>(null);\n\nconst cols = ref(1);\nconst containerWidth = ref(100);\nconst containerHeight = ref(100);\nconst rowHeight = ref(10);\nconst margin = ref([10, 10]);\nconst maxRows = ref(Infinity);\nconst draggable = ref<boolean | null>(null);\nconst resizable = ref<boolean | null>(null);\nconst useCssTransforms = ref(true);\nconst isDragging = ref(false);\nconst dragging = ref<any>(null);\nconst isResizing = ref(false);\nconst resizing = ref<any>(null);\nconst lastX = ref(NaN);\nconst lastY = ref(NaN);\nconst lastW = ref(NaN);\nconst lastH = ref(NaN);\nconst style = ref<Record<string, any>>({});\nconst rtl = ref(false);\nconst dragEventSet = ref(false);\nconst resizeEventSet = ref(false);\nconst previousW = ref<number | string | null>(null);\nconst previousH = ref<number | string | null>(null);\nconst previousX = ref<number | string | null>(null);\nconst previousY = ref<number | string | null>(null);\nconst innerX = ref<number | string>(props.x);\nconst innerY = ref<number | string>(props.y);\nconst innerW = ref<number | string>(props.w);\nconst innerH = ref<number | string>(props.h);\nconst interactObj = ref<any>(null);\n\nconst getVal = (v: number | string): number => (typeof v === 'number' ? v : parseFloat(v) || 0);\n\nconst parseUnit = (val: string | number | undefined, pos?: string | number): string => {\n if (val === undefined || val === null) return '0%';\n if (typeof val === 'number') return val + '%';\n if (val.endsWith('%') || val.endsWith('px') || val.includes('calc')) return val;\n if (val === 'grow') {\n if (pos !== undefined) {\n const p = typeof pos === 'number' ? pos + '%' : pos;\n return `calc(100% - ${p})`;\n }\n return '100%';\n }\n return val.includes('%') || val.includes('px') || val.includes('calc') ? val : val + '%';\n};\n\nconst usePercentagesInternal = computed(() => {\n return props.usePercentages !== null ? props.usePercentages : injectedUsePercentages;\n});\n\nconst resizableAndNotStatic = computed(() => {\n return resizable.value && !props.static;\n});\n\nconst draggableOrResizableAndNotStatic = computed(() => {\n return (draggable.value || resizable.value) && !props.static;\n});\n\nconst isAndroid = computed(() => {\n return navigator.userAgent.toLowerCase().indexOf('android') !== -1;\n});\n\nconst renderRtl = computed(() => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n return parent?.isMirrored ? !rtl.value : rtl.value;\n});\n\nconst classObj = computed(() => {\n return {\n 'vue-resizable': resizableAndNotStatic.value,\n static: props.static,\n resizing: isResizing.value,\n 'vue-draggable-dragging': isDragging.value,\n cssTransforms: useCssTransforms.value,\n 'render-rtl': renderRtl.value,\n 'disable-userselect': isDragging.value,\n 'no-touch': isAndroid.value && draggableOrResizableAndNotStatic.value,\n };\n});\n\nconst resizableHandleClass = computed(() => {\n if (renderRtl.value) {\n return 'vue-resizable-handle vue-rtl-resizable-handle';\n }\n return 'vue-resizable-handle';\n});\n\nconst calcColWidth = () => {\n return (containerWidth.value - (margin.value[0] || 10) * (cols.value + 1)) / cols.value;\n};\n\nconst calcPosition = (\n x: number | string,\n y: number | string,\n w: number | string,\n h: number | string,\n) => {\n if (usePercentagesInternal.value) {\n const out: any = {\n width: parseUnit(w, x),\n height: parseUnit(h, y),\n top: parseUnit(y),\n };\n if (renderRtl.value) {\n out.right = parseUnit(x);\n } else {\n out.left = parseUnit(x);\n }\n return out;\n }\n\n const colWidth = calcColWidth();\n let out: any = null;\n const nx = getVal(x);\n const ny = getVal(y);\n const nw = getVal(w);\n const nh = getVal(h);\n\n if (renderRtl.value) {\n out = {\n right:\n typeof x === 'string' && (x.includes('calc') || x.includes('px'))\n ? x\n : Math.round(colWidth * nx + (nx + 1) * margin.value[0]),\n top:\n typeof y === 'string' && (y.includes('calc') || y.includes('px'))\n ? y\n : Math.round(rowHeight.value * ny + (ny + 1) * margin.value[1]),\n width:\n typeof w === 'string' && (w.includes('calc') || w.includes('px'))\n ? w\n : nw === Infinity\n ? nw\n : Math.round(colWidth * nw + Math.max(0, nw - 1) * margin.value[0]),\n height:\n typeof h === 'string' && (h.includes('calc') || h.includes('px'))\n ? h\n : nh === Infinity\n ? nh\n : Math.round(rowHeight.value * nh + Math.max(0, nh - 1) * margin.value[1]),\n };\n } else {\n out = {\n left:\n typeof x === 'string' && (x.includes('calc') || x.includes('px'))\n ? x\n : Math.round(colWidth * nx + (nx + 1) * margin.value[0]),\n top:\n typeof y === 'string' && (y.includes('calc') || y.includes('px'))\n ? y\n : Math.round(rowHeight.value * ny + (ny + 1) * margin.value[1]),\n width:\n typeof w === 'string' && (w.includes('calc') || w.includes('px'))\n ? w\n : nw === Infinity\n ? nw\n : Math.round(colWidth * nw + Math.max(0, nw - 1) * margin.value[0]),\n height:\n typeof h === 'string' && (h.includes('calc') || h.includes('px'))\n ? h\n : nh === Infinity\n ? nh\n : Math.round(rowHeight.value * nh + Math.max(0, nh - 1) * margin.value[1]),\n };\n }\n return out;\n};\n\nconst resolveItemValue = (id: string, prop: 'x' | 'y'): string | number => {\n if (!layout) return 0;\n const item = (layout as any).find((l: any) => l.i === id);\n if (!item) return 0;\n\n if (prop === 'y') {\n if (item.top_i !== undefined && item.top_i !== null) {\n const refItem = (layout as any).find((l: any) => l.i === item.top_i);\n const refY = resolveItemValue(item.top_i, 'y');\n return `calc(${parseUnit(refY)} + ${parseUnit(refItem?.h ?? 0)})`;\n }\n return item.y ?? 0;\n } else {\n if (item.left_i !== undefined && item.left_i !== null) {\n const refItem = (layout as any).find((l: any) => l.i === item.left_i);\n const refX = resolveItemValue(item.left_i, 'x');\n return `calc(${parseUnit(refX)} + ${parseUnit(refItem?.w ?? 0)})`;\n }\n return item.x ?? 0;\n }\n};\n\nconst createStyle = () => {\n if (!usePercentagesInternal.value) {\n const px = getVal(props.x);\n const pw = getVal(props.w);\n if (px + pw > cols.value) {\n innerX.value = 0;\n innerW.value = pw > cols.value ? cols.value : pw;\n } else {\n innerX.value = props.x;\n innerW.value = props.w;\n }\n } else {\n innerX.value = props.x;\n innerW.value = props.w;\n }\n\n const actualX = resolveItemValue(String(props.i), 'x');\n const actualY = resolveItemValue(String(props.i), 'y');\n\n const pos = calcPosition(actualX, actualY, innerW.value, innerH.value);\n if (isDragging.value) {\n pos.top = dragging.value.top;\n if (typeof pos.top === 'number') pos.top += 'px';\n if (renderRtl.value) {\n pos.right = dragging.value.left;\n if (typeof pos.right === 'number') pos.right += 'px';\n } else {\n pos.left = dragging.value.left;\n if (typeof pos.left === 'number') pos.left += 'px';\n }\n }\n if (isResizing.value) {\n pos.width = resizing.value.width;\n if (typeof pos.width === 'number') pos.width += 'px';\n pos.height = resizing.value.height;\n if (typeof pos.height === 'number') pos.height += 'px';\n }\n let s: any = null;\n\n if (useCssTransforms.value && (isDragging.value || isResizing.value)) {\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n if (v.includes('calc')) {\n // Simple heuristic for calc(100% - pos)\n if (v.includes('100%')) {\n const parts = v.split('-');\n if (parts.length > 1) {\n return containerSize - getPx(parts[1].trim().replace(')', ''), containerSize);\n }\n }\n }\n return parseFloat(v) || 0;\n };\n\n const topPx = getPx(pos.top, containerHeight.value);\n const widthPx = getPx(pos.width, containerWidth.value);\n const heightPx = getPx(pos.height, containerHeight.value);\n\n if (renderRtl.value) {\n const rightPx = getPx(pos.right, containerWidth.value);\n s = setTransformRtl(topPx, rightPx, widthPx, heightPx);\n } else {\n const leftPx = getPx(pos.left, containerWidth.value);\n s = setTransform(topPx, leftPx, widthPx, heightPx);\n }\n } else if (useCssTransforms.value && !usePercentagesInternal.value) {\n if (renderRtl.value) {\n s = setTransformRtl(pos.top, pos.right!, pos.width, pos.height);\n } else {\n s = setTransform(pos.top, pos.left!, pos.width, pos.height);\n }\n } else {\n if (renderRtl.value) {\n s = setTopRight(pos.top, pos.right!, pos.width, pos.height);\n } else {\n s = setTopLeft(pos.top, pos.left!, pos.width, pos.height);\n }\n }\n\n for (const key of ['top', 'left', 'right', 'width', 'height']) {\n if (s[key] !== undefined && typeof s[key] === 'number') {\n s[key] += 'px';\n }\n }\n\n style.value = s;\n};\n\nconst emitContainerResized = () => {\n const styleProps: any = {};\n for (const prop of ['width', 'height']) {\n let val = style.value[prop];\n if (typeof val === 'string' && (val.includes('calc') || val.includes('%'))) {\n if (item.value) {\n val = prop === 'width' ? item.value.offsetWidth + 'px' : item.value.offsetHeight + 'px';\n } else {\n return;\n }\n }\n const matches = String(val).match(/^(\\d+(\\.\\d+)?)px$/);\n if (!matches) return;\n styleProps[prop] = matches[1];\n }\n emit('container-resized', props.i, props.h, props.w, styleProps.height, styleProps.width);\n};\n\nconst calcXY = (top: number, left: number) => {\n if (usePercentagesInternal.value) {\n let x = (left / containerWidth.value) * 100;\n let y = (top / containerHeight.value) * 100;\n\n x = Math.max(Math.min(x, 100 - getVal(innerW.value)), 0);\n y = Math.max(Math.min(y, 100 - getVal(innerH.value)), 0);\n return { x, y };\n }\n\n const colWidth = calcColWidth();\n let x = Math.round((left - margin.value[0]) / (colWidth + margin.value[0]));\n let y = Math.round((top - margin.value[1]) / (rowHeight.value + margin.value[1]));\n x = Math.max(Math.min(x, cols.value - getVal(innerW.value)), 0);\n y = Math.max(Math.min(y, maxRows.value - getVal(innerH.value)), 0);\n return { x, y };\n};\n\nconst calcWH = (height: number, width: number, autoSizeFlag = false) => {\n if (usePercentagesInternal.value) {\n let w = (width / containerWidth.value) * 100;\n let h = (height / containerHeight.value) * 100;\n\n w = Math.max(Math.min(w, 100 - getVal(innerX.value)), 0);\n h = Math.max(Math.min(h, 100 - getVal(innerY.value)), 0);\n return { w, h };\n }\n\n const colWidth = calcColWidth();\n let w = Math.round((width + margin.value[0]) / (colWidth + margin.value[0]));\n let h = 0;\n if (!autoSizeFlag) {\n h = Math.round((height + margin.value[1]) / (rowHeight.value + margin.value[1]));\n } else {\n h = Math.ceil((height + margin.value[1]) / (rowHeight.value + margin.value[1]));\n }\n w = Math.max(Math.min(w, cols.value - getVal(innerX.value)), 0);\n h = Math.max(Math.min(h, maxRows.value - getVal(innerY.value)), 0);\n return { w, h };\n};\n\nconst handleDrag = (event: any) => {\n if (props.static) return;\n if (isResizing.value) return;\n const position = getControlPosition(event);\n if (position === null) return;\n const { x, y } = position;\n const newPosition = { top: 0, left: 0 };\n switch (event.type) {\n case 'dragstart': {\n previousX.value = innerX.value;\n previousY.value = innerY.value;\n const parentRect = event.target.offsetParent.getBoundingClientRect();\n const clientRect = event.target.getBoundingClientRect();\n if (renderRtl.value) {\n newPosition.left = (clientRect.right - parentRect.right) * -1;\n } else {\n newPosition.left = clientRect.left - parentRect.left;\n }\n newPosition.top = clientRect.top - parentRect.top;\n dragging.value = newPosition;\n isDragging.value = true;\n break;\n }\n case 'dragend': {\n if (!isDragging.value) return;\n const parentRect = event.target.offsetParent.getBoundingClientRect();\n const clientRect = event.target.getBoundingClientRect();\n if (renderRtl.value) {\n newPosition.left = (clientRect.right - parentRect.right) * -1;\n } else {\n newPosition.left = clientRect.left - parentRect.left;\n }\n newPosition.top = clientRect.top - parentRect.top;\n dragging.value = null;\n isDragging.value = false;\n break;\n }\n case 'dragmove': {\n const coreEvent = createCoreData(lastX.value, lastY.value, x, y);\n if (renderRtl.value) {\n newPosition.left = dragging.value.left - coreEvent.deltaX;\n } else {\n newPosition.left = dragging.value.left + coreEvent.deltaX;\n }\n newPosition.top = dragging.value.top + coreEvent.deltaY;\n dragging.value = newPosition;\n break;\n }\n }\n let pos = calcXY(newPosition.top, newPosition.left);\n lastX.value = x;\n lastY.value = y;\n if (getVal(innerX.value) !== pos.x || getVal(innerY.value) !== pos.y) {\n emit('move', props.i, pos.x, pos.y);\n }\n if (\n event.type === 'dragend' &&\n (getVal(previousX.value!) !== pos.x || getVal(previousY.value!) !== pos.y)\n ) {\n emit('moved', props.i, pos.x, pos.y);\n }\n if (usePercentagesInternal.value) {\n eventBus.emit('dragEvent', {\n eventType: event.type,\n i: props.i,\n x: pos.x,\n y: pos.y,\n h: innerH.value,\n w: innerW.value,\n });\n } else {\n eventBus.emit('dragEvent', {\n eventType: event.type,\n i: props.i,\n x: pos.x,\n y: pos.y,\n h: getVal(innerH.value),\n w: getVal(innerW.value),\n });\n }\n};\n\nconst handleResize = (event: any) => {\n if (props.static) return;\n const position = getControlPosition(event);\n if (position == null) return;\n const { x, y } = position;\n const newSize = { width: 0, height: 0 };\n let posStyle: any = null;\n switch (event.type) {\n case 'resizestart': {\n previousW.value = innerW.value;\n previousH.value = innerH.value;\n posStyle = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);\n\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n return parseFloat(v) || 0;\n };\n\n newSize.width = getPx(posStyle.width, containerWidth.value);\n newSize.height = getPx(posStyle.height, containerHeight.value);\n\n resizing.value = newSize;\n isResizing.value = true;\n break;\n }\n case 'resizemove': {\n const coreEvent = createCoreData(lastW.value, lastH.value, x, y);\n if (renderRtl.value) {\n newSize.width = resizing.value.width - coreEvent.deltaX;\n } else {\n newSize.width = resizing.value.width + coreEvent.deltaX;\n }\n newSize.height = resizing.value.height + coreEvent.deltaY;\n resizing.value = newSize;\n break;\n }\n case 'resizeend': {\n posStyle = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);\n\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n return parseFloat(v) || 0;\n };\n\n newSize.width = getPx(posStyle.width, containerWidth.value);\n newSize.height = getPx(posStyle.height, containerHeight.value);\n\n resizing.value = null;\n isResizing.value = false;\n break;\n }\n }\n const pos = calcWH(newSize.height, newSize.width);\n if (!usePercentagesInternal.value) {\n if (pos.w < props.minW) pos.w = props.minW;\n if (pos.w > props.maxW) pos.w = props.maxW;\n if (pos.h < props.minH) pos.h = props.minH;\n if (pos.h > props.maxH) pos.h = props.maxH;\n if (pos.h < 1) pos.h = 1;\n if (pos.w < 1) pos.w = 1;\n }\n lastW.value = x;\n lastH.value = y;\n if (getVal(innerW.value) !== pos.w || getVal(innerH.value) !== pos.h) {\n emit('resize', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n if (\n event.type === 'resizeend' &&\n (getVal(previousW.value!) !== pos.w || getVal(previousH.value!) !== pos.h)\n ) {\n emit('resized', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n eventBus.emit('resizeEvent', {\n eventType: event.type,\n i: props.i,\n x: getVal(innerX.value),\n y: getVal(innerY.value),\n h: pos.h,\n w: pos.w,\n });\n};\n\nconst tryMakeDraggable = () => {\n if (interactObj.value === null || interactObj.value === undefined) {\n interactObj.value = interact(item.value as any);\n }\n if (draggable.value && !props.static) {\n const opts = {\n ignoreFrom: props.dragIgnoreFrom,\n allowFrom: props.dragAllowFrom,\n };\n interactObj.value.draggable(opts);\n if (!dragEventSet.value) {\n dragEventSet.value = true;\n interactObj.value.on('dragstart dragmove dragend', (event: any) => {\n handleDrag(event);\n });\n }\n } else {\n interactObj.value.draggable({\n enabled: false,\n });\n }\n};\n\nconst tryMakeResizable = () => {\n if (interactObj.value === null || interactObj.value === undefined) {\n interactObj.value = interact(item.value as any);\n }\n if (resizable.value && !props.static) {\n let maximumPx: any;\n let minimumPx: any;\n\n if (usePercentagesInternal.value) {\n maximumPx = {\n width: (props.maxW / 100) * containerWidth.value,\n height: (props.maxH / 100) * containerHeight.value,\n };\n minimumPx = {\n width: (props.minW / 100) * containerWidth.value,\n height: (props.minH / 100) * containerHeight.value,\n };\n } else {\n const maximum = calcPosition(0, 0, props.maxW, props.maxH);\n const minimum = calcPosition(0, 0, props.minW, props.minH);\n maximumPx = {\n width: parseFloat(maximum.width),\n height: parseFloat(maximum.height),\n };\n minimumPx = {\n width: parseFloat(minimum.width),\n height: parseFloat(minimum.height),\n };\n }\n\n const opts = {\n preserveAspectRatio: true,\n edges: {\n left: false,\n right: '.' + resizableHandleClass.value,\n bottom: '.' + resizableHandleClass.value,\n top: false,\n },\n ignoreFrom: props.resizeIgnoreFrom,\n restrictSize: {\n min: minimumPx,\n max: maximumPx,\n },\n };\n interactObj.value.resizable(opts);\n if (!resizeEventSet.value) {\n resizeEventSet.value = true;\n interactObj.value.on('resizestart resizemove resizeend', (event: any) => {\n handleResize(event);\n });\n }\n } else {\n interactObj.value.resizable({\n enabled: false,\n });\n }\n};\n\nconst updateWidth = (width: number, colNum?: number) => {\n containerWidth.value = width || 100;\n if (colNum !== undefined && colNum !== null) {\n cols.value = colNum;\n }\n if (item.value && item.value.parentElement) {\n containerHeight.value = item.value.parentElement.offsetHeight || 100;\n }\n};\n\nconst compact = () => {\n createStyle();\n};\n\nconst autoSize = () => {\n previousW.value = innerW.value;\n previousH.value = innerH.value;\n if (item.value && item.value.firstElementChild) {\n const newSize = item.value.firstElementChild.getBoundingClientRect();\n const pos = calcWH(newSize.height, newSize.width, true);\n if (!usePercentagesInternal.value) {\n if (pos.w < props.minW) pos.w = props.minW;\n if (pos.w > props.maxW) pos.w = props.maxW;\n if (pos.h < props.minH) pos.h = props.minH;\n if (pos.h > props.maxH) pos.h = props.maxH;\n if (pos.h < 1) pos.h = 1;\n if (pos.w < 1) pos.w = 1;\n }\n if (getVal(innerW.value) !== pos.w || getVal(innerH.value) !== pos.h) {\n emit('resize', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n if (getVal(previousW.value!) !== pos.w || getVal(previousH.value!) !== pos.h) {\n emit('resized', props.i, pos.h, pos.w, newSize.height, newSize.width);\n eventBus.emit('resizeEvent', {\n eventType: 'resizeend',\n i: props.i,\n x: getVal(innerX.value),\n y: getVal(innerY.value),\n h: pos.h,\n w: pos.w,\n });\n }\n }\n};\n\nconst updateWidthHandler = (width: number) => {\n updateWidth(width);\n};\nconst compactHandler = () => {\n compact();\n};\nconst setDraggableHandler = (isDraggable: boolean) => {\n if (props.isDraggable === null) {\n draggable.value = isDraggable;\n }\n};\nconst setResizableHandler = (isResizable: boolean) => {\n if (props.isResizable === null) {\n resizable.value = isResizable;\n }\n};\nconst setRowHeightHandler = (val: number) => {\n rowHeight.value = val;\n};\nconst setMaxRowsHandler = (val: number) => {\n maxRows.value = val;\n};\nconst directionchangeHandler = () => {\n rtl.value = getDocumentDir() === 'rtl';\n compact();\n};\nconst setColNum = (colNum: any) => {\n cols.value = parseInt(colNum, 10);\n};\n\nonMounted(() => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n\n cols.value = parent.colNum;\n rowHeight.value = parent.rowHeight;\n containerWidth.value = parent.width !== null && parent.width !== 0 ? parent.width : 100;\n margin.value = parent.margin !== undefined ? parent.margin : [10, 10];\n maxRows.value = parent.maxRows;\n\n if (item.value && item.value.parentElement) {\n containerHeight.value = item.value.parentElement.offsetHeight || 100;\n if (containerWidth.value === 100) {\n containerWidth.value = item.value.parentElement.offsetWidth || 100;\n }\n }\n\n if (props.isDraggable === null) {\n draggable.value = parent.isDraggable;\n } else {\n draggable.value = props.isDraggable;\n }\n if (props.isResizable === null) {\n resizable.value = parent.isResizable;\n } else {\n resizable.value = props.isResizable;\n }\n useCssTransforms.value = parent.useCssTransforms;\n\n eventBus.on('updateWidth', updateWidthHandler);\n eventBus.on('compact', compactHandler);\n eventBus.on('setDraggable', setDraggableHandler);\n eventBus.on('setResizable', setResizableHandler);\n eventBus.on('setRowHeight', setRowHeightHandler);\n eventBus.on('setMaxRows', setMaxRowsHandler);\n eventBus.on('directionchange', directionchangeHandler);\n eventBus.on('setColNum', setColNum);\n rtl.value = getDocumentDir() === 'rtl';\n\n createStyle();\n});\n\nonBeforeUnmount(() => {\n eventBus.off('updateWidth', updateWidthHandler);\n eventBus.off('compact', compactHandler);\n eventBus.off('setDraggable', setDraggableHandler);\n eventBus.off('setResizable', setResizableHandler);\n eventBus.off('setRowHeight', setRowHeightHandler);\n eventBus.off('setMaxRows', setMaxRowsHandler);\n eventBus.off('directionchange', directionchangeHandler);\n eventBus.off('setColNum', setColNum);\n if (interactObj.value) {\n interactObj.value.unset();\n }\n});\n\nwatch(\n () => props.isDraggable,\n () => {\n draggable.value = props.isDraggable;\n },\n);\n\nwatch(\n () => props.static,\n () => {\n tryMakeDraggable();\n tryMakeResizable();\n },\n);\n\nwatch(draggable, () => {\n tryMakeDraggable();\n});\n\nwatch(\n () => props.isResizable,\n () => {\n resizable.value = props.isResizable;\n },\n);\n\nwatch(resizable, () => {\n tryMakeResizable();\n});\n\nwatch(rowHeight, () => {\n createStyle();\n emitContainerResized();\n});\n\nwatch(cols, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(containerWidth, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(containerHeight, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(\n () => props.x,\n newVal => {\n innerX.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.y,\n newVal => {\n innerY.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.h,\n newVal => {\n innerH.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.w,\n newVal => {\n innerW.value = newVal;\n createStyle();\n },\n);\n\nwatch(renderRtl, () => {\n tryMakeResizable();\n createStyle();\n});\n\nwatch(\n () => props.minH,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.maxH,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.minW,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.maxW,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n return parent?.margin;\n },\n val => {\n if (!val || (val[0] === margin.value[0] && val[1] === margin.value[1])) {\n return;\n }\n margin.value = val.map((m: any) => Number(m));\n createStyle();\n emitContainerResized();\n },\n);\n\ndefineExpose({\n autoSize,\n compact,\n updateWidth,\n});\n</script>\n\n<style>\n.vue-grid-item {\n transition: none;\n transition-property: left, top, right;\n /* add right for rtl */\n}\n.vue-grid-item.no-touch {\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.vue-grid-item.cssTransforms {\n right: auto;\n left: 0;\n transition-property: transform;\n}\n\n.vue-grid-item.cssTransforms.render-rtl {\n right: 0;\n left: auto;\n}\n\n.vue-grid-item.resizing {\n z-index: 3;\n opacity: 0.6;\n}\n\n.vue-grid-item.vue-draggable-dragging {\n z-index: 3;\n transition: none;\n}\n\n.vue-grid-item.vue-grid-placeholder {\n z-index: 2;\n background: pink;\n transition-duration: 100ms;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n}\n\n.vue-grid-item > .vue-resizable-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 20px;\n height: 20px;\n padding: 0 3px 3px 0;\n background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: bottom right;\n background-origin: content-box;\n cursor: se-resize;\n}\n\n.vue-grid-item > .vue-rtl-resizable-handle {\n right: auto;\n bottom: 0;\n left: 0;\n padding-left: 3px;\n background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAuMDAwMDAwMDAwMDAwMDAyIiBoZWlnaHQ9IjEwLjAwMDAwMDAwMDAwMDAwMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDwhLS0gQ3JlYXRlZCB3aXRoIE1ldGhvZCBEcmF3IC0gaHR0cDovL2dpdGh1Yi5jb20vZHVvcGl4ZWwvTWV0aG9kLURyYXcvIC0tPgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9Im5vbmUiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSIxMiIgd2lkdGg9IjEyIiB5PSItMSIgeD0iLTEiLz4KICA8ZyBkaXNwbGF5PSJub25lIiBvdmVyZmxvdz0idmlzaWJsZSIgeT0iMCIgeD0iMCIgaGVpZ2h0PSIxMDAlIiB3aWR0aD0iMTAwJSIgaWQ9ImNhbnZhc0dyaWQiPgogICA8cmVjdCBmaWxsPSJ1cmwoI2dyaWRwYXR0ZXJuKSIgc3Ryb2tlLXdpZHRoPSIwIiB5PSIwIiB4PSIwIiBoZWlnaHQ9IjEwMCUiIHdpZHRoPSIxMDAlIi8+CiAgPC9nPgogPC9nPgogPGc+CiAgPHRpdGxlPkxheWVyIDE8L3RpdGxlPgogIDxsaW5lIGNhbnZhcz0iI2ZmZmZmZiIgY2FudmFzLW9wYWNpdHk9IjEiIHN0cm9rZS1saW5lY2FwPSJ1bmRlZmluZWQiIHN0cm9rZS1saW5lam9pbj0idW5kZWZpbmVkIiBpZD0ic3ZnXzEiIHkyPSItNzAuMTc4NDA3IiB4Mj0iMTI0LjQ2NDA3NSIgeTE9Ii0zOC4zOTI3MzciIHgxPSIxNDQuODIxMjg5IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlPSIjMDAwIiBmaWxsPSJub25lIi8+CiAgPGxpbmUgc3Ryb2tlPSIjNjY2NjY2IiBzdHJva2UtbGluZWNhcD0idW5kZWZpbmVkIiBzdHJva2UtbGluZWpvaW49InVuZGVmaW5lZCIgaWQ9InN2Z181IiB5Mj0iOS4xMDY5NTciIHgyPSIwLjk0NzI0NyIgeTE9Ii0wLjAxODEyOCIgeDE9IjAuOTQ3MjQ3IiBzdHJva2Utd2lkdGg9IjIiIGZpbGw9Im5vbmUiLz4KICA8bGluZSBzdHJva2UtbGluZWNhcD0idW5kZWZpbmVkIiBzdHJva2UtbGluZWpvaW49InVuZGVmaW5lZCIgaWQ9InN2Z183IiB5Mj0iOSIgeDI9IjEwLjA3MzUyOSIgeTE9IjkiIHgxPSItMC42NTU2NCIgc3Ryb2tlLXdpZHRoPSIwIiBzdHJva2U9IiM2NjY2NjYiIGZpbGw9Im5vbmUiLz4KIDwvZz4KPC9zdmc+);\n background-repeat: no-repeat;\n background-position: bottom left;\n background-origin: content-box;\n cursor: sw-resize;\n}\n\n.vue-grid-item.disable-userselect {\n user-select: none;\n}\n</style>\n","<template>\n <div\n ref=\"item\"\n class=\"vue-grid-item\"\n :class=\"classObj\"\n :style=\"style\"\n >\n <slot></slot>\n <span\n v-if=\"resizableAndNotStatic\"\n ref=\"handle\"\n :class=\"resizableHandleClass\"\n ></span>\n <!--<span v-if=\"draggable\" ref=\"dragHandle\" class=\"vue-draggable-handle\"></span>-->\n </div>\n</template>\n<script setup lang=\"ts\">\nimport interact from 'interactjs';\nimport { computed, getCurrentInstance, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue';\nimport { getDocumentDir } from '../helpers/dom';\nimport { createCoreData, getControlPosition } from '../helpers/draggable-utils';\nimport { setTopLeft, setTopRight, setTransform, setTransformRtl } from '../helpers/utils';\nimport type { Layout, LayoutItem } from '../helpers/utils';\ndefineOptions({\n name: 'GridItem',\n});\n\nconst props = withDefaults(defineProps<LayoutItem & { usePercentages?: boolean }>(), {\n isDraggable: null,\n isResizable: null,\n static: false,\n minH: 1,\n minW: 1,\n maxH: Infinity,\n maxW: Infinity,\n dragIgnoreFrom: 'a, button',\n dragAllowFrom: null,\n resizeIgnoreFrom: 'a, button',\n usePercentages: null,\n});\n\nconst emit = defineEmits<{\n (\n e: 'container-resized',\n i: string | number,\n h: number | string,\n w: number | string,\n height: string,\n width: string,\n ): void;\n (\n e: 'resize',\n i: string | number,\n h: number | string,\n w: number | string,\n height: number,\n width: number,\n ): void;\n (\n e: 'resized',\n i: string | number,\n h: number | string,\n w: number | string,\n height: number,\n width: number,\n ): void;\n (e: 'move', i: string | number, x: number | string, y: number | string): void;\n (e: 'moved', i: string | number, x: number | string, y: number | string): void;\n}>();\n\nconst eventBus = inject<any>('eventBus');\nconst injectedUsePercentages = inject<boolean>('usePercentages', false);\nconst layout = inject<Layout>('layout');\n\nconst item = ref<HTMLElement | null>(null);\nconst handle = ref<HTMLElement | null>(null);\n\nconst cols = ref(1);\nconst containerWidth = ref(100);\nconst containerHeight = ref(100);\nconst rowHeight = ref(10);\nconst margin = ref([10, 10]);\nconst maxRows = ref(Infinity);\nconst draggable = ref<boolean | null>(null);\nconst resizable = ref<boolean | null>(null);\nconst useCssTransforms = ref(true);\nconst isDragging = ref(false);\nconst dragging = ref<any>(null);\nconst isResizing = ref(false);\nconst resizing = ref<any>(null);\nconst lastX = ref(NaN);\nconst lastY = ref(NaN);\nconst lastW = ref(NaN);\nconst lastH = ref(NaN);\nconst style = ref<Record<string, any>>({});\nconst rtl = ref(false);\nconst dragEventSet = ref(false);\nconst resizeEventSet = ref(false);\nconst previousW = ref<number | string | null>(null);\nconst previousH = ref<number | string | null>(null);\nconst previousX = ref<number | string | null>(null);\nconst previousY = ref<number | string | null>(null);\nconst innerX = ref<number | string>(props.x);\nconst innerY = ref<number | string>(props.y);\nconst innerW = ref<number | string>(props.w);\nconst innerH = ref<number | string>(props.h);\nconst interactObj = ref<any>(null);\n\nconst getVal = (v: number | string): number => (typeof v === 'number' ? v : parseFloat(v) || 0);\n\nconst parseUnit = (val: string | number | undefined, pos?: string | number): string => {\n if (val === undefined || val === null) return '0%';\n if (typeof val === 'number') return val + '%';\n if (val.endsWith('%') || val.endsWith('px') || val.includes('calc')) return val;\n if (val === 'grow') {\n if (pos !== undefined) {\n const p = typeof pos === 'number' ? pos + '%' : pos;\n return `calc(100% - ${p})`;\n }\n return '100%';\n }\n return val.includes('%') || val.includes('px') || val.includes('calc') ? val : val + '%';\n};\n\nconst usePercentagesInternal = computed(() => {\n return props.usePercentages !== null ? props.usePercentages : injectedUsePercentages;\n});\n\nconst resizableAndNotStatic = computed(() => {\n return resizable.value && !props.static;\n});\n\nconst draggableOrResizableAndNotStatic = computed(() => {\n return (draggable.value || resizable.value) && !props.static;\n});\n\nconst isAndroid = computed(() => {\n return navigator.userAgent.toLowerCase().indexOf('android') !== -1;\n});\n\nconst renderRtl = computed(() => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n return parent?.isMirrored ? !rtl.value : rtl.value;\n});\n\nconst classObj = computed(() => {\n return {\n 'vue-resizable': resizableAndNotStatic.value,\n static: props.static,\n resizing: isResizing.value,\n 'vue-draggable-dragging': isDragging.value,\n cssTransforms: useCssTransforms.value,\n 'render-rtl': renderRtl.value,\n 'disable-userselect': isDragging.value,\n 'no-touch': isAndroid.value && draggableOrResizableAndNotStatic.value,\n };\n});\n\nconst resizableHandleClass = computed(() => {\n if (renderRtl.value) {\n return 'vue-resizable-handle vue-rtl-resizable-handle';\n }\n return 'vue-resizable-handle';\n});\n\nconst calcColWidth = () => {\n return (containerWidth.value - (margin.value[0] || 10) * (cols.value + 1)) / cols.value;\n};\n\nconst calcPosition = (\n x: number | string,\n y: number | string,\n w: number | string,\n h: number | string,\n) => {\n if (usePercentagesInternal.value) {\n const out: any = {\n width: parseUnit(w, x),\n height: parseUnit(h, y),\n top: parseUnit(y),\n };\n if (renderRtl.value) {\n out.right = parseUnit(x);\n } else {\n out.left = parseUnit(x);\n }\n return out;\n }\n\n const colWidth = calcColWidth();\n let out: any = null;\n const nx = getVal(x);\n const ny = getVal(y);\n const nw = getVal(w);\n const nh = getVal(h);\n\n if (renderRtl.value) {\n out = {\n right:\n typeof x === 'string' && (x.includes('calc') || x.includes('px'))\n ? x\n : Math.round(colWidth * nx + (nx + 1) * margin.value[0]),\n top:\n typeof y === 'string' && (y.includes('calc') || y.includes('px'))\n ? y\n : Math.round(rowHeight.value * ny + (ny + 1) * margin.value[1]),\n width:\n typeof w === 'string' && (w.includes('calc') || w.includes('px'))\n ? w\n : nw === Infinity\n ? nw\n : Math.round(colWidth * nw + Math.max(0, nw - 1) * margin.value[0]),\n height:\n typeof h === 'string' && (h.includes('calc') || h.includes('px'))\n ? h\n : nh === Infinity\n ? nh\n : Math.round(rowHeight.value * nh + Math.max(0, nh - 1) * margin.value[1]),\n };\n } else {\n out = {\n left:\n typeof x === 'string' && (x.includes('calc') || x.includes('px'))\n ? x\n : Math.round(colWidth * nx + (nx + 1) * margin.value[0]),\n top:\n typeof y === 'string' && (y.includes('calc') || y.includes('px'))\n ? y\n : Math.round(rowHeight.value * ny + (ny + 1) * margin.value[1]),\n width:\n typeof w === 'string' && (w.includes('calc') || w.includes('px'))\n ? w\n : nw === Infinity\n ? nw\n : Math.round(colWidth * nw + Math.max(0, nw - 1) * margin.value[0]),\n height:\n typeof h === 'string' && (h.includes('calc') || h.includes('px'))\n ? h\n : nh === Infinity\n ? nh\n : Math.round(rowHeight.value * nh + Math.max(0, nh - 1) * margin.value[1]),\n };\n }\n return out;\n};\n\nconst resolveItemValue = (id: string, prop: 'x' | 'y'): string | number => {\n if (!layout) return 0;\n const item = (layout as any).find((l: any) => l.i === id);\n if (!item) return 0;\n\n if (prop === 'y') {\n if (item.top_i !== undefined && item.top_i !== null) {\n const refItem = (layout as any).find((l: any) => l.i === item.top_i);\n const refY = resolveItemValue(item.top_i, 'y');\n return `calc(${parseUnit(refY)} + ${parseUnit(refItem?.h ?? 0)})`;\n }\n return item.y ?? 0;\n } else {\n if (item.left_i !== undefined && item.left_i !== null) {\n const refItem = (layout as any).find((l: any) => l.i === item.left_i);\n const refX = resolveItemValue(item.left_i, 'x');\n return `calc(${parseUnit(refX)} + ${parseUnit(refItem?.w ?? 0)})`;\n }\n return item.x ?? 0;\n }\n};\n\nconst createStyle = () => {\n if (!usePercentagesInternal.value) {\n const px = getVal(props.x);\n const pw = getVal(props.w);\n if (px + pw > cols.value) {\n innerX.value = 0;\n innerW.value = pw > cols.value ? cols.value : pw;\n } else {\n innerX.value = props.x;\n innerW.value = props.w;\n }\n } else {\n innerX.value = props.x;\n innerW.value = props.w;\n }\n\n const actualX = resolveItemValue(String(props.i), 'x');\n const actualY = resolveItemValue(String(props.i), 'y');\n\n const pos = calcPosition(actualX, actualY, innerW.value, innerH.value);\n if (isDragging.value) {\n pos.top = dragging.value.top;\n if (typeof pos.top === 'number') pos.top += 'px';\n if (renderRtl.value) {\n pos.right = dragging.value.left;\n if (typeof pos.right === 'number') pos.right += 'px';\n } else {\n pos.left = dragging.value.left;\n if (typeof pos.left === 'number') pos.left += 'px';\n }\n }\n if (isResizing.value) {\n pos.width = resizing.value.width;\n if (typeof pos.width === 'number') pos.width += 'px';\n pos.height = resizing.value.height;\n if (typeof pos.height === 'number') pos.height += 'px';\n }\n let s: any = null;\n\n if (useCssTransforms.value && (isDragging.value || isResizing.value)) {\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n if (v.includes('calc')) {\n // Simple heuristic for calc(100% - pos)\n if (v.includes('100%')) {\n const parts = v.split('-');\n if (parts.length > 1) {\n return containerSize - getPx(parts[1].trim().replace(')', ''), containerSize);\n }\n }\n }\n return parseFloat(v) || 0;\n };\n\n const topPx = getPx(pos.top, containerHeight.value);\n const widthPx = getPx(pos.width, containerWidth.value);\n const heightPx = getPx(pos.height, containerHeight.value);\n\n if (renderRtl.value) {\n const rightPx = getPx(pos.right, containerWidth.value);\n s = setTransformRtl(topPx, rightPx, widthPx, heightPx);\n } else {\n const leftPx = getPx(pos.left, containerWidth.value);\n s = setTransform(topPx, leftPx, widthPx, heightPx);\n }\n } else if (useCssTransforms.value && !usePercentagesInternal.value) {\n if (renderRtl.value) {\n s = setTransformRtl(pos.top, pos.right!, pos.width, pos.height);\n } else {\n s = setTransform(pos.top, pos.left!, pos.width, pos.height);\n }\n } else {\n if (renderRtl.value) {\n s = setTopRight(pos.top, pos.right!, pos.width, pos.height);\n } else {\n s = setTopLeft(pos.top, pos.left!, pos.width, pos.height);\n }\n }\n\n for (const key of ['top', 'left', 'right', 'width', 'height']) {\n if (s[key] !== undefined && typeof s[key] === 'number') {\n s[key] += 'px';\n }\n }\n\n style.value = s;\n};\n\nconst emitContainerResized = () => {\n const styleProps: any = {};\n for (const prop of ['width', 'height']) {\n let val = style.value[prop];\n if (typeof val === 'string' && (val.includes('calc') || val.includes('%'))) {\n if (item.value) {\n val = prop === 'width' ? item.value.offsetWidth + 'px' : item.value.offsetHeight + 'px';\n } else {\n return;\n }\n }\n const matches = String(val).match(/^(\\d+(\\.\\d+)?)px$/);\n if (!matches) return;\n styleProps[prop] = matches[1];\n }\n emit('container-resized', props.i, props.h, props.w, styleProps.height, styleProps.width);\n};\n\nconst calcXY = (top: number, left: number) => {\n if (usePercentagesInternal.value) {\n let x = (left / containerWidth.value) * 100;\n let y = (top / containerHeight.value) * 100;\n\n x = Math.max(Math.min(x, 100 - getVal(innerW.value)), 0);\n y = Math.max(Math.min(y, 100 - getVal(innerH.value)), 0);\n return { x, y };\n }\n\n const colWidth = calcColWidth();\n let x = Math.round((left - margin.value[0]) / (colWidth + margin.value[0]));\n let y = Math.round((top - margin.value[1]) / (rowHeight.value + margin.value[1]));\n x = Math.max(Math.min(x, cols.value - getVal(innerW.value)), 0);\n y = Math.max(Math.min(y, maxRows.value - getVal(innerH.value)), 0);\n return { x, y };\n};\n\nconst calcWH = (height: number, width: number, autoSizeFlag = false) => {\n if (usePercentagesInternal.value) {\n let w = (width / containerWidth.value) * 100;\n let h = (height / containerHeight.value) * 100;\n\n w = Math.max(Math.min(w, 100 - getVal(innerX.value)), 0);\n h = Math.max(Math.min(h, 100 - getVal(innerY.value)), 0);\n return { w, h };\n }\n\n const colWidth = calcColWidth();\n let w = Math.round((width + margin.value[0]) / (colWidth + margin.value[0]));\n let h = 0;\n if (!autoSizeFlag) {\n h = Math.round((height + margin.value[1]) / (rowHeight.value + margin.value[1]));\n } else {\n h = Math.ceil((height + margin.value[1]) / (rowHeight.value + margin.value[1]));\n }\n w = Math.max(Math.min(w, cols.value - getVal(innerX.value)), 0);\n h = Math.max(Math.min(h, maxRows.value - getVal(innerY.value)), 0);\n return { w, h };\n};\n\nconst handleDrag = (event: any) => {\n if (props.static) return;\n if (isResizing.value) return;\n const position = getControlPosition(event);\n if (position === null) return;\n const { x, y } = position;\n const newPosition = { top: 0, left: 0 };\n switch (event.type) {\n case 'dragstart': {\n previousX.value = innerX.value;\n previousY.value = innerY.value;\n const parentRect = event.target.offsetParent.getBoundingClientRect();\n const clientRect = event.target.getBoundingClientRect();\n if (renderRtl.value) {\n newPosition.left = (clientRect.right - parentRect.right) * -1;\n } else {\n newPosition.left = clientRect.left - parentRect.left;\n }\n newPosition.top = clientRect.top - parentRect.top;\n dragging.value = newPosition;\n isDragging.value = true;\n break;\n }\n case 'dragend': {\n if (!isDragging.value) return;\n const parentRect = event.target.offsetParent.getBoundingClientRect();\n const clientRect = event.target.getBoundingClientRect();\n if (renderRtl.value) {\n newPosition.left = (clientRect.right - parentRect.right) * -1;\n } else {\n newPosition.left = clientRect.left - parentRect.left;\n }\n newPosition.top = clientRect.top - parentRect.top;\n dragging.value = null;\n isDragging.value = false;\n break;\n }\n case 'dragmove': {\n const coreEvent = createCoreData(lastX.value, lastY.value, x, y);\n if (renderRtl.value) {\n newPosition.left = dragging.value.left - coreEvent.deltaX;\n } else {\n newPosition.left = dragging.value.left + coreEvent.deltaX;\n }\n newPosition.top = dragging.value.top + coreEvent.deltaY;\n dragging.value = newPosition;\n break;\n }\n }\n let pos = calcXY(newPosition.top, newPosition.left);\n lastX.value = x;\n lastY.value = y;\n if (getVal(innerX.value) !== pos.x || getVal(innerY.value) !== pos.y) {\n emit('move', props.i, pos.x, pos.y);\n }\n if (\n event.type === 'dragend' &&\n (getVal(previousX.value!) !== pos.x || getVal(previousY.value!) !== pos.y)\n ) {\n emit('moved', props.i, pos.x, pos.y);\n }\n if (usePercentagesInternal.value) {\n eventBus.emit('dragEvent', {\n eventType: event.type,\n i: props.i,\n x: pos.x,\n y: pos.y,\n h: innerH.value,\n w: innerW.value,\n });\n } else {\n eventBus.emit('dragEvent', {\n eventType: event.type,\n i: props.i,\n x: pos.x,\n y: pos.y,\n h: getVal(innerH.value),\n w: getVal(innerW.value),\n });\n }\n};\n\nconst handleResize = (event: any) => {\n if (props.static) return;\n const position = getControlPosition(event);\n if (position == null) return;\n const { x, y } = position;\n const newSize = { width: 0, height: 0 };\n let posStyle: any = null;\n switch (event.type) {\n case 'resizestart': {\n previousW.value = innerW.value;\n previousH.value = innerH.value;\n posStyle = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);\n\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n return parseFloat(v) || 0;\n };\n\n newSize.width = getPx(posStyle.width, containerWidth.value);\n newSize.height = getPx(posStyle.height, containerHeight.value);\n\n resizing.value = newSize;\n isResizing.value = true;\n break;\n }\n case 'resizemove': {\n const coreEvent = createCoreData(lastW.value, lastH.value, x, y);\n if (renderRtl.value) {\n newSize.width = resizing.value.width - coreEvent.deltaX;\n } else {\n newSize.width = resizing.value.width + coreEvent.deltaX;\n }\n newSize.height = resizing.value.height + coreEvent.deltaY;\n resizing.value = newSize;\n break;\n }\n case 'resizeend': {\n posStyle = calcPosition(innerX.value, innerY.value, innerW.value, innerH.value);\n\n const getPx = (v: any, containerSize: number) => {\n if (typeof v === 'number') return v;\n if (typeof v !== 'string') return 0;\n if (v.endsWith('%')) return (parseFloat(v) / 100) * containerSize;\n if (v.endsWith('px')) return parseFloat(v);\n return parseFloat(v) || 0;\n };\n\n newSize.width = getPx(posStyle.width, containerWidth.value);\n newSize.height = getPx(posStyle.height, containerHeight.value);\n\n resizing.value = null;\n isResizing.value = false;\n break;\n }\n }\n const pos = calcWH(newSize.height, newSize.width);\n if (!usePercentagesInternal.value) {\n if (pos.w < props.minW) pos.w = props.minW;\n if (pos.w > props.maxW) pos.w = props.maxW;\n if (pos.h < props.minH) pos.h = props.minH;\n if (pos.h > props.maxH) pos.h = props.maxH;\n if (pos.h < 1) pos.h = 1;\n if (pos.w < 1) pos.w = 1;\n }\n lastW.value = x;\n lastH.value = y;\n if (getVal(innerW.value) !== pos.w || getVal(innerH.value) !== pos.h) {\n emit('resize', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n if (\n event.type === 'resizeend' &&\n (getVal(previousW.value!) !== pos.w || getVal(previousH.value!) !== pos.h)\n ) {\n emit('resized', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n eventBus.emit('resizeEvent', {\n eventType: event.type,\n i: props.i,\n x: getVal(innerX.value),\n y: getVal(innerY.value),\n h: pos.h,\n w: pos.w,\n });\n};\n\nconst tryMakeDraggable = () => {\n if (interactObj.value === null || interactObj.value === undefined) {\n interactObj.value = interact(item.value as any);\n }\n if (draggable.value && !props.static) {\n const opts = {\n ignoreFrom: props.dragIgnoreFrom,\n allowFrom: props.dragAllowFrom,\n };\n interactObj.value.draggable(opts);\n if (!dragEventSet.value) {\n dragEventSet.value = true;\n interactObj.value.on('dragstart dragmove dragend', (event: any) => {\n handleDrag(event);\n });\n }\n } else {\n interactObj.value.draggable({\n enabled: false,\n });\n }\n};\n\nconst tryMakeResizable = () => {\n if (interactObj.value === null || interactObj.value === undefined) {\n interactObj.value = interact(item.value as any);\n }\n if (resizable.value && !props.static) {\n let maximumPx: any;\n let minimumPx: any;\n\n if (usePercentagesInternal.value) {\n maximumPx = {\n width: (props.maxW / 100) * containerWidth.value,\n height: (props.maxH / 100) * containerHeight.value,\n };\n minimumPx = {\n width: (props.minW / 100) * containerWidth.value,\n height: (props.minH / 100) * containerHeight.value,\n };\n } else {\n const maximum = calcPosition(0, 0, props.maxW, props.maxH);\n const minimum = calcPosition(0, 0, props.minW, props.minH);\n maximumPx = {\n width: parseFloat(maximum.width),\n height: parseFloat(maximum.height),\n };\n minimumPx = {\n width: parseFloat(minimum.width),\n height: parseFloat(minimum.height),\n };\n }\n\n const opts = {\n preserveAspectRatio: true,\n edges: {\n left: false,\n right: '.' + resizableHandleClass.value,\n bottom: '.' + resizableHandleClass.value,\n top: false,\n },\n ignoreFrom: props.resizeIgnoreFrom,\n restrictSize: {\n min: minimumPx,\n max: maximumPx,\n },\n };\n interactObj.value.resizable(opts);\n if (!resizeEventSet.value) {\n resizeEventSet.value = true;\n interactObj.value.on('resizestart resizemove resizeend', (event: any) => {\n handleResize(event);\n });\n }\n } else {\n interactObj.value.resizable({\n enabled: false,\n });\n }\n};\n\nconst updateWidth = (width: number, colNum?: number) => {\n containerWidth.value = width || 100;\n if (colNum !== undefined && colNum !== null) {\n cols.value = colNum;\n }\n if (item.value && item.value.parentElement) {\n containerHeight.value = item.value.parentElement.offsetHeight || 100;\n }\n};\n\nconst compact = () => {\n createStyle();\n};\n\nconst autoSize = () => {\n previousW.value = innerW.value;\n previousH.value = innerH.value;\n if (item.value && item.value.firstElementChild) {\n const newSize = item.value.firstElementChild.getBoundingClientRect();\n const pos = calcWH(newSize.height, newSize.width, true);\n if (!usePercentagesInternal.value) {\n if (pos.w < props.minW) pos.w = props.minW;\n if (pos.w > props.maxW) pos.w = props.maxW;\n if (pos.h < props.minH) pos.h = props.minH;\n if (pos.h > props.maxH) pos.h = props.maxH;\n if (pos.h < 1) pos.h = 1;\n if (pos.w < 1) pos.w = 1;\n }\n if (getVal(innerW.value) !== pos.w || getVal(innerH.value) !== pos.h) {\n emit('resize', props.i, pos.h, pos.w, newSize.height, newSize.width);\n }\n if (getVal(previousW.value!) !== pos.w || getVal(previousH.value!) !== pos.h) {\n emit('resized', props.i, pos.h, pos.w, newSize.height, newSize.width);\n eventBus.emit('resizeEvent', {\n eventType: 'resizeend',\n i: props.i,\n x: getVal(innerX.value),\n y: getVal(innerY.value),\n h: pos.h,\n w: pos.w,\n });\n }\n }\n};\n\nconst updateWidthHandler = (width: number) => {\n updateWidth(width);\n};\nconst compactHandler = () => {\n compact();\n};\nconst setDraggableHandler = (isDraggable: boolean) => {\n if (props.isDraggable === null) {\n draggable.value = isDraggable;\n }\n};\nconst setResizableHandler = (isResizable: boolean) => {\n if (props.isResizable === null) {\n resizable.value = isResizable;\n }\n};\nconst setRowHeightHandler = (val: number) => {\n rowHeight.value = val;\n};\nconst setMaxRowsHandler = (val: number) => {\n maxRows.value = val;\n};\nconst directionchangeHandler = () => {\n rtl.value = getDocumentDir() === 'rtl';\n compact();\n};\nconst setColNum = (colNum: any) => {\n cols.value = parseInt(colNum, 10);\n};\n\nonMounted(() => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n\n cols.value = parent.colNum;\n rowHeight.value = parent.rowHeight;\n containerWidth.value = parent.width !== null && parent.width !== 0 ? parent.width : 100;\n margin.value = parent.margin !== undefined ? parent.margin : [10, 10];\n maxRows.value = parent.maxRows;\n\n if (item.value && item.value.parentElement) {\n containerHeight.value = item.value.parentElement.offsetHeight || 100;\n if (containerWidth.value === 100) {\n containerWidth.value = item.value.parentElement.offsetWidth || 100;\n }\n }\n\n if (props.isDraggable === null) {\n draggable.value = parent.isDraggable;\n } else {\n draggable.value = props.isDraggable;\n }\n if (props.isResizable === null) {\n resizable.value = parent.isResizable;\n } else {\n resizable.value = props.isResizable;\n }\n useCssTransforms.value = parent.useCssTransforms;\n\n eventBus.on('updateWidth', updateWidthHandler);\n eventBus.on('compact', compactHandler);\n eventBus.on('setDraggable', setDraggableHandler);\n eventBus.on('setResizable', setResizableHandler);\n eventBus.on('setRowHeight', setRowHeightHandler);\n eventBus.on('setMaxRows', setMaxRowsHandler);\n eventBus.on('directionchange', directionchangeHandler);\n eventBus.on('setColNum', setColNum);\n rtl.value = getDocumentDir() === 'rtl';\n\n createStyle();\n});\n\nonBeforeUnmount(() => {\n eventBus.off('updateWidth', updateWidthHandler);\n eventBus.off('compact', compactHandler);\n eventBus.off('setDraggable', setDraggableHandler);\n eventBus.off('setResizable', setResizableHandler);\n eventBus.off('setRowHeight', setRowHeightHandler);\n eventBus.off('setMaxRows', setMaxRowsHandler);\n eventBus.off('directionchange', directionchangeHandler);\n eventBus.off('setColNum', setColNum);\n if (interactObj.value) {\n interactObj.value.unset();\n }\n});\n\nwatch(\n () => props.isDraggable,\n () => {\n draggable.value = props.isDraggable;\n },\n);\n\nwatch(\n () => props.static,\n () => {\n tryMakeDraggable();\n tryMakeResizable();\n },\n);\n\nwatch(draggable, () => {\n tryMakeDraggable();\n});\n\nwatch(\n () => props.isResizable,\n () => {\n resizable.value = props.isResizable;\n },\n);\n\nwatch(resizable, () => {\n tryMakeResizable();\n});\n\nwatch(rowHeight, () => {\n createStyle();\n emitContainerResized();\n});\n\nwatch(cols, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(containerWidth, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(containerHeight, () => {\n tryMakeResizable();\n createStyle();\n emitContainerResized();\n});\n\nwatch(\n () => props.x,\n newVal => {\n innerX.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.y,\n newVal => {\n innerY.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.h,\n newVal => {\n innerH.value = newVal;\n createStyle();\n },\n);\n\nwatch(\n () => props.w,\n newVal => {\n innerW.value = newVal;\n createStyle();\n },\n);\n\nwatch(renderRtl, () => {\n tryMakeResizable();\n createStyle();\n});\n\nwatch(\n () => props.minH,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.maxH,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.minW,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => props.maxW,\n () => {\n tryMakeResizable();\n },\n);\n\nwatch(\n () => {\n const instance = getCurrentInstance();\n const parent = instance?.parent?.proxy as any;\n return parent?.margin;\n },\n val => {\n if (!val || (val[0] === margin.value[0] && val[1] === margin.value[1])) {\n return;\n }\n margin.value = val.map((m: any) => Number(m));\n createStyle();\n emitContainerResized();\n },\n);\n\ndefineExpose({\n autoSize,\n compact,\n updateWidth,\n});\n</script>\n\n<style>\n.vue-grid-item {\n transition: none;\n transition-property: left, top, right;\n /* add right for rtl */\n}\n.vue-grid-item.no-touch {\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.vue-grid-item.cssTransforms {\n right: auto;\n left: 0;\n transition-property: transform;\n}\n\n.vue-grid-item.cssTransforms.render-rtl {\n right: 0;\n left: auto;\n}\n\n.vue-grid-item.resizing {\n z-index: 3;\n opacity: 0.6;\n}\n\n.vue-grid-item.vue-draggable-dragging {\n z-index: 3;\n transition: none;\n}\n\n.vue-grid-item.vue-grid-placeholder {\n z-index: 2;\n background: pink;\n transition-duration: 100ms;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n}\n\n.vue-grid-item > .vue-resizable-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 20px;\n height: 20px;\n padding: 0 3px 3px 0;\n background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: bottom right;\n background-origin: content-box;\n cursor: se-resize;\n}\n\n.vue-grid-item > .vue-rtl-resizable-handle {\n right: auto;\n bottom: 0;\n left: 0;\n padding-left: 3px;\n background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAuMDAwMDAwMDAwMDAwMDAyIiBoZWlnaHQ9IjEwLjAwMDAwMDAwMDAwMDAwMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAv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geDE9IjAuOTQ3MjQ3IiBzdHJva2Utd2lkdGg9IjIiIGZpbGw9Im5vbmUiLz4KICA8bGluZSBzdHJva2UtbGluZWNhcD0idW5kZWZpbmVkIiBzdHJva2UtbGluZWpvaW49InVuZGVmaW5lZCIgaWQ9InN2Z183IiB5Mj0iOSIgeDI9IjEwLjA3MzUyOSIgeTE9IjkiIHgxPSItMC42NTU2NCIgc3Ryb2tlLXdpZHRoPSIwIiBzdHJva2U9IiM2NjY2NjYiIGZpbGw9Im5vbmUiLz4KIDwvZz4KPC9zdmc+);\n background-repeat: no-repeat;\n background-position: bottom left;\n background-origin: content-box;\n cursor: sw-resize;\n}\n\n.vue-grid-item.disable-userselect {\n user-select: none;\n}\n</style>\n","<template>\n <div\n ref=\"item\"\n class=\"vue-grid-layout\"\n :style=\"mergedStyle\"\n >\n <slot></slot>\n <grid-item\n ref=\"gridItem\"\n class=\"vue-grid-placeholder\"\n v-show=\"isDragging\"\n :x=\"placeholder.x\"\n :y=\"placeholder.y\"\n :w=\"placeholder.w\"\n :h=\"placeholder.h\"\n :i=\"placeholder.i\"\n ></grid-item>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport elementResizeDetectorMaker from 'element-resize-detector';\nimport mitt from 'mitt';\nimport {\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue';\nimport { addWindowEventListener, removeWindowEventListener } from '../helpers/dom';\nimport {\n findOrGenerateResponsiveLayout,\n getBreakpointFromWidth,\n getColsFromBreakpoint,\n} from '../helpers/responsive-utils';\nimport type { Layout } from '../helpers/utils';\nimport {\n bottom,\n cloneLayout,\n compact,\n getAllCollisions,\n getLayoutItem,\n moveElement,\n validateLayout,\n} from '../helpers/utils';\nimport GridItem from './grid-item.vue';\n\ndefineOptions({\n name: 'GridLayout',\n});\n\nconst props = withDefaults(\n defineProps<{\n // If true, the container height swells and contracts to fit contents\n autoSize?: boolean;\n colNum?: number;\n rowHeight?: number;\n maxRows?: number;\n margin?: number[];\n isDraggable?: boolean;\n isResizable?: boolean;\n isMirrored?: boolean;\n useCssTransforms?: boolean;\n verticalCompact?: boolean;\n layout: Layout;\n responsive?: boolean;\n responsiveLayouts?: Record<string, any>;\n breakpoints?: Record<string, number>;\n cols?: Record<string, number>;\n preventCollision?: boolean;\n usePercentages?: boolean;\n }>(),\n {\n autoSize: true,\n colNum: 12,\n rowHeight: 10,\n maxRows: Infinity,\n margin: () => [10, 10],\n isDraggable: false,\n isResizable: false,\n isMirrored: false,\n useCssTransforms: true,\n verticalCompact: true,\n responsive: false,\n responsiveLayouts: () => ({}),\n breakpoints: () => ({ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }),\n cols: () => ({ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }),\n preventCollision: false,\n usePercentages: false,\n },\n);\n\nconst emit = defineEmits<{\n (e: 'layout-created', layout: Layout): void;\n (e: 'layout-mounted', layout: Layout): void;\n (e: 'layout-before-mount', layout: Layout): void;\n (e: 'layout-updated', layout: Layout): void;\n (e: 'layout-ready', layout: Layout): void;\n (e: 'update:layout', layout: Layout): void;\n (e: 'breakpoint-changed', breakpoint: string | null, layout: Layout): void;\n}>();\n\nconst eventBus = mitt();\nprovide('eventBus', eventBus);\nprovide('usePercentages', props.usePercentages);\nprovide('layout', props.layout);\n\nconst item = ref<HTMLElement | null>(null);\nconst gridItem = ref(null);\nconst width = ref<number | null>(null);\nconst mergedStyle = ref<Record<string, any>>({});\nconst lastLayoutLength = ref(0);\nconst isDragging = ref(false);\nconst placeholder = reactive({\n x: 0 as string | number,\n y: 0 as string | number,\n w: 0 as string | number,\n h: 0 as string | number,\n i: -1 as string | number,\n});\nconst layouts = ref<Record<string, Layout>>({}); // array to store all layouts from different breakpoints\nconst lastBreakpoint = ref<string | null>(null); // store last active breakpoint\nconst originalLayout = ref<Layout | null>(null); // store original Layout\nconst erd = ref<any>(null);\n\nconst getLayoutEl = () => {\n return item.value;\n};\n\nconst updateHeight = () => {\n mergedStyle.value = {\n height: containerHeight(),\n };\n if (props.usePercentages) {\n mergedStyle.value.width = '100%';\n }\n};\n\nconst onWindowResize = () => {\n if (item.value !== null && item.value !== undefined) {\n width.value = item.value.offsetWidth;\n }\n eventBus.emit('resizeEvent', {});\n};\n\nconst containerHeight = () => {\n if (props.usePercentages) return '100%';\n if (!props.autoSize) return;\n return bottom(props.layout) * (props.rowHeight + props.margin[1]) + props.margin[1] + 'px';\n};\n\nconst dragEvent = (\n eventName: string,\n id: string | number,\n x: number,\n y: number,\n h: number,\n w: number,\n) => {\n let l = getLayoutItem(props.layout, String(id));\n if (l === undefined || l === null) {\n l = { x: 0, y: 0, w: 0, h: 0, i: String(id) };\n }\n if (eventName === 'dragmove' || eventName === 'dragstart') {\n placeholder.i = id;\n placeholder.x = l.x;\n placeholder.y = l.y;\n placeholder.w = w;\n placeholder.h = h;\n nextTick(() => {\n isDragging.value = true;\n });\n eventBus.emit('updateWidth', width.value);\n } else {\n nextTick(() => {\n isDragging.value = false;\n });\n }\n // Move the element to the dragged location.\n moveElement(props.layout, l, x, y, true, props.preventCollision);\n compact(props.layout, props.verticalCompact);\n // needed because vue can't detect changes on array element properties\n eventBus.emit('compact');\n updateHeight();\n if (eventName === 'dragend') emit('layout-updated', props.layout);\n};\n\nconst responsiveGridLayout = () => {\n if (!width.value) return;\n const newBreakpoint = getBreakpointFromWidth(props.breakpoints, width.value);\n const newCols = getColsFromBreakpoint(newBreakpoint, props.cols);\n // save actual layout in layouts\n if (lastBreakpoint.value != null && !layouts.value[lastBreakpoint.value])\n layouts.value[lastBreakpoint.value] = cloneLayout(props.layout);\n // Find or generate a new layout.\n const layout = findOrGenerateResponsiveLayout(\n originalLayout.value!,\n layouts.value,\n props.breakpoints as any,\n newBreakpoint,\n lastBreakpoint.value as any,\n newCols,\n props.verticalCompact,\n );\n // Store the new layout.\n layouts.value[newBreakpoint] = layout;\n if (lastBreakpoint.value !== newBreakpoint) {\n emit('breakpoint-changed', newBreakpoint, layout);\n }\n // new prop sync\n emit('update:layout', layout);\n lastBreakpoint.value = newBreakpoint;\n eventBus.emit('setColNum', getColsFromBreakpoint(newBreakpoint, props.cols));\n};\n\nconst resizeEvent = (\n eventName: string,\n id: string | number,\n x: number,\n y: number,\n h: number,\n w: number,\n) => {\n let l = getLayoutItem(props.layout, String(id));\n if (l === undefined || l === null) {\n l = { h: 0, w: 0, x: 0, y: 0, i: String(id) };\n }\n let hasCollisions = false;\n if (props.preventCollision) {\n const collisions = getAllCollisions(props.layout, { ...l, w, h }).filter(\n layoutItem => layoutItem.i !== l!.i,\n );\n hasCollisions = collisions.length > 0;\n // If we're colliding, we need adjust the placeholder.\n if (hasCollisions) {\n // adjust w && h to maximum allowed space\n let leastX = Infinity;\n let leastY = Infinity;\n collisions.forEach(layoutItem => {\n if (layoutItem.x > l!.x) leastX = Math.min(leastX, layoutItem.x);\n if (layoutItem.y > l!.y) leastY = Math.min(leastY, layoutItem.y);\n });\n if (Number.isFinite(leastX)) l.w = leastX - l.x;\n if (Number.isFinite(leastY)) l.h = leastY - l.y;\n }\n }\n if (!hasCollisions) {\n // Set new width and height.\n l.w = w;\n l.h = h;\n }\n if (eventName === 'resizestart' || eventName === 'resizemove') {\n placeholder.i = id;\n placeholder.x = x;\n placeholder.y = y;\n placeholder.w = l.w;\n placeholder.h = l.h;\n nextTick(() => {\n isDragging.value = true;\n });\n eventBus.emit('updateWidth', width.value);\n } else {\n nextTick(() => {\n isDragging.value = false;\n });\n }\n if (props.responsive) responsiveGridLayout();\n compact(props.layout, props.verticalCompact);\n eventBus.emit('compact');\n updateHeight();\n if (eventName === 'resizeend') emit('layout-updated', props.layout);\n};\n\nconst initResponsiveFeatures = () => {\n layouts.value = Object.assign({}, props.responsiveLayouts);\n};\n\nconst findDifference = (layout: Layout, originalLayout: Layout) => {\n const uniqueResultOne = layout.filter(obj => {\n return !originalLayout.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n const uniqueResultTwo = originalLayout.filter(obj => {\n return !layout.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n return uniqueResultOne.concat(uniqueResultTwo);\n};\n\nconst layoutUpdate = () => {\n if (props.layout !== undefined && originalLayout.value !== null) {\n if (props.layout.length !== originalLayout.value.length) {\n const diff = findDifference(props.layout, originalLayout.value);\n if (diff.length > 0) {\n if (props.layout.length > originalLayout.value.length) {\n originalLayout.value = originalLayout.value.concat(diff);\n } else {\n originalLayout.value = originalLayout.value.filter(obj => {\n return !diff.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n }\n }\n lastLayoutLength.value = props.layout.length;\n initResponsiveFeatures();\n }\n if (props.usePercentages) {\n // Skip correctBounds on layout update to keep original values\n }\n compact(props.layout, props.verticalCompact);\n eventBus.emit('updateWidth', width.value);\n updateHeight();\n emit('layout-updated', props.layout);\n }\n};\n\nconst resizeEventHandler = ({ eventType, i, x, y, h, w }: any) => {\n resizeEvent(eventType, i, x, y, h, w);\n};\nconst dragEventHandler = ({ eventType, i, x, y, h, w }: any) => {\n dragEvent(eventType, i, x, y, h, w);\n};\n\nonBeforeMount(() => {\n emit('layout-before-mount', props.layout);\n});\n\nonMounted(() => {\n eventBus.on('resizeEvent', resizeEventHandler);\n eventBus.on('dragEvent', dragEventHandler);\n emit('layout-created', props.layout);\n\n emit('layout-mounted', props.layout);\n nextTick(() => {\n validateLayout(props.layout);\n originalLayout.value = props.layout;\n if (props.usePercentages) {\n // Skip correctBounds on initialization to keep original values\n }\n nextTick(() => {\n onWindowResize();\n initResponsiveFeatures();\n addWindowEventListener('resize', onWindowResize);\n compact(props.layout, props.verticalCompact);\n emit('layout-updated', props.layout);\n updateHeight();\n nextTick(() => {\n erd.value = elementResizeDetectorMaker({\n strategy: 'scroll',\n callOnAdd: false,\n });\n erd.value.listenTo(item.value, () => {\n onWindowResize();\n });\n });\n });\n });\n});\n\nonBeforeUnmount(() => {\n eventBus.off('resizeEvent', resizeEventHandler);\n eventBus.off('dragEvent', dragEventHandler);\n removeWindowEventListener('resize', onWindowResize);\n if (erd.value && item.value) {\n erd.value.uninstall(item.value);\n }\n});\n\nwatch(width, (_newval, oldval) => {\n nextTick(() => {\n eventBus.emit('updateWidth', width.value);\n if (oldval === null) {\n nextTick(() => {\n emit('layout-ready', props.layout);\n });\n }\n updateHeight();\n });\n});\n\nwatch(\n () => props.layout.length,\n () => {\n layoutUpdate();\n },\n);\n\nwatch(\n () => props.layout,\n () => {\n layoutUpdate();\n },\n);\n\nwatch(\n () => props.colNum,\n val => {\n eventBus.emit('setColNum', val);\n },\n);\n\nwatch(\n () => props.rowHeight,\n () => {\n eventBus.emit('setRowHeight', props.rowHeight);\n },\n);\n\nwatch(\n () => props.isDraggable,\n () => {\n eventBus.emit('setDraggable', props.isDraggable);\n },\n);\n\nwatch(\n () => props.isResizable,\n () => {\n eventBus.emit('setResizable', props.isResizable);\n },\n);\n\nwatch(\n () => props.responsive,\n () => {\n if (!props.responsive) {\n emit('update:layout', originalLayout.value!);\n eventBus.emit('setColNum', props.colNum);\n }\n onWindowResize();\n },\n);\n\nwatch(\n () => props.maxRows,\n () => {\n eventBus.emit('setMaxRows', props.maxRows);\n },\n);\n\nwatch(\n () => props.margin,\n () => {\n updateHeight();\n },\n);\n\ndefineExpose({\n getLayoutEl,\n});\n</script>\n<style>\n.vue-grid-layout {\n position: relative;\n}\n</style>\n","<template>\n <div\n ref=\"item\"\n class=\"vue-grid-layout\"\n :style=\"mergedStyle\"\n >\n <slot></slot>\n <grid-item\n ref=\"gridItem\"\n class=\"vue-grid-placeholder\"\n v-show=\"isDragging\"\n :x=\"placeholder.x\"\n :y=\"placeholder.y\"\n :w=\"placeholder.w\"\n :h=\"placeholder.h\"\n :i=\"placeholder.i\"\n ></grid-item>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport elementResizeDetectorMaker from 'element-resize-detector';\nimport mitt from 'mitt';\nimport {\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue';\nimport { addWindowEventListener, removeWindowEventListener } from '../helpers/dom';\nimport {\n findOrGenerateResponsiveLayout,\n getBreakpointFromWidth,\n getColsFromBreakpoint,\n} from '../helpers/responsive-utils';\nimport type { Layout } from '../helpers/utils';\nimport {\n bottom,\n cloneLayout,\n compact,\n getAllCollisions,\n getLayoutItem,\n moveElement,\n validateLayout,\n} from '../helpers/utils';\nimport GridItem from './grid-item.vue';\n\ndefineOptions({\n name: 'GridLayout',\n});\n\nconst props = withDefaults(\n defineProps<{\n // If true, the container height swells and contracts to fit contents\n autoSize?: boolean;\n colNum?: number;\n rowHeight?: number;\n maxRows?: number;\n margin?: number[];\n isDraggable?: boolean;\n isResizable?: boolean;\n isMirrored?: boolean;\n useCssTransforms?: boolean;\n verticalCompact?: boolean;\n layout: Layout;\n responsive?: boolean;\n responsiveLayouts?: Record<string, any>;\n breakpoints?: Record<string, number>;\n cols?: Record<string, number>;\n preventCollision?: boolean;\n usePercentages?: boolean;\n }>(),\n {\n autoSize: true,\n colNum: 12,\n rowHeight: 10,\n maxRows: Infinity,\n margin: () => [10, 10],\n isDraggable: false,\n isResizable: false,\n isMirrored: false,\n useCssTransforms: true,\n verticalCompact: true,\n responsive: false,\n responsiveLayouts: () => ({}),\n breakpoints: () => ({ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }),\n cols: () => ({ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }),\n preventCollision: false,\n usePercentages: false,\n },\n);\n\nconst emit = defineEmits<{\n (e: 'layout-created', layout: Layout): void;\n (e: 'layout-mounted', layout: Layout): void;\n (e: 'layout-before-mount', layout: Layout): void;\n (e: 'layout-updated', layout: Layout): void;\n (e: 'layout-ready', layout: Layout): void;\n (e: 'update:layout', layout: Layout): void;\n (e: 'breakpoint-changed', breakpoint: string | null, layout: Layout): void;\n}>();\n\nconst eventBus = mitt();\nprovide('eventBus', eventBus);\nprovide('usePercentages', props.usePercentages);\nprovide('layout', props.layout);\n\nconst item = ref<HTMLElement | null>(null);\nconst gridItem = ref(null);\nconst width = ref<number | null>(null);\nconst mergedStyle = ref<Record<string, any>>({});\nconst lastLayoutLength = ref(0);\nconst isDragging = ref(false);\nconst placeholder = reactive({\n x: 0 as string | number,\n y: 0 as string | number,\n w: 0 as string | number,\n h: 0 as string | number,\n i: -1 as string | number,\n});\nconst layouts = ref<Record<string, Layout>>({}); // array to store all layouts from different breakpoints\nconst lastBreakpoint = ref<string | null>(null); // store last active breakpoint\nconst originalLayout = ref<Layout | null>(null); // store original Layout\nconst erd = ref<any>(null);\n\nconst getLayoutEl = () => {\n return item.value;\n};\n\nconst updateHeight = () => {\n mergedStyle.value = {\n height: containerHeight(),\n };\n if (props.usePercentages) {\n mergedStyle.value.width = '100%';\n }\n};\n\nconst onWindowResize = () => {\n if (item.value !== null && item.value !== undefined) {\n width.value = item.value.offsetWidth;\n }\n eventBus.emit('resizeEvent', {});\n};\n\nconst containerHeight = () => {\n if (props.usePercentages) return '100%';\n if (!props.autoSize) return;\n return bottom(props.layout) * (props.rowHeight + props.margin[1]) + props.margin[1] + 'px';\n};\n\nconst dragEvent = (\n eventName: string,\n id: string | number,\n x: number,\n y: number,\n h: number,\n w: number,\n) => {\n let l = getLayoutItem(props.layout, String(id));\n if (l === undefined || l === null) {\n l = { x: 0, y: 0, w: 0, h: 0, i: String(id) };\n }\n if (eventName === 'dragmove' || eventName === 'dragstart') {\n placeholder.i = id;\n placeholder.x = l.x;\n placeholder.y = l.y;\n placeholder.w = w;\n placeholder.h = h;\n nextTick(() => {\n isDragging.value = true;\n });\n eventBus.emit('updateWidth', width.value);\n } else {\n nextTick(() => {\n isDragging.value = false;\n });\n }\n // Move the element to the dragged location.\n moveElement(props.layout, l, x, y, true, props.preventCollision);\n compact(props.layout, props.verticalCompact);\n // needed because vue can't detect changes on array element properties\n eventBus.emit('compact');\n updateHeight();\n if (eventName === 'dragend') emit('layout-updated', props.layout);\n};\n\nconst responsiveGridLayout = () => {\n if (!width.value) return;\n const newBreakpoint = getBreakpointFromWidth(props.breakpoints, width.value);\n const newCols = getColsFromBreakpoint(newBreakpoint, props.cols);\n // save actual layout in layouts\n if (lastBreakpoint.value != null && !layouts.value[lastBreakpoint.value])\n layouts.value[lastBreakpoint.value] = cloneLayout(props.layout);\n // Find or generate a new layout.\n const layout = findOrGenerateResponsiveLayout(\n originalLayout.value!,\n layouts.value,\n props.breakpoints as any,\n newBreakpoint,\n lastBreakpoint.value as any,\n newCols,\n props.verticalCompact,\n );\n // Store the new layout.\n layouts.value[newBreakpoint] = layout;\n if (lastBreakpoint.value !== newBreakpoint) {\n emit('breakpoint-changed', newBreakpoint, layout);\n }\n // new prop sync\n emit('update:layout', layout);\n lastBreakpoint.value = newBreakpoint;\n eventBus.emit('setColNum', getColsFromBreakpoint(newBreakpoint, props.cols));\n};\n\nconst resizeEvent = (\n eventName: string,\n id: string | number,\n x: number,\n y: number,\n h: number,\n w: number,\n) => {\n let l = getLayoutItem(props.layout, String(id));\n if (l === undefined || l === null) {\n l = { h: 0, w: 0, x: 0, y: 0, i: String(id) };\n }\n let hasCollisions = false;\n if (props.preventCollision) {\n const collisions = getAllCollisions(props.layout, { ...l, w, h }).filter(\n layoutItem => layoutItem.i !== l!.i,\n );\n hasCollisions = collisions.length > 0;\n // If we're colliding, we need adjust the placeholder.\n if (hasCollisions) {\n // adjust w && h to maximum allowed space\n let leastX = Infinity;\n let leastY = Infinity;\n collisions.forEach(layoutItem => {\n if (layoutItem.x > l!.x) leastX = Math.min(leastX, layoutItem.x);\n if (layoutItem.y > l!.y) leastY = Math.min(leastY, layoutItem.y);\n });\n if (Number.isFinite(leastX)) l.w = leastX - l.x;\n if (Number.isFinite(leastY)) l.h = leastY - l.y;\n }\n }\n if (!hasCollisions) {\n // Set new width and height.\n l.w = w;\n l.h = h;\n }\n if (eventName === 'resizestart' || eventName === 'resizemove') {\n placeholder.i = id;\n placeholder.x = x;\n placeholder.y = y;\n placeholder.w = l.w;\n placeholder.h = l.h;\n nextTick(() => {\n isDragging.value = true;\n });\n eventBus.emit('updateWidth', width.value);\n } else {\n nextTick(() => {\n isDragging.value = false;\n });\n }\n if (props.responsive) responsiveGridLayout();\n compact(props.layout, props.verticalCompact);\n eventBus.emit('compact');\n updateHeight();\n if (eventName === 'resizeend') emit('layout-updated', props.layout);\n};\n\nconst initResponsiveFeatures = () => {\n layouts.value = Object.assign({}, props.responsiveLayouts);\n};\n\nconst findDifference = (layout: Layout, originalLayout: Layout) => {\n const uniqueResultOne = layout.filter(obj => {\n return !originalLayout.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n const uniqueResultTwo = originalLayout.filter(obj => {\n return !layout.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n return uniqueResultOne.concat(uniqueResultTwo);\n};\n\nconst layoutUpdate = () => {\n if (props.layout !== undefined && originalLayout.value !== null) {\n if (props.layout.length !== originalLayout.value.length) {\n const diff = findDifference(props.layout, originalLayout.value);\n if (diff.length > 0) {\n if (props.layout.length > originalLayout.value.length) {\n originalLayout.value = originalLayout.value.concat(diff);\n } else {\n originalLayout.value = originalLayout.value.filter(obj => {\n return !diff.some(obj2 => {\n return obj.i === obj2.i;\n });\n });\n }\n }\n lastLayoutLength.value = props.layout.length;\n initResponsiveFeatures();\n }\n if (props.usePercentages) {\n // Skip correctBounds on layout update to keep original values\n }\n compact(props.layout, props.verticalCompact);\n eventBus.emit('updateWidth', width.value);\n updateHeight();\n emit('layout-updated', props.layout);\n }\n};\n\nconst resizeEventHandler = ({ eventType, i, x, y, h, w }: any) => {\n resizeEvent(eventType, i, x, y, h, w);\n};\nconst dragEventHandler = ({ eventType, i, x, y, h, w }: any) => {\n dragEvent(eventType, i, x, y, h, w);\n};\n\nonBeforeMount(() => {\n emit('layout-before-mount', props.layout);\n});\n\nonMounted(() => {\n eventBus.on('resizeEvent', resizeEventHandler);\n eventBus.on('dragEvent', dragEventHandler);\n emit('layout-created', props.layout);\n\n emit('layout-mounted', props.layout);\n nextTick(() => {\n validateLayout(props.layout);\n originalLayout.value = props.layout;\n if (props.usePercentages) {\n // Skip correctBounds on initialization to keep original values\n }\n nextTick(() => {\n onWindowResize();\n initResponsiveFeatures();\n addWindowEventListener('resize', onWindowResize);\n compact(props.layout, props.verticalCompact);\n emit('layout-updated', props.layout);\n updateHeight();\n nextTick(() => {\n erd.value = elementResizeDetectorMaker({\n strategy: 'scroll',\n callOnAdd: false,\n });\n erd.value.listenTo(item.value, () => {\n onWindowResize();\n });\n });\n });\n });\n});\n\nonBeforeUnmount(() => {\n eventBus.off('resizeEvent', resizeEventHandler);\n eventBus.off('dragEvent', dragEventHandler);\n removeWindowEventListener('resize', onWindowResize);\n if (erd.value && item.value) {\n erd.value.uninstall(item.value);\n }\n});\n\nwatch(width, (_newval, oldval) => {\n nextTick(() => {\n eventBus.emit('updateWidth', width.value);\n if (oldval === null) {\n nextTick(() => {\n emit('layout-ready', props.layout);\n });\n }\n updateHeight();\n });\n});\n\nwatch(\n () => props.layout.length,\n () => {\n layoutUpdate();\n },\n);\n\nwatch(\n () => props.layout,\n () => {\n layoutUpdate();\n },\n);\n\nwatch(\n () => props.colNum,\n val => {\n eventBus.emit('setColNum', val);\n },\n);\n\nwatch(\n () => props.rowHeight,\n () => {\n eventBus.emit('setRowHeight', props.rowHeight);\n },\n);\n\nwatch(\n () => props.isDraggable,\n () => {\n eventBus.emit('setDraggable', props.isDraggable);\n },\n);\n\nwatch(\n () => props.isResizable,\n () => {\n eventBus.emit('setResizable', props.isResizable);\n },\n);\n\nwatch(\n () => props.responsive,\n () => {\n if (!props.responsive) {\n emit('update:layout', originalLayout.value!);\n eventBus.emit('setColNum', props.colNum);\n }\n onWindowResize();\n },\n);\n\nwatch(\n () => props.maxRows,\n () => {\n eventBus.emit('setMaxRows', props.maxRows);\n },\n);\n\nwatch(\n () => props.margin,\n () => {\n updateHeight();\n },\n);\n\ndefineExpose({\n getLayoutEl,\n});\n</script>\n<style>\n.vue-grid-layout {\n position: relative;\n}\n</style>\n","<template>\n <grid-layout\n v-model:layout=\"layout\"\n :is-draggable=\"config.isDraggable\"\n :is-resizable=\"config.isResizable\"\n :is-mirrored=\"false\"\n :vertical-compact=\"false\"\n use-css-transforms\n :use-percentages=\"true\"\n >\n <grid-item\n v-for=\"item in layout\"\n :x=\"item.x\"\n :y=\"item.y\"\n :w=\"item.w\"\n :h=\"item.h\"\n :i=\"item.i\"\n :key=\"item.i\"\n :dragAllowFrom=\"'span'\"\n :class=\"{ item: true, border: hasBorder }\"\n :style=\"{ padding: config.itemPadding || '0' }\"\n >\n <div class=\"item-content\">\n <template v-if=\"item.config.component\">\n <component\n :is=\"item.config.component\"\n :itemKey=\"item.config.key\"\n v-bind=\"item.config.props || {}\"\n />\n </template>\n <template v-else>\n <span class=\"text\">Layout: {{ item.i }}</span>\n </template>\n </div>\n </grid-item>\n </grid-layout>\n</template>\n<script setup lang=\"ts\">\nimport { GridConfig } from 'liyu-pc-base/typing';\nimport { computed, onMounted } from 'vue';\nimport { GridItem, GridLayout } from '../grid-layout';\n\nconst props = withDefaults(\n defineProps<{\n config: GridConfig;\n }>(),\n {},\n);\n\nconst layout = computed(() => {\n const keyMap = {};\n return props.config.items.map((item, index) => {\n let i = item.key;\n if (!i) {\n i = `index_${index}`;\n }\n if (keyMap[i]) {\n throw new Error('key: ${i}重复');\n }\n\n return {\n ...item.layout,\n i: i,\n config: item,\n };\n });\n});\nconst hasBorder = computed(() => {\n return !!props.config.isBorder;\n});\nonMounted(() => {});\n</script>\n\n<style scoped lang=\"less\">\n.item {\n position: relative;\n}\n.border {\n border: 1px solid #ccc;\n}\n.item-content {\n width: 100%;\n height: 100%;\n background: #fff;\n border-radius: 2px;\n overflow: hidden;\n}\n</style>\n","<template>\n <grid-layout\n v-model:layout=\"layout\"\n :is-draggable=\"config.isDraggable\"\n :is-resizable=\"config.isResizable\"\n :is-mirrored=\"false\"\n :vertical-compact=\"false\"\n use-css-transforms\n :use-percentages=\"true\"\n >\n <grid-item\n v-for=\"item in layout\"\n :x=\"item.x\"\n :y=\"item.y\"\n :w=\"item.w\"\n :h=\"item.h\"\n :i=\"item.i\"\n :key=\"item.i\"\n :dragAllowFrom=\"'span'\"\n :class=\"{ item: true, border: hasBorder }\"\n :style=\"{ padding: config.itemPadding || '0' }\"\n >\n <div class=\"item-content\">\n <template v-if=\"item.config.component\">\n <component\n :is=\"item.config.component\"\n :itemKey=\"item.config.key\"\n v-bind=\"item.config.props || {}\"\n />\n </template>\n <template v-else>\n <span class=\"text\">Layout: {{ item.i }}</span>\n </template>\n </div>\n </grid-item>\n </grid-layout>\n</template>\n<script setup lang=\"ts\">\nimport { GridConfig } from 'liyu-pc-base/typing';\nimport { computed, onMounted } from 'vue';\nimport { GridItem, GridLayout } from '../grid-layout';\n\nconst props = withDefaults(\n defineProps<{\n config: GridConfig;\n }>(),\n {},\n);\n\nconst layout = computed(() => {\n const keyMap = {};\n return props.config.items.map((item, index) => {\n let i = item.key;\n if (!i) {\n i = `index_${index}`;\n }\n if (keyMap[i]) {\n throw new Error('key: ${i}重复');\n }\n\n return {\n ...item.layout,\n i: i,\n config: item,\n };\n });\n});\nconst hasBorder = computed(() => {\n return !!props.config.isBorder;\n});\nonMounted(() => {});\n</script>\n\n<style scoped lang=\"less\">\n.item {\n position: relative;\n}\n.border {\n border: 1px solid #ccc;\n}\n.item-content {\n width: 100%;\n height: 100%;\n background: #fff;\n border-radius: 2px;\n overflow: hidden;\n}\n</style>\n","import { useGlobMap } from 'liyu-pc-base/init-plugin';\nimport type { GridConfig } from 'liyu-pc-base/typing';\nimport { markRaw } from 'vue';\nconst custom_config: { [key: string]: any } = {};\n\nconst get_custom_config = async (key: string) => {\n if (Object.keys(custom_config).length > 0) {\n if (custom_config[key]) {\n const obj = await custom_config[key]();\n return obj.default;\n } else {\n const obj = await custom_config['default']();\n return obj.default;\n }\n }\n const allComponents: any = import.meta.glob('liyu-pc-base/components/gridPage/config/*/*.ts', {\n eager: false,\n });\n const customComponents = useGlobMap('gridPage');\n Object.assign(allComponents, customComponents);\n for (const full_file_name in allComponents) {\n const file_name_list = full_file_name.split('/');\n const file_name = file_name_list[file_name_list.length - 1].replace('.ts', '');\n custom_config[file_name] = allComponents[full_file_name];\n }\n\n if (custom_config[key]) {\n const obj = await custom_config[key]();\n return obj.default;\n } else {\n const obj = await custom_config['default']();\n return obj.default;\n }\n};\nconst process_config = (config: any) => {\n if (config.items) {\n for (const item of config.items) {\n if (item.component) {\n item.component = markRaw(item.component);\n }\n }\n }\n};\nexport const getGridConfig = async (\n key: string,\n { context, eventBus },\n): Promise<{ config: GridConfig }> => {\n const configFunc = await get_custom_config(key);\n const local_config = configFunc({ menu_flag: key, context, eventBus });\n process_config(local_config);\n\n return { config: local_config };\n};\n","<template>\n <fullLayout>\n <div\n class=\"grid-page-wraper\"\n :style=\"{ minWidth: minWidth, minHeight: minHeight }\"\n >\n <div class=\"grid-page-content\">\n <gridView\n v-if=\"config\"\n :config=\"config\"\n ></gridView>\n </div>\n </div>\n </fullLayout>\n</template>\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, provide, ref } from 'vue';\nimport fullLayout from '../fullLayout/fullLayout.vue';\nimport gridView from './gridView.vue';\nimport mitt from 'mitt';\nimport type { GridConfig } from 'liyu-pc-base/typing';\nimport { getGridConfig } from './index';\nimport { gridPageStateSymbol, GridPageState } from './utils';\nimport { useRoute } from 'vue-router';\nconst route = useRoute();\nconst config = ref<GridConfig>(null);\nconst context = ref<any>({});\nconst eventBus = mitt();\nconst modelType = ref('');\nconst path_arr = route.path.split('/');\nmodelType.value = path_arr[path_arr.length - 1];\n\nprovide<GridPageState>(gridPageStateSymbol, {\n context: context,\n eventBus,\n});\nonMounted(async () => {\n config.value = (\n await getGridConfig(modelType.value, { context: context.value, eventBus })\n ).config;\n if (config.value.onMounted) {\n await config.value.onMounted(context.value, eventBus);\n }\n});\nonUnmounted(() => {\n if (config.value.onUnmounted) {\n config.value.onUnmounted(context.value, eventBus);\n }\n});\nconst minWidth = computed(() => {\n if (config.value?.minWidth != null) {\n return config.value.minWidth;\n } else {\n return undefined;\n }\n});\nconst minHeight = computed(() => {\n if (config.value?.minHeight != null) {\n return config.value.minHeight;\n } else {\n return undefined;\n }\n});\n</script>\n\n<style lang=\"less\">\n.grid-page-wraper {\n height: 100%;\n width: 100%;\n padding: 5px;\n}\n.grid-page-content {\n height: 100%;\n width: 100%;\n border-radius: 4px;\n}\n</style>\n","<template>\n <fullLayout>\n <div\n class=\"grid-page-wraper\"\n :style=\"{ minWidth: minWidth, minHeight: minHeight }\"\n >\n <div class=\"grid-page-content\">\n <gridView\n v-if=\"config\"\n :config=\"config\"\n ></gridView>\n </div>\n </div>\n </fullLayout>\n</template>\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, provide, ref } from 'vue';\nimport fullLayout from '../fullLayout/fullLayout.vue';\nimport gridView from './gridView.vue';\nimport mitt from 'mitt';\nimport type { GridConfig } from 'liyu-pc-base/typing';\nimport { getGridConfig } from './index';\nimport { gridPageStateSymbol, GridPageState } from './utils';\nimport { useRoute } from 'vue-router';\nconst route = useRoute();\nconst config = ref<GridConfig>(null);\nconst context = ref<any>({});\nconst eventBus = mitt();\nconst modelType = ref('');\nconst path_arr = route.path.split('/');\nmodelType.value = path_arr[path_arr.length - 1];\n\nprovide<GridPageState>(gridPageStateSymbol, {\n context: context,\n eventBus,\n});\nonMounted(async () => {\n config.value = (\n await getGridConfig(modelType.value, { context: context.value, eventBus })\n ).config;\n if (config.value.onMounted) {\n await config.value.onMounted(context.value, eventBus);\n }\n});\nonUnmounted(() => {\n if (config.value.onUnmounted) {\n config.value.onUnmounted(context.value, eventBus);\n }\n});\nconst minWidth = computed(() => {\n if (config.value?.minWidth != null) {\n return config.value.minWidth;\n } else {\n return undefined;\n }\n});\nconst minHeight = computed(() => {\n if (config.value?.minHeight != null) {\n return config.value.minHeight;\n } else {\n return undefined;\n }\n});\n</script>\n\n<style lang=\"less\">\n.grid-page-wraper {\n height: 100%;\n width: 100%;\n padding: 5px;\n}\n.grid-page-content {\n height: 100%;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