Commit f1ab0033 authored by xioln's avatar xioln

详情修改

parent 65ec8112
......@@ -22,6 +22,23 @@
:name="formItem.title"
></slot>
</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
v-else
v-model="form[formItem.key]"
......@@ -68,6 +85,29 @@ export default {
data () {
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 () {
},
mounted () { },
......@@ -93,14 +133,14 @@ export default {
})
formItemData.forEach((item) => {
if (item?.component && item?.component?.name) {
if (
item?.component?.name === 'readable' ||
item?.component?.name === 'el-input'
) {
// console.log(item)
if (item?.component?.name === 'el-input') {
Vue.component(item?.component?.name, (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') {
Vue.component(item?.component?.name, (resolve) => {
require(['./vanRadio.vue'], resolve)
......
......@@ -17,7 +17,6 @@
</div>
</template>
<script>
import { getDictListByCode } from '@/api/taskDetail'
export default {
props: {
......@@ -62,10 +61,6 @@ export default {
inputValue: {
deep: true,
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)
}
}
......@@ -73,22 +68,6 @@ export default {
methods: {
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'
import 'pdfh5/css/pdfh5.css'
import { get, post } from '@/utils/http'
import moment from 'moment'
import { getLayOut } from '@/api/taskDetail'
export default {
name: 'Pdf',
......@@ -43,7 +44,8 @@ export default {
pdfh5: null,
filesList: [],
activeFile: 0,
option: []
option: [],
contentType: null
}
},
watch: {
......@@ -59,16 +61,15 @@ export default {
}
},
computed: {
contentType () {
const defaultContentType = 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF'
return 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF,ATTACH_FILE,MASTER_FILE' || defaultContentType
},
// contentType () {
// const defaultContentType = 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF'
// return 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF,ATTACH_FILE,MASTER_FILE' || defaultContentType
// },
eid () {
return 'id_' + this.$utils.guid().replaceAll('-', '')
}
},
created () {
console.log(this.url)
// if (this.url) {
// this.pdfUrl = this.url.split('devgace.avicgeneral.com')[1]
// }
......@@ -82,10 +83,25 @@ export default {
// // renderType: 'canvas'
// // lazy: true
// })
this.getFileId()
this.getPdf(this.filesList[0])
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.getPdf(this.filesList[0])
}
}
})
}
})
},
getPdf (file) {
get('/dfs/fileManager/preview', { objName: file.sourceIdType, objId: file.sourceId, linkId: file.id }).then(res => {
if (res.items.fileBase64) {
......@@ -98,16 +114,13 @@ export default {
getFileId () {
if (!this.basicData.objFileLinks) return
const objFileLinks = this.basicData.objFileLinks
console.log('this.filterFilesByRuleType(objFileLinks)', this.filterFilesByRuleType(objFileLinks))
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 masterFileIdx = this.filesList.findIndex(file => file.contentType === 'MASTER_FILE' && file.target.fileExtension === 'pdf')
if (masterFile) {
this.filesList.splice(masterFileIdx, 1)
this.filesList.unshift(masterFile)
console.log('this.filesList', this.filesList)
} else {
const signedFile = this.filesList.find(file => file.contentType === 'ATTACH_FILE')
const idx = this.filesList.findIndex(file => file.contentType === 'ATTACH_FILE')
......@@ -117,7 +130,6 @@ export default {
this.filesList.unshift(signedFile)
}
}
console.log('this.filesList', this.filesList)
this.option = this.filesList.map(file => {
return { text: file.name, value: file.targetId }
})
......
......@@ -41,31 +41,15 @@ export default {
url: '',
form: {},
formData: [
// {
// title: '基本属性',
// split: 1,
// data: [
// {
// title: '名称',
// key: 'name',
// isBase: true,
// component: {
// name: 'readable',
// isStandard: true,
// disabled: true
// }
// }
// ]
// }
]
}
},
created () {
},
mounted () {
this.getFormData()
this.getForm()
async mounted () {
await this.getFormData()
await this.getForm()
},
methods: {
async getForm () {
......@@ -78,9 +62,17 @@ export default {
pageSize: 1,
searchItems: { items: [{ fieldName: 'id', operator: 'EQ', value: id }] },
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) => {
// 将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])
})
},
......@@ -88,13 +80,45 @@ export default {
getLayOut({ modelDefName: this.$route.query.dxClassname, layoutType: 'defaultView' }).then((res) => {
if (res.items.content.length) {
const jsonparse = JSON.parse(res.items.content[0].configDetails)
console.log('jsonparse', jsonparse)
jsonparse.formData.forEach(item => {
if (item.title && item.title !== '关联文档') {
this.formData.push(item)
}
})
console.log('jsonparse', [...this.formData])
this.fiiterData(jsonparse.formData)
}
})
},
fiiterData (formData) {
formData.forEach(item => {
if (item.title && item.title !== '关联文档') {
// 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
}
}
})
}
this.formData.push(fd)
}
})
},
......
......@@ -35,7 +35,7 @@
<script>
import { Notify } from 'vant'
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 { captchaLogin, extAccountCaptcha } from '../../api/user'
export default {
......
......@@ -62,7 +62,6 @@ export default {
methods: {
// 跳转详情页面
goDetailsInfo (item) {
console.log('item', item)
this.$router.push({
path: `/taskDetails-${item.id}`,
query: {
......@@ -89,7 +88,6 @@ export default {
var clientHeight = this.box.clientHeight
var scrollTop = this.box.scrollTop
var scrollHeight = this.box.scrollHeight
// console.log('scrollHeight', Math.abs(scrollHeight - (scrollTop + clientHeight)))
if (Math.abs(scrollHeight - (scrollTop + clientHeight)) < 20) {
this.curr++
this.debounce(this.dealWithtaskData())
......@@ -115,8 +113,8 @@ export default {
<style lang='scss'>
.todoList-lazyCell {
overflow-y: auto;
max-height: 600px;
max-height: 400px;
height: 100%;
.taskItem {
font-size: 16px;
color: #000000;
......
......@@ -75,13 +75,10 @@ export default {
},
computed: {
title () {
return this.$route.query.title
return this.$route.query.title || ''
}
},
watch: {
showLoading (newVal, oldVal) {
console.log('newVal', newVal)
}
},
activated () {
if (sessionStorage.getItem('finishWork')) {
......@@ -265,7 +262,7 @@ export default {
<style lang="scss">
.todoList {
overflow: hidden;
overflow: auto;
box-sizing: border-box;
height: calc(100%);
......@@ -339,7 +336,6 @@ export default {
.lazy-list {
height: calc(100vh - 120px);
.loading {
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