no message

This commit is contained in:
小陌 2023-09-08 23:29:56 +08:00
parent 7f87963448
commit 6a9321c849
8 changed files with 90 additions and 44 deletions

View File

@ -35,7 +35,7 @@
},
created() {
var menu = this.$router.sc_getMenu()
var menu = this.$router.x_getMenu()
this.menu = this.filterUrl(menu)
},

View File

@ -79,7 +79,7 @@
}
},
created() {
var menu = this.$router.sc_getMenu()
var menu = this.$router.x_getMenu()
var dashboardRoute = this.treeFind(menu, node => node.path==this.$config.DASHBOARD_URL)
if(dashboardRoute){
dashboardRoute.fullPath = dashboardRoute.path

View File

@ -242,7 +242,7 @@
this.appLogo = this.$tool.data.get("appLogo") || (this.$config.APP_LOGO || logo);
this.onLayoutResize();
window.addEventListener('resize', this.onLayoutResize);
var menu = this.$router.sc_getMenu();
var menu = this.$router.x_getMenu();
this.menu = this.filterUrl(menu);
this.showThis()
},

View File

@ -78,7 +78,7 @@ router.beforeEach(async (to, from, next) => {
store.commit("SET_layout", response.data[key])
}
}
var menu = router.sc_getMenu();
var menu = router.x_getMenu();
var menuRouter = filterAsyncRouter(menu)
menuRouter = flatAsyncRoutes(menuRouter)
menuRouter.forEach(item => {
@ -109,7 +109,7 @@ router.onError((error) => {
});
});
//入侵追加自定义方法、对象
router.sc_getMenu = () => {
router.x_getMenu = () => {
var apiMenu = tool.data.get("menu") || []
let userInfo = tool.data.get("user") || {}
let userMenu = treeFilter(userRoutes, node => {
@ -155,8 +155,7 @@ function loadComponent(component) {
function flatAsyncRoutes(routes, breadcrumb = []) {
let res = []
routes.forEach(route => {
const tmp = { ...route
}
const tmp = { ...route }
if (tmp.children) {
let childrenBreadcrumb = [...breadcrumb]
childrenBreadcrumb.push(route)

View File

@ -60,7 +60,9 @@
var data = {
account: this.form.account,
password: this.$tool.crypto.BASE64.encrypt( this.$tool.crypto.BASE64.encrypt( this.form.password ) + this.$tool.crypto.BASE64.encrypt( this.form.account ) )
password: this.$tool.crypto.BASE64.encrypt(
this.$tool.crypto.BASE64.encrypt( this.form.password ) + this.$tool.crypto.BASE64.encrypt( this.form.account )
)
}
//token

View File

@ -4,7 +4,7 @@
<el-table-column label="">
<template #default="scope">
<div class="tab-box dis-f al-item">
<img :src="scope.row.icon" class="img" alt="">
<img :src="scope.row.icon" v-if="scope.row.icon" class="img" alt="">
<div class="info-box">
<div class="title">
{{ scope.row.name }}
@ -21,19 +21,19 @@
<span>{{ scope.row.version }}</span>
</template>
</el-table-column>
<el-table-column label="目录" width="100">
<el-table-column label="目录" width="120">
<template #default="scope">
<code>{{ scope.row.app }}</code>
</template>
</el-table-column>
<el-table-column label="安装时间" width="160">
<el-table-column label="安装时间" width="180">
<template #default="scope">
<span v-time="scope.row.timestamp"></span>
</template>
</el-table-column>
<el-table-column label="状态" width="80">
<template #default="scope">
<el-switch v-model="scope.row.status" :before-change="changeStatus(scope.row)" :loading="scope.row.changeStatusloading||false" />
<el-switch v-model="scope.row.status" :before-change="()=>changeStatus(scope.row)" :loading="scope.row.changeStatusloading||false" />
</template>
</el-table-column>
<el-table-column label="操作" width="120" fixed="right" align="center">
@ -51,7 +51,7 @@
</el-table>
</div>
<div class="pop-box" v-show="popShow">
<div class="pop-box" v-if="popShow">
<pop-info :showPop="closePlugin" :item="info"></pop-info>
</div>
</template>
@ -80,9 +80,15 @@ export default {
},
closePlugin(refresh = false){
this.info = {};
this.popShow = false;
this.popShow = false;
if (refresh===true) {
this.loaddata();
// //
// this.$api.system.index.get().then((response) => {
// this.$tool.data.set('menu', response.data.menu);
// });
// this.$router.x_getMenu();
}
},
loaddata(){
@ -96,15 +102,22 @@ export default {
},
changeStatus(o){
// o.changeStatusloading = true;
console.log(o)
// this.$http.get('admin/application/installedApplist').then((res) => {
// this.changeStatusloading = false;
// if (res.code == 200) {
// this.data = res.data;
// }
// });
return ElMessageBox.confirm((o.status?'关闭应用会导致相关调用失效':'打开应用('+ o.name +')') + ', 确认执行?', '正在'+ (o.status?'关闭':'打开') + '应用', {
type: 'error',
closeOnClickModal: false,
confirmButtonText: '确认操作',
}).then(() => {
o.changeStatusloading = true;
return this.$http.post('admin/application/status', {app:o.app, status:o.status?0:1}).then((res) => {
o.changeStatusloading = false;
if (res.code == 200) {
this.$message.success(res.message || "操作成功")
return true;
}
this.$alert(res.message, "提示", {type: 'error'});
return false;
});
}).catch(() => {})
},
uninstall(item, index) {
@ -115,7 +128,14 @@ export default {
}).then(() => {
this.$http.post('admin/application/uninstall', {app:item.app}).then((res) => {
if (res.code == 200) {
this.data.splice(index, 1)
// //
// this.$api.system.index.get().then((response) => {
// this.$tool.data.set('menu', response.data.menu);
// });
// this.$router.x_getMenu();
this.$message.success(res.message || "操作成功")
return true;
}

View File

@ -1,6 +1,6 @@
<template>
<div class="dis-f warp pd-15 pos-r" ref="tabBox" v-loading="loading">
<div class="pop-box" v-show="popShow">
<div class="pop-box" v-if="popShow">
<pop-info :showPop="closePlugin" :item="info"></pop-info>
</div>
<plugin-box @click="installPlugin(item)" :windowType="windowType" :tabI="i" :item="item" v-for="(item, i) in list" :key="i"></plugin-box>
@ -48,6 +48,11 @@ export default {
this.popShow = false;
if (refresh===true) {
this.loaddata();
// //
// this.$api.system.index.get().then((response) => {
// this.$tool.data.set('menu', response.data.menu);
// });
// this.$router.x_getMenu();
}
},
unObserve() {

View File

@ -2,7 +2,7 @@
<div class="dis-f jus-x pop-bg">
<div class="info-box dis-f jus-x al-item text-f pos-r">
<div class="title">
{{ item.name }}
{{ info.name }}
<div class="close" @click="closePop">
<el-icon><el-icon-close-bold /></el-icon>
</div>
@ -10,12 +10,12 @@
<div class="info-data-box">
<div class="dis-f al-item jus-bet">
<div class="dis-f al-item" style="flex:0.75;">
<img :src="item.icon" class="img" alt="">
<img :src="info.icon" class="img" alt="">
<div style="flex:1;">
<div class="data-title">{{ item.name }}</div>
<div class="data-info-text">目录<code>{{ item.app }}</code></div>
<div class="data-title">{{ info.name }}</div>
<div class="data-info-text">目录<code>{{ info.app }}</code></div>
<span class="data-info-type data-info-type-m jus-x">
{{ item.islocal ? '本地插件' : '线上插件' }}
{{ info.islocal ? '本地插件' : '线上插件' }}
</span>
<span class="data-info-type data-info-type-m jus-x" style="margin-left: 5px; color: #fff; background-color: #67c23a;">
@ -23,7 +23,7 @@
</span>
</div>
</div>
<div class="install-btn" @click="install" style="flex:0.2;" v-if="!item.installed">
<div class="install-btn" @click="install" style="flex:0.2;" v-if="!info.installed">
安装
</div>
<div v-else class="install-btn" @click="uninstall" style="flex:0.2;background: #9E9E9E; border-color: #9E9E9E;">
@ -34,7 +34,7 @@
插件详情
</div>
<div class="plugin-introduce">
{{ item.description }}
{{ info.description }}
</div>
<div class="plugin-tag-title">
相关详情
@ -45,21 +45,21 @@
版本
</div>
<div class="text">
{{ item.version }} <span class="history-text">版本历史</span>
{{ info.version }} <span class="history-text">版本历史</span>
</div>
</div>
<div class="line"></div>
<div class="box">
<div style="margin-bottom:8px;">开发者</div>
<div class="text">
{{ item.author }}
{{ info.author }}
</div>
</div>
<div class="line" v-if="item.tables"></div>
<div class="box" v-if="item.tables">
<div class="line" v-if="info.tables"></div>
<div class="box" v-if="info.tables">
<div style="margin-bottom:8px;">数据表</div>
<div class="dis-f" style="flex-wrap: wrap;">
<div class="business-type">{{ item.tables }}</div>
<div class="business-type">{{ info.tables }}</div>
</div>
</div>
<div class="line"></div>
@ -93,10 +93,19 @@ export default {
required: true
}
},
data() {
return {
info:this.item,
isupdate:false,
}
},
mounted() {
this.info = this.item;
},
methods: {
//
closePop() {
this.showPop()
this.showPop(this.isupdate)
},
//
uninstall(){
@ -107,9 +116,11 @@ export default {
confirmButtonText: '确认卸载',
}).then(() => {
this.$http.post('admin/application/uninstall', {app:this.item.app}).then((res) => {
this.$http.post('admin/application/uninstall', {app:this.info.app}).then((res) => {
if (res.code == 200) {
this.showPop(true)
this.info.installed = false;
this.isupdate = true;
// this.showPop(true)
this.$message.success(res.message || "操作成功")
return true;
}
@ -123,22 +134,31 @@ export default {
install(){
ElMessageBox.confirm(this.item.islocal?'在安装插件之前,请阅读插件的使用说明。':'此插件为远程应用, 如安装失败请确认是否有写入权限.或前往应用中心下载至本地再进行安装', '安装应用', {
ElMessageBox.confirm(this.info.islocal?'在安装插件之前,请阅读插件的使用说明。':'此插件为远程应用, 如安装失败请确认是否有写入权限.或前往应用中心下载至本地再进行安装', '安装应用', {
type: 'warning',
closeOnClickModal: false,
confirmButtonText: '确认安装',
}).then(() => {
this.$http.post('admin/application/install', {app:this.item.app}).then((res) => {
this.$http.post('admin/application/install', {app:this.info.app}).then((res) => {
//
if (res.code == 205) {
alert(1);
this.$message.warning(res.message || "请前往在线升级频道登录X-PHP后进行安装");
if (res.url) {
this.$router.replace({
path: res.url
})
}
return false;
}
if (res.code == 200) {
console.log(res)
//
this.info.installed = true;
this.isupdate = true;
this.$message.success(res.message || "操作成功")
return true;
}