@dinert/element-plus 1.1.41 → 1.1.42
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.
- package/dist/element-plus.umd.js +2 -2
- package/dist/element-plus.umd.js.map +1 -1
- package/es/packages/components/form/src/index.mjs +126 -124
- package/es/packages/components/form/src/index.mjs.map +1 -1
- package/es/packages/components/form/utils/index.mjs +1 -1
- package/es/packages/components/form/utils/index.mjs.map +1 -1
- package/es/packages/components/table/src/recuve-table-column.mjs +113 -113
- package/es/packages/components/table/src/recuve-table-column.mjs.map +1 -1
- package/es/src/components/form/types/index.d.ts +1 -0
- package/es/style.css +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/src/components/form/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/utils/index.ts"],"sourcesContent":["import {isSlotsValue} from '@packages/utils/tools'\n\nexport const labelMouseEnter = (e: MouseEvent, item: any, _this: any) => {\n const el = (e.target as any).parentElement.parentElement\n const labelEl = window.getComputedStyle(el, null)\n const isRequried = item.rules ? 12 : item.beforeWidth || 0\n const labelWidth\n = parseInt(labelEl.getPropertyValue('max-width')) - isRequried\n - parseInt(labelEl.getPropertyValue('padding-right'))\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\n if (tooltipWidth >= labelWidth) {\n _this.form.formItem[item.key].labelDisabled = false\n\n } else {\n _this.form.formItem[item.key].labelDisabled = true\n }\n}\n\nexport const findTreeNode = (treeData: any, key: string, value: string) => {\n const result: any[] = []\n function filterResult(treeData: any) {\n treeData.forEach((item: any) => {\n if (item) {\n if ((Array.isArray(value) && value.includes(item[key])) || value === item[key]) {\n result.push(item)\n }\n if (item.children && item.children.length) {\n filterResult(item.children)\n }\n }\n\n })\n }\n filterResult(treeData)\n return result\n}\n\n\nexport const getTooltipValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n if (['input', 'input-autocomplete', 'input-number'].includes(type)) {\n return value\n } else if (['select', 'tree-select', 'select-v2'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n\n let optValue = ['select-v2'].includes(type) ? options.props && options.props.value : options.value\n optValue = optValue || 'value'\n let optLabel = ['select-v2'].includes(type) ? options.props && options.props.label : options.label\n optLabel = optLabel || 'label'\n\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : optValue, newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[optLabel])\n })\n if (tempArr && tempArr.length) {\n return tempArr.join(',')\n }\n return value\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const getSpanValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n\n\n if (['input', 'input-autocomplete', 'input-number', 'textarea', 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',].includes(type)) {\n return value\n } else if (['select', 'tree-select', 'select-v2', 'radio', 'radio-button', 'checkbox', 'checkbox-button'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n let optValue = ['select-v2'].includes(type) ? options.props && options.props.value : options.value\n optValue = optValue || 'value'\n let optLabel = ['select-v2'].includes(type) ? options.props && options.props.label : options.label\n optLabel = optLabel || 'label'\n\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : optValue, newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[optLabel])\n })\n if (tempArr && tempArr.length) {\n return tempArr.join(',')\n }\n return value\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const valueMouseEnter = (e: MouseEvent, item: any, value: any, _this, itemShowLabel: any) => {\n const showCom = ['input', 'input-autocomplete', 'cascader', 'input-number', 'select', 'tree-select', 'select-v2']\n\n if (!value || (!showCom.includes(item.type) && itemShowLabel !== true)) {\n _this.form.formItem[item.key].tempValueDisabled = true\n return\n }\n let el: HTMLElement | null = null\n if (itemShowLabel) {\n el = e.target as any\n } else if (['input', 'input-autocomplete', 'cascader', 'input-number'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-input__inner') || (e.target as any).parentElement.querySelector('.busy-input__inner') as HTMLElement\n } else if (['select', 'tree-select', 'select-v2'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-select__selected-item.el-select__placeholder') || (e.target as any).parentElement.querySelector('.busy-select__selected-item.el-select__placeholder') as HTMLElement\n el = el || (e.target as any).parentElement.querySelector('.el-select__selection') || (e.target as any).parentElement.querySelector('.busy-select__selection') as HTMLElement\n }\n\n\n if (el) {\n const inputEl = window.getComputedStyle(el, null)\n const textWidth\n = el.offsetWidth\n - parseInt(inputEl.getPropertyValue('padding-right'))\n - parseInt(inputEl.getPropertyValue('padding-left'))\n const tooltipEl = (e.target as any).previousElementSibling\n const tooltipWidth = tooltipEl.offsetWidth\n\n if (tooltipWidth >= textWidth) {\n _this.form.formItem[item.key].tempValueDisabled = false\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n\n }\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n }\n\n}\n\nexport const customPlaceholder = (customName: any, type: string = 'input', name: string = '请输入') => {\n name = ['select', 'tree-select', 'cascader', 'select-v2', 'datetime',\n 'datetimerange', 'date', 'daterange', 'dates', 'week', 'month', 'monthrange', 'year', 'years', 'time-picker', 'radio', 'radio-button'].includes(type) ? '请选择' : name\n return name + ((customName) || '')\n}\n\nexport const formItemSlot = (customName: any, name: string = 'formItem_') => {\n return name + (customName || '')\n}\n\n\nexport const renderSlot = (arr: string[] = [], _this: any, slots, item: any): any => {\n for (const prop in _this.$slots) {\n const slotName = prop.split('formItem_').join('').split('_')[1]\n\n let slotFn: any = null\n if (!slotName) {\n return\n }\n\n if (arr.includes(slotName) && formItemSlot(item.key) + '_' + slotName === prop) {\n\n slotFn = _this.$slots[prop]?.(item)\n // eslint-disable-next-line consistent-return\n isSlotsValue(slotFn) && (slots[slotName] = () => slotFn)\n }\n }\n}\n"],"names":["labelMouseEnter","e","item","_this","el","labelEl","isRequried","labelWidth","findTreeNode","treeData","key","value","result","filterResult","getTooltipValue","type","options","tempArr","newVal","optValue","optLabel","_a","_b","selectItem","_c","_d","getSpanValue","valueMouseEnter","itemShowLabel","inputEl","textWidth","customPlaceholder","customName","name","formItemSlot","renderSlot","arr","slots","prop","slotName","slotFn","isSlotsValue"],"mappings":";AAEO,MAAMA,IAAkB,CAACC,GAAeC,GAAWC,MAAe;AAC/D,QAAAC,IAAMH,EAAE,OAAe,cAAc,eACrCI,IAAU,OAAO,iBAAiBD,GAAI,IAAI,GAC1CE,IAAaJ,EAAK,QAAQ,KAAKA,EAAK,eAAe,GACnDK,IACA,SAASF,EAAQ,iBAAiB,WAAW,CAAC,IAAIC,IAC9C,SAASD,EAAQ,iBAAiB,eAAe,CAAC;AAE5D,EADsBJ,EAAE,OAAe,uBAAuB,eAC1CM,IAChBJ,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB,KAG9CC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAEtD,GAEaM,IAAe,CAACC,GAAeC,GAAaC,MAAkB;AACvE,QAAMC,IAAgB,CAAA;AACtB,WAASC,EAAaJ,GAAe;AACjCA,IAAAA,EAAS,QAAQ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gBAAAhB,EAAA,KAAAD,GAAqBnB,IAE9BuC,EAAaD,CAAM,MAAMH,EAAME,CAAQ,IAAI,MAAMC;AAAA,EAEzD;AACJ;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/utils/index.ts"],"sourcesContent":["import {isSlotsValue} from '@packages/utils/tools'\n\nexport const labelMouseEnter = (e: MouseEvent, item: any, _this: any) => {\n const el = (e.target as any).parentElement.parentElement\n const labelEl = window.getComputedStyle(el, null)\n const isRequried = item.rules ? 12 : item.beforeWidth || 0\n const labelWidth\n = parseInt(labelEl.getPropertyValue('max-width')) - isRequried\n - parseInt(labelEl.getPropertyValue('padding-right'))\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\n if (tooltipWidth >= labelWidth) {\n _this.form.formItem[item.key].labelDisabled = false\n\n } else {\n _this.form.formItem[item.key].labelDisabled = true\n }\n}\n\nexport const findTreeNode = (treeData: any, key: string, value: string) => {\n const result: any[] = []\n function filterResult(treeData: any) {\n treeData.forEach((item: any) => {\n if (item) {\n if ((Array.isArray(value) && value.includes(item[key])) || value === item[key]) {\n result.push(item)\n }\n if (item.children && item.children.length) {\n filterResult(item.children)\n }\n }\n\n })\n }\n filterResult(treeData)\n return result\n}\n\n\nexport const getTooltipValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n if (['input', 'input-autocomplete', 'input-number'].includes(type)) {\n return value\n } else if (['select', 'tree-select', 'select-v2'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n\n let optValue = ['select-v2'].includes(type) ? options.props && options.props.value : options.value\n optValue = optValue || 'value'\n let optLabel = ['select-v2'].includes(type) ? options.props && options.props.label : options.label\n optLabel = optLabel || 'label'\n\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : optValue, newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[optLabel])\n })\n if (tempArr && tempArr.length) {\n return tempArr.join(',')\n }\n return value\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const getSpanValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n\n\n if (['input', 'input-autocomplete', 'input-number', 'textarea', 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',].includes(type)) {\n return value\n } else if (['select', 'tree-select', 'select-v2', 'radio', 'radio-button', 'checkbox', 'checkbox-button'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n let optValue = ['select-v2'].includes(type) ? options.props && options.props.value : options.value\n optValue = optValue || 'value'\n let optLabel = ['select-v2'].includes(type) ? options.props && options.props.label : options.label\n optLabel = optLabel || 'label'\n\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : optValue, newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[optLabel])\n })\n if (tempArr && tempArr.length) {\n return tempArr.join(',')\n }\n return value\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const valueMouseEnter = (e: MouseEvent, item: any, value: any, _this, itemShowLabel: any) => {\n const showCom = ['input', 'input-autocomplete', 'cascader', 'input-number', 'select', 'tree-select', 'select-v2', 'textarea']\n\n if (!value || (!showCom.includes(item.type) && itemShowLabel !== true)) {\n _this.form.formItem[item.key].tempValueDisabled = true\n return\n }\n let el: HTMLElement | null = null\n if (itemShowLabel) {\n el = e.target as any\n } else if (['input', 'input-autocomplete', 'cascader', 'input-number'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-input__inner') || (e.target as any).parentElement.querySelector('.busy-input__inner') as HTMLElement\n } else if (['select', 'tree-select', 'select-v2'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-select__selected-item.el-select__placeholder') || (e.target as any).parentElement.querySelector('.busy-select__selected-item.el-select__placeholder') as HTMLElement\n el = el || (e.target as any).parentElement.querySelector('.el-select__selection') || (e.target as any).parentElement.querySelector('.busy-select__selection') as HTMLElement\n }\n\n\n if (el) {\n const inputEl = window.getComputedStyle(el, null)\n const textWidth\n = el.offsetWidth\n - parseInt(inputEl.getPropertyValue('padding-right'))\n - parseInt(inputEl.getPropertyValue('padding-left'))\n const tooltipEl = (e.target as any).previousElementSibling\n const tooltipWidth = tooltipEl.offsetWidth\n\n if (tooltipWidth >= textWidth) {\n _this.form.formItem[item.key].tempValueDisabled = false\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n\n }\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n }\n\n}\n\nexport const customPlaceholder = (customName: any, type: string = 'input', name: string = '请输入') => {\n name = ['select', 'tree-select', 'cascader', 'select-v2', 'datetime',\n 'datetimerange', 'date', 'daterange', 'dates', 'week', 'month', 'monthrange', 'year', 'years', 'time-picker', 'radio', 'radio-button'].includes(type) ? '请选择' : name\n return name + ((customName) || '')\n}\n\nexport const formItemSlot = (customName: any, name: string = 'formItem_') => {\n return name + (customName || '')\n}\n\n\nexport const renderSlot = (arr: string[] = [], _this: any, slots, item: any): any => {\n for (const prop in _this.$slots) {\n const slotName = prop.split('formItem_').join('').split('_')[1]\n\n let slotFn: any = null\n if (!slotName) {\n return\n }\n\n if (arr.includes(slotName) && formItemSlot(item.key) + '_' + slotName === prop) {\n\n slotFn = _this.$slots[prop]?.(item)\n // eslint-disable-next-line consistent-return\n isSlotsValue(slotFn) && (slots[slotName] = () => slotFn)\n }\n }\n}\n"],"names":["labelMouseEnter","e","item","_this","el","labelEl","isRequried","labelWidth","findTreeNode","treeData","key","value","result","filterResult","getTooltipValue","type","options","tempArr","newVal","optValue","optLabel","_a","_b","selectItem","_c","_d","getSpanValue","valueMouseEnter","itemShowLabel","inputEl","textWidth","customPlaceholder","customName","name","formItemSlot","renderSlot","arr","slots","prop","slotName","slotFn","isSlotsValue"],"mappings":";AAEO,MAAMA,IAAkB,CAACC,GAAeC,GAAWC,MAAe;AAC/D,QAAAC,IAAMH,EAAE,OAAe,cAAc,eACrCI,IAAU,OAAO,iBAAiBD,GAAI,IAAI,GAC1CE,IAAaJ,EAAK,QAAQ,KAAKA,EAAK,eAAe,GACnDK,IACA,SAASF,EAAQ,iBAAiB,WAAW,CAAC,IAAIC,IAC9C,SAASD,EAAQ,iBAAiB,eAAe,CAAC;AAE5D,EADsBJ,EAAE,OAAe,uBAAuB,eAC1CM,IAChBJ,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB,KAG9CC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAEtD,GAEaM,IAAe,CAACC,GAAeC,GAAaC,MAAkB;AACvE,QAAMC,IAAgB,CAAA;AACtB,WAASC,EAAaJ,GAAe;AACjCA,IAAAA,EAAS,QAAQ,CAACP,MAAc;AAC5B,MAAIA,OACK,MAAM,QAAQS,CAAK,KAAKA,EAAM,SAAST,EAAKQ,CAAG,CAAC,KAAMC,MAAUT,EAAKQ,CAAG,MACzEE,EAAO,KAAKV,CAAI,GAEhBA,EAAK,YAAYA,EAAK,SAAS,UAC/BW,EAAaX,EAAK,QAAQ;AAAA,IAElC,CAEH;AAAA,EACL;AACA,SAAAW,EAAaJ,CAAQ,GACdG;AACX,GAGaE,IAAkB,CAACH,GAAYT,MAAmB;;AAC3D,QAAMa,IAAOb,EAAK,MACZc,IAAUd,EAAK,WAAW,IAC1Be,IAAoB,CAAA;AAC1B,MAAI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;AAAA,EAEtD;AAEA,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,oBAAoB;AAG1D,GAEa6B,IAAoB,CAACC,GAAiBjB,IAAe,SAASkB,IAAe,WAC/EA,IAAA;AAAA,EAAC;AAAA,EAAU;AAAA,EAAe;AAAA,EAAY;AAAA,EAAa;AAAA,EACtD;AAAA,EAAiB;AAAA,EAAQ;AAAA,EAAa;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAc;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAe;AAAA,EAAS;AAAgB,EAAA,SAASlB,CAAI,IAAI,QAAQkB,GAC7JA,KAASD,KAAe,MAGtBE,IAAe,CAACF,GAAiBC,IAAe,gBAClDA,KAAQD,KAAc,KAIpBG,IAAa,CAACC,IAAgB,CAAA,GAAIjC,GAAYkC,GAAOnC,MAAmB;;AACtE,aAAAoC,KAAQnC,EAAM,QAAQ;AACvB,UAAAoC,IAAWD,EAAK,MAAM,WAAW,EAAE,KAAK,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC;AAE9D,QAAIE,IAAc;AAClB,QAAI,CAACD;AACD;AAGA,IAAAH,EAAI,SAASG,CAAQ,KAAKL,EAAahC,EAAK,GAAG,IAAI,MAAMqC,MAAaD,MAEtEE,KAASlB,KAAAD,IAAAlB,EAAM,QAAOmC,OAAb,gBAAAhB,EAAA,KAAAD,GAAqBnB,IAE9BuC,EAAaD,CAAM,MAAMH,EAAME,CAAQ,IAAI,MAAMC;AAAA,EAEzD;AACJ;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getPropByPath as
|
|
3
|
-
import { treeNode as
|
|
4
|
-
import { Setting as
|
|
5
|
-
import { ElMessageBox as
|
|
6
|
-
import { buildVueDompurifyHTMLDirective as
|
|
7
|
-
function
|
|
8
|
-
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !
|
|
1
|
+
import { defineComponent as P, ref as H, watch as I, nextTick as K, createVNode as n, Fragment as w, resolveComponent as u, mergeProps as C, withDirectives as S, resolveDirective as W, createTextVNode as $, computed as N, isVNode as m } from "vue";
|
|
2
|
+
import { getPropByPath as M, dataTransformRod as E } from "../../../utils/tools.mjs";
|
|
3
|
+
import { treeNode as q, allShow as z, treeProps as G, allowDrop as J, checkTree as Q, nodeDragEnd as U } from "../hooks/index.mjs";
|
|
4
|
+
import { Setting as X, ArrowDown as Y } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
5
|
+
import { ElMessageBox as F } from "element-plus";
|
|
6
|
+
import { buildVueDompurifyHTMLDirective as Z } from "../../../../node_modules/vue-dompurify-html/dist/vue-dompurify-html.mjs";
|
|
7
|
+
function O(i) {
|
|
8
|
+
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !m(i);
|
|
9
9
|
}
|
|
10
|
-
const
|
|
10
|
+
const L = (i) => {
|
|
11
11
|
const f = {};
|
|
12
12
|
for (const s in i)
|
|
13
13
|
s !== "children" && (f[s] = i[s]);
|
|
14
14
|
return f;
|
|
15
|
-
},
|
|
15
|
+
}, ee = {
|
|
16
16
|
index: 60,
|
|
17
17
|
selection: 40,
|
|
18
18
|
expand: 40
|
|
19
|
-
},
|
|
19
|
+
}, te = Z({}), ue = /* @__PURE__ */ P({
|
|
20
20
|
name: "dinert-recuve-table-column",
|
|
21
21
|
props: {
|
|
22
22
|
onlyClass: {
|
|
@@ -40,169 +40,169 @@ const Y = (i) => {
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
directives: {
|
|
43
|
-
DompurifyHtml:
|
|
43
|
+
DompurifyHtml: te
|
|
44
44
|
},
|
|
45
45
|
emits: ["CheckedChange"],
|
|
46
46
|
setup(i, {
|
|
47
47
|
emit: f
|
|
48
48
|
}) {
|
|
49
|
-
const s =
|
|
50
|
-
return
|
|
51
|
-
var
|
|
52
|
-
return (
|
|
49
|
+
const s = H();
|
|
50
|
+
return I(() => {
|
|
51
|
+
var o;
|
|
52
|
+
return (o = i.table) == null ? void 0 : o.key;
|
|
53
53
|
}, () => {
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
s.value &&
|
|
54
|
+
K(() => {
|
|
55
|
+
var o;
|
|
56
|
+
s.value && q(s.value, (o = i.table) == null ? void 0 : o.tableColumns);
|
|
57
57
|
});
|
|
58
58
|
}, {
|
|
59
59
|
immediate: !0
|
|
60
60
|
}), {
|
|
61
|
-
settingRender: (
|
|
62
|
-
value:
|
|
61
|
+
settingRender: (o) => n(u("el-popover"), {
|
|
62
|
+
value: o.popoverValue
|
|
63
63
|
}, {
|
|
64
64
|
default: () => {
|
|
65
65
|
var x;
|
|
66
|
-
return
|
|
66
|
+
return n("ul", {
|
|
67
67
|
class: "dinert-popover-classify"
|
|
68
|
-
}, [
|
|
68
|
+
}, [n("li", null, [n(u("el-button"), {
|
|
69
69
|
class: "allSelect",
|
|
70
70
|
link: !0,
|
|
71
71
|
type: "primary",
|
|
72
72
|
onClick: async () => {
|
|
73
73
|
var a;
|
|
74
|
-
return
|
|
74
|
+
return z(s.value, ((a = o.table) == null ? void 0 : a.tableColumns) || []);
|
|
75
75
|
}
|
|
76
76
|
}, {
|
|
77
77
|
default: () => [$("全选")]
|
|
78
|
-
})]),
|
|
78
|
+
})]), n(u("el-tree"), {
|
|
79
79
|
ref: s,
|
|
80
80
|
draggable: !0,
|
|
81
|
-
data: (x =
|
|
81
|
+
data: (x = o.table) == null ? void 0 : x.tableColumns,
|
|
82
82
|
"default-expand-all": !0,
|
|
83
|
-
defaultCheckedKeys:
|
|
83
|
+
defaultCheckedKeys: o.defaultCheckedKeys,
|
|
84
84
|
"show-checkbox": !0,
|
|
85
85
|
"node-key": "prop",
|
|
86
|
-
props:
|
|
87
|
-
allowDrop:
|
|
86
|
+
props: G,
|
|
87
|
+
allowDrop: J,
|
|
88
88
|
onCheckChange: async (a, d, k) => {
|
|
89
|
-
await
|
|
89
|
+
await Q(a, d, k), f("CheckedChange", a, d, k);
|
|
90
90
|
},
|
|
91
|
-
onNodeDragEnd: (a, d) =>
|
|
91
|
+
onNodeDragEnd: (a, d) => U(a, d, s.value)
|
|
92
92
|
}, {
|
|
93
93
|
default: ({
|
|
94
94
|
data: a
|
|
95
|
-
}) =>
|
|
95
|
+
}) => n("div", {
|
|
96
96
|
class: "text-dot tree-item"
|
|
97
|
-
}, [
|
|
97
|
+
}, [n(u("el-tooltip"), {
|
|
98
98
|
content: a.label,
|
|
99
99
|
placement: "top",
|
|
100
100
|
disabled: a.label && a.label.length < 8
|
|
101
101
|
}, {
|
|
102
|
-
default: () =>
|
|
102
|
+
default: () => n("span", null, [a.label])
|
|
103
103
|
})])
|
|
104
104
|
})]);
|
|
105
105
|
},
|
|
106
|
-
reference: () =>
|
|
106
|
+
reference: () => n(u("el-icon"), {
|
|
107
107
|
class: "setting-icon"
|
|
108
108
|
}, {
|
|
109
|
-
default: () => [
|
|
109
|
+
default: () => [n(X, null, null)]
|
|
110
110
|
})
|
|
111
111
|
}),
|
|
112
|
-
moreRender: (
|
|
112
|
+
moreRender: (o, x, {
|
|
113
113
|
value: a,
|
|
114
114
|
scope: d,
|
|
115
115
|
isSlotValue: k,
|
|
116
116
|
slotValue: D
|
|
117
117
|
}) => {
|
|
118
|
-
const h =
|
|
118
|
+
const h = o.operations || {}, y = N(() => {
|
|
119
119
|
const e = [];
|
|
120
|
-
return Object.keys(h).forEach((
|
|
121
|
-
const r = h[
|
|
122
|
-
(typeof r.show != "function" && [!0, void 0].includes(r.show) || typeof r.show == "function" && [!0, void 0].includes(r.show(d,
|
|
123
|
-
key:
|
|
120
|
+
return Object.keys(h).forEach((l) => {
|
|
121
|
+
const r = h[l];
|
|
122
|
+
(typeof r.show != "function" && [!0, void 0].includes(r.show) || typeof r.show == "function" && [!0, void 0].includes(r.show(d, o, r))) && e.push({
|
|
123
|
+
key: l,
|
|
124
124
|
...r
|
|
125
125
|
});
|
|
126
|
-
}), e.sort((
|
|
126
|
+
}), e.sort((l, r) => (l.sort || 1 / 0) - (r.sort || 1 / 0)), e;
|
|
127
127
|
});
|
|
128
|
-
let g =
|
|
128
|
+
let g = o.maxOperations || 3;
|
|
129
129
|
g = y.value.length > g ? g - 1 : g;
|
|
130
130
|
const V = N(() => y.value.slice(0, g)), c = N(() => y.value.slice(g, y.value.length));
|
|
131
|
-
return y.value && y.value.length ?
|
|
132
|
-
const
|
|
131
|
+
return y.value && y.value.length ? n(w, null, [V.value.map((e) => {
|
|
132
|
+
const l = typeof e.message == "function" ? e.message(d, o, e) : e.message, r = n(u("el-button"), C({
|
|
133
133
|
...e,
|
|
134
134
|
type: e.key === "delete" ? "danger" : e.type || "primary",
|
|
135
135
|
link: e.link === void 0 ? !0 : e.link
|
|
136
136
|
}, {
|
|
137
|
-
onClick: () => e.second === "messageBox" || e.key === "delete" ?
|
|
137
|
+
onClick: () => e.second === "messageBox" || e.key === "delete" ? F({
|
|
138
138
|
title: "警告",
|
|
139
|
-
message: `是否${
|
|
139
|
+
message: `是否${l}该条数据?`,
|
|
140
140
|
type: "warning",
|
|
141
141
|
showCancelButton: !0,
|
|
142
142
|
cancelButtonText: "取消",
|
|
143
|
-
beforeClose(b,
|
|
143
|
+
beforeClose(b, R, T) {
|
|
144
144
|
T();
|
|
145
145
|
},
|
|
146
146
|
...e.messageBox
|
|
147
|
-
}).then(() => e.click && e.click(d,
|
|
147
|
+
}).then(() => e.click && e.click(d, o, e)).catch(() => null) : e.click && e.click(d, o, e),
|
|
148
148
|
key: e.key
|
|
149
|
-
}),
|
|
150
|
-
default: () => [
|
|
149
|
+
}), O(l) ? l : {
|
|
150
|
+
default: () => [l]
|
|
151
151
|
});
|
|
152
|
-
return e.second === "messageBox" ? r : e.key === "delete" || e.second ?
|
|
153
|
-
title: `是否${
|
|
152
|
+
return e.second === "messageBox" ? r : e.key === "delete" || e.second ? n(u("el-popconfirm"), C({
|
|
153
|
+
title: `是否${l}该数据?`
|
|
154
154
|
}, {
|
|
155
155
|
...e.confirm
|
|
156
156
|
}, {
|
|
157
|
-
onConfirm: () => e.click && e.click(d,
|
|
157
|
+
onConfirm: () => e.click && e.click(d, o, e)
|
|
158
158
|
}), {
|
|
159
|
-
reference: () =>
|
|
159
|
+
reference: () => n(u("el-button"), C({
|
|
160
160
|
...e,
|
|
161
161
|
type: e.key === "delete" ? "danger" : e.type || "primary",
|
|
162
162
|
link: e.link === void 0 ? !0 : e.link
|
|
163
163
|
}, {
|
|
164
164
|
key: e.key
|
|
165
|
-
}),
|
|
166
|
-
default: () => [
|
|
165
|
+
}), O(l) ? l : {
|
|
166
|
+
default: () => [l]
|
|
167
167
|
})
|
|
168
168
|
}) : r;
|
|
169
|
-
}), c.value.length && y.value.length > g &&
|
|
169
|
+
}), c.value.length && y.value.length > g && n(u("el-dropdown"), {
|
|
170
170
|
teleported: !0,
|
|
171
|
-
onCommand: (e) => e.key === "delete" || e.second ?
|
|
171
|
+
onCommand: (e) => e.key === "delete" || e.second ? F({
|
|
172
172
|
title: "警告",
|
|
173
173
|
message: `是否${e.message}该条数据?`,
|
|
174
174
|
type: "warning",
|
|
175
175
|
showCancelButton: !0,
|
|
176
176
|
cancelButtonText: "取消",
|
|
177
|
-
beforeClose(
|
|
177
|
+
beforeClose(l, r, b) {
|
|
178
178
|
b();
|
|
179
179
|
},
|
|
180
180
|
...e.messageBox
|
|
181
|
-
}).then(() => e.click && e.click(d,
|
|
181
|
+
}).then(() => e.click && e.click(d, o, e)).catch(() => null) : e.click && e.click(d, o, e)
|
|
182
182
|
}, {
|
|
183
|
-
default: () =>
|
|
183
|
+
default: () => n(u("el-button"), {
|
|
184
184
|
type: "primary",
|
|
185
185
|
link: !0,
|
|
186
186
|
text: !0
|
|
187
187
|
}, {
|
|
188
|
-
default: () => [$("更多"),
|
|
189
|
-
default: () => [
|
|
188
|
+
default: () => [$("更多"), n(u("el-icon"), null, {
|
|
189
|
+
default: () => [n(Y, null, null)]
|
|
190
190
|
})]
|
|
191
191
|
}),
|
|
192
192
|
dropdown: () => {
|
|
193
193
|
let e;
|
|
194
|
-
return
|
|
195
|
-
const r = typeof
|
|
196
|
-
return
|
|
197
|
-
command:
|
|
198
|
-
},
|
|
194
|
+
return n(u("el-dropdown-menu"), null, O(e = c.value.map((l) => {
|
|
195
|
+
const r = typeof l.message == "function" ? l.message(d, o, l) : l.message;
|
|
196
|
+
return n(u("el-dropdown-item"), {
|
|
197
|
+
command: l
|
|
198
|
+
}, O(r) ? r : {
|
|
199
199
|
default: () => [r]
|
|
200
200
|
});
|
|
201
201
|
})) ? e : {
|
|
202
202
|
default: () => [e]
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
-
}) || null]) :
|
|
205
|
+
}) || null]) : n("div", {
|
|
206
206
|
class: "cell-item-text"
|
|
207
207
|
}, [k && D || a]);
|
|
208
208
|
}
|
|
@@ -210,59 +210,59 @@ const Y = (i) => {
|
|
|
210
210
|
},
|
|
211
211
|
render() {
|
|
212
212
|
const i = this.$slots, f = i.default, s = i.header;
|
|
213
|
-
return
|
|
213
|
+
return n(w, null, [
|
|
214
214
|
// eslint-disable-next-line array-callback-return, consistent-return
|
|
215
|
-
this.tableColumns && this.tableColumns.map((
|
|
215
|
+
this.tableColumns && this.tableColumns.map((t) => {
|
|
216
216
|
var V;
|
|
217
|
-
let v = typeof
|
|
217
|
+
let v = typeof t.show == "function" ? t.show(t) : t.show;
|
|
218
218
|
v = v === void 0 || v === !0;
|
|
219
|
-
const
|
|
220
|
-
let D =
|
|
221
|
-
const y =
|
|
222
|
-
if (p != null && p.includes("time") || p != null && p.includes("date") ? h = h || 170 : (p != null && p.includes("status") || p != null && p.includes("state")) && (h = h || 100, D =
|
|
223
|
-
return
|
|
224
|
-
key:
|
|
219
|
+
const o = t.checked === void 0 || t.checked === !0, x = !["index", "selection", "expand"].includes(t.type), a = t.prop === "operations" && t.fixed === void 0 ? "right" : t.fixed, d = t.showOverflowTooltip === void 0 && t.prop !== "operations" ? !0 : t.showOverflowTooltip, k = `${t.prop || ""} ${t.className || ""} ${t.setting ? "setting" : ""}`;
|
|
220
|
+
let D = t.prop === "operations" && t.align === void 0 ? "center" : t.align, h = t.prop === "operations" && t.width === void 0 ? 200 : t.width;
|
|
221
|
+
const y = t.formatter && typeof t.formatter == "function", g = L(t), p = (V = t.prop) == null ? void 0 : V.toLocaleLowerCase();
|
|
222
|
+
if (p != null && p.includes("time") || p != null && p.includes("date") ? h = h || 170 : (p != null && p.includes("status") || p != null && p.includes("state")) && (h = h || 100, D = t.align || "center"), v && o && x)
|
|
223
|
+
return n(u("el-table-column"), C(g, {
|
|
224
|
+
key: t.prop,
|
|
225
225
|
fixed: a,
|
|
226
226
|
"show-overflow-tooltip": d,
|
|
227
227
|
className: k,
|
|
228
228
|
width: h,
|
|
229
|
-
minWidth:
|
|
229
|
+
minWidth: t.minWidth,
|
|
230
230
|
align: D
|
|
231
231
|
}), {
|
|
232
232
|
default: (c) => {
|
|
233
|
-
var
|
|
234
|
-
const e =
|
|
233
|
+
var R, T, j, _, A;
|
|
234
|
+
const e = M(c.row, t.prop || ""), l = E(e, (R = this.table) == null ? void 0 : R.errData), r = f == null ? void 0 : f({
|
|
235
235
|
...c,
|
|
236
|
-
prop:
|
|
236
|
+
prop: t.prop
|
|
237
237
|
}), b = r && r[0] && r[0].children;
|
|
238
238
|
if (y) {
|
|
239
|
-
let
|
|
240
|
-
return
|
|
241
|
-
class: "cell-item"
|
|
239
|
+
let B = t.formatter && t.formatter(c, t, e, c.$index, (T = this.table) == null ? void 0 : T.errData);
|
|
240
|
+
return B = E(B, (j = this.table) == null ? void 0 : j.errData), n(w, null, [b ? n("div", {
|
|
241
|
+
class: ["cell-item"]
|
|
242
242
|
}, [f == null ? void 0 : f({
|
|
243
243
|
...c,
|
|
244
|
-
prop:
|
|
245
|
-
})]) :
|
|
246
|
-
class: "cell-item"
|
|
247
|
-
}, null), [[
|
|
244
|
+
prop: t.prop
|
|
245
|
+
})]) : S(n("div", {
|
|
246
|
+
class: ["cell-item", B === ((_ = this.table) == null ? void 0 : _.errData) ? "empty-value" : ""]
|
|
247
|
+
}, null), [[W("dompurify-html"), B]]), n(u("dinert-recuve-table-column"), {
|
|
248
248
|
table: this.table,
|
|
249
|
-
key:
|
|
250
|
-
tableColumns:
|
|
249
|
+
key: t.prop,
|
|
250
|
+
tableColumns: t.children,
|
|
251
251
|
"popover-value": this.popoverValue,
|
|
252
252
|
"only-class": this.onlyClass
|
|
253
253
|
}, i)]);
|
|
254
254
|
} else
|
|
255
|
-
return
|
|
256
|
-
class: "cell-item"
|
|
257
|
-
}, [this.moreRender(
|
|
258
|
-
value:
|
|
255
|
+
return n(w, null, [n("div", {
|
|
256
|
+
class: ["cell-item", l === ((A = this.table) == null ? void 0 : A.errData) ? "empty-value" : ""]
|
|
257
|
+
}, [this.moreRender(t, this, {
|
|
258
|
+
value: l,
|
|
259
259
|
scope: c,
|
|
260
260
|
isSlotValue: b,
|
|
261
261
|
slotValue: r
|
|
262
|
-
})]),
|
|
262
|
+
})]), n(u("dinert-recuve-table-column"), {
|
|
263
263
|
table: this.table,
|
|
264
|
-
key:
|
|
265
|
-
tableColumns:
|
|
264
|
+
key: t.prop,
|
|
265
|
+
tableColumns: t.children,
|
|
266
266
|
"popover-value": this.popoverValue,
|
|
267
267
|
"only-class": this.onlyClass
|
|
268
268
|
}, i)]);
|
|
@@ -271,23 +271,23 @@ const Y = (i) => {
|
|
|
271
271
|
var r, b;
|
|
272
272
|
const e = s == null ? void 0 : s({
|
|
273
273
|
...c,
|
|
274
|
-
data:
|
|
275
|
-
prop:
|
|
276
|
-
}),
|
|
277
|
-
return s ?
|
|
274
|
+
data: t,
|
|
275
|
+
prop: t.prop
|
|
276
|
+
}), l = e && e[0] && e[0].children;
|
|
277
|
+
return s ? n(w, null, [$(" "), n("span", null, [l ? s == null ? void 0 : s({
|
|
278
278
|
...c,
|
|
279
|
-
data:
|
|
280
|
-
prop:
|
|
281
|
-
}) : c.column.label]),
|
|
279
|
+
data: t,
|
|
280
|
+
prop: t.prop
|
|
281
|
+
}) : c.column.label]), t.setting && ((r = this.table) == null ? void 0 : r.setting) !== !1 && this.settingRender(this)]) : n(w, null, [n("span", null, [c.column.label]), t.setting && ((b = this.table) == null ? void 0 : b.setting) !== !1 && this.settingRender(this)]);
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
|
-
if (v &&
|
|
285
|
-
const c =
|
|
286
|
-
return
|
|
287
|
-
key:
|
|
284
|
+
if (v && o) {
|
|
285
|
+
const c = t.align === void 0 ? "center" : "left", e = t.width === void 0 ? ee[t.type || ""] || 60 : t.width;
|
|
286
|
+
return n(u("el-table-column"), C(t, {
|
|
287
|
+
key: t.prop,
|
|
288
288
|
fixed: a,
|
|
289
289
|
align: c,
|
|
290
|
-
"reserve-selection":
|
|
290
|
+
"reserve-selection": t.reserveSelection,
|
|
291
291
|
width: e
|
|
292
292
|
}), this.$slots);
|
|
293
293
|
}
|
|
@@ -296,6 +296,6 @@ const Y = (i) => {
|
|
|
296
296
|
}
|
|
297
297
|
});
|
|
298
298
|
export {
|
|
299
|
-
|
|
299
|
+
ue as default
|
|
300
300
|
};
|
|
301
301
|
//# sourceMappingURL=recuve-table-column.mjs.map
|