Commit 27e53a04 authored by 周远喜's avatar 周远喜

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

parents a3f0f581 f7b792d3
...@@ -7,5 +7,8 @@ export default { ...@@ -7,5 +7,8 @@ export default {
serialcode(params) { serialcode(params) {
return Api.post(`${systemUrl}/cache/generate_serialcode`, params); return Api.post(`${systemUrl}/cache/generate_serialcode`, params);
}, },
//文档分类列表
list(params){
return Api.post(`${material}/documentcategory/list`,params);
},
} }
\ No newline at end of file
<template>
<div class="flex fd tree-menu">
<h3>
<span>文档分类</span>
<div class="fr mr10 mt10">
<ButtonGroup class="fr ddi" 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="fg">
<Tree
:data="data"
ref="tree"
@on-select-change="change"
:render="renderContent"
></Tree>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
data() {
return {
keys: "",
expand: false,
list: [],
};
},
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 < u.title) {
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;
},
},
mounted() {
this.loadTree();
},
methods: {
loadTree() {
let data = {
conditions: [
{
fieldName: "status",
fieldValue: "1",
conditionalType: "Equal",
},
],
};
Api.list(data).then((r) => {
var data = this.$u.toTree(
r.result,
0,
(u) => {
u.title = u.name;
u.value = u.id;
u.expand = true;
},
"upId"
);
this.list = this.$u.clone(data);
// console.log(this.list);
});
},
change(a, b) {
// console.log(a)
console.log(b);
// if (b.children.length == 0) { //判断最底层才能添加文档
// this.addShow = true;
// this.$refs.dataTable.$refs.grid.reload(this.easySearch);
// } else {
// this.addShow = false;
// }
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("change", b, ids);
},
renderContent(h, { root, node, data }) {
let type = "";
if (data.type == 0) {
type = "md-folder";
} else if (data.type == 1) {
type = "ios-copy";
} else {
type = "ios-book";
}
return h("span", [
h("Icon", {
props: {
type: type,
},
style: {
marginRight: "8px",
},
}),
h(
"span",
data.title
),
]);
},
toggle() {
this.expand = !this.expand;
},
hide() {
this.$emit("onHide");
},
},
};
</script>
\ No newline at end of file
...@@ -19,10 +19,7 @@ export default { ...@@ -19,10 +19,7 @@ export default {
deletes(params) { deletes(params) {
return Api.post(`${material}/document/batchdelete`,params); return Api.post(`${material}/document/batchdelete`,params);
}, },
//文档分类列表
list(params){
return Api.post(`${material}/documentcategory/list`,params);
},
//自定义属性 //自定义属性
listbyid(params){ listbyid(params){
return Api.get(`${material}/documentpropertydefinition/listbyid`,params); return Api.get(`${material}/documentpropertydefinition/listbyid`,params);
......
...@@ -2,39 +2,7 @@ ...@@ -2,39 +2,7 @@
<div class="product-mix"> <div class="product-mix">
<Layout> <Layout>
<Sider width="300" v-if="showMenu"> <Sider width="300" v-if="showMenu">
<div class="flex fd tree-menu"> <WordTree @change="change" @onHide="hide" />
<h3>
<span>文档分类</span>
<div class="fr mr10 mt10">
<ButtonGroup class="fr ddi" 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="data"
ref="tree"
@on-select-change="change"
:render="renderContent"
></Tree>
</div>
</div>
</div>
</Sider> </Sider>
<div v-if="!showMenu" class="show_menu"> <div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开"> <a class="menu_play fr" @click="showMenuFn" title="展开">
...@@ -70,135 +38,26 @@ export default { ...@@ -70,135 +38,26 @@ export default {
return { return {
list: [], list: [],
showMenu: true, showMenu: true,
model8: "",
keys: "",
expand: false,
treeId: 0, treeId: 0,
addShow: false, addShow: false,
ids: [], ids: [],
workFlowIds: "", workFlowIds: "",
}; };
}, },
mounted() { mounted() {},
this.loadTree();
},
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
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 < u.title) {
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;
},
},
methods: { methods: {
loadTree() { change(item, ids) {
let data = { this.treeId = item.id;
conditions: [ this.workFlowIds = item.workFlowIds;
{ this.ids = ids;
fieldName: "status",
fieldValue: "1",
conditionalType: "Equal",
},
],
// sortBy: "code",
// isDesc: false,
};
Api.list(data).then((r) => {
var data = this.$u.toTree(
r.result,
0,
(u) => {
u.title = u.name;
u.value = u.id;
u.expand = true;
},
"upId"
);
this.list = this.$u.clone(data);
// console.log(this.list);
});
},
toggle() {
if (this.model8) {
this.expand = !this.expand;
} else {
this.$Message.error("请先选择类型");
}
}, },
hide() { hide() {
this.showMenu = false; this.showMenu = false;
}, },
change(a, b) {
// console.log(a)
console.log(b);
this.treeId = b.id;
this.workFlowIds = b.workFlowIds; //流程id
// if (b.children.length == 0) { //判断最底层才能添加文档
// this.addShow = true;
// this.$refs.dataTable.$refs.grid.reload(this.easySearch);
// } else {
// this.addShow = false;
// }
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);
}
});
}
}
// console.log(ids)
this.ids = ids;
},
renderContent(h, { root, node, data }) {
let type = "";
if (data.type == 0) {
type = "md-folder";
} else if (data.type == 1) {
type = "ios-copy";
} else {
type = "ios-book";
}
return h("span", [
h("Icon", {
props: {
type: type,
},
style: {
marginRight: "8px",
},
}),
h(
"span",
data.title
),
]);
},
showMenuFn() { showMenuFn() {
//this.$Message.info("展开左侧树") //this.$Message.info("展开左侧树")
......
...@@ -67,7 +67,7 @@ import ImportExcel from '@/components/page/import/process.vue' ...@@ -67,7 +67,7 @@ import ImportExcel from '@/components/page/import/process.vue'
import CustomProperties from '@/components/page/customProperties.vue' import CustomProperties from '@/components/page/customProperties.vue'
import InputCode from '@/components/page/inputCode.vue' import InputCode from '@/components/page/inputCode.vue'
import Pictrue from '@/components/page/pictrue.vue' import Pictrue from '@/components/page/pictrue.vue'
import WordTree from '@/components/page/wordTree.vue'
...@@ -141,6 +141,8 @@ Vue.component("ImportExcel",ImportExcel) ...@@ -141,6 +141,8 @@ Vue.component("ImportExcel",ImportExcel)
Vue.component("CustomProperties",CustomProperties) Vue.component("CustomProperties",CustomProperties)
Vue.component("InputCode",InputCode) Vue.component("InputCode",InputCode)
Vue.component("Pictrue",Pictrue) Vue.component("Pictrue",Pictrue)
Vue.component("WordTree",WordTree)
......
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