ソースを参照

修改店铺账号

YY 2 年 前
コミット
d319e73651
1 ファイル変更6 行追加3 行削除
  1. 6 3
      src/views/platmanag/storeAcc/detail.vue

+ 6 - 3
src/views/platmanag/storeAcc/detail.vue

@@ -31,9 +31,9 @@
             <template #role>
               <el-option v-for="i in roleList" :key="i._id" :label="i.name" :value="i._id"></el-option>
             </template>
-            <template #password v-if="!form.id">
+            <!-- <template #password>
               <el-input v-model="form.password" type="password" placeholder="请输入密码"></el-input>
-            </template>
+            </template> -->
           </data-form>
         </el-col>
       </el-row>
@@ -77,7 +77,6 @@ export default {
         { label: '账号', model: 'account' },
         { label: '角色', model: 'role', type: 'select' },
         { label: '邮箱', model: 'email' },
-        { label: '密码', model: 'password', custom: true },
       ],
       rules: {
         // password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
@@ -108,11 +107,15 @@ export default {
     },
     // 添加自定义
     initAddData() {
+      let pass = { label: '密码', model: 'password', type: 'password' };
+      this.$set(this, 'infoFields', [...this.infoFields, pass]);
       const obj = { shop: this.id };
       this.$set(this, 'form', obj);
     },
     // 修改
     async toEdit({ data }) {
+      let index = this.infoFields.findIndex((f) => f.model == 'password');
+      this.infoFields.splice(index, 1, { label: '密码', model: 'password', type: 'password', readonly: true });
       const res = await this.fetch(data._id);
       if (this.$checkRes(res)) {
         let data = res.data;