|
@@ -34,13 +34,14 @@
|
|
|
:default-expand-all="isExpand"
|
|
|
:default-checked-keys="checkedArr"
|
|
|
:check-strictly="isStrictly"
|
|
|
+ @check="currentChecked"
|
|
|
/>
|
|
|
|
|
|
<br />
|
|
|
|
|
|
<div style="text-align: right">
|
|
|
<el-button @click="closeDialog(0)">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm(formInfo)" disabled=disabled>
|
|
|
+ <el-button type="primary" @click="submitForm(formInfo)">
|
|
|
保存
|
|
|
</el-button>
|
|
|
</div>
|
|
@@ -55,7 +56,7 @@ import { defineComponent, ref, watchEffect, watch, onMounted } from 'vue'
|
|
|
import * as api from '@/api/tenantManage/authConfig.js'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
// import { parseTime } from '@/utils'
|
|
|
-import { validatorPhone, parseTime, isEmail } from '@/utils'
|
|
|
+// import { validatorPhone, parseTime, isEmail } from '@/utils'
|
|
|
export default defineComponent({
|
|
|
name: 'DialogComponent',
|
|
|
emits: ['closeDialog'],
|
|
@@ -91,6 +92,21 @@ export default defineComponent({
|
|
|
console.log(data)
|
|
|
}
|
|
|
|
|
|
+ const currentChecked = (nodeObj, SelectedObj) => {
|
|
|
+ nodeObj, SelectedObj
|
|
|
+ console.log('SelectedObj.checkedNodes')
|
|
|
+ console.log(SelectedObj.checkedNodes)
|
|
|
+ checkedArr.value = []
|
|
|
+
|
|
|
+
|
|
|
+ SelectedObj.checkedNodes.forEach((item) => {
|
|
|
+ checkedArr.value.push(item.id)
|
|
|
+ })
|
|
|
+ console.log(checkedArr.value)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//展开合并
|
|
|
const handleExpandChange = () => {
|
|
|
data.value = []
|
|
@@ -424,57 +440,27 @@ export default defineComponent({
|
|
|
|
|
|
// 保存操作
|
|
|
const submitForm = () => {
|
|
|
- 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
|
|
|
-
|
|
|
- // 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
|
|
|
- // }
|
|
|
- // })
|
|
|
+ if (checkedArr.value.length) {
|
|
|
+ api.updateMenu({
|
|
|
+ "tenantId":form.value.id,
|
|
|
+ "menuIds":checkedArr.value
|
|
|
+ }).then((requset) => {
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
+ ElMessage.success({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ closeDialog()
|
|
|
+ } else {
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage.warning('请至少选择一个权限保存')
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
const open = () => {
|
|
@@ -516,6 +502,8 @@ export default defineComponent({
|
|
|
console.log(data.value)
|
|
|
|
|
|
checkedArr.value = requset.data.checkedKeys
|
|
|
+ console.log( 'checkedArr.value')
|
|
|
+ console.log( checkedArr.value)
|
|
|
|
|
|
|
|
|
|
|
@@ -574,70 +562,10 @@ export default defineComponent({
|
|
|
handleCheckedChange,
|
|
|
handleStrictlyChange,
|
|
|
checkedArr,
|
|
|
+ currentChecked,
|
|
|
|
|
|
rules: {
|
|
|
- tenantName: [
|
|
|
- { required: true, message: '请输入租户名称', trigger: 'blur' },
|
|
|
- {
|
|
|
- min: 1,
|
|
|
- max: 30,
|
|
|
- message: '长度在 1 到 30个字符',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ],
|
|
|
- tenantManager: [
|
|
|
- { required: true, message: '请输入租户负责人', trigger: 'blur' },
|
|
|
- {
|
|
|
- min: 1,
|
|
|
- max: 10,
|
|
|
- message: '长度在 1 到 10个字符',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ],
|
|
|
- tenantTerm: [
|
|
|
- { required: true, message: '请选择有效期限', trigger: 'change' },
|
|
|
- ],
|
|
|
- geoPosition: [
|
|
|
- { required: true, message: '请选输入地理位置', trigger: 'blur' },
|
|
|
- ],
|
|
|
-
|
|
|
- tenantType: [
|
|
|
- { required: true, message: '请输入租户类型', trigger: 'blur' },
|
|
|
- ],
|
|
|
- phoneNumber: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入负责人手机号码',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- {
|
|
|
- validator: validatorPhone,
|
|
|
- message: '输入的电话号码不正确',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ],
|
|
|
- systemName: [
|
|
|
- { required: true, message: '请选择系统平台', trigger: 'blur' },
|
|
|
- ],
|
|
|
- email: [
|
|
|
- { required: true, message: '请输入邮箱地址', trigger: 'blur' },
|
|
|
-
|
|
|
- {
|
|
|
- validator: isEmail,
|
|
|
- message: '输入的邮箱地址不正确',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ],
|
|
|
- address: [
|
|
|
- { required: true, message: '请输入联系地址', trigger: 'blur' },
|
|
|
- {
|
|
|
- min: 1,
|
|
|
- max: 15,
|
|
|
- message: '长度在 1 到 15个字符',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
})
|