Commit e5f3d71a authored by renjintao's avatar renjintao

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

parents c68b98ba 8ba6f75a
......@@ -66,6 +66,7 @@ export default {
this.$http.storeHouse
.getpaged({ materialType: this.type })
.then((res) => {
console.log(res.result)
if (res.result) {
let items = res.result
this.tree = this.getTrees(items)
......
<template>
<div class="flex fd tree-menu">
<h3>
产品结构
<div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small">
<Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
</h3>
<div class="search">
<Input search placeholder="关键字" v-model="keys" clearable />
</div>
<div class="fg">
<div class="tree">
<Tree :data="tree" ref="tree" @on-select-change="change" :render="renderContent"></Tree>
</div>
</div>
</div>
</template>
<script>
export default {
name: "",
data() {
return {
expand: false,
ids: [],
tree: [],
divHeight:'',
keys: "",
// list: []
};
},
created() {
this.loadTree();
},
methods: {
toggle() {
this.expand = !this.expand;
this.loadTree()
},
async loadTree() {
this.$http.storeHouse
.getpaged({ materialType: this.type })
.then((res) => {
console.log(res.result)
if (res.result) {
let items = res.result;
// let item = this.$u.clone(res.result);
console.log('items:',items)
this.tree = this.getTrees(items)
this.change1(this.tree)
search(this.keys, items);
function search(keys, items) {
items.map(u => {
if (keys.length < 3) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
} else if (u.children) {
search(keys, u.children);
}
}
});
}
} else {
this.$Message.error('加载库房库位树失败!')
}
})
},
//重构左侧树
getTrees(trees) {
var expand = this.expand
trees.forEach((data, index) => {
var that = this
data.expand = expand
if (data.children.length > 0) {
this.getTrees(data.children)
}
})
return trees
},
renderContent(h, { root, node, data }) {
return h(
'span',
{
style: {
color: data.isClick ? '#000' : '#bbb', //根据选中状态设置样式
cursor: data.isClick ? 'pointer' : '',
background: node.node.selected&&data.isClick ? '#AAD8D4' : '#ffffff',
paddingLeft: '10px',
paddingRight: '10px',
paddingTop: '3px',
paddingBottom: '3px'
},
on: {
// click: () => {
// if (!node.node.selected) {
// this.$refs.tree.handleSelect(node.nodeKey) //手动选择树节点
// }
// }
}
},
data.title
)
},
//得到此树节点下所有是产品的Id
getAllIds(trees) {
trees.forEach((data, index) => {
var that = this
if (data.isClick) {
this.ids.push(data.id)
}
if (data.children.length > 0) {
this.getAllIds(data.children)
}
})
},
change(value) {
if (value.length > 0) {
if (value[0].isClick) {
this.ids = []
this.getAllIds(value)
if (this.ids.length > 0) {
this.$emit('storeIds', this.ids)
//this.easySearch.storeId.value = this.ids
} else {
this.$emit('storeIds', [-1])
}
} else {
this.$Message.error('当前操作用户无此库位的权限')
this.$emit('storeIds', [-1])
}
}
},
change1(value) {
if (value.length > 0) {
this.ids = []
this.getAllIds(value)
if (this.ids.length > 0) {
this.$emit('storeIds', this.ids)
} else {
this.$emit('storeIds', [-1])
}
}
},
// loadTree() {
// this.$http.storeHouse.getpaged({ materialType: this.type })
// .then(r => {
// console.log(r.result)
// var data = r.result;
// this.list = this.$u.clone(data);
// })
// },
// change(v, b) {
// let ids = [];
// ids.push(b.value);
// if (b.children) {
// addId(b.children);
// function addId(data) {
// data.map(u => {
// ids.push(u.value);
// if (u.children) {
// addId(u.children);
// }
// });
// }
// }
// this.$emit("on-select", b.value, b, ids);
// },
hide() {
this.$emit("on-hide");
}
},
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
if (keys.length < 3) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
} else if (u.children) {
search(keys, u.children);
}
}
});
}
return result;
}
}
};
</script>
<style lang="less">
.tree-menu {
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: rgba(81, 90, 110, 1);
background:rgba(245,246,250,1);
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
// height:0;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
</style>
\ No newline at end of file
......@@ -30,7 +30,6 @@ export default {
border-top: none;
height: 100%;
.filed-col {
border: 1px solid #ddd;
border-right: none;
margin: 0 -1px -1px -1px;
......@@ -47,7 +46,6 @@ export default {
height: 100%;
}
p {
height: 100%;
word-break: break-all;
word-wrap: break-word;
......@@ -67,4 +65,30 @@ export default {
}
}
}
.new-detail {
.ivu-row {
width: 100% !important;
.filed-col {
box-sizing: border-box;
line-height: 70px;
.label {
display: inline-block;
width: 100px;
text-align: right;
line-height: 40px;
float: left;
height: 100%;
font-weight: bold;
}
p {
text-align: left;
height: 100%;
word-break: break-all;
word-wrap: break-word;
line-height: 20px;
padding-top: 10px;
}
}
}
}
</style>
\ No newline at end of file
......@@ -31,9 +31,9 @@ export default {
data.map(u => {
u.title = u.name;
u.value = u.id;
// u.expand = true;
// u.selected = false;
// u.checked = false;
u.expand = true;
u.selected = false;
u.checked = false;
if (u.children) {
setTree(u.children);
}
......@@ -47,7 +47,7 @@ export default {
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择部门"
default: "请选择产品"
},
multiple: {
type: Boolean,
......@@ -59,7 +59,7 @@ export default {
}
},
methods: {
change(v) {
change(v,item,items) {
console.log(v);
this.dep = v;
var item;
......@@ -70,6 +70,7 @@ export default {
item = items[0];
}
this.$emit("on-change", v, item);
console.log(v,item,items)
}
},
watch: {
......
<template>
<div class="remote" >
<component :is="currentView" v-bind="$props" @onChange="hi"/>
</div>
</template>
<script>
import Axios from "axios";
// import '@/utils/less.min';
export default {
props: {
url: {
type: String,
default() {
return null;
}
}
},
data() {
return {
resData: null,
cssId: null
};
},
computed: {
currentView() {
if (!this.resData)
return { template: "<div class='remoteInfo'>正在加载中。。。</div>" };
const tplData = this.resolveStr(this.resData);
let ponentObj = new Function(
`return ${tplData.sctipts.slice(
tplData.sctipts.indexOf("{"),
tplData.sctipts.lastIndexOf("}") + 1
)}`
)();
ponentObj.template = tplData.templates;
// this.$el.setAttribute('class',`remote css${this.cssId}`);
// if(!document.querySelector(`style[id=css${this.cssId}]`)){//防止重复创建
// let cssStr = `
// .css${this.cssId}{
// ${tplData.styles}
// }
// `;
// this.resolveCss(cssStr);
// }
return ponentObj;
}
},
watch: {
url() {
this.getData();
}
},
mounted() {
this.getData();
},
methods: {
hi(v){
alert(v)
},
getId() {
var d = new Date().getTime();
var uid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function(c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
}
);
return uid;
},
resolveCss(lessInput) {
less.render(lessInput).then(
function(output) {
let style = document.createElement("style");
style.setAttribute("type", "text/css");
style.setAttribute("id", "css" + this.cssId);
if (style.styleSheet)
// IE
style.styleSheet.cssText = output.css;
else {
// w3c
var cssText = document.createTextNode(output.css);
style.appendChild(cssText);
}
var heads = document.getElementsByTagName("head");
if (heads.length) heads[0].appendChild(style);
else document.documentElement.appendChild(style);
}.bind(this)
);
},
resolveStr(str) {
return {
templates: str.match(/<template>([\s\S]*)<\/template>/)[1],
sctipts: str.match(/<script.*>([\s\S]*)<\/script>/)[1],
// styles: str.match(/<style.*>([\s\S]*)<\/style>/)[1]
};
},
async getData() {
// let remoteData = this.$store.getters.getRemoteByUrl(this.url);
// if(remoteData){
// this.resData = remoteData.resData;
// this.cssId = remoteData.cssId;
// }else{
if (this.$props.url) {
const res = await Axios.get(this.$props.url);
// this.cssId = this.getId();
this.resData = res.data;
console.log(this.resData)
}
// this.$store.dispatch('doAction',{
// event:'addRemote',
// data:{url:this.url,cssId:this.cssId,resData:this.resData}
// });
// }
}
// async getData(){
// let remoteData = this.$store.getters.getRemoteByUrl(this.url);
// if(remoteData){
// this.resData = remoteData.resData;
// this.cssId = remoteData.cssId;
// }else{
// const res = await Axios.get(this.$props.url);
// this.cssId = this.getId();
// this.resData = res.data;
// this.$store.dispatch('doAction',{
// event:'addRemote',
// data:{url:this.url,cssId:this.cssId,resData:this.resData}
// });
// }
// }
}
};
</script>
\ No newline at end of file
<template>
<Cascader :data="data" v-model="name" @on-change="change" trigger="hover"></Cascader>
</template>
<script>
export default {
name: "roleSelect",
model: {
prop: "value",
event: "on-change"
},
data() {
return {
name: this.value,
data: [],
resources: [],
types: []
};
},
mounted() {
//
this.types = this.$store.getters.dictionaryByKey(
"aps.resource.type"
);
let url = `${systemUrl}/planresource/list`;
this.$api
.post(url, {
pageSize: 2000
})
.then(r => {
this.resources = r.result;
this.init();
});
},
props: {
value: [Array]
},
methods: {
init(data) {
var data = [];
this.types.map(u => {
let item = {
label: u.name,
value: u.code
};
var children = this.resources.filter(r => {
return r.type == u.code;
});
if (children && children.length > 0) {
var ul = [];
children.map(u => {
ul.push({
label: u.title,
value: u.id
});
});
item.children = ul;
}else{
item.disabled=true
}
data.push(item);
});
this.data = data;
},
change(value,selected) {
// console.log(event)
this.$emit("on-change", value,selected);
},
//获取所有的选中项
getSelectItems() {
var items = [];
this.value.forEach(v => {
var item = this.dic.filter(u => u.value == v);
if (item && item[0]) {
items.push(item[0]);
}
});
return items;
},
//获取所有选中项的名称
getSelectNames() {
var names = [];
this.getSelectItems().forEach(v => {
names.push(v.label);
});
return names;
}
},
computed: {
dic() {
let result = [];
this.data.forEach(u => {
result.push({
value: u.id,
label: u.name
});
});
return result;
}
},
watch: {
value: {
handler(v, o) {
this.name = v;
},
deep: true
}
}
};
</script>
\ No newline at end of file
......@@ -123,8 +123,8 @@
this.isChangeValueInTree = true;
this.$emit('input', this.currentValue);
this.$emit('on-change', this.currentValue);
this.$emit('input', this.currentValue,currentNode,selectedNodes);
this.$emit('on-change', this.currentValue,currentNode,selectedNodes);
this.dispatch('FormItem', 'on-form-change', this.currentValue);
},
handleUpdateTreeNodes (data, isInit = false) {
......
......@@ -105,6 +105,7 @@ export default {
}
},
extend(config, ctx) {
config.resolve.alias['vue$']='vue/dist/vue.esm.js'
// config.resolve.alias['_c']=path.resolve(__dirname, 'components')
// config.module.rules.push({
// enforce:'pre',
......
<template>
<div class="checkbox-list">
<Row class="check-title">
<Col span="20">
<div>
<!-- :indeterminate="indeterminate" -->
<!-- :label="resourcesType==0?singleList.shop_name:resourcesType==2?singleList.equip_name:''" -->
<Checkbox
:label="singleList.equip_name"
v-model="checkAll"
@click.prevent.native="handleCheckAll(singleList.shop_id)"
>{{singleList.equip_name}}</Checkbox>
<!-- {{resourcesType==0?singleList.shop_name:resourcesType==2?singleList.equip_name:''}} -->
</div>
</Col>
<Col span="4">
<div class="icon-down">
<Icon type="ios-arrow-down" v-if="!singleList.isClick" @click="upDown(singleList)"></Icon>
<Icon type="ios-arrow-up" v-if="singleList.isClick" @click="upDown(singleList)"></Icon>
</div>
</Col>
</Row>
<ul v-show="singleList.isClick">
<li
ref="liId"
v-for="(item,index) in list"
:key="index"
@click="onclick(index)"
>{{item.name}}&nbsp&nbsp{{item.class}}</li>
</ul>
<!-- <CheckboxGroup
v-model="checkAllGroup"
@on-change="checkAllGroupChange"
v-if="singleList.isClick"
>-->
<!-- :label="resourcesType==0?item.user_name:resourcesType==2?item.equip_name:''" -->
<!-- <Checkbox v-for="(item,index) in list" :key="index" :label="item.name">{{item.name}}</Checkbox>
</CheckboxGroup>-->
</div>
</template>
<script>
import Api from "./api";
export default {
name: "CheckboxList",
props: ["singleList"],
data() {
return {
chooseNum: null,
indeterminate: true,
checkAll: false,
checkAllGroup: [],
typeIcon: "ios-arrow-down",
show: -1,
list: [
{
name: "张芳",
class: "1级"
},
{
name: "张芳",
class: "1级"
},
{
name: "张芳",
class: "1级"
},
{
name: "张芳",
class: "1级"
}
],
taglistData: []
};
},
mounted() {
// this.checkList()
},
methods: {
onclick(index) {
if (this.$refs.liId[index].className.length <= 0) {
this.$refs.liId[index].className = "li-focus"; // 添加类
let list = [];
this.$refs.liId.forEach((element, index) => {
if (this.$refs.liId[index].className) {
list.push(this.$refs.liId[index].className);
}
});
if (list.length == this.list.length) {
this.checkAll = true;
}
} else {
this.$refs.liId[index].className = ""; // 选中再取消的情况
this.checkAll = false;
}
},
handleCheckAll(id) {
this.checkAll = !this.checkAll;
if (this.checkAll) {
this.$refs.liId.forEach((element, index) => {
this.$refs.liId[index].className = "li-focus"; // 添加类
});
} else {
this.$refs.liId.forEach((element, index) => {
this.$refs.liId[index].className = ""; // 选中再取消的情况
});
}
// // console.log(this.list)
// // this.list.map((u) => {
// // console.log(u)
// // })
// // this.checkList(id)
// this.checkAll = !this.checkAll;
// if (this.checkAll) {
// let listNew = [];
// this.list.map(u => {
// if (this.resourcesType == 0) {
// listNew.push(u.user_name);
// } else if (this.resourcesType == 2) {
// listNew.push(u.equip_name);
// }
// });
// this.checkAllGroup = listNew;
// this.$emit("changeData", this.checkAllGroup);
// } else {
// this.checkAllGroup = [];
// }
},
// checkAllGroupChange(data) {
// console.log(data);
// console.log(this.list);
// this.checkAllGroup = data;
// this.$emit("changeData", this.checkAllGroup);
// if (data.length === this.list.length) {
// this.indeterminate = false;
// this.checkAll = true;
// } else if (data.length > 0) {
// this.indeterminate = true;
// this.checkAll = false;
// } else {
// this.indeterminate = false;
// this.checkAll = false;
// }
// },
checkList(id) {
if (this.resourcesType == 0) {
//班组
Api.getbyshopid({ shop_id: id }).then(r => {
// console.log(r)
if (r.success) {
r.result.forEach(e => {
e.ischeckBox = false;
});
this.list = r.result;
}
});
} else if (this.resourcesType == 2) {
//设备
Api.getbyequippk({ equip_pk: 91 }).then(r => {
// console.log(r)
if (r.success) {
r.result.forEach(e => {
e.ischeckBox = false;
});
this.list = r.result;
}
});
}
},
upDown(post) {
if (!post.isClick) {
this.$set(post, "isClick", true);
this.checkList(post.shop_id);
} else {
this.$set(post, "isClick", false);
}
}
}
// watch: {
// list: {
// handler(newVal, oldVal) {
// console.log('深度监听', newVal, oldVal)
// },
// deep: true
// }
// }
};
</script>
<style lang="less" scoped>
.checkbox-list {
.icon-down {
text-align: right;
cursor: pointer;
}
.check-title {
height: 40px;
line-height: 40px;
padding: 0 10px;
background: rgba(38, 128, 235, 0.5);
}
ul {
min-height: 60px;
padding: 10px 5px;
display: flex;
li {
list-style-type: none;
text-align: center;
width: 100px;
height: 30px;
line-height: 30px;
border-radius: 20px;
margin: 0 5px;
cursor: pointer;
background: rgba(38, 128, 235, 0.1);
}
li:hover {
border: 1px solid rgba(38, 128, 235, 0.5);
}
.li-focus {
border: 1px solid rgba(38, 128, 235, 0.5);
}
}
}
</style>
\ No newline at end of file
......@@ -73,27 +73,6 @@
<Tree key="mytree" :data="workShop" ref="mytree" :render="renderContent"></Tree>
</Select>
</FormItem>
<!-- <FormItem v-if="formItem.radio==0">
<div class="list-check">
<Checkbox-List
:single-list="li"
ref="groups"
@changeData="setData"
v-for="(li,index) in listGroup"
:key="index"
></Checkbox-List>
</div>
</FormItem>-->
<!-- v-if="tagGroup.lenght>0" -->
<!-- <FormItem label="已选择" v-if="formItem.radio==0">
<div class="tag-list">
<div v-for="(item,index) in tagGroup" :key="index" class="tag-group">
<span>{{item.name}}&nbsp&nbsp{{item.class}}</span>
<Icon type="md-close" @click="closeTag" />
</div>
</div>
</FormItem>-->
<FormItem label="备注">
<Input
v-model="formItem.remark "
......
<template>
<div>
<Button type="dashed">新增</Button>
</div>
</template>
\ No newline at end of file
<template>
<div>
<Button type="dashed">新增</Button>
</div>
</template>
\ No newline at end of file
<template>
<Layout class="data-details">
<Sider hide-trigger class="left-detail" width="300">
<h4 class="bt">标题</h4>
<div class="list-tree">
<div
v-for="(item,index) in listData"
:key="index"
:class="isactive == index ? 'addclass' : 'item-i'"
@click="everyItem(item,index)"
>{{item.lable}}</div>
</div>
</Sider>
<Content class="right-detail">
<div class="btn">
<Button type="primary">编辑</Button>
<div class="new-detail">
<Row>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
</Row>
<Divider />
<div class="title-h4">engineering</div>
<Row>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
</Row>
<Divider />
<div class="title-h4">engineering</div>
<Row>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
</Row>
</div>
</div>
</Content>
</Layout>
</template>
<script>
export default {
data() {
return {
isactive: null,
listData: [
{
lable: "属性"
},
{
lable: "图像"
},
{
lable: "图像"
},
{
lable: "图像"
},
{
lable: "图像"
}
]
};
},
methods: {
everyItem(li, i) {
this.isactive = i;
},
l(key) {
key = "routing_qc_card" + "." + key;
return this.$t(key);
}
}
};
</script>
<style lang="less">
.ivu-layout {
background-color: #f5f7f9 !important;
}
.data-details {
width: 100%;
height: 100%;
.left-detail {
background: rgba(255, 255, 255, 1);
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 86vh;
overflow: auto;
.bt {
height: 50px;
line-height: 50px;
padding-left: 15px;
background: #f5f6fa;
}
.list-tree {
padding: 10px 0;
.item-i {
height: 40px;
line-height: 40px;
padding: 0 15px;
}
.item-i:hover {
cursor: pointer;
background: rgba(38, 128, 235, 0.4);
color: rgba(38, 128, 235, 1);
}
.addclass {
height: 40px;
line-height: 40px;
padding: 0 15px;
background: rgba(38, 128, 235, 0.4);
color: rgba(38, 128, 235, 1);
}
}
}
.right-detail {
margin-left: 10px;
padding: 10px 15px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 86vh;
overflow: auto;
.btn {
text-align: right;
}
.title-h4 {
text-align: left;
height: 40px;
line-height: 40px;
color: #2680eb;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="master-data">
<Button type="dashed" @click="datail">详情</Button>
</div>
</template>
<script>
export default {
data() {
return {};
},
methods: {
datail() {
this.$router.push({
path: "/materiel/masterData/details"
});
}
}
};
</script>
<style lang="less" scoped>
.master-data {
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file
......@@ -457,6 +457,7 @@ export default {
this.formValidate.mydate = date;
},
onchange_createtype() {
if (this.createtype == 1) {
this.isshow_selectpdefm = false;
this.clearModal2();
......@@ -530,9 +531,8 @@ export default {
},
setparentcreatetype(type, headerid) {
this.$parent.$parent.createtype = type
this.$parent.$parent.headerid = headerid
this.$parent.$parent.$parent.createtype = type
this.$parent.$parent.$parent.headerid = headerid
},
......
......@@ -3,7 +3,16 @@
<Sider hide-trigger :style="{ background: '#fff' }" class="menu" width="240" style=" flex:0;">
<StoreHouseLeft @storeIds="storeIds" :type="1"></StoreHouseLeft>
</Sider>
<Content class="content">
<!-- <Sider hide-trigger v-if="showMenu" class="menu_side" width="300"> -->
<!-- <storeHouseTree @on-hide="onHide" @storeIds="storeIds" :type="1"/> -->
<!-- @on-select="productSearch" -->
<!-- </Sider> -->
<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="content" :class="!showMenu?'con_bord':''">
<DataGrid
:columns="columns"
ref="grid"
......@@ -73,6 +82,7 @@ import Detail from "./detail";
import Search from "./search";
import Inventory from "./inventory";
import StoreHouseLeft from "@/components/modalTree/storeHouseLeft.vue";
import storeHouseTree from '@/components/modalTree/storeHouseTree.vue'
export default {
name: "list",
components: {
......@@ -81,10 +91,12 @@ export default {
Detail,
Search,
Inventory,
StoreHouseLeft
StoreHouseLeft,
storeHouseTree
},
data() {
return {
showMenu: true,
action: Api.index,
addModal: false,
editModal: false,
......@@ -316,6 +328,20 @@ export default {
this.tdHeight = window.innerHeight - 260
},
methods: {
onHide() {
this.showMenu = false;
},
showMenuFn() {
this.showMenu = true;
},
// productSearch(id, item, ids) {
// let where = { productId: { op: "In", value: ids } };
// this.$refs.grid.reload(where);
// },
storeIds(val) {
this.easySearch.storeId.value = val;
this.$refs.grid.easySearch();
},
addOk() {
this.$refs.grid.load();
this.addModal = false;
......@@ -389,10 +415,6 @@ export default {
let vkey = "MaterialPowder" + "." + key;
return this.$t(vkey) || key;
},
storeIds(val) {
this.easySearch.storeId.value = val;
this.$refs.grid.easySearch();
}
}
};
</script>
......@@ -63,6 +63,7 @@ import Detail from './detail'
import Search from './search'
import Inventory from './inventory'
import StoreHouseLeft from '@/components/modalTree/storeHouseLeft.vue'
// import StoreHouseLeft from '@/components/modalTree/storeHouseTree.vue'
export default {
name: 'list',
components: {
......
......@@ -366,6 +366,10 @@ export default {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
productSearch(id, item, ids) {
let where = { productId: { op: "In", value: ids } };
this.$refs.grid.reload(where);
},
// 详情页面
view(row) {
// this.$router.push("technology/details");
......@@ -393,10 +397,6 @@ export default {
search() {
this.$refs.grid.reload(this.easySearch);
},
productSearch(id, item, ids) {
let where = { productId: { op: "In", value: ids } };
this.$refs.grid.reload(where);
},
add() {
this.curId = 0;
this.title = "新增";
......
<style lang="less">
.test_layout {
height: 100%;
.bg1{
background:#fefefe ;
.bg1 {
background: #fefefe;
}
// &.fg {
// // overflow: auto;
......@@ -20,7 +20,8 @@
<Menu mode="horizontal" active-name="1">
<div class="layout-assistant">
<MenuItem name="1" to="/test/user">人员选择</MenuItem>
<MenuItem name="2">Option 2</MenuItem>
<MenuItem name="2" to="/test/com">异步组件</MenuItem>
<MenuItem name="4" to="/test/resource">资源选择</MenuItem>
<MenuItem name="3">Option 3</MenuItem>
</div>
</Menu>
......@@ -32,6 +33,9 @@
</template>
<script>
export default {
layout: "empty"
layout: "empty",
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
}
};
</script>
\ No newline at end of file
<style lang="less">
</style>
<template>
<div class="layout">
<Button @click="load()">异步组件</Button>
<Remote url="/user.txt" @onChange="hi"></Remote>
</div>
</template>
<script>
import Remote from "@/components/page/remote"
export default {
components:{Remote},
methods:{
hi(v){
alert(v)
}
}
}
</script>
\ No newline at end of file
<template>
<div>
<ResourceSelect v-model="model" @on-change="change"></ResourceSelect>
<p>{{model}}</p>
<p>{{text}}</p>
<Button @click="set">赋值</Button>
<ProductSelect v-model="product" @on-change="pchange"></ProductSelect>
</div>
</template>
<script>
import ResourceSelect from "@/components/page/resourceSelect"
export default {
components:{ResourceSelect},
name: '',
data() {
return {
model:[],
text:"",
product:"",
}
},
methods:{
change(v,items){
this.text=items.map(u=>u.label).join('/');
},
set(){
this.model=[ "1", 91 ];
},
pchange(v){
// this.text=items.map(u=>u.label).join('/');
},
}
}
</script>
<style lang="less" >
</style>
\ No newline at end of file
<template>
<div style="padding:50px;">
<UserSelect v-model="user" :multiple="true" theme="list"/>
<!-- <DepartmentSelect v-model="dep" /> -->
<Button @click="setUser">Set</Button>{{dep}}
{{user}}
</div>
</template>
<script>
export default {
data(){
return {
dep:39,
user:[21,22,23]
}
},
methods:{
setUser(){
this.user=[25]
this.$emit("onChange",25)
}
}
}
</script>
<style lang="less"></style>
\ No newline at end of file
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