Commit e3f3d7bc authored by luo ying's avatar luo ying

修改的card

parent 6c11c918
<template> <template>
<div class="cardPage mt10 mb10"> <div class="cardPage">
<!-- :columns="rowCard" -->
<div <div
class="cardBox" class="cardBox mb10"
:class="{ borderCss: isCard }" :class="{ borderCss: isCard }"
@click="clickCard(columns)" @click="clickCard(row)"
:columns="columns" @mouseenter="enterCard"
@mouseleave="leaveCard"
>
<p
class="topCard lh40 flex pr"
:style="{ background: topStyle }"
slot="header"
> >
<p class="topCard lh40 flex pr" slot="header">
<span class="checkSingle" v-if="multiple"> <span class="checkSingle" v-if="multiple">
<slot name="multiple"> <slot name="multiple">
<Checkbox <Checkbox
v-model="single" v-model="single"
@on-change="singleChange(single, columns)" @on-change="singleChange(single, row)"
></Checkbox> ></Checkbox>
</slot> </slot>
</span> </span>
<span class="titleName f14 fwBold zh-ellip ml20"> <span class="titleName f14 fwBold zh-ellip ml20">
<slot name="title"> <slot name="title" v-if="title">
{{ columns.topTitle }} {{ title }}
</slot> </slot>
</span> </span>
<span class="f14 fwBold zh-ellip topCount"> <span class="f14 fwBold zh-ellip topCount">
<slot name="topCount"> <slot name="topCount" v-if="subtitle">
{{ columns.topCount }} {{ subtitle }}
</slot> </slot>
</span> </span>
<slot name="colorBol">
<span <span
class="triangle pa" class="triangle pa"
v-show="columns.borCol"
:style="{ :style="{
'border-color': 'border-right-color': life,
'transparent ' + columns.borCol + columns.borCol + ' transparent', 'border-bottom-color': life,
}" }"
></span> ></span>
<span class="triangleName pa f12 fwBold" v-show="columns.borCol">{{ <span class="triangleName pa f12 fwBold" v-if="lifeCode">
columns.markerName <state
}}</span> code="taskList.status"
ref="state"
:value="lifeCode"
type="text"
:color="false"
></state>
</span>
</slot>
</p> </p>
<div class="countCard"> <div class="countCard">
<div class="mainCount flex" slot="main"> <div class="mainCount flex" slot="main">
<div class="imgBox" v-if="img"> <div class="imgBox" v-if="img">
<slot name="img"> <slot name="img">
<img :src="columns.srcImg" v-if="columns.srcImg" alt="图片" /> <img :src="downUrl + srcImg" v-if="srcImg" alt="图片" />
<div <div v-else-if="!srcImg">无图片</div>
v-else-if="
columns.srcImg == null || columns.srcImg == underfined
"
>
无图片
</div>
<img :src="srcImg1" v-else alt="图片" /> <img :src="srcImg1" v-else alt="图片" />
</slot> </slot>
</div> </div>
<div class="rightCount mr20 mt20 ml20"> <div class="rightCount mr20 mt20 ml20">
<slot name="fileLine"> <slot name="fileLine">
<Filed :name="columns.countName4"> <Filed :name="countTitle">
{{ columns.content4 }} {{ count }}
<Icon class="blueFont" type="md-sync" /> <Icon class="blueFont" type="md-sync" />
</Filed> </Filed>
</slot> </slot>
</div> </div>
</div> </div>
<div class="bottomCard flex" slot="footer"> <div class="bottomCard flex" slot="footer">
<div v-if="leftBottom"> <div>
<span class="earlyWarn f14 fwBold mr20"> <span class="earlyWarn f14 fwBold mr20">
<slot name="leftBottom"> <slot name="leftBottom" v-if="leftOneName">
<Icon :type="columns.oneIcon" class="iconStyle" />{{ <Icon :type="leftOneIcon" class="iconStyle" />
columns.leftT1 {{ leftOneName }}
}}
<!-- v-show="leftBtmicon" --> <!-- v-show="leftBtmicon" -->
</slot> </slot>
</span> </span>
<span class="overdue f14 fwBold mr20"> <span class="overdue f14 fwBold mr20">
<slot name="leftBottom2"> <slot name="leftBottom2" v-if="leftTwoName">
<Icon :type="columns.twoIcon" class="iconStyle" />{{ <Icon :type="leftTwoIcon" class="iconStyle" />
columns.leftT2 {{ leftTwoName }}
}}
<!-- v-show="leftBtmicon2" -->
</slot> </slot>
</span> </span>
</div> </div>
<!-- v-if="rightBottom"-->
<span class="rightMore"> <span class="rightMore">
<slot name="rightBottom"> <slot name="rightBottom"> </slot>
<RightM :num="num" :rightM="rightBottom" >
<slot></slot>
</RightM>
</slot>
</span> </span>
</div> </div>
</div> </div>
...@@ -98,18 +97,22 @@ export default { ...@@ -98,18 +97,22 @@ export default {
name: "cardPage", name: "cardPage",
data() { data() {
return { return {
// num:3, rightList: [],
// rightBottom: true,
life: "",
topStyle: "rgba(38, 128, 235, 0.2)",
countTitle: "",
count: "",
downUrl: fileUrlDown,
single: false, //是否选中 single: false, //是否选中
isCard: false, isCard: false,
// leftBottom: false, //左侧底部是否显示 // rowCard: {},
// rightBottom: false, //右侧底部是否显示
columns: {},
srcImg1: require("../../assets/imgicon/chan_Pin.png"), srcImg1: require("../../assets/imgicon/chan_Pin.png"),
}; };
}, },
props: { props: {
// datas:{ // columns: {
// type:Array, // type: Object,
// default: [], // default: [],
// }, // },
multiple: { multiple: {
...@@ -120,37 +123,85 @@ export default { ...@@ -120,37 +123,85 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
moreTrue: { srcImg: {
type: Boolean, type: String,
default: false, default: "",
}, },
leftBottom: { moreTrue: {
//底部左侧显示
type: Boolean, type: Boolean,
default: false, default: false,
}, },
rightBottom: {
//底部右侧显示 title: {
type: Boolean, type: String,
default: false, default: "",
}, },
num:{ subtitle: {
type: Number, type: String,
default: 0, default: "",
}, },
// row: { // life: {
// type:[Array,Object], // type: String,
// default: [], // default: "#666",
// }, // },
lifeCode: {
type: [String, Number],
default: "",
},
leftOneName: {
type: String,
default: "",
},
leftOneIcon: {
type: String,
default: "",
},
leftTwoName: {
type: String,
default: "",
},
leftTwoIcon: {
type: String,
default: "",
},
row: {
type: Object,
default: [],
},
},
created() {
if (this.lifeCode) {
this.tdStyle(this.lifeCode);
}
// this.data = this.$store.getters.dictionaryByKey(this.code) || []; //rightM组件中用到
}, },
created() {},
methods: { methods: {
clickCard(columns) { enterCard() {
if (this.multiple) {
this.topStyle = "rgba(38, 128, 235, 0.4)";
}
},
leaveCard() {
this.topStyle = "rgba(38, 128, 235, 0.2)";
},
tdStyle(val) {
//动态根据状态值加载状态值对应的颜色
let temDic = this.$store.getters.dictionaryByKey("taskList.status");
this.life = "";
temDic.forEach((s) => {
if (Number(s.code) == val) {
this.life = s.color;
}
});
},
clickCard(value) {
console.log(value);
//点击整个card //点击整个card
this.isCard = !this.isCard; this.isCard = !this.isCard;
this.single = !this.single; this.single = !this.single;
}, },
singleChange(v, columns) { singleChange(v, rows) {
console.log(v, rows);
//checkbox //checkbox
event.stopPropagation(); event.stopPropagation();
}, },
...@@ -158,28 +209,29 @@ export default { ...@@ -158,28 +209,29 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" >
.cardBox { .cardBox {
min-height: 310px;
box-sizing: border-box; box-sizing: border-box;
width: 498px;
background: #ffffff; background: #ffffff;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
border-radius: 8px; border-radius: 8px;
margin-bottom: 15px; // margin-bottom: 15px;
.topCard { .topCard {
height: 40px; height: 40px;
background: rgba(38, 128, 235, 0.2); // background: rgba(38, 128, 235, 0.2);
border-radius: 8px 8px 0px 0px; border-radius: 8px 8px 0px 0px;
border-bottom: 1px dashed #2680eb; border-bottom: 1px dashed #2680eb;
.checkSingle { .checkSingle {
margin-left: 16px; margin-left: 16px;
// margin-right: 24px;
} }
.titleName { .titleName {
width: 190px; // width: 190px;
min-width: 190px;
} }
.topCount { .topCount {
max-width: 205px; // max-width: 205px;
min-width: 205px;
} }
/* css3绘制三角形 */ /* css3绘制三角形 */
.triangle { .triangle {
...@@ -187,17 +239,20 @@ export default { ...@@ -187,17 +239,20 @@ export default {
height: 0px; height: 0px;
border-width: 20px; border-width: 20px;
border-style: solid; /*定义的是实现边框*/ border-style: solid; /*定义的是实现边框*/
border-color: transparent;
border-radius: 4px; border-radius: 4px;
transform: rotate(-90deg); transform: rotate(-90deg);
right: 0; right: 0;
top: 0; top: 0;
} }
.triangleName { .triangleName {
right: -5px; right: -3px;
top: -1px; top: -3px;
transform: rotate(45deg); transform: rotate(45deg);
color: #ffffff; color: #ffffff;
.ib > span {
font-size: 12px;
}
} }
} }
.countCard { .countCard {
...@@ -252,9 +307,9 @@ export default { ...@@ -252,9 +307,9 @@ export default {
} }
.cardBox:hover { .cardBox:hover {
box-shadow: 0px 0px 10px rgba(38, 128, 235, 0.4); box-shadow: 0px 0px 10px rgba(38, 128, 235, 0.4);
.topCard { // .topCard {
background: rgba(38, 128, 235, 0.4); // background: rgba(38, 128, 235, 0.4);
} // }
} }
.borderCss { .borderCss {
border: 2px solid #2680eb; border: 2px solid #2680eb;
......
...@@ -2,19 +2,18 @@ ...@@ -2,19 +2,18 @@
<div <div
class="rightM flex" class="rightM flex"
:class="{ mr10: num == 1 }" :class="{ mr10: num == 1 }"
v-if="rightM" v-if="rightM && rightList"
@mouseleave="outPut" @mouseleave="outPut"
> >
<slot> <slot >
<op <op v-if="rightList && rightList.slice(0, num).length > 0"
v-for="(v, i) in data.slice(0, num)" v-for="(v, i) in rightList.slice(0, num)"
:key="i" :key="i"
:title="v.name" :title="v.name"
:type="v.type" :type="v.type"
:msg="v.msg" :msg="v.msg"
:disable="v.disable" :disable="v.disable"
@click="v.click(row,$event)" @click="v.click(row,$event)"
v-if="data && data.slice(0, num).length > 0"
> >
<Icon :type="v.icon==null || v.icon==undefined ? 'ios-paper':v.icon" v-if="v.type=='icon'|| v.type=='' || v.type==undefined || v.type==null "/> <Icon :type="v.icon==null || v.icon==undefined ? 'ios-paper':v.icon" v-if="v.type=='icon'|| v.type=='' || v.type==undefined || v.type==null "/>
<span v-if="v.name"> <span v-if="v.name">
...@@ -24,20 +23,20 @@ ...@@ -24,20 +23,20 @@
<span <span
class="elliPsis fwBold" class="elliPsis fwBold"
slot="elliPsis" slot="elliPsis"
v-if="data && data.length > num > 0" v-if="rightList && rightList.length > num > 0"
> >
<span :class="{ hide: inlines, mr10: !inlines }" @mouseenter="inFo" <span :class="{ hide: inlines, mr10: !inlines }" @mouseenter="inFo"
>•••</span > >•••</span >
<span class="mr10" :class="{ inline: inlines, hide: !inlines }"> <span class="mr10" :class="{ inline: inlines, hide: !inlines }">
<op <op
v-for="(value, index) in data.slice(num)" v-for="(value, index) in rightList.slice(num)"
:key="index" :key="index"
:title="value.name" :title="value.name"
:type="value.type" :type="value.type"
:msg="value.msg" :msg="value.msg"
:disable="value.disable" :disable="value.disable"
@click="value.click(row,$event)" @click="value.click(row,$event)"
v-if="data && data.slice(num).length >= num" v-if="rightList && rightList.slice(num).length >= num"
> >
<Icon :type="value.icon==''?'ios-paper':value.icon" v-if="value.type=='icon'|| value.type=='' || value.type==undefined || value.type==null"/> <Icon :type="value.icon==''?'ios-paper':value.icon" v-if="value.type=='icon'|| value.type=='' || value.type==undefined || value.type==null"/>
<span v-if="value.name"> <span v-if="value.name">
...@@ -59,11 +58,11 @@ export default { ...@@ -59,11 +58,11 @@ export default {
}, },
props: { props: {
row: { row: {
type: [Array, Object], type:[Object,Array],
default: [], default: []
}, },
data: { rightList: {
type: Array, type:[Object,Array],
default: [], default: [],
}, },
num: { num: {
...@@ -77,19 +76,12 @@ export default { ...@@ -77,19 +76,12 @@ export default {
}, },
mounted() { mounted() {
// console.log("$slots",this.$slots,this.$slots.default) // console.log("$slots",this.$slots,this.$slots.default)
// if(this.data.length>0){
// this.data.map(v=>{
// if(v.icon='')
// })
// }
console.log(this.data.slice(0, this.num));
}, },
methods: { methods: {
inFo() { inFo() {
this.inlines = true; this.inlines = true;
}, },
outPut() { outPut() {
// console.log(this.inlines)
this.inlines = false; this.inlines = false;
}, },
}, },
...@@ -103,13 +95,5 @@ export default { ...@@ -103,13 +95,5 @@ export default {
.elliPsis { .elliPsis {
color: #2680eb; color: #2680eb;
} }
// .elliPsis:hover {
// .showMore {
// display: inline-block;
// }
// .elliPsisSpan {
// display: none;
// }
// }
} }
</style> </style>
\ No newline at end of file
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
ref="grid" ref="grid"
:batch="false" :batch="false"
:type="typeInfo" :type="typeInfo"
:span="8" :span="6"
:lazy="true" :lazy="true"
:conditions="easySearch" :conditions="easySearch"
:action="action" :action="action"
:gutter="40" :gutter="10"
> >
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
></Button> ></Button>
</template> </template>
<template slot="card" slot-scope="{ row }"> <template slot="card" slot-scope="{ row }" >
<!-- <div <div
class="body" class="body"
@click=" @click="
toExecute( toExecute(
...@@ -161,41 +161,40 @@ ...@@ -161,41 +161,40 @@
</Col> </Col>
</Row> </Row>
</div> </div>
</div> --> </div>
<!-- <Vcard
<Vcard :multiple="multiple" :img="img" :leftBottom="leftBottom"> v-if='row'
<template slot="title"> :row='row'
{{ row.productName }} :img="img"
</template> :srcImg='row.productUrl'
<template slot="topCount"> :title="row.productName"
{{ row.mesCode }} :subtitle="row.mesCode"
</template> :lifeCode="row.status"
<template slot="img"> :leftOneName='row.drawnNumber'
<img :src="downUrl + row.productUrl" v-if="row.productUrl" /> >
</template>
<template slot="fileLine"> <template slot="fileLine">
<Filed :span="24" name="开始时间:"> <Filed :span="24" :name="l('beginTime')">
{{ row.beginTime }} {{ row.beginTime }}
</Filed> </Filed>
<Filed :span="24" name="计划结束时间:"> <Filed :span="24" :name="l('endTime')">
{{ row.endTime }} {{ row.endTime }}
</Filed> </Filed>
<Filed :span="14" name="生产数量:"> <Filed :span="12" :name="l('quantity')">
{{ row.quantity }} {{ row.quantity }}
</Filed> </Filed>
<Filed :span="8" name="工序号:"> <Filed :span="12" name="工序号:">
{{ row.taskSeq }} {{ row.taskSeq }}
</Filed> </Filed>
<Filed :span="24" name="工序名称:"> <Filed :span="24" name="工序名称:">
{{ row.taskName }} {{ row.taskName }}
</Filed> </Filed>
</template> </template> -->
<template slot="leftBottom"> 图号:{{ row.drawnNumber }} </template> <!-- <template slot="leftBottom"> 图号:{{ row.drawnNumber }} </template> -->
<template slot="rightBottom"> <!-- <template slot="rightBottom">
<RightM :num="100" :rightM="rightBottom" :data="buttons" :row="row"> <RightM :num="num" :rightM="rightBottom" :rightList="buttons" :row="row">
</RightM> </RightM>
</template> </template> -->
</Vcard> <!-- </Vcard> -->
</template> </template>
</DataGrid> </DataGrid>
</div> </div>
...@@ -211,10 +210,10 @@ export default { ...@@ -211,10 +210,10 @@ export default {
}, },
data() { data() {
return { return {
num: 2, num: 2,
span: "9", span: "9",
rightBottom: true, rightBottom: true,
leftBottom: true,
multiple: false, multiple: false,
img: true, img: true,
action: Api.index, action: Api.index,
...@@ -431,6 +430,8 @@ export default { ...@@ -431,6 +430,8 @@ export default {
}); });
}, },
tdStyle(val) { tdStyle(val) {
console.log(val);
// debugger
//动态根据状态值加载状态值对应的颜色 //动态根据状态值加载状态值对应的颜色
let temDic = this.$store.getters.dictionaryByKey("taskList.status"); let temDic = this.$store.getters.dictionaryByKey("taskList.status");
let temColor = "#666"; let temColor = "#666";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment