-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -123,7 +120,7 @@
>
- 审核
@@ -177,6 +175,8 @@ import { destroy, index, save } from "@/api/meeting";
import { index as meetingRoomIndex } from "@/api/meetingRoom";
import AddMeeting from "./components/AddMeeting.vue";
import UserPicker from "@/components/UserPicker/index.vue";
+import axios from "axios";
+import {getToken} from "@/utils/auth";
export default {
components: {
@@ -185,13 +185,16 @@ export default {
},
data() {
return {
+ examineKey: 0,
isShowAdd: false,
+ isShowType: 'add',
rooms: [],
loading: false,
select: {
page: 1,
page_size: 20,
+ show_relation: ['users']
},
total: 0,
allAlign: null,
@@ -208,6 +211,7 @@ export default {
meeting_status: "",
files: [],
user_ids: [],
+ files_details: []
},
};
},
@@ -224,7 +228,40 @@ export default {
this.getList();
this.getRooms();
},
+ mounted() {
+ this.bindToolbar()
+ },
methods: {
+ uploadMethod(file, row) {
+ const formData = new FormData()
+ formData.append('file', file)
+ return axios.post(process.env.VUE_APP_UPLOAD_API, formData, {
+ headers: {
+ Authorization: `Bearer ${getToken()}`,
+ }
+ }).then((response) => {
+ if (response.status === 200 && !response.data.code) {
+ if (!(this.form['files_details'] instanceof Array)) {
+ this.form['files_details'] = []
+ }
+ this.form['files_details'].push({
+ response: response.data.data,
+ name: response.data.data.original_name,
+ url: response.data.data.url
+ })
+ } else {
+ this.$message.error("上传失败")
+ }
+ })
+ },
+ bindToolbar() {
+ this.$nextTick(() => {
+ if (this.$refs["table"] && this.$refs["toolbar"]) {
+ this.$refs["table"].connect(this.$refs["toolbar"]);
+ }
+ });
+ },
+
editRowEvent(row) {
if (this.$refs["table"]) {
this.$refs["table"].setEditRow(row);
@@ -279,10 +316,8 @@ export default {
for (const key in form) {
form[key] = row[key];
}
- if (!form.password) {
- delete form.password;
- }
this.loading = true;
+ form['files'] = this.form['files_details'].map(i => i.response?.id)
await save(form);
await this.getList();
this.loading = false;
@@ -314,6 +349,12 @@ export default {
this.loading = false;
}
},
+
+ async examine(row) {
+ this.isShowType = 'examine'
+ this.$refs['AddMeeting'].getDetail(row)
+ this.isShowAdd = true
+ }
},
};
diff --git a/src/views/notice/components/AddNotice.vue b/src/views/notice/components/AddNotice.vue
index 1f3cc40..3b0d79d 100644
--- a/src/views/notice/components/AddNotice.vue
+++ b/src/views/notice/components/AddNotice.vue
@@ -49,6 +49,7 @@
}"
:before-upload="beforeUpload"
:on-success="uploadSuccess"
+ :on-remove="uploadRemove"
multiple
:file-list="fileList"
>
@@ -150,6 +151,9 @@ export default {
this.getUsers()
},
methods: {
+ uploadRemove(file, fileList) {
+ this.fileList = fileList
+ },
beforeUpload(file) {
const isLt10M = file.size / 1024 / 1024 < 10
if (!isLt10M) {
@@ -158,6 +162,10 @@ export default {
return isLt10M
},
uploadSuccess(response, file, fileList) {
+ if (response.code) {
+ fileList.splice(fileList.indexOf(file), 1)
+ this.$message.warning(response.msg)
+ }
this.fileList = fileList
},
diff --git a/src/views/vehicle/components/AddVehicle.vue b/src/views/vehicle/components/AddVehicle.vue
index 94c3c51..c29107d 100644
--- a/src/views/vehicle/components/AddVehicle.vue
+++ b/src/views/vehicle/components/AddVehicle.vue
@@ -143,6 +143,10 @@ export default {
this.form.photo_file_id = ''
},
photoSuccess(response, file, fileList) {
+ if (response.code) {
+ fileList.splice(fileList.indexOf(file), 1)
+ this.$message.warning(response.msg)
+ }
this.fileList = fileList
this.form.photo_file_id = this.fileList[0]?.response?.data?.id
},