no message

This commit is contained in:
小陌 2023-07-06 19:04:04 +08:00
parent ce4912273c
commit 01eeb6db39
20 changed files with 112 additions and 233 deletions

View File

@ -5,6 +5,8 @@ const APP_CONFIG = {
APP_NAME: "寄托天下", APP_NAME: "寄托天下",
//主题设置 //主题设置
THEMESETTING: false, THEMESETTING: false,
// Cookie name
SESSIONNAME: 'miucms_session',
// 主题页头 // 主题页头
// THEMEHEADER: false, // THEMEHEADER: false,
//布局 默认default | 通栏header | 经典menu | 功能坞dock //布局 默认default | 通栏header | 经典menu | 功能坞dock

15
src/api/model/app.js Normal file
View File

@ -0,0 +1,15 @@
import http from "@/utils/request"
export default {
index: {
get: async function() {
return await http.get('/system/index');
}
},
table: {
get: async function(name = '', config = {}) {
return await http.get('/system/table/get', {
name
}, config);
}
},
}

View File

@ -1,10 +1,8 @@
import http from "@/utils/request" import http from "@/utils/request"
export default { export default {
token: { token: {
url: `/api/login`, post: async function(data = {}) {
name: "登录获取TOKEN", return await http.post('/api/login', data);
post: async function(data={}){
return await http.post(this.url, data);
} }
} }
} }

View File

@ -1,48 +1,13 @@
import http from "@/utils/request" import http from "@/utils/request"
export default { export default {
upload: { upload: {
url: `/app/upload`, post: async function(data, config = {}) {
name: "文件上传", return await http.post('/app/upload', data, config);
post: async function(data, config={}){
return await http.post(this.url, data, config);
} }
}, },
uploadFile: { uploadFile: {
url: `/app/upload?type=file`, post: async function(data, config = {}) {
name: "附件上传", return await http.post('/app/upload?type=file', data, config);
post: async function(data, config={}){
return await http.post(this.url, data, config);
} }
}, },
exportFile: {
url: `/fileExport`,
name: "导出附件",
get: async function(data, config={}){
return await http.get(this.url, data, config);
}
},
importFile: {
url: `/fileImport`,
name: "导入附件",
post: async function(data, config={}){
return await http.post(this.url, data, config);
}
},
file: {
menu: {
url: `/file/menu`,
name: "获取文件分类",
get: async function(){
return await http.get(this.url);
}
},
list: {
url: `/file/list`,
name: "获取文件列表",
get: async function(params){
return await http.get(this.url, params);
}
}
}
} }

View File

@ -1,54 +0,0 @@
import http from "@/utils/request"
export default {
ver: {
url: `/demo/ver`,
name: "获取最新版本号",
get: async function(params){
return await http.get(this.url, params);
}
},
post: {
url: `/demo/post`,
name: "分页列表",
post: async function(data){
return await http.post(this.url, data, {
headers: {
//'response-status': 401
}
});
}
},
page: {
url: `/demo/page`,
name: "分页列表",
get: async function(params){
return await http.get(this.url, params);
}
},
list: {
url: `/demo/list`,
name: "数据列表",
get: async function(params){
return await http.get(this.url, params);
}
},
menu: {
url: `/demo/menu`,
name: "普通用户菜单",
get: async function(){
return await http.get(this.url);
}
},
status: {
url: `/demo/status`,
name: "模拟无权限",
get: async function(code){
return await http.get(this.url, {}, {
headers: {
"response-status": code
}
});
}
}
}

View File

@ -5,97 +5,11 @@ export default {
return await http.get('/system/index'); return await http.get('/system/index');
} }
}, },
dic: {
tree: {
url: `/system/dic/tree`,
name: "获取字典树",
get: async function() {
return await http.get(this.url);
}
},
list: {
url: `/system/dic/lists`,
name: "字典明细",
get: async function(params) {
return await http.get(this.url, params);
}
},
get: {
url: `/system/dic/get`,
name: "获取字典数据",
get: async function(params) {
return await http.get(this.url, params);
}
}
},
role: {
list: {
url: `/system/role/list2`,
name: "获取角色列表",
get: async function(params) {
return await http.get(this.url, params);
}
}
},
dept: {
list: {
url: `/system/dept/lists`,
name: "获取部门列表",
get: async function(params) {
return await http.get(this.url, params);
}
}
},
user: {
list: {
url: `/system/user/lists`,
name: "获取用户列表",
get: async function(params) {
return await http.get(this.url, params);
}
}
},
app: {
list: {
url: `/system/app/lists`,
name: "应用列表",
get: async function() {
return await http.get(this.url);
}
}
},
log: {
list: {
url: `/system/log/lists`,
name: "日志列表",
get: async function(params) {
return await http.get(this.url, params);
}
}
},
table: { table: {
list: { get: async function(name = '', config = {}) {
url: `/system/table/lists`, return await http.get('/system/table/get', {
name: "表格列管理列表", name
get: async function(params) { }, config);
return await http.get(this.url, params);
} }
}, },
info: {
url: `/system/table/info`,
name: "表格列管理详情",
get: async function(params) {
return await http.get(this.url, params);
}
}
},
tasks: {
list: {
url: `/system/tasks/lists`,
name: "系统任务管理",
get: async function(params) {
return await http.get(this.url, params);
}
}
}
} }

