diff --git a/src/api/index.js b/src/api/index.js index baaf02a..5280db0 100644 --- a/src/api/index.js +++ b/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({ diff --git a/src/utils/convert.js b/src/utils/convert.js index 4c36c6c..81829f1 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -16,6 +16,7 @@ import { * @param item */ export function formItemConvertData(item, projectKey) { + let data = { 'itemKey': item.__config__.name, 'moduleType': item.__config__.moduleType, diff --git a/src/views/form/editor/index.vue b/src/views/form/editor/index.vue index e1a27cd..2ebdecb 100644 --- a/src/views/form/editor/index.vue +++ b/src/views/form/editor/index.vue @@ -1,128 +1,113 @@ diff --git a/src/views/form/index.vue b/src/views/form/index.vue index 3b913ad..3d5af7b 100644 --- a/src/views/form/index.vue +++ b/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; } diff --git a/src/views/form/publish/index.vue b/src/views/form/publish/index.vue index 9e6308f..d2967fa 100644 --- a/src/views/form/publish/index.vue +++ b/src/views/form/publish/index.vue @@ -17,9 +17,10 @@ @@ -32,12 +33,11 @@ @click="publishProject"> 发布 - +

恭喜您,发布成功!

-
+ + + + {{publishClient}} + + + + + + + + @@ -88,6 +107,7 @@ @click="stopPublishProject"> 停止发布 + -
+
共收集 {{ item.detail.collectionTotal }} 条, 有效 {{ item.detail.validTotal }} 条 - ,总计 {{ item.detail.sumTotal }} + ,总计 {{ item.detail.sumTotal }} - ,开 {{ item.detail.openTotal }} 条,关 - {{ item.detail.closedTotal }} 条 + ,开 {{ item.detail.openTotal }} 条,关 + {{ item.detail.closedTotal }} 条
-
-
+
+
- +
{{ item.detail.starProfile[n] || 0 }} 次
-
+ +
+
平均星数
+
+ {{item.detail.avgStarNum}} + +
-
+ class="cell-wrapper"> +
{{ n.label }}
- +
{{ computedPercent(n.currentCount, item.detail.totalCount).toFixed(2) }}% @@ -81,16 +86,17 @@
-
-
+
+
{{ i }}
- +
{{ computedPercent(n, item.detail.totalCount).toFixed(2) }}% @@ -103,16 +109,29 @@
- + - - - + + + - + @@ -127,7 +146,7 @@ export default { components: { LineChart }, - data() { + data () { return { dialogTableVisible: false, dialogTitle: '', @@ -197,11 +216,11 @@ export default { ] } }, - mounted() { + mounted () { this.getData() }, methods: { - getData() { + getData () { // `${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/report/analysis` // params: { projectKey: this.$route.query.key } this.$api @@ -212,7 +231,7 @@ export default { this.list = res.data }) }, - getCharData(data) { + getCharData (data) { const config = { tooltip: { backgroundColor: 'rgba(255,255,255,0.8)', // 通过设置rgba调节背景颜色与透明度 @@ -282,8 +301,8 @@ export default { } return config }, - getInputList(id, type) { - + getInputList (id, type) { + this.$api .post('/data/aggregator/questionnaire/itemresdetail-list', { projectKey: this.$route.query.key, @@ -302,8 +321,8 @@ export default { }) }) }, - getConcatList() { - + getConcatList () { + this.$api .post('/data/aggregator/questionnaire/itemresdetail-concat', { projectKey: this.$route.query.key @@ -313,10 +332,10 @@ export default { this.dialogHeader = res.data.tableHeaderList }) }, - async handleOpen(item) { + async handleOpen (item) { if (item.type === 'SWITCH' || item.type === 'NUMBER_INPUT') return false - - + + if (item.moduleType && item.moduleType === 'concat') { this.dialogTitle = '联系人信息' await this.getConcatList() @@ -325,16 +344,16 @@ export default { this.dialogHeader.push(item) await this.getInputList(item.formItemId, item.type) } - + this.dialogTableVisible = true }, - handleClose() { + handleClose () { this.dialogHeader = [] this.dialogTitle = '' this.dialogData = [] this.dialogTableVisible = false }, - computedCount(type) { + computedCount (type) { const arr = [ 'PROVINCE_CITY', 'NUMBER_INPUT', @@ -349,7 +368,7 @@ export default { ] return arr.includes(type) }, - computedPercent(num, count) { + computedPercent (num, count) { return (num * 100) / count } } @@ -383,7 +402,7 @@ export default { .cell-type { padding-left: 10px; font-size: 14px; - color: #409EFF; + color: #409eff; cursor: pointer; } .cell-wrapper { diff --git a/src/views/form/statistics/item.vue b/src/views/form/statistics/item.vue index a4f63a7..a853130 100644 --- a/src/views/form/statistics/item.vue +++ b/src/views/form/statistics/item.vue @@ -1,96 +1,105 @@ @@ -100,8 +109,7 @@ export default { height: 106px; margin-right: 15px; margin-bottom: 15px; - border: 1px solid #EBEEF5; + border: 1px solid #ebeef5; background: #0001; } - diff --git a/src/views/form/statistics/list.vue b/src/views/form/statistics/list.vue index dc0e9f9..1c4bfb7 100644 --- a/src/views/form/statistics/list.vue +++ b/src/views/form/statistics/list.vue @@ -50,7 +50,7 @@ + prop="clientTypeShow" /> { 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 }) @@ -310,10 +325,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) // 创建下载的链接 diff --git a/src/views/form/statistics/public.vue b/src/views/form/statistics/public.vue index c73fecd..dad4ae3 100644 --- a/src/views/form/statistics/public.vue +++ b/src/views/form/statistics/public.vue @@ -24,8 +24,8 @@ - +