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

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

@ -21,7 +21,7 @@
:default-checked-keys="publishAgency" :default-checked-keys="publishAgency"
style="background-color:#f7f7f7" style="background-color:#f7f7f7"
:props="props" :props="props"
:data="data" :data="treeData"
show-checkbox show-checkbox
:default-expand-all="false" /> :default-expand-all="false" />
</el-form-item> </el-form-item>
@ -34,12 +34,7 @@
@click="publishProject"> @click="publishProject">
<i class="el-icon-document-checked el-icon--right">发布</i> <i class="el-icon-document-checked el-icon--right">发布</i>
</el-button> </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> </div>
<div v-if="publishStatus" <div v-if="publishStatus"
@ -81,14 +76,13 @@
<el-form-item label="发布范围"> <el-form-item label="发布范围">
<el-tree style="background-color:#f7f7f7" <el-tree style="background-color:#f7f7f7"
class="form_item" class="form_item"
ref="tree" ref="selTree"
node-key="orgId" node-key="orgId"
:default-checked-keys="publishAgency" :default-checked-keys="publishAgency"
:props="props" :props="props"
:data="data" :data="selTreeData"
show-checkbox show-checkbox
:default-expand-all="false" :default-expand-all="false" />
disabled />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -147,7 +141,9 @@ export default {
children: 'subOrgList' children: 'subOrgList'
}, },
count: 1, count: 1,
data: [], treeData: [],
selTreeData: [],//
selAgencyList: [], selAgencyList: [],
agencyArrayCopy: [], agencyArrayCopy: [],
@ -160,7 +156,7 @@ export default {
let url = window.location.protocol + '//' + window.location.host let url = window.location.protocol + '//' + window.location.host
this.writeLink = `${url}/${process.env.VUE_APP_PUBLIC_PATH}/s/${this.projectKey}` this.writeLink = `${url}/${process.env.VUE_APP_PUBLIC_PATH}/s/${this.projectKey}`
await this.loadAgencyList() await this.loadAgencyList()
this.getProjectStatus()
}, },
@ -177,9 +173,14 @@ export default {
agencyId: customerId agencyId: customerId
} }
this.$api.post(`/data/aggregator/org/agencytree`, params).then((res) => { 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 () { getPublishAgency () {
let params = { let params = {
@ -200,17 +201,32 @@ export default {
} }
this.publishAgency = res.data.orgList || [] 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 () { resolveAgency () {
let selAll = this.$refs.tree.getCheckedNodes(false, false) let selAll = this.$refs.tree.getCheckedNodes(false, false)
// console.log(selAll) // console.log(selAll)
this.selAgencyList = [] this.selAgencyList = []
this.agencyArrayCopy = JSON.parse(JSON.stringify(this.data)) this.agencyArrayCopy = JSON.parse(JSON.stringify(this.treeData))
selAll.forEach(element => { selAll.forEach(element => {
// debugger // debugger
@ -218,7 +234,6 @@ export default {
this.resursionTree(this.agencyArrayCopy, orgId) this.resursionTree(this.agencyArrayCopy, orgId)
}); });
console.log(this.selAgencyList)
}, },
// //
@ -256,7 +271,7 @@ export default {
}, },
publishProject () { publishProject () {
this.resolveAgency() this.resolveAgency()
if (this.data.length > 0 && this.selAgencyList.length === 0) { if (this.treeData.length > 0 && this.selAgencyList.length === 0) {
this.$message( this.$message(
{ {
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('至') : '' return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`].join('至') : ''
} }
if (this.projectItemData.type === 'SWITCH') { 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}`] : '' 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('无表单有效反馈结果,无法导出') this.$message.error('无表单有效反馈结果,无法导出')
return 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`, { this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/export`, {
params: this.queryConditions, params: this.queryConditions,
responseType: 'blob' responseType: 'blob'
}).then(res => { }).then(res => {
let blob = res let blob = res
let downloadElement = document.createElement('a') let downloadElement = document.createElement('a')
let href = window.URL.createObjectURL(blob) // let href = window.URL.createObjectURL(blob) //

Loading…
Cancel
Save