|
|
@@ -61,7 +61,7 @@
|
|
|
<!-- <div class="look" @click="applyClick(scope.row)">打开项目</div> -->
|
|
|
<div class="look" @click="editClick(scope.row)">编辑</div>
|
|
|
<el-popconfirm
|
|
|
- v-if="scope.row.appid!='wx2fc3f45732fae5d3'"
|
|
|
+ v-if="scope.row.appid != 'wx2fc3f45732fae5d3'"
|
|
|
width="220"
|
|
|
confirm-button-text="确认"
|
|
|
cancel-button-text="取消"
|
|
|
@@ -140,6 +140,7 @@
|
|
|
<el-form-item label="logo图标 :" prop="logoUrl">
|
|
|
<div class="xcxLogo">
|
|
|
<img
|
|
|
+ v-viewer
|
|
|
:src="editRuleForm.logoUrl"
|
|
|
alt=""
|
|
|
style="width: 80px; height: 80px"
|
|
|
@@ -192,7 +193,8 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
v-if="
|
|
|
- editRuleForm.type == '默认小程序' || editRuleForm.type == '自建小程序'
|
|
|
+ editRuleForm.type == '默认小程序' ||
|
|
|
+ editRuleForm.type == '自建小程序'
|
|
|
"
|
|
|
label="APPID :"
|
|
|
prop="appid"
|
|
|
@@ -202,7 +204,7 @@
|
|
|
placeholder="请输入APPID"
|
|
|
clearable
|
|
|
style="width: 500px"
|
|
|
- :disabled="editRuleForm.id?true:false"
|
|
|
+ :disabled="editRuleForm.id ? true : false"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
@@ -219,7 +221,7 @@
|
|
|
placeholder="请输入路径"
|
|
|
clearable
|
|
|
style="width: 500px"
|
|
|
- :disabled="editRuleForm.id?true:false"
|
|
|
+ :disabled="editRuleForm.id ? true : false"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="应用简介 :" prop="content">
|
|
|
@@ -397,7 +399,11 @@ const getList = async () => {
|
|
|
params: data,
|
|
|
});
|
|
|
if (res.data.code == 200) {
|
|
|
- console.log(res, JSON.parse(eds.decryptDes(res.data.data)),"应用管理分页数据");
|
|
|
+ console.log(
|
|
|
+ res,
|
|
|
+ JSON.parse(eds.decryptDes(res.data.data)),
|
|
|
+ "应用管理分页数据"
|
|
|
+ );
|
|
|
loading.value = false;
|
|
|
tableData.list = JSON.parse(eds.decryptDes(res.data.data)).list;
|
|
|
total.value = JSON.parse(eds.decryptDes(res.data.data)).totalCount;
|
|
|
@@ -409,7 +415,7 @@ const getList = async () => {
|
|
|
// });
|
|
|
} else {
|
|
|
loading.value = false;
|
|
|
- if(res.data.message=='登录凭证已过期,请重新登录'){
|
|
|
+ if (res.data.message == "登录凭证已过期,请重新登录") {
|
|
|
sessionStorage.removeItem("token");
|
|
|
sessionStorage.removeItem("userhead");
|
|
|
sessionStorage.removeItem("roleList");
|
|
|
@@ -439,13 +445,15 @@ const applyLink = (row) => {
|
|
|
let charToCheck = "http";
|
|
|
|
|
|
if (str.includes(charToCheck)) {
|
|
|
- if(row.descript=='领导驾驶舱'){
|
|
|
+ if (row.descript == "领导驾驶舱") {
|
|
|
window.open(`${row.urlLink}?token=${sessionStorage.getItem("token")}`);
|
|
|
- }else{
|
|
|
- window.open(row.urlLink)
|
|
|
+ } else {
|
|
|
+ window.open(row.urlLink);
|
|
|
}
|
|
|
} else {
|
|
|
- window.open(`https://${row.urlLink}?token=${sessionStorage.getItem("token")}`);
|
|
|
+ window.open(
|
|
|
+ `https://${row.urlLink}?token=${sessionStorage.getItem("token")}`
|
|
|
+ );
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -463,6 +471,17 @@ const addApply = async () => {
|
|
|
};
|
|
|
// 确定添加应用
|
|
|
const confirmEdit = (formEl) => {
|
|
|
+ console.log({
|
|
|
+ name: editRuleForm.name,
|
|
|
+ logo: editRuleForm.logoUrl,
|
|
|
+ category: editRuleForm.type,
|
|
|
+ urlLink: editRuleForm.applyLink,
|
|
|
+ descript: editRuleForm.content,
|
|
|
+ route: editRuleForm.route,
|
|
|
+ isTop: editRuleForm.switch,
|
|
|
+ appid: editRuleForm.appid,
|
|
|
+ });
|
|
|
+
|
|
|
if (!formEl) return;
|
|
|
formEl.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
|
@@ -547,49 +566,82 @@ const confirmEdit = (formEl) => {
|
|
|
const typeSel = () => {
|
|
|
editRuleForm.applyLink = "";
|
|
|
editRuleForm.route = "";
|
|
|
- editRuleForm.appid=""
|
|
|
+ editRuleForm.appid = "";
|
|
|
editRuleForm.switch = 2;
|
|
|
// editRuleForm.id = "";
|
|
|
};
|
|
|
// 封面图上传(------------------------------------------------------)
|
|
|
// 添加照片时往fileList列表中添加图片信息(封面图上传图片)
|
|
|
-const handleChange = (file, fileLists) => {
|
|
|
+const handleChange = async (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));
|
|
|
- },
|
|
|
+ // 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;
|
|
|
+ // // 成功
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ const data = new FormData();
|
|
|
+ data.append("file", file.raw);
|
|
|
+ let res = await axios({
|
|
|
+ method: "post",
|
|
|
+ url: api.value + "/wanzai/api/file/uploadFile",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
},
|
|
|
- function (err, data) {
|
|
|
- if (err) {
|
|
|
- console.error(err, "请求失败");
|
|
|
- } else {
|
|
|
- console.log(data, "请求成功");
|
|
|
- editRuleForm.logoUrl = "https://" + data.Location;
|
|
|
- // 成功
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
+ data: data,
|
|
|
+ });
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ console.log(
|
|
|
+ res,
|
|
|
+ JSON.parse(eds.decryptDes(res.data.data)),
|
|
|
+ "图片上传成功封面图"
|
|
|
+ );
|
|
|
+ let resData = JSON.parse(eds.decryptDes(res.data.data));
|
|
|
+ editRuleForm.logoUrl = resData.fileUrl;
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -677,8 +729,8 @@ const handleExceed = (files) => {
|
|
|
|
|
|
//编辑按钮 (-------------------------------------------)
|
|
|
const editClick = async (row) => {
|
|
|
- console.log(row,'编辑');
|
|
|
-
|
|
|
+ console.log(row, "编辑");
|
|
|
+
|
|
|
titleDialog.value = "编辑应用";
|
|
|
editVisible.value = true;
|
|
|
editRuleForm.name = row.name;
|