Просмотр исходного кода

【updata】调整表单样式、操作列按钮样式,隐藏附件明细弹窗按钮

cfort 2 лет назад
Родитель
Сommit
29967fa0c9

+ 2 - 2
src/business/platform/form/formrender/dynamic-form/dynamic-form.vue

@@ -661,8 +661,8 @@
         box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
         margin: 0 auto;
         padding: 10px;
-        min-height: 92vh;
-        width: 84%;
+        min-height: calc(100vh - 120px);
+        width: 80%;
     }
     .jbd-replce {
         height: 5px;

+ 1 - 1
src/components/ibps-crud/index.vue

@@ -317,7 +317,7 @@
                     v-if="rowHandle"
                     v-bind="rowHandle"
                     :label=" handleAttribute(rowHandle.columnHeader,'操作') "
-                    :width="handleAttribute(rowHandle.width, rowHandleDefaultWidth) <80 ? '80' : this.rowHandle.actions.length !=0 && this.rowHandle.actions.length<=3 ? 90 + 50 * (this.rowHandle.actions.length - 1) : 90"
+                    :width="handleAttribute(rowHandle.width, rowHandleDefaultWidth) < 80 ? '80' : rowHandle.actions.length !== 0 && rowHandle.actions.length <= 3 ? 90 + 60 * (rowHandle.actions.length - 1) : 90"
                     :fixed="handleAttribute(rowHandle.fixed, 'right')"
                     :align="handleAttribute(rowHandle.align, 'center')"
                 >

+ 109 - 109
src/views/platform/file/attachment/detail.vue

@@ -56,127 +56,127 @@
 </template>
 
 <script>
-    import { get } from '@/api/platform/file/attachment'
-    import { downloadFile } from '@/business/platform/file/utils'
-    import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
-    import { fileTypes } from '@/business/platform/file/constants/fileTypes'
+import { get } from '@/api/platform/file/attachment'
+import { downloadFile } from '@/business/platform/file/utils'
+import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
+import { fileTypes } from '@/business/platform/file/constants/fileTypes'
 
-    export default {
-        props: {
-            visible: {
-                type: Boolean,
-                default: false
-            },
-            id: String,
-            data: [Object, String]
+export default {
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
         },
-        data() {
-            return {
-                formName: 'attachmentForm',
-                title: '系统附件明细',
-                formLabelWidth: '120px',
-                dialogVisible: this.visible,
-                dialogLoading: false,
-                filePreviewVisible: false,
-                attachment: {
-                    fileName: '',
-                    typeId: '',
-                    fileType: '',
-                    filePath: '',
-                    createTime: '',
-                    storeType: '',
-                    totalBytes: '',
-                    ext: '',
-                    note: '',
-                    creatorName: ''
-                },
-                toolbars: [
-                    { key: 'primary', icon: 'ibps-icon-eye', label: '预览' },
-                    {
-                        key: 'download',
-                        icon: 'ibps-icon-download',
-                        label: '下载'
-                    },
-                    { key: 'cancel' }
-                ],
-                fileOption: {
-                    user: {}
-                }
+        id: String,
+        data: [Object, String]
+    },
+    data () {
+        return {
+            formName: 'attachmentForm',
+            title: '系统附件明细',
+            formLabelWidth: '120px',
+            dialogVisible: this.visible,
+            dialogLoading: false,
+            filePreviewVisible: false,
+            attachment: {
+                fileName: '',
+                typeId: '',
+                fileType: '',
+                filePath: '',
+                createTime: '',
+                storeType: '',
+                totalBytes: '',
+                ext: '',
+                note: '',
+                creatorName: ''
+            },
+            toolbars: [
+                // { key: 'primary', icon: 'ibps-icon-eye', label: '预览' },
+                // {
+                //     key: 'download',
+                //     icon: 'ibps-icon-download',
+                //     label: '下载'
+                // },
+                { key: 'cancel', label: '关闭' }
+            ],
+            fileOption: {
+                user: {}
             }
+        }
+    },
+    computed: {
+        formId () {
+            return this.id
         },
-        computed: {
-            formId() {
-                return this.id
-            },
-            formData() {
-                return this.data
+        formData () {
+            return this.data
+        }
+    },
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+                console.log(this.data)
+            }
+            // immediate: true
+        }
+    },
+    created () {
+        this.getFormData()
+    },
+    methods: {
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'primary':
+                    this.filePreview()
+                    break
+                case 'download':
+                    this.handleDownload()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
             }
         },
-        watch: {
-            visible: {
-                handler: function (val, oldVal) {
-                    this.dialogVisible = this.visible
-                    console.log(this.data)
-                }
-                // immediate: true
+        handleDownload () {
+            downloadFile(this.attachment)
+        },
+        // 获取明细数据
+        getFormData () {
+            if (this.$utils.isEmpty(this.formId)) {
+                return
             }
+            get({ attachmentId: this.formId }).then((response) => {
+                this.attachment = response.data
+            }).catch(() => {})
         },
-        created() {
-            this.getFormData()
+        // 关闭当前窗口
+        closeDialog () {
+            this.$emit('close', false)
         },
-        methods: {
-            handleActionEvent({ key }) {
-                switch (key) {
-                    case 'primary':
-                        this.filePreview()
-                        break
-                    case 'download':
-                        this.handleDownload()
-                        break
-                    case 'cancel':
-                        this.closeDialog()
-                        break
-                    default:
-                        break
-                }
-            },
-            handleDownload() {
-                downloadFile(this.attachment)
-            },
-            // 获取明细数据
-            getFormData() {
-                if (this.$utils.isEmpty(this.formId)) {
-                    return
-                }
-                get({ attachmentId: this.formId }).then((response) => {
-                    this.attachment = response.data
-                }).catch(() => {})
-            },
-            // 关闭当前窗口
-            closeDialog() {
-                this.$emit('close', false)
-            },
-            filePreview () {
-                const { id, fileName, ext } = this.data
-                if (fileTypes.images.includes(ext)) {
-                    this.$message.warning('图片附件请直接在列表预览!')
-                    return
-                }
-                this.fileOption.user.id = this.$store.getters.userId
-                this.fileOption.user.name = this.$store.getters.name
-                this.fileOption.url = BASE_API() + SYSTEM_URL() + `/file/download?attachmentId=${id}`
-                this.fileOption.editUrl = BASE_API() + SYSTEM_URL() + `/file/editCallback?fileName=${fileName}&fileType=${ext}&id=${id}`
-                this.fileOption.title = fileName
-                this.fileOption.fileType = ext
-                // console.log(this.fileOption)
-                let routeData = this.$router.resolve({
-                    path: '/fileView',
-                    query: this.fileOption
-                })
-                window.open(routeData.href)
+        filePreview () {
+            const { id, fileName, ext } = this.data
+            if (fileTypes.images.includes(ext)) {
+                this.$message.warning('图片附件请直接在列表预览!')
+                return
             }
+            this.fileOption.user.id = this.$store.getters.userId
+            this.fileOption.user.name = this.$store.getters.name
+            this.fileOption.url = BASE_API() + SYSTEM_URL() + `/file/download?attachmentId=${id}`
+            this.fileOption.editUrl = BASE_API() + SYSTEM_URL() + `/file/editCallback?fileName=${fileName}&fileType=${ext}&id=${id}`
+            this.fileOption.title = fileName
+            this.fileOption.fileType = ext
+            // console.log(this.fileOption)
+            const routeData = this.$router.resolve({
+                path: '/fileView',
+                query: this.fileOption
+            })
+            window.open(routeData.href)
         }
     }
+}
 </script>
 <style lang="scss">
     .attachment-detail-dialog {