app-list-itemlayoutpanel.vue 2.3 KB
Newer Older
hudan's avatar
hudan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<template>
    <div v-if="inputData" class="app-list-itemlayoutpanel">
        <h4 class="srfmajortext">{{inputData.srfmajortext}}</h4>
        <template v-for="(tagitem,index) of tagArr">
            <el-tag v-if="tagArr" type="info" size="medium" :key="index">{{tagitem}}</el-tag>
        </template>
        <p class="srfdescription">{{inputData.srfdescription}}</p>
        <div class="user-information">
            <div class="srficon">
                <img v-if="inputData.srficon" :src="inputData.srficon" />
                <img v-else src="/assets/img/noimage.png" alt="">
            </div>
            <span class="srfdate">{{inputData.srfdate}}</span>
        </div>
15
        <div class="app-list-item-action" v-if="actionModel">
hudan's avatar
hudan committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
            <template v-for="(action,index) in Object.keys(actionModel)">
                <a :key="index" style="display: inline-block;margin: 0 12px;" @click="uiAction(inputData, action, $event)">
                    <i :class="actionModel[action].icon" style="margin-right:2px;"></i>
                    <span>{{actionModel[action].caption}}</span>
                </a>
            </template>
        </div>
    </div>
</template>

<script lang="ts">
import { Component, Vue, Prop, Model, Watch } from 'vue-property-decorator';
import { Subject,Subscription } from 'rxjs';
@Component({
})
export default class AppListItemlayoutpanel extends Vue { 

    /**
     * 传递数据
     * 
     * @type {any}
     * @memberof AppListItemlayoutpanel
     */
    @Prop() public inputData: any;

    /**
     * 操作栏模型
     * 
     * @type {*}
     * @memberof AppListItemlayoutpanel
     */
    @Prop() public actionModel:any;

    /**
     * 处理数据
     * 
     * @memberof AppListItemlayoutpanel
     */
    public tagArr:Array<any>=[];

    /**
     * 操作列界面行为
     *
     * @param {*} data
     * @param {*} tag
     * @param {*} $event
     * @memberof AppListItemlayoutpanel
     */
	public uiAction(data: any, tag: any, $event: any) {
        this.$emit('uiAction',data, tag, $event)
    }

    /**
     * vue生命周期
     * 
     * @memberof AppListItemlayoutpanel
     */
    public created(){
        if(this.inputData && this.inputData.srftag){
            this.tagArr = this.inputData.srftag.split(',');
        }
    }
}
</script>

<style lang='less'>
@import './app-list-itemlayoutpanel.less';
</style>