Explorar o código

管理员动态

CzRger hai 3 meses
pai
achega
1f5f8bb543

+ 1 - 1
src/components/cus/cus-form-link/input.vue

@@ -8,7 +8,7 @@
       @keyup.enter.native="$emit('emitEnter')"
       @keyup.enter.native="$emit('emitEnter')"
       :disabled="$util.isValue($attrs.disabled) ? $attrs.disabled : formView"
       :disabled="$util.isValue($attrs.disabled) ? $attrs.disabled : formView"
       :title="paramVal"
       :title="paramVal"
-      @blur="() => paramVal = String(paramVal).trim()"
+      @blur="() => paramVal = paramVal ? String(paramVal).trim() : ''"
   >
   >
     <template v-if="$slots.prefix" #prefix>
     <template v-if="$slots.prefix" #prefix>
       <slot name="prefix"/>
       <slot name="prefix"/>

+ 0 - 1
src/router/index.ts

@@ -65,7 +65,6 @@ export const initMainRouter = async () => {
             sysThemeGetThemeByThemeType(),
             sysThemeGetThemeByThemeType(),
         ]).then(async ([user, theme]) => {
         ]).then(async ([user, theme]) => {
             userInfo = user.data
             userInfo = user.data
-            userInfo.isAdmin = true
             if (userInfo?.isAdmin) {
             if (userInfo?.isAdmin) {
                 router.addRoute(manageRouter)
                 router.addRoute(manageRouter)
             }
             }

+ 11 - 0
src/views/manage/system/user/detail.vue

@@ -30,6 +30,17 @@
           link="select"
           link="select"
           :options="DictionaryStore.userStatusList"
           :options="DictionaryStore.userStatusList"
         />
         />
+        <CusFormColumn
+          :span="24"
+          required
+          label="管理员"
+          v-model:param="state.form.isAdmin"
+          link="radio"
+          :options="[
+            {dictLabel: '是', dictValue: true},
+            {dictLabel: '否', dictValue: false},
+          ]"
+        />
       </CusForm>
       </CusForm>
     </div>
     </div>
   </CusDialog>
   </CusDialog>

+ 4 - 0
src/views/manage/system/user/index.vue

@@ -38,6 +38,9 @@
         <template #status-column-value="{scope}">
         <template #status-column-value="{scope}">
           {{DictionaryStore.userStatusMap.get(scope.row.status)}}
           {{DictionaryStore.userStatusMap.get(scope.row.status)}}
         </template>
         </template>
+        <template #isAdmin-column-value="{scope}">
+          {{String(scope.row.isAdmin) == 'true' ? '是' : '否'}}
+        </template>
         <template #do-column-value="{scope}">
         <template #do-column-value="{scope}">
           <CusButton type="table-edit" @click="onEdit(scope.row)"/>
           <CusButton type="table-edit" @click="onEdit(scope.row)"/>
           <CusButton type="table-del" @click="onDel(scope.row)"/>
           <CusButton type="table-del" @click="onDel(scope.row)"/>
@@ -74,6 +77,7 @@ const state: any = reactive({
       {value: "username", label: "账号", fixed: 'left'},
       {value: "username", label: "账号", fixed: 'left'},
       {value: "nickName", label: "用户名", fixed: 'left'},
       {value: "nickName", label: "用户名", fixed: 'left'},
       {value: "status", label: "状态"},
       {value: "status", label: "状态"},
+      {value: "isAdmin", label: "管理员"},
       {value: "createTime", label: "创建时间", width: 200},
       {value: "createTime", label: "创建时间", width: 200},
       {value: "createByName", label: "创建人"},
       {value: "createByName", label: "创建人"},
       {value: "updateTime", label: "最后修改时间", width: 200},
       {value: "updateTime", label: "最后修改时间", width: 200},