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

修改组建查看编辑删除

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