Browse Source

Merge branch 'master' of https://git.agilestar.cn/spfm/spfm-market-front into hjw-222

hujunwei@agilestar.cn 2 years ago
parent
commit
1cd27cdd84

+ 5 - 3
src/components/uploadDown.vue

@@ -21,6 +21,7 @@
   </div>
 </template>
 <script>
+import getConfig from '../config/dev.js'
 export default {
   props: ["datalist", "dialogStatus"],
   data() {
@@ -41,10 +42,11 @@ export default {
       console.log(v);
       let url = encodeURIComponent(Base64.encode(v.callPath));
       console.log(url);
-      this.srcsc = 'http://10.230.15.228:8012/onlinePreview?url=' + url;
-      // this.srcsc = 'http:///114.215.71.182:8012/onlinePreview?url=' + url;
+      // this.srcsc = 'http://150.158.79.10:8012/onlinePreview?url=' + url;//本地
+      // this.srcsc = 'http:///10.149.85.91:8012/onlinePreview?url=' + url;//测试
+      // this.srcsc = 'http://10.230.15.228:8012/onlinePreview?url=' + url;//生产
+      this.srcsc =  getConfig().KNOWLEDGE_URL+'/onlinePreview?url=' + url;
       this.ifrshow = true;
-      // window.open('http://114.215.71.182:8012/onlinePreview?url=' + url);
     },
     //下载e
     uploaddown(v) {

+ 247 - 0
src/components/uploadOnlineOffice.vue

@@ -0,0 +1,247 @@
+<template>
+    <div v-loading="loading">
+        <el-upload class="upload-demo" accept=".xls,.xlsx,.ppt,.pptx,.doc,.docx" :drag="fileInfo.type !== 'btn'" multiple
+            :limit="fileInfo.limit" ref="upload" action="string" :on-remove="handleRemove" :on-exceed="handleExceed"
+            :file-list="attList" :auto-upload="true" :show-file-list="fileInfo.type !== 'btn'" :before-upload="deforeUp"
+            :http-request="signUpload" :on-preview="defUp" :disabled="disabled">
+            <div v-if="fileInfo.type !== 'btn'">
+                <span class="iconfont icon-excel" style="font-size: 80px;color: dodgerblue;margin-top: 10px;"></span>
+                <div class="el-upload__text" style="margin-top: 10px;">{{ fileInfo.typename
+                }}</div>
+            </div>
+            <div v-if="fileInfo.type === 'btn'">
+                <el-button size="medium" :type="fileInfo.btntype" class="btn-check" type="primary" plain
+                    icon="el-icon-upload2">{{ fileInfo.typename
+                    }}</el-button>
+            </div>
+        </el-upload>
+    </div>
+</template>
+<script>
+export default {
+    // props: ["fileInfo", "fileList", "type"],
+    props: {
+        fileInfo: {
+            type: Object,
+            default: () => { }
+        },
+        filenowFolder: {
+            type: Object,
+            default: () => { }
+        },
+        fileList: {
+            type: Array,
+            default: () => []
+        },
+        type: {
+            type: Array,
+            default: () => []
+        },
+        disabled: {
+            type: Boolean,
+            default: () => { },
+        },
+    },
+    data() {
+        return {
+            fileLists: [],
+            attList: [
+                // {
+                //   attchFileId: "",
+                //   fileCode: "202209271105276441",
+                //   name: "1231233333333333.xlsx",
+                //   id: "202209271105276441",
+                //   opName: "范岩",
+                //   opNo: "fanyan",
+                //   opTime: "2022-09-27 11:05:27",
+                //   type: 'success',
+                // },
+            ],
+            loading: false,
+            num: 0,
+            s: false,
+        };
+    },
+    // props:{
+    //    disabled: {
+    //     type: Boolean,
+    //     default: () => {},
+    //   },
+    // },
+    methods: {
+        signUpload() { },
+        //删除
+        handleRemove(file) {
+            console.log(file);
+            console.log(this.attList);
+            for (let i = 0; i < this.attList.length; i++) {
+                if (this.attList[i].name === file.name) {
+                    this.attList.splice(i, 1);
+
+
+
+                    // this.$emit("clickDownload",this.attList);
+                }
+            }
+            console.log(this.attList)
+            this.$emit("uploadBack", this.attList);
+        },
+
+        //数量限制
+        handleExceed(files, fileList) {
+            this.$message.warning(
+                `当前限制选择 ${this.fileInfo.limit} 个文件,本次选择了 ${files.length
+                } 个文件,共选择了 ${files.length + fileList.length} 个文件`
+            );
+        },
+        defUp(file) {
+            this.$emit("clickDownload", this.attList);
+        },
+        deforeUp(file) {
+            console.log(file);
+            let query = new FormData();
+            query.append("file", file);
+            console.log(query);
+            let docType = file.name.split('.')[1]
+            const extension1 = docType === "xlsx";
+            const extension2 = docType === "xls";
+            const extension3 = docType === "docx";
+            const extension4 = docType === "doc";
+            const extension5 = docType === "ppt";
+            const extension6 = docType === "pptx";
+            console.log(extension6);
+            if (!extension1 && !extension2 && !extension3 && !extension4 && !extension5 && !extension6) {
+                this.$message.error("上传文件格式有误!");
+                return false;
+            }
+            // if (docType == 'xlsx' || docType == 'xls') {
+            //     docType = 'cell'
+            // }
+            // if (docType == 'docx' || docType == 'doc') {
+            //     docType = 'word'
+            // }
+            // if (docType == 'ppt' || docType == 'pptx') {
+            //     docType = 'slide'
+            // }
+            const isLt2M = file.size / 1024 / 1024 < 100;
+            if (!isLt2M) {
+                this.$message.error("上传文件大小不能超过 20MB!");
+                return false;
+            }
+            this.loading = true;
+            if (this.fileInfo.urlType == "onlineExcel") {
+                query.append("folderId", this.filenowFolder.functionCode ? this.filenowFolder.functionCode : '');
+            }
+            this.num++;
+            let _this = this;
+            this.$http({
+                url: this.fileInfo.url,
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: query,
+            }).then((res) => {
+                this.$refs["upload"].clearFiles();
+                if (res.data.result == 0) {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: "success",
+                    });
+                } else if (res.data.result == 1) {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: "error",
+                    });
+                } else if (res.data.result == 2) {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: "warning",
+                    });
+                } else if (res.data.result == 3) {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: "info",
+                    });
+                } else {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: "success",
+                    });
+                }
+                this.num--;
+                if (this.num == 0) {
+                    this.loading = false;
+                }
+                this.$emit("uploadBack", this.attList);
+                return true;
+            }).catch((res) => {
+                this.$message({
+                    message: file.name + "上传失败",
+                    type: "error",
+                });
+                this.num--;
+                if (this.num == 0) {
+                    this.loading = false;
+                }
+                for (let i = 0; i < this.$refs["upload"].uploadFiles.length; i++) {
+                    if (file.name == this.$refs["upload"].uploadFiles[i].name) {
+                        this.$refs["upload"].uploadFiles.splice(i, 1);
+                    }
+                }
+                return false;
+            });
+
+        },
+    },
+    mounted() { },
+    created() {
+        this.attList = [];
+        console.log(this.fileList);
+        if (this.fileList) {
+            for (let i = 0; i < this.fileList.length; i++) {
+                this.attList.push({
+                    id: this.fileList[i].id,
+                    name: this.fileList[i].fileName,
+                    fileCode: this.fileList[i].fileCode,
+                    opName: this.fileList[i].opName,
+                    opNo: this.fileList[i].opNo,
+                    opTime: this.fileList[i].opTime,
+                    attchFileId: this.fileList[i].attchFileId,
+                    type: this.fileList[i].type,
+                })
+            }
+        }
+
+        console.log(this.attList);
+    },
+    watch: {
+        fileList() {
+            this.attList = [];
+            for (let i = 0; i < this.fileList.length; i++) {
+                this.attList.push({
+                    id: this.fileList[i].id,
+                    name: this.fileList[i].fileName,
+                    fileCode: this.fileList[i].fileCode,
+                    opName: this.fileList[i].opName,
+                    opNo: this.fileList[i].opNo,
+                    opTime: this.fileList[i].opTime,
+                    attchFileId: this.fileList[i].attchFileId,
+                    type: this.fileList[i].type,
+                });
+            }
+        },
+    },
+};
+</script>
+<style lang="scss" scoped>
+::v-deep .el-upload-dragger {
+    height: 120px !important;
+    border: none;
+}
+
+::v-deep .el-upload {
+    padding: 0px;
+}
+</style>
+  

