Browse Source

Merge branch 'release'

master
jiangyy 4 years ago
parent
commit
6a71f717eb
  1. 5
      src/api/index.js
  2. 1
      src/utils/convert.js
  3. 46
      src/views/form/editor/index.vue
  4. 2
      src/views/form/index.vue
  5. 137
      src/views/form/publish/index.vue
  6. 93
      src/views/form/statistics/analysis.vue
  7. 36
      src/views/form/statistics/item.vue
  8. 35
      src/views/form/statistics/list.vue
  9. 4
      src/views/form/statistics/public.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({

1
src/utils/convert.js

@ -16,6 +16,7 @@ import {
* @param item * @param item
*/ */
export function formItemConvertData(item, projectKey) { export function formItemConvertData(item, projectKey) {
let data = { let data = {
'itemKey': item.__config__.name, 'itemKey': item.__config__.name,
'moduleType': item.__config__.moduleType, 'moduleType': item.__config__.moduleType,

46
src/views/form/editor/index.vue

@ -4,8 +4,7 @@
<el-scrollbar class="left-scrollbar"> <el-scrollbar class="left-scrollbar">
<div class="components-list"> <div class="components-list">
<div v-for="(item, listIndex) in leftComponents" <div v-for="(item, listIndex) in leftComponents"
:key="listIndex" :key="listIndex">
>
<div class="components-title"> <div class="components-title">
<svg-icon name="component" /> <svg-icon name="component" />
{{ item.title }} {{ item.title }}
@ -16,13 +15,11 @@
:sort="false" :sort="false"
class="components-draggable" class="components-draggable"
draggable=".components-item" draggable=".components-item"
@end="onEnd" @end="onEnd">
>
<div v-for="(element, index) in item.list" <div v-for="(element, index) in item.list"
:key="index" :key="index"
class="components-item" class="components-item"
@click="addComponent(element)" @click="addComponent(element)">
>
<div class="components-body"> <div class="components-body">
<svg-icon :name="element.__config__.tagIcon" /> <svg-icon :name="element.__config__.tagIcon" />
{{ element.__config__.label }} {{ element.__config__.label }}
@ -37,39 +34,33 @@
<el-scrollbar class="center-scrollbar"> <el-scrollbar class="center-scrollbar">
<el-row v-if="formConf" <el-row v-if="formConf"
:gutter="formConf.gutter" :gutter="formConf.gutter"
class="center-board-row" class="center-board-row">
>
<el-row align="middle" <el-row align="middle"
justify="center" justify="center"
type="flex" type="flex">
>
<el-col class="form-head-title"> <el-col class="form-head-title">
<h4 class="form-name-text" <h4 class="form-name-text"
contenteditable="true" contenteditable="true"
@blur="(event)=>{ @blur="(event)=>{
this.formConf.title=event.target.innerText; this.formConf.title=event.target.innerText;
this.saveProjectInfo()}" this.saveProjectInfo()}">
>
{{ formConf.title }} {{ formConf.title }}
</h4> </h4>
</el-col> </el-col>
</el-row> </el-row>
<el-row align="middle" <el-row align="middle"
justify="center" justify="center"
type="flex" type="flex">
>
<el-col class="form-head-desc"> <el-col class="form-head-desc">
<Tinymce v-if="editDescription" <Tinymce v-if="editDescription"
v-model="formConf.description" v-model="formConf.description"
placeholder="请输入表单描述" placeholder="请输入表单描述"
@blur="editDescription=false" @blur="editDescription=false"
@input="saveProjectInfo" @input="saveProjectInfo" />
/>
<div v-else <div v-else
class="form-name-text" class="form-name-text"
@click="editDescription=true" @click="editDescription=true"
v-html="formConf.description" v-html="formConf.description" />
/>
<!-- <p class="form-name-text" contenteditable="true"--> <!-- <p class="form-name-text" contenteditable="true"-->
<!-- @blur="(event)=>{--> <!-- @blur="(event)=>{-->
<!-- formConf.description=event.target.innerText;--> <!-- formConf.description=event.target.innerText;-->
@ -82,14 +73,12 @@
<el-form :disabled="formConf.disabled" <el-form :disabled="formConf.disabled"
:label-position="formConf.labelPosition" :label-position="formConf.labelPosition"
:label-width="formConf.labelWidth + 'px'" :label-width="formConf.labelWidth + 'px'"
:size="formConf.size" :size="formConf.size">
>
<draggable :animation="340" <draggable :animation="340"
:list="drawingList" :list="drawingList"
class="drawing-board" class="drawing-board"
group="componentsGroup" group="componentsGroup"
@end="onItemEnd" @end="onItemEnd">
>
<draggable-item v-for="(item, index) in drawingList" <draggable-item v-for="(item, index) in drawingList"
:key="item.renderKey" :key="item.renderKey"
:active-id="activeId" :active-id="activeId"
@ -100,15 +89,12 @@
@activeItem="activeFormItem" @activeItem="activeFormItem"
@changeLabel="changeLabel" @changeLabel="changeLabel"
@copyItem="drawingItemCopy" @copyItem="drawingItemCopy"
@deleteItem="drawingItemDelete" @deleteItem="drawingItemDelete" />
/>
</draggable> </draggable>
<div v-show="!drawingList.length" <div v-show="!drawingList.length"
class="empty-info" class="empty-info">
>
<img style="width: 20%" <img style="width: 20%"
src="@/assets/images/form-bg.png" src="@/assets/images/form-bg.png">
>
<p>从左侧拖入或点选组件进行表单设计</p> <p>从左侧拖入或点选组件进行表单设计</p>
</div> </div>
</el-form> </el-form>
@ -120,8 +106,7 @@
:form-conf="formConf" :form-conf="formConf"
:show-field="!!drawingList.length" :show-field="!!drawingList.length"
@tag-change="tagChange" @tag-change="tagChange"
@data-change="updateProjectItemInfo" @data-change="updateProjectItemInfo" />
/>
</div> </div>
</template> </template>
@ -277,6 +262,7 @@ export default {
async saveProjectItemInfo (item) { async saveProjectItemInfo (item) {
let isSuccess = false let isSuccess = false
let params = formItemConvertData(item, this.projectKey) let params = formItemConvertData(item, this.projectKey)
console.log(params)
let pItem = item let pItem = item
await this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/item/create`, params).then(res => { await this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/item/create`, params).then(res => {
pItem.sort = res.data.sort pItem.sort = res.data.sort

2
src/views/form/index.vue

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

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

@ -17,9 +17,10 @@
<el-form-item label="发布范围"> <el-form-item label="发布范围">
<el-tree class="form_item" <el-tree class="form_item"
ref="tree" ref="tree"
node-key="orgId"
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>
@ -32,12 +33,11 @@
@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" <!-- <el-button type="danger"
size="medium"
type="primary"
@click="resolveAgency"> @click="resolveAgency">
<i class="el-icon-document-checked el-icon--right">获取组织</i> 禁用
</el-button> --> </el-button> -->
</div> </div>
</div> </div>
<div v-if="publishStatus" <div v-if="publishStatus"
@ -70,9 +70,28 @@
<div> <div>
<p class="success-title">恭喜您发布成功</p> <p class="success-title">恭喜您发布成功</p>
</div> </div>
<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="selTree"
node-key="orgId"
:default-checked-keys="publishAgency"
:props="props"
:data="selTreeData"
show-checkbox
:default-expand-all="false" />
</el-form-item>
</el-form>
<!-- <div>
<p class="link-text"> {{ writeLink }}</p> <p class="link-text"> {{ writeLink }}</p>
</div> </div> -->
<el-row> <el-row>
<el-col :offset="2" <el-col :offset="2"
:span="6"> :span="6">
@ -88,6 +107,7 @@
@click="stopPublishProject"> @click="stopPublishProject">
停止发布 停止发布
</el-button> </el-button>
</el-col> </el-col>
<!-- <el-col :span="12"> <!-- <el-col :span="12">
<el-button type="warning" <el-button type="warning"
@ -125,20 +145,26 @@ export default {
children: 'subOrgList' children: 'subOrgList'
}, },
count: 1, count: 1,
data: [], treeData: [],
selTreeData: [],//
selAgencyList: [], selAgencyList: [],
agencyArrayCopy: [] agencyArrayCopy: [],
publishClient: '',
publishAgency: []//
} }
}, },
mounted () { async mounted () {
this.projectKey = this.$route.query.key this.projectKey = this.$route.query.key
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}`
this.getProjectStatus() await this.loadAgencyList()
}, },
methods: { methods: {
clientChange (label) { clientChange (label) {
this.clientType = label this.clientType = label
this.loadAgencyList() this.loadAgencyList()
@ -151,17 +177,69 @@ 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 () {
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.processSelTreeData(this.selTreeData)
this.publishAgency = res.data.orgList || []
// this.processSelTreeData(this.selTreeData)
this.$refs.selTree.setCheckedKeys(this.publishAgency)
this.processSelTreeData(this.selTreeData)
// this.$refs.selTree.setCheckedNodes(this.publishAgency)
})
},
disableditem () {
this.processSelTreeData(this.selTreeData)
},
processSelTreeData (array) {
array.forEach(element => {
element.disabled = true
if (element.subOrgList && element.subOrgList.length > 0) {
this.processSelTreeData(element.subOrgList)
}
});
console.log(this.selTreeData)
},
// //
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
@ -169,27 +247,28 @@ export default {
this.resursionTree(this.agencyArrayCopy, orgId) this.resursionTree(this.agencyArrayCopy, orgId)
}); });
console.log(this.selAgencyList)
}, },
// //
resursionTree (orgArray, orgId) { resursionTree (orgArray, orgId) {
for (let i = 0; i < orgArray.length; i++) { for (let i = 0; i < orgArray.length; i++) {
let item = orgArray[i] let item = orgArray[i]
// debugger
if (item && item.orgId === orgId) { if (item && item.orgId === orgId) {
// debugger orgArray[i].orgIds = orgArray[i].orgPids
orgArray[i].subOrgList = []
this.selAgencyList.push(orgArray[i]) this.selAgencyList.push(orgArray[i])
orgArray[i] = {} orgArray[i] = {}
break break
} else if (item.subOrgList && item.subOrgList.length > 0) { } else if (item.subOrgList && item.subOrgList.length > 0) {
// debugger
this.resursionTree(item.subOrgList, orgId) this.resursionTree(item.subOrgList, orgId)
} }
} }
// console.log(this.agencyArrayCopy) console.log(this.selAgencyList)
}, },
@ -198,15 +277,16 @@ export default {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/${this.projectKey}`).then(res => { this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/${this.projectKey}`).then(res => {
if (res.data.status == 2) { if (res.data.status == 2) {
this.publishStatus = true this.publishStatus = true
this.getPublishAgency()
} else { } else {
this.publishStatus = false this.publishStatus = false
this.loadAgencyList()
} }
}) })
}, },
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: "请选择发布范围",
@ -225,6 +305,7 @@ export default {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/publish`, this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/publish`,
params).then(() => { params).then(() => {
this.publishStatus = true this.publishStatus = true
this.getPublishAgency()
this.$parent.getProjectStatus() this.$parent.getProjectStatus()
this.msgSuccess('发布成功') this.msgSuccess('发布成功')
}) })
@ -274,16 +355,22 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.age_title {
width: 100px;
align-items: left;
}
.publish-container { .publish-container {
width: 100%; width: 100vw;
height: 100%; height: 100%;
padding: 0; padding: 0;
margin: 0; margin: 0;
background-color: #f7f7f7; background-color: #f7f7f7;
min-height: 84vh; min-height: 84vh;
display: flex; display: flex;
align-items: center; padding-top: 150px;
justify-content: center; padding-left: 350px;
// align-items: center;
// justify-content: center;
} }
.publish-btn-view { .publish-btn-view {
width: 800px; width: 800px;

93
src/views/form/statistics/analysis.vue

@ -1,12 +1,11 @@
<template> <template>
<div class="analysis"> <div class="analysis">
<div v-if="list.length && list.length !== 0"> <div v-if="list.length && list.length !== 0">
<div v-for="(item, index) in list" :key="index"> <div v-for="(item, index) in list"
:key="index">
<div class="content"> <div class="content">
<div class="title"> <div class="title">
<span style="font-size: 16px; font-weight: bold" <span style="font-size: 16px; font-weight: bold">Q{{ index + 1 }} {{ item.label }}{{ item.type }}</span>
>Q{{ index + 1 }} {{ item.label }}{{ item.type }}</span
>
<!-- <div> <!-- <div>
<span>图表类型</span> <span>图表类型</span>
@ -25,31 +24,31 @@
:chart-option="getCharData(item)" :chart-option="getCharData(item)"
:width="'90vw'" :width="'90vw'"
/> --> /> -->
<div v-if="computedCount(item.type)" class="cell-type" @click="handleOpen(item)"> <div v-if="computedCount(item.type)"
class="cell-type"
@click="handleOpen(item)">
<span>共收集 {{ item.detail.collectionTotal }} </span> <span>共收集 {{ item.detail.collectionTotal }} </span>
<span>有效 {{ item.detail.validTotal }} </span> <span>有效 {{ item.detail.validTotal }} </span>
<span v-if="item.type === 'NUMBER_INPUT'" <span v-if="item.type === 'NUMBER_INPUT'">总计 {{ item.detail.sumTotal }}
>总计 {{ item.detail.sumTotal }}
</span> </span>
<span v-if="item.type === 'SWITCH'" <span v-if="item.type === 'SWITCH'"> {{ item.detail.openTotal }}
> {{ item.detail.openTotal }} {{ item.detail.closedTotal }} </span>
{{ item.detail.closedTotal }} </span
>
</div> </div>
<div v-else-if="item.type === 'RATE'" class="cell-rate"> <div v-else-if="item.type === 'RATE'"
<div class="cell-rate">
v-for="(n, i) in item.detail.maxStarNum" <div v-for="(n, i) in item.detail.maxStarNum"
:key="i" :key="i"
class="rate-item" class="rate-item">
>
<div class="rate-item-icon"> <div class="rate-item-icon">
<el-rate :value="n" disabled text-color="#ff9900"> </el-rate> <el-rate :value="n"
disabled
text-color="#ff9900"> </el-rate>
</div> </div>
<div class="rate-item-num"> <div class="rate-item-num">
{{ item.detail.starProfile[n] || 0 }} {{ item.detail.starProfile[n] || 0 }}
</div> </div>
</div> </div>
<div class="rate-item"> <!-- <div class="rate-item">
<div class="rate-item-avg">平均星数</div> <div class="rate-item-avg">平均星数</div>
<div class="rate-item-icon"> <div class="rate-item-icon">
<el-rate <el-rate
@ -59,20 +58,26 @@
> >
</el-rate> </el-rate>
</div> </div>
</div> -->
<div class="rate-item">
<div class="rate-item-avg">平均星数</div>
<div class="rate-item-icon">
<span>{{item.detail.avgStarNum}}</span>
</div>
</div> </div>
</div> </div>
<div v-else-if="item.type === 'RADIO' || item.type === 'CHECKBOX' || item.type === 'SELECT'" <div v-else-if="item.type === 'RADIO' || item.type === 'CHECKBOX' || item.type === 'SELECT'"
class="cell-wrapper" class="cell-wrapper">
> <div v-for="(n, i) in item.detail.options"
<div v-for="(n, i) in item.detail.options" :key="i" class="cell"> :key="i"
class="cell">
<div class="cell-label">{{ n.label }}</div> <div class="cell-label">{{ n.label }}</div>
<div class="cell-value"> <div class="cell-value">
<div class="cell-progress"> <div class="cell-progress">
<el-progress <el-progress :stroke-width="20"
:stroke-width="20"
:show-text="false" :show-text="false"
:percentage="computedPercent(n.currentCount, item.detail.totalCount)" :percentage="computedPercent(n.currentCount, item.detail.totalCount)" />
/>
</div> </div>
<div class="cell-percent"> <div class="cell-percent">
{{ computedPercent(n.currentCount, item.detail.totalCount).toFixed(2) }}% {{ computedPercent(n.currentCount, item.detail.totalCount).toFixed(2) }}%
@ -81,16 +86,17 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="item.type === 'CASCADER'" class="cell-wrapper"> <div v-else-if="item.type === 'CASCADER'"
<div v-for="(n, i) in item.detail.profile" :key="i" class="cell"> class="cell-wrapper">
<div v-for="(n, i) in item.detail.profile"
:key="i"
class="cell">
<div class="cell-label">{{ i }}</div> <div class="cell-label">{{ i }}</div>
<div class="cell-value"> <div class="cell-value">
<div class="cell-progress"> <div class="cell-progress">
<el-progress <el-progress :stroke-width="20"
:stroke-width="20"
:show-text="false" :show-text="false"
:percentage="computedPercent(n, item.detail.totalCount)" :percentage="computedPercent(n, item.detail.totalCount)" />
/>
</div> </div>
<div class="cell-percent"> <div class="cell-percent">
{{ computedPercent(n, item.detail.totalCount).toFixed(2) }}% {{ computedPercent(n, item.detail.totalCount).toFixed(2) }}%
@ -103,16 +109,29 @@
<el-divider /> <el-divider />
</div> </div>
</div> </div>
<data-empty v-else style="padding: 20px" desc="暂无数据分析" /> <data-empty v-else
style="padding: 20px"
desc="暂无数据分析" />
<el-dialog :title="dialogTitle" :visible.sync="dialogTableVisible" :close-on-click-modal="false" @close="handleClose"> <el-dialog :title="dialogTitle"
<el-table :data="dialogData" max-height="400" border> :visible.sync="dialogTableVisible"
<el-table-column type="index" label="序号" width="50" align="center"> :close-on-click-modal="false"
@close="handleClose">
<el-table :data="dialogData"
max-height="400"
border>
<el-table-column type="index"
label="序号"
width="50"
align="center">
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
{{ scope.row.index }} {{ scope.row.index }}
</template> --> </template> -->
</el-table-column> </el-table-column>
<el-table-column v-for="item in dialogHeader" :key="item.formItemId" :prop="item.formItemId" :label="item.label" /> <el-table-column v-for="item in dialogHeader"
:key="item.formItemId"
:prop="item.formItemId"
:label="item.label" />
<!-- <el-table-column property="name" label="姓名" width="200"></el-table-column> <!-- <el-table-column property="name" label="姓名" width="200"></el-table-column>
<el-table-column property="address" label="地址"></el-table-column> --> <el-table-column property="address" label="地址"></el-table-column> -->
</el-table> </el-table>
@ -383,7 +402,7 @@ export default {
.cell-type { .cell-type {
padding-left: 10px; padding-left: 10px;
font-size: 14px; font-size: 14px;
color: #409EFF; color: #409eff;
cursor: pointer; cursor: pointer;
} }
.cell-wrapper { .cell-wrapper {

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

@ -4,20 +4,22 @@
<div v-if="getItemValue['files']"> <div v-if="getItemValue['files']">
<!-- 图片文件渲染图片栏 --> <!-- 图片文件渲染图片栏 -->
<template v-if="getItemValue['type'] == 'image'"> <template v-if="getItemValue['type'] == 'image'">
<span v-for="file in getItemValue['files']" :key="JSON.stringify(file)"> <span v-for="file in getItemValue['files']"
<el-image class="item-thumbnail-image-preview" :src="file.url" :preview-src-list="getItemValue['files'].map( img => img.url)" lazy /> :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> </span>
</template> </template>
<!-- 其他文件渲染文件下载链接 --> <!-- 其他文件渲染文件下载链接 -->
<template v-else> <template v-else>
<el-link <el-link v-for="file in getItemValue['files']"
v-for="file in getItemValue['files']"
:key="file" :key="file"
:href="file.url" target="_blank" :href="file.url"
type="primary" target="_blank"
> type="primary">
<span> {{ file.fileName }}</span> <span> {{ file.fileName }}</span>
</el-link> </el-link>
</template> </template>
@ -25,8 +27,12 @@
<span v-else>/</span> <span v-else>/</span>
</div> </div>
<div v-else-if="projectItemData.type=='SIGN_PAD'"> <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>
<div v-else> <div v-else>
{{ getItemValue || '/' }} {{ getItemValue || '/' }}
</div> </div>
@ -56,7 +62,7 @@ export default {
}, },
computed: { computed: {
processData () { processData () {
console.log('数据', this.projectItemData)
return this.resultData ? this.resultData['processData'] : {} return this.resultData ? this.resultData['processData'] : {}
}, },
getItemValue () { getItemValue () {
@ -64,6 +70,7 @@ export default {
// lable+ // lable+
return this.processData[`field${this.fieldItemId}`] + ':' + this.processData[`field${this.fieldItemId}other`] return this.processData[`field${this.fieldItemId}`] + ':' + this.processData[`field${this.fieldItemId}other`]
} }
if (this.projectItemData.type === 'INPUT_MAP') { if (this.projectItemData.type === 'INPUT_MAP') {
// let _value = this.processData[`field${this.fieldItemId}`][2] // let _value = this.processData[`field${this.fieldItemId}`][2]
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`][2] : '' return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`][2] : ''
@ -86,11 +93,13 @@ export default {
if (this.projectItemData.type === 'TIME_RANGE') { 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}`] ? '开' : '关'
}
return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`] : '' return this.processData[`field${this.fieldItemId}`] ? this.processData[`field${this.fieldItemId}`] : ''
} }
} },
} }
</script> </script>
@ -100,8 +109,7 @@ export default {
height: 106px; height: 106px;
margin-right: 15px; margin-right: 15px;
margin-bottom: 15px; margin-bottom: 15px;
border: 1px solid #EBEEF5; border: 1px solid #ebeef5;
background: #0001; background: #0001;
} }
</style> </style>

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

@ -50,7 +50,7 @@
<el-table-column label="组织/部门/网格" <el-table-column label="组织/部门/网格"
prop="orgName" /> prop="orgName" />
<el-table-column label="来源" <el-table-column label="来源"
prop="clientType" /> prop="clientTypeShow" />
<!-- <el-table-column label="填写时间" prop="createdTime" /> --> <!-- <el-table-column label="填写时间" prop="createdTime" /> -->
<el-table-column v-for="col in otherCustomColumns" <el-table-column v-for="col in otherCustomColumns"
@ -174,8 +174,10 @@ import { getCheckedColumn, saveCheckedColumn } from '@/utils/db'
const fixedDefaultFormColumn = ['serialNumber'] const fixedDefaultFormColumn = ['serialNumber']
const fixedDefaultLabelFormColumn = { serialNumber: '提交序号' } const fixedDefaultLabelFormColumn = { serialNumber: '提交序号' }
// //
const fixedDefaultFormTailColumn = ['submitAddress', 'createdTime'] // const fixedDefaultFormTailColumn = ['submitAddress', 'createdTime']
const fixedDefaultLabelFormTailColumn = { submitAddress: '提交地址', createdTime: '提交时间' } const fixedDefaultFormTailColumn = ['createdTime']
// const fixedDefaultLabelFormTailColumn = { submitAddress: '', createdTime: '' }
const fixedDefaultLabelFormTailColumn = { createdTime: '提交时间' }
export default { export default {
name: 'ProjectStatisticsList', name: 'ProjectStatisticsList',
@ -234,6 +236,7 @@ export default {
) )
}, },
openDetailDrawerHandle (row) { openDetailDrawerHandle (row) {
this.activeResultRow = row this.activeResultRow = row
this.detailDrawer = true this.detailDrawer = true
}, },
@ -254,6 +257,18 @@ export default {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/page`, { params: this.queryConditions }).then(res => { 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 let { records, total, size } = res.data
this.projectResultList = records 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.total = total
this.queryConditions.size = size this.queryConditions.size = size
}) })
@ -310,10 +325,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) //

4
src/views/form/statistics/public.vue

@ -24,8 +24,8 @@
</el-table-column> </el-table-column>
<el-table-column label="提交序号" <el-table-column label="提交序号"
prop="serialNumber" /> prop="serialNumber" />
<el-table-column label="提交地址" <!-- <el-table-column label="提交地址"
prop="submitAddress" /> prop="submitAddress" /> -->
<el-table-column label="提交时间" <el-table-column label="提交时间"
prop="createdTime" /> prop="createdTime" />
</el-table> </el-table>

Loading…
Cancel
Save