Browse Source

修改bug

master
jiangyy 4 years ago
parent
commit
4d0b9ff9bc
  1. 2
      src/views/form/index.vue
  2. 71
      src/views/form/publish/index.vue
  3. 50
      src/views/form/statistics/item.vue
  4. 15
      src/views/form/statistics/list.vue

2
src/views/form/index.vue

@ -304,6 +304,8 @@ export default {
min-height: 400px;
}
.el-menu-item-per {
width: 130px;
text-align: left;
// display: flex;
// line-height: 20px;
}

71
src/views/form/publish/index.vue

@ -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;

50
src/views/form/statistics/item.vue

@ -4,20 +4,22 @@
<div v-if="getItemValue['files']">
<!-- 图片文件渲染图片栏 -->
<template v-if="getItemValue['type'] == 'image'">
<span v-for="file in getItemValue['files']" :key="JSON.stringify(file)">
<el-image class="item-thumbnail-image-preview" :src="file.url" :preview-src-list="getItemValue['files'].map( img => img.url)" lazy />
<span v-for="file in getItemValue['files']"
:key="JSON.stringify(file)">
<el-image class="item-thumbnail-image-preview"
:src="file.url"
:preview-src-list="getItemValue['files'].map( img => img.url)"
lazy />
</span>
</template>
<!-- 其他文件渲染文件下载链接 -->
<template v-else>
<el-link
v-for="file in getItemValue['files']"
<el-link v-for="file in getItemValue['files']"
:key="file"
:href="file.url" target="_blank"
type="primary"
>
:href="file.url"
target="_blank"
type="primary">
<span> {{ file.fileName }}</span>
</el-link>
</template>
@ -25,8 +27,12 @@
<span v-else>/</span>
</div>
<div v-else-if="projectItemData.type=='SIGN_PAD'">
<el-image class="item-thumbnail-image-preview" :src="getItemValue || ''" :preview-src-list="[getItemValue || '']" lazy />
<el-image class="item-thumbnail-image-preview"
:src="getItemValue || ''"
:preview-src-list="[getItemValue || '']"
lazy />
</div>
<div v-else>
{{ getItemValue || '/' }}
</div>
@ -39,13 +45,13 @@ export default {
props: {
projectItemData: {
type: Object,
default: function() {
default: function () {
return {}
}
},
resultData: {
type: Object,
default: function() {
default: function () {
return {}
}
},
@ -55,21 +61,22 @@ export default {
}
},
computed: {
processData() {
console.log('数据', this.projectItemData)
processData () {
return this.resultData ? this.resultData['processData'] : {}
},
getItemValue() {
getItemValue () {
if (this.processData[`field${this.fieldItemId}other`]) {
// lable+
return this.processData[`field${this.fieldItemId}`] + ':' + this.processData[`field${this.fieldItemId}other`]
}
if (this.projectItemData.type === 'INPUT_MAP') {
// let _value = this.processData[`field${this.fieldItemId}`][2]
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`][2] : ''
}
if (this.projectItemData.type === 'PROVINCE_CITY') {
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`].join('-'): ''
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`].join('-') : ''
}
if (this.projectItemData.type === 'CASCADER') {
let arr = this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`] : []
@ -81,16 +88,18 @@ export default {
return arr.length > 0 ? arr.join(',') : ''
}
if (this.projectItemData.type === 'DATE_RANGE') {
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`].join('至'): ''
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`].join('至') : ''
}
if (this.projectItemData.type === 'TIME_RANGE') {
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`].join('至'): ''
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`].join('至') : ''
}
if (this.projectItemData.type === 'SWITCH') {
return this.processData[`field${this.fieldItemId}`] ? 'true' : 'false'
}
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`] : ''
}
}
},
}
</script>
@ -100,8 +109,7 @@ export default {
height: 106px;
margin-right: 15px;
margin-bottom: 15px;
border: 1px solid #EBEEF5;
border: 1px solid #ebeef5;
background: #0001;
}
</style>

15
src/views/form/statistics/list.vue

@ -50,7 +50,7 @@
<el-table-column label="组织/部门/网格"
prop="orgName" />
<el-table-column label="来源"
prop="clientType" />
prop="clientTypeShow" />
<!-- <el-table-column label="填写时间" prop="createdTime" /> -->
<el-table-column v-for="col in otherCustomColumns"
@ -234,6 +234,7 @@ export default {
)
},
openDetailDrawerHandle (row) {
this.activeResultRow = row
this.detailDrawer = true
},
@ -254,6 +255,18 @@ export default {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/page`, { params: this.queryConditions }).then(res => {
let { records, total, size } = res.data
this.projectResultList = records
this.projectResultList.forEach(element => {
if (element.clientType === 'gov') {
element.clientTypeShow = '工作端'
} else if (element.clientType === 'resi') {
element.clientTypeShow = '居民端'
} else {
element.clientTypeShow = '未知'
}
});
this.total = total
this.queryConditions.size = size
})

Loading…
Cancel
Save