|
@@ -13,7 +13,7 @@
|
|
|
label-width="150px"
|
|
|
:rules="rules"
|
|
|
>
|
|
|
- <el-form-item label="菜单权限:" prop="aaa">
|
|
|
+ <el-form-item label="" prop="aaa">
|
|
|
<!-- <div>
|
|
|
<el-checkbox
|
|
|
v-model="checked1"
|
|
@@ -30,16 +30,20 @@
|
|
|
:props="defaultProps"
|
|
|
@node-click="handleNodeClick"
|
|
|
show-checkbox
|
|
|
+ node-key="id"
|
|
|
:default-expand-all="isExpand"
|
|
|
+ :default-checked-keys="checkedArr"
|
|
|
:check-strictly="isStrictly"
|
|
|
/>
|
|
|
|
|
|
<br />
|
|
|
|
|
|
- <div style="text-align: right">
|
|
|
- <el-button @click="closeDialog(0)">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm(formInfo)">保存</el-button>
|
|
|
- </div>
|
|
|
+ <div style="text-align: right">
|
|
|
+ <el-button @click="closeDialog(0)">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm(formInfo)">
|
|
|
+ 保存
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
@@ -48,7 +52,7 @@
|
|
|
<script>
|
|
|
import { useStore } from 'vuex'
|
|
|
import { defineComponent, ref, watchEffect, watch, onMounted } from 'vue'
|
|
|
-import * as api from '@/api/tenantManage/tenantUnit.js'
|
|
|
+import * as api from '@/api/tenantManage/authConfig.js'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
// import { parseTime } from '@/utils'
|
|
|
import { validatorPhone, parseTime, isEmail } from '@/utils'
|
|
@@ -73,69 +77,14 @@ export default defineComponent({
|
|
|
const formInfo = ref(null)
|
|
|
|
|
|
const isExpand = ref(false)
|
|
|
- const isStrictly=ref(true)
|
|
|
+ const isStrictly = ref(false)
|
|
|
const getPlatformBoxList = ref([])
|
|
|
const checked1 = ref(false)
|
|
|
const checked2 = ref(false)
|
|
|
const checked3 = ref(false)
|
|
|
+ const checkedArr = ref([])
|
|
|
|
|
|
- const data = ref([
|
|
|
- {
|
|
|
- label: 'Level one 1',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level two 1-1',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 1-1-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Level one 2',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level two 2-1',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 2-1-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Level two 2-2',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 2-2-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Level one 3',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level two 3-1',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 3-1-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Level two 3-2',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 3-2-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ])
|
|
|
+ const data = ref([])
|
|
|
|
|
|
const handleNodeClick = (data, obj, node) => {
|
|
|
data, node
|
|
@@ -268,8 +217,6 @@ export default defineComponent({
|
|
|
]
|
|
|
}, 10)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
//全选全不选
|
|
@@ -399,8 +346,7 @@ export default defineComponent({
|
|
|
}, 10)
|
|
|
}
|
|
|
}
|
|
|
- const handleStrictlyChange=()=>{
|
|
|
-
|
|
|
+ const handleStrictlyChange = () => {
|
|
|
if (checked3.value) {
|
|
|
isStrictly.value = false
|
|
|
setTimeout(function () {
|
|
@@ -464,68 +410,8 @@ export default defineComponent({
|
|
|
}, 10)
|
|
|
} else {
|
|
|
isStrictly.value = true
|
|
|
- setTimeout(function () {
|
|
|
- data.value = [
|
|
|
- {
|
|
|
- label: 'Level one 1',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level two 1-1',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 1-1-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Level one 2',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level two 2-1',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 2-1-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Level two 2-2',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 2-2-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Level one 3',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level two 3-1',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 3-1-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Level two 3-2',
|
|
|
- children: [
|
|
|
- {
|
|
|
- label: 'Level three 3-2-1',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ]
|
|
|
- }, 10)
|
|
|
+ setTimeout(function () {}, 10)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
const roleValid = (rule, value, callback) => {
|
|
|
rule
|
|
@@ -538,56 +424,57 @@ export default defineComponent({
|
|
|
|
|
|
// 保存操作
|
|
|
const submitForm = () => {
|
|
|
- formInfo.value.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- var aa = form.value
|
|
|
- if (aa.tenantTerm == 3) {
|
|
|
- aa.tenantTerm = '永久有效'
|
|
|
- }
|
|
|
- if (aa.tenantTerm == 4) {
|
|
|
- if (!form.value.value1) {
|
|
|
- ElMessage.warning('请选择日期')
|
|
|
- return
|
|
|
- }
|
|
|
- aa.tenantTerm = form.value.value1
|
|
|
-
|
|
|
- parseTime
|
|
|
-
|
|
|
- aa.tenantTerm
|
|
|
- ? (aa.tenantTerm = parseTime(aa.tenantTerm).substring(0, 10))
|
|
|
- : ''
|
|
|
- }
|
|
|
+ parseTime
|
|
|
+ // formInfo.value.validate((valid) => {
|
|
|
+ // if (valid) {
|
|
|
+ // var aa = form.value
|
|
|
+ // if (aa.tenantTerm == 3) {
|
|
|
+ // aa.tenantTerm = '永久有效'
|
|
|
+ // }
|
|
|
+ // if (aa.tenantTerm == 4) {
|
|
|
+ // if (!form.value.value1) {
|
|
|
+ // ElMessage.warning('请选择日期')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // aa.tenantTerm = form.value.value1
|
|
|
|
|
|
- if (props.dialogTitle === '新增') {
|
|
|
- api.addTenantData(form.value).then((requset) => {
|
|
|
- if (requset.status === 'SUCCESS') {
|
|
|
- ElMessage.success({
|
|
|
- message: '新增成功',
|
|
|
- type: 'success',
|
|
|
- })
|
|
|
- closeDialog()
|
|
|
- } else {
|
|
|
- ElMessage.error(requset.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- api.updateTenantData(form.value).then((requset) => {
|
|
|
- if (requset.status === 'SUCCESS') {
|
|
|
- ElMessage.success({
|
|
|
- message: '修改成功',
|
|
|
- type: 'success',
|
|
|
- })
|
|
|
- closeDialog()
|
|
|
- } else {
|
|
|
- ElMessage.error(requset.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
- }
|
|
|
- })
|
|
|
+ // parseTime
|
|
|
+
|
|
|
+ // aa.tenantTerm
|
|
|
+ // ? (aa.tenantTerm = parseTime(aa.tenantTerm).substring(0, 10))
|
|
|
+ // : ''
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (props.dialogTitle === '新增') {
|
|
|
+ // api.addTenantData(form.value).then((requset) => {
|
|
|
+ // if (requset.status === 'SUCCESS') {
|
|
|
+ // ElMessage.success({
|
|
|
+ // message: '新增成功',
|
|
|
+ // type: 'success',
|
|
|
+ // })
|
|
|
+ // closeDialog()
|
|
|
+ // } else {
|
|
|
+ // ElMessage.error(requset.msg)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // api.updateTenantData(form.value).then((requset) => {
|
|
|
+ // if (requset.status === 'SUCCESS') {
|
|
|
+ // ElMessage.success({
|
|
|
+ // message: '修改成功',
|
|
|
+ // type: 'success',
|
|
|
+ // })
|
|
|
+ // closeDialog()
|
|
|
+ // } else {
|
|
|
+ // ElMessage.error(requset.msg)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // console.log('error submit!!')
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
|
|
|
const open = () => {
|
|
@@ -595,7 +482,7 @@ export default defineComponent({
|
|
|
console.log('form.value')
|
|
|
console.log(form.value)
|
|
|
|
|
|
- optionselect()
|
|
|
+ getMenuList()
|
|
|
}
|
|
|
|
|
|
// 关闭弹框
|
|
@@ -609,15 +496,32 @@ export default defineComponent({
|
|
|
formInfo.value.resetFields()
|
|
|
}
|
|
|
|
|
|
- //角色下拉请求
|
|
|
- function optionselect() {
|
|
|
- api.getPlatformBoxList().then((requset) => {
|
|
|
- if (requset.status === 'SUCCESS') {
|
|
|
- getPlatformBoxList.value = requset.data
|
|
|
- } else {
|
|
|
- ElMessage.error(requset.msg)
|
|
|
- }
|
|
|
- })
|
|
|
+ //树结构下拉
|
|
|
+ function getMenuList() {
|
|
|
+ api
|
|
|
+ .getMenuList({
|
|
|
+ tenantId: form.value.id,
|
|
|
+ platformId: form.value.systemName,
|
|
|
+ })
|
|
|
+ .then((requset) => {
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
+ var jsona = JSON.stringify(requset.data.menus)
|
|
|
+ var jsonb = jsona.replace(/"menu"/g, '"label"')
|
|
|
+ jsonb = jsonb.replace(/"authority"/g, '"children"')
|
|
|
+ jsonb = jsonb.replace(/"name"/g, '"label"')
|
|
|
+ var jsonc = JSON.parse(jsonb)
|
|
|
+ data.value = jsonc
|
|
|
+ console.log('data.value')
|
|
|
+ console.log(data.value)
|
|
|
+
|
|
|
+ checkedArr.value = requset.data.checkedKeys
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
//监听变化
|
|
@@ -668,6 +572,7 @@ export default defineComponent({
|
|
|
handleExpandChange,
|
|
|
handleCheckedChange,
|
|
|
handleStrictlyChange,
|
|
|
+ checkedArr,
|
|
|
|
|
|
rules: {
|
|
|
tenantName: [
|
|
@@ -766,12 +671,11 @@ export default defineComponent({
|
|
|
padding: 15px;
|
|
|
}
|
|
|
|
|
|
-.aa {
|
|
|
- ::v-deep .el-form-item--small .el-form-item__label {
|
|
|
- line-height: 15px !important;
|
|
|
- // margin-top:10px
|
|
|
- }
|
|
|
-}
|
|
|
+// .aa {
|
|
|
+// ::v-deep .el-form-item--small .el-form-item__label {
|
|
|
+// line-height: 15px !important;
|
|
|
+// }
|
|
|
+// }
|
|
|
</style>
|
|
|
<style>
|
|
|
</style>
|