UNPKG

sohelp-ele

Version:

SohelpEle Library

182 lines (181 loc) 9.55 kB
(function() { "use strict"; try { if (typeof document != "undefined") { var elementStyle = document.createElement("style"); elementStyle.appendChild(document.createTextNode("")); document.head.appendChild(elementStyle); } } catch (e) { console.error("vite-plugin-css-injected-by-js", e); } })(); "use strict"; var render = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _vm.column.customFilterDropdown ? _c("div", { staticStyle: { "position": "absolute", "right": "8px", "margin-top": "-10px", "top": "50%" }, on: { "click": function($event) { $event.stopPropagation(); } } }, [_c("el-popover", { attrs: { "width": 200, "trigger": "click", "placement": "bottom", "transition": "el-zoom-in-top" }, model: { value: _vm.visible, callback: function($$v) { _vm.visible = $$v; }, expression: "visible" } }, [_c("i", { staticClass: "el-icon-_filter ele-text-secondary", staticStyle: { "font-weight": "bold" }, attrs: { "slot": "reference" }, slot: "reference" }), _c("div", [_c("div", [_vm.column.type === "file" || _vm.column.type === "image" || _vm.column.type === "autocoder" || _vm.column.type === "string" || _vm.column.type === "dictcombo" ? _c("div", { staticStyle: { "display": "flex" } }, [_c("el-select", { attrs: { "default-value": "like" }, on: { "change": _vm.onChange }, model: { value: _vm.value, callback: function($$v) { _vm.value = $$v; }, expression: "value" } }, _vm._l(_vm.options, function(it) { return _c("el-option", { key: it.value, attrs: { "value": it.value, "label": it.label } }); }), 1), _c("el-input", { attrs: { "placeholder": "\u8BF7\u8F93\u5165\u5173\u952E\u5B57" }, model: { value: _vm.filters[_vm.column.slot], callback: function($$v) { _vm.$set(_vm.filters, _vm.column.slot, $$v); }, expression: "filters[column.slot]" } })], 1) : _vm._e(), _vm.column.type === "relation" || _vm.column.type === "sort" || _vm.column.type === "float" || _vm.column.type === "number" || _vm.column.type === "int" || _vm.column.type === "sequence" ? _c("div", {}, [_c("div", { staticStyle: { "display": "flex", "align-items": "center" } }, [_c("span", { staticStyle: { "width": "40px", "font-size": "12px" } }, [_vm._v("\u5927\u4E8E")]), _c("el-input", { attrs: { "onkeyup": "value=value.replace(/[^\\d]/g,'')", "placeholder": "\u8BF7\u8F93\u5165\u5173\u952E\u5B57" }, on: { "change": function($event) { return _vm.onGtFilters(_vm.column.slot + ",gt"); } }, model: { value: _vm.filters[_vm.column.slot + ".gt"], callback: function($$v) { _vm.$set(_vm.filters, _vm.column.slot + ".gt", $$v); }, expression: "filters[column.slot+'.gt']" } })], 1), _c("div", { staticStyle: { "display": "flex", "align-items": "center" } }, [_c("span", { staticStyle: { "width": "40px", "font-size": "12px" } }, [_vm._v("\u5C0F\u4E8E")]), _c("el-input", { attrs: { "onkeyup": "value=value.replace(/[^\\d]/g,'')", "placeholder": "\u8BF7\u8F93\u5165\u5173\u952E\u5B57" }, on: { "change": function($event) { return _vm.onLtFilters(_vm.column.slot + ",lt"); } }, model: { value: _vm.filters[_vm.column.slot + ".lt"], callback: function($$v) { _vm.$set(_vm.filters, _vm.column.slot + ".lt", $$v); }, expression: "filters[column.slot+'.lt']" } })], 1), _c("div", { staticStyle: { "display": "flex", "align-items": "center" } }, [_c("span", { staticStyle: { "width": "40px", "font-size": "12px" } }, [_vm._v("\u7B49\u4E8E")]), _c("el-input", { attrs: { "onkeyup": "value=value.replace(/[^\\d]/g,'')", "placeholder": "\u8BF7\u8F93\u5165\u5173\u952E\u5B57" }, on: { "change": function($event) { return _vm.onEqFilters(_vm.column.slot + ",eq"); } }, model: { value: _vm.filters[_vm.column.slot + ".eq"], callback: function($$v) { _vm.$set(_vm.filters, _vm.column.slot + ".eq", $$v); }, expression: "filters[column.slot+'.eq']" } })], 1)]) : _vm._e(), _vm.column.type === "date" || _vm.column.type === "datetime" ? _c("div", {}, [_c("div", { staticStyle: { "display": "flex", "align-items": "center" } }, [_c("span", { staticStyle: { "width": "40px", "font-size": "12px" } }, [_vm._v("\u5927\u4E8E")]), _c("el-date-picker", { attrs: { "type": "date", "placeholder": "\u9009\u62E9\u65E5\u671F", "placement": "bottom-start" }, on: { "change": function($event) { return _vm.onGtFilters(_vm.column.slot + ",gt"); } }, model: { value: _vm.filters[_vm.column.slot + ".gt"], callback: function($$v) { _vm.$set(_vm.filters, _vm.column.slot + ".gt", $$v); }, expression: "filters[column.slot+'.gt']" } })], 1), _c("div", { staticStyle: { "display": "flex", "align-items": "center" } }, [_c("span", { staticStyle: { "width": "40px", "font-size": "12px" } }, [_vm._v("\u5C0F\u4E8E")]), _c("el-date-picker", { attrs: { "type": "date", "placement": "bottom-start", "placeholder": "\u9009\u62E9\u65E5\u671F" }, on: { "change": function($event) { return _vm.onLtFilters(_vm.column.slot + ",lt"); } }, model: { value: _vm.filters[_vm.column.slot + ".lt"], callback: function($$v) { _vm.$set(_vm.filters, _vm.column.slot + ".lt", $$v); }, expression: "filters[column.slot+'.lt']" } })], 1), _c("div", { staticStyle: { "display": "flex", "align-items": "center" } }, [_c("span", { staticStyle: { "width": "40px", "font-size": "12px" } }, [_vm._v("\u7B49\u4E8E")]), _c("el-date-picker", { attrs: { "placement": "bottom-start", "type": "date", "placeholder": "\u9009\u62E9\u65E5\u671F" }, on: { "change": function($event) { return _vm.onEqFilters(_vm.column.slot + ",eq"); } }, model: { value: _vm.filters[_vm.column.slot + ".eq"], callback: function($$v) { _vm.$set(_vm.filters, _vm.column.slot + ".eq", $$v); }, expression: "filters[column.slot+'.eq']" } })], 1)]) : _vm._e()]), _c("div", { staticStyle: { "margin-top": "10px" } }, [_c("el-button", { attrs: { "type": "primary", "size": "mini" }, on: { "click": _vm.screen } }, [_vm._v(" \u641C\u7D22 ")]), _c("el-button", { attrs: { "size": "mini" }, on: { "click": function($event) { return _vm.reset(_vm.column.slot); } } }, [_vm._v("\u91CD\u7F6E")])], 1)])])], 1) : _vm._e(); }; var staticRenderFns = []; var TableSearch_vue_vue_type_style_index_0_scoped_true_lang = ""; function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) { var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports; if (render2) { options.render = render2; options.staticRenderFns = staticRenderFns2; options._compiled = true; } if (functionalTemplate) { options.functional = true; } if (scopeId) { options._scopeId = "data-v-" + scopeId; } var hook; if (moduleIdentifier) { hook = function(context) { context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") { context = __VUE_SSR_CONTEXT__; } if (injectStyles) { injectStyles.call(this, context); } if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier); } }; options._ssrRegister = hook; } else if (injectStyles) { hook = shadowMode ? function() { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ); } : injectStyles; } if (hook) { if (options.functional) { options._injectStyles = hook; var originalRender = options.render; options.render = function renderWithStyleInjection(h, context) { hook.call(context); return originalRender(h, context); }; } else { var existing = options.beforeCreate; options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; } } return { exports: scriptExports, options }; } const __vue2_script = { name: "TableSearch", props: { column: "" }, data() { return { visible: false, filtersType: {}, value: "like", filters: {}, options: [{ value: "like", label: "\u5305\u542B" }, { value: "notLike", label: "\u4E0D\u5305\u542B" }, { value: "eq", label: "\u7B49\u4E8E" }, { value: "leq", label: "\u5DE6\u5305\u542B" }, { value: "req", label: "\u53F3\u5305\u542B" }] }; }, methods: { screen() { if (!this.filtersType[this.column.slot] && (this.column.type === "file" || this.column.type === "image" || this.column.type === "autocoder" || this.column.type === "string" || this.column.type === "dictcombo")) { this.filtersType[this.column.slot] = "like"; } this.$emit("search", this.filtersType, this.filters); }, onGtFilters(key) { this.filtersType[key] = ">="; }, onLtFilters(key) { this.filtersType[key] = "<="; }, onEqFilters(key) { this.filtersType[key] = "="; }, onChange(value) { this.filtersType[this.column.slot] = value; } } }; const __cssModules = {}; var __component__ = /* @__PURE__ */ normalizeComponent( __vue2_script, render, staticRenderFns, false, __vue2_injectStyles, "71962426", null, null ); function __vue2_injectStyles(context) { for (let o in __cssModules) { this[o] = __cssModules[o]; } } var TableSearch = /* @__PURE__ */ function() { return __component__.exports; }(); module.exports = TableSearch;