mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
feat:增加搜索学习路径
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
<a-range-picker
|
||||
style="width: 424px"
|
||||
v-model:value="time"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
format="YYYY-MM-DD"
|
||||
@change="onChange"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
@@ -102,12 +102,13 @@
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import * as api from "../../api/indexEval";
|
||||
import { message } from "ant-design-vue";
|
||||
// import { toDate } from "../../api/method";
|
||||
import { toDate } from "../../api/method.js";
|
||||
const router = useRouter();
|
||||
const rowSelection = ref({
|
||||
checkStrictly: false,
|
||||
@@ -127,7 +128,7 @@ const rowSelection = ref({
|
||||
});
|
||||
function getBase64(img, callback) {
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener('load', () => callback(reader.result));
|
||||
reader.addEventListener("load", () => callback(reader.result));
|
||||
reader.readAsDataURL(img);
|
||||
}
|
||||
export default {
|
||||
@@ -158,48 +159,54 @@ export default {
|
||||
console.log("state", bool);
|
||||
};
|
||||
const onChange = () => {
|
||||
console.log(
|
||||
"state.time[0]",
|
||||
toDate(new Date(state.time[0].$d).getTime() / 1000, "Y-M-D"),
|
||||
state.time[1]
|
||||
);
|
||||
state.endTime = state.time[0].$d.toString;
|
||||
state.startTime = state.time[1].$d.toString;
|
||||
}
|
||||
};
|
||||
//上传组件
|
||||
const fileList = ref([]);
|
||||
const loading = ref(false);
|
||||
const imageUrl = ref('');
|
||||
const imageUrl = ref("");
|
||||
|
||||
const handleChange = info => {
|
||||
if (info.file.status === 'uploading') {
|
||||
const handleChange = (info) => {
|
||||
if (info.file.status === "uploading") {
|
||||
loading.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.file.status === 'done') {
|
||||
if (info.file.status === "done") {
|
||||
// Get this url from response in real world.
|
||||
getBase64(info.file.originFileObj, base64Url => {
|
||||
getBase64(info.file.originFileObj, (base64Url) => {
|
||||
imageUrl.value = base64Url;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
if (info.file.status === 'error') {
|
||||
if (info.file.status === "error") {
|
||||
loading.value = false;
|
||||
message.error('upload error');
|
||||
message.error("upload error");
|
||||
}
|
||||
}
|
||||
const beforeUpload = file => {
|
||||
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
||||
};
|
||||
const beforeUpload = (file) => {
|
||||
const isJpgOrPng =
|
||||
file.type === "image/jpeg" || file.type === "image/png";
|
||||
|
||||
if (!isJpgOrPng) {
|
||||
message.error('You can only upload JPG file!');
|
||||
message.error("You can only upload JPG file!");
|
||||
}
|
||||
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
|
||||
if (!isLt2M) {
|
||||
message.error('Image must smaller than 2MB!');
|
||||
message.error("Image must smaller than 2MB!");
|
||||
}
|
||||
|
||||
return isJpgOrPng && isLt2M;
|
||||
}
|
||||
};
|
||||
// const fileUp = () => {
|
||||
// let obj = {
|
||||
// file
|
||||
@@ -262,7 +269,7 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
<style lang="scss">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
@@ -401,4 +408,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user