View File

@ -95,7 +95,7 @@
</el-link> </el-link>
</template> </template>
<template v-else-if="item.component=='formtable'"> <template v-else-if="item.component=='formtable'">
<sc-form-table ref="videostable" v-bind="item.options"> </sc-form-table> <sc-form-table ref="videostable" v-model="data[item.name]" v-bind="item.options"> </sc-form-table>
</template> </template>
<!-- noComponent --> <!-- noComponent -->
<template v-else> <template v-else>

View File

@ -0,0 +1,40 @@
<!--
* @Descripttion: 编辑
-->
<template>
<el-container v-loading="loading">
<el-main style="padding:0 20px 20px 20px">
<sc-form ref="formref" :config="config" v-model="data" :loading="loading"> </sc-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
<el-button @click="visible=false">取消</el-button>
</el-footer>
</el-container>
</template>
<script>
export default {
props: {
modelValue: { type: Object, default: () => {} },
config: { type: Object, default: () => {} },
},
data() {
return {
data: this.modelValue,
isSaveing: false
}
},
watch:{
modelValue(){
}
},
mounted() {
// this.data = this.modelValue
},
methods: {
}
}
</script>

View File

@ -26,6 +26,9 @@ const DEFAULT_CONFIG = {
//TokenName //TokenName
TOKEN_NAME: "Authorization", TOKEN_NAME: "Authorization",
// Cookie Name
SESSIONNAME: "X-PHPSSESSION",
//Token前缀注意最后有个空格如不需要需设置空字符串 //Token前缀注意最后有个空格如不需要需设置空字符串
TOKEN_PREFIX: "", TOKEN_PREFIX: "",

View File

@ -1,9 +1,9 @@
import API from "@/api"; // import API from "@/api";
//字典选择器配置 //字典选择器配置
export default { export default {
dicApiObj: API.system.dic.get, //获取字典接口对象 // dicApiObj: API.system.dic.get, //获取字典接口对象
parseData: function (res) { parseData: function (res) {
return { return {
data: res.data, //分析行数据字段结构 data: res.data, //分析行数据字段结构

View File

@ -39,7 +39,7 @@ router.beforeEach(async (to, from, next) => {
NProgress.start() NProgress.start()
//动态标题 //动态标题
document.title = to.meta.title ? `${to.meta.title} - ${config.APP_NAME}` : `${config.APP_NAME}` document.title = to.meta.title ? `${to.meta.title} - ${config.APP_NAME}` : `${config.APP_NAME}`
let token = tool.cookie.get('X-PHPSSESSION'); let token = tool.cookie.get(config.SESSIONNAME);
if (to.path === "/login") { if (to.path === "/login") {
//删除路由(替换当前layout路由) //删除路由(替换当前layout路由)
router.addRoute(routes[0]) router.addRoute(routes[0])

View File

@ -11,7 +11,7 @@ axios.defaults.timeout = sysConfig.TIMEOUT
// HTTP request 拦截器 // HTTP request 拦截器
axios.interceptors.request.use( axios.interceptors.request.use(
(config) => { (config) => {
let token = tool.cookie.get('X-PHPSSESSION'); let token = tool.cookie.get(sysConfig.SESSIONNAME);
if (token) { if (token) {
config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
} }
@ -59,7 +59,9 @@ axios.interceptors.response.use(
}).then(() => { }).then(() => {
router.replace({ router.replace({
path: '/login', path: '/login',
query: { redirect: router.currentRoute.fullPath } query: {
redirect: router.currentRoute.fullPath
}
}); });
}).catch(() => {}) }).catch(() => {})
} }

View File

@ -212,15 +212,8 @@
this.selection = selection; this.selection = selection;
}, },
// //
async handleSuccess(data, o){ async handleSuccess(){
this.$refs.table.refresh()
var res = await api.post('attachmentSubmit', data)
if (res.code==200) {
o.close();
this.$message.success("操作成功")
return ;
}
this.$alert(res.message, "提示", {type: 'error'})
} }
} }
} }

View File

@ -44,6 +44,7 @@
var res = await api.post('submit', {info:this.info,id:this.id,token:this.token}) var res = await api.post('submit', {info:this.info,id:this.id,token:this.token})
if (res.code==200) { if (res.code==200) {
this.close(); this.close();
this.$emit('success', this.info, this.mode);
this.$message.success("操作成功") this.$message.success("操作成功")
return ; return ;
} }

View File

@ -71,7 +71,7 @@
return false return false
} }
this.$tool.cookie.set('X-PHPSSESSION', user.data.token, { this.$tool.cookie.set(this.$config.SESSIONNAME, user.data.token, {
expires: 86400*360 expires: 86400*360
}) })

View File

@ -107,7 +107,7 @@
} }
}, },
created: function() { created: function() {
this.$tool.cookie.remove('X-PHPSSESSION') this.$tool.cookie.remove(this.$config.SESSIONNAME)
this.$tool.data.remove("user") this.$tool.data.remove("user")
this.$tool.data.remove("menu") this.$tool.data.remove("menu")
this.$tool.data.remove("permissions") this.$tool.data.remove("permissions")
@ -144,7 +144,7 @@
}else if(res.code==200){ }else if(res.code==200){
this.showWechatLogin = false this.showWechatLogin = false
this.$tool.cookie.set('X-PHPSSESSION', res.data.token, { this.$tool.cookie.set(this.$config.SESSIONNAME, res.data.token, {
expires: 86400*360 expires: 86400*360
}) })

View File

@ -100,7 +100,7 @@
loaddata(){ loaddata(){
// //
if(this.statName) { if(this.statName) {
this.$http.get('system/stat/get', { name: this.statName,date:this.date }).then((res) => { this.$http.get('app/stat/get', { name: this.statName,date:this.date }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
Object.assign(this.$data, res.data); Object.assign(this.$data, res.data);
this.dateType = ''; this.dateType = '';

View File

@ -100,7 +100,7 @@
mounted() { mounted() {
// //
if(this.$route.meta.tablename) { if(this.$route.meta.tablename) {
this.$http.get('system/table/get', { name: this.$route.meta.tablename }, { cache: this.$route.meta.tablecache || 0 }).then((res) => { this.$api.system.table.get(this.$route.meta.tablename, { cache: this.$route.meta.tablecache || 0 }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
Object.assign(this.$data, res.data); Object.assign(this.$data, res.data);
} }

View File

@ -1,14 +1,6 @@
<template> <template>
<el-drawer :title="titleMap[mode]" v-model="visible" :size="960" destroy-on-close @closed="$emit('closed')"> <el-drawer :title="titleMap[mode]" v-model="visible" :size="960" destroy-on-close @closed="$emit('closed')">
<el-container v-loading="loading"> <x-update v-model="info" :config="config"></x-update>
<el-main style="padding:0 20px 20px 20px">
<sc-form ref="formref" :config="config" v-model="info" :loading="loading"> </sc-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
<el-button @click="visible=false">取消</el-button>
</el-footer>
</el-container>
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
@ -26,6 +18,12 @@
edit: '编辑' edit: '编辑'
}, },
info: {}, info: {},
config: {
formItems : this.column,
labelPosition : "right",
labelWidth : "120px",
size : "medium",
},
visible: false, visible: false,
isSaveing: false, isSaveing: false,
} }
@ -36,12 +34,12 @@
} }
}, },
mounted() { mounted() {
this.config = { // this.config = {
formItems : this.column, // formItems : this.column,
labelPosition : "right", // labelPosition : "right",
labelWidth : "120px", // labelWidth : "120px",
size : "medium", // size : "medium",
} // }
}, },
methods: { methods: {
// //

View File

@ -20,6 +20,7 @@ import xDialog from './components/xDialog'
import scForm from './components/scForm' import scForm from './components/scForm'
import XItem from './components/scForm/item' import XItem from './components/scForm/item'
import xUser from './components/xUser' import xUser from './components/xUser'
import xUpdate from './components/xUpdate'
import scTitle from './components/scTitle' import scTitle from './components/scTitle'
import scWaterMark from './components/scWaterMark' import scWaterMark from './components/scWaterMark'
import scQrCode from './components/scQrCode' import scQrCode from './components/scQrCode'
@ -46,6 +47,7 @@ export default {
//注册全局组件 //注册全局组件
app.component('XItem', XItem); app.component('XItem', XItem);
app.component('xUser', xUser); app.component('xUser', xUser);
app.component('xUpdate', xUpdate);
app.component('scTable', scTable); app.component('scTable', scTable);
app.component('scTableColumn', scTableColumn); app.component('scTableColumn', scTableColumn);
app.component('scFilterBar', scFilterBar); app.component('scFilterBar', scFilterBar);