|
@@ -1,17 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-table
|
|
|
- ref="moduleTable"
|
|
|
- :data="moduleData"
|
|
|
- style="width: 100%;margin-bottom: 20px;"
|
|
|
- row-key="id"
|
|
|
- border
|
|
|
- :tree-props="{children: 'childModules', hasChildren: 'hasChildren'}"
|
|
|
- header-align="center"
|
|
|
- size="mini"
|
|
|
- :header-cell-style="{ background: '#F2F3F6' }"
|
|
|
- fit
|
|
|
- >
|
|
|
+ <el-table ref="moduleTable" :data="moduleData" style="width: 100%;margin-bottom: 20px;" row-key="id" border :tree-props="{children: 'childModules', hasChildren: 'hasChildren'}" header-align="center" size="mini" :header-cell-style="{ background: '#F2F3F6' }" fit>
|
|
|
<el-table-column v-if="false" prop="id" label="ID" width="180" align="center" />
|
|
|
<el-table-column prop="moduleName" label="模块名称">
|
|
|
<template slot="header">
|
|
@@ -28,6 +17,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+
|
|
|
<el-dialog :title="moduleTitle" :visible.sync="moduleDialog" width="30%" :before-close="() => {moduleDialog = false}">
|
|
|
<el-form ref="moduleForm" :model="moduleForm">
|
|
|
<template v-if="curcentModule === 'add'">
|
|
@@ -67,6 +57,10 @@
|
|
|
是否要删除模块:<span style="color: #E6A23C">{{ moduleForm.moduleNames[0] }}</span>
|
|
|
</el-col>
|
|
|
</el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="moduleDialog = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmModule('moduleForm')">确 定</el-button>
|
|
|
+ </span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -116,6 +110,34 @@ export default {
|
|
|
} else {
|
|
|
this.moduleDialog = true
|
|
|
}
|
|
|
+ },
|
|
|
+ addModuleForm() {
|
|
|
+ if (this.moduleForm.moduleNames.length <= 4) {
|
|
|
+ this.moduleForm.moduleNames.push(null)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmModule(formName) { // 模块操作确认
|
|
|
+ if (this.curcentModule === 'add') {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.addModule(this.moduleForm)
|
|
|
+ } else {
|
|
|
+ this.$message({ message: '填写格式不正确', type: 'error' })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (this.curcentModule === 'edit') {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.updataModule(this.moduleForm)
|
|
|
+ } else {
|
|
|
+ this.$message({ message: '填写格式不正确', type: 'error' })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (this.curcentModule === 'delete') {
|
|
|
+ this.deleteModule(this.moduleForm)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|