Commit 674a64c4 authored by 赵伟庚's avatar 赵伟庚

fix some bugs

parent 4deaf832
...@@ -41,19 +41,19 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 ...@@ -41,19 +41,19 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
- export NODE_ENV=production - export NODE_ENV=production
- yarn build - yarn build
# - name: s3-cache-build - name: s3-cache-build
# image: registry.cn-qingdao.aliyuncs.com/wod/devops-s3-cache:1.0 image: registry.cn-qingdao.aliyuncs.com/wod/devops-s3-cache:1.0
# network_mode: host network_mode: host
# settings: settings:
# rebuild: true rebuild: true
# hash: package.json hash: package.json
# mount: mount:
# - node_modules - node_modules
# endpoint: http://cache.wodcloud.com endpoint: http://cache.wodcloud.com
# access_key: access_key:
# from_secret: ACCESS_KEY_MINIO from_secret: ACCESS_KEY_MINIO
# secret_key: secret_key:
# from_secret: SECRET_KEY_MINIO from_secret: SECRET_KEY_MINIO
- name: docker - name: docker
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0 image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0
......
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
</div> </div>
</template> </template>
</el-upload> </el-upload>
<el-dialog title="图片预览" v-model="dialogVisible" custom-class="bg-upload-image-dialog">
<img style="margin:30px 0;width: 600px;" :src="dialogImageUrl" alt="Preview Image" />
</el-dialog>
</template> </template>
<script> <script>
...@@ -59,7 +63,7 @@ export default { ...@@ -59,7 +63,7 @@ export default {
}, },
action: { action: {
type: String, type: String,
default: "/apaas/common/file/upload", default: "/apaas/common/image/upload",
}, },
autoUpload: { autoUpload: {
type: Boolean, type: Boolean,
...@@ -74,7 +78,7 @@ export default { ...@@ -74,7 +78,7 @@ export default {
}, },
multiple: { multiple: {
type: Boolean, type: Boolean,
default: true, default: false,
}, },
accept: { accept: {
...@@ -100,7 +104,7 @@ export default { ...@@ -100,7 +104,7 @@ export default {
default: "", default: "",
},// 自定义提示内容 },// 自定义提示内容
}, },
emits: ['update:modelValue'], emits: ['update:modelValue',"change"],
computed: { computed: {
acceptTypes() { acceptTypes() {
if (Array.isArray(this.accept)) { if (Array.isArray(this.accept)) {
...@@ -142,6 +146,8 @@ export default { ...@@ -142,6 +146,8 @@ export default {
return { return {
fileList: [], fileList: [],
UploadFilled, UploadFilled,
dialogImageUrl:'',
dialogVisible:false
}; };
}, },
watch: { watch: {
...@@ -154,9 +160,22 @@ export default { ...@@ -154,9 +160,22 @@ export default {
if (newStr !== oldStr) { if (newStr !== oldStr) {
this.fileList = [...this.modelValue]; this.fileList = [...this.modelValue];
} }
this.$nextTick().then(() => {
this.checkLimit(this.modelValue)
});
}, },
}, },
methods: { methods: {
checkLimit(filelist) {
const limit = this.limit
const uploadDom = this.$refs['upload']
const length = uploadDom.$el.children[0].children.length
if (filelist.length === limit) {
uploadDom.$el.children[0].children[length-1].style.display = 'none'
} else {
uploadDom.$el.children[0].children[length-1]?uploadDom.$el.children[0].children[length-1].style.display = '':''
}
},
handleBeforeUpload(file) { handleBeforeUpload(file) {
let units = { let units = {
KB: 1024, KB: 1024,
...@@ -181,17 +200,21 @@ export default { ...@@ -181,17 +200,21 @@ export default {
}, },
handleSuccess(response, file, fileList) { handleSuccess(response, file, fileList) {
this.updateFileList(fileList); this.updateFileList(fileList);
this.checkLimit(fileList)
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.updateFileList(fileList); this.updateFileList(fileList);
this.checkLimit(fileList)
}, },
handlePreview({ name, url }) { handlePreview({ name, url }) {
let a = document.createElement("a"); // 生成一个a元素 this.dialogImageUrl = url
let event = new MouseEvent("click"); // 创建一个单击事件 this.dialogVisible = true
// let a = document.createElement("a"); // 生成一个a元素
// let event = new MouseEvent("click"); // 创建一个单击事件
a.download = name; // 设置图片名称 // a.download = name; // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性 // a.href = url; // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件 // a.dispatchEvent(event); // 触发a的单击事件
}, },
updateFileList(fileList) { updateFileList(fileList) {
let values = fileList.map((v) => { let values = fileList.map((v) => {
...@@ -206,6 +229,7 @@ export default { ...@@ -206,6 +229,7 @@ export default {
console.log(values); console.log(values);
this.$emit("update:modelValue", values); this.$emit("update:modelValue", values);
this.$emit("change",values);
}, },
submitUpload() { submitUpload() {
this.$refs.upload.submit(); this.$refs.upload.submit();
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
:disabled="actionDisabled" :disabled="actionDisabled"
style="max-width: 600px" style="max-width: 600px"
multiple multiple
drag
> >
<!-- <el-button type="primary"> <!-- <el-button type="primary">
上传附件 上传附件
...@@ -209,3 +210,9 @@ export default { ...@@ -209,3 +210,9 @@ export default {
}, },
}; };
</script> </script>
<style>
.bg-upload .el-upload-dragger{
padding: 0;
border: 0;
}
</style>
...@@ -2559,6 +2559,7 @@ a { ...@@ -2559,6 +2559,7 @@ a {
width: 100%; width: 100%;
.el-checkbox { .el-checkbox {
width: 100%;
.el-checkbox__label { .el-checkbox__label {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -2620,7 +2621,7 @@ a { ...@@ -2620,7 +2621,7 @@ a {
} }
.bg-permission-option--self { .bg-permission-option--self {
width: 168px; width: 128px;
&.full-option { &.full-option {
width: 100%; width: 100%;
...@@ -2628,7 +2629,7 @@ a { ...@@ -2628,7 +2629,7 @@ a {
} }
.bg-permission-option--list { .bg-permission-option--list {
width: calc(100% - 168px); width: calc(100% - 128px);
&.flex-wrap { &.flex-wrap {
display: flex; display: flex;
...@@ -2640,10 +2641,13 @@ a { ...@@ -2640,10 +2641,13 @@ a {
>.bg-permission-option { >.bg-permission-option {
>.bg-permission-option--self { >.bg-permission-option--self {
width: 168px; width: 128px;
border-right: none; border-right: none;
border-bottom: none; border-bottom: none;
} }
} }
} }
} }
.bg-upload-image-dialog {
width: 650px;
}
\ No newline at end of file
...@@ -217,22 +217,21 @@ import CryptoJS from "crypto-js"; ...@@ -217,22 +217,21 @@ import CryptoJS from "crypto-js";
{ {
label: "业务系统编码", label: "业务系统编码",
prop: "business_code", prop: "business_code",
width: 180 minWidth: 160
}, },
{ {
label: "业务系统名称", label: "业务系统名称",
prop: "business_name", prop: "business_name",
minWidth: 180 minWidth: 160
}, },
{ {
label: "账号", label: "账号",
prop: "system_account", prop: "system_account",
width: 150
}, },
{ {
label: "所属机构", label: "所属机构",
prop: "organization_name", prop: "organization_name",
width: 240 minwidth: 240
}, },
{ {
label: "创建时间", label: "创建时间",
...@@ -242,7 +241,6 @@ import CryptoJS from "crypto-js"; ...@@ -242,7 +241,6 @@ import CryptoJS from "crypto-js";
{ {
label: "是否启用", label: "是否启用",
prop: "state", prop: "state",
width: 80
}, },
{ {
label: "操作", label: "操作",
......
...@@ -969,7 +969,7 @@ import { downloadFileFormatNew } from '@/services/helper' ...@@ -969,7 +969,7 @@ import { downloadFileFormatNew } from '@/services/helper'
bottom: unset bottom: unset
} }
.dialog_form { .dialog_form {
padding: 16px; padding: 24px 8px 6px;
} }
</style> </style>
\ No newline at end of file
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
:model="orgForm" :model="orgForm"
:rules="formRules" :rules="formRules"
ref="orgRef" ref="orgRef"
style="max-width: 80%"
> >
<el-form-item label="上级目录" prop="p_organization_id" v-if="formType === 'create'"> <el-form-item label="上级目录" prop="p_organization_id" v-if="formType === 'create'">
<el-tree-select <el-tree-select
...@@ -30,9 +29,13 @@ ...@@ -30,9 +29,13 @@
<el-input type="textarea" :rows="3" v-model="orgForm.description" /> <el-input type="textarea" :rows="3" v-model="orgForm.description" />
</el-form-item> </el-form-item>
<el-form-item label="组织附件" prop="logo"> <el-form-item label="组织附件" prop="logo">
<bg-upload v-model="orgForm.attachment" customTips :limit="3" <bg-upload
v-model="orgForm.attachment"
customTips
:limit="3"
:fileTypes="['doc','docx','xls','xlsx','pdf','jpg','jpeg','png','zip','rar']" :fileTypes="['doc','docx','xls','xlsx','pdf','jpg','jpeg','png','zip','rar']"
:otherInfo="'最多可上传三个附件,可上传zip,rar,doc,docx,xlsx,xls,png,jpg,可上传营业执照和相关协议文件等'"> :otherInfo="'最多可上传三个附件,可上传zip,rar,doc,docx,xlsx,xls,png,jpg,可上传营业执照和相关协议文件等'"
>
<span>将文件拖到此处,或 点击上传</span> <span>将文件拖到此处,或 点击上传</span>
</bg-upload> </bg-upload>
</el-form-item> </el-form-item>
......
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