Commit b9dee450 authored by 康振飞's avatar 康振飞

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product

parents 158623c0 f665ed86
<!--一次可上传多个文件 --> <!--一次可上传多个文件 -->
<template> <template>
<div> <div>
<div v-show="showList">
<Upload <Upload
:action="postUrl" :action="postUrl"
:on-success="uploadSuccess" :on-success="uploadSuccess"
...@@ -26,9 +27,10 @@ ...@@ -26,9 +27,10 @@
>文件格式:{{formatList.join()}};文件最大:{{maxSize}}k</span> >文件格式:{{formatList.join()}};文件最大:{{maxSize}}k</span>
</Upload> </Upload>
<Progress :percent="per" :stroke-width="5" v-show="vshowPro" /> <Progress :percent="per" :stroke-width="5" v-show="vshowPro" />
</div>
<div v-if="Photo"> <div v-if="Photo">
<Tag <Tag
v-for="(item,index) in nameList" v-for="(item,index) in nameList"
:key="index" :key="index"
:name="item.id" :name="item.id"
...@@ -51,7 +53,7 @@ ...@@ -51,7 +53,7 @@
<template> <template>
<img :src="downUrl+item.filePath" /> <img :src="downUrl+item.filePath" />
</template> </template>
<div class="demo-upload-list-cover"> <div class="demo-upload-list-cover" v-show="showList">
<Icon type="ios-eye" @click.native="seeFile(item.filePath)"></Icon> <Icon type="ios-eye" @click.native="seeFile(item.filePath)"></Icon>
<Icon type="ios-trash-outline" @click.native="handleClose2($event,item.id)"></Icon> <Icon type="ios-trash-outline" @click.native="handleClose2($event,item.id)"></Icon>
</div> </div>
...@@ -80,6 +82,7 @@ export default { ...@@ -80,6 +82,7 @@ export default {
per: 0, per: 0,
vshowPro: false, vshowPro: false,
Photo: true, Photo: true,
showList: true,
isactive: 0 isactive: 0
}; };
}, },
...@@ -118,6 +121,10 @@ export default { ...@@ -118,6 +121,10 @@ export default {
Photos: { Photos: {
type: Boolean, type: Boolean,
default: false default: false
},
showList: {
type: Boolean,
default: true
} }
}, },
methods: { methods: {
...@@ -245,7 +252,7 @@ export default { ...@@ -245,7 +252,7 @@ export default {
//查询上传到文件服务器上的文件 //查询上传到文件服务器上的文件
this.$http.sysUser.getFile(this.parms).then(res => { this.$http.sysUser.getFile(this.parms).then(res => {
if (res.data != [] && res.data.length > 0) { if (res.data != [] && res.data.length > 0) {
var items=[] var items = [];
res.data.forEach(data => { res.data.forEach(data => {
let objImag = {}; let objImag = {};
objImag.fileName = data.fileName; objImag.fileName = data.fileName;
...@@ -253,7 +260,7 @@ export default { ...@@ -253,7 +260,7 @@ export default {
objImag.id = data.id; objImag.id = data.id;
items.push(objImag); items.push(objImag);
}); });
this.nameList=items; this.nameList = items;
} }
}); });
}, },
...@@ -318,8 +325,8 @@ export default { ...@@ -318,8 +325,8 @@ export default {
this.nameList = []; this.nameList = [];
this.nameList = v; this.nameList = v;
}, },
"parms.eid"(v){ "parms.eid"(v) {
if(v){ if (v) {
this.intFiles(); this.intFiles();
} }
} }
...@@ -327,8 +334,7 @@ export default { ...@@ -327,8 +334,7 @@ export default {
mounted() { mounted() {
this.formatL(); this.formatL();
this.mutipleStatu(); this.mutipleStatu();
if(this.parms.eid){ if (this.parms.eid) {
this.intFiles(); this.intFiles();
} }
if (this.Photos === true) { if (this.Photos === true) {
......
<template> <template>
<div class="product-mix"> <div class="product-mix">
<Layout> <Layout>
<Sider width="300"> <Sider width="300" v-if="showMenu">
<!-- <h4>产品列表</h4> -->
<div class="p-list"> <div class="p-list">
<!-- <Input search enter-button placeholder="请输入产品名称" /> -->
<ProductTree @on-hide="onHide" @on-select="productSearch" /> <ProductTree @on-hide="onHide" @on-select="productSearch" />
</div> </div>
</Sider> </Sider>
<Content> <div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" />
</a>
</div>
<Content :class="!showMenu?'con_bord':''">
<Product :parent="parent" /> <Product :parent="parent" />
</Content> </Content>
</Layout> </Layout>
...@@ -28,10 +31,15 @@ export default { ...@@ -28,10 +31,15 @@ export default {
id: null, id: null,
parentName: "", parentName: "",
ids: "" ids: ""
} },
showMenu: true
}; };
}, },
methods: { methods: {
showMenuFn() {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
productSearch(id, item, ids) { productSearch(id, item, ids) {
this.parent.parentName = item.title; this.parent.parentName = item.title;
this.parent.id = id; this.parent.id = id;
...@@ -49,11 +57,12 @@ export default { ...@@ -49,11 +57,12 @@ export default {
<style lang="less" > <style lang="less" >
.product-mix { .product-mix {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
height: 84vh;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 87vh;
h4 { h4 {
height: 30px; height: 30px;
...@@ -61,17 +70,39 @@ export default { ...@@ -61,17 +70,39 @@ export default {
background: #eee; background: #eee;
padding-left: 10px; padding-left: 10px;
} }
// .p-list { }
// // padding: 10px; .show_menu {
// overflow: auto; width: 30px;
// } height: 30px;
position: fixed;
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px;
height: 30px;
line-height: 34px;
font-size: 14px;
text-align: center;
color: #515a6e;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover {
background-color: #2d8cf0;
color: white;
}
} }
.ivu-layout-content { .ivu-layout-content {
margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
height: 87vh;
overflow-y: hidden;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -10,9 +10,18 @@ ...@@ -10,9 +10,18 @@
<Filed :span="12" :name="l('madeCompany')">{{entity.madeCompanyTitle}}</Filed> <Filed :span="12" :name="l('madeCompany')">{{entity.madeCompanyTitle}}</Filed>
<!-- <Filed :span="12" :name="l('extend')">{{entity.extend}}</Filed> --> <!-- <Filed :span="12" :name="l('extend')">{{entity.extend}}</Filed> -->
<Filed :span="24" :name="l('productUrl')"> <Filed :span="24" :name="l('productUrl')">
<a href="#" @click="seeImg(entity.productUrl)">{{entity.productUrl}}</a> <a href="#" @click="seeImg(entity.productUrl)">查看图片</a>
</Filed>
<Filed :span="24" :name="l('productUrlList')">
<files
ref="refFile"
:parms="parms"
fileFormat
:Photos="true"
:showList="false"
@clickItem="clickData"
/>
</Filed> </Filed>
<Filed :span="24" :name="l('productUrlList')">{{entity.productUrlList}}</Filed>
</Row> </Row>
</div> </div>
</template> </template>
...@@ -26,6 +35,12 @@ export default { ...@@ -26,6 +35,12 @@ export default {
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }] code: [{ required: true, message: "必填", trigger: "blur" }]
},
parms: {
app: "technology",
eid: "",
name: "",
field: ""
} }
}; };
}, },
...@@ -38,12 +53,20 @@ export default { ...@@ -38,12 +53,20 @@ export default {
} }
}, },
methods: { methods: {
clickData(data) {
window.open(data, "_blank");
},
seeImg(url) { seeImg(url) {
if (url) {
window.open(url, "_blank"); window.open(url, "_blank");
} else {
this.$Message.error("暂无图片");
}
}, },
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
this.entity = r.result; this.entity = r.result;
this.parms.eid = r.result.productUrlList;
this.$emit("on-load"); this.$emit("on-load");
}); });
}, },
...@@ -64,3 +87,8 @@ export default { ...@@ -64,3 +87,8 @@ export default {
} }
}; };
</script> </script>
<style lang="less" >
.detail .upload-body {
border: none;
}
</style>
\ No newline at end of file
...@@ -117,6 +117,7 @@ export default { ...@@ -117,6 +117,7 @@ export default {
methods: { methods: {
clickData(data) { clickData(data) {
this.img = data; this.img = data;
this.entity.productUrl = data;
}, },
handleSelect1(data) { handleSelect1(data) {
if (data.length > 0) { if (data.length > 0) {
......
...@@ -40,12 +40,12 @@ ...@@ -40,12 +40,12 @@
<Col span="17" class="c"> <Col span="17" class="c">
<div>产品分类:{{row.productClass}}</div> <div>产品分类:{{row.productClass}}</div>
<div>图号:{{row.drawingNo}}</div> <div>图号:{{row.drawingNo}}</div>
<div>主制单位:{{row.madeCompany}}</div> <div>主制单位:{{row.madeCompanyTitle}}</div>
<p class="a-icon"> <p class="a-icon">
<a @click="edit(row.id)"> <a @click="edit(row.id)">
<Icon type="md-create" />编辑 <Icon type="md-create" />编辑
</a>&nbsp; </a>&nbsp;
<a @click="remove(row.id)"> <a @click="remove(row)">
<Icon type="ios-trash" />删除 <Icon type="ios-trash" />删除
</a>&nbsp; </a>&nbsp;
<a @click="view(row.id)"> <a @click="view(row.id)">
...@@ -143,14 +143,23 @@ export default { ...@@ -143,14 +143,23 @@ export default {
this.detail = () => import("./edit"); this.detail = () => import("./edit");
this.modal = true; this.modal = true;
}, },
remove(id) { remove(row) {
Api.delete(id).then(r => { this.$Modal.confirm({
title: "删除",
content: "<p>您确定要删除此产品吗?</p>",
onOk: () => {
Api.delete(row.id).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.$Message.success("删除成功"); this.$Message.success("删除成功");
} }
}); });
}, },
onCancel: () => {
this.$Message.success("取消删除");
}
});
},
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false; this.modal = false;
......
<template> <template>
<div class="flex fd tree-menu"> <div class="flex fd tree-menu">
<h3> <h3>
产品列表 产品分类
<div class="fr mr10 mt10"> <div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small"> <ButtonGroup class="fr" size="small">
<Button icon="md-add" title="新增顶级" @click="addNew"></Button> <Button icon="md-add" title="新增顶级" @click="addNew"></Button>
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
} }
.fg { .fg {
flex: none; flex: none;
// height:0; height: 100%;
overflow: auto; overflow: auto;
padding-left: 10px; padding-left: 10px;
} }
......
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