pd改名mb

This commit is contained in:
吕金泽 2022-01-28 16:02:34 +08:00
parent 8b7a73d452
commit 6fbf5978ff
27 changed files with 77 additions and 78 deletions

View File

@ -11,7 +11,7 @@
import { getToken } from '@/scripts/auth'
export default {
name: 'PdButton',
name: 'MbButton',
props: {
el: {
type: Object,

View File

@ -16,7 +16,7 @@
<script>
export default {
name: 'PdDialog',
name: 'MbDialog',
props: {
title: {
type: String,

View File

@ -3,19 +3,19 @@
<el-row style="margin-bottom: 6px">
<el-button type="primary" @click="tableOptions.data.push({})">添加一行</el-button>
</el-row>
<pd-table v-bind="tableOptions">
<mb-table v-bind="tableOptions">
<template v-for="col in cols" #[col.field]="{ index }">
<el-input v-if="col.type === 'input'" v-bind="col.properties" v-model="tableOptions.data[index][col.field]" @change="dataChange" />
<pd-select v-else-if="col.type === 'select'" v-bind="col.properties" v-model="tableOptions.data[index][col.field]" @change="dataChange" />
<mb-select v-else-if="col.type === 'select'" v-bind="col.properties" v-model="tableOptions.data[index][col.field]" @change="dataChange" />
</template>
</pd-table>
</mb-table>
</div>
</template>
<script>
export default {
name: 'PdEditorTable',
name: 'MbEditorTable',
model: {
prop: 'value',
event: 'change'

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-select v-if="pdType === 'select'" v-model="selectValue" v-bind="el" :style="{ width }" placeholder="请选择" filterable clearable>
<el-select v-if="mbType === 'select'" v-model="selectValue" v-bind="el" :style="{ width }" placeholder="请选择" filterable clearable>
<el-option
v-for="item in selectList"
:key="item.value"
@ -8,7 +8,7 @@
:value="item.value"
/>
</el-select>
<el-radio-group v-if="pdType === 'radio'" v-model="selectValue">
<el-radio-group v-if="mbType === 'radio'" v-model="selectValue">
<el-radio v-for="item in selectList" :key="item.value" :label="item.value">
{{ item.label }}
</el-radio>
@ -19,7 +19,7 @@
<script>
export default {
name: 'PdSelect',
name: 'MbSelect',
model: {
prop: 'value',
event: 'change'
@ -61,7 +61,7 @@ export default {
type: String,
default: 'value'
},
pdType: {
mbType: {
type: String,
default: 'select'
},

View File

@ -35,18 +35,18 @@
</span>
<span v-else-if="col.field">{{ scope.row[col.field] }}</span>
</template>
<pd-table-column v-for="(col2, j) in col.cols" :key="j" :col="col2">
<mb-table-column v-for="(col2, j) in col.cols" :key="j" :col="col2">
<template v-for="(value, key) in $scopedSlots" #[key]="{ row, index }">
<slot :row="row" :index="index" :name="key" />
</template>
</pd-table-column>
</mb-table-column>
</el-table-column>
</template>
<script>
export default {
name: 'PdTableColumn',
name: 'MbTableColumn',
props: {
col: {
type: Object,

View File

@ -21,11 +21,11 @@
</template>
</el-table-column>
<pd-table-column v-for="(col, i) in cols" :key="i" :col="col">
<mb-table-column v-for="(col, i) in cols" :key="i" :col="col">
<template v-for="(value, key) in $scopedSlots" #[key]="{ row, index }">
<slot :row="row" :index="index" :name="key" />
</template>
</pd-table-column>
</mb-table-column>
<el-empty :description="emptyText" slot="empty" />
@ -37,11 +37,11 @@
<script>
import request from '@/scripts/request'
import Pagination from '@/components/Pagination'
import PdTableColumn from './pd-table-column.vue'
import MbTableColumn from './mb-table-column.vue'
export default {
name: 'PdTable',
components: { Pagination, PdTableColumn },
name: 'MbTable',
components: { Pagination, MbTableColumn },
props: {
el: {
type: Object,

View File

@ -25,7 +25,7 @@
<script>
export default {
name: 'PdTree',
name: 'MbTree',
props: {
url: {
type: String,

View File

@ -1,12 +1,12 @@
<template>
<vue-ueditor-wrap v-model="content" :config="editorConfig" editor-id="pd-ueditor" />
<vue-ueditor-wrap v-model="content" :config="editorConfig" editor-id="mb-ueditor" />
</template>
<script>
import VueUeditorWrap from 'vue-ueditor-wrap'
export default {
name: 'PdUeditor',
name: 'MbUeditor',
components: {
VueUeditorWrap
},

View File

@ -22,7 +22,7 @@
<script>
import { getToken } from '@/scripts/auth'
export default {
name: 'PdUploadFile',
name: 'MbUploadFile',
model: {
prop: 'value',
event: 'change'

View File

@ -51,7 +51,7 @@
</i>
</el-upload>
</vuedraggable>
<pd-dialog :visible.sync="cropperDialogVisible" @confirm-click="cropper">
<mb-dialog :visible.sync="cropperDialogVisible" @confirm-click="cropper">
<template #content>
<div class="cropper-content">
<div class="cropper" style="text-align:center">
@ -68,7 +68,7 @@
</div>
</div>
</template>
</pd-dialog>
</mb-dialog>
</div>
</template>
@ -78,7 +78,7 @@ import vuedraggable from 'vuedraggable'
import { getToken } from '@/scripts/auth'
export default {
name: 'PdUploadImage',
name: 'MbUploadImage',
components: { vuedraggable, VueCropper },
model: {
prop: 'value',

View File

@ -48,7 +48,7 @@ Vue.component('vuedraggable', vuedraggable)
const requireComponent = require.context(
// 其组件目录的相对路径
'@/components/Psyduck/',
'@/components/MagicBoot/',
// 是否查询其子目录
true,
// 匹配基础组件文件名的正则表达式

View File

@ -20,7 +20,7 @@
<el-checkbox-group v-else-if="col.type === 'checkboxGroup'" v-model="temp[col.name]" size="small">
<el-checkbox v-for="checkboxIt in temp['_'+col.name]" :key="checkboxIt[col.defaultValue.value]" :label="checkboxIt[col.defaultValue.value]">{{ checkboxIt[col.defaultValue.text] }}</el-checkbox>
</el-checkbox-group>
<pd-select v-else-if="col.type === 'select'" v-model="temp[col.name]" v-bind="col.el" />
<mb-select v-else-if="col.type === 'select'" v-model="temp[col.name]" v-bind="col.el" />
<el-input v-else v-model="temp[col.name]" :type="col.type" :value="col.defaultValue" />
</el-form-item>
</el-col>

View File

@ -4,7 +4,7 @@
<el-form :inline="true">
<el-form-item v-for="col in queryOptions.cols" :key="col.field" :label="col.title">
<el-input v-if="col.type === 'input'" v-model="tableOptions.where[col.field]" v-bind="col.el" :placeholder="'请输入'+col.title" :style="col.style" />
<pd-select v-else-if="col.type === 'select'" v-model="tableOptions.where[col.field]" v-bind="col.el" width="100%" />
<mb-select v-else-if="col.type === 'select'" v-model="tableOptions.where[col.field]" v-bind="col.el" width="100%" />
</el-form-item>
<el-form-item v-for="(btn, i) in queryOptions.btns" :key="i">
<el-button v-if="btn.type == 'query'" class="filter-item" type="primary" icon="el-icon-search" @click="reloadTable">
@ -24,7 +24,7 @@
<el-button v-if="btn.btnType == 'add'" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">
添加
</el-button>
<pd-button
<mb-button
v-else
:el="btn.el || {}"
:request-url="btn.request.url"
@ -41,13 +41,13 @@
<hr>
</template>
<pd-table ref="table" v-bind="tableOptions" @selection-change="selectionChange" />
<mb-table ref="table" v-bind="tableOptions" @selection-change="selectionChange" />
<pd-dialog :params="formParams" v-bind="formConfig && formConfig.dialog" :visible.sync="dialogFormVisible" @confirm-click="$refs.inputForm.save()">
<mb-dialog :params="formParams" v-bind="formConfig && formConfig.dialog" :visible.sync="dialogFormVisible" @confirm-click="$refs.inputForm.save()">
<template #content>
<common-form ref="inputForm" v-bind="formConfig" :visible.sync="dialogFormVisible" :dialog-status="dialogStatus" @reload-table="reloadTable" />
</template>
</pd-dialog>
</mb-dialog>
</div>
</template>

View File

@ -1,7 +1,7 @@
<template>
<div style="padding: 50px;">
<el-button type="primary" @click="getData" style="margin-bottom: 10px">获取数据</el-button>
<pd-editor-table v-model="tableDatas" :cols="cols" :show-no="false" />
<mb-editor-table v-model="tableDatas" :cols="cols" :show-no="false" />
</div>
</template>

View File

@ -2,7 +2,7 @@
<div style="padding: 50px;">
<h2>多选</h2>
<el-button type="primary" @click="getData" style="margin-bottom: 10px">获取数据</el-button>
<pd-select v-model="dictType" type="dict_type" :el="{ multiple: true }" />
<mb-select v-model="dictType" type="dict_type" :el="{ multiple: true }" />
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div>
<pd-ueditor v-model="content" />
<mb-ueditor v-model="content" />
<button @click="getContent">获取内容</button>
</div>
</template>

View File

@ -1,13 +1,13 @@
<template>
<div style="padding: 50px;">
<h2>上传文件</h2>
<pd-upload-file v-model="fileUrl" @change="fileChange" />
<mb-upload-file v-model="fileUrl" @change="fileChange" />
<h2>上传图片id</h2>
<pd-upload-image :external-id="externalId" multiple :external-type="externalType" />
<mb-upload-image :external-id="externalId" multiple :external-type="externalType" />
<h2>上传图片url单图</h2>
<pd-upload-image v-model="imgUrl" @change="imgChange" />
<mb-upload-image v-model="imgUrl" @change="imgChange" />
<h2>上传图片url多图</h2>
<pd-upload-image v-model="multipleImgUrl" width="120" height="120" multiple :limit="3" @change="multipleImgChange" />
<mb-upload-image v-model="multipleImgUrl" width="120" height="120" multiple :limit="3" @change="multipleImgChange" />
</div>
</template>

View File

@ -17,9 +17,9 @@
</el-form>
</div>
<pd-table ref="table" v-bind="tableOptions" />
<mb-table ref="table" v-bind="tableOptions" />
<pd-dialog ref="formDialog" :title="dialogTitle" width="700px" @confirm-click="save">
<mb-dialog ref="formDialog" :title="dialogTitle" width="700px" @confirm-click="save">
<template #content>
<el-form ref="dataForm" :inline="true" :rules="rules" :model="temp" label-position="right" label-width="100px" style="margin-left: 20px">
<el-form-item label="标签名" prop="label">
@ -36,7 +36,7 @@
</el-form-item>
</el-form>
</template>
</pd-dialog>
</mb-dialog>
</div>
</template>

View File

@ -6,7 +6,7 @@
<el-input v-model="tableOptions.where.type" placeholder="请输入类型" style="width: 200px;" class="filter-item" />
</el-form-item>
<el-form-item label="字典类型">
<pd-select v-model="tableOptions.where.dictType" :all-option="true" type="dict_type" width="185px" />
<mb-select v-model="tableOptions.where.dictType" :all-option="true" type="dict_type" width="185px" />
</el-form-item>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="reloadTable">
搜索
@ -17,13 +17,13 @@
</el-form>
</div>
<pd-table ref="table" v-bind="tableOptions" />
<mb-table ref="table" v-bind="tableOptions" />
<pd-dialog ref="dictDialog" :title="dialogTitle" width="700px" @confirm-click="save()">
<mb-dialog ref="dictDialog" :title="dialogTitle" width="700px" @confirm-click="save()">
<template #content>
<el-form ref="dataForm" :inline="true" :rules="rules" :model="temp" label-position="right" label-width="100px" style="margin-left: 20px">
<el-form-item label="字典类型" prop="dictType">
<pd-select v-model="temp.dictType" type="dict_type" width="185px" />
<mb-select v-model="temp.dictType" type="dict_type" width="185px" />
</el-form-item>
<el-form-item label="类型" prop="type">
<el-input v-model="temp.type" />
@ -39,13 +39,13 @@
</el-form-item>
</el-form>
</template>
</pd-dialog>
</mb-dialog>
<pd-dialog ref="dictItemsDialog" title="字典项" width="1400px">
<mb-dialog ref="dictItemsDialog" title="字典项" width="1400px">
<template #content>
<dict-items :dict-id.sync="dictId" />
</template>
</pd-dialog>
</mb-dialog>
</div>
</template>

View File

@ -66,11 +66,11 @@
</el-col>
</el-row>
</el-form>
<pd-dialog ref="iconDialog">
<mb-dialog ref="iconDialog">
<template #content>
<menu-icons :select-icon="selectIcon" />
</template>
</pd-dialog>
</mb-dialog>
</div>
</template>

View File

@ -22,13 +22,13 @@
<el-button type="primary" icon="el-icon-sort" plain @click="expand">展开/折叠</el-button>
</el-row>
<pd-table ref="table" v-bind="tableOptions" v-if="menuData && menuData.length > 0 && refreshTable" />
<mb-table ref="table" v-bind="tableOptions" v-if="menuData && menuData.length > 0 && refreshTable" />
<pd-dialog ref="menuFormDialog" width="1050px" :title="dialogTitle" @confirm-click="$refs.menuForm.save()">
<mb-dialog ref="menuFormDialog" width="1050px" :title="dialogTitle" @confirm-click="$refs.menuForm.save()">
<template #content>
<menu-form ref="menuForm" :menu-tree="menuTree" @reload-table="reloadTable" />
</template>
</pd-dialog>
</mb-dialog>
</div>
</template>

View File

@ -28,15 +28,15 @@
<el-button type="primary" icon="el-icon-sort" plain @click="expand">展开/折叠</el-button>
</el-row>
<pd-table ref="table" v-bind="tableOptions" v-if="officeData && officeData.length > 0 && refreshTable" />
<mb-table ref="table" v-bind="tableOptions" v-if="officeData && officeData.length > 0 && refreshTable" />
<pd-dialog ref="officeFormDialog" width="1050px" :title="dialogTitle" @confirm-click="save()">
<mb-dialog ref="officeFormDialog" width="1050px" :title="dialogTitle" @confirm-click="save()">
<template #content>
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="right" label-width="80px" style="width: 900px; margin-left:50px;">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="机构类型" prop="type">
<pd-select v-model="temp.type" type="office_type" width="100%" />
<mb-select v-model="temp.type" type="office_type" width="100%" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -66,7 +66,7 @@
</el-row>
</el-form>
</template>
</pd-dialog>
</mb-dialog>
</div>
</template>

View File

@ -1,5 +1,5 @@
<template>
<pd-tree ref="tree" :el="{ 'show-checkbox': true }" url="menu/tree" :search="true" search-width="230px" :select-values.sync="menus" />
<mb-tree ref="tree" :el="{ 'show-checkbox': true }" url="menu/tree" :search="true" search-width="230px" :select-values.sync="menus" />
</template>
<script>

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form :inline="true">
<el-form :inline="true" @keyup.enter.native="reloadTable">
<el-form-item label="角色名称">
<el-input v-model="tableOptions.where.name" placeholder="请输入角色名称" style="width: 200px;" class="filter-item" />
</el-form-item>
@ -20,9 +20,9 @@
</el-button>
</el-row>
<pd-table ref="table" v-bind="tableOptions" />
<mb-table ref="table" v-bind="tableOptions" />
<pd-dialog ref="roleFormDialog" :title="dialogTitle" width="1000px" @confirm-click="save()">
<mb-dialog ref="roleFormDialog" :title="dialogTitle" width="1000px" @confirm-click="save()">
<template #content>
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="right" label-width="120px" style="width: 900px;">
<el-row :gutter="24">
@ -52,25 +52,25 @@
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="菜单权限" prop="menus">
<pd-tree ref="tree" :el="{ 'show-checkbox': true }" max-height="320px" url="menu/tree" :search="true" :select-values.sync="temp.menus" />
<mb-tree ref="tree" :el="{ 'show-checkbox': true }" max-height="320px" url="menu/tree" :search="true" :select-values.sync="temp.menus" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数据权限" prop="permission">
<pd-select v-model="temp.permission" :data="permissionData" />
<pd-tree v-if="temp.permission == 1" max-height="320px" :el="{ 'check-strictly': true, 'show-checkbox': true }" ref="office" url="office/tree" :select-values.sync="temp.offices" />
<mb-select v-model="temp.permission" :data="permissionData" />
<mb-tree v-if="temp.permission == 1" max-height="320px" :el="{ 'check-strictly': true, 'show-checkbox': true }" ref="office" url="office/tree" :select-values.sync="temp.offices" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
</pd-dialog>
</mb-dialog>
<pd-dialog ref="assignPermissionsDialog" title="分配权限" width="750" @confirm-click="$refs.assignPermissions.save()">
<mb-dialog ref="assignPermissionsDialog" title="分配权限" width="750" @confirm-click="$refs.assignPermissions.save()">
<template #content>
<role-assign-permissions ref="assignPermissions" :key="Math.random()" :id="temp.id" @close="() => { $refs.assignPermissionsDialog.hide(); temp.id = '' }" />
</template>
</pd-dialog>
</mb-dialog>
</div>
</template>

View File

@ -8,7 +8,7 @@
</el-form>
</div>
<pd-table ref="table" v-bind="tableOptions" />
<mb-table ref="table" v-bind="tableOptions" />
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="700px">
<el-form ref="dataForm" :inline="true" :model="temp" label-position="right" label-width="100px" style="margin-left: 20px">

View File

@ -32,7 +32,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="选择角色" prop="roles">
<pd-select v-model="temp.roles" url="role/list?size=999999" labelField="name" valueField="id" :el="{ multiple: true }" />
<mb-select v-model="temp.roles" url="role/list?size=999999" labelField="name" valueField="id" :el="{ multiple: true }" />
</el-form-item>
</el-col>
</el-row>

View File

@ -13,11 +13,11 @@
<template>
<div class="app-container">
<div class="left">
<pd-tree url="office/tree" :el="{ 'expand-on-click-node': false,'show-checkbox': true }" :expand="false" :search="true" search-width="100%" :checked="false" @check-change="checkChange" />
<mb-tree url="office/tree" :el="{ 'expand-on-click-node': false,'show-checkbox': true }" :expand="false" :search="true" search-width="100%" :checked="false" @check-change="checkChange" />
</div>
<div class="right">
<div class="filter-container">
<el-form :inline="true">
<el-form :inline="true" @keyup.enter.native="reloadTable">
<el-form-item label="登录名称">
<el-input v-model="tableOptions.where.username" placeholder="登录名称" style="width: 200px;" class="filter-item" />
</el-form-item>
@ -40,16 +40,16 @@
<el-button v-permission="'user:save'" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">
添加
</el-button>
<pd-button :el="{ plain: true }" :request-url="'user/delete'" :btn-type="'delete'" :request-data="{ id: ids }" :after-handler="reloadTable" />
<mb-button :el="{ plain: true }" :request-url="'user/delete'" :btn-type="'delete'" :request-data="{ id: ids }" :after-handler="reloadTable" />
</el-row>
<pd-table ref="table" v-bind="tableOptions" @selection-change="selectionChange" />
<mb-table ref="table" v-bind="tableOptions" @selection-change="selectionChange" />
<pd-dialog ref="userFormDialog" :title="dialogTitle" @confirm-click="$refs.userForm.save()" width="770px">
<mb-dialog ref="userFormDialog" :title="dialogTitle" @confirm-click="$refs.userForm.save()" width="770px">
<template #content>
<user-form ref="userForm" :dialog-status="dialogTitle" @reload-table="reloadTable" />
</template>
</pd-dialog>
</mb-dialog>
</div>
<div class="clear"></div>
@ -59,11 +59,10 @@
<script>
import UserForm from './user-form.vue'
import PdTree from "@/components/Psyduck/pd-tree";
export default {
name: 'UserList',
components: {PdTree, UserForm },
components: { UserForm },
data() {
return {
tableOptions: {