Commit 5f193a74 authored by 白舜's avatar 白舜 🎱

格式化规范化

parent 1d348cce
......@@ -7,7 +7,7 @@
"build": "vite build",
"preview": "vite preview",
"lint": "eslint --ext .js,vue --ignore-pattern '!.*ignore' .",
"lint:fix": "eslint --fix && prettier --config .prettierrc --write ."
"lint:fix": "prettier --config .prettierrc --write . && yarn lint --fix"
},
"dependencies": {
"@element-plus/icons-vue": "^2.0.10",
......
......@@ -79,6 +79,8 @@ const info = reactive({
],
});
const aFileList = ref([]);
const { options: btnsOption, currentValue: btnsCurrentValue } = toRefs(btns);
const { title: cardTitle, icon: cardIcon } = toRefs(card);
</script>
......@@ -220,10 +222,14 @@ const { title: cardTitle, icon: cardIcon } = toRefs(card);
<cw title="bg-upload-image" />
<cw title="bg-upload">
<bg-upload
:data="{
directory: 'file',
uniqueCode: false,
}" />
v-model="aFileList"
:el-attrs="{
multiple: false,
drag: true,
}"
:auto="false"
:custom-tips="true"
:file-types="['zip', 'tgz', 'tar', 'gz']" />
</cw>
<cw title="bg-user-upload-image" />
</div>
......
......@@ -18,17 +18,13 @@
v-if="!item.urls"
:title="item.info"
:style="item.url ? { color: '#515fe7', cursor: 'pointer' } : ''"
@click="down_file(item.url)"
>{{ item.info }}</span
>
@click="down_file(item.url)">{{ item.info }}</span>
<span v-else :title="item.info">
<span
v-for="(it, idx) in item.urls"
:key="'urls' + idx"
style="color: #515fe7; cursor: pointer"
@click="down_file(it)"
>{{ helper.downloadFileFormatNew(it) }}</span
>
@click="down_file(it)">{{ helper.downloadFileFormatNew(it) }}</span>
</span>
</template>
</div>
......@@ -43,6 +39,7 @@
<script setup>
import { reactive, ref, onBeforeMount, toRefs, watch } from "vue";
import helper from "./utils/index.js";
const props = defineProps({
data: {
type: Array,
......@@ -50,9 +47,9 @@ const props = defineProps({
},
layout: {
type: Object,
default: () => {
4;
},
default: () => ({
line_num: 4,
}),
},
});
......
......@@ -28,17 +28,15 @@
width: item.copy
? 'calc(100% - 36px)'
: item.download || item.password
? 'calc(100% - 22px)'
: '100%',
? 'calc(100% - 22px)'
: '100%',
color: item.download ? '#3759be' : '#404a62',
}">
<span
v-if="item.callback"
class="can_click_text"
style="text-decoration: underline"
@click.stop="item.callback && item.callback()"
>{{ item.value }}</span
>
@click.stop="item.callback && item.callback()">{{ item.value }}</span>
<span v-else>{{ item.value }}</span>
</span>
<a
......
......@@ -29,7 +29,7 @@
<script setup>
import { reactive, ref, onBeforeMount, toRefs, computed, nextTick } from "vue";
import html2canvas from "html2canvas";
const emit = defineEmits(["update:btn"]);
const props = defineProps({
title: {
type: String,
......@@ -57,7 +57,6 @@ const props = defineProps({
},
});
const emit = defineEmits(["update:btn"]);
const style = computed(() => {
return {
width: `calc(${props.width} - 20px)`,
......
......@@ -43,7 +43,9 @@
<el-button type="primary" @click="$emit('search-action')">
查询
</el-button>
<el-button @click="$emit('search-reset')"> 重置 </el-button>
<el-button type="default" @click="$emit('search-reset')">
重置
</el-button>
</div>
</div>
</div>
......@@ -71,6 +73,7 @@
</template>
<script setup>
const emit = defineEmits(["update:visible", "search-action", "search-reset"]);
const props = defineProps({
visible: {
type: Boolean,
......@@ -85,6 +88,4 @@ const props = defineProps({
default: false,
},
});
const emit = defineEmits(["update:visible", "search-action", "search-reset"]);
</script>
......@@ -81,7 +81,7 @@ const props = defineProps({
},
highlightParentRule: {
type: Function,
default: () => null,
default: () => {},
},
});
......
......@@ -27,7 +27,7 @@ const props = defineProps({
}, // 导航列表 [ { name: "xxx", path: "xxx" } ]
highlightParentRule: {
type: Function,
default: () => null,
default: () => {},
},
});
</script>
......@@ -18,8 +18,10 @@
<script setup>
import "@wangeditor/editor/dist/css/style.css"; // 引入 css
import { onBeforeUnmount, ref, shallowRef, onMounted } from "vue";
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import { useFormItem } from "element-plus";
const props = defineProps({
......@@ -36,14 +38,8 @@ const props = defineProps({
default: "default",
},
});
const emit = defineEmits([
"update:modelValue",
"update:visible",
"search-action",
"search-reset",
"change",
"blur",
]);
const emit = defineEmits(["update:modelValue", "change", "blur"]);
const valueHtml = ref("");
// change次数
......
......@@ -20,9 +20,7 @@
v-for="(item, index) in state.lastChildren"
:key="'as' + index"
:class="item.disabled ? 'disabled' : ''"
@click="action(item.onClick, item.disabled)"
>{{ item.name }}</span
>
@click="action(item.onClick, item.disabled)">{{ item.name }}</span>
</div>
</teleport>
</span>
......
......@@ -72,8 +72,8 @@ const attrs = useAttrs();
const props = defineProps({
headers: {
type: Array,
default: () => [],
require: true,
default: () => [],
},
data: {
type: Array,
......@@ -93,7 +93,7 @@ const props = defineProps({
},
selectable: {
type: Function,
default: () => null,
default: () => {},
},
defaultExpandAll: {
type: Boolean,
......
......@@ -111,8 +111,8 @@ const props = defineProps({
},
headers: {
type: Array,
default: () => [],
require: true,
default: () => [],
},
rows: {
type: Array,
......
......@@ -96,7 +96,7 @@ const props = defineProps({
}, // 接受类型
fileSize: {
type: Number,
default: 2048,
default: 1024,
}, // 文件大小
fileSizeUnit: {
type: String,
......
......@@ -3,7 +3,6 @@
class="bg-upload"
:class="{ 'is-disabled': actionDisabled, 'is-easy': isEasy }">
<el-upload
ref="uploadRef"
:action="actionUrl"
:data="actionData"
:name="actionName"
......@@ -27,7 +26,7 @@
支持上传{{ fileTypes.join("") }},最大{{ fileMaxSize }}M
</div> -->
<template v-if="isEasy">
<el-button type="primary" size="mini">
<el-button type="primary" size="small">
<bg-icon
v-if="triggerIcon"
:icon="`#${triggerIcon}`"
......@@ -68,7 +67,6 @@ import {
toRefs,
} from "vue";
import { ElMessage } from "element-plus";
const props = defineProps({
modelValue: {
type: Array,
......@@ -144,8 +142,6 @@ const props = defineProps({
const emit = defineEmits(["update:modelValue", "change", "delete"]);
const uploadRef = ref(null);
const state = reactive({
fileList: [],
initFileList: [],
......@@ -176,7 +172,11 @@ watch(
.join(",");
if (newStr !== oldStr) {
state.fileList = [...props.modelValue];
let newFileList = [];
props.modelValue.forEach((file) => {
newFileList.push({ name: file.name, url2: file.url });
});
state.fileList = newFileList;
}
}
);
......@@ -226,7 +226,7 @@ const updateFileList = (fileList) => {
if (props.saveType == "url") {
return {
name: v.name,
url: (v.response && v.response.data) || v.url || v.raw,
url: (v.response && v.response.data) || v.url2 || v.raw,
};
} else {
return {
......@@ -243,7 +243,6 @@ const updateFileList = (fileList) => {
};
const onChangeFile = (file, fileList) => {
console.log(file, fileList);
if (!handleBeforeUpload(file.raw)) {
state.fileList = state.fileList.filter(({ uid }) => file.uid !== uid);
return;
......
......@@ -81,7 +81,7 @@ export default {
});
return vnode;
} catch (error) {
console.error(error);
log.error(error);
}
},
};
var downloadFileFormatNew = function (fileUrl) {
var downloadFileFormatNew = function(fileUrl) {
/*
input: /apaas/common/docs/image/images/1234_qq234ewr123.png
output: 1234.png
......
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