vue-ant-patterns
Version:
vue-ant-patterns
153 lines (150 loc) • 4.52 kB
JavaScript
import _defineProperty from 'babel-runtime/helpers/defineProperty';
import PropTypes from 'ant-design-vue/es/_util/vue-types';
import cx from 'classnames';
import ViewItem from './ViewItem';
var TopTools = {
props: {
prefixCls: PropTypes.string.def('depot-dquerypanel-toptools'),
conditionAllList: PropTypes.array,
selectCode: PropTypes.string.def('')
},
components: {
ViewItem: ViewItem
},
data: function data() {
return {};
},
methods: {
changeSH: function changeSH() {
this.$emit('changestate');
},
selectView: function selectView(scode) {
this.$emit('changeSelect', scode);
}
},
render: function render() {
var _this = this;
var h = arguments[0];
var prefixCls = this.prefixCls,
conditionAllList = this.conditionAllList;
var ttProps = {
'class': cx(_defineProperty({}, '' + prefixCls, true))
};
return h(
'div',
ttProps,
[h('d-tools', [h(
'template',
{ slot: 'main' },
[h(
'a-row',
{
attrs: { type: 'flex' }
},
[h('a-col', [h(
'a-popover',
{
attrs: { placement: 'bottomLeft' }
},
[h(
'template',
{ slot: 'content' },
[h(
'd-container-v',
{ style: 'min-height:100px;width:400px', attrs: { justify: 'between' }
},
[h(
'd-container',
{ style: 'padding:16px' },
[h(
'a-row',
{
attrs: { type: 'flex' }
},
[h(
'a-col',
{ 'class': 'margin-right-xs margin-bottom-xs' },
[h(
'div',
{
'class': cx(_defineProperty({}, prefixCls + '-allbtn', true)),
on: {
'click': function click() {
_this.selectView('');
}
}
},
['\u5168\u90E8\u7ED3\u679C']
)]
), this.conditionAllList.map(function (_citem) {
return h(
'a-col',
{ 'class': 'margin-right-xs margin-bottom-xs' },
[h('view-item', {
on: {
'selectview': _this.selectView
},
attrs: {
conditionItem: _citem,
selected: _citem.id === _this.selectCode
}
})]
);
})]
)]
), h(
'd-container',
{ style: 'background: rgba(0,0,0,0.02);height:48px;padding:6px 12px' },
[h('d-tools', [h(
'template',
{ slot: 'second' },
[h('a-button', ['\u7F16\u8F91\u89C6\u56FE'])]
)])]
)]
)]
), h(
'div',
{ 'class': prefixCls + '-qrItem' },
[this.selectCode === '' ? '全部结果' : this.conditionAllList.find(function (_citem) {
return _citem.id === _this.selectCode;
}).name]
)]
)]), h('a-col', [h(
'div',
{ 'class': prefixCls + '-rightIcon' },
[h('a-icon', {
attrs: { type: 'right' }
})]
)]), h('a-col', [h(
'a-tag',
{
attrs: { closable: true }
},
['\u2260\u6B63\u5F0F\u5458\u5DE5']
)]), h('a-col', [h(
'a-tag',
{
attrs: { closable: true }
},
['\u5B9E\u4E60\u751F']
)])]
)]
), h(
'template',
{ slot: 'second' },
[h('a-divider', {
attrs: { type: 'vertical' }
}), h(
'a-button',
{
on: {
'click': this.changeSH
}
},
['\u5C55\u5F00\u67E5\u8BE2\u9762\u677F']
)]
)])]
);
}
};
export default TopTools;