|
@@ -34,8 +34,9 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="是否启用" :rules="[{required: true,message: '请选择是否启用',trigger: 'change',}]" prop="user_status">
|
|
|
<el-radio-group v-model="ruleForm.user_status">
|
|
|
- <el-radio :label="1">启用</el-radio>
|
|
|
- <el-radio :label="2"> 禁用</el-radio>
|
|
|
+ <el-radio v-if="statusInfo != 1" :label="2">启用</el-radio>
|
|
|
+ <el-radio v-else :label="1">启用</el-radio>
|
|
|
+ <el-radio :label="0"> 禁用</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -97,6 +98,8 @@ const msgId = ref(null);
|
|
|
const msgType = ref("all");
|
|
|
const PageIndex = ref(1);
|
|
|
const searchInfo = ref("");
|
|
|
+const pwdInfo = ref(null);
|
|
|
+const statusInfo = ref(2);
|
|
|
//获取用户组
|
|
|
const getGroup = async () => {
|
|
|
const { code, returnData } = await Query({
|
|
@@ -229,6 +232,8 @@ const btnClick = (index, row, param) => {
|
|
|
} else if (param == "edit") {
|
|
|
dT.value = "edit";
|
|
|
editDialogVisible.value = true;
|
|
|
+ pwdInfo.value = row.user_pwd;
|
|
|
+ statusInfo.value = row.user_status;
|
|
|
editDialogTitle.value = "编辑账号";
|
|
|
ruleForm.value = _.cloneDeep(row);
|
|
|
} else {
|
|
@@ -251,17 +256,23 @@ const addApp = () => {
|
|
|
editDialogVisible.value = true;
|
|
|
editDialogTitle.value = "新增账号";
|
|
|
dT.value = "add";
|
|
|
+ statusInfo.value = 2;
|
|
|
ruleForm.value = {};
|
|
|
};
|
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
|
await formEl.validate((valid, fields) => {
|
|
|
if (valid) {
|
|
|
- ruleForm.value.user_pwd = MD5(ruleForm.value.user_pwd);
|
|
|
if (dT.value == "add") {
|
|
|
+ ruleForm.value.user_pwd = MD5(ruleForm.value.user_pwd);
|
|
|
dataChange(1, ruleForm.value);
|
|
|
} else {
|
|
|
- dataChange(2, ruleForm.value);
|
|
|
+ if (ruleForm.value.user_pwd === pwdInfo.value) {
|
|
|
+ dataChange(2, ruleForm.value);
|
|
|
+ } else {
|
|
|
+ ruleForm.value.user_pwd = MD5(ruleForm.value.user_pwd);
|
|
|
+ dataChange(2, ruleForm.value);
|
|
|
+ }
|
|
|
}
|
|
|
editDialogVisible.value = false;
|
|
|
} else {
|