UNPKG

vue-ant-patterns

Version:

vue-ant-patterns

314 lines (272 loc) 8.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _babelHelperVueJsxMergeProps = require("babel-helper-vue-jsx-merge-props"); var _babelHelperVueJsxMergeProps2 = _interopRequireDefault(_babelHelperVueJsxMergeProps); var _moment = require("moment"); var _moment2 = _interopRequireDefault(_moment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var API_PLATFORM = (global || window).globalJSConfig.SERVICE_CONFIG.API_PLATFORM; /* * @Author: liuyanxin * @Date: 2020-06-22 13:53:40 * @LastEditTime: 2021-04-07 21:03:29 * @LastEditors: liuyanxin * @Description: * @FilePath: \vue-patterns\biz\b-query-panel\middleMixins.jsx */ var middleMixins = { methods: { changeMiddleValue: function changeMiddleValue(e) { this.operator = e; this.formatResValue(); }, changeColValue: function changeColValue(e) { this.isInitialize = false; this.ovalue = e; this.formatResValue(); }, render_Col_String: function render_Col_String() { var _this = this; var h = this.$createElement; return h("a-input", { attrs: { value: this.ovalue, allowClear: true }, on: { "change": function change(e) { return _this.changeColValue(e.target.value); } } }); }, render_Col_Short: function render_Col_Short() { var _this2 = this; var h = this.$createElement; return h("a-input-number", { attrs: { value: this.ovalue, allowClear: true }, style: "width: 100%", on: { "change": function change(e) { return _this2.changeColValue(e); } } }); }, render_Col_Integer: function render_Col_Integer() { var _this3 = this; var h = this.$createElement; return h("a-input-number", { attrs: { value: this.ovalue, allowClear: true }, style: "width: 100%", on: { "change": function change(e) { return _this3.changeColValue(e); } } }); }, render_Col_Long: function render_Col_Long() { var _this4 = this; var h = this.$createElement; return h("a-input-number", { attrs: { value: this.ovalue, allowClear: true }, style: "width: 100%", on: { "change": function change(e) { return _this4.changeColValue(e); } } }); }, render_Col_BigDecimal: function render_Col_BigDecimal() { var _this5 = this; var h = this.$createElement; return h("a-input-number", { attrs: { value: this.ovalue, allowClear: true }, style: "width: 100%", on: { "change": function change(e) { return _this5.changeColValue(e); } } }); }, render_Col_Float: function render_Col_Float() { var _this6 = this; var h = this.$createElement; return h("a-input-number", { attrs: { value: this.ovalue, allowClear: true }, style: "width: 100%", on: { "change": function change(e) { return _this6.changeColValue(e); } } }); }, render_Col_Double: function render_Col_Double() { var _this7 = this; var h = this.$createElement; return h("a-input-number", { attrs: { value: this.ovalue, allowClear: true }, style: "width: 100%", on: { "change": function change(e) { return _this7.changeColValue(e); } } }); }, render_Col_Date: function render_Col_Date() { var _this8 = this; var h = this.$createElement; return h("a-date-picker", { attrs: { value: this.ovalue && this.ovalue.time && (0, _moment2["default"])(this.ovalue.time), allowClear: true }, style: "width: 100%", on: { "change": function change(date, dateString) { return _this8.changeColValue(date && { time: (0, _moment2["default"])(date).valueOf() }); } } }); }, render_Col_DateTo: function render_Col_DateTo() { var _this9 = this; var h = this.$createElement; return h("a-range-picker", { attrs: { value: this.ovalue, allowClear: true }, on: { "change": function change(dates, dateStrings) { return _this9.changeColValue(dates); } } }); }, render_Col_Code: function render_Col_Code() { var _this10 = this; var h = this.$createElement; var typeCode = this.typeCode; return h("b-constant", { attrs: { allowClear: true, value: this.ovalue, typeCode: typeCode }, style: "width: 100%", on: { "change": function change(e) { return _this10.changeColValue(e); } } }); }, render_Col_CODE: function render_Col_CODE() { var _this11 = this; var h = this.$createElement; var typeCode = this.typeCode; return h("b-constant", { attrs: { allowClear: true, value: this.ovalue, typeCode: typeCode }, style: "width: 100%", on: { "change": function change(e) { return _this11.changeColValue(e); } } }); }, render_Col_Enum: function render_Col_Enum() { var h = this.$createElement; return h("div"); }, render_Col_SetId: function render_Col_SetId() { var _this12 = this; var h = this.$createElement; var typeCode = this.typeCode; var setProps = { props: { queryParam: { url: API_PLATFORM + "dataShareController/getAllSetIdsByTableName" }, value: this.ovalue, tableName: typeCode, type: 'select', status: 'edit', allowClear: true }, on: { changeValue: function changeValue(e) { _this12.changeColValue(e.value); } } }; return h("b-table-collection", (0, _babelHelperVueJsxMergeProps2["default"])([{ style: "width:100%" }, setProps])); }, render_Col_ComboBox: function render_Col_ComboBox() { var _this13 = this; var h = this.$createElement; var comboOptions = this.comboOptions; return h("a-select", { attrs: { value: this.ovalue, options: comboOptions, allowClear: true }, style: "width: 100%", on: { "change": function change(e) { return _this13.changeColValue(e); } } }); }, render_Col_SearchHelper: function render_Col_SearchHelper() { var _this14 = this; var h = this.$createElement; var typeCode = this.typeCode; function searchHelperSelect(args) { // console.log('search-select', args); var selectedRowKeys = args.selectedRowKeys, selectedRows = args.selectedRows, sKey = args.sKey, sValue = args.sValue; } var bshProps = { props: { allowClear: true, code: typeCode }, on: { select: searchHelperSelect, change: function change(e) { _this14.changeColValue(e); } } }; return h("b-search-helper", (0, _babelHelperVueJsxMergeProps2["default"])([{ attrs: { value: this.ovalue } }, bshProps])); } } }; exports["default"] = middleMixins;