|
|
@@ -37,7 +37,8 @@ import Count from "../../../../components/Count";
|
|
|
import Tablepage from "../../../../components/TablePage";
|
|
|
import Table from "./DetailPageTable";
|
|
|
import Modal from "./DetailPageModal";
|
|
|
-
|
|
|
+import { php_url } from "../../../../config/env";
|
|
|
+import axiosPhp from "axios";
|
|
|
export default {
|
|
|
components: {
|
|
|
Count,
|
|
|
@@ -53,6 +54,7 @@ export default {
|
|
|
tableData: [],
|
|
|
modalFlag: false, // 控制模态框展示
|
|
|
parentId: (this.$route.query && this.$route.query.id) || "",
|
|
|
+ unifiedUrl: "/lexus_php/api/",
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -141,108 +143,191 @@ export default {
|
|
|
// 新增平台 接口
|
|
|
addPublishPlatformInfo: function (parentId, platformName) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- this.$http({
|
|
|
+ axiosPhp({
|
|
|
method: "post",
|
|
|
- url: "/base/publishPlatformManager/addPublishPlatformInfo",
|
|
|
- data: {
|
|
|
+ url: php_url + this.unifiedUrl +"publish_platform_add.php",
|
|
|
+ data:{
|
|
|
parentId,
|
|
|
- platformName,
|
|
|
+ platformName
|
|
|
},
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.data && res.data.code === 200) {
|
|
|
- console.log(res);
|
|
|
- resolve();
|
|
|
- } else {
|
|
|
- alert(res.data.message);
|
|
|
- console.log(res);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log(err);
|
|
|
- reject(err);
|
|
|
- });
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data && res.data.code === 200) {
|
|
|
+ console.log(res);
|
|
|
+ resolve();
|
|
|
+ } else {
|
|
|
+ alert(res.data.message);
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ reject(err);
|
|
|
+ });
|
|
|
});
|
|
|
+ // return new Promise((resolve, reject) => {
|
|
|
+ // this.$http({
|
|
|
+ // method: "post",
|
|
|
+ // url: "/base/publishPlatformManager/addPublishPlatformInfo",
|
|
|
+ // data: {
|
|
|
+ // parentId,
|
|
|
+ // platformName,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.data && res.data.code === 200) {
|
|
|
+ // console.log(res);
|
|
|
+ // resolve();
|
|
|
+ // } else {
|
|
|
+ // alert(res.data.message);
|
|
|
+ // console.log(res);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // console.log(err);
|
|
|
+ // reject(err);
|
|
|
+ // });
|
|
|
+ // });
|
|
|
},
|
|
|
// 获取列表 接口
|
|
|
selectPublishPlatformPage: function (parentId, page, rows) {
|
|
|
- this.$http({
|
|
|
+ axiosPhp({
|
|
|
method: "post",
|
|
|
- url: "/base/publishPlatformManager/selectPublishPlatformPage",
|
|
|
- data: {
|
|
|
+ url: php_url + this.unifiedUrl +"publish_platform_list.php",
|
|
|
+ data:{
|
|
|
parentId,
|
|
|
page,
|
|
|
rows,
|
|
|
},
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.data && res.data.code === 200) {
|
|
|
- console.log(res);
|
|
|
- this.tableData = res.data.data;
|
|
|
- this.sum = res.data.count;
|
|
|
- } else {
|
|
|
- console.log(res);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data && res.data.code === 200) {
|
|
|
+ console.log(res);
|
|
|
+ this.tableData = res.data.data;
|
|
|
+ this.sum = Number(res.data.count);
|
|
|
+ } else {
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
console.log(err);
|
|
|
- });
|
|
|
+ });
|
|
|
+ // this.$http({
|
|
|
+ // method: "post",
|
|
|
+ // url: "/base/publishPlatformManager/selectPublishPlatformPage",
|
|
|
+ // data: {
|
|
|
+ // parentId,
|
|
|
+ // page,
|
|
|
+ // rows,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.data && res.data.code === 200) {
|
|
|
+ // console.log(res);
|
|
|
+ // this.tableData = res.data.data;
|
|
|
+ // this.sum = res.data.count;
|
|
|
+ // } else {
|
|
|
+ // console.log(res);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // console.log(err);
|
|
|
+ // });
|
|
|
},
|
|
|
// 编辑平台模块,接口
|
|
|
updatePublishPlatformInfo: function (parentId, id, platformName) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- this.$http({
|
|
|
+ axiosPhp({
|
|
|
method: "post",
|
|
|
- url: "/base/publishPlatformManager/updatePublishPlatformInfo",
|
|
|
- data: {
|
|
|
+ url: php_url + this.unifiedUrl +"publish_platform_update.php",
|
|
|
+ data:{
|
|
|
parentId,
|
|
|
id,
|
|
|
- platformName,
|
|
|
+ platformName
|
|
|
},
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- console.log(res, 1111);
|
|
|
- if (res.data && res.data.code === 200) {
|
|
|
- console.log(res);
|
|
|
- resolve();
|
|
|
- } else {
|
|
|
- alert("编辑失败,请重试");
|
|
|
- console.log(res);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data && res.data.code === 200) {
|
|
|
+ resolve();
|
|
|
+ } else {
|
|
|
alert("编辑失败,请重试");
|
|
|
- console.log(err);
|
|
|
- reject(err);
|
|
|
- });
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ alert("编辑失败,请重试");
|
|
|
+ console.log(err);
|
|
|
+ reject(err);
|
|
|
+ });
|
|
|
});
|
|
|
+ // return new Promise((resolve, reject) => {
|
|
|
+ // this.$http({
|
|
|
+ // method: "post",
|
|
|
+ // url: "/base/publishPlatformManager/updatePublishPlatformInfo",
|
|
|
+ // data: {
|
|
|
+ // parentId,
|
|
|
+ // id,
|
|
|
+ // platformName,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // console.log(res, 1111);
|
|
|
+ // if (res.data && res.data.code === 200) {
|
|
|
+ // console.log(res);
|
|
|
+ // resolve();
|
|
|
+ // } else {
|
|
|
+ // alert("编辑失败,请重试");
|
|
|
+ // console.log(res);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // alert("编辑失败,请重试");
|
|
|
+ // console.log(err);
|
|
|
+ // reject(err);
|
|
|
+ // });
|
|
|
+ // });
|
|
|
},
|
|
|
// 删除平台模块 接口
|
|
|
deletePublishPlatformInfo: function (parentId, id) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- this.$http({
|
|
|
+ axiosPhp({
|
|
|
method: "post",
|
|
|
- url: "/base/publishPlatformManager/deletePublishPlatformInfo",
|
|
|
- data: {
|
|
|
+ url: php_url + this.unifiedUrl +"publish_platform_del.php",
|
|
|
+ data:{
|
|
|
parentId,
|
|
|
id,
|
|
|
},
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.data && res.data.code === 200) {
|
|
|
- console.log(res);
|
|
|
- resolve();
|
|
|
- } else {
|
|
|
- alert("编辑失败,请重试");
|
|
|
- console.log(res);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- alert("编辑失败,请重试");
|
|
|
- console.log(err);
|
|
|
- reject(err);
|
|
|
- });
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data && res.data.code === 200) {
|
|
|
+ resolve();
|
|
|
+ } else {
|
|
|
+ alert("删除失败,请重试");
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ alert("删除失败,请重试");
|
|
|
+ console.log(err);
|
|
|
+ reject(err);
|
|
|
+ });
|
|
|
});
|
|
|
+ // return new Promise((resolve, reject) => {
|
|
|
+ // this.$http({
|
|
|
+ // method: "post",
|
|
|
+ // url: "/base/publishPlatformManager/deletePublishPlatformInfo",
|
|
|
+ // data: {
|
|
|
+ // parentId,
|
|
|
+ // id,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.data && res.data.code === 200) {
|
|
|
+ // console.log(res);
|
|
|
+ // resolve();
|
|
|
+ // } else {
|
|
|
+ // alert("编辑失败,请重试");
|
|
|
+ // console.log(res);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // alert("编辑失败,请重试");
|
|
|
+ // console.log(err);
|
|
|
+ // reject(err);
|
|
|
+ // });
|
|
|
+ // });
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|