Browse Source

修改登录页面样式

Qukatie 3 tuần trước cách đây
mục cha
commit
a40e246933

+ 452 - 439
src/components/upload/index.vue

@@ -1,92 +1,99 @@
 <template>
-    <div>
-        <basic-container v-if="!basic">
-            <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn"
-                       @saveColumn="saveColumn">
-                <template slot="menuLeft">
-                    <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled"
-                               v-if="display">上传
-                    </el-button>
-                    <slot name="c_button"></slot>
-                </template>
-                <template slot="url" slot-scope="{ row }">
-                    <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url"
-                              class="input-with-select">
-                        <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
-                    </el-input>
-                    <span v-else>{{ row.url }}</span>
-                </template>
-                <template slot-scope="scope" slot="menu">
-                    <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看
-                    </el-button>
-                    <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
-                               @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
-                        {{ scope.row.$cellEdit ? "保存" : "修改" }}
-                    </el-button>
-                    <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
-                               @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled">删除
-                    </el-button>
-                </template>
-            </avue-crud>
-            <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px"
-                       :close-on-click-modal="false"
-                       v-dialog-drag>
-                <el-upload class="upload-demo" drag style="text-align: center" ref="upload"
-                           :action="incomingAction ? incomingAction : action" :headers="headers" :on-success="onSuccess"
-                           multiple
-                           :before-upload="beforeUpload">
-                    <i class="el-icon-upload"></i>
-                    <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-                    <div class="el-upload__tip" slot="tip">
-                        如上传文件过大,请耐心等待上传成功
-                    </div>
-                </el-upload>
-            </el-dialog>
-            <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px"
-                       :close-on-click-modal="false"
-                       v-dialog-drag>
-                <el-upload class="upload-demo" drag style="text-align: center"
-                           :action="incomingAction ? incomingAction : action" :headers="headers" :show-file-list="false"
-                           :on-success="onSuccessTwo" :before-upload="beforeUpload">
-                    <i class="el-icon-upload"></i>
-                    <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-                    <div class="el-upload__tip" slot="tip">
-                        如上传文件过大,请耐心等待上传成功
-                    </div>
-                </el-upload>
-            </el-dialog>
-            <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]"/>
-        </basic-container>
-        <span v-else-if="true">
-      <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn"
-                 @saveColumn="saveColumn">
+  <div>
+    <basic-container v-if="!basic">
+      <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn" @saveColumn="saveColumn">
         <template slot="menuLeft">
-          <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled">上传
-          </el-button>
+          <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled" v-if="display">上传 </el-button>
+          <slot name="c_button"></slot>
         </template>
         <template slot="url" slot-scope="{ row }">
-          <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url"
-                    class="input-with-select">
+          <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url" class="input-with-select">
             <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
           </el-input>
           <span v-else>{{ row.url }}</span>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看
+          <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看 </el-button>
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit" @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
+            {{ scope.row.$cellEdit ? "保存" : "修改" }}
           </el-button>
-          <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
-                     @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete" @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled"
+            >删除
+          </el-button>
+        </template>
+      </avue-crud>
+      <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
+        <el-upload
+          class="upload-demo"
+          drag
+          style="text-align: center"
+          ref="upload"
+          :action="incomingAction ? incomingAction : action"
+          :headers="headers"
+          :on-success="onSuccess"
+          multiple
+          :before-upload="beforeUpload"
+        >
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+          <div class="el-upload__tip" slot="tip">
+            如上传文件过大,请耐心等待上传成功
+          </div>
+        </el-upload>
+      </el-dialog>
+      <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false" v-dialog-drag>
+        <el-upload
+          class="upload-demo"
+          drag
+          style="text-align: center"
+          :action="incomingAction ? incomingAction : action"
+          :headers="headers"
+          :show-file-list="false"
+          :on-success="onSuccessTwo"
+          :before-upload="beforeUpload"
+        >
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+          <div class="el-upload__tip" slot="tip">
+            如上传文件过大,请耐心等待上传成功
+          </div>
+        </el-upload>
+      </el-dialog>
+      <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
+    </basic-container>
+    <span v-else-if="true">
+      <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn" @saveColumn="saveColumn">
+        <template slot="menuLeft">
+          <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled">上传 </el-button>
+        </template>
+        <template slot="url" slot-scope="{ row }">
+          <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url" class="input-with-select">
+            <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
+          </el-input>
+          <span v-else>{{ row.url }}</span>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看 </el-button>
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit" @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
             {{ scope.row.$cellEdit ? "保存" : "修改" }}
           </el-button>
