Commit 6c11c918 authored by luo ying's avatar luo ying

修改组建查看编辑删除

parent ce86c9dc
......@@ -2,7 +2,7 @@
<span class="btnStyle">
<span
class="mr20"
@click="lookBtn(id,$event)"
@click="lookBtn($event)"
:class="{
bor: borders,
small: bigBox == 'small',
......@@ -18,13 +18,10 @@
<script>
export default {
// name: "",
data() {
return {};
},
props: {
id:Number,String,
default: null,
type: String,
default: "default",
valueName: String,
......@@ -50,12 +47,9 @@ export default {
return "#515a6e";
}
},
lookBtn(id,event) {
let a={
id:id,
event:event
}
this.$emit('click', a);
lookBtn(event) {
// console.log("btnBi",event)
this.$emit('click',event);
event.stopPropagation();
},
},
......
......@@ -65,23 +65,27 @@
<div v-if="leftBottom">
<span class="earlyWarn f14 fwBold mr20">
<slot name="leftBottom">
<Icon :type="columns.oneIcon" class="iconStyle" />{{ columns.leftT1 }}
<Icon :type="columns.oneIcon" class="iconStyle" />{{
columns.leftT1
}}
<!-- v-show="leftBtmicon" -->
</slot>
</span>
<span class="overdue f14 fwBold mr20">
<slot name="leftBottom2">
<Icon :type="columns.twoIcon" class="iconStyle" />{{ columns.leftT2 }}
<Icon :type="columns.twoIcon" class="iconStyle" />{{
columns.leftT2
}}
<!-- v-show="leftBtmicon2" -->
</slot>
</span>
</div>
<!-- v-if="rightBottom"-->
<span class="rightMore" >
<span class="rightMore">
<slot name="rightBottom">
<RightM :num='num' :rightM='rightBottom' :id='id'>
<slot ></slot>
</RightM>
<RightM :num="num" :rightM="rightBottom" >
<slot></slot>
</RightM>
</slot>
</span>
</div>
......@@ -104,10 +108,10 @@ export default {
};
},
props: {
// columns: {
// type: Object,
// default: {},
// },
// datas:{
// type:Array,
// default: [],
// },
multiple: {
type: Boolean,
default: false,
......@@ -130,43 +134,24 @@ export default {
type: Boolean,
default: false,
},
num:Number,
id:Number,String,
default: null,
// leftBtmicon:{//底部左侧图标
// type: Boolean,
// default: false,
// },
// leftBtmicon2:{
// type: Boolean,
// default: false,
num:{
type: Number,
default: 0,
},
// row: {
// type:[Array,Object],
// default: [],
// },
},
created() {
// this.columns=this.row
// console.log("传过来的值:", this.columns);
},
created() {},
methods: {
lookBtn(id) {
console.log("详情", id);
event.stopPropagation();
},
editBtn(id) {
console.log("编辑", id);
event.stopPropagation();
},
delBtn(id) {
console.log("删除", id);
event.stopPropagation();
},
clickCard(columns) {
//点击整个card
console.log(columns);
this.isCard = !this.isCard;
this.single = !this.single;
},
singleChange(v, columns) {
console.log(v, columns);
//checkbox
event.stopPropagation();
},
},
......@@ -257,9 +242,7 @@ export default {
}
.rightMore {
margin-left: auto;
}
}
}
img {
......
......@@ -68,7 +68,6 @@ export default {
delete: "删除",
remove: "删除"
};
if (oprates[this.oprate]) {
this.text = oprates[this.oprate];
this.css = this.oprate;
......@@ -89,7 +88,7 @@ export default {
methods: {
handler() {
if (this.disable == 0) {
if (this.oprate == "delete" || this.oprate == "remove") {
if (this.oprate == "delete" || this.oprate == "remove"||this.msg.length>0) {
this.$Modal.confirm({
title: this.title,
content: "<p>" + this.msg + "</p>",
......
<template>
<div class="rightM" v-if="rightM" @mouseleave="outPut">
<slot v-if="false"> </slot>
<BtnBox
@click="lookBtn()"
v-if="btnBoxList && btnBoxList.length > 0"
:borders="btnBoxList[0].borders"
:valueName="btnBoxList[0].valueName"
:type="btnBoxList[0].type"
:iconFont="btnBoxList[0].iconFont"
></BtnBox>
<span class=" elliPsis fwBold" slot="elliPsis" v-if="btnBoxList && btnBoxList.length > 1" >
<span :class="{hide:inlines,mr10:!inlines}" @mouseenter="inFo">•••</span>
<span class="mr10" :class='{inline:inlines,hide:!inlines}' >
<BtnBox
@click="lookBtn(a)"
v-for="(value, index) in btnBoxList"
v-if="index"
:key="index"
:borders="value.borders"
:valueName="value.valueName"
:type="value.type"
:iconFont="value.iconFont"
></BtnBox>
<div
class="rightM flex"
:class="{ mr10: num == 1 }"
v-if="rightM"
@mouseleave="outPut"
>
<slot>
<op
v-for="(v, i) in data.slice(0, num)"
:key="i"
:title="v.name"
:type="v.type"
:msg="v.msg"
:disable="v.disable"
@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 "/>
<span v-if="v.name">
{{ v.name }}
</span>
</op>
<span
class="elliPsis fwBold"
slot="elliPsis"
v-if="data && data.length > num > 0"
>
<span :class="{ hide: inlines, mr10: !inlines }" @mouseenter="inFo"
>•••</span >
<span class="mr10" :class="{ inline: inlines, hide: !inlines }">
<op
v-for="(value, index) in data.slice(num)"
:key="index"
:title="value.name"
:type="value.type"
:msg="value.msg"
:disable="value.disable"
@click="value.click(row,$event)"
v-if="data && data.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"/>
<span v-if="value.name">
{{ value.name }}
</span>
</op>
</span>
</span>
</span>
</slot>
</div>
</template>
<script>
export default {
// name: '',
data() {
return {
inlines:false,
inlines: false,
btnBoxList: [],
};
},
props: {
id: Number,
String,
default: null,
num: Number,
default: 0,
rightM: Boolean,
default: true,
row: {
type: [Array, Object],
default: [],
},
data: {
type: Array,
default: [],
},
num: {
type: Number,
default: 0,
},
rightM: {
type: Boolean,
default: true,
},
},
mounted() {
// console.log("$slots",this.$slots,this.$slots.default)
if (this.$slots && this.$slots.default.length > 0) {
this.btnBoxList = [];
let listSolt = this.$slots.default;
listSolt.map((v) => {
if (v.componentOptions && v.componentOptions.tag == "BtnBox") {
let obj = {
id: v.componentOptions.propsData.id,
borders: v.componentOptions.propsData.borders,
iconFont: v.componentOptions.propsData.iconFont,
type: v.componentOptions.propsData.type,
valueName: v.componentOptions.propsData.valueName,
};
this.btnBoxList.push(obj);
}
// console.log("componentOptions",v.componentOptions)
});
console.log("btnBoxList", this.btnBoxList);
}
// if(this.data.length>0){
// this.data.map(v=>{
// if(v.icon='')
// })
// }
console.log(this.data.slice(0, this.num));
},
methods: {
lookBtn(event) {
console.log("1111111111111111111111", event);
// this.$emit('click', event);
inFo() {
this.inlines = true;
},
inFo(){
this.inlines=true;
outPut() {
// console.log(this.inlines)
this.inlines = false;
},
outPut(){
console.log(this.inlines)
this.inlines=false;
}
},
};
</script>
......@@ -88,13 +103,13 @@ export default {
.elliPsis {
color: #2680eb;
}
// .elliPsis:hover {
// .showMore {
// display: inline-block;
// }
// .elliPsisSpan {
// display: none;
// }
// }
// .elliPsis:hover {
// .showMore {
// display: inline-block;
// }
// .elliPsisSpan {
// display: none;
// }
// }
}
</style>
\ No newline at end of file
......@@ -99,9 +99,7 @@
v-if="item.chai"
></op>
</div>
<div class="content">数量:{{ item.quantity }}</div>
<div v-show="item.userIds" class="content">
人员:
<span v-for="(u, j) in item.userIds" :key="j">
......
......@@ -192,26 +192,7 @@
</template>
<template slot="leftBottom"> 图号:{{ row.drawnNumber }} </template>
<template slot="rightBottom">
<RightM :num="num" :rightM="rightBottom" :id="row.id">
<BtnBox
:borders="true"
:valueName="`查看`"
:type="`success`"
:iconFont="`ios-create-outline`"
></BtnBox>
<BtnBox
:borders="true"
:valueName="`编辑`"
:type="`success`"
:iconFont="`ios-create-outline`"
></BtnBox>
<BtnBox
:borders="true"
:valueName="`删除`"
:type="`success`"
:iconFont="`ios-create-outline`"
></BtnBox>
<RightM :num="100" :rightM="rightBottom" :data="buttons" :row="row">
</RightM>
</template>
</Vcard>
......@@ -230,13 +211,70 @@ export default {
},
data() {
return {
num: 3,
num: 2,
span: "9",
rightBottom: true,
leftBottom: true,
multiple: false,
img: true,
action: Api.index,
buttons: [
{
name: "查看",
msg: "",
// type: "",
disable: false,
icon: "ios-paper",
click: (v,event) => {
console.log("add", v,event);
event.stopPropagation();
},
},
{
name: "编辑",
type: "icon",
msg: "",
disable: false,
icon: "ios-create-outline",
click: (v,event) => {
console.log("edit", v,event);
event.stopPropagation();
},
},
{
type: "icon",
name: "删除",
msg: "34534534",
disable: false,
icon: "ios-trash-outline",
click: (v,event) => {
console.log("del",v,event);
event.stopPropagation();
},
},
{
name: "导入",
type: "icon",
msg: "",
disable: false,
icon: "ios-create-outline",
click: (v,event) => {
console.log("1", v,event);
event.stopPropagation();
},
},
{
name: "导出",
type: "icon",
msg: "",
disable: false,
icon: "ios-create-outline",
click: (v,event) => {
console.log("2",v,event);
event.stopPropagation();
},
},
],
easySearch: {
keys: {
op: "mesCode,productName,drawnNumber",
......@@ -360,9 +398,6 @@ export default {
this.search();
},
methods: {
// lookBtn(a){
// console.log('dfsdfsdfsdfsd',a)
// },
search() {
this.$refs.grid.reload(this.easySearch);
},
......
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