Commit 6fa01eab authored by 仇晓婷's avatar 仇晓婷

gg

parent c8cb93fe
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<Sider width="300" v-if="showMenu"> <Sider width="300" v-if="showMenu">
<div class="p-list"> <div class="p-list">
<h3> <h3>
<Dropdown @on-click="clickItem"> <Dropdown @on-click="clickItem">
<a href="javascript:void(0)"> <a href="javascript:void(0)">
{{downName}} {{downName}}
...@@ -20,7 +19,6 @@ ...@@ -20,7 +19,6 @@
</Dropdown> </Dropdown>
<div class="fr mr10 mt10"> <div class="fr mr10 mt10">
<ButtonGroup class="fr ddi" size="small"> <ButtonGroup class="fr ddi" size="small">
<Button <Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle" @click="toggle"
...@@ -58,7 +56,7 @@ import MasterData from "./masterData.vue"; ...@@ -58,7 +56,7 @@ import MasterData from "./masterData.vue";
import Api from "./api"; import Api from "./api";
export default { export default {
components: { components: {
MasterData MasterData,
}, },
name: "masterData", name: "masterData",
data() { data() {
...@@ -73,7 +71,8 @@ export default { ...@@ -73,7 +71,8 @@ export default {
categoryId: 0, categoryId: 0,
rootCategoryId: 0, rootCategoryId: 0,
ids: [], ids: [],
addChange: true addChange: true,
codeRuleId: 0,
}, },
downName: "请选择类型", downName: "请选择类型",
modal: false, modal: false,
...@@ -82,7 +81,7 @@ export default { ...@@ -82,7 +81,7 @@ export default {
detail: null, detail: null,
showMenu: true, showMenu: true,
dataList: [], dataList: [],
codeRuleId: "" codeRuleId: "",
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
...@@ -95,9 +94,10 @@ export default { ...@@ -95,9 +94,10 @@ export default {
methods: { methods: {
clickItem(val) { clickItem(val) {
this.codeRuleId = val; this.codeRuleId = val;
this.nodeInfo.codeRuleId = val;
this.model8 = val; this.model8 = val;
this.loadTree(this.codeRuleId); this.loadTree(this.codeRuleId);
this.cityList.forEach(e => { this.cityList.forEach((e) => {
if (val == e.id) { if (val == e.id) {
this.downName = e.name; this.downName = e.name;
} }
...@@ -107,9 +107,9 @@ export default { ...@@ -107,9 +107,9 @@ export default {
let data = { let data = {
conditions: [], conditions: [],
sortBy: "id", sortBy: "id",
isDesc: false isDesc: false,
}; };
Api.pagedSlecet(data).then(r => { Api.pagedSlecet(data).then((r) => {
this.cityList = r.result.items; this.cityList = r.result.items;
this.downName = this.cityList[0].name; this.downName = this.cityList[0].name;
this.model8 = this.cityList[0].id; this.model8 = this.cityList[0].id;
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
this.loadTree(this.nodeInfo.codeRuleId); this.loadTree(this.nodeInfo.codeRuleId);
}); });
}, },
showMenuFn() { showMenuFn() {
//this.$Message.info("展开左侧树") //this.$Message.info("展开左侧树")
this.showMenu = true; this.showMenu = true;
...@@ -145,8 +145,8 @@ export default { ...@@ -145,8 +145,8 @@ export default {
on: { on: {
click: () => { click: () => {
this.handleSelect(root, data); //手动选择树节点 this.handleSelect(root, data); //手动选择树节点
} },
} },
}, },
data.title + data.title +
"(" + "(" +
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
let upId = data.upId; let upId = data.upId;
let roots = root; let roots = root;
function addId(roots, upId) { function addId(roots, upId) {
roots.map(u => { roots.map((u) => {
if (u.node.id == upId) { if (u.node.id == upId) {
if (u.node.upId == 0) { if (u.node.upId == 0) {
pid = u.node.id; pid = u.node.id;
...@@ -183,16 +183,16 @@ export default { ...@@ -183,16 +183,16 @@ export default {
loadTree(id) { loadTree(id) {
let data = { let data = {
conditions: [ conditions: [
{ fieldName: "codeRuleId", fieldValue: id, conditionalType: "Equal" } { fieldName: "codeRuleId", fieldValue: id, conditionalType: "Equal" },
], ],
sortBy: "code", sortBy: "code",
isDesc: false isDesc: false,
}; };
Api.list(data).then(r => { Api.list(data).then((r) => {
var data = this.$u.toTree( var data = this.$u.toTree(
r.result, r.result,
0, 0,
u => { (u) => {
u.title = u.code + u.name; u.title = u.code + u.name;
u.value = u.id; u.value = u.id;
u.expand = true; u.expand = true;
...@@ -220,7 +220,7 @@ export default { ...@@ -220,7 +220,7 @@ export default {
if (b.children) { if (b.children) {
addId(b.children); addId(b.children);
function addId(data) { function addId(data) {
data.map(u => { data.map((u) => {
ids.push(u.value); ids.push(u.value);
if (u.children) { if (u.children) {
addId(u.children); addId(u.children);
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
}, },
hide() { hide() {
this.showMenu = false; this.showMenu = false;
} },
}, },
computed: { computed: {
data() { data() {
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
let result = []; let result = [];
search(this.keys, items); search(this.keys, items);
function search(keys, data) { function search(keys, data) {
data.map(u => { data.map((u) => {
if (keys.length < u.title) { if (keys.length < u.title) {
u.expand = expand; u.expand = expand;
result.push(u); result.push(u);
...@@ -256,8 +256,8 @@ export default { ...@@ -256,8 +256,8 @@ export default {
}); });
} }
return result; return result;
} },
} },
}; };
</script> </script>
<style lang="less" > <style lang="less" >
......
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