-          <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
-                     @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled">删除
+          <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete" @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled"
+            >删除
           </el-button>
         </template>
       </avue-crud>
-      <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
-                 v-dialog-drag>
-        <el-upload class="upload-demo" drag style="text-align: center" ref="upload" :action="action" :headers="headers"
-                   :on-success="onSuccess" multiple :before-upload="beforeUpload">
+      <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
+        <el-upload
+          class="upload-demo"
+          drag
+          style="text-align: center"
+          ref="upload"
+          :action="action"
+          :headers="headers"
+          :on-success="onSuccess"
+          multiple
+          :before-upload="beforeUpload"
+        >
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -94,11 +101,17 @@
           </div>
         </el-upload>
       </el-dialog>
-      <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false"
-                 v-dialog-drag>
-        <el-upload class="upload-demo" drag style="text-align: center"
-                   :action="incomingAction ? incomingAction : action" :headers="headers" :show-file-list="false"
-                   :on-success="onSuccessTwo" :before-upload="beforeUpload">
+      <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false" v-dialog-drag>
+        <el-upload
+          class="upload-demo"
+          drag
+          style="text-align: center"
+          :action="incomingAction ? incomingAction : action"
+          :headers="headers"
+          :show-file-list="false"
+          :on-success="onSuccessTwo"
+          :before-upload="beforeUpload"
+        >
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
           <div class="el-upload__tip" slot="tip">
@@ -107,381 +120,381 @@
         </el-upload>
       </el-dialog>
 
-            <!--  新的查看图片弹窗-->
-      <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]"/>
+      <!--  新的查看图片弹窗-->
+      <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
     </span>
-    </div>
+  </div>
 </template>
 
 <script>
