|
@@ -9,22 +9,23 @@
|
|
|
<div class="zyml" :class="$props.splitId >= 0 ? `zymlsplit` : ''">
|
|
|
<div class="searchDiv">
|
|
|
<el-input :placeholder="Resource.InputPlaceholder" prefix-icon="el-icon-search" v-model="treeSearchText"
|
|
|
- size="small">
|
|
|
- </el-input>
|
|
|
- <div
|
|
|
- class="eicon"
|
|
|
- :class="isshowNum ? 'eyes' : 'close_eyes'"
|
|
|
- @click="isshowNum = !isshowNum"
|
|
|
- ></div>
|
|
|
+ size="small">
|
|
|
+ </el-input>
|
|
|
+ <div class="eicon" :class="isshowNum ? 'eyes' : 'close_eyes'" @click="isshowNum = !isshowNum"></div>
|
|
|
</div>
|
|
|
<div class="treeDiv">
|
|
|
- <el-tree @check="handleCheckChange" class="filter-tree" :data="TreeDatas" show-checkbox :props="defaultProps"
|
|
|
- :filter-node-method="filterNode" :default-checked-keys="checkedKeys" node-key="id" ref="tree">
|
|
|
+ <el-tree @check="handleCheckChange" class="filter-tree" :data="TreeDatas" show-checkbox
|
|
|
+ :props="defaultProps" :filter-node-method="filterNode" :default-checked-keys="checkedKeys" node-key="id"
|
|
|
+ ref="tree">
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
- <span>{{ !isshowNum && !data.url && node.label ? node.label.replace(/\[.*$/, '') : node.label }}</span>
|
|
|
+ <span>{{
|
|
|
+ !isshowNum && !data.url && node.label
|
|
|
+ ? node.label.replace(/\[.*$/, "")
|
|
|
+ : node.label
|
|
|
+ }}</span>
|
|
|
<span>
|
|
|
- <Icon :type="!data.favorite ? 'ios-star-outline' : 'ios-star'" color="green" size="18" class="opBtn"
|
|
|
- :title="data.favorite ? Resource.DelCollect : Resource.AddCollect
|
|
|
+ <Icon :type="!data.favorite ? 'ios-star-outline' : 'ios-star'" color="green" size="18"
|
|
|
+ class="ivu-icon" :title="data.favorite ? Resource.DelCollect : Resource.AddCollect
|
|
|
" @click="favoriteHandle(data)" v-if="data.url != ''" />
|
|
|
</span>
|
|
|
</span>
|
|
@@ -47,12 +48,14 @@
|
|
|
</template>
|
|
|
</i-switch>
|
|
|
<Icon type="md-arrow-round-up" color="green" size="18" class="opBtn" :title="Resource.MoveUpOneLevel"
|
|
|
- @click="raise(item)" v-if="index > 0 && (item.type == 'Vector' || item.type == 'IMG')
|
|
|
- " />
|
|
|
- <Icon type="md-arrow-round-down" color="green" size="18" class="opBtn" :title="Resource.MoveDownOneLevel"
|
|
|
- @click="lower(item)" v-if="index < addlayerdata.length - 1 &&
|
|
|
+ @click="raise(item)" v-if="
|
|
|
+ index > 0 && (item.type == 'Vector' || item.type == 'IMG')
|
|
|
+ " />
|
|
|
+ <Icon type="md-arrow-round-down" color="green" size="18" class="opBtn"
|
|
|
+ :title="Resource.MoveDownOneLevel" @click="lower(item)" v-if="
|
|
|
+ index < addlayerdata.length - 1 &&
|
|
|
(item.type == 'Vector' || item.type == 'IMG')
|
|
|
- " />
|
|
|
+ " />
|
|
|
<Icon type="md-locate" color="green" size="18" class="opBtn" :title="Resource.location"
|
|
|
@click="location(item)" />
|
|
|
</div>
|
|
@@ -155,19 +158,18 @@ export default {
|
|
|
return data.label.indexOf(value) >= 0 && addjudge;
|
|
|
},
|
|
|
favoriteHandle(data) {
|
|
|
- // this.$emit("favoriteHandle", data);
|
|
|
if (data.favorite) {
|
|
|
- data.favorite = null;
|
|
|
+ data.favorite = false;
|
|
|
for (let i = 0; i < this.favoriteLayerList.length; i++) {
|
|
|
if (this.favoriteLayerList[i].id == data.id) {
|
|
|
this.favoriteLayerList.splice(i, 1);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- data.favorite = this.username;
|
|
|
+ data.favorite = true;
|
|
|
this.favoriteLayerList.push(data);
|
|
|
}
|
|
|
- Collect(this.username, data.id).then((res) => {
|
|
|
+ Collect(data.id).then((res) => {
|
|
|
if (res.statuscode == 200) {
|
|
|
this.$message({
|
|
|
message: "操作成功",
|
|
@@ -216,7 +218,7 @@ export default {
|
|
|
|
|
|
// 递归遍历子节点
|
|
|
if (node.children) {
|
|
|
- node.children.forEach(child => {
|
|
|
+ node.children.forEach((child) => {
|
|
|
this.setDisabledIfChildrenExist(child);
|
|
|
});
|
|
|
}
|
|
@@ -226,7 +228,7 @@ export default {
|
|
|
GetResourceTree().then((res) => {
|
|
|
if (res.statuscode == 200) {
|
|
|
// 从根节点开始递归
|
|
|
- res.data.forEach(rootNode => {
|
|
|
+ res.data.forEach((rootNode) => {
|
|
|
this.setDisabledIfChildrenExist(rootNode);
|
|
|
});
|
|
|
this.TreeDatas = res.data;
|
|
@@ -289,14 +291,14 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@import "./LayerManage.scss";
|
|
|
+
|
|
|
.searchDiv {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
margin-right: 10px;
|
|
|
+
|
|
|
.el-input {
|
|
|
width: calc(100% - 30px);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
</style>
|