gaoshp
2024-06-16 060561221cb55a663a18cd69c934b8dc1185bac6
update
已添加1个文件
已修改5个文件
172 ■■■■ 文件已修改
src/components/scForm/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/scMyFilePreview.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/scui.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/document/index.vue 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/factory-file/index.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/file/admin/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/scForm/index.vue
@@ -4,7 +4,7 @@
 * @Author: sakuya
 * @Date: 2021å¹´9月22日09:26:25
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-13 22:50:27
 * @LastEditTime: 2024-06-16 15:18:05
-->
<template>
@@ -26,8 +26,8 @@
                        <!-- input -->
                        <template v-if="item.component == 'input'">
                            <el-input v-model="form[item.name]" :placeholder="item.options.placeholder" clearable
                                :maxlength="item.options.maxlength" show-word-limit
                                :disabled="item.disabled"></el-input>
                                :maxlength="item.options.maxlength" show-word-limit :disabled="item.disabled"
                                :type="item.type"></el-input>
                        </template>
                        <!-- checkbox -->
                        <template v-else-if="item.component == 'checkbox'">
src/components/scMyFilePreview.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
<!--
 * @Date: 2024-06-16 15:38:05
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-16 15:39:11
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/components/scMyFilePreview.vue
-->
<template>
    <div>
    </div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped></style>
src/scui.js
@@ -1,3 +1,9 @@
/*
 * @Date: 2024-03-23 09:49:06
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-16 15:38:54
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/scui.js
 */
import config from "./config"
import api from './api'
import tool from './utils/tool'
@@ -18,6 +24,7 @@
import scForm from './components/scForm'
import scTitle from './components/scTitle'
import scWaterMark from './components/scWaterMark'
import scMyFilePreview from './components/scMyFilePreview'
import scQrCode from './components/scQrCode'
import scStatusIndicator from './components/scMini/scStatusIndicator'
@@ -47,6 +54,7 @@
        //注册全局组件
        app.component('scTable', scTable);
        app.component('scTableColumn', scTableColumn);
        app.component('scMyFilePreview', scMyFilePreview);
        app.component('scFilterBar', scFilterBar);
        app.component('scUpload', scUpload);
        app.component('scUploadMultiple', scUploadMultiple);