-import {getToken} from "@/util/auth";
-import {LTfujianDelete, sharedDeletion} from "@/api/user";
-import {updateListRemove} from "@/api/base/upload";
-import PreviewImage from '@/components/PreviewImage/index.vue'
+import { getToken } from "@/util/auth";
+import { LTfujianDelete, sharedDeletion } from "@/api/user";
+import { updateListRemove } from "@/api/base/upload";
+import PreviewImage from "@/components/PreviewImage/index.vue";
 
 export default {
-    name: "index",
-    components: {PreviewImage},
-    props: {
-        data: {
-            type: Object
-        },
-        incomingAction: {
-            type: String
-        },
-        deleteUrl: {
-            type: String
-        },
-        enumerationValue: {
-            type: Number
-        },
-        typeUpload: {
-            type: String
-        },
-        disabled: {
-            type: Boolean
-        },
-        display: {
-            type: Boolean
-        },
-        basic: {
-            type: Boolean
-        }
+  name: "index",
+  components: { PreviewImage },
+  props: {
+    data: {
+      type: Object
     },
-    data() {
-        return {
-            excelBox: false,
-            excelTwo: false,
-            innerVisible: false,
-            form: {},
-            imgUrl: "",
-            action: "/api/blade-resource/oss/endpoint/put-file",
-            headers: {"Blade-Auth": "Bearer " + getToken()},
-            option: {},
-            key: 0,
-            originalOptions: {
-                dialogDrag: true,
-                index: true,
-                refreshBtn: false,
-                cellBtn: false,
-                cancelBtn: false,
-                delBtn: false,
-                editBtn: false,
-                addBtn: false,
-                align: "center",
-                column: [
-                    {
-                        label: "文件名称",
-                        prop: "fileName",
-                        index: 1,
-                        width: 140,
-                        cell: true,
-                        overHidden: true
-                    },
-                    {
-                        label: "文件地址",
-                        prop: "url",
-                        index: 2,
-                        overHidden: true
-                    }, {
-                        type: "select",
-                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=file_type",
-                        props: {
-                            label: "dictValue",
-                            value: "dictValue"
-                        },
-                        label: "文件属性",
-                        prop: "paymentType",
-                        search: false,
-                        index: 3,
-                        width: 140,
-                        overHidden: true,
-                        cell: true
-                    },
-                    {
-                        label: "备注",
-                        prop: "remarks",
-                        index: 4,
-                        cell: true,
-                        overHidden: true
-                    }
-                ]
-            },
-            originalOptionsTwo: {
-                dialogDrag: true,
-                index: true,
-                refreshBtn: false,
-                cellBtn: false,
-                cancelBtn: false,
-                delBtn: false,
-                editBtn: false,
-                addBtn: false,
-                align: "center",
-                column: [
-                    {
-                        label: "文件名称",
-                        prop: "fileName",
-                        index: 1,
-                        width: 140,
-                        cell: true,
-                        overHidden: true
-                    },
-                    {
-                        label: "文件地址",
-                        prop: "url",
-                        index: 2,
-                        overHidden: true
-                    }, {
-                        type: "select",
-                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=picture_type",
-                        props: {
-                            label: "dictValue",
-                            value: "dictKey"
-                        },
-                        label: "文件属性",
-                        prop: "version",
-                        search: false,
-                        index: 3,
-                        width: 140,
-                        overHidden: true,
-                        cell: true,
-                    },
-                    {
-                        label: "备注",
-                        prop: "remarks",
-                        index: 4,
-                        cell: true,
-                        overHidden: true
-                    }
-                ]
-            },
-            // 基础信息轮胎附件
-            originalOptionsTwo_LT: {
-                dialogDrag: true,
-                index: true,
-                refreshBtn: false,
-                cellBtn: false,
-                cancelBtn: false,
-                delBtn: false,
-                editBtn: false,
-                addBtn: false,
-                align: "center",
-                column: [
-                    {
-                        label: "文件名称",
-                        prop: "fileName",
-                        index: 1,
-                        width: 140,
-                        cell: true,
-                        overHidden: true
-                    },
-                    {
-                        label: "文件地址",
-                        prop: "url",
-                        index: 2,
-                        overHidden: true
-                    }, {
-                        type: "select",
-                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=picture_type",
-                        props: {
-                            label: "dictValue",
-                            value: "dictKey"
-                        },
-                        label: "文件属性",
-                        prop: "mainImage",
-                        search: false,
-                        index: 3,
-                        width: 140,
-                        overHidden: true,
-                        cell: true,
-                    },
-                    {
-                        label: "备注",
-                        prop: "remarks",
-                        index: 4,
-                        cell: true,
-                        overHidden: true
-                    }
-                ]
+    incomingAction: {
+      type: String
+    },
+    deleteUrl: {
+      type: String
+    },
+    enumerationValue: {
+      type: Number
+    },
+    typeUpload: {
+      type: String
+    },
+    disabled: {
+      type: Boolean
+    },
+    display: {
+      type: Boolean
+    },
+    basic: {
+      type: Boolean
+    },
+    mainImageType: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      excelBox: false,
+      excelTwo: false,
+      innerVisible: false,
+      form: {},
+      imgUrl: "",
+      action: "/api/blade-resource/oss/endpoint/put-file",
+      headers: { "Blade-Auth": "Bearer " + getToken() },
+      option: {},
+      key: 0,
+      originalOptions: {
+        dialogDrag: true,
+        index: true,
+        refreshBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        delBtn: false,
+        editBtn: false,
+        addBtn: false,
+        align: "center",
+        column: [
+          {
+            label: "文件名称",
+            prop: "fileName",
+            index: 1,
+            width: 140,
+            cell: true,
+            overHidden: true
+          },
+          {
+            label: "文件地址",
+            prop: "url",
+            index: 2,
+            overHidden: true
+          },
+          {
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=file_type",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
             },
-            originalOptionsThree: {
-                dialogDrag: true,
-                index: true,
-                refreshBtn: false,
-                cellBtn: false,
-                cancelBtn: false,
-                delBtn: false,
-                editBtn: false,
-                addBtn: false,
-                align: "center",
-                column: [
-                    {
-                        label: "文件名称",
-                        prop: "fileName",
-                        index: 1,
-                        width: 140,
-                        cell: true,
-                        overHidden: true
-                    },
-                    {
-                        label: "文件地址",
-                        prop: "url",
-                        index: 2,
-                        overHidden: true
-                    },
-                    {
-                        label: "备注",
-                        prop: "remarks",
-                        index: 4,
-                        cell: true,
-                        overHidden: true
-                    }
-                ]
+            label: "文件属性",
+            prop: "paymentType",
+            search: false,
+            index: 3,
+            width: 140,
+            overHidden: true,
+            cell: true
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            index: 4,
+            cell: true,
+            overHidden: true
+          }
+        ]
+      },
+      originalOptionsTwo: {
+        dialogDrag: true,
+        index: true,
+        refreshBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        delBtn: false,
+        editBtn: false,
+        addBtn: false,
+        align: "center",
+        column: [
+          {
+            label: "文件名称",
+            prop: "fileName",
+            index: 1,
+            width: 140,
+            cell: true,
+            overHidden: true
+          },
+          {
+            label: "文件地址",
+            prop: "url",
+            index: 2,
+            overHidden: true
+          },
+          {
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=picture_type",
+            props: {
+              label: "dictValue",
+              value: "dictKey"
             },
-            uploadCount: 0
-        };
+            label: "文件属性",
+            prop: "version",
+            search: false,
+            index: 3,
+            width: 140,
+            overHidden: true,
+            cell: true
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            index: 4,
+            cell: true,
+            overHidden: true
+          }
+        ]
+      },
+      // 基础信息轮胎附件
+      originalOptionsTwo_LT: {
+        // dialogDrag: true,
+        index: true,
+        refreshBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        delBtn: false,
+        editBtn: false,
+        addBtn: false,
+        align: "center",
+        column: [
+          {
+            label: "文件名称",
+            prop: "fileName",
+            width: 140,
+            cell: true,
+            overHidden: true
+          },
+          {
+            label: "文件地址",
+            prop: "url",
+            overHidden: true
+          },
+          {
+            label: this.mainImageType?"是否主图":"文件属性",
+            prop: "mainImage",
+            type: "select",
+            dicData: [
+              {
+                label: "是",
+                value: 1
+              },
+              {
+                label: "否",
+                value: 0
+              }
+            ],
+            width: 140,
+            overHidden: true,
+            cell: true
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            cell: true,
+            overHidden: true
+          }
+        ]
+      },
+      originalOptionsThree: {
+        dialogDrag: true,
+        index: true,
+        refreshBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        delBtn: false,
+        editBtn: false,
+        addBtn: false,
+        align: "center",
+        column: [
+          {
+            label: "文件名称",
+            prop: "fileName",
+            index: 1,
+            width: 140,
+            cell: true,
+            overHidden: true
+          },
+          {
+            label: "文件地址",
+            prop: "url",
+            index: 2,
+            overHidden: true
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            index: 4,
+            cell: true,
+            overHidden: true
+          }
+        ]
+      },
+      uploadCount: 0
+    };
+  },
+  async created() {
+    console.log(this.enumerationValue);
+    this.option = this.originalOptionsTwo_LT;
+    this.key++;
+  },
+  methods: {
+    //自定义列保存
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(this.enumerationValue), this.option);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
     },
-    async created() {
-        console.log(this.enumerationValue)
-        this.option = this.originalOptionsTwo_LT
-        this.key++
+    //自定义列重置
+    async resetColumn() {
+      this.option = this.originalOptionsTwo_LT;
+      this.$message.success("重置成功");
     },
-    methods: {
-        //自定义列保存
-        async saveColumn() {
-            /**
-             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-             */
-            const inSave = await this.saveColumnData(this.getColumnName(this.enumerationValue), this.option);
-            if (inSave) {
-                this.$message.success("保存成功");
-                //关闭窗口
-                this.$refs.crud.$refs.dialogColumn.columnBox = false;
-            }
-        },
-        //自定义列重置
-        async resetColumn() {
-
-            this.option = this.originalOptionsTwo_LT;
-            this.$message.success("重置成功");
-        },
-        beforeUpload(file) {
-            if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
-                const fileSize = file.size / 1024 / 1024
-                if (fileSize > 5) {
-                    this.$message.error("请上传不能超过5M的图片");
-                    return false;
-                }
-            } else {
-                const fileSize = file.size / 1024 / 1024
-                if (fileSize > 10) {
-                    this.$message.error("请上传不能超过10M的文件");
-                    return false;
-                }
-            }
-        },
-        //新增上传成功
-        onSuccess(response, file, fileList) {
-            this.$refs.crud.rowCellAdd({
-                fileName: response.data.originalName,
-                url: response.data.link
+    beforeUpload(file) {
+      if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
+        const fileSize = file.size / 1024 / 1024;
+        if (fileSize > 5) {
+          this.$message.error("请上传不能超过5M的图片");
+          return false;
+        }
+      } else {
+        const fileSize = file.size / 1024 / 1024;
+        if (fileSize > 10) {
+          this.$message.error("请上传不能超过10M的文件");
+          return false;
+        }
+      }
+    },
+    //新增上传成功
+    onSuccess(response, file, fileList) {
+      this.$refs.crud.rowCellAdd({
+        fileName: response.data.originalName,
+        url: response.data.link
+      });
+      this.uploadCount++;
+      if (this.uploadCount === fileList.length) {
+        this.$refs.upload.clearFiles();
+        this.excelBox = false;
+        this.uploadCount = 0;
+      }
+    },
+    //修改上传成功
+    onSuccessTwo(response) {
+      this.form.fileName = response.data.originalName;
+      this.form.url = response.data.link;
+      this.data[this.form.$index] = this.form;
+      this.excelTwo = false;
+    },
+    //单行上传
+    singleLineUpload(row) {
+      this.form = row;
+      this.excelTwo = true;
+    },
+    //开启批量上传
+    addDetail() {
+      this.excelBox = true;
+    },
+    //下载附件
+    download(scope) {
+      if (scope.row.url) {
+        if (
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) === ".jpg" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) === ".png" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) === ".jpeg" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) === ".JPG" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) === ".PNG" ||
+          scope.row.url.substring(scope.row.url.lastIndexOf(".")) === ".JPEG"
+        ) {
+          this.imgUrl = scope.row.url;
+          this.innerVisible = true;
+        } else {
+          window.open(scope.row.url);
+        }
+      } else {
+        this.$message.error("请上传附件");
+      }
+    },
+    //修改触发
+    rowCell(row, index) {
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+      // this.$refs.crud.rowCell(row, index)
+    },
+    rowDel(row, index) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        console.log(row, 657);
+        if (row.id) {
+          if (this.typeUpload == "CK") {
+            updateListRemove(row.id, this.deleteUrl).then(res => {
+              if (res.data.success) {
+                this.$message.success("操作成功!");
+                this.data.splice(index, 1);
+              }
+            });
+          } else if (this.typeUpload == "LT") {
+            LTfujianDelete({ ids: row.id }).then(res => {
+              if (res.data.success) {
+                this.$message.success("操作成功!");
+                this.data.splice(index, 1);
+              }
             });
-            this.uploadCount++;
-            if (this.uploadCount === fileList.length) {
-                this.$refs.upload.clearFiles();
-                this.excelBox = false;
-                this.uploadCount = 0;
-            }
-        },
-        //修改上传成功
-        onSuccessTwo(response) {
-            this.form.fileName = response.data.originalName;
-            this.form.url = response.data.link;
-            this.data[this.form.$index] = this.form;
-            this.excelTwo = false;
-        },
-        //单行上传
-        singleLineUpload(row) {
-            this.form = row;
-            this.excelTwo = true;
-        },
-        //开启批量上传
-        addDetail() {
-            this.excelBox = true;
-        },
-        //下载附件
-        download(scope) {
-            if (scope.row.url) {
-                if (
-                    scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-                    ".jpg" ||
-                    scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-                    ".png" ||
-                    scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-                    ".jpeg" ||
-                    scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-                    ".JPG" ||
-                    scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-                    ".PNG" ||
-                    scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
-                    ".JPEG"
-                ) {
-                    this.imgUrl = scope.row.url;
-                    this.innerVisible = true;
-                } else {
-                    window.open(scope.row.url);
-                }
-            } else {
-                this.$message.error("请上传附件");
-            }
-        },
-        //修改触发
-        rowCell(row, index) {
-            if (row.$cellEdit == true) {
-                this.$set(row, "$cellEdit", false);
-            } else {
-                this.$set(row, "$cellEdit", true);
-            }
-            // this.$refs.crud.rowCell(row, index)
-        },
-        rowDel(row, index) {
-            this.$confirm("确定将选择数据删除?", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning"
-            }).then(() => {
-                console.log(row, 657)
-                if (row.id) {
-                    if (this.typeUpload == "CK") {
-                        updateListRemove(row.id, this.deleteUrl).then(res => {
-                            if (res.data.success) {
-                                this.$message.success("操作成功!");
-                                this.data.splice(index, 1);
-                            }
-                        });
-                    } else if (this.typeUpload == "LT") {
-                        LTfujianDelete({ids: row.id}).then(res => {
-                            if (res.data.success) {
-                                this.$message.success("操作成功!");
-                                this.data.splice(index, 1);
-                            }
-                        })
-                    } else {
-                        sharedDeletion(this.deleteUrl, row.id).then(res => {
-                            if (res.data.success) {
-                                this.$message.success("操作成功!");
-                                this.data.splice(index, 1);
-                            }
-                        });
-                    }
-                } else {
-                    this.data.splice(index, 1);
-                }
+          } else {
+            sharedDeletion(this.deleteUrl, row.id).then(res => {
+              if (res.data.success) {
+                this.$message.success("操作成功!");
+                this.data.splice(index, 1);
+              }
             });
+          }
+        } else {
+          this.data.splice(index, 1);
         }
+      });
     }
