diff --git a/src/router/index.js b/src/router/index.js
index 29d4cb5..6b11109 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -52,6 +52,7 @@ router.beforeEach((to, from, next) => {
console.log('ro.query', to.query)
localStorage.setItem('loginSource', 'epmet')
+ localStorage.setItem('customerId', to.query.customerId)
store.dispatch('user/getUserInfo', to.query.token)
store.dispatch('user/setTokens', to.query.token)
next()
diff --git a/src/views/form/editor/RightPanel.vue b/src/views/form/editor/RightPanel.vue
index a936fb9..17e4ce8 100644
--- a/src/views/form/editor/RightPanel.vue
+++ b/src/views/form/editor/RightPanel.vue
@@ -971,6 +971,7 @@ export default {
loading: null,
currentTab: "field",
currentNode: null,
+ currentPID: Number,
dialogVisible: false,
iconsVisible: false,
currentIconModel: null,
@@ -1215,6 +1216,7 @@ export default {
},
addTreeItem () {
++this.idGlobal;
+ this.currentPID = 0
this.dialogVisible = true;
this.currentNode = this.activeData.options;
},
@@ -1238,10 +1240,12 @@ export default {
);
},
append (data) {
+
if (!data.children) {
this.$set(data, "children", []);
}
this.dialogVisible = true;
+ this.currentPID = data.id
this.currentNode = data.children;
},
remove (node, data) {
@@ -1252,6 +1256,8 @@ export default {
children.splice(index, 1);
},
addNode (data) {
+ debugger
+ data.pid = this.currentPID
this.currentNode.push(data);
},
setOptionValue (item, val) {
diff --git a/src/views/form/index.vue b/src/views/form/index.vue
index 952b050..ee8da10 100644
--- a/src/views/form/index.vue
+++ b/src/views/form/index.vue
@@ -1,6 +1,6 @@
-
diff --git a/src/views/form/publish/index.vue b/src/views/form/publish/index.vue
index a8dc3f0..7ae76bf 100644
--- a/src/views/form/publish/index.vue
+++ b/src/views/form/publish/index.vue
@@ -4,34 +4,40 @@
-
+
-
- 居民端
- 工作端
+
+ 居民端
+ 工作端
-
+ :default-expand-all="true" />
-
-
+
-
+
+
@@ -115,71 +121,112 @@ export default {
clientType: 'resi',
props: {
- // label: 'name',
- // children: 'zones'
+ label: 'orgName',
+ children: 'subOrgList'
},
count: 1,
data: [{
- id: 1,
- label: '一级 1',
- children: [{
- id: 4,
- label: '二级 1-1',
- children: [{
- id: 9,
- label: '三级 1-1-1'
+ orgId: 1,
+ orgName: '一级 1',
+ subOrgList: [{
+ orgId: 4,
+ orgName: '二级 1-1',
+ subOrgList: [{
+ orgId: 9,
+ orgName: '三级 1-1-1'
}, {
- id: 10,
- label: '三级 1-1-2'
+ orgId: 10,
+ orgName: '三级 1-1-2'
}]
}]
}, {
- id: 2,
- label: '一级 2',
- children: [{
- id: 5,
- label: '二级 2-1'
+ orgId: 2,
+ orgName: '一级 2',
+ subOrgList: [{
+ orgId: 5,
+ orgName: '二级 2-1'
}, {
- id: 6,
- label: '二级 2-2'
+ orgId: 6,
+ orgName: '二级 2-2'
}]
}, {
- id: 3,
- label: '一级 3',
- children: [{
- id: 7,
- label: '二级 3-1'
+ orgId: 3,
+ orgName: '一级 3',
+ subOrgList: [{
+ orgId: 7,
+ orgName: '二级 3-1'
}, {
- id: 8,
- label: '二级 3-2'
+ orgId: 8,
+ orgName: '二级 3-2'
}]
- }]
+ }],
+
+ selAgencyList: [],
+ agencyArrayCopy: []
}
},
mounted () {
this.projectKey = this.$route.query.key
let url = window.location.protocol + '//' + window.location.host
this.writeLink = `${url}/s/${this.projectKey}`
+
this.getProjectStatus()
},
methods: {
- currentChange (data, node) {
- console.log(data, node)
- },
- check () {
+ clientChange (label) {
+ this.clientType = label
+ this.loadAgencyList()
},
- handleCheckChange (data, checked, indeterminate) {
- data.select = true
- console.log(data, checked, indeterminate)
- // console.log('树');
- // console.log(this.data)
+
+ loadAgencyList () {
+ const customerId = localStorage.getItem('customerId')
+ let params = {
+ client: this.clientType,
+ agencyId: customerId
+ }
+ this.$api.post(`/data/aggregator/org/agencytree`, params).then((res) => {
+ debugger
+ })
},
- nodeClick (a, b, c) {
- console.log(a, b, c)
+
+ //解析树选择的数据
+ resolveAgency () {
+ let selAll = this.$refs.tree.getCheckedNodes(false, false)
+ // console.log(selAll)
+
+ this.selAgencyList = []
+ this.agencyArrayCopy = JSON.parse(JSON.stringify(this.data))
+
+ selAll.forEach(element => {
+ // debugger
+ let orgId = element.orgId
+ this.resursionTree(this.agencyArrayCopy, orgId)
+ });
+
+ console.log(this.selAgencyList)
},
- handleNodeClick (data) {
- // console.log(data);
+
+ //递归树
+ resursionTree (orgArray, orgId) {
+ for (let i = 0; i < orgArray.length; i++) {
+ let item = orgArray[i]
+ // debugger
+ if (item && item.orgId === orgId) {
+ // debugger
+ this.selAgencyList.push(orgArray[i])
+ orgArray[i] = {}
+ break
+
+ } else if (item.subOrgList && item.subOrgList.length > 0) {
+ // debugger
+ this.resursionTree(item.subOrgList, orgId)
+
+ }
+ }
+ // console.log(this.agencyArrayCopy)
+
+
},
getProjectStatus () {
@@ -188,16 +235,16 @@ export default {
this.publishStatus = true
} else {
this.publishStatus = false
+ this.loadAgencyList()
}
})
},
publishProject () {
- const aaa = this.$refs.tree.getCheckedNodes(false, false)
- console.log(aaa)
- // this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/publish`, { key: this.projectKey }).then(() => {
- // this.publishStatus = true
- // this.msgSuccess('发布成功')
- // })
+
+ this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/publish`, { key: this.projectKey }).then(() => {
+ this.publishStatus = true
+ this.msgSuccess('发布成功')
+ })
},
stopPublishProject () {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/stop`, { 'key': this.projectKey }).then(res => {
@@ -284,4 +331,7 @@ export default {
font-size: 14px;
}
}
+.form_item {
+ padding-left: 20px;
+}
diff --git a/src/views/form/statistics/public.vue b/src/views/form/statistics/public.vue
index f62b2ad..1d6f88f 100644
--- a/src/views/form/statistics/public.vue
+++ b/src/views/form/statistics/public.vue
@@ -1,40 +1,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+