UNPKG

vue-ant-patterns

Version:

vue-ant-patterns

188 lines (183 loc) 5.01 kB
import _defineProperty from 'babel-runtime/helpers/defineProperty'; import PropTypes from 'ant-design-vue/es/_util/vue-types'; import cx from 'classnames'; export default { name: 'miniRecognition', props: { option: PropTypes.any, recognitionInfo: PropTypes.Object, collapsible: PropTypes.bool, localMsg: PropTypes.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': cx((_cx = {}, _defineProperty(_cx, 'flex-end-center', true), _defineProperty(_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) : ''] ); } };