@@ -72,11 +80,11 @@
        app.directive('copy', copy)
        //统一注册el-icon图标
        for(let icon in elIcons){
        for (let icon in elIcons) {
            app.component(`ElIcon${icon}`, elIcons[icon])
        }
        //统一注册sc-icon图标
        for(let icon in scIcons){
        for (let icon in scIcons) {
            app.component(`ScIcon${icon}`, scIcons[icon])
        }
src/views/dnc/document/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-05-16 22:40:01
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-11 19:19:41
 * @LastEditTime: 2024-06-16 15:35:03
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/document/index.vue
-->
<template>
@@ -11,9 +11,10 @@
                <el-aside width="200px">
                    <el-container>
                        <el-main>
                            <el-tree default-expand-all ref="tree" node-key="id" :data="treeData" :props="{
                                label: 'name',
                            }" @node-click="nodeClick" highlight-current :current-node-key="selectNode.id">
                            <el-tree expand-on-click-node default-expand-all ref="tree" node-key="id" :data="treeData"
                                :props="{
                                    label: 'name',
                                }" @node-click="nodeClick" highlight-current :current-node-key="selectNode.id">
                                <template #default="{ node, data }">
                                    <span :class="data.isGroup ? 'active' : ''" class="custom-tree-node">
                                        <span>{{
@@ -37,7 +38,7 @@
                            <template #dropdown>
                                <el-dropdown-menu>
                                    <el-dropdown-item @click="addFolder">文件夹</el-dropdown-item>
                                    <el-dropdown-item>文件</el-dropdown-item>
                                    <el-dropdown-item @click="addFile">文件</el-dropdown-item>
                                </el-dropdown-menu>
                            </template>
                        </el-dropdown>
@@ -107,8 +108,13 @@
                                    <el-button-group>
                                        <el-button text type="primary" size="small"
                                            @click="table_edit(scope.row, scope.$index)">编辑</el-button>
                                        <el-button text type="primary" size="small"
                                            @click="del([scope.row])">删除</el-button>
                                        <el-popconfirm width="220" title="确定将选择的数据删除" @confirm="del([scope.row], '0')">
                                            <template #reference>
                                                <el-button text type="primary" size="small">删除</el-button>
                                            </template>
                                        </el-popconfirm>
                                        <!-- <el-button text type="primary" size="small"
                                            @click="del([scope.row])">删除</el-button> -->
                                    </el-button-group>
                                </template>
                            </el-table-column>
@@ -150,6 +156,10 @@
                </div>
            </template>
        </el-dialog>
        <scDialog v-model="visible">
            <scForm ref="form" :config="config" :rules="rules1" v-model="form1" @submit="submit1">
            </scForm>
        </scDialog>
    </el-main>
</template>
@@ -157,6 +167,41 @@
export default {
    data() {
        return {
            visible: false,
            rules1: {
                name: [{
                    required: true, message: '必填'
                }],
                content: [{
                    required: true, message: '必填'
                }]
            },
            form1: {},
            config: {
                labelWidth: 120,
                formItems: [
                    {
                        component: 'input',
                        label: '文件名称',
                        name: 'name',
                        options: {
                            placeholder: '',
                            maxlength: 100,
                        }
                    },
                    {
                        component: 'input',
                        label: '文件内容',
                        type: 'textarea',
                        name: 'content',
                        options: {
                            multiple: false,
                            data: []
                        },
                        disabled: false
                    }
                ]
            },
            treeData: [],
            selectNode: {},
            visible: false,
@@ -201,6 +246,46 @@
        this.init()
    },
    methods: {
        addFile() {
            this.form1 = {}
            this.$refs?.form?.resetFields()
            this.visible = true
        },
        submit1() {
            // åˆ›å»ºæ–‡æœ¬å†…容
            const textContent = "这里是文本内容";
            // åˆ›å»ºBlob对象
            const blob = new Blob([this.form1.content], { type: 'text/plain' });
            // åˆ›å»ºFile对象
            const file = new File([blob], this.form1.name, { type: 'text/plain', lastModified: new Date().getTime() });
            const data = new FormData()
            data.append("file", file);
            this.$HTTP.post(`/api/blade-resource/oss/endpoint/put-file`, data).then(res => {
                if (res.success) {
                    this.$HTTP.post(`/api/blade-dnc/file/batch-save`, [{
                        name: `${this.form1.name}.txt`,
                        targetId: this.selectNode.id,
                        ossFile: {
                            attachId: res.data.attachId,
                            domain: res.data.domain,
                            link: res.data.link,
                            name: res.data.name,
                            originalName: res.data.originalName
                        }
                    }]).then(res => {
                        if (res.success) {
                            this.visible = false
                            this.search()
                        } else {
                            this.$message.error(res.msg)
                        }
                    })
                } else {
                    this.$message.error(res.msg)
                }
            })
        },
        init() {
            this.selectNode = {
                id: ''
src/views/dnc/factory-file/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-05-20 21:43:10
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-06 23:11:22
 * @LastEditTime: 2024-06-16 15:52:44
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/factory-file/index.vue
-->
<template>
@@ -20,16 +20,10 @@
                        :params="params" :apiObj="apiObj" @selection-change="selectionChange" stripe>
                        <el-table-column type="selection" width="50"></el-table-column>
                        <el-table-column label="文件名称" prop="filename">
                            <!-- <template #default="scope">
                                <el-icon style="margin-right: 4px;">
                                    <el-icon-folder v-if="scope.row.fileType === 1" />
                                    <el-icon-document v-else />
                                </el-icon>
                                <a v-if="scope.row.fileType === 1" @click="goCurrent(scope.row)"
                                    style="color: var(--el-color-primary);cursor: pointer;">{{ scope.row.name }}</a>
                                <a v-else @click="viewHis(scope.row)"
                                    style="color: var(--el-color-primary);cursor: pointer;">{{ scope.row.name }}</a>
                            </template> -->
                            <template #default="scope">
                                <a @click="goCurrent(scope.row)"
                                    style="color: var(--el-color-primary);cursor: pointer;">{{ scope.row.filename }}</a>
                            </template>
                        </el-table-column>
                        <el-table-column label="版本" prop="versionDesc"></el-table-column>
                        <el-table-column label="文件大小" prop="contentLength"></el-table-column>
@@ -39,7 +33,11 @@
                        <el-table-column label="操作" fixed="right" align="right" width="160">
                            <template #default="scope">
                                <el-button-group>
                                    <el-button text type="primary" size="small" @click="del([scope.row])">删除</el-button>
                                    <el-popconfirm width="220" title="确定将选择的数据删除" @confirm="del([scope.row], '0')">
                                        <template #reference>
                                            <el-button text type="primary" size="small">删除</el-button>
                                        </template>
                                    </el-popconfirm>
                                </el-button-group>
                            </template>
                        </el-table-column>
@@ -70,6 +68,11 @@
        }
    },
    methods: {
        goCurrent(row) {
            console.log(row)
            window.open(row.link)
            // this.$HTTP.get(row.link)
        },
        selectionChange(selection) {
            this.selection = selection
        },
src/views/dnc/file/admin/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-05-20 21:43:10
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-06 23:06:11
 * @LastEditTime: 2024-06-16 15:35:21
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/file/admin/index.vue
-->
<template>
@@ -49,8 +49,11 @@
                            <el-table-column label="操作" fixed="right" align="right" width="160">
                                <template #default="scope">
                                    <el-button-group>
                                        <el-button text type="primary" size="small"
                                            @click="del([scope.row])">删除</el-button>
                                        <el-popconfirm width="220" title="确定将选择的数据删除" @confirm="del([scope.row], '0')">
                                            <template #reference>
                                                <el-button text type="primary" size="small">删除</el-button>
                                            </template>
                                        </el-popconfirm>
                                    </el-button-group>
                                </template>
                            </el-table-column>