UNPKG

vue-ant-patterns

Version:

vue-ant-patterns

204 lines (191 loc) 5.5 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _vueTypes = require('ant-design-vue/lib/_util/vue-types'); var _vueTypes2 = _interopRequireDefault(_vueTypes); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } exports['default'] = { name: 'miniRecognition', props: { option: _vueTypes2['default'].any, recognitionInfo: _vueTypes2['default'].Object, collapsible: _vueTypes2['default'].bool, localMsg: _vueTypes2['default'].Object }, data: function data() { return { personData: this.recognitionInfo }; }, watch: { recognitionInfo: { handler: function handler(val, oldval) { this.personData = val; }, deep: true } }, methods: { desMenuClick: function desMenuClick(e) { switch (e.key) { case 1: // 职位说明书 break; case 2: // 职务说明书 break; } }, collapseBtn: function collapseBtn() { // this.type === 'mini'; this.$emit('changeType', 'full'); } }, render: function render() { var _this = this, _cx; var h = arguments[0]; var $props = this.$props, personData = this.personData; var option = $props.option, recognitionInfo = $props.recognitionInfo, collapsible = $props.collapsible, localMsg = $props.localMsg; var btnProps = { 'class': 'full-collapse-btn', on: { click: function click() { _this.collapseBtn(); } } }; // 右侧操作 var operationsProps = { 'class': (0, _classnames2['default'])((_cx = {}, (0, _defineProperty3['default'])(_cx, 'flex-end-center', true), (0, _defineProperty3['default'])(_cx, 'recognition-operations', true), _cx)) }; return h( 'div', { 'class': 'miniRecognition' }, [h( 'a-row', { attrs: { type: 'flex' } }, [h( 'a-col', { attrs: { span: '8' }, 'class': 'ascenter' }, [h( 'div', { 'class': 'pinfo' }, [h('div', [h( 'span', { 'class': 'pinfo-namespan' }, [personData.employeeName] ), h( 'span', { 'class': 'pinfo-sexspan' }, [personData.gender ? '[' + personData.gender.name + ']' : ''] ), h( 'span', { 'class': 'pinfo-empcode' }, [personData.employeeCode] )]), h( 'd-container-h', { 'class': 'margin-top-xs' }, [h( 'a-tooltip', { attrs: { placement: 'bottom' }, 'class': 'margin-right-md' }, [h( 'template', { slot: 'title' }, [personData.mobileTel ? personData.mobileTel : '暂无信息'] ), h( 'd-icon-button', { 'class': 'radiconbtn' }, [h('a-icon', { 'class': 'operation-btn', attrs: { type: 'phone' } })] )] ), h( 'a-tooltip', { attrs: { placement: 'bottom' } }, [h( 'template', { slot: 'title' }, [personData.businessEmail ? personData.businessEmail : '暂无信息'] ), h( 'd-icon-button', { 'class': 'radiconbtn' }, [h('a-icon', { 'class': 'operation-btn', attrs: { type: 'mail' } })] )] )] )] )] ), h( 'a-col', { attrs: { span: '4' }, 'class': 'ascenter' }, [h('div', [h( 'div', { 'class': 'pinfo-comtitle' }, ['\u804C\u4F4D:'] ), h( 'div', { 'class': 'margin-top-xs infoPlaceholder', style: 'height:21px' }, [personData.positionName] )])] ), h( 'a-col', { attrs: { span: '4' }, 'class': 'ascenter' }, [h('div', [h( 'div', { 'class': 'pinfo-comtitle' }, ['\u516C\u53F8:'] ), h( 'div', { 'class': 'margin-top-xs infoPlaceholder' }, [personData.companyName] )])] ), h( 'a-col', { attrs: { span: '4' }, 'class': 'ascenter' }, [h('div', [h( 'div', { 'class': 'pinfo-comtitle' }, ['\u90E8\u95E8:'] ), h( 'div', { 'class': 'margin-top-xs infoPlaceholder' }, [personData.deptName] )])] ), option ? h( 'a-col', { attrs: { span: '4' } }, [h( 'd-container-h', operationsProps, [option] )] ) : ''] ), collapsible ? h('div', btnProps) : ''] ); } };