增加文档部分功能
This commit is contained in:
parent
babaf8f430
commit
ac1daa1a79
58
src/api/model/docs.js
Normal file
58
src/api/model/docs.js
Normal file
@ -0,0 +1,58 @@
|
||||
import config from "@/config";
|
||||
import http from "@/utils/request";
|
||||
|
||||
export default {
|
||||
manager:{
|
||||
upload: {
|
||||
url: `${config.API_URL}/document.upload`,
|
||||
name: "上传文档",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
add: {
|
||||
url: `${config.API_URL}/document.folder.add`,
|
||||
name: "新建文件夹",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
list: {
|
||||
url: `${config.API_URL}/document.folder.list`,
|
||||
name: "文件、文件夹列表",
|
||||
get: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
deleteFolder: {
|
||||
url: `${config.API_URL}/document.folder.delete`,
|
||||
name: "删除文件夹",
|
||||
post: async function () {
|
||||
return await http.post(this.url);
|
||||
},
|
||||
},
|
||||
deleteFile: {
|
||||
url: `${config.API_URL}/document.file.delete`,
|
||||
name: "删除文件",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
},
|
||||
share:{
|
||||
add: {
|
||||
url: `${config.API_URL}/document.file.delete`,
|
||||
name: "共享文件、文件夹",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
list: {
|
||||
url: `${config.API_URL}/document.share.list`,
|
||||
name: "共享文件、文件夹列表",
|
||||
get: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
13
src/assets/icons/Excel.vue
Normal file
13
src/assets/icons/Excel.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1721820632587" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3831" width="200" height="200"><path d="M175.8208 51.2A73.728 73.728 0 0 0 102.4 124.6208v774.7584A73.728 73.728 0 0 0 175.8208 972.8h659.5584a73.728 73.728 0 0 0 73.4208-73.4208V343.5008L636.6208 51.2h-460.8z" fill="#45B058" p-id="3832"></path><path d="M381.696 827.392a11.008 11.008 0 0 1-7.168-2.9184l-53.3504-71.9872-54.6816 71.9872a11.008 11.008 0 0 1-7.168 2.8672 9.8304 9.8304 0 0 1-10.1376-10.0352c0-1.4848 0-4.352 1.4336-5.7856l56.1664-73.4208-51.8144-70.6048c-1.4336-1.4336-2.9184-2.8672-2.9184-5.7344 0-4.3008 4.352-10.0864 10.0864-10.0864 4.352 0 7.168 1.4336 8.704 4.352l50.3296 66.2016 48.9984-66.2016a7.936 7.936 0 0 1 7.168-4.352c5.7856 0 11.52 4.352 11.52 10.0864 0 2.8672-1.4336 4.3008-1.4336 5.7344l-53.248 69.12 56.1152 74.9056a10.9056 10.9056 0 0 1 2.9184 5.7856c0 5.7344-5.7856 10.0352-11.52 10.0352z m143.9744-1.4848H447.8976a15.9744 15.9744 0 0 1-15.8208-15.872v-148.2752c0-5.7856 4.3008-10.0864 11.52-10.0864 5.7856 0 10.0864 4.352 10.0864 10.0864v145.408h71.9872c5.7856 0 10.0864 4.352 10.0864 8.704a9.8304 9.8304 0 0 1-10.0864 10.0352z m100.8128 2.8672c-25.9072 0-46.08-8.6016-60.4672-21.5552-2.9184-1.4336-2.9184-4.352-2.9184-7.2192 0-5.7856 2.9184-11.52 10.0864-11.52 1.4336 0 4.352 1.4336 5.7856 2.8672 11.52 10.0864 28.7744 18.7392 48.9472 18.7392 30.208 0 40.3456-17.3056 40.3456-30.208 0-44.6976-102.2464-20.1728-102.2464-80.6912 0-28.7744 24.4736-48.9472 59.0336-48.9472 21.6064 0 41.728 7.168 54.7328 18.7392a7.936 7.936 0 0 1 4.3008 7.168c0 5.7856-4.3008 11.52-10.0864 11.52a10.9056 10.9056 0 0 1-5.7344-2.8672 71.936 71.936 0 0 0-44.6464-14.3872c-21.6064 0-35.9936 10.0864-35.9936 27.3408 0 38.912 102.1952 15.872 102.1952 80.64 0 24.4736-17.2544 50.432-63.3344 50.432z" fill="#FFFFFF" p-id="3833"></path><path d="M908.8 344.9344v14.4384h-184.32s-92.16-18.7392-89.2928-97.9456c0 0 2.8672 83.5072 86.3744 83.5072h187.1872z" fill="#349C42" p-id="3834"></path><path d="M635.1872 51.2v210.2272c0 23.04 17.3056 83.5072 89.2928 83.5072h184.32L635.1872 51.2z" fill="#FFFFFF" opacity=".5" p-id="3835"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Excel"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
13
src/assets/icons/Folder.vue
Normal file
13
src/assets/icons/Folder.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1721820601828" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3541" width="200" height="200"><path d="M918.6816 882.9952H104.3456c-21.76 0-39.3216-15.616-39.3216-34.9696V276.992c0-19.3536 17.5616-34.9696 39.3216-34.9696h814.336c21.76 0 39.3216 15.616 39.3216 34.9696v571.0336c0 19.2512-17.664 34.9696-39.3216 34.9696z" fill="#FFE9B4" p-id="3542"></path><path d="M512 410.9824H65.024V210.432c0-21.76 17.5616-39.424 39.3216-39.424h305.9712c17.408 0 32.6656 11.3664 37.632 28.0576L512 410.9824z" fill="#FFB02C" p-id="3543"></path><path d="M918.6816 882.9952H104.3456a39.2704 39.2704 0 0 1-39.3216-39.3216V335.3088c0-21.7088 17.5616-39.3216 39.3216-39.3216h814.336c21.76 0 39.3216 17.6128 39.3216 39.3216v508.3648a39.424 39.424 0 0 1-39.3216 39.3216z" fill="#FFCA28" p-id="3544"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Folder"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
13
src/assets/icons/Pdf.vue
Normal file
13
src/assets/icons/Pdf.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1721820622012" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3686" width="200" height="200"><path d="M178.9952 64h468.48l223.0272 225.4848v645.5296c0 13.824-11.2128 24.9856-24.9856 24.9856H178.9952a24.9856 24.9856 0 0 1-24.9856-24.9856V88.9856c0-13.824 11.1616-24.9856 24.9856-24.9856z" fill="#FF4867" p-id="3687"></path><path d="M647.4752 64v200.4992c0 13.824 11.264 24.9856 25.0368 24.9856h197.9904L647.5264 64z" fill="#FF97A9" p-id="3688"></path><path d="M691.9168 812.032c-44.3904 0-84.224-76.2368-105.1648-125.7472a734.0032 734.0032 0 0 0-111.8208-37.376c-33.024 21.8112-89.2416 54.4256-132.4032 54.4256-26.7776 0-46.08-13.4656-53.0944-36.864-5.4272-19.3536-0.8704-32.6656 4.9664-39.8848 11.3664-15.5136 34.816-23.4496 69.9392-23.4496 28.416 0 64.512 5.0176 104.7552 14.6944 25.9584-18.432 52.3264-39.7824 75.776-62.464-10.4448-49.3568-21.8112-129.4336 7.0656-166.4 14.2848-17.5616 36.0448-23.3984 62.464-15.5136 28.8256 8.3456 39.7824 25.9584 43.1104 39.8336 12.1856 48.128-43.1616 113.152-80.4864 151.296 8.3456 33.024 19.3024 67.84 32.6144 99.7376 53.5552 23.9104 117.248 59.5456 124.416 98.4064 2.9696 13.4656-1.2288 25.9584-12.1856 36.9152-9.4208 7.7824-19.4048 12.3392-29.952 12.3392z m-39.936-84.0192c9.7792 21.7088 19.0976 32 24.0128 32 0.768 0 1.8432-0.3584 3.328-1.6896 1.8432-1.9968 1.8432-3.328 1.536-4.5568-1.024-5.6832-9.2672-15.0528-28.8768-25.7536zM370.0736 640c-15.616 0-19.9168 3.7888-21.1968 5.5296-0.4096 0.5632-1.536 2.2528-0.4096 6.656 0.9728 3.7888 3.584 7.8336 11.6736 7.8336 10.1376 0 24.832-5.7344 41.8816-15.9744a150.9376 150.9376 0 0 0-31.9488-4.0448z m152.9344-19.456c9.3184 2.6624 18.9952 5.9904 28.0064 9.472a252.0064 252.0064 0 0 1-8.192-26.0096c-6.4512 5.632-13.1072 11.1616-19.8144 16.5888z m65.9456-187.5456a9.8304 9.8304 0 0 0-7.7312 3.5328c-6.144 7.7824-6.8608 27.3408-2.0992 52.48 18.1248-19.456 27.9552-37.2736 25.4976-46.848-0.3584-1.3824-1.3824-5.632-9.8304-8.0896a19.8144 19.8144 0 0 0-5.8368-1.0752z" fill="#FFFFFF" p-id="3689"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Pdf"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -28,6 +28,9 @@ export { default as AgentMaintenance } from './AgentMaintenance.vue'
|
||||
export { default as CostAllocation } from './CostAllocation.vue'
|
||||
export { default as DataSource } from './DataSource.vue'
|
||||
export { default as MachineRoom } from './MachineRoom.vue'
|
||||
export { default as Folder } from './Folder.vue'
|
||||
export { default as Pdf } from './Pdf.vue'
|
||||
export { default as Excel } from './Excel.vue'
|
||||
|
||||
// 列表按钮
|
||||
export { default as Delete } from './Delete.vue'
|
||||
|
||||
@ -95,6 +95,7 @@
|
||||
hideRefresh: { type: Boolean, default: false },
|
||||
hideSetting: { type: Boolean, default: false },
|
||||
paginationLayout: { type: String, default: config.paginationLayout },
|
||||
rowChild:{type:Boolean, default:true}
|
||||
},
|
||||
watch: {
|
||||
//监听从props里拿到值了
|
||||
@ -210,7 +211,16 @@
|
||||
if(this.hidePagination){
|
||||
this.tableData = response.data || [];
|
||||
}else{
|
||||
this.tableData = response.rows || [];
|
||||
if(!this.rowChild){
|
||||
response.rows.forEach(item=>{
|
||||
item.data = item.children;
|
||||
delete item.children
|
||||
})
|
||||
this.tableData = response.rows || [];
|
||||
console.log('数据处理')
|
||||
}else{
|
||||
this.tableData = response.rows || [];
|
||||
}
|
||||
}
|
||||
if(response.data.columnConfig){
|
||||
this.userColumn = response.data.columnConfig; // 表头获取
|
||||
|
||||
43
src/style/docs.scss
Normal file
43
src/style/docs.scss
Normal file
@ -0,0 +1,43 @@
|
||||
.docsRow{
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
::v-deep .el-col{
|
||||
padding: 0 !important;
|
||||
}
|
||||
}
|
||||
.docsHeaderMain{
|
||||
height: 48px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.docsHeader{
|
||||
width: 100%;
|
||||
display: flex;align-items: center;
|
||||
.arrowBox{
|
||||
display: flex;align-items: center;justify-content: center;
|
||||
background: #EFF3FB;height: 28px;
|
||||
border-radius: 4px;padding: 2px 0;
|
||||
.item{
|
||||
padding: 0 12px;
|
||||
height: 100%;
|
||||
display: flex;align-items: center;justify-content: center;
|
||||
}
|
||||
.leftArrow{border-right: 1px solid #f9f9f9;}
|
||||
.rightArrow{border-left: 1px solid #f9f9f9;}
|
||||
}
|
||||
.refreshBox{
|
||||
margin-left: 12px;
|
||||
padding: 0 12px;
|
||||
background: #EFF3FB;height: 28px;
|
||||
border-radius: 4px;
|
||||
display: flex;align-items: center;justify-content: center;
|
||||
}
|
||||
.breadcrumb{
|
||||
flex: 1;
|
||||
margin:0 12px;
|
||||
height: 28px;
|
||||
padding: 0 10px;
|
||||
border-radius: 4px;
|
||||
display: flex;align-items: center;
|
||||
border:1px solid #f3f3f3;
|
||||
}
|
||||
}
|
||||
@ -5,3 +5,4 @@
|
||||
@import 'dark.scss';
|
||||
@import 'home.scss';
|
||||
@import 'user.scss';
|
||||
@import 'docs.scss';
|
||||
|
||||
@ -1,9 +1,44 @@
|
||||
<template>
|
||||
<el-container class="mainHeaderNoPadding">
|
||||
<el-header class="docsHeaderMain">
|
||||
<el-row class="docsRow">
|
||||
<el-col :span="20">
|
||||
<div class="docsHeader">
|
||||
<div class="arrowBox">
|
||||
<div class="item leftArrow"><el-icon><el-icon-ArrowLeftBold/></el-icon></div>
|
||||
<div class="item rightArrow"><el-icon><el-icon-ArrowRightBold/></el-icon></div>
|
||||
</div>
|
||||
<div class="refreshBox">
|
||||
<el-icon><el-icon-RefreshLeft/></el-icon>
|
||||
</div>
|
||||
<div class="breadcrumb">
|
||||
<el-breadcrumb separator-icon="el-icon-ArrowRight">
|
||||
<el-breadcrumb-item>我的文档</el-breadcrumb-item>
|
||||
<!-- <el-breadcrumb-item>固本</el-breadcrumb-item>-->
|
||||
<!-- <el-breadcrumb-item>中学</el-breadcrumb-item>-->
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-input type="text" :size="size" prefix-icon="el-icon-Search" placeholder="搜索"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
<el-button :size="size" plain icon="el-icon-plus" @click="permission">上传</el-button>
|
||||
<el-dropdown>
|
||||
<el-button type="primary" :size="size">新建文档</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="table_show('see')" icon="sc-icon-See">查看详情</el-dropdown-item>
|
||||
<el-dropdown-item @click="table_edit('edit')" icon="sc-icon-Edit">编辑公司</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新建文档</el-button>
|
||||
<el-button type="primary" :size="size" plain @click="permission">上传</el-button>
|
||||
<el-button type="primary" :size="size" plain @click="permission">操作</el-button>
|
||||
<el-button type="danger" :size="size" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
@ -11,49 +46,48 @@
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe>
|
||||
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" @selection-change="selectionChange" stripe :rowChild="false">
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<el-table-column label="工单号" prop="order_sn" width="150"></el-table-column>
|
||||
<el-table-column label="别名" prop="alias" width="200"></el-table-column>
|
||||
<el-table-column label="排序" prop="sort" width="80"></el-table-column>
|
||||
<el-table-column label="状态" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.status" @change="changeSwitch($event, scope.row)" :loading="scope.row.$switch_status" :active-value="true" :inactive-value="false"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="date" width="180"></el-table-column>
|
||||
<el-table-column label="备注" prop="remark" min-width="150"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="right" width="170">
|
||||
<template #default="scope">
|
||||
<el-button-group>
|
||||
<el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看</el-button>
|
||||
<el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
||||
<template #reference>
|
||||
<el-button text type="primary" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</el-button-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #name="scope">
|
||||
<div class="nameBox" v-if="scope.row.type == 'folder'">
|
||||
<el-icon size="large"><sc-icon-Folder/></el-icon>
|
||||
<div class="text">{{scope.row.name}}</div>
|
||||
</div>
|
||||
<div class="nameBox" v-else>
|
||||
<el-icon size="large"><sc-icon-Excel/></el-icon>
|
||||
<div class="text">{{scope.row.file_name}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #size="scope">
|
||||
<span v-if="scope.row.type == 'folder'"></span>
|
||||
<span v-else>{{scope.row.file_size}}KB</span>
|
||||
</template>
|
||||
<template #type="scope">
|
||||
<span v-if="scope.row.type == 'folder'">文件夹</span>
|
||||
<span v-else>
|
||||
{{scope.row.file_suffix}}文件
|
||||
</span>
|
||||
</template>
|
||||
<template #is_share="scope">
|
||||
{{scope.row.is_share?'是':'否'}}
|
||||
</template>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
<!-- <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>-->
|
||||
|
||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
|
||||
<!-- <permission-dialog v-if="dialog.permission" ref="permissionDialog" @closed="dialog.permission=false"></permission-dialog>-->
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import saveDialog from './save'
|
||||
import saveDialog from './save'
|
||||
// import permissionDialog from './permission'
|
||||
|
||||
export default {
|
||||
name: 'document',
|
||||
components: {
|
||||
// saveDialog,
|
||||
saveDialog,
|
||||
// permissionDialog
|
||||
},
|
||||
data() {
|
||||
@ -63,9 +97,10 @@ export default {
|
||||
save: false,
|
||||
permission: false
|
||||
},
|
||||
apiObj: [
|
||||
{},{},{}
|
||||
],
|
||||
list:{
|
||||
apiObj: this.$API.docs.manager.list,
|
||||
column:[]
|
||||
},
|
||||
selection: [],
|
||||
search: {
|
||||
keyword: null
|
||||
@ -103,8 +138,8 @@ export default {
|
||||
},
|
||||
//删除
|
||||
async table_del(row){
|
||||
var reqData = {id: row.id}
|
||||
var res = await this.$API.demo.post.post(reqData);
|
||||
const reqData = {id: row.id};
|
||||
const res = await this.$API.demo.post.post(reqData);
|
||||
if(res.code == 200){
|
||||
this.$refs.table.refresh()
|
||||
this.$message.success("删除成功")
|
||||
@ -170,5 +205,14 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.nameBox{
|
||||
display: flex;align-items: center;
|
||||
cursor: pointer;
|
||||
.el-icon{
|
||||
margin-right: 8px;
|
||||
}
|
||||
.text{
|
||||
overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
89
src/views/docsManager/save.vue
Normal file
89
src/views/docsManager/save.vue
Normal file
@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<el-dialog :title="titleMap[mode]" v-model="visible" :width="500" draggable destroy-on-close @closed="$emit('closed')">
|
||||
<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="120px" label-position="right">
|
||||
<el-form-item label="角色名称" prop="role_name">
|
||||
<el-input v-model="form.role_name" placeholder="请填写角色名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="active_status">
|
||||
<el-switch v-model="form.active_status" :active-value="true" :inactive-value="false"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" clearable type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="visible=false" >取 消</el-button>
|
||||
<el-button v-if="mode!='show'" type="primary" :loading="isSave" @click="submit()">保 存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
emits: ['success', 'closed'],
|
||||
data() {
|
||||
return {
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: '新增',
|
||||
edit: '编辑',
|
||||
show: '查看'
|
||||
},
|
||||
visible: false,
|
||||
isSave: false,
|
||||
//表单数据
|
||||
form: {
|
||||
id:"",
|
||||
role_name: "",
|
||||
active_status: true,
|
||||
remark: ""
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
role_name: [
|
||||
{required: true, message: '请输入角色名称'}
|
||||
],
|
||||
active_status: [
|
||||
{required: true,}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
open(mode='add'){
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this
|
||||
},
|
||||
//表单提交方法
|
||||
submit(){
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSave = true;
|
||||
const res = await this.$API.system.role.add.post(this.form);
|
||||
this.isSave = false;
|
||||
if(res.code == 200){
|
||||
this.$emit('success', this.form, this.mode)
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功")
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data){
|
||||
this.form.id = data.id
|
||||
this.form.role_name = data.role_name
|
||||
this.form.active_status = data.active_status
|
||||
this.form.remark = data.remark
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user