Browse Source

bug修改

master
jiangyy 4 years ago
parent
commit
a2eb1dbcf1
  1. 5
      src/api/index.js
  2. 51
      src/views/form/publish/index.vue
  3. 2
      src/views/form/statistics/item.vue
  4. 14
      src/views/form/statistics/list.vue

5
src/api/index.js

@ -69,6 +69,7 @@ api.interceptors.response.use(
*/
let errCodes = [500, 405, 403]
const res = response.data
if (res.code === 0) {
return Promise.resolve(res)
} else if (errCodes.includes(res.code)) {
@ -112,7 +113,7 @@ api.interceptors.response.use(
result = await api.request(response.config)
})
return Promise.resolve(result)
}else {
} else if (res.code ===8000||res.code>8000) {
Message({
message: res.msg || 'Error',
type: 'error',
@ -120,7 +121,7 @@ api.interceptors.response.use(
})
return Promise.reject(res)
}
// return Promise.resolve(res)
return Promise.resolve(res)
},
error => {
Message({

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

@ -21,7 +21,7 @@
:default-checked-keys="publishAgency"
style="background-color:#f7f7f7"
:props="props"
:data="data"
:data="treeData"
show-checkbox
:default-expand-all="false" />
</el-form-item>
@ -34,12 +34,7 @@
@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"
@ -81,14 +76,13 @@
<el-form-item label="发布范围">
<el-tree style="background-color:#f7f7f7"
class="form_item"
ref="tree"
ref="selTree"
node-key="orgId"
:default-checked-keys="publishAgency"
:props="props"
:data="data"
:data="selTreeData"
show-checkbox
:default-expand-all="false"
disabled />
:default-expand-all="false" />
</el-form-item>
</el-form>
@ -147,7 +141,9 @@ export default {
children: 'subOrgList'
},
count: 1,
data: [],
treeData: [],
selTreeData: [],//
selAgencyList: [],
agencyArrayCopy: [],
@ -160,7 +156,7 @@ export default {
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()
},
@ -177,9 +173,14 @@ export default {
agencyId: customerId
}
this.$api.post(`/data/aggregator/org/agencytree`, params).then((res) => {
this.data = res.data || []
this.treeData = res.data || []
this.selTreeData = JSON.parse(JSON.stringify(this.treeData))
this.getProjectStatus()
})
},
//
getPublishAgency () {
let params = {
@ -200,17 +201,32 @@ export default {
}
this.publishAgency = res.data.orgList || []
this.$refs.tree.setCheckedNodes(this.publishAgency)
// this.processSelTreeData(this.selTreeData)
// this.$refs.selTree.setCheckedNodes(this.publishAgency)
})
},
processSelTreeData (array) {
array.forEach(element => {
element.disabled = true
if (element.subOrgList && element.subOrgList.length > 0) {
this.processSelTreeData(element.subOrgList)
}
});
},
//
resolveAgency () {
let selAll = this.$refs.tree.getCheckedNodes(false, false)
// console.log(selAll)
this.selAgencyList = []
this.agencyArrayCopy = JSON.parse(JSON.stringify(this.data))
this.agencyArrayCopy = JSON.parse(JSON.stringify(this.treeData))
selAll.forEach(element => {
// debugger
@ -218,7 +234,6 @@ export default {
this.resursionTree(this.agencyArrayCopy, orgId)
});
console.log(this.selAgencyList)
},
//
@ -256,7 +271,7 @@ export default {
},
publishProject () {
this.resolveAgency()
if (this.data.length > 0 && this.selAgencyList.length === 0) {
if (this.treeData.length > 0 && this.selAgencyList.length === 0) {
this.$message(
{
message: "请选择发布范围",

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

@ -94,7 +94,7 @@ export default {
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}`] ? '开' : '关'
}
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`] : ''

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

@ -323,10 +323,24 @@ export default {
this.$message.error('无表单有效反馈结果,无法导出')
return
}
// ajax.exportFilePost(
// url,
// this.tableParams,
// (data, rspMsg) => {
// this.download(data, title + '.xls')
// },
// (rspMsg, data) => {
// this.$message.error(rspMsg);
// }
// );
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/export`, {
params: this.queryConditions,
responseType: 'blob'
}).then(res => {
let blob = res
let downloadElement = document.createElement('a')
let href = window.URL.createObjectURL(blob) //

Loading…
Cancel
Save