+  }
 };
 </script>
 

+ 1 - 1
src/lang/zh.js

@@ -67,7 +67,7 @@ export default {
     saleOrderL: '销售订单(L)'
   },
   login: {
-    title: '登录 ',
+    title: '库比森营销平台',
     info: '库比森营销平台',
     tenantId: '请输入企业ID',
     username: '请输入账号',

+ 2 - 4
src/page/login/index.vue

@@ -4,16 +4,14 @@
          @keyup.enter.native="handleLogin">
         <top-color v-show="false"></top-color>
         <div class="login-weaper animated bounceInDown">
-            <div class="login-left">
+            <!-- <div class="login-left">
                 <div class="login-time">
                     {{ time }}
                 </div>
-                <!--<img class="img" src="/img/logoTubao.png" alt="">-->
                 <p class="title">
                     {{ $t('login.info') }}
                 </p>
-                <!--$t 国际化vue-i18n中英文切换 -->
-            </div>
+            </div> -->
             <div class="login-border">
                 <div class="login-main">
                     <h4 class="login-title">

+ 7 - 6
src/styles/login.scss

@@ -10,8 +10,10 @@
 }
 
 .login-weaper {
-  margin: 0 auto;
-  width: 1000px;
+  // margin: 0 auto;
+  position: absolute;
+  right:12vw;
+  width: 500px;
   box-shadow: -4px 5px 10px rgba(0, 0, 0, 0.4);
     border-radius: 40px;
   .el-input-group__append {
@@ -22,7 +24,7 @@
 .login-left,
 .login-border {
   position: relative;
-  min-height: 500px;
+  min-height: 440px;
   align-items: center;
   display: flex;
 }
@@ -69,11 +71,10 @@
 
 .login-border {
   border-left: none;
-  border-top-right-radius: 40px;
-  border-bottom-right-radius: 40px;
+  border-radius: 40px;
   color: #fff;
   background-color: #fff;
-  width: 50%;
+  width: 100%;
   float: left;
   box-sizing: border-box;
 }

+ 5 - 5
src/styles/media.scss

@@ -124,14 +124,14 @@
     padding-top: 30px !important;
     margin-left: -30px;
   }
-  .login-weaper {
-    margin: 0 auto;
-    width: 96% !important;
-  }
+  // .login-weaper {
+    // margin: 0 auto;
+    // width: 96% !important;
+  // }
   .login-border {
     border-radius: 5px;
     padding: 40px;
-    margin: 0 auto;
+    // margin: 0 auto;
     float: none !important;
     width: 100% !important;
   }

+ 1 - 1
src/views/fc/customer/detailsPage.vue

@@ -106,7 +106,7 @@
       <c-upload
         v-loading="loadingBtn"
         typeUpload="CD"
-        deleteUrl="/api/blade-sales-part/corpsfiles/remove"
+        deleteUrl="/api/gubersail-admin/corpsfiles/remove"
         :data="corpsFiles"
         display
         :enumerationValue="35.1"

+ 17 - 2
src/views/store/detailsPage.vue

@@ -141,11 +141,12 @@
       <c-upload
         v-loading="loadingBtn"
         typeUpload="CD"
-        deleteUrl="/api/blade-sales-part/corpsfiles/remove"
+        deleteUrl="/api/gubersail-admin/corpsfiles/remove"
         :data="corpsFiles"
         display
         :enumerationValue="35.1"
         :disabled="detailData.status == 1"
+        :mainImageType="true"
       ></c-upload>
       <el-dialog
         title="设置客户分类"
@@ -205,7 +206,7 @@ import corpType from "./components/index.vue";
 import corpLabel from "./components/label.vue";
 import website from "@/config/website";
 import dicSelect from "@/components/dicSelect/main.vue";
-
+import { getToken } from "@/util/auth";
 export default {
   name: "index",
   data() {
@@ -419,6 +420,19 @@ export default {
             valueFormat: "yyyy-MM-01 00:00:00"
           },
           {
+            label: "营业执照",
+            prop: "businessLicenseUrl",
+            type: "upload",
+            listType: "picture-img",
+            fileType: "img", //img/video/audio
+            propsHttp: {
+              res: "data",
+              url: "link"
+            },
+            action: "/api/blade-resource/oss/endpoint/put-file",
+            headers: { "Blade-Auth": "Bearer " + getToken() }
+          },
+          {
             label: "备注",
             prop: "remarks",
             type: "textarea",
@@ -829,6 +843,7 @@ export default {
         if (valid) {
           if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
           if (this.data.length == 0) return this.$message.error("请添加地址信息");
+          if (this.corpsFiles.filter(item => item.mainImage == 1).length > 1) return this.$message.error("附件主图只允许选一个");
           this.loadingBtn = true;
           if (!this.form.id) {
             this.form.checkStatus = "通过";