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. 94
      src/views/form/editor/index.vue
  4. 2
      src/views/form/index.vue
  5. 137
      src/views/form/publish/index.vue
  6. 113
      src/views/form/statistics/analysis.vue
  7. 50
      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]
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({

1
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,

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

@ -4,8 +4,7 @@
<el-scrollbar class="left-scrollbar">
<div class="components-list">
<div v-for="(item, listIndex) in leftComponents"
:key="listIndex"
>
:key="listIndex">
<div class="components-title">
<svg-icon name="component" />
{{ item.title }}
@ -16,13 +15,11 @@
:sort="false"
class="components-draggable"
draggable=".components-item"
@end="onEnd"
>
@end="onEnd">
<div v-for="(element, index) in item.list"
:key="index"
class="components-item"
@click="addComponent(element)"
>
@click="addComponent(element)">
<div class="components-body">
<svg-icon :name="element.__config__.tagIcon" />
{{ element.__config__.label }}
@ -37,39 +34,33 @@
<el-scrollbar class="center-scrollbar">
<el-row v-if="formConf"
:gutter="formConf.gutter"
class="center-board-row"
>
class="center-board-row">
<el-row align="middle"
justify="center"
type="flex"
>
type="flex">
<el-col class="form-head-title">
<h4 class="form-name-text"
contenteditable="true"
@blur="(event)=>{
this.formConf.title=event.target.innerText;
this.saveProjectInfo()}"
>
this.saveProjectInfo()}">
{{ formConf.title }}
</h4>
</el-col>
</el-row>
<el-row align="middle"
justify="center"
type="flex"
>
type="flex">
<el-col class="form-head-desc">
<Tinymce v-if="editDescription"
v-model="formConf.description"
placeholder="请输入表单描述"
@blur="editDescription=false"
@input="saveProjectInfo"
/>
@input="saveProjectInfo" />
<div v-else
class="form-name-text"
@click="editDescription=true"
v-html="formConf.description"
/>
v-html="formConf.description" />
<!-- <p class="form-name-text" contenteditable="true"-->
<!-- @blur="(event)=>{-->
<!-- formConf.description=event.target.innerText;-->
@ -82,14 +73,12 @@
<el-form :disabled="formConf.disabled"
:label-position="formConf.labelPosition"
:label-width="formConf.labelWidth + 'px'"
:size="formConf.size"
>
:size="formConf.size">
<draggable :animation="340"
:list="drawingList"
class="drawing-board"
group="componentsGroup"
@end="onItemEnd"
>
@end="onItemEnd">
<draggable-item v-for="(item, index) in drawingList"
:key="item.renderKey"
:active-id="activeId"
@ -100,15 +89,12 @@
@activeItem="activeFormItem"
@changeLabel="changeLabel"
@copyItem="drawingItemCopy"
@deleteItem="drawingItemDelete"
/>
@deleteItem="drawingItemDelete" />
</draggable>
<div v-show="!drawingList.length"
class="empty-info"
>
class="empty-info">
<img style="width: 20%"
src="@/assets/images/form-bg.png"
>
src="@/assets/images/form-bg.png">
<p>从左侧拖入或点选组件进行表单设计</p>
</div>
</el-form>
@ -120,8 +106,7 @@
:form-conf="formConf"
:show-field="!!drawingList.length"
@tag-change="tagChange"
@data-change="updateProjectItemInfo"
/>
@data-change="updateProjectItemInfo" />
</div>
</template>
@ -154,7 +139,7 @@ export default {
RightPanel,
DraggableItem
},
data() {
data () {
return {
idGlobal,
formConf: null,
@ -200,7 +185,7 @@ export default {
computed: {},
watch: {
// eslint-disable-next-line func-names
'activeData.__config__.label': function(val, oldVal) {
'activeData.__config__.label': function (val, oldVal) {
if (
this.activeData.placeholder === undefined
|| !this.activeData.__config__.tag
@ -211,20 +196,20 @@ export default {
this.activeData.placeholder = this.activeData.placeholder.replace(oldVal, '') + val
},
activeId: {
handler(val) {
handler (val) {
oldActiveId = val
},
immediate: true
},
drawingList: {
handler(val) {
handler (val) {
this.saveDrawingListDebounce(val, this.projectKey)
if (val.length === 0) this.idGlobal = 100
},
deep: true
},
idGlobal: {
handler(val) {
handler (val) {
if (val) {
this.saveIdGlobalDebounce(val, this.projectKey)
}
@ -232,7 +217,7 @@ export default {
immediate: true
}
},
mounted() {
mounted () {
//
this.formConf = JSON.parse(JSON.stringify(formConf))
@ -253,7 +238,7 @@ export default {
})
},
methods: {
saveProjectInfo: debounce(430, true, function() {
saveProjectInfo: debounce(430, true, function () {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/update`, {
'key': this.projectKey,
'name': this.formConf.title,
@ -262,21 +247,22 @@ export default {
})
}),
updateProjectItemInfo(val) {
updateProjectItemInfo (val) {
let data = formItemConvertData(val, this.projectKey)
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/item/update`, data).then(() => {
})
},
deleteProjectItemInfo(val) {
deleteProjectItemInfo (val) {
let data = formItemConvertData(val, this.projectKey)
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/item/delete`, data).then(() => {
})
},
async saveProjectItemInfo(item) {
async saveProjectItemInfo (item) {
let isSuccess = false
let params = formItemConvertData(item, this.projectKey)
console.log(params)
let pItem = item
await this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/item/create`, params).then(res => {
pItem.sort = res.data.sort
@ -288,7 +274,7 @@ export default {
}
return isSuccess
},
updatePaginationList() {
updatePaginationList () {
//
const length = this.drawingList.filter(item => item.typeId === 'PAGINATION').length
let curr = 1
@ -300,22 +286,22 @@ export default {
}
})
},
queryProjectItems() {
queryProjectItems () {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/item/list`, { params: { key: this.projectKey } }).then(res => {
this.drawingList = res.data.map(item => dbDataConvertForItemJson(item))
//
this.updatePaginationList()
})
},
activeFormItem(currentItem) {
activeFormItem (currentItem) {
this.activeData = currentItem
this.activeId = currentItem.__config__.formId
},
changeLabel(currentItem, value) {
changeLabel (currentItem, value) {
console.log(currentItem)
console.log(value)
},
onEnd(obj) {
onEnd (obj) {
if (obj.from !== obj.to) {
this.activeData = tempActiveData
this.activeId = this.idGlobal
@ -324,7 +310,7 @@ export default {
})
}
},
onItemEnd(obj) {
onItemEnd (obj) {
let params = { 'projectKey': this.projectKey }
if (this.drawingList[obj.newIndex - 1]) {
let sort1 = this.drawingList[obj.newIndex - 1].sort
@ -341,13 +327,13 @@ export default {
})
}
},
addComponent(item) {
addComponent (item) {
const clone = this.cloneComponent(item)
this.saveProjectItemInfo(clone)
this.drawingList.push(clone)
this.activeFormItem(clone)
},
cloneComponent(origin) {
cloneComponent (origin) {
const clone = deepClone(origin)
const config = clone.__config__
config.span = this.formConf.span // span
@ -356,7 +342,7 @@ export default {
tempActiveData = clone
return tempActiveData
},
createIdAndKey(item) {
createIdAndKey (item) {
const config = item.__config__
config.formId = ++this.idGlobal
config.renderKey = `${config.formId}${+new Date()}` // renderKey
@ -372,7 +358,7 @@ export default {
}
return item
},
empty() {
empty () {
this.$confirm('确定要清空所有组件吗?', '提示', { type: 'warning' })
.then(
() => {
@ -381,14 +367,14 @@ export default {
}
)
},
drawingItemCopy(item, list) {
drawingItemCopy (item, list) {
let clone = deepClone(item)
clone = this.createIdAndKey(clone)
list.push(clone)
this.activeFormItem(clone)
this.saveProjectItemInfo(clone)
},
drawingItemDelete(index, list) {
drawingItemDelete (index, list) {
let item = list[index]
list.splice(index, 1)
this.$nextTick(() => {
@ -399,7 +385,7 @@ export default {
})
this.deleteProjectItemInfo(item)
},
tagChange(newTag) {
tagChange (newTag) {
newTag = this.cloneComponent(newTag)
const config = newTag.__config__
newTag.__vModel__ = this.activeData.__vModel__
@ -423,7 +409,7 @@ export default {
this.updateProjectItemInfo(newTag)
this.updateDrawingList(newTag, this.drawingList)
},
updateDrawingList(newTag, list) {
updateDrawingList (newTag, list) {
const index = list.findIndex(item => item.__config__.formId === this.activeId)
if (index > -1) {
list.splice(index, 1, newTag)

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

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

@ -17,9 +17,10 @@
<el-form-item label="发布范围">
<el-tree class="form_item"
ref="tree"
node-key="orgId"
style="background-color:#f7f7f7"
:props="props"
:data="data"
:data="treeData"
show-checkbox
:default-expand-all="false" />
</el-form-item>
@ -32,12 +33,11 @@
@click="publishProject">
<i class="el-icon-document-checked el-icon--right">发布</i>
</el-button>
<!-- <el-button class="publish-btn"
size="medium"
type="primary"
<!-- <el-button type="danger"
@click="resolveAgency">
<i class="el-icon-document-checked el-icon--right">获取组织</i>
禁用
</el-button> -->
</div>
</div>
<div v-if="publishStatus"
@ -70,9 +70,28 @@
<div>
<p class="success-title">恭喜您发布成功</p>
</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>
</div>
</div> -->
<el-row>
<el-col :offset="2"
:span="6">
@ -88,6 +107,7 @@
@click="stopPublishProject">
停止发布
</el-button>
</el-col>
<!-- <el-col :span="12">
<el-button type="warning"
@ -125,20 +145,26 @@ export default {
children: 'subOrgList'
},
count: 1,
data: [],
treeData: [],
selTreeData: [],//
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}`
this.getProjectStatus()
await this.loadAgencyList()
},
methods: {
clientChange (label) {
this.clientType = label
this.loadAgencyList()
@ -151,17 +177,69 @@ 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 = {
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 () {
let selAll = this.$refs.tree.getCheckedNodes(false, false)
// console.log(selAll)
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
@ -169,27 +247,28 @@ export default {
this.resursionTree(this.agencyArrayCopy, orgId)
});
console.log(this.selAgencyList)
},
//
resursionTree (orgArray, orgId) {
for (let i = 0; i < orgArray.length; i++) {
let item = orgArray[i]
// debugger
if (item && item.orgId === orgId) {
// debugger
orgArray[i].orgIds = orgArray[i].orgPids
orgArray[i].subOrgList = []
this.selAgencyList.push(orgArray[i])
orgArray[i] = {}
break
} else if (item.subOrgList && item.subOrgList.length > 0) {
// debugger
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 => {
if (res.data.status == 2) {
this.publishStatus = true
this.getPublishAgency()
} else {
this.publishStatus = false
this.loadAgencyList()
}
})
},
publishProject () {
this.resolveAgency()
if (this.data.length > 0 && this.selAgencyList.length === 0) {
if (this.treeData.length > 0 && this.selAgencyList.length === 0) {
this.$message(
{
message: "请选择发布范围",
@ -225,6 +305,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 +355,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;

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

@ -1,12 +1,11 @@
<template>
<div class="analysis">
<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="title">
<span style="font-size: 16px; font-weight: bold"
>Q{{ index + 1 }} {{ item.label }}{{ item.type }}</span
>
<span style="font-size: 16px; font-weight: bold">Q{{ index + 1 }} {{ item.label }}{{ item.type }}</span>
<!-- <div>
<span>图表类型</span>
@ -25,31 +24,31 @@
:chart-option="getCharData(item)"
: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.validTotal }} </span>
<span v-if="item.type === 'NUMBER_INPUT'"
>总计 {{ item.detail.sumTotal }}
<span v-if="item.type === 'NUMBER_INPUT'">总计 {{ item.detail.sumTotal }}
</span>
<span v-if="item.type === 'SWITCH'"
> {{ item.detail.openTotal }}
{{ item.detail.closedTotal }} </span
>
<span v-if="item.type === 'SWITCH'"> {{ item.detail.openTotal }}
{{ item.detail.closedTotal }} </span>
</div>
<div v-else-if="item.type === 'RATE'" class="cell-rate">
<div
v-for="(n, i) in item.detail.maxStarNum"
<div v-else-if="item.type === 'RATE'"
class="cell-rate">
<div v-for="(n, i) in item.detail.maxStarNum"
:key="i"
class="rate-item"
>
class="rate-item">
<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 class="rate-item-num">
{{ item.detail.starProfile[n] || 0 }}
</div>
</div>
<div class="rate-item">
<!-- <div class="rate-item">
<div class="rate-item-avg">平均星数</div>
<div class="rate-item-icon">
<el-rate
@ -59,20 +58,26 @@
>
</el-rate>
</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 v-else-if="item.type === 'RADIO' || item.type === 'CHECKBOX' || item.type === 'SELECT'"
class="cell-wrapper"
>
<div v-for="(n, i) in item.detail.options" :key="i" class="cell">
class="cell-wrapper">
<div v-for="(n, i) in item.detail.options"
:key="i"
class="cell">
<div class="cell-label">{{ n.label }}</div>
<div class="cell-value">
<div class="cell-progress">
<el-progress
:stroke-width="20"
<el-progress :stroke-width="20"
:show-text="false"
:percentage="computedPercent(n.currentCount, item.detail.totalCount)"
/>
:percentage="computedPercent(n.currentCount, item.detail.totalCount)" />
</div>
<div class="cell-percent">
{{ computedPercent(n.currentCount, item.detail.totalCount).toFixed(2) }}%
@ -81,16 +86,17 @@
</div>
</div>
</div>
<div v-else-if="item.type === 'CASCADER'" class="cell-wrapper">
<div v-for="(n, i) in item.detail.profile" :key="i" class="cell">
<div v-else-if="item.type === 'CASCADER'"
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-value">
<div class="cell-progress">
<el-progress
:stroke-width="20"
<el-progress :stroke-width="20"
:show-text="false"
:percentage="computedPercent(n, item.detail.totalCount)"
/>
:percentage="computedPercent(n, item.detail.totalCount)" />
</div>
<div class="cell-percent">
{{ computedPercent(n, item.detail.totalCount).toFixed(2) }}%
@ -103,16 +109,29 @@
<el-divider />
</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-table :data="dialogData" max-height="400" border>
<el-table-column type="index" label="序号" width="50" align="center">
<el-dialog :title="dialogTitle"
:visible.sync="dialogTableVisible"
: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">
{{ scope.row.index }}
</template> -->
</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="address" label="地址"></el-table-column> -->
</el-table>
@ -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,7 +301,7 @@ export default {
}
return config
},
getInputList(id, type) {
getInputList (id, type) {
this.$api
.post('/data/aggregator/questionnaire/itemresdetail-list', {
@ -302,7 +321,7 @@ export default {
})
})
},
getConcatList() {
getConcatList () {
this.$api
.post('/data/aggregator/questionnaire/itemresdetail-concat', {
@ -313,7 +332,7 @@ export default {
this.dialogHeader = res.data.tableHeaderList
})
},
async handleOpen(item) {
async handleOpen (item) {
if (item.type === 'SWITCH' || item.type === 'NUMBER_INPUT') return false
@ -328,13 +347,13 @@ export default {
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 {

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}`] ? '开' : '关'
}
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>

35
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"
@ -174,8 +174,10 @@ import { getCheckedColumn, saveCheckedColumn } from '@/utils/db'
const fixedDefaultFormColumn = ['serialNumber']
const fixedDefaultLabelFormColumn = { serialNumber: '提交序号' }
//
const fixedDefaultFormTailColumn = ['submitAddress', 'createdTime']
const fixedDefaultLabelFormTailColumn = { submitAddress: '提交地址', createdTime: '提交时间' }
// const fixedDefaultFormTailColumn = ['submitAddress', 'createdTime']
const fixedDefaultFormTailColumn = ['createdTime']
// const fixedDefaultLabelFormTailColumn = { submitAddress: '', createdTime: '' }
const fixedDefaultLabelFormTailColumn = { createdTime: '提交时间' }
export default {
name: 'ProjectStatisticsList',
@ -234,6 +236,7 @@ export default {
)
},
openDetailDrawerHandle (row) {
this.activeResultRow = row
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 => {
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) //

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

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

Loading…
Cancel
Save