|
@@ -38,6 +38,7 @@
|
|
|
/>
|
|
/>
|
|
|
<el-table-column align="center" prop="name" label="名称" />
|
|
<el-table-column align="center" prop="name" label="名称" />
|
|
|
<el-table-column align="center" prop="category" label="类别" />
|
|
<el-table-column align="center" prop="category" label="类别" />
|
|
|
|
|
+ <el-table-column align="center" prop="updateTime" label="创建时间" />
|
|
|
<el-table-column align="center" label="操作" width="200">
|
|
<el-table-column align="center" label="操作" width="200">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div class="edit">
|
|
<div class="edit">
|
|
@@ -111,14 +112,51 @@
|
|
|
class="m-2"
|
|
class="m-2"
|
|
|
placeholder="请选择类别"
|
|
placeholder="请选择类别"
|
|
|
style="width: 500px"
|
|
style="width: 500px"
|
|
|
|
|
+ @change="typeSel"
|
|
|
>
|
|
>
|
|
|
<el-option label="小程序" value="小程序" />
|
|
<el-option label="小程序" value="小程序" />
|
|
|
<el-option label="管理后台" value="管理后台" />
|
|
<el-option label="管理后台" value="管理后台" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="logo图标 :" prop="logoUrl">
|
|
|
|
|
- <input type="file" @change="handleFileUpload" />
|
|
|
|
|
- <img :src="imgUrl" alt="" style="width: 20px; height: 20px" />
|
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-if="editRuleForm.type == '小程序'"
|
|
|
|
|
+ label="logo图标 :"
|
|
|
|
|
+ prop="logoUrl"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="xcxLogo">
|
|
|
|
|
+ <img
|
|
|
|
|
+ :src="editRuleForm.logoUrl"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ style="width: 80px; height: 80px"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ class="avatar-uploader"
|
|
|
|
|
+ action="#"
|
|
|
|
|
+ ref="upload"
|
|
|
|
|
+ :auto-upload="false"
|
|
|
|
|
+ list-type="picture"
|
|
|
|
|
+ :on-preview="handlePreview"
|
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
|
+ :on-change="handleChange"
|
|
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ :on-exceed="handleExceed"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #trigger>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ color="rgba(41, 109, 227, 1)"
|
|
|
|
|
+ @click="updateImg"
|
|
|
|
|
+ >上传图片</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #tip>
|
|
|
|
|
+ <div class="el-upload__tip">
|
|
|
|
|
+ (注:图片格式必须为JPG/PNG格式,大小不超过50Kb)
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="应用链接 :" prop="applyLink">
|
|
<el-form-item label="应用链接 :" prop="applyLink">
|
|
|
<el-input
|
|
<el-input
|
|
@@ -178,7 +216,7 @@ import {
|
|
|
onUnmounted,
|
|
onUnmounted,
|
|
|
} from "vue";
|
|
} from "vue";
|
|
|
import { useRouter } from "vue-router";
|
|
import { useRouter } from "vue-router";
|
|
|
-import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
|
|
|
|
+import { ElMessage, ElMessageBox, genFileId } from "element-plus";
|
|
|
import { Calendar } from "@element-plus/icons-vue";
|
|
import { Calendar } from "@element-plus/icons-vue";
|
|
|
import vidiconsApi from "@/api/vidicons.js";
|
|
import vidiconsApi from "@/api/vidicons.js";
|
|
|
import { dayjs } from "element-plus";
|
|
import { dayjs } from "element-plus";
|
|
@@ -224,22 +262,18 @@ const total = ref(4); // 当前总数
|
|
|
const titleDialog = ref("");
|
|
const titleDialog = ref("");
|
|
|
const editVisible = ref(false);
|
|
const editVisible = ref(false);
|
|
|
const editRef = ref();
|
|
const editRef = ref();
|
|
|
|
|
+const upload = ref();
|
|
|
const editRuleForm = reactive({
|
|
const editRuleForm = reactive({
|
|
|
name: "", // 名称
|
|
name: "", // 名称
|
|
|
- applyLink: "", // 应用链接
|
|
|
|
|
type: "", // 类别
|
|
type: "", // 类别
|
|
|
|
|
+ logoUrl: "", // 图标
|
|
|
|
|
+ applyLink: "", // 应用链接
|
|
|
id: "",
|
|
id: "",
|
|
|
});
|
|
});
|
|
|
-const imgUrl = ref();
|
|
|
|
|
-
|
|
|
|
|
-// 打开项目弹窗
|
|
|
|
|
-const applyVisible = ref(false);
|
|
|
|
|
-const applyTitle = ref();
|
|
|
|
|
-const iframeSrc = ref();
|
|
|
|
|
-
|
|
|
|
|
// 表单验证
|
|
// 表单验证
|
|
|
const editRules = reactive({
|
|
const editRules = reactive({
|
|
|
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
|
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
|
|
|
|
+ logoUrl: [{ required: true, message: "图标不能为空", trigger: "blur" }],
|
|
|
type: [
|
|
type: [
|
|
|
{
|
|
{
|
|
|
required: true,
|
|
required: true,
|
|
@@ -256,6 +290,11 @@ const editRules = reactive({
|
|
|
],
|
|
],
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+// 打开项目弹窗
|
|
|
|
|
+const applyVisible = ref(false);
|
|
|
|
|
+const applyTitle = ref();
|
|
|
|
|
+const iframeSrc = ref();
|
|
|
|
|
+
|
|
|
// 应用管理分页数据
|
|
// 应用管理分页数据
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
@@ -266,7 +305,7 @@ const getList = async () => {
|
|
|
};
|
|
};
|
|
|
let res = await axios({
|
|
let res = await axios({
|
|
|
method: "get",
|
|
method: "get",
|
|
|
- url: api.value + "/smartApply/queryPageSmartApply",
|
|
|
|
|
|
|
+ url: api.value + "/wanzai/api/smartApply/queryPageSmartApply",
|
|
|
headers: {
|
|
headers: {
|
|
|
// token: sessionStorage.getItem("token"),
|
|
// token: sessionStorage.getItem("token"),
|
|
|
// user_head: sessionStorage.getItem("userhead"),
|
|
// user_head: sessionStorage.getItem("userhead"),
|
|
@@ -303,53 +342,188 @@ const searchBtn = lodash.debounce(async () => {
|
|
|
const addApply = async () => {
|
|
const addApply = async () => {
|
|
|
titleDialog.value = "新建应用";
|
|
titleDialog.value = "新建应用";
|
|
|
editVisible.value = true;
|
|
editVisible.value = true;
|
|
|
- editRef.value.resetFields();
|
|
|
|
|
editRuleForm.name = "";
|
|
editRuleForm.name = "";
|
|
|
editRuleForm.applyLink = "";
|
|
editRuleForm.applyLink = "";
|
|
|
editRuleForm.type = "";
|
|
editRuleForm.type = "";
|
|
|
- // let data = {
|
|
|
|
|
- // linkId: row.id,
|
|
|
|
|
- // };
|
|
|
|
|
- // let res = await axios({
|
|
|
|
|
- // method: "post",
|
|
|
|
|
- // url: api.value + "/mhotel/uploadgetByLinkId.action",
|
|
|
|
|
- // headers: {},
|
|
|
|
|
- // params: data,
|
|
|
|
|
- // });
|
|
|
|
|
- // console.log(res, "编辑中查找图片");
|
|
|
|
|
- // if (res.data.code == 200) {
|
|
|
|
|
- // // res.data.data.fileInfoList.forEach((item) => {
|
|
|
|
|
- // // item.uid = item.id;
|
|
|
|
|
- // // });
|
|
|
|
|
- // // fileList.list = res.data.data.fileInfoList;
|
|
|
|
|
- // // ruleForm.fileListJson = fileList.list;
|
|
|
|
|
- // res.data.data.forEach((item) => {
|
|
|
|
|
- // item.uid = item.id;
|
|
|
|
|
- // });
|
|
|
|
|
- // fileList.list = res.data.data;
|
|
|
|
|
- // ruleForm.fileListJson = fileList.list;
|
|
|
|
|
- // // ElMessage({
|
|
|
|
|
- // // type: "success",
|
|
|
|
|
- // // showClose: true,
|
|
|
|
|
- // // message: res.data.message,
|
|
|
|
|
- // // center: true,
|
|
|
|
|
- // // });
|
|
|
|
|
- // } else {
|
|
|
|
|
- // ElMessage({
|
|
|
|
|
- // type: "error",
|
|
|
|
|
- // showClose: true,
|
|
|
|
|
- // message: res.data.message,
|
|
|
|
|
- // center: true,
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ editRuleForm.logoUrl = "";
|
|
|
|
|
+ editRuleForm.id = "";
|
|
|
};
|
|
};
|
|
|
|
|
+// 确定添加应用
|
|
|
const confirmEdit = (formEl) => {
|
|
const confirmEdit = (formEl) => {
|
|
|
if (!formEl) return;
|
|
if (!formEl) return;
|
|
|
formEl.validate(async (valid, fields) => {
|
|
formEl.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ name: editRuleForm.name,
|
|
|
|
|
+ category: editRuleForm.type,
|
|
|
|
|
+ urlLink: editRuleForm.applyLink,
|
|
|
|
|
+ };
|
|
|
|
|
+ if (editRuleForm.logoUrl) {
|
|
|
|
|
+ data.logo = editRuleForm.logoUrl;
|
|
|
|
|
+ }
|
|
|
|
|
+ let res = "";
|
|
|
|
|
+ if (editRuleForm.id) {
|
|
|
|
|
+ data.id = editRuleForm.id;
|
|
|
|
|
+ res = await axios({
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ url: api.value + "/wanzai/api/smartApply/updateSmartApplyById",
|
|
|
|
|
+ headers: {},
|
|
|
|
|
+ data: data,
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ res = await axios({
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ url: api.value + "/wanzai/api/smartApply/insertSmartApply",
|
|
|
|
|
+ headers: {},
|
|
|
|
|
+ data: data,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(res, "添加/编辑应用");
|
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
|
+ editVisible.value = false;
|
|
|
|
|
+ getList();
|
|
|
|
|
+ editRef.value.resetFields();
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ message: res.data.message,
|
|
|
|
|
+ center: true,
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "error",
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ message: res.data.message,
|
|
|
|
|
+ center: true,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
+// 切换类别 (小程序 管理后台)
|
|
|
|
|
+const typeSel = () => {
|
|
|
|
|
+ editRuleForm.logoUrl = "";
|
|
|
|
|
+};
|
|
|
|
|
+// 封面图上传(------------------------------------------------------)
|
|
|
|
|
+// 添加照片时往fileList列表中添加图片信息(封面图上传图片)
|
|
|
|
|
+const handleChange = (file, fileLists) => {
|
|
|
|
|
+ console.log(file, "file11111");
|
|
|
|
|
+ if (file.raw.type == "image/jpeg" || file.raw.type == "image/png") {
|
|
|
|
|
+ if (file.size /1024 > 50) {
|
|
|
|
|
+ ElMessage.error("图片的大小不能超过50Kb!");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (file.raw) {
|
|
|
|
|
+ const cos = new COS({
|
|
|
|
|
+ SecretId: "AKIDCPVZdcWIxgHpy5FYxVyPiqkZGrhdXUBg",
|
|
|
|
|
+ SecretKey: "NkyCN3cz97qKaeXLvHOGxOcdS8f184pL",
|
|
|
|
|
+ SecurityToken: "1306339220",
|
|
|
|
|
+ Bucket: "wanzai-1306339220",
|
|
|
|
|
+ Region: "ap-shanghai",
|
|
|
|
|
+ });
|
|
|
|
|
+ const files = file.raw;
|
|
|
|
|
+ console.log(files, "files文件");
|
|
|
|
|
+ const key = file.name; // 设置上传到 COS 后的文件名
|
|
|
|
|
+ cos.putObject(
|
|
|
|
|
+ {
|
|
|
|
|
+ Bucket: "wanzai-1306339220",
|
|
|
|
|
+ Region: "ap-shanghai",
|
|
|
|
|
+ Key: key,
|
|
|
|
|
+ Body: files,
|
|
|
|
|
+ onProgress: function (progressData) {
|
|
|
|
|
+ console.log(JSON.stringify(progressData));
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ function (err, data) {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ console.error(err, "请求失败");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log(data, "请求成功");
|
|
|
|
|
+ editRuleForm.logoUrl = "https://" + data.Location;
|
|
|
|
|
+ // 成功
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error("图片格式必须为JPG/PNG格式!");
|
|
|
|
|
+ }
|
|
|
|
|
+ // ruleForm.coverImg = file.url;
|
|
|
|
|
+};
|
|
|
|
|
+// 可以获取图片参数(封面图上传图片)
|
|
|
|
|
+const handleUpload = async (file) => {
|
|
|
|
|
+ console.log(file, "2222");
|
|
|
|
|
+ // if (xcxFile.value) {
|
|
|
|
|
+ // const cos = new COS({
|
|
|
|
|
+ // SecretId: "AKIDCPVZdcWIxgHpy5FYxVyPiqkZGrhdXUBg",
|
|
|
|
|
+ // SecretKey: "NkyCN3cz97qKaeXLvHOGxOcdS8f184pL",
|
|
|
|
|
+ // SecurityToken: "1306339220",
|
|
|
|
|
+ // Bucket: "wanzai-1306339220",
|
|
|
|
|
+ // Region: "ap-shanghai",
|
|
|
|
|
+ // });
|
|
|
|
|
+
|
|
|
|
|
+ // const files = file.file;
|
|
|
|
|
+ // console.log(files, "files文件");
|
|
|
|
|
+
|
|
|
|
|
+ // const key = file.file.name; // 设置上传到 COS 后的文件名
|
|
|
|
|
+
|
|
|
|
|
+ // cos.putObject(
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Bucket: "wanzai-1306339220",
|
|
|
|
|
+ // Region: "ap-shanghai",
|
|
|
|
|
+ // Key: key,
|
|
|
|
|
+ // Body: files,
|
|
|
|
|
+ // onProgress: function (progressData) {
|
|
|
|
|
+ // console.log(JSON.stringify(progressData));
|
|
|
|
|
+ // },
|
|
|
|
|
+ // },
|
|
|
|
|
+ // function (err, data) {
|
|
|
|
|
+ // if (err) {
|
|
|
|
|
+ // console.error(err, "请求失败");
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // console.log(data, "请求成功");
|
|
|
|
|
+ // editRuleForm.logoUrl = "https://" + data.Location;
|
|
|
|
|
+ // // 成功
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // );
|
|
|
|
|
+
|
|
|
|
|
+ // // datas.set("files", img1File.value);
|
|
|
|
|
+ // // let ress = await axios({
|
|
|
|
|
+ // // method: "post",
|
|
|
|
|
+ // // url: api.value + "/file/cos/upload",
|
|
|
|
|
+ // // headers: {},
|
|
|
|
|
+ // // data: datas,
|
|
|
|
|
+ // // });
|
|
|
|
|
+ // // console.log(ress, "图片上传成功封面图");
|
|
|
|
|
+ // // ruleForm.coverImg = ress.data.data;
|
|
|
|
|
+ // }
|
|
|
|
|
+};
|
|
|
|
|
+// 移出图片(封面图上传图片)
|
|
|
|
|
+const handleRemove = (uploadFile, uploadFiles) => {
|
|
|
|
|
+ console.log(uploadFile, uploadFiles, "移出图片");
|
|
|
|
|
+ editRuleForm.logoUrl = "";
|
|
|
|
|
+};
|
|
|
|
|
+// 限制上传图片的大小
|
|
|
|
|
+const beforeAvatarUpload = (rawFile) => {
|
|
|
|
|
+ console.log(rawFile.type, 333333333333);
|
|
|
|
|
+
|
|
|
|
|
+ if (rawFile.type !== "image/jpeg" && rawFile.type !== "image/png") {
|
|
|
|
|
+ ElMessage.error("图片格式必须为JPG/PNG格式!");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ } else if (rawFile.size / 1024 > 0.05) {
|
|
|
|
|
+ ElMessage.error("图片的大小不能超过50Kb!");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+};
|
|
|
|
|
+// 选中时自动替换上一个文件。
|
|
|
|
|
+const handleExceed = (files) => {
|
|
|
|
|
+ upload.value.clearFiles();
|
|
|
|
|
+ const file = files[0];
|
|
|
|
|
+ file.uid = genFileId();
|
|
|
|
|
+ upload.value.handleStart(file);
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
//编辑按钮 (-------------------------------------------)
|
|
//编辑按钮 (-------------------------------------------)
|
|
|
const editClick = async (row) => {
|
|
const editClick = async (row) => {
|
|
@@ -358,156 +532,28 @@ const editClick = async (row) => {
|
|
|
editRuleForm.name = row.name;
|
|
editRuleForm.name = row.name;
|
|
|
editRuleForm.type = row.category;
|
|
editRuleForm.type = row.category;
|
|
|
editRuleForm.applyLink = row.urlLink;
|
|
editRuleForm.applyLink = row.urlLink;
|
|
|
|
|
+ editRuleForm.logoUrl = row.logo;
|
|
|
editRuleForm.id = row.id;
|
|
editRuleForm.id = row.id;
|
|
|
- // let data = {
|
|
|
|
|
- // linkId: row.id,
|
|
|
|
|
- // };
|
|
|
|
|
- // let res = await axios({
|
|
|
|
|
- // method: "post",
|
|
|
|
|
- // url: api.value + "/mhotel/uploadgetByLinkId.action",
|
|
|
|
|
- // headers: {},
|
|
|
|
|
- // params: data,
|
|
|
|
|
- // });
|
|
|
|
|
- // console.log(res, "编辑中查找图片");
|
|
|
|
|
- // if (res.data.code == 200) {
|
|
|
|
|
- // // res.data.data.fileInfoList.forEach((item) => {
|
|
|
|
|
- // // item.uid = item.id;
|
|
|
|
|
- // // });
|
|
|
|
|
- // // fileList.list = res.data.data.fileInfoList;
|
|
|
|
|
- // // ruleForm.fileListJson = fileList.list;
|
|
|
|
|
- // res.data.data.forEach((item) => {
|
|
|
|
|
- // item.uid = item.id;
|
|
|
|
|
- // });
|
|
|
|
|
- // fileList.list = res.data.data;
|
|
|
|
|
- // ruleForm.fileListJson = fileList.list;
|
|
|
|
|
- // // ElMessage({
|
|
|
|
|
- // // type: "success",
|
|
|
|
|
- // // showClose: true,
|
|
|
|
|
- // // message: res.data.message,
|
|
|
|
|
- // // center: true,
|
|
|
|
|
- // // });
|
|
|
|
|
- // } else {
|
|
|
|
|
- // ElMessage({
|
|
|
|
|
- // type: "error",
|
|
|
|
|
- // showClose: true,
|
|
|
|
|
- // message: res.data.message,
|
|
|
|
|
- // center: true,
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
};
|
|
};
|
|
|
const cancelEdit = () => {
|
|
const cancelEdit = () => {
|
|
|
editVisible.value = false;
|
|
editVisible.value = false;
|
|
|
editRef.value.resetFields();
|
|
editRef.value.resetFields();
|
|
|
|
|
+ editRuleForm.name = "";
|
|
|
|
|
+ editRuleForm.type = "";
|
|
|
|
|
+ editRuleForm.logoUrl = "";
|
|
|
|
|
+ editRuleForm.applyLink = "";
|
|
|
|
|
+ editRuleForm.id = "";
|
|
|
};
|
|
};
|
|
|
-const handleFileUpload = (event) => {
|
|
|
|
|
- const cos = new COS({
|
|
|
|
|
- SecretId: "AKIDCPVZdcWIxgHpy5FYxVyPiqkZGrhdXUBg",
|
|
|
|
|
- SecretKey: "NkyCN3cz97qKaeXLvHOGxOcdS8f184pL",
|
|
|
|
|
- SecurityToken: "1306339220",
|
|
|
|
|
- Bucket: "wanzai-1306339220",
|
|
|
|
|
- Region: "ap-shanghai",
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- const file = event.target.files[0];
|
|
|
|
|
- console.log(event.target.files);
|
|
|
|
|
-
|
|
|
|
|
- const key = event.target.files[0].name; // 设置上传到 COS 后的文件名
|
|
|
|
|
-
|
|
|
|
|
- cos.putObject(
|
|
|
|
|
- {
|
|
|
|
|
- Bucket: "wanzai-1306339220",
|
|
|
|
|
- Region: "ap-shanghai",
|
|
|
|
|
- Key: key,
|
|
|
|
|
- Body: file,
|
|
|
|
|
- onProgress: function (progressData) {
|
|
|
|
|
- console.log(JSON.stringify(progressData));
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- function (err, data) {
|
|
|
|
|
- if (err) {
|
|
|
|
|
- console.error(err);
|
|
|
|
|
- } else {
|
|
|
|
|
- console.log(data);
|
|
|
|
|
- imgUrl.value = "https://" + data.Location;
|
|
|
|
|
- // 成功
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-// const beforePicUpload = async () => {
|
|
|
|
|
-// await getSign();
|
|
|
|
|
-// };
|
|
|
|
|
-// const getSign = async () => {
|
|
|
|
|
-// //让这个请求变成同步请求
|
|
|
|
|
-// let data = { suffix: ".png" };
|
|
|
|
|
-// let res = await axios({
|
|
|
|
|
-// method: "get",
|
|
|
|
|
-// url: api.value + "/upload/ossSign",
|
|
|
|
|
-// headers: {},
|
|
|
|
|
-// params: data,
|
|
|
|
|
-// });
|
|
|
|
|
-// console.log(res, "编辑中查找图片");
|
|
|
|
|
-// // await this.$http.get("/common/oss/sign").then(response => {
|
|
|
|
|
-// // //接收预签名url链接
|
|
|
|
|
-// // console.log(response.data.data);// response.data
|
|
|
|
|
-// // });
|
|
|
|
|
-// uploadUrl.value = response.data.data;
|
|
|
|
|
-// };
|
|
|
|
|
-// const uploadImage = (file) => {
|
|
|
|
|
-// // 这里的`file`参数是要上传的文件对象
|
|
|
|
|
-// // 在这里根据需要添加一些逻辑,如显示进度条
|
|
|
|
|
-// console.log(file, "upload");
|
|
|
|
|
-
|
|
|
|
|
-// return new Promise((resolve, reject) => {
|
|
|
|
|
-// const xhr = new XMLHttpRequest();
|
|
|
|
|
-// //element-ui默认使用post提交,但是我们生成的url需要使用 put 提交
|
|
|
|
|
-// //需要指定 put 直传,以及this.uploadUrl(后端返回的url)
|
|
|
|
|
-// xhr.open("PUT", uploadUrl.value, true);
|
|
|
|
|
-// //设置上传文件的类型
|
|
|
|
|
-// xhr.setRequestHeader("Content-Type", file.file.type); // 或者 file.type
|
|
|
|
|
-// xhr.onreadystatechange = () => {
|
|
|
|
|
-// if (xhr.readyState === 4) {
|
|
|
|
|
-// if (xhr.status === 200) {
|
|
|
|
|
-// resolve(xhr.response);
|
|
|
|
|
-// //进入到这里就表明上传成功了
|
|
|
|
|
-// //我这里对后端返回的url进行截取方便存入数据库,因为前端还需要展示图片
|
|
|
|
|
-// let indexOf = this.uploadUrl.indexOf("?");
|
|
|
|
|
-// this.addForm.pic = this.uploadUrl.slice(0, indexOf);
|
|
|
|
|
-// } else {
|
|
|
|
|
-// reject(xhr.statusText);
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// };
|
|
|
|
|
-// xhr.onerror = () => {
|
|
|
|
|
-// reject(xhr.statusText);
|
|
|
|
|
-// };
|
|
|
|
|
-// //发送
|
|
|
|
|
-// xhr.send(file.file); //或者 file
|
|
|
|
|
-// });
|
|
|
|
|
-// };
|
|
|
|
|
-// // 上传文件之前的钩子,参数为上传的文件
|
|
|
|
|
-// const beforeAvatarUpload = (rawFile) => {
|
|
|
|
|
-// if (rawFile.type !== "image/jpeg" && rawFile.type !== "image/png") {
|
|
|
|
|
-// ElMessage.error("图片格式必须为JPG/PNG格式!");
|
|
|
|
|
-// return false;
|
|
|
|
|
-// } else if (rawFile.size / 1024 / 1024 > 10) {
|
|
|
|
|
-// ElMessage.error("图片的大小不能超过10MB!");
|
|
|
|
|
-// return false;
|
|
|
|
|
-// }
|
|
|
|
|
-// return true;
|
|
|
|
|
-// };
|
|
|
|
|
|
|
|
|
|
// (-------------------------------------------------------------)
|
|
// (-------------------------------------------------------------)
|
|
|
-
|
|
|
|
|
//删除按钮
|
|
//删除按钮
|
|
|
const del = async (row) => {
|
|
const del = async (row) => {
|
|
|
let data = {
|
|
let data = {
|
|
|
id: row.id,
|
|
id: row.id,
|
|
|
};
|
|
};
|
|
|
let res = await axios({
|
|
let res = await axios({
|
|
|
- method: "post",
|
|
|
|
|
- url: api.value + "/mhotel/housedelHouser.action",
|
|
|
|
|
|
|
+ method: "get",
|
|
|
|
|
+ url: api.value + "/wanzai/api/smartApply/deleteSmartApplyById",
|
|
|
headers: {
|
|
headers: {
|
|
|
// token: sessionStorage.getItem("token"),
|
|
// token: sessionStorage.getItem("token"),
|
|
|
// user_head: sessionStorage.getItem("userhead"),
|
|
// user_head: sessionStorage.getItem("userhead"),
|
|
@@ -777,6 +823,9 @@ onBeforeMount(async () => {
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
user-select: none;
|
|
user-select: none;
|
|
|
}
|
|
}
|
|
|
|
|
+ .el-upload-list{
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.options {
|
|
.options {
|
|
|
margin: 30px 20px 20px 0;
|
|
margin: 30px 20px 20px 0;
|