Commit f1ab0033 authored by xioln's avatar xioln

详情修改

parent 65ec8112
...@@ -22,6 +22,23 @@ ...@@ -22,6 +22,23 @@
:name="formItem.title" :name="formItem.title"
></slot> ></slot>
</van-field> </van-field>
<component
v-else-if="formItem.component.name === 'readable'"
v-show="
formItem.component.show ? !formItem.component.show : true
"
:value="formValue(form, formItem.key)"
:is="formItem.component.name"
:item="formItem"
:item-obj="formItem.component"
:form="form"
:type="formItem.component.type"
:name="formItem.key || ''"
:label="formItem.title || ''"
:rules="rules"
v-on="$listeners"
@handleSubmit="handleSubmit"
/>
<component <component
v-else v-else
v-model="form[formItem.key]" v-model="form[formItem.key]"
...@@ -68,6 +85,29 @@ export default { ...@@ -68,6 +85,29 @@ export default {
data () { data () {
return {} return {}
}, },
computed: {
formValue () {
return function (form, key) {
// 判断form为空
if (!form || Object.keys(form).length === 0) {
return
}
if (key && key.includes('.')) {
const keys = key.split('.')
let value = form
keys.forEach((k) => {
value = value[k] || ''
})
// 判断value不是对象
return typeof value !== 'object' ? value : ''
} else {
return form[key] || ''
}
}
}
},
created () { created () {
}, },
mounted () { }, mounted () { },
...@@ -93,14 +133,14 @@ export default { ...@@ -93,14 +133,14 @@ export default {
}) })
formItemData.forEach((item) => { formItemData.forEach((item) => {
if (item?.component && item?.component?.name) { if (item?.component && item?.component?.name) {
if ( if (item?.component?.name === 'el-input') {
item?.component?.name === 'readable' ||
item?.component?.name === 'el-input'
) {
// console.log(item)
Vue.component(item?.component?.name, (resolve) => { Vue.component(item?.component?.name, (resolve) => {
require(['./vanInput.vue'], resolve) require(['./vanInput.vue'], resolve)
}) })
} else if (item?.component?.name === 'readable') {
Vue.component(item?.component?.name, (resolve) => {
require(['./vanReadable.vue'], resolve)
})
} else if (item?.component?.name === 'el-radio') { } else if (item?.component?.name === 'el-radio') {
Vue.component(item?.component?.name, (resolve) => { Vue.component(item?.component?.name, (resolve) => {
require(['./vanRadio.vue'], resolve) require(['./vanRadio.vue'], resolve)
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
</div> </div>
</template> </template>
<script> <script>
import { getDictListByCode } from '@/api/taskDetail'
export default { export default {
props: { props: {
...@@ -62,10 +61,6 @@ export default { ...@@ -62,10 +61,6 @@ export default {
inputValue: { inputValue: {
deep: true, deep: true,
handler (val) { handler (val) {
console.log('this.item', this.item)
if (this.item.fildProp && this.item.fildProp.rule.dictTypeCode) {
this.getCode()
}
this.$emit('input', val, this.name) this.$emit('input', val, this.name)
} }
} }
...@@ -73,22 +68,6 @@ export default { ...@@ -73,22 +68,6 @@ export default {
methods: { methods: {
getVerifyCode () { getVerifyCode () {
this.$emit('getVerifyCode') this.$emit('getVerifyCode')
},
getCode () {
getDictListByCode(this.item.fildProp.rules.dictTypeCode).then(res => {
console.log(res)
if (!res || !res.items) {
return []
}
const list = res.items.content.map(row => {
return {
label: row.dictValue,
value: row.dictKey,
id: row.id,
parentId: row.parentId
}
})
})
} }
} }
} }
......
<template>
<div class="input">
<van-field
v-if="itemObj"
v-model="inputValue"
colon
v-bind="itemObj"
:readonly="itemObj.name === 'readable' ? true : false"
:name="name"
:label="label"
:type="itemObj.type"
:formatter="item.formatter"
>
<div v-if="itemObj.verifyIcon" slot="button">
<img :src="itemObj.verifyIcon" @click="getVerifyCode" />
</div>
</van-field>
</div>
</template>
<script>
import { getDictListByCode } from '@/api/taskDetail'
export default {
props: {
item: {
type: Object,
default: () => null
},
itemObj: {
type: Object,
default: () => null
},
value: {
type: String,
default: () => null
},
name: {
type: String,
default: () => null
},
label: {
type: String,
default: () => null
}
},
components: {
},
// 数据源 给组件分发数据用
data () {
return {
inputValue: ''
}
},
mounted () {
},
watch: {
value: {
deep: true,
immediate: true,
handler (val) {
if (val) {
this.getVal(val)
}
}
},
inputValue: {
deep: true,
handler (val) {
this.$emit('input', val, this.name)
}
}
},
methods: {
getVerifyCode () {
this.$emit('getVerifyCode')
},
getVal (val) {
if (this.itemObj && this.itemObj?.dictTypeCode) {
getDictListByCode(this.itemObj.dictTypeCode).then(res => {
if (!res || !res.items) {
return []
}
// 对象数组中朝找到对应的字典值
this.$set(this, 'inputValue', res.items.content.find(item => item.dictKey === this.value)?.dictValue)
}).catch(err => {
console.log(err)
this.$set(this, 'inputValue', '')
})
} else {
this.$set(this, 'inputValue', val)
}
}
}
}
</script>
<style lang="scss" scoped>
.input {
::v-deep .van-field__label {
width: auto;
}
img {
width: 70px;
height: 30px;
position: absolute;
top: 50%;
right: 0%;
transform: translate(-0%, -50%);
}
}
</style>
...@@ -13,6 +13,7 @@ import Pdfh5 from 'pdfh5' ...@@ -13,6 +13,7 @@ import Pdfh5 from 'pdfh5'
import 'pdfh5/css/pdfh5.css' import 'pdfh5/css/pdfh5.css'
import { get, post } from '@/utils/http' import { get, post } from '@/utils/http'
import moment from 'moment' import moment from 'moment'
import { getLayOut } from '@/api/taskDetail'
export default { export default {
name: 'Pdf', name: 'Pdf',
...@@ -43,7 +44,8 @@ export default { ...@@ -43,7 +44,8 @@ export default {
pdfh5: null, pdfh5: null,
filesList: [], filesList: [],
activeFile: 0, activeFile: 0,
option: [] option: [],
contentType: null
} }
}, },
watch: { watch: {
...@@ -59,16 +61,15 @@ export default { ...@@ -59,16 +61,15 @@ export default {
} }
}, },
computed: { computed: {
contentType () { // contentType () {
const defaultContentType = 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF' // const defaultContentType = 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF'
return 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF,ATTACH_FILE,MASTER_FILE' || defaultContentType // return 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF,ATTACH_FILE,MASTER_FILE' || defaultContentType
}, // },
eid () { eid () {
return 'id_' + this.$utils.guid().replaceAll('-', '') return 'id_' + this.$utils.guid().replaceAll('-', '')
} }
}, },
created () { created () {
console.log(this.url)
// if (this.url) { // if (this.url) {
// this.pdfUrl = this.url.split('devgace.avicgeneral.com')[1] // this.pdfUrl = this.url.split('devgace.avicgeneral.com')[1]
// } // }
...@@ -82,10 +83,25 @@ export default { ...@@ -82,10 +83,25 @@ export default {
// // renderType: 'canvas' // // renderType: 'canvas'
// // lazy: true // // lazy: true
// }) // })
this.getFormInfo()
},
methods: {
getFormInfo () {
getLayOut({ modelDefName: this.$route.query.dxClassname, layoutType: 'defaultInfo' }).then((res) => {
if (res.items.content.length) {
const jsonparse = JSON.parse(res.items.content[0].configDetails)
jsonparse.componentsData.forEach(item => {
if (item.name === '浏览') {
if (item.data[0]?.contentType) {
this.contentType = item.data[0].contentType
this.getFileId() this.getFileId()
this.getPdf(this.filesList[0]) this.getPdf(this.filesList[0])
}
}
})
}
})
}, },
methods: {
getPdf (file) { getPdf (file) {
get('/dfs/fileManager/preview', { objName: file.sourceIdType, objId: file.sourceId, linkId: file.id }).then(res => { get('/dfs/fileManager/preview', { objName: file.sourceIdType, objId: file.sourceId, linkId: file.id }).then(res => {
if (res.items.fileBase64) { if (res.items.fileBase64) {
...@@ -98,16 +114,13 @@ export default { ...@@ -98,16 +114,13 @@ export default {
getFileId () { getFileId () {
if (!this.basicData.objFileLinks) return if (!this.basicData.objFileLinks) return
const objFileLinks = this.basicData.objFileLinks const objFileLinks = this.basicData.objFileLinks
console.log('this.filterFilesByRuleType(objFileLinks)', this.filterFilesByRuleType(objFileLinks))
this.filesList = this.filterFilesByRuleType(objFileLinks).filter(item => item.name.includes('pdf')) this.filesList = this.filterFilesByRuleType(objFileLinks).filter(item => item.name.includes('pdf'))
console.log('this.basicData.objFileLinks', this.filesList)
const masterFile = this.filesList.find(file => file.contentType === 'MASTER_FILE' && file.target.fileExtension === 'pdf') const masterFile = this.filesList.find(file => file.contentType === 'MASTER_FILE' && file.target.fileExtension === 'pdf')
const masterFileIdx = this.filesList.findIndex(file => file.contentType === 'MASTER_FILE' && file.target.fileExtension === 'pdf') const masterFileIdx = this.filesList.findIndex(file => file.contentType === 'MASTER_FILE' && file.target.fileExtension === 'pdf')
if (masterFile) { if (masterFile) {
this.filesList.splice(masterFileIdx, 1) this.filesList.splice(masterFileIdx, 1)
this.filesList.unshift(masterFile) this.filesList.unshift(masterFile)
console.log('this.filesList', this.filesList)
} else { } else {
const signedFile = this.filesList.find(file => file.contentType === 'ATTACH_FILE') const signedFile = this.filesList.find(file => file.contentType === 'ATTACH_FILE')
const idx = this.filesList.findIndex(file => file.contentType === 'ATTACH_FILE') const idx = this.filesList.findIndex(file => file.contentType === 'ATTACH_FILE')
...@@ -117,7 +130,6 @@ export default { ...@@ -117,7 +130,6 @@ export default {
this.filesList.unshift(signedFile) this.filesList.unshift(signedFile)
} }
} }
console.log('this.filesList', this.filesList)
this.option = this.filesList.map(file => { this.option = this.filesList.map(file => {
return { text: file.name, value: file.targetId } return { text: file.name, value: file.targetId }
}) })
......
...@@ -41,31 +41,15 @@ export default { ...@@ -41,31 +41,15 @@ export default {
url: '', url: '',
form: {}, form: {},
formData: [ formData: [
// {
// title: '基本属性',
// split: 1,
// data: [
// {
// title: '名称',
// key: 'name',
// isBase: true,
// component: {
// name: 'readable',
// isStandard: true,
// disabled: true
// }
// }
// ]
// }
] ]
} }
}, },
created () { created () {
}, },
mounted () { async mounted () {
this.getFormData() await this.getFormData()
this.getForm() await this.getForm()
}, },
methods: { methods: {
async getForm () { async getForm () {
...@@ -78,9 +62,17 @@ export default { ...@@ -78,9 +62,17 @@ export default {
pageSize: 1, pageSize: 1,
searchItems: { items: [{ fieldName: 'id', operator: 'EQ', value: id }] }, searchItems: { items: [{ fieldName: 'id', operator: 'EQ', value: id }] },
sortItem: [{ fieldName: 'modifyTime', sortOrder: 'asc' }], sortItem: [{ fieldName: 'modifyTime', sortOrder: 'asc' }],
openProps: [{ name: 'objFileLinks', pageFrom: 1, pageSize: 9999, openProps: [{ name: 'target', pageFrom: 1, pageSize: 9999 }] }] openProps: [{ name: 'dxContext' }, { name: 'objFileLinks', openProps: [{ name: 'target', pageFrom: 1, pageSize: 9999 }] }]
} }
await this.$api.searchApi(this.$route.query.dxClassname, params).then((res) => { await this.$api.searchApi(this.$route.query.dxClassname, params).then((res) => {
// 将res.items.content[0]所有数据值转为string
res.items.content.forEach((item) => {
Object.keys(item).forEach((key) => {
if (typeof item[key] !== 'object') {
item[key] = String(item[key])
}
})
})
this.$set(this, 'form', res.items.content[0]) this.$set(this, 'form', res.items.content[0])
}) })
}, },
...@@ -88,13 +80,45 @@ export default { ...@@ -88,13 +80,45 @@ export default {
getLayOut({ modelDefName: this.$route.query.dxClassname, layoutType: 'defaultView' }).then((res) => { getLayOut({ modelDefName: this.$route.query.dxClassname, layoutType: 'defaultView' }).then((res) => {
if (res.items.content.length) { if (res.items.content.length) {
const jsonparse = JSON.parse(res.items.content[0].configDetails) const jsonparse = JSON.parse(res.items.content[0].configDetails)
console.log('jsonparse', jsonparse) this.fiiterData(jsonparse.formData)
jsonparse.formData.forEach(item => { }
})
},
fiiterData (formData) {
formData.forEach(item => {
if (item.title && item.title !== '关联文档') { if (item.title && item.title !== '关联文档') {
this.formData.push(item) // eslint-disable-next-line no-unused-vars
const that = this
const fd = {
title: item.title,
split: 1,
data: item.data.map(d => {
let show = false
if (d.component?.obscure) {
// eslint-disable-next-line no-eval
show = eval(d.component?.obscure.replace(/this/g, 'that'))
}
return {
title: d.title,
key: d.key,
disabled: d.disabled,
formatter: function (row) {
if (row && ['true', 'false'].includes(row)) {
return row === 'true' ? '是' : '否'
} else {
return row
}
},
component: {
name: d.component.name,
// options: d.component.options,
dictTypeCode: d.fildProp.type === 'DictDataVO' ? d.fildProp.rule.dictTypeCode : '',
show: show
}
} }
}) })
console.log('jsonparse', [...this.formData]) }
this.formData.push(fd)
} }
}) })
}, },
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<script> <script>
import { Notify } from 'vant' import { Notify } from 'vant'
import RSA from '../../utils/rsa.js' import RSA from '../../utils/rsa.js'
import DeeForm from '../../components/form/form' import DeeForm from '@/components/form/form'
import ChangePassword from '@/views/tabbar/changePassword' import ChangePassword from '@/views/tabbar/changePassword'
import { captchaLogin, extAccountCaptcha } from '../../api/user' import { captchaLogin, extAccountCaptcha } from '../../api/user'
export default { export default {
......
...@@ -62,7 +62,6 @@ export default { ...@@ -62,7 +62,6 @@ export default {
methods: { methods: {
// 跳转详情页面 // 跳转详情页面
goDetailsInfo (item) { goDetailsInfo (item) {
console.log('item', item)
this.$router.push({ this.$router.push({
path: `/taskDetails-${item.id}`, path: `/taskDetails-${item.id}`,
query: { query: {
...@@ -89,7 +88,6 @@ export default { ...@@ -89,7 +88,6 @@ export default {
var clientHeight = this.box.clientHeight var clientHeight = this.box.clientHeight
var scrollTop = this.box.scrollTop var scrollTop = this.box.scrollTop
var scrollHeight = this.box.scrollHeight var scrollHeight = this.box.scrollHeight
// console.log('scrollHeight', Math.abs(scrollHeight - (scrollTop + clientHeight)))
if (Math.abs(scrollHeight - (scrollTop + clientHeight)) < 20) { if (Math.abs(scrollHeight - (scrollTop + clientHeight)) < 20) {
this.curr++ this.curr++
this.debounce(this.dealWithtaskData()) this.debounce(this.dealWithtaskData())
...@@ -115,8 +113,8 @@ export default { ...@@ -115,8 +113,8 @@ export default {
<style lang='scss'> <style lang='scss'>
.todoList-lazyCell { .todoList-lazyCell {
overflow-y: auto; overflow-y: auto;
max-height: 600px; max-height: 400px;
height: 100%;
.taskItem { .taskItem {
font-size: 16px; font-size: 16px;
color: #000000; color: #000000;
......
...@@ -75,13 +75,10 @@ export default { ...@@ -75,13 +75,10 @@ export default {
}, },
computed: { computed: {
title () { title () {
return this.$route.query.title return this.$route.query.title || ''
} }
}, },
watch: { watch: {
showLoading (newVal, oldVal) {
console.log('newVal', newVal)
}
}, },
activated () { activated () {
if (sessionStorage.getItem('finishWork')) { if (sessionStorage.getItem('finishWork')) {
...@@ -265,7 +262,7 @@ export default { ...@@ -265,7 +262,7 @@ export default {
<style lang="scss"> <style lang="scss">
.todoList { .todoList {
overflow: hidden; overflow: auto;
box-sizing: border-box; box-sizing: border-box;
height: calc(100%); height: calc(100%);
...@@ -339,7 +336,6 @@ export default { ...@@ -339,7 +336,6 @@ export default {
.lazy-list { .lazy-list {
height: calc(100vh - 120px); height: calc(100vh - 120px);
.loading { .loading {
margin-top: 10px !important; margin-top: 10px !important;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment