Commit 44161d59 authored by 仇晓婷's avatar 仇晓婷

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

parents 71e80862 f665ed86
...@@ -193,7 +193,12 @@ ...@@ -193,7 +193,12 @@
.ivu-input { .ivu-input {
font-size: 14px; font-size: 14px;
} }
.ivu-select-dropdown-list{
.ivu-select-item:hover {
color: white;
background-color: #2d8cf0;
}
}
.ivu-form-item { .ivu-form-item {
margin-bottom: 16px; margin-bottom: 16px;
vertical-align: top; vertical-align: top;
......
<!--一次可上传多个文件 --> <!--一次可上传多个文件 -->
<template> <template>
<div> <div>
<Upload <div v-show="showList">
:action="postUrl" <Upload
:on-success="uploadSuccess" :action="postUrl"
:on-error="uploadError" :on-success="uploadSuccess"
:on-remove="removeFile" :on-error="uploadError"
:format="formatList" :on-remove="removeFile"
:max-size="maxSize" :format="formatList"
:show-upload-list="false" :max-size="maxSize"
:on-exceeded-size="onExceededSize" :show-upload-list="false"
:on-format-error="onFormatError" :on-exceeded-size="onExceededSize"
:multiple="multiple" :on-format-error="onFormatError"
:style="style" :multiple="multiple"
:on-progress="onProgress" :style="style"
> :on-progress="onProgress"
<div style="padding: 20px 0;text-align:center" v-if="cloudIco"> >
<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon> <div style="padding: 20px 0;text-align:center" v-if="cloudIco">
<p>将文件拖到此处,或点击上传</p> <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
</div> <p>将文件拖到此处,或点击上传</p>
<Button icon="ios-cloud-upload-outline" v-if="!cloudIco">上传文件</Button> </div>
<span <Button icon="ios-cloud-upload-outline" v-if="!cloudIco">上传文件</Button>
style="font-size:10px;color:#aaa" <span
v-if="fileFormat" style="font-size:10px;color:#aaa"
>文件格式:{{formatList.join()}};文件最大:{{maxSize}}k</span> v-if="fileFormat"
</Upload> >文件格式:{{formatList.join()}};文件最大:{{maxSize}}k</span>
<Progress :percent="per" :stroke-width="5" v-show="vshowPro" /> </Upload>
<div v-if="Photo"> <Progress :percent="per" :stroke-width="5" v-show="vshowPro" />
<Tag </div>
v-for="(item,index) in nameList" <div v-if="Photo">
:key="index" <Tag
:name="item.id" v-for="(item,index) in nameList"
:closable="!unClosable" :key="index"
@on-close="handleClose2" :name="item.id"
checkable :closable="!unClosable"
> @on-close="handleClose2"
<a :href="fileUrlPath" @click="downFile(item.filePath)" target="_blank">{{item.fileName}}</a> checkable
</Tag> >
<a :href="fileUrlPath" @click="downFile(item.filePath)" target="_blank">{{item.fileName}}</a>
</Tag>
</div> </div>
<div class="upload-body" v-else> <div class="upload-body" v-else>
<div <div
...@@ -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,9 +334,8 @@ export default { ...@@ -327,9 +334,8 @@ 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) {
this.Photo = false; this.Photo = false;
......
<template> <template>
<div class="account"> <div class="account">
<Carousel v-model="value1" autoplay :autoplay-speed="5000" loop class="zmd"> <Carousel v-model="value1" autoplay :autoplay-speed="5000" loop class="zmd">
<!-- <CarouselItem>
<div class="bg bg0">1</div>
</CarouselItem>-->
<CarouselItem> <CarouselItem>
<div class="bg bg1">1</div> <div class="bg bg1"></div>
</CarouselItem> </CarouselItem>
<CarouselItem> <CarouselItem>
<div class="bg bg2">1</div> <div class="bg bg2"></div>
</CarouselItem> </CarouselItem>
<CarouselItem> <CarouselItem>
<div class="bg bg3">1</div> <div class="bg bg3"></div>
</CarouselItem> </CarouselItem>
</Carousel> </Carousel>
<!-- <div v-if="showI18n" class="page-account-header">
<i-header-i18n />
</div>-->
<div class="main"> <div class="main">
<div class="ad"> <div class="ad">
<img src="@/assets/images/login/ad.png" /> <div class="page_log">
<img class="img" src="@/assets/images/login/jz_logo.png" alt="logo" />
</div>
<img src="@/assets/images/login/ivew01.png" alt=""/>
</div> </div>
<div class="login"> <div class="login">
<div class="cen"> <div class="cen">
<div class="page-account-top"> <div class="log_code_box">
<div class="page-account-top-logo tc"> <div class="log_code">
<img src="@/assets/images/logo.png" alt="logo" /> <img src="@/assets/images/login/erwei.jpg" alt="logoCode" />
<img src="@/assets/images/login/sanjiao.png" alt="" class="sanjiao" />
</div> </div>
<!-- <div class="page-account-top-desc tc">SaaS MES 制造执行系统</div> -->
</div> </div>
<h3 class="mb20">用户登陆</h3> <h2 class="mb20">登 录</h2>
<Login @on-submit="handleSubmit"> <Login @on-submit="handleSubmit">
<UserName name="username" value="" /> <UserName name="username" value="" />
<Password name="password" value="" enter-to-submit /> <Password name="password" value="" enter-to-submit />
<div class="page-account-auto-login mb20"> <!-- <div class="page-account-auto-login mb20">
<Checkbox v-model="autoLogin">{{ $t('page.login.remember') }}</Checkbox> <Checkbox v-model="autoLogin">{{ $t('page.login.remember') }}</Checkbox>
<a href>{{ $t('page.login.forgot') }}</a> <a href>{{ $t('page.login.forgot') }}</a>
</div> </div> -->
<div class="mt20"> <div class="mt20">
<Submit class="shadown">{{ $t('page.login.submit') }}</Submit> <Submit class="shadown">{{ $t('page.login.submit') }}</Submit>
</div> </div>
...@@ -140,43 +137,61 @@ export default { ...@@ -140,43 +137,61 @@ export default {
background-size: 100% auto; background-size: 100% auto;
} }
.bg0 { .bg0 {
background-image: url("../../../assets/images/login/bg0.png"); background-image: url("../../../assets/images/login/login01.png");
} }
.bg1 { .bg1 {
background-image: url("../../../assets/images/login/bg1.jpg"); background-image: url("../../../assets/images/login/login01.png");
} }
.bg2 { .bg2 {
background-image: url("../../../assets/images/login/bg2.jpg"); background-image: url("../../../assets/images/login/login01.png");
} }
.bg3 { .bg3 {
background-image: url("../../../assets/images/login/bg3.jpg"); background-image: url("../../../assets/images/login/login01.png");
} }
.main { .main {
position: absolute; position: absolute;
z-index: 55; z-index: 55;
top: @jianju; top: 168px;
left: @jianju; bottom: 168px;
right: @jianju; left: 360px;
bottom: @jianju; right: 360px;
background: rgba(38, 128, 235, 0.3); background: url("../../../assets/images/login/login02.jpg") no-repeat -177px -16px;
background-size: 94%;
display: flex; display: flex;
.ad { .ad {
flex: 1; flex: 1;
text-align: center; text-align: center;
img { .page_log{
margin-top:26%; display: block;
width: 304px;
height: 72px;
} }
.img { margin-top:30px; }
img { margin-top:23%; }
} }
.login { .login {
background-color: white; background-color: white;
width: 600px; width: 420px;
padding: 0 90px; padding: 0 50px;
display: flex; display: flex;
align-items: center; // align-items: center;
flex-direction: row; flex-direction: row;
.cen { .cen {
width: 100%; width: 100%;
margin-top: -50px; .log_code_box{
text-align: right;
height: 130px;
margin: 0 -50px 0 0;
.log_code{
width: 100px;
float: right;
.sanjiao{
position: absolute;
right: 0px;
top: 0px;
}
}
}
.ivu-input-wrapper { .ivu-input-wrapper {
margin-bottom: 5px; margin-bottom: 5px;
} }
......
<template>
<div class="account">
<Carousel v-model="value1" autoplay :autoplay-speed="5000" loop class="zmd">
<!-- <CarouselItem>
<div class="bg bg0">1</div>
</CarouselItem>-->
<CarouselItem>
<div class="bg bg1">1</div>
</CarouselItem>
<CarouselItem>
<div class="bg bg2">1</div>
</CarouselItem>
<CarouselItem>
<div class="bg bg3">1</div>
</CarouselItem>
</Carousel>
<!-- <div v-if="showI18n" class="page-account-header">
<i-header-i18n />
</div>-->
<div class="main">
<div class="ad">
<img src="@/assets/images/login/ad.png" />
</div>
<div class="login">
<div class="cen">
<div class="page-account-top">
<div class="page-account-top-logo tc">
<img src="@/assets/images/logo.png" alt="logo" />
</div>
<!-- <div class="page-account-top-desc tc">SaaS MES 制造执行系统</div> -->
</div>
<h3 class="mb20">用户登陆</h3>
<Login @on-submit="handleSubmit">
<UserName name="username" value="" />
<Password name="password" value="" enter-to-submit />
<div class="page-account-auto-login mb20">
<Checkbox v-model="autoLogin">{{ $t('page.login.remember') }}</Checkbox>
<a href>{{ $t('page.login.forgot') }}</a>
</div>
<div class="mt20">
<Submit class="shadown">{{ $t('page.login.submit') }}</Submit>
</div>
</Login>
</div>
</div>
</div>
</div>
</template>
<script>
import iCopyright from "@/components/copyright";
import { mapActions } from "vuex";
import mixins from "../mixins";
import Oidc from "oidc-client";
import util from "@/libs/util";
var mgr = new Oidc.UserManager(window.authConfig);
export default {
layout: "empty",
mixins: [mixins],
components: { iCopyright },
data() {
return {
value1: 0,
autoLogin: true
};
},
created() {
// this.oidc();
},
methods: {
...mapActions("admin/account", ["login"]),
/**
* @description 登录
* 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档
*/
handleSubmit(valid, values) {
if (valid) {
const { username, password } = values;
this.login({
username,
password
}).then(r => {
if (r > 0) {
this.$Message.success("登陆成功!");
this.initUserInfo(r);
} else {
this.$Message.error("登陆失败!");
}
});
}
},
initUserInfo(id) {
let parma = {
Id: id
};
this.$http.sysUser.getuserinfo(parma).then(res => {
if (res.result) {
if (
res.result.avatarUrl &&
res.result.avatarUrl != "" &&
res.result.avatarUrl != null
) {
res.result.avatarUrl = fileUrlDown + res.result.avatarUrl;
}
let info = res.result;
info.auth = ["admin"];
info.avatar = info.avatarUrl;
info.userId = info.id;
info.name = info.userName;
this.$store.dispatch("admin/user/set", info, {
root: true
});
// setUserInfo
this.$store.commit("setUserInfo", info);
this.$router.replace(this.$route.query.redirect || "/");
} else {
this.$Message.error("用户信息22查询失败!");
}
});
}
}
};
</script>
<style lang="less">
@jianju: 40px;
.account {
position: fixed;
width: 100%;
top: 0;
bottom: 0;
.zmd {
z-index: 1;
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.bg {
width: 100%;
height: 100vh;
background-size: 100% auto;
}
.bg0 {
background-image: url("../../../assets/images/login/bg0.png");
}
.bg1 {
background-image: url("../../../assets/images/login/bg1.jpg");
}
.bg2 {
background-image: url("../../../assets/images/login/bg2.jpg");
}
.bg3 {
background-image: url("../../../assets/images/login/bg3.jpg");
}
.main {
position: absolute;
z-index: 55;
top: @jianju;
left: @jianju;
right: @jianju;
bottom: @jianju;
background: rgba(38, 128, 235, 0.3);
display: flex;
.ad {
flex: 1;
text-align: center;
img {
margin-top:26%;
}
}
.login {
background-color: white;
width: 600px;
padding: 0 90px;
display: flex;
align-items: center;
flex-direction: row;
.cen {
width: 100%;
margin-top: -50px;
.ivu-input-wrapper {
margin-bottom: 5px;
}
.mt20 {
margin-top: 50px;
.shadown {
box-shadow: 1px 5px 15px #2680eb;
}
.ivu-btn-large {
height: 50px !important;
}
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<InputNumber :max="maxnum" :min="1" v-model="chaiNum"></InputNumber> <InputNumber :max="maxnum" :min="1" v-model="chaiNum"></InputNumber>
<Slider v-model="chaiNum" :max="maxnum" show-stops :min="1"></Slider> <Slider v-model="chaiNum" :max="maxnum" show-stops :min="1"></Slider>
</Modal> </Modal>
<!-- 专业工艺-添加人员单个,批量 --> <!-- 工艺-添加人员单个,批量 -->
<Modal v-model="userModal" title="添加人员" :width="770" :mask-closable="false" @on-ok="okUsers"> <Modal v-model="userModal" title="添加人员" :width="770" :mask-closable="false" @on-ok="okUsers">
<UserSelect ref="userSelected" v-model="userIds" :type='2' :multiple="true" /> <UserSelect ref="userSelected" v-model="userIds" :type='2' :multiple="true" />
</Modal> </Modal>
......
...@@ -365,6 +365,7 @@ ...@@ -365,6 +365,7 @@
padding-left: 50px; padding-left: 50px;
} }
.mass_box{ .mass_box{
h2{ height: 40px;}
.heger{ color: #2680EB;} .heger{ color: #2680EB;}
.rangb{ color: #515A6E;} .rangb{ color: #515A6E;}
.fanxiu{ color: #FFA000;} .fanxiu{ color: #FFA000;}
...@@ -406,6 +407,8 @@ ...@@ -406,6 +407,8 @@
} }
.list02{ .list02{
min-height: 50px; min-height: 50px;
max-height: 100px;
overflow-y: auto;
.tag_card02{ .tag_card02{
margin: 0 20px 15px 0; margin: 0 20px 15px 0;
} }
...@@ -430,7 +433,7 @@ ...@@ -430,7 +433,7 @@
} }
} }
.fei_box{ .fei_box{
width: calc(100% - 520px); width: calc(100% - 482px);
display: inline-block; display: inline-block;
.list02{ .list02{
.tag_card02{ .tag_card02{
......
...@@ -191,7 +191,14 @@ export default { ...@@ -191,7 +191,14 @@ export default {
nowTime: new Date().getTime() //页面当前打开时间 nowTime: new Date().getTime() //页面当前打开时间
}; };
}, },
created() {}, created() {
let oldStr=localStorage.getItem('admin');
let userlist = this.$store.getters.getUser(2);
console.info(userlist)
console.warn(localStorage)
// console.warn("02",sessionStorage)
// console.log("user",oldStr)
},
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
......
<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) {
window.open(url, "_blank"); if (url) {
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");
}); });
}, },
...@@ -63,4 +86,9 @@ export default { ...@@ -63,4 +86,9 @@ export default {
} }
} }
}; };
</script> </script>
\ No newline at end of file <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,11 +143,20 @@ export default { ...@@ -143,11 +143,20 @@ 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({
if (r.success) { title: "删除",
this.$refs.grid.load(); content: "<p>您确定要删除此产品吗?</p>",
this.$Message.success("删除成功"); onOk: () => {
Api.delete(row.id).then(r => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
onCancel: () => {
this.$Message.success("取消删除");
} }
}); });
}, },
......
<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