+ 4 - 0
src/config/dev.js

@@ -1,6 +1,7 @@
 'use strict'
 let devs = {
     TITLE: '本地环境',
+    KNOWLEDGE_URL: "http://150.158.79.10:8012", //本地环境知识库预览
     BASE_URL: "http://43.138.50.94:9600/", //本地环境
     BASE_API: "http://43.138.50.94:8880/api",//工作流本地环境
     EXCEL_URL: "http://43.138.50.94:7777", //本地excel路径
@@ -34,6 +35,7 @@ let devs = {
 }
 let dev = {
     TITLE: '本地环境',
+    KNOWLEDGE_URL: "http://150.158.79.10:8012", //本地环境知识库预览
     OFFICE_URL:'http://43.138.50.94:7779',  //在线office路径
     BASE_URL: "http://127.0.0.1:8080", //本地环境
     BASE_API: "http://43.138.50.94:8880/api",//工作流本地环境
@@ -67,6 +69,7 @@ let dev = {
 }
 let test = {
     TITLE: '测试环境',
+    KNOWLEDGE_URL: "http://10.149.85.91:8012", //测试环境知识库预览
     OFFICE_URL:'http://10.149.85.91:8000',  //在线office路径
     BASE_URL: "http://10.149.85.91:8000/spfm", //测试环境
     BASE_API: "http://10.149.85.91:8000/api",//工作流测试环境
@@ -100,6 +103,7 @@ let test = {
 }
 let prod = {
     TITLE: '线上环境',
+    KNOWLEDGE_URL: "http://10.230.15.228:8012", //生产环境知识库预览
     OFFICE_URL:'http://10.230.26.15:8000',  //在线office路径
     BASE_URL: "http://10.230.26.15:8000/mkt", //线上环境
     BASE_API: "http://10.230.26.15:8000/api",//工作流线上环境

+ 1 - 4
src/pages/main/accountPermissions/accountdel.vue

@@ -65,7 +65,7 @@
                     </el-form-item>
                 </div>
                 <div class="flex-header">
-                    <el-form-item label="4A主账号:" prop="mainAccount4a">
+                    <el-form-item label="4A主账号:" >
                         <el-input v-model="fromList.mainAccount4a" :disabled="disabled"></el-input>
                     </el-form-item>
                 </div>
@@ -220,9 +220,6 @@ export default {
                 deletionReason: [
                     { required: true, message: "请添加删除原因", trigger: "blur" },
                 ],
-                mainAccount4a: [
-                    { required: true, message: "请添加4A主账号", trigger: "blur" },
-                ],
                 crmAccount: [
                     { required: true, message: "请添加CRM账号", trigger: "blur" },
                 ],

+ 155 - 155
src/pages/main/iptv/uploadDown.vue

@@ -1,196 +1,196 @@
 <template>
     <div class="back-box">
         <div v-for="item in infolist" :key="item.id" @click="downcheck(item)">
-            <i class="iconfont icon-word" v-if="item.type==='word'"></i>
-            <i class="iconfont icon-excel" v-if="item.type==='excel'"></i>
-            <i class="iconfont icon-ppt" v-if="item.type==='ppt'"></i>
-            <i class="iconfont icon-wenjian" v-if="item.type==='wenjian'"></i>
-            <i class="el-icon-picture" v-if="item.type==='png'"></i>
+            <i class="iconfont icon-word" v-if="item.type === 'word'"></i>
+            <i class="iconfont icon-excel" v-if="item.type === 'excel'"></i>
+            <i class="iconfont icon-ppt" v-if="item.type === 'ppt'"></i>
+            <i class="iconfont icon-wenjian" v-if="item.type === 'wenjian'"></i>
+            <i class="el-icon-picture" v-if="item.type === 'png'"></i>
             <el-tooltip class="item" effect="dark" :content="item.fileName" placement="right" :enterable="false">
-                <span class="tab-long">{{item.fileName}}</span>
+                <span class="tab-long">{{ item.fileName }}</span>
             </el-tooltip>
-            <div class="seedown" v-if="datalist.type===2">
+            <div class="seedown" v-if="datalist.type === 2">
                 <a @click="uploaddown(item)">下载</a>
             </div>
         </div>
-        <div class="if-box-top" v-if="ifrshow" @keyup.esc="ifrshow=false">
-            <i class="el-icon-close" @click="ifrshow=false"></i>
-            <iframe
-                height="100%"
-                width="100%"
-                :src="srcsc">
+        <div class="if-box-top" v-if="ifrshow" @keyup.esc="ifrshow = false">
+            <i class="el-icon-close" @click="ifrshow = false"></i>
+            <iframe height="100%" width="100%" :src="srcsc">
             </iframe>
         </div>
     </div>
 </template>
 <script>
-    export default {
-        props: ['datalist', 'dialogStatus'],
-        data() {
-            return {
-                infolist: [],
-                status: false,
-                srcsc: '',
-                ifrshow:false,
+import getConfig from '../../../config/dev.js'
+export default {
+    props: ['datalist', 'dialogStatus'],
+    data() {
+        return {
+            infolist: [],
+            status: false,
+            srcsc: '',
+            ifrshow: false,
+        }
+    },
+    methods: {
+        downcheck(v) {
+            if (this.datalist.type === 1) {
+                this.uploaddown(v);
             }
         },
-        methods: {
-            downcheck(v) {
-                if (this.datalist.type === 1) {
-                    this.uploaddown(v);
+        uploadsee(v) {
+            let url = encodeURIComponent(Base64.encode(v.callPath));
+            this.srcsc = getConfig().KNOWLEDGE_URL + '/onlinePreview?url=' + url;
+            this.ifrshow = true;
+            // window.open('http://114.215.71.182:8012/onlinePreview?url=' + url);
+        },
+        //下载e
+        uploaddown(v) {
+            let fileData = v;
+            this.$http({
+                url: this.datalist.url,
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                responseType: "blob",
+                data: { "id": fileData.id, "fileName": fileData.fileName },
+            }).then((response) => {
+                if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+                    let blob = new Blob([response.data], {
+                        type: 'application/vnd.ms-excel'
+                    });
+                    window.navigator.msSaveOrOpenBlob(blob, fileData.fileName);
+                } else {
+                    /* 火狐谷歌的文件下载方式 */
+                    var blob = new Blob([response.data])
+                    var downloadElement = document.createElement('a')
+                    var href = window.URL.createObjectURL(blob);
+                    downloadElement.href = href;
+                    downloadElement.download = fileData.fileName;
+                    document.body.appendChild(downloadElement);
+                    downloadElement.click();
+                    document.body.removeChild(downloadElement);
+                    window.URL.revokeObjectURL(href);
                 }
-            },
-            uploadsee(v) {
-                let url = encodeURIComponent(Base64.encode(v.callPath));
-            this.srcsc = 'http://10.230.15.228:8012/onlinePreview?url=' + url;
-                this.ifrshow=true;
-                // window.open('http://114.215.71.182:8012/onlinePreview?url=' + url);
-            },
-            //下载e
-            uploaddown(v) {
-                let fileData = v;
-                this.$http({
-                    url: this.datalist.url,
-                    method: "post",
-                    headers: {
-                        "Content-Type": "application/json",
-                    },
-                    responseType: "blob",
-                    data: {"id": fileData.id, "fileName": fileData.fileName},
-                }).then((response) => {
-                    if (window.navigator && window.navigator.msSaveOrOpenBlob) {
-                        let blob = new Blob([response.data], {
-                            type: 'application/vnd.ms-excel'
-                        });
-                        window.navigator.msSaveOrOpenBlob(blob, fileData.fileName);
+            });
+        },
+        dataHandle() {
+            this.infolist = this.datalist.attList;
+            if (this.infolist) {
+                for (let i = 0; i < this.infolist.length; i++) {
+                    let f = this.infolist[i].fileName.split(".");
+                    let type = f[f.length - 1];
+                    if (type === 'doc' || type === 'docx') {
+                        this.infolist[i].type = 'word';
+                    } else if (type === 'ppt') {
+                        this.infolist[i].type = 'ppt';
+                    } else if (type === 'xlsx' || type === 'xls') {
+                        this.infolist[i].type = 'excel';
+                    } else if (type === 'png' || type === 'jpg' || type === 'svg' || type === 'gif' || type === 'psd') {
+                        this.infolist[i].type = 'png';
                     } else {
-                        /* 火狐谷歌的文件下载方式 */
-                        var blob = new Blob([response.data])
-                        var downloadElement = document.createElement('a')
-                        var href = window.URL.createObjectURL(blob);
-                        downloadElement.href = href;
-                        downloadElement.download = fileData.fileName;
-                        document.body.appendChild(downloadElement);
-                        downloadElement.click();
-                        document.body.removeChild(downloadElement);
-                        window.URL.revokeObjectURL(href);
-                    }
-                });
-            },
-            dataHandle() {
-                this.infolist = this.datalist.attList;
-                if (this.infolist) {
-                    for (let i = 0; i < this.infolist.length; i++) {
-                        let f = this.infolist[i].fileName.split(".");
-                        let type = f[f.length - 1];
-                        if (type === 'doc' || type === 'docx') {
-                            this.infolist[i].type = 'word';
-                        } else if (type === 'ppt') {
-                            this.infolist[i].type = 'ppt';
-                        } else if (type === 'xlsx' || type === 'xls') {
-                            this.infolist[i].type = 'excel';
-                        } else if (type === 'png' || type === 'jpg' || type === 'svg' || type === 'gif' || type === 'psd') {
-                            this.infolist[i].type = 'png';
-                        } else {
-                            this.infolist[i].type = 'wenjian';
-                        }
+                        this.infolist[i].type = 'wenjian';
                     }
                 }
             }
-        },
-        mounted() {
+        }
+    },
+    mounted() {
 
-        },
-        created() {
-            this.dataHandle();
-        },
-        watch: {
-            dialogStatus() {
-                this.$forceUpdate()
-                let _this = this;
-                _this.dataHandle();
-            }
+    },
+    created() {
+        this.dataHandle();
+    },
+    watch: {
+        dialogStatus() {
+            this.$forceUpdate()
+            let _this = this;
+            _this.dataHandle();
         }
     }
+}
 </script>
 <style scoped lang="scss">
-    .if-box-top{
-        background: #fff;
-        width: 80vw;
-        height: 80vh;
-        margin-top: 10vh;
-        margin-left: 10vw;
-    }
+.if-box-top {
+    background: #fff;
+    width: 80vw;
+    height: 80vh;
+    margin-top: 10vh;
+    margin-left: 10vw;
+}
 
-    .iconfont {
-        font-size: 42px;
-    }
+.iconfont {
+    font-size: 42px;
+}
 
-    .icon-excel {
-        color: #67DB63;
-    }
+.icon-excel {
+    color: #67DB63;
+}
 
-    .icon-word {
-        color: #FF654E;
-    }
+.icon-word {
+    color: #FF654E;
+}
 
-    .icon-ppt {
-        color: #FF8943;
-    }
+.icon-ppt {
+    color: #FF8943;
+}
 
-    .icon-wenjian {
-        color: #ccc;
-    }
+.icon-wenjian {
+    color: #ccc;
+}
 
-    .el-icon-picture {
-        font-size: 36px;
-        color: #ccc;
-        background: #fff;
-        padding: 4px 2px;
-        margin-bottom: 2px;
-        border-radius: 3px;
-    }
+.el-icon-picture {
+    font-size: 36px;
+    color: #ccc;
+    background: #fff;
+    padding: 4px 2px;
+    margin-bottom: 2px;
+    border-radius: 3px;
+}
 
-    .back-box {
-        margin-top: 20px;
-        background: #F2F2F2;
-        padding: 20px;
+.back-box {
+    margin-top: 20px;
+    background: #F2F2F2;
+    padding: 20px;
 
-        div {
-            display: inline-block;
-            text-align: center;
-            margin-right: 20px;
-            cursor: pointer;
+    div {
+        display: inline-block;
+        text-align: center;
+        margin-right: 20px;
+        cursor: pointer;
 
-            span {
-                display: block;
-                width: 80px;
-                overflow: hidden;
-                padding-top: 5px;
-                margin: 0 10px;
-                overflow: hidden;
-                text-overflow: ellipsis;
-                display: -webkit-box; /* 将对象作为弹性伸缩盒子模型显示 */
-                -webkit-line-clamp: 1; /* 控制最多显示几行 */
-                -webkit-box-orient: vertical; /* 设置或检索伸缩盒对象的子元素的排列方式 */
-            }
+        span {
+            display: block;
+            width: 80px;
+            overflow: hidden;
+            padding-top: 5px;
+            margin: 0 10px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            display: -webkit-box;
+            /* 将对象作为弹性伸缩盒子模型显示 */
+            -webkit-line-clamp: 1;
+            /* 控制最多显示几行 */
+            -webkit-box-orient: vertical;
+            /* 设置或检索伸缩盒对象的子元素的排列方式 */
         }
+    }
 
-        .seedown {
-            margin: 0;
-            margin-top: 5px;
+    .seedown {
+        margin: 0;
+        margin-top: 5px;
 
-            a {
-                font-size: 12px;
-                padding: 2px 5px;
-                border: 1px solid transparent;
-                color: #999;
-            }
+        a {
+            font-size: 12px;
+            padding: 2px 5px;
+            border: 1px solid transparent;
+            color: #999;
+        }
 
-            a:hover {
-                color: #0b82ff;
-            }
+        a:hover {
+            color: #0b82ff;
         }
     }
-
+}
 </style>

File diff suppressed because it is too large
+ 1290 - 0
src/pages/main/onlineOfficeExcel/index.vue


+ 6 - 0
src/router/index.js

@@ -22,6 +22,12 @@ const routes = [{
             component: (resolve) => require( /* webpackChunkName: "system" */['../pages/main/onlineOffice/index.vue'], resolve)
         },
         {
+            meta: { name: '在线onlineOfficeExcel', keepAlive: false },
+            path: '/onlineOfficeExcel',
+            name: 'onlineOfficeExcel',
+            component: (resolve) => require( /* webpackChunkName: "system" */['../pages/main/onlineOfficeExcel/index.vue'], resolve)
+        },
+        {
             meta: { name: '绩效', keepAlive: false },
             path: '/performance',
             name: 'performance',