调整了部分内容及注释
This commit is contained in:
parent
e8b47a4e0e
commit
75afed7c0c
|
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
VUE_APP_API_BASE_URL=http://zxx4.f3322.net:46000
|
VUE_APP_API_BASE_URL=http://zxx4.f3322.net:46000
|
||||||
VUE_APP_USER_MODEL2=AdminUser
|
VUE_APP_USER_MODEL=AdminUser
|
||||||
VUE_APP_USER_MODEL=BaseAdmin
|
VUE_APP_USER_MODEL2=BaseAdmin
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
// 跟业务系统相关的
|
// 跟业务系统相关的
|
||||||
|
|
||||||
import mk from './mk'
|
import mk from './mk' // mk插件
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
install(Vue) {
|
install(Vue) { // 安装插件
|
||||||
|
|
||||||
|
|
||||||
mk.init(Vue);
|
mk.init(Vue); // 初始化
|
||||||
Vue.prototype.$mk = mk;
|
Vue.prototype.$mk = mk; // 挂载到Vue原型上
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
|
<!-- 弹窗对话框 -->
|
||||||
<vxe-modal class="vxe-table--ignore-clear" id="myModal" @close="modalClose" v-model="visible" :width="width" :height="height"
|
<vxe-modal class="vxe-table--ignore-clear" id="myModal" @close="modalClose" v-model="visible" :width="width" :height="height"
|
||||||
|
|
||||||
:show-footer="showFooter"
|
:show-footer="showFooter"
|
||||||
@confirm="confirmEvent"
|
@confirm="confirmEvent"
|
||||||
min-width="600" min-height="400" show-zoom resize transfer>
|
min-width="600" min-height="400" show-zoom resize transfer>
|
||||||
|
<!--
|
||||||
|
show-footer 显示底部按钮
|
||||||
|
confirm 确认按钮事件
|
||||||
|
min-width 最小宽度
|
||||||
|
min-height 最小高度
|
||||||
|
show-zoom 显示缩放按钮
|
||||||
|
resize 是否可以缩放
|
||||||
|
transfer 是否使用传送门
|
||||||
|
-->
|
||||||
<template #title>
|
<template #title>
|
||||||
<span>{{ title }}</span>
|
<span>{{ title }}</span>
|
||||||
|
<!-- <span>提示</span> -->
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<component :is="app" ref="appPage" :dataId="dataId" :pageOptions="pageOptions" :pageMode="pageMode" @callback="handleCallback"></component>
|
<component :is="app" ref="appPage" :dataId="dataId" :pageOptions="pageOptions" :pageMode="pageMode" @callback="handleCallback"></component>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,15 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue' // 加载vue模块
|
||||||
import promptComponent from './dialog.vue'
|
import promptComponent from './dialog.vue' // 加载dialog组件
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
open: function (args) {
|
open: function (args) { // 打开对话框
|
||||||
const promptConstructor = Vue.extend(promptComponent);
|
const promptConstructor = Vue.extend(promptComponent); // 创建一个子类
|
||||||
let instance = new promptConstructor().$mount('');
|
let instance = new promptConstructor().$mount(''); // 创建一个实例
|
||||||
document.body.appendChild(instance.$el);
|
document.body.appendChild(instance.$el); // 将实例挂载到body上
|
||||||
|
instance.open(args); // 打开对话框
|
||||||
|
|
||||||
instance.open(args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
@ -20,6 +20,14 @@
|
||||||
|
|
||||||
<vxe-modal show-footer class-name="vxe-table--ignore-clear edit-popup-box" title="选择数据" :width="modalWidth"
|
<vxe-modal show-footer class-name="vxe-table--ignore-clear edit-popup-box" title="选择数据" :width="modalWidth"
|
||||||
:height="modalHeight" v-model="modalVisible" @confirm="confirmEvent">
|
:height="modalHeight" v-model="modalVisible" @confirm="confirmEvent">
|
||||||
|
<!-- vxe-modal 有以下属性
|
||||||
|
show-footer 显示底部按钮
|
||||||
|
width 宽度
|
||||||
|
height 高度
|
||||||
|
v-model 显示隐藏
|
||||||
|
@confirm 确认按钮事件
|
||||||
|
-->
|
||||||
|
|
||||||
<template #default>
|
<template #default>
|
||||||
<component :is="popupPage" ref="popup" :pageOptions="popupPageOptions" :pageMode="popupPageMode"></component>
|
<component :is="popupPage" ref="popup" :pageOptions="popupPageOptions" :pageMode="popupPageMode"></component>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -31,136 +39,137 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import BASE_URL from '@/services/base/api.js';
|
import BASE_URL from '@/services/base/api.js'; // 加载api地址
|
||||||
export default {
|
export default {
|
||||||
name: 'MkFormDataSelector',
|
name: 'MkFormDataSelector', // 组件名称
|
||||||
props: {
|
props: { // 组件属性
|
||||||
readonly: Boolean,
|
readonly: Boolean, // 只读
|
||||||
params: Object,
|
params: Object, // 参数
|
||||||
value: Array
|
value: Array // 值
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
actions: {
|
actions: { // api地址
|
||||||
getList: `${BASE_URL}/api/web/listdata`
|
getList: `${BASE_URL}/api/web/listdata` // 获取列表数据
|
||||||
},
|
},
|
||||||
modalVisible: false,
|
modalVisible: false, // 弹出框显示
|
||||||
lastKey: '',
|
lastKey: '', // 上次输入的值
|
||||||
modelName: '',
|
modelName: '', // 模块名称
|
||||||
orderBy: '',
|
orderBy: '', // 排序
|
||||||
textboxValue: '',
|
textboxValue: '', // 输入框值
|
||||||
placeholder: '',
|
placeholder: '', // 提示
|
||||||
row: null,
|
row: null, // 行
|
||||||
column: null,
|
column: null, // 列
|
||||||
loading: false,
|
loading: false, // 加载中
|
||||||
tableData: [],
|
tableData: [], // 表格数据
|
||||||
enalbedPopup: false,
|
enalbedPopup: false, // 是否启用弹出框
|
||||||
popupPage: null,
|
popupPage: null, // 弹出框页面
|
||||||
popupPageOptions: {},
|
popupPageOptions: {}, // 弹出框页面参数
|
||||||
popupPageMode: '',
|
popupPageMode: '', // 弹出框页面模式
|
||||||
|
|
||||||
tableColumn: [
|
tableColumn: [ // 表格列
|
||||||
{ field: 'name', title: '名称' },
|
{ field: 'name', title: '名称' }, // 字段名称,字段标题
|
||||||
{ field: 'code', title: '编码' }
|
{ field: 'code', title: '编码' } // 字段名称,字段标题
|
||||||
],
|
],
|
||||||
modalWidth: 800,
|
modalWidth: 800, // 弹出框宽度
|
||||||
modalHeight: 600,
|
modalHeight: 600, // 弹出框高度
|
||||||
searchFieldNames: ['name', 'code'],
|
searchFieldNames: ['name', 'code'], // 搜索字段
|
||||||
tablePage: {
|
tablePage: { // 表格分页
|
||||||
total: 0,
|
total: 0, // 总数
|
||||||
currentPage: 1,
|
currentPage: 1, // 当前页
|
||||||
pageSize: 100
|
pageSize: 100 // 每页显示条数
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() { // 创建
|
||||||
this.load()
|
this.load() // 加载
|
||||||
this.heightInit();
|
this.heightInit(); // 高度初始化
|
||||||
},
|
},
|
||||||
watch: {
|
watch: { // 监听
|
||||||
value() {
|
value() { // 值改变
|
||||||
if (this.value && this.value[1]) {
|
if (this.value && this.value[1]) { // 如果值存在
|
||||||
this.textboxValue = this.value[1];
|
this.textboxValue = this.value[1]; // 输入框值
|
||||||
} else {
|
} else { // 如果值不存在
|
||||||
this.textboxValue = "";
|
this.textboxValue = ""; // 输入框值
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
heightInit() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
|
|
||||||
this.modalHeight = this.$mk.getWindowSize().height * 0.9;
|
|
||||||
this.modalWidth = this.$mk.getWindowSize().width * 0.9;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
load() {
|
|
||||||
const { params } = this
|
|
||||||
|
|
||||||
if (params) {
|
|
||||||
|
|
||||||
|
|
||||||
this.modelName = params.modelName;
|
heightInit() { // 高度初始化
|
||||||
this.orderBy = params.orderBy;
|
this.$nextTick(() => { // 下一次
|
||||||
this.placeholder = params.placeholder;
|
|
||||||
if (params.searchFieldNames) {
|
|
||||||
this.searchFieldNames = params.searchFieldNames;
|
|
||||||
}
|
|
||||||
if (params.columns) {
|
|
||||||
this.tableColumn = params.columns;
|
|
||||||
}
|
|
||||||
if (params.popup) {
|
|
||||||
this.enalbedPopup = true;
|
|
||||||
this.popupPage = params.popup.page;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.value && this.value[1]) {
|
this.modalHeight = this.$mk.getWindowSize().height * 0.9; // 弹出框高度
|
||||||
this.textboxValue = this.value[1];
|
this.modalWidth = this.$mk.getWindowSize().width * 0.9; // 弹出框宽度
|
||||||
} else {
|
|
||||||
this.textboxValue = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
this.getData().then(data => {
|
|
||||||
this.tableData = data
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getData(key) {
|
|
||||||
this.lastKey = key;
|
load() { // 加载
|
||||||
let filter = { rules: [], op: 'or' };
|
const { params } = this // 参数
|
||||||
if (key) {
|
if (params) { // 如果参数存在
|
||||||
for (let i = 0; i < this.searchFieldNames.length; i++) {
|
this.modelName = params.modelName; // 模块名称
|
||||||
let field = this.searchFieldNames[i];
|
this.orderBy = params.orderBy; // 排序
|
||||||
filter.rules.push({ value: key, field: field, op: "like" });
|
this.placeholder = params.placeholder; // 提示
|
||||||
|
if (params.searchFieldNames) { // 如果搜索字段存在
|
||||||
|
this.searchFieldNames = params.searchFieldNames; // 搜索字段
|
||||||
|
}
|
||||||
|
if (params.columns) { // 如果列存在
|
||||||
|
this.tableColumn = params.columns; // 表格列
|
||||||
|
}
|
||||||
|
if (params.popup) { // 如果弹出框存在
|
||||||
|
this.enalbedPopup = true; // 是否启用弹出框
|
||||||
|
this.popupPage = params.popup.page; // 弹出框页面
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.$mk.post({
|
|
||||||
url: this.actions.getList,
|
if (this.value && this.value[1]) { // 如果值存在
|
||||||
data: {
|
this.textboxValue = this.value[1]; // 输入框值
|
||||||
filter: filter,
|
} else { // 如果值不存在
|
||||||
model: this.modelName,
|
this.textboxValue = ""; // 输入框值为空
|
||||||
orderby: this.orderBy
|
}
|
||||||
|
|
||||||
|
this.getData().then(data => { // 获取数据
|
||||||
|
this.tableData = data // 表格数据
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getData(key) { // 获取数据
|
||||||
|
this.lastKey = key; // 上次输入的值
|
||||||
|
let filter = { rules: [], op: 'or' }; // 过滤器
|
||||||
|
if (key) { // 如果输入的值存在
|
||||||
|
for (let i = 0; i < this.searchFieldNames.length; i++) { // 循环搜索字段
|
||||||
|
let field = this.searchFieldNames[i]; // 字段
|
||||||
|
filter.rules.push({ value: key, field: field, op: "like" }); // 添加过滤器
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.$mk.post({ // 发送请求
|
||||||
|
url: this.actions.getList, // 地址
|
||||||
|
data: { // 数据
|
||||||
|
filter: filter, // 过滤器
|
||||||
|
model: this.modelName, // 模块名称
|
||||||
|
orderby: this.orderBy // 排序
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clickEvent() {
|
clickEvent() { // 点击事件
|
||||||
if (this.readonly) {
|
if (this.readonly) { // 如果只读
|
||||||
|
return; // 返回
|
||||||
|
}
|
||||||
|
this.$refs.xDown.showPanel() // 显示面板
|
||||||
|
},
|
||||||
|
keyupEvent(e) { // 键盘弹起事件
|
||||||
|
const { params } = this // 参数
|
||||||
|
if (this.readonly) { // 如果只读
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$refs.xDown.showPanel()
|
if (e.$event.keyCode == 40) { // 如果按下的是向下键
|
||||||
},
|
this.$refs.xDown.showPanel(); // 显示面板
|
||||||
keyupEvent(e) {
|
|
||||||
const { params } = this
|
|
||||||
if (this.readonly) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e.$event.keyCode == 40) {
|
|
||||||
this.$refs.xDown.showPanel();
|
|
||||||
const grid = this.$refs.xgrid;
|
const grid = this.$refs.xgrid;
|
||||||
var ds = grid.getTableData();
|
var ds = grid.getTableData(); // 获取表格数据
|
||||||
grid.focus();
|
grid.focus(); // 获取焦点
|
||||||
grid.setCurrentRow(ds.tableData[0]);
|
grid.setCurrentRow(ds.tableData[0]); // 设置当前行
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const cellValue = this.textboxValue;
|
const cellValue = this.textboxValue;
|
||||||
|
|
@ -170,16 +179,16 @@ export default {
|
||||||
params.onDataChanged({ value: ["", ""]})
|
params.onDataChanged({ value: ["", ""]})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true // 加载
|
||||||
this.getData(cellValue).then(data => {
|
this.getData(cellValue).then(data => { // 获取数据
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.tableData = data
|
this.tableData = data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
suffixClick() {
|
suffixClick() { // 后缀点击事件
|
||||||
this.$refs.xDown.togglePanel()
|
this.$refs.xDown.togglePanel()
|
||||||
},
|
},
|
||||||
pageChangeEvent({ currentPage, pageSize }) {
|
pageChangeEvent({ currentPage, pageSize }) { // 分页改变事件
|
||||||
this.tablePage.currentPage = currentPage
|
this.tablePage.currentPage = currentPage
|
||||||
this.tablePage.pageSize = pageSize
|
this.tablePage.pageSize = pageSize
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
@ -188,7 +197,7 @@ export default {
|
||||||
this.tableData = data
|
this.tableData = data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectEvent(e) {
|
selectEvent(e) { // 选择事件
|
||||||
const { params } = this
|
const { params } = this
|
||||||
let textField = params.textField;
|
let textField = params.textField;
|
||||||
this.textboxValue = e.row[textField];
|
this.textboxValue = e.row[textField];
|
||||||
|
|
@ -199,10 +208,10 @@ export default {
|
||||||
this.$refs.xDown.hidePanel()
|
this.$refs.xDown.hidePanel()
|
||||||
},
|
},
|
||||||
|
|
||||||
popupEvent() {
|
popupEvent() { // 弹出框事件
|
||||||
this.modalVisible = true;
|
this.modalVisible = true;
|
||||||
},
|
},
|
||||||
confirmEvent() {
|
confirmEvent() { // 确认事件
|
||||||
const { params } = this
|
const { params } = this
|
||||||
let selectedRow = this.$refs.popup.getSelectdRow();
|
let selectedRow = this.$refs.popup.getSelectdRow();
|
||||||
let textField = params.textField;
|
let textField = params.textField;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
uploadDefaultImg: "http://zjdaomiimgtest.oss-cn-hangzhou.aliyuncs.com/2022/16709016422295584.png",
|
uploadDefaultImg: "http://zjdaomiimgtest.oss-cn-hangzhou.aliyuncs.com/2022/16709016422295584.png", // 默认图片
|
||||||
|
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
import modal from './libs/function/modal'
|
import modal from './libs/function/modal' // 加载modal
|
||||||
import apis from './libs/function/apis'
|
import apis from './libs/function/apis' // 加载apis
|
||||||
import uploader from './libs/uploader/uploader'
|
import uploader from './libs/uploader/uploader' // 加载uploader
|
||||||
import form from './libs/function/form'
|
import form from './libs/function/form' // 加载form
|
||||||
import config from './config'
|
import config from './config' // 加载config
|
||||||
import dialog from './components/dialog'
|
import dialog from './components/dialog' // 加载dialog
|
||||||
import VXETable from 'vxe-table'
|
import VXETable from 'vxe-table' // 加载vxe-table
|
||||||
import MkGridSelect from './components/editors/MkGridSelect.vue'
|
import MkGridSelect from './components/editors/MkGridSelect.vue' // 加载下拉表格
|
||||||
import MkGridDataSelector from './components/editors/MkGridDataSelector.vue'
|
import MkGridDataSelector from './components/editors/MkGridDataSelector.vue' // 加载下拉表格
|
||||||
import MkFormDataSelector from './components/editors/MkFormDataSelector.vue'
|
import MkFormDataSelector from './components/editors/MkFormDataSelector.vue' // 加载下拉表单
|
||||||
import switchCompany from './components/switchCompany/switchCompany'
|
import switchCompany from './components/switchCompany/switchCompany' // 加载切换公司
|
||||||
import XEUtils from 'xe-utils'
|
import XEUtils from 'xe-utils' // 加载xe-utils
|
||||||
|
|
||||||
// 创建一个下拉表格渲染
|
// 创建一个下拉表格渲染
|
||||||
VXETable.renderer.add('MkGridDataSelector', {
|
VXETable.renderer.add('MkGridDataSelector', { // 创建一个下拉表格渲染
|
||||||
autofocus: '.vxe-input--inner',
|
autofocus: '.vxe-input--inner',
|
||||||
renderEdit(h, renderOpts, params) {
|
renderEdit(h, renderOpts, params) {
|
||||||
return <mk-grid-data-selector params={params}></mk-grid-data-selector>
|
return <mk-grid-data-selector params={params}></mk-grid-data-selector>
|
||||||
|
|
@ -38,25 +38,25 @@ VXETable.renderer.add('MkFormDataSelector', {
|
||||||
|
|
||||||
|
|
||||||
VXETable.formats.mixin({
|
VXETable.formats.mixin({
|
||||||
formatYesNo({ cellValue }) {
|
formatYesNo({ cellValue }) { // 格式化是否
|
||||||
return cellValue ? '是' : '否'
|
return cellValue ? '是' : '否'
|
||||||
},
|
},
|
||||||
formatRef({ cellValue }) {
|
formatRef({ cellValue }) { // 格式化参照
|
||||||
return cellValue && cellValue[1] ? cellValue[1] : ''
|
return cellValue && cellValue[1] ? cellValue[1] : ''
|
||||||
},
|
},
|
||||||
formatStatus({ cellValue }) {
|
formatStatus({ cellValue }) { // 格式化状态
|
||||||
if (cellValue && (cellValue.toLowerCase() == 'completed' || cellValue.toLowerCase() == 'approved')) {
|
if (cellValue && (cellValue.toLowerCase() == 'completed' || cellValue.toLowerCase() == 'approved')) {
|
||||||
return '生效';
|
return '生效';
|
||||||
}
|
}
|
||||||
return '未审';
|
return '未审';
|
||||||
},
|
},
|
||||||
formatDateTime({ cellValue }) {
|
formatDateTime({ cellValue }) { // 日期时间格式化
|
||||||
return XEUtils.toDateString(cellValue, 'yyyy-MM-dd HH:ss:mm')
|
return XEUtils.toDateString(cellValue, 'yyyy-MM-dd HH:ss:mm')
|
||||||
},
|
},
|
||||||
formatDate({ cellValue }) {
|
formatDate({ cellValue }) { // 日期格式化
|
||||||
return XEUtils.toDateString(cellValue, 'yyyy-MM-dd')
|
return XEUtils.toDateString(cellValue, 'yyyy-MM-dd')
|
||||||
},
|
},
|
||||||
formatNumber({ cellValue }) {
|
formatNumber({ cellValue }) { // 数字格式化
|
||||||
if(cellValue === 0) return '0';
|
if(cellValue === 0) return '0';
|
||||||
if(!cellValue) return '';
|
if(!cellValue) return '';
|
||||||
return parseFloat(cellValue).toFixed(2)
|
return parseFloat(cellValue).toFixed(2)
|
||||||
|
|
@ -64,7 +64,7 @@ VXETable.formats.mixin({
|
||||||
})
|
})
|
||||||
var mk = {
|
var mk = {
|
||||||
|
|
||||||
...modal,
|
...modal, // modal
|
||||||
|
|
||||||
...apis,
|
...apis,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,86 +1,86 @@
|
||||||
import { request } from '@/utils/request'
|
import { request } from '@/utils/request' // 加载request
|
||||||
import modal from './modal'
|
import modal from './modal' // 加载modal
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
post : function({url, data,loading , config}){
|
post : function({url, data,loading , config}){ // post请求
|
||||||
|
|
||||||
return new Promise((resolve, reject)=>{
|
return new Promise((resolve, reject)=>{ // 返回一个Promise
|
||||||
|
|
||||||
if(loading){
|
if(loading){ // 如果需要加载
|
||||||
modal.loading(loading);
|
modal.loading(loading); // 显示加载
|
||||||
}
|
}
|
||||||
request(url, 'post', data, config).then(response=>{
|
request(url, 'post', data, config).then(response=>{ // 发送请求
|
||||||
if(!response){
|
if(!response){ // 如果没有返回
|
||||||
reject && reject(response);
|
reject && reject(response); // 返回错误
|
||||||
return;
|
return; // 返回
|
||||||
}
|
}
|
||||||
var result = response.data;
|
var result = response.data; // 获取数据
|
||||||
if(!result){
|
if(!result){ // 如果没有数据
|
||||||
reject && reject(response);
|
reject && reject(response); // 返回错误
|
||||||
return;
|
return; // 返回
|
||||||
}
|
}
|
||||||
if(loading){
|
if(loading){ // 如果需要加载
|
||||||
modal.hideLoading();
|
modal.hideLoading(); // 隐藏加载
|
||||||
}
|
}
|
||||||
if(result.code != 200){
|
if(result.code != 200){ // 如果返回的状态码不是200
|
||||||
if(reject){
|
if(reject){ // 如果有错误回调
|
||||||
reject(response);
|
reject(response); // 返回错误
|
||||||
}else{
|
}else{ // 如果没有错误回调
|
||||||
modal.error(result.msg);
|
modal.error(result.msg); // 显示错误
|
||||||
}
|
}
|
||||||
return;
|
return; // 返回
|
||||||
}
|
}
|
||||||
resolve(result);
|
resolve(result); // 返回成功
|
||||||
}).catch((error)=>{
|
}).catch((error)=>{ // 如果出错
|
||||||
if(loading){
|
if(loading){ // 如果需要加载
|
||||||
modal.hideLoading();
|
modal.hideLoading(); // 隐藏加载
|
||||||
}
|
}
|
||||||
modal.error(error.toString());
|
modal.error(error.toString()); // 显示错误
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getPagedData: function({url, method = 'post', data,callback, config}){
|
getPagedData: function({url, method = 'post', data,callback, config}){ // 获取分页数据 默认post请求
|
||||||
|
|
||||||
return new Promise((resolve, reject)=>{
|
return new Promise((resolve, reject)=>{ // 返回一个Promise
|
||||||
|
|
||||||
if(data.start_time && typeof(data.start_time) == "string"){
|
if(data.start_time && typeof(data.start_time) == "string"){ // 如果开始时间是字符串
|
||||||
data.start_time = parseInt(new Date(data.start_time).getTime()/1000);
|
data.start_time = parseInt(new Date(data.start_time).getTime()/1000); // 转换为时间戳
|
||||||
}
|
}
|
||||||
if(data.end_time && typeof(data.end_time) == "string"){
|
if(data.end_time && typeof(data.end_time) == "string"){ // 如果结束时间是字符串
|
||||||
data.end_time =parseInt(new Date(data.end_time).getTime()/1000);
|
data.end_time =parseInt(new Date(data.end_time).getTime()/1000); // 转换为时间戳
|
||||||
}
|
}
|
||||||
request(url, method, data, config).then(response=>{
|
request(url, method, data, config).then(response=>{ // 发送请求
|
||||||
if(!response){
|
if(!response){ // 如果没有返回
|
||||||
reject && reject(response);
|
reject && reject(response); // 返回错误
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var result = response.data;
|
var result = response.data; // 获取数据
|
||||||
if(!result){
|
if(!result){ // 如果没有数据
|
||||||
reject && reject(response);
|
reject && reject(response); // 返回错误
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result.code != 200){
|
if(result.code != 200){ // 如果返回的状态码不是200
|
||||||
if(reject){
|
if(reject){ // 如果有错误回调
|
||||||
reject(response);
|
reject(response); // 返回错误
|
||||||
}else{
|
}else{ // 如果没有错误回调
|
||||||
modal.error(result.msg);
|
modal.error(result.msg); // 显示错误
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
resolve(result.data);
|
resolve(result.data); // 返回成功
|
||||||
|
|
||||||
if(callback){
|
if(callback){ // 如果有回调
|
||||||
callback(result.data);
|
callback(result.data); // 执行回调
|
||||||
}
|
}
|
||||||
}).catch((error)=>{
|
}).catch((error)=>{
|
||||||
resolve({
|
resolve({ // 返回一个空数据
|
||||||
total:0,
|
total:0, // 总数
|
||||||
list :[]
|
list :[] // 列表
|
||||||
});
|
});
|
||||||
modal.error(error.toString());
|
modal.error(error.toString()); // 显示错误
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
formatFormData: function ({ data, rules }) {
|
formatFormData: function ({ data, rules }) { // 格式化表单数据
|
||||||
|
|
||||||
rules.forEach(rule => {
|
rules.forEach(rule => { // 循环规则
|
||||||
if (rule.field in data) {
|
if (rule.field in data) { // 如果字段在数据中
|
||||||
let value = data[rule.field];
|
let value = data[rule.field]; // 获取值
|
||||||
if (rule.dataRule && rule.dataRule.type == "integer") {
|
if (rule.dataRule && rule.dataRule.type == "integer") { // 如果是整数
|
||||||
data[rule.field] = parseInt(value);
|
data[rule.field] = parseInt(value); // 转换为整数
|
||||||
}
|
}
|
||||||
if (rule.dataRule && rule.dataRule.type == "timestamp") {
|
if (rule.dataRule && rule.dataRule.type == "timestamp") { // 如果是时间戳
|
||||||
data[rule.field] = parseInt(new Date(data[rule.field]).getTime() / 1000);
|
data[rule.field] = parseInt(new Date(data[rule.field]).getTime() / 1000); // 转换为时间戳
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -18,24 +18,24 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
validateForm : function ({ form }) {
|
validateForm : function ({ form }) { // 验证表单
|
||||||
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => { // 返回一个Promise
|
||||||
|
|
||||||
form.validate(a => {
|
form.validate(a => { // 验证表单
|
||||||
let count = 0;
|
let count = 0; // 计数器
|
||||||
if (a) {
|
if (a) { // 如果有错误
|
||||||
for (let name in a) {
|
for (let name in a) { // 循环错误
|
||||||
a[name];
|
a[name]; // 获取错误
|
||||||
count++;
|
count++; // 计数器加1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) { // 如果有错误
|
||||||
reject(count);
|
reject(count); // 返回错误
|
||||||
} else {
|
} else { // 如果没有错误
|
||||||
resolve();
|
resolve(); // 返回成功
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import VXETable from 'vxe-table'
|
||||||
/**
|
/**
|
||||||
* 函数 - 弹窗
|
* 函数 - 弹窗
|
||||||
*/
|
*/
|
||||||
const msgs = {
|
const msgs = { // 提示信息
|
||||||
title: "提示",
|
title: "提示",
|
||||||
confirmText: "确定",
|
confirmText: "确定",
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
|
|
@ -13,44 +13,44 @@ export default {
|
||||||
/**
|
/**
|
||||||
this.$mk.alert({ content: '基本提示框', title: '标题1' });
|
this.$mk.alert({ content: '基本提示框', title: '标题1' });
|
||||||
*/
|
*/
|
||||||
alert: function (options = {}) {
|
alert: function (options = {}) { // 弹窗
|
||||||
options = Object.assign({ title: msgs.title }, options);
|
options = Object.assign({ title: msgs.title }, options); // 合并
|
||||||
|
|
||||||
return VXETable.modal.alert(options);
|
return VXETable.modal.alert(options); // 弹窗
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
this.$mk.msg(“消息提示”);
|
this.$mk.msg(“消息提示”);
|
||||||
*/
|
*/
|
||||||
msg: function (content) {
|
msg: function (content) {
|
||||||
return VXETable.modal.message({ content: content });
|
return VXETable.modal.message({ content: content }); // 消息提示
|
||||||
},
|
},
|
||||||
|
|
||||||
info: function (content) {
|
info: function (content) { // 信息提示
|
||||||
return VXETable.modal.message({ content: content, status: 'info' });
|
return VXETable.modal.message({ content: content, status: 'info' });
|
||||||
},
|
},
|
||||||
|
|
||||||
warning: function (content) {
|
warning: function (content) { // 警告提示
|
||||||
return VXETable.modal.message({ content: content, status: 'warning' });
|
return VXETable.modal.message({ content: content, status: 'warning' });
|
||||||
},
|
},
|
||||||
|
|
||||||
question: function (content) {
|
question: function (content) { // 询问提示
|
||||||
return VXETable.modal.message({ content: content, status: 'question' });
|
return VXETable.modal.message({ content: content, status: 'question' });
|
||||||
},
|
},
|
||||||
|
|
||||||
success: function (content) {
|
success: function (content) { // 成功提示
|
||||||
return VXETable.modal.message({ content: content, status: 'success' });
|
return VXETable.modal.message({ content: content, status: 'success' });
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (content) {
|
error: function (content) { // 错误提示
|
||||||
return VXETable.modal.message({ content: content, status: 'error' });
|
return VXETable.modal.message({ content: content, status: 'error' });
|
||||||
},
|
},
|
||||||
|
|
||||||
loading: function (content) {
|
loading: function (content) { // 加载提示
|
||||||
return VXETable.modal.message({ content: content, status: 'loading', duration: -1, id: 'loading' });
|
return VXETable.modal.message({ content: content, status: 'loading', duration: -1, id: 'loading' });
|
||||||
},
|
},
|
||||||
|
|
||||||
hideLoading: function () {
|
hideLoading: function () { // 隐藏加载提示
|
||||||
VXETable.modal.close("loading");
|
VXETable.modal.close("loading");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -59,5 +59,5 @@ export default {
|
||||||
this.$mk.msg("点击了确定")
|
this.$mk.msg("点击了确定")
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
confirm: VXETable.modal.confirm
|
confirm: VXETable.modal.confirm // 确认提示
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,21 +30,26 @@
|
||||||
<!-- 表格区 -->
|
<!-- 表格区 -->
|
||||||
<div class="gridPanel">
|
<div class="gridPanel">
|
||||||
<vxe-grid ref='xGrid' v-bind="gridOptions">
|
<vxe-grid ref='xGrid' v-bind="gridOptions">
|
||||||
<template #status="{ row }">
|
<template #status="{ row }"><!-- 这里是自定义列 -->
|
||||||
<a-switch :checked="row.status ? true : false" @change="onSwitch(row, 'status')" />
|
<!-- 转换 row.status 的值 如果是true显示开,否则显示关-->
|
||||||
</template>
|
<a-switch :checked="row.status ? true : false" @change="onSwitch(row, 'status')" />
|
||||||
<template #op="{ row }">
|
</template>
|
||||||
<div class="oplinks">
|
<template #auth_stop_date="{ row }"><!-- 这里是自定义列 -->
|
||||||
|
<!-- 转换 row.auth_stop_date 的值 将时间戳转换为日期格式 -->
|
||||||
|
<span>{{ row.auth_stop_date | formatDateTime(row.auth_stop_date) }}</span>
|
||||||
|
</template>
|
||||||
|
<template #op="{ row }">
|
||||||
|
<div class="oplinks">
|
||||||
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
|
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
|
||||||
<a @click.stop="pageDelete(row)" title="删除"><a-icon type="delete" /></a>
|
<a @click.stop="pageDelete(row)" title="删除"><a-icon type="delete" /></a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #logo="{ row }">
|
<template #logo="{ row }">
|
||||||
<img v-if="row.logo" :src="row.logo" style="width: 100px;"/>
|
<img v-if="row.logo" :src="row.logo" style="width: 100px;" />
|
||||||
<span v-else>无</span>
|
<span v-else>无</span>
|
||||||
</template>
|
</template>
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -97,8 +102,12 @@ export default {
|
||||||
{ field: 'title', title: '标题', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入标题' } } },
|
{ field: 'title', title: '标题', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入标题' } } },
|
||||||
{ field: 'desc', title: '描述', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入描述' } } },
|
{ field: 'desc', title: '描述', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入描述' } } },
|
||||||
{ span: 8, slots: { default: 'date' } },
|
{ span: 8, slots: { default: 'date' } },
|
||||||
{ align: 'right', span: 4, itemRender: { name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } },
|
{
|
||||||
{ props: { type: 'reset', content: '重置' } }] } }
|
align: 'right', span: 4, itemRender: {
|
||||||
|
name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } },
|
||||||
|
{ props: { type: 'reset', content: '重置' } }]
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -120,40 +129,41 @@ export default {
|
||||||
// 接收Promise
|
// 接收Promise
|
||||||
ajax: {
|
ajax: {
|
||||||
// 当点击工具栏查询按钮或者手动提交指令 query或reload 时会被触发
|
// 当点击工具栏查询按钮或者手动提交指令 query或reload 时会被触发
|
||||||
query: (options) => {
|
query: (options) => { // options 为当前表格的配置项
|
||||||
const { page, sorts } = options;
|
const { page, sorts } = options; // 获取当前页码、每页条数、排序信息
|
||||||
var params = {};
|
var params = {}; // 定义请求参数
|
||||||
params.page = page.currentPage;
|
params.page = page.currentPage; // 当前页码
|
||||||
params.limit = page.pageSize;
|
params.limit = page.pageSize; // 每页条数
|
||||||
params.order_bys = [];
|
params.order_bys = []; // 排序信息
|
||||||
params.search_rules = this.getSearchParms();
|
params.search_rules = this.getSearchParms(); // 搜索信息
|
||||||
if (sorts) {
|
if (sorts) { // 如果有排序信息
|
||||||
sorts.forEach((v) => {
|
sorts.forEach((v) => { // 遍历排序信息
|
||||||
params.order_bys.push({
|
params.order_bys.push({ // 添加排序信息
|
||||||
column: v.property,
|
column: v.property, // 字段名
|
||||||
order: v.order
|
order: v.order // 排序方式
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return this.loadData({ params });
|
return this.loadData({ params }); // 返回请求结果
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{ type: 'checkbox', width: 50 },
|
{ type: 'checkbox', width: 50 },
|
||||||
{ type: 'seq', width: 50 },
|
{ type: 'seq', width: 50 },
|
||||||
{ slots: { default: 'logo' }, width: 120, sortable: true, title: '公司Logo', showHeaderOverflow: true },
|
{ slots: { default: 'logo' }, width: 120, sortable: true, title: '公司Logo', showHeaderOverflow: true },
|
||||||
{ field: 'title', sortable: true, title: '公司名称' ,width:250},
|
{ field: 'title', sortable: true, title: '公司名称', width: 250 },
|
||||||
{ field: 'auth_stop_date', width: 120, sortable: true, title: '授权截止日期', showHeaderOverflow: true },
|
// 将 auth_stop_date 时间戵转换为日期格式
|
||||||
|
{ field: 'auth_stop_date', slots: { default: 'auth_stop_date' }, width: 120, sortable: true, title: '授权截止日期', showHeaderOverflow: true },
|
||||||
{ field: 'token', width: 120, sortable: true, title: 'token', showHeaderOverflow: true },
|
{ field: 'token', width: 120, sortable: true, title: 'token', showHeaderOverflow: true },
|
||||||
{ field: 'is_private_cloud' ,width:110, sortable: true, title: '私有云', showHeaderOverflow: true },
|
{ field: 'is_private_cloud', width: 110, sortable: true, title: '私有云', showHeaderOverflow: true },
|
||||||
{ field: 'admin_count' ,width:110, sortable: true, title: '用户数', showHeaderOverflow: true },
|
{ field: 'admin_count', width: 110, sortable: true, title: '用户数', showHeaderOverflow: true },
|
||||||
{ title: '操作', slots: { default: 'op' },width:120 }
|
{ title: '操作', slots: { default: 'op' }, width: 120 }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions);
|
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); // 合并默认配置
|
||||||
|
|
||||||
return pageData;
|
return pageData;
|
||||||
},
|
},
|
||||||
|
|
@ -163,7 +173,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => { // 在下次 DOM 更新循环结束之后执行延迟回调
|
||||||
// 将表格和工具栏进行关联
|
// 将表格和工具栏进行关联
|
||||||
this.$refs.xGrid.connect(this.$refs.xToolbar)
|
this.$refs.xGrid.connect(this.$refs.xToolbar)
|
||||||
});
|
});
|
||||||
|
|
@ -175,50 +185,50 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
onDateChange(date) {
|
onDateChange(date) { // 日期选择器事件
|
||||||
if (date && date.length) {
|
if (date && date.length) { // 如果有值
|
||||||
this.start_time = parseInt(date[0]._d.getTime() / 1000);
|
this.start_time = parseInt(date[0]._d.getTime() / 1000); // 将日期转换为时间戳
|
||||||
this.end_time = parseInt(date[1]._d.getTime() / 1000);
|
this.end_time = parseInt(date[1]._d.getTime() / 1000); // 将日期转换为时间戳
|
||||||
} else {
|
} else {
|
||||||
this.start_time = 0;
|
this.start_time = 0; // 将日期转换为时间戳
|
||||||
this.end_time = 0;
|
this.end_time = 0; // 将日期转换为时间戳
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
getSearchParms() {
|
getSearchParms() { // 获取搜索参数
|
||||||
var rules = [];
|
var rules = []; // 定义搜索参数
|
||||||
let findMode = k => {
|
let findMode = k => { // 查找搜索模式
|
||||||
for (let i in this.searchRules) {
|
for (let i in this.searchRules) { // 遍历搜索规则
|
||||||
if (this.searchRules[i].key == k) return this.searchRules[i].mode;
|
if (this.searchRules[i].key == k) return this.searchRules[i].mode; // 如果找到了就返回搜索模式
|
||||||
}
|
}
|
||||||
return "equal";
|
return "equal"; // 如果没有找到就返回等于
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let key in this.searchFormData) {
|
for (let key in this.searchFormData) { // 遍历搜索表单数据
|
||||||
let value = this.searchFormData[key];
|
let value = this.searchFormData[key]; // 获取值
|
||||||
if (value) {
|
if (value) { // 如果有值
|
||||||
let mode = findMode(key);
|
let mode = findMode(key); // 获取搜索模式
|
||||||
if (mode == "like") {
|
if (mode == "like") { // 如果是模糊搜索
|
||||||
value = "%" + value + "%";
|
value = "%" + value + "%"; // 如果是模糊搜索就在两边加上%
|
||||||
}
|
}
|
||||||
rules.push({
|
rules.push({ // 添加搜索参数
|
||||||
column: key,
|
column: key, // 字段名
|
||||||
mode: mode,
|
mode: mode, // 搜索模式
|
||||||
value: value
|
value: value // 值
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rules;
|
return rules; // 返回搜索参数
|
||||||
},
|
},
|
||||||
getSelectdRow() {
|
getSelectdRow() { // 获取选中行
|
||||||
let row = this.$refs.xGrid.getCurrentRecord();
|
let row = this.$refs.xGrid.getCurrentRecord(); // 获取当前行
|
||||||
if (!row) {
|
if (!row) { // 如果没有选中行
|
||||||
let rows = this.$refs.xGrid.getCheckboxRecords();
|
let rows = this.$refs.xGrid.getCheckboxRecords(); // 获取选中行
|
||||||
if (rows && rows.length) { row = rows[0]; }
|
if (rows && rows.length) { row = rows[0]; } // 如果有选中行就取第一行
|
||||||
}
|
}
|
||||||
return row;
|
return row;
|
||||||
},
|
},
|
||||||
loadData({ params }) {
|
loadData({ params }) { // 加载数据
|
||||||
|
|
||||||
params.start_time = this.start_time;
|
params.start_time = this.start_time;
|
||||||
params.end_time = this.end_time;
|
params.end_time = this.end_time;
|
||||||
|
|
@ -227,64 +237,67 @@ export default {
|
||||||
return this.$mk.getPagedData({ url: this.actions.getList, data: params });
|
return this.$mk.getPagedData({ url: this.actions.getList, data: params });
|
||||||
},
|
},
|
||||||
|
|
||||||
//add / log / setting
|
//add / log / setting
|
||||||
toolbarClick(e) {
|
toolbarClick(e) { // 工具栏点击事件
|
||||||
if (e.name == "add") {
|
if (e.name == "add") {
|
||||||
|
|
||||||
this.$openPage("/BaseCompany/BaseCompanyAdd");
|
this.$openPage("/BaseCompany/BaseCompanyAdd");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
pageEdit(row) {
|
pageEdit(row) { // 编辑
|
||||||
|
|
||||||
if (!row) {
|
if (!row) { // 如果没有选中行
|
||||||
this.$mk.msg("请选择行");
|
this.$mk.msg("请选择行"); // 提示
|
||||||
|
return; // 返回
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$openPage("/BaseCompany/BaseCompanyUpdate/" + row[this.keyName]); // 打开页面
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
pageDelete(row) { // 删除
|
||||||
|
|
||||||
|
|
||||||
|
let rows = row ? [row] : this.$refs.xGrid.getCheckboxRecords(); // 获取选中行
|
||||||
|
|
||||||
|
let ids = [];
|
||||||
|
rows.forEach((row) => { // 遍历选中行
|
||||||
|
ids.push(row[this.keyName]); // 添加到数组中
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!ids.length) { // 如果没有选中行
|
||||||
|
this.$mk.error("请选择行"); // 提示
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$openPage("/BaseCompany/BaseCompanyUpdate/" + row[this.keyName]);
|
this.$mk.confirm('您确定要删除吗?').then(type => {
|
||||||
|
if (type == 'confirm') {
|
||||||
},
|
this.$mk.post({
|
||||||
|
url: this.actions.delete,
|
||||||
pageDelete(row) {
|
loading: "删除中...",
|
||||||
|
data: {
|
||||||
|
ids: ids
|
||||||
let rows = row ? [row] : this.$refs.xGrid.getCheckboxRecords();
|
}
|
||||||
|
}).then(() => {
|
||||||
let ids = [];
|
this.$mk.success("删除成功");
|
||||||
rows.forEach((row) => {
|
this.onSearch();
|
||||||
ids.push(row[this.keyName]);
|
}).catch((a) => {
|
||||||
|
this.$mk.error(a.data.msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!ids.length) {
|
|
||||||
this.$mk.error("请选择行");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
this.$mk.confirm('您确定要删除吗?').then(type => {
|
|
||||||
if (type == 'confirm') {
|
|
||||||
this.$mk.post({
|
|
||||||
url: this.actions.delete,
|
|
||||||
loading: "删除中...",
|
|
||||||
data: {
|
|
||||||
ids: ids
|
|
||||||
}
|
|
||||||
}).then(() => {
|
|
||||||
this.$mk.success("删除成功");
|
|
||||||
this.onSearch();
|
|
||||||
}).catch((a) => {
|
|
||||||
this.$mk.error(a.data.msg);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onSearch() {
|
onSearch() { // 搜索
|
||||||
this.$refs.xGrid.commitProxy('query')
|
this.$refs.xGrid.commitProxy('query')
|
||||||
}
|
},
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 监听属性
|
// 监听属性
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -294,22 +307,20 @@ export default {
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
|
||||||
.page-body {
|
.page-body {
|
||||||
padding: 30px ;
|
padding: 30px;
|
||||||
background: @base-bg-color;
|
background: @base-bg-color;
|
||||||
}
|
}
|
||||||
.gridPanel{
|
|
||||||
|
.gridPanel {
|
||||||
height: calc(100vh - 400px);
|
height: calc(100vh - 400px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.oplinks svg {
|
.oplinks svg {
|
||||||
width: 22px;
|
width: 22px;
|
||||||
height:22px;
|
height: 22px;
|
||||||
margin: 0 5px 0 0;
|
margin: 0 5px 0 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -127,8 +127,7 @@ export default {
|
||||||
{ field: 'en_title', title: '项目名称(英文)', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入项目名' } } },
|
{ field: 'en_title', title: '项目名称(英文)', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入项目名' } } },
|
||||||
{ field: 'sub_title', title: '副标题', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入副标题' } } },
|
{ field: 'sub_title', title: '副标题', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入副标题' } } },
|
||||||
{ field: 'en_sub_title', title: '副标题(英文)', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入副标题' } } },
|
{ field: 'en_sub_title', title: '副标题(英文)', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入副标题' } } },
|
||||||
|
{ field: 'copy_right', title: '版权', span: 12,defaultValue:'显示Copyright 2022 广东正极科技有限公司出品', itemRender: { name: '$input', props: { placeholder: '请输入版权' } } },
|
||||||
{ field: 'copy_right', title: '版权', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入版权' } } },
|
|
||||||
{ field: 'en_copy_right', title: '版权(英文)', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入版权' } } },
|
{ field: 'en_copy_right', title: '版权(英文)', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入版权' } } },
|
||||||
{ field: 'slogan', title: '标语', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入标语' } } },
|
{ field: 'slogan', title: '标语', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入标语' } } },
|
||||||
{ field: 'en_slogan', title: '标语(英文)', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入标语' } } },
|
{ field: 'en_slogan', title: '标语(英文)', span: 12, itemRender: { name: '$input', props: { placeholder: '请输入标语' } } },
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,16 @@
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<img alt="logo" class="logo" :src="Project.project_logo" />
|
<img alt="logo" class="logo" :src="Project.project_logo" />
|
||||||
|
|
||||||
<span class="title">{{ Project.project_name }}</span>
|
<div class="title">{{ Project.project_name }}
|
||||||
|
<!-- 如果 Project.project_sub_title 不为空,则显示 -->
|
||||||
|
<i v-if="Project.project_sub_title"><b>|</b> {{ Project.project_sub_title }}</i>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="title_en">{{ Project.project_en_name }} <b>|</b> <i>{{ Project.project_en_sub_title }}</i></div> -->
|
||||||
|
<div class="desc">
|
||||||
|
{{ Project.slogan }}<br />
|
||||||
|
<!-- {{ Project.en_slogan }} -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="desc">{{ Project.project_sub_title }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<a-form @submit="onSubmit" :form="form">
|
<a-form @submit="onSubmit" :form="form">
|
||||||
|
|
@ -71,7 +78,8 @@
|
||||||
</div>
|
</div>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
|
||||||
<switch-company v-model="companyShow" :data="companyData" @confirm="companyconfirm" ref="switchCompany" ></switch-company>
|
<switch-company v-model="companyShow" :data="companyData" @confirm="companyconfirm"
|
||||||
|
ref="switchCompany"></switch-company>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -99,7 +107,7 @@ export default {
|
||||||
logging: false,
|
logging: false,
|
||||||
error: '',
|
error: '',
|
||||||
form: this.$form.createForm(this),
|
form: this.$form.createForm(this),
|
||||||
mobileTest:"18607684660",
|
mobileTest: "18607684660",
|
||||||
user: {
|
user: {
|
||||||
mobile: '18192398883',
|
mobile: '18192398883',
|
||||||
password: '888888'
|
password: '888888'
|
||||||
|
|
@ -133,8 +141,8 @@ export default {
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if(!this.isMiddleAdmin()){
|
if (!this.isMiddleAdmin()) {
|
||||||
this.user.mobile = this.mobileTest;
|
this.user.mobile = this.mobileTest;
|
||||||
}
|
}
|
||||||
this.form.setFieldsValue({
|
this.form.setFieldsValue({
|
||||||
name: this.user.mobile,
|
name: this.user.mobile,
|
||||||
|
|
@ -149,7 +157,7 @@ export default {
|
||||||
...mapMutations('account', ['setUid', 'setUser', 'setPermissions', 'setRoutesConfig', 'setSettings', 'setCompany', 'setProject']),
|
...mapMutations('account', ['setUid', 'setUser', 'setPermissions', 'setRoutesConfig', 'setSettings', 'setCompany', 'setProject']),
|
||||||
|
|
||||||
|
|
||||||
companyconfirm({row}) {
|
companyconfirm({ row }) {
|
||||||
this.companyShow = false;
|
this.companyShow = false;
|
||||||
//没有选择公司,或者选择了第一个公司,直接登录
|
//没有选择公司,或者选择了第一个公司,直接登录
|
||||||
if (!row || row.id == this.companyData[0].id) {
|
if (!row || row.id == this.companyData[0].id) {
|
||||||
|
|
@ -225,7 +233,7 @@ export default {
|
||||||
afterLoginSuccess({ token, access_expire, uid, loginResMsg }) {
|
afterLoginSuccess({ token, access_expire, uid, loginResMsg }) {
|
||||||
|
|
||||||
|
|
||||||
this.$refs.loginActions.afterLoginSuccess({ token, access_expire, uid, msg :loginResMsg});
|
this.$refs.loginActions.afterLoginSuccess({ token, access_expire, uid, msg: loginResMsg });
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -238,34 +246,65 @@ export default {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
height: 44px;
|
min-height: 44px;
|
||||||
line-height: 44px;
|
width: 30%;
|
||||||
|
padding: auto;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
// border: 1px solid black;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
height: 44px;
|
height: 80px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
margin-right: 16px;
|
margin-bottom:10px;
|
||||||
|
// border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 33px;
|
font-size: 40px;
|
||||||
color: @title-color;
|
color: @title-color;
|
||||||
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 2px;
|
// margin-left: 25%;
|
||||||
|
// border: 1px solid black;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom:10px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 16px;
|
||||||
|
margin-right: 4px;
|
||||||
|
position: absolute;
|
||||||
|
right:0px;
|
||||||
|
color:rgb(194, 194, 194);
|
||||||
|
b {
|
||||||
|
font-weight: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title_en {
|
||||||
|
color: @title-color;
|
||||||
|
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
||||||
|
// margin-left: 25%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.desc {
|
.desc {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: @text-color-second;
|
color: @text-color-second;
|
||||||
margin-top: 12px;
|
margin-top: 5px;
|
||||||
|
font-size: 20px;
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
|
// margin-left: 25%;
|
||||||
|
// border: 1px solid black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const BaseAdminRouterMap = {
|
||||||
name: '用户管理',
|
name: '用户管理',
|
||||||
icon: 'idcard',
|
icon: 'idcard',
|
||||||
path: '/BaseAdmin/BaseAdminList',
|
path: '/BaseAdmin/BaseAdminList',
|
||||||
component: () => import('@/pages/BaseAdmin/BaseAdmin/list'),
|
component: () => import('@/pages/Middle/Base/BaseAdmin/BaseAdmin/list'),
|
||||||
|
|
||||||
authority: {
|
authority: {
|
||||||
permission: ['BaseAdmin-All'],
|
permission: ['BaseAdmin-All'],
|
||||||
|
|
@ -46,7 +46,7 @@ const BaseAdminRouterMap = {
|
||||||
name: '角色管理',
|
name: '角色管理',
|
||||||
icon: 'idcard',
|
icon: 'idcard',
|
||||||
path: '/BasePermission/RoleList',
|
path: '/BasePermission/RoleList',
|
||||||
component: () => import('@/pages/BaseAdmin/BaseRole/list'),
|
component: () => import('@/pages/Middle/Base/BaseAdmin/BaseRole/list'),
|
||||||
authority: {
|
authority: {
|
||||||
permission: ['BasePermission-All'],
|
permission: ['BasePermission-All'],
|
||||||
}
|
}
|
||||||
|
|
@ -3,27 +3,24 @@ import BaseRouterMap from './async/base.map.js'
|
||||||
|
|
||||||
|
|
||||||
import AdminUserRouterMap from '@/router/Middle/Admin/AdminUser/router.map.js'
|
import AdminUserRouterMap from '@/router/Middle/Admin/AdminUser/router.map.js'
|
||||||
import BaseConfigRouterMap from '@/router/Middle/Base/BaseConfig/router.map.js'
|
import BaseConfigRouterMap from '@/router/Middle/Base/BaseConfig/router.map.js'
|
||||||
import BaseServiceRouterMap from '@/router/Middle/Base/BaseService/router.map.js'
|
import BaseServiceRouterMap from '@/router/Middle/Base/BaseService/router.map.js'
|
||||||
import BaseAgentRouterMap from '@/router/Middle/Base/BaseAgent/router.map.js'
|
import BaseAgentRouterMap from '@/router/Middle/Base/BaseAgent/router.map.js'
|
||||||
import BaseCompanyRouterMap from '@/router/Middle/Base/BaseCompany/router.map.js'
|
import BaseCompanyRouterMap from '@/router/Middle/Base/BaseCompany/router.map.js'
|
||||||
import BasePermissionRouterMap from '@/router/Middle/Base/BasePermission/router.map.js'
|
import BasePermissionRouterMap from '@/router/Middle/Base/BasePermission/router.map.js'
|
||||||
|
import BaseAdminRouterMap from '@/router/Middle/Base/BaseAdmin/router.map.js'
|
||||||
|
|
||||||
import BaseAdminRouterMap from '@/router/BaseAdmin/router.map.js'
|
|
||||||
|
|
||||||
|
|
||||||
// 合并BaseRouterMap ConfigRouterMap ServiceRouterMap
|
// 合并BaseRouterMap ConfigRouterMap ServiceRouterMap
|
||||||
const routerMap = Object.assign({},
|
const routerMap = Object.assign({},
|
||||||
BaseRouterMap,
|
BaseRouterMap,
|
||||||
AdminUserRouterMap,
|
AdminUserRouterMap,
|
||||||
BaseConfigRouterMap,
|
BaseConfigRouterMap,
|
||||||
BaseServiceRouterMap,
|
BaseServiceRouterMap,
|
||||||
BaseAgentRouterMap,
|
BaseAgentRouterMap,
|
||||||
BaseCompanyRouterMap,
|
BaseCompanyRouterMap,
|
||||||
BasePermissionRouterMap,
|
BasePermissionRouterMap,
|
||||||
|
BaseAdminRouterMap,
|
||||||
BaseAdminRouterMap,
|
)
|
||||||
)
|
|
||||||
|
|
||||||
export default routerMap
|
export default routerMap
|
||||||
Loading…
Reference in New Issue