|
|
@ -4,34 +4,40 @@ |
|
|
|
<div v-if="!publishStatus" |
|
|
|
class="publish-btn-view"> |
|
|
|
<div> |
|
|
|
<el-form label-width="90px"> |
|
|
|
<el-form label-width="150px"> |
|
|
|
<el-form-item label="小程序端"> |
|
|
|
<el-radio-group v-model="clientType"> |
|
|
|
<el-radio-button label="resi">居民端</el-radio-button> |
|
|
|
<el-radio-button label="work">工作端</el-radio-button> |
|
|
|
<el-radio-group class="form_item" |
|
|
|
@change="clientChange" |
|
|
|
v-model="clientType"> |
|
|
|
<el-radio label="resi">居民端</el-radio> |
|
|
|
<el-radio label="gov">工作端</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="发布范围"> |
|
|
|
<el-tree ref="tree" |
|
|
|
<el-tree class="form_item" |
|
|
|
ref="tree" |
|
|
|
style="background-color:#f7f7f7" |
|
|
|
:props="props" |
|
|
|
:data="data" |
|
|
|
show-checkbox |
|
|
|
:default-expand-all="true" |
|
|
|
@node-click="nodeClick" |
|
|
|
@check="check" |
|
|
|
@check-change="handleCheckChange" /> |
|
|
|
:default-expand-all="true" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<div style="text-align:center"> |
|
|
|
<div style="text-align:left;margin-left:200px;margin-top:50px"> |
|
|
|
<el-button class="publish-btn" |
|
|
|
size="medium" |
|
|
|
type="primary" |
|
|
|
@click="publishProject"> |
|
|
|
<i class="el-icon-document-checked el-icon--right">开始发布</i> |
|
|
|
</el-button> |
|
|
|
<!-- <el-button class="publish-btn" |
|
|
|
size="medium" |
|
|
|
type="primary" |
|
|
|
@click="resolveAgency"> |
|
|
|
<i class="el-icon-document-checked el-icon--right">获取组织</i> |
|
|
|
</el-button> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="publishStatus" |
|
|
@ -64,19 +70,19 @@ |
|
|
|
<div> |
|
|
|
<p class="success-title">恭喜您,发布成功!</p> |
|
|
|
</div> |
|
|
|
<!-- <div> |
|
|
|
<div> |
|
|
|
<p class="link-text"> {{ writeLink }}</p> |
|
|
|
</div> --> |
|
|
|
</div> |
|
|
|
<el-row> |
|
|
|
<!-- <el-col :offset="2" |
|
|
|
<el-col :offset="2" |
|
|
|
:span="6"> |
|
|
|
<el-button v-clipboard:copy="writeLink" |
|
|
|
<!-- <el-button v-clipboard:copy="writeLink" |
|
|
|
v-clipboard:error="()=>{this.msgError('复制失败')}" |
|
|
|
v-clipboard:success="()=>{this.msgSuccess('复制成功')}" type="primary" |
|
|
|
> |
|
|
|
v-clipboard:success="()=>{this.msgSuccess('复制成功')}" |
|
|
|
type="primary"> |
|
|
|
复制链接 |
|
|
|
</el-button> |
|
|
|
</el-col> --> |
|
|
|
</el-button> --> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-button type="danger" |
|
|
|
@click="stopPublishProject"> |
|
|
@ -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; |
|
|
|
} |
|
|
|
</style> |
|
|
|