|
|
@ -17,6 +17,8 @@ |
|
|
|
<el-form-item label="发布范围"> |
|
|
|
<el-tree class="form_item" |
|
|
|
ref="tree" |
|
|
|
node-key="orgId" |
|
|
|
:default-checked-keys="publishAgency" |
|
|
|
style="background-color:#f7f7f7" |
|
|
|
:props="props" |
|
|
|
:data="data" |
|
|
@ -70,6 +72,26 @@ |
|
|
|
<div> |
|
|
|
<p class="success-title">恭喜您,发布成功!</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-form label-width="150px"> |
|
|
|
<el-form-item label="小程序端"> |
|
|
|
<span style="margin-left:30px;float:left">{{publishClient}}</span> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="发布范围"> |
|
|
|
<el-tree style="background-color:#f7f7f7" |
|
|
|
class="form_item" |
|
|
|
ref="tree" |
|
|
|
node-key="orgId" |
|
|
|
:default-checked-keys="publishAgency" |
|
|
|
:props="props" |
|
|
|
:data="data" |
|
|
|
show-checkbox |
|
|
|
:default-expand-all="false" |
|
|
|
disabled /> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div> |
|
|
|
<p class="link-text"> {{ writeLink }}</p> |
|
|
|
</div> |
|
|
@ -128,17 +150,21 @@ export default { |
|
|
|
data: [], |
|
|
|
|
|
|
|
selAgencyList: [], |
|
|
|
agencyArrayCopy: [] |
|
|
|
agencyArrayCopy: [], |
|
|
|
publishClient: '', |
|
|
|
publishAgency: []//问卷的发布范围 |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
async mounted () { |
|
|
|
this.projectKey = this.$route.query.key |
|
|
|
let url = window.location.protocol + '//' + window.location.host |
|
|
|
this.writeLink = `${url}/${process.env.VUE_APP_PUBLIC_PATH}/s/${this.projectKey}` |
|
|
|
await this.loadAgencyList() |
|
|
|
this.getProjectStatus() |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
clientChange (label) { |
|
|
|
this.clientType = label |
|
|
|
this.loadAgencyList() |
|
|
@ -154,6 +180,29 @@ export default { |
|
|
|
this.data = res.data || [] |
|
|
|
}) |
|
|
|
}, |
|
|
|
//获取问卷发布范围 |
|
|
|
getPublishAgency () { |
|
|
|
let params = { |
|
|
|
projectKey: this.projectKey, |
|
|
|
|
|
|
|
} |
|
|
|
this.$api.post(`/data/aggregator/questionnaire/getrange`, params).then((res) => { |
|
|
|
if (res.data.client) { |
|
|
|
if (res.data.client === 'resi') { |
|
|
|
this.publishClient = '居民端' |
|
|
|
} else if (res.data.client === 'gov') { |
|
|
|
this.publishClient = '工作端' |
|
|
|
} else { |
|
|
|
this.publishClient = '未知' |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.publishClient = '未知' |
|
|
|
} |
|
|
|
|
|
|
|
this.publishAgency = res.data.orgList || [] |
|
|
|
this.$refs.tree.setCheckedNodes(this.publishAgency) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//解析树选择的数据 |
|
|
|
resolveAgency () { |
|
|
@ -198,9 +247,10 @@ export default { |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/${this.projectKey}`).then(res => { |
|
|
|
if (res.data.status == 2) { |
|
|
|
this.publishStatus = true |
|
|
|
this.getPublishAgency() |
|
|
|
} else { |
|
|
|
this.publishStatus = false |
|
|
|
this.loadAgencyList() |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -225,6 +275,7 @@ export default { |
|
|
|
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/publish`, |
|
|
|
params).then(() => { |
|
|
|
this.publishStatus = true |
|
|
|
this.getPublishAgency() |
|
|
|
this.$parent.getProjectStatus() |
|
|
|
this.msgSuccess('发布成功') |
|
|
|
}) |
|
|
@ -274,16 +325,22 @@ export default { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.age_title { |
|
|
|
width: 100px; |
|
|
|
align-items: left; |
|
|
|
} |
|
|
|
.publish-container { |
|
|
|
width: 100%; |
|
|
|
width: 100vw; |
|
|
|
height: 100%; |
|
|
|
padding: 0; |
|
|
|
margin: 0; |
|
|
|
background-color: #f7f7f7; |
|
|
|
min-height: 84vh; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
padding-top: 150px; |
|
|
|
padding-left: 350px; |
|
|
|
// align-items: center; |
|
|
|
// justify-content: center; |
|
|
|
} |
|
|
|
.publish-btn-view { |
|
|
|
width: 800px; |
|
|
|