apps/com.awspaas.user.apps.yili.integration/zuzhi-web/listview.html
2023-06-02 19:51:39 +08:00

155 lines
4.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="components/icon.css">
</head>
<body>
<div id="app">
<div id="main">
<div id="leftDiv" ref="searchDiv">
<div class="cartTitle">
<span class="title">部门视图</span>
<div style="float:right">
文件类型:
<el-select v-model="selectvalue" placeholder="请选择" @change="selcetchangetype" >
<el-option
v-for="item in selectoptions"
:key="item.value"
:label="item.label"
:value="item.value" >
</el-option>
</el-select>
</div>
</div>
<div id="processList" v-loading="g_loading" style="width: 100%; height: 100%" >
<div class="collspse">
<el-tree
:data="options"
:props="defaultProps1"
node-key="ID"
:default-expanded-keys="defaultkey">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>
<a :href="node.data.path">
{{node.data.name}}
</a>
</span>
<label>
{{node.data.desc}}
</label>
</span>
</el-tree>
</div>
</div>
</div>
</div>
</div>
</body>
<!-- import Vue before Element -->
<script src="components/vue.js"></script>
<script src="components/jquery.js"></script>
<!-- import JavaScript -->
<script src="components/index.js"></script>
<script src="components/js.js"></script>
<script src="components/qs.js"></script>
<script>
new Vue({
el: '#app',
name: "Department",
data() {
return {
g_loading: true,
filterText: '',
selectoptions: [],
selectvalue: '',
options: [],
defaultkey: [],
defaultProps1: {
children: 'children',
label: 'name'
},
filetype: '',
};
},
created() {
this.leftTreedatabind();
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
methods: {
leftTreedatabind() {
let _this = this;
let qs = Qs;
let params = {
fileType: _this.filetype
}
$.ajax({
url: api.leftTreeurl,
method: 'post',
data: qs.stringify(params),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
.then((res) => {
_this.g_loading = false
if (res.data.fileMaps.length > 0) {
_this.options = res.data.fileMaps;
res.data.fileMaps.forEach(element => {
_this.defaultkey.push(element.ID)
});
}
});
},
selcetchangetype(e) {
this.filetype = this.selectvalue
if (this.filetype) {
this.options = []
}
this.leftTreedatabind()
},
},
});
</script>
<style scoped>
#main {
margin-top: 20px;
height: 100%;
background: #FFFFFF;
clear: both;
overflow: hidden;
}
#leftDiv {
height:100%;
width: 100%;
box-sizing: border-box;
padding: 20px 30px;
}
#leftDiv .cartTitle{
padding-bottom:20px;
}
#leftDiv .cartTitle .title{ font-size: 16px; margin-top: 20px; display: inline-block;}
/* 左侧手风琴样式 */
.el-tree-node{margin-bottom: 5px}
.el-tree-node__content{ background-color: #f1f5fa!important;padding: 4px 10px!important;}
.el-tree-node__children{margin:0 10px; background: #FFFFFF;}
.el-tree-node__children .el-tree-node__content{background: #FFFFFF!important; border-bottom: 1px solid #eceff5}
.custom-tree-node{display: block; width: 100%}
.custom-tree-node label{position: absolute;right: 40px; font-size: 12px; color: #999999}
.custom-tree-node a{color: #606266}
.custom-tree-node{display: block; width: 100%}
.custom-tree-node label{position: absolute;right: 40px; font-size: 12px; color: #999999}
.custom-tree-node a{color: #606266}
</style>
</html>