Browse Source

Merge branch 'master' of http://git.ius.plus/denny.zhao/VinnoManagementSystem

Conflicts:
	VinnoManagementSystem/src/locales/lang/en.js
	VinnoManagementSystem/src/locales/lang/zh-cn.js
denny 3 years ago
parent
commit
d57189b04d

+ 88 - 0
VinnoManagementSystem/src/api/wing/adminManage.js

@@ -0,0 +1,88 @@
+import http from "@/utils/request"
+import common from "@/utils/common"
+
+export default {
+    adminRoleSelectList: {
+        method: 'GetAdminRoleSelectList',
+        name: "角色下拉列表",
+        post: async function (data = {}) {
+            return await http.post({
+                "jsonrpc": "2.0",
+                "id": common.guid(),
+                "method": this.method,
+                "params": [data]
+            });
+        }
+    },
+    adminList: {
+        method: 'GetAdminPagesAsync',
+        name: "查询管理员列表",
+        post: async function (params) {
+            var queryType = params.queryType == null ? '' : params.queryType;
+            var data = {
+                'PageIndex': params.page,
+                'PageSize': params.pageSize,
+                'QueryType': queryType,
+                'KeyWord': params.keyword,
+                'RoleCode': params.roleCode
+            }
+            return await http.post({
+                "jsonrpc": "2.0",
+                "id": common.guid(),
+                "method": this.method,
+                "params": [data]
+            });
+        }
+    },
+    createAdmin: {
+        method: 'CreateAdminAsync',
+        name: "创建管理员",
+        post: async function (req) {
+            var roleCodes = [];
+            if (req.roleCode != null || req.AdminRoleCode != '') {
+                roleCodes.push(req.AdminRoleCode);
+            }
+            else {
+                roleCodes = null;
+            }
+            var data = {
+                'AdminName': req.AdminName,
+                'FullName': req.AdminFullName,
+                'SecretPassword': req.Password1,
+                'RoleCodes': roleCodes,
+            }
+            return await http.post({
+                "jsonrpc": "2.0",
+                "id": common.guid(),
+                "method": this.method,
+                "params": [data]
+            });
+        }
+    },
+    modifyAdmin: {
+        method: 'ModifyAdminAsync',
+        name: "修改管理员",
+        post: async function (req) {
+            var roleCodes = [];
+            if (req.roleCode != null || req.AdminRoleCode != '') {
+                roleCodes.push(req.AdminRoleCode);
+            }
+            else {
+                roleCodes = null;
+            }
+            var data = {
+                'AdminCode': req.AdminCode,
+                'AdminName': req.AdminName,
+                'FullName': req.AdminFullName,
+                'SecretPassword': req.Password1,
+                'RoleCodes': roleCodes,
+            }
+            return await http.post({
+                "jsonrpc": "2.0",
+                "id": common.guid(),
+                "method": this.method,
+                "params": [data]
+            });
+        }
+    }
+}

+ 48 - 27
VinnoManagementSystem/src/components/admin/selectAdmin.vue

@@ -1,36 +1,20 @@
 <template>
   <el-dialog
-    :title="$t('create')"
+    :title="$t('admin.AssignAdmin')"
     v-model="visible"
-    :width="500"
+    :width="800"
     destroy-on-close
     @closed="$emit('closed')"
   >
     <el-container>
       <el-header>
         <div class="left-panel">
-          <div class="left-panel-search">
+          <div class="right-panel-search">
             <el-input
-              v-model="search.Keyword"
+              v-model="search.KeyWord"
               clearable
-              style="width: 320px"
-              :placeholder="$t('pleaseInput')"
+              :placeholder="$t('admin.PleaseInputAdminName')"
             >
-              <template #prepend>
-                <el-select
-                  v-model="search.QueryType"
-                  style="width: 120px"
-                  :placeholder="$t('pleaseChoose')"
-                  class="filter-item"
-                >
-                  <el-option
-                    v-for="item in queryTypes"
-                    :key="item"
-                    :label="$t('organization.QueryType' + item)"
-                    :value="item"
-                  />
-                </el-select>
-              </template>
             </el-input>
             <el-button type="primary" icon="el-icon-search" @click="upsearch">{{
               $t("query")
@@ -43,14 +27,30 @@
           ref="table"
           :apiObj="apiObj"
           :pageSize="10"
-          row-key="UserCode"
-          @selection-change="selectionChange"
+          row-key="AdminCode"
           stripe
+          :hideDo="true"
         >
-          <el-table-column type="selection" width="50"></el-table-column>
+          <el-table-column prop="AdminCode" :width="34">
+            <template #default="scope">
+              <el-radio
+                v-model="selectCode"
+                :label="scope.row.AdminCode"
+                @click="selectCode = scope.row.AdminCode"
+              />
+            </template>
+          </el-table-column>
           <el-table-column
-            :label="$t('organization.OrganizationName')"
-            prop="OrganizationName"
+            :label="$t('admin.AccountName')"
+            prop="AdminName"
+          ></el-table-column>
+          <el-table-column
+            :label="$t('admin.FullName')"
+            prop="FullName"
+          ></el-table-column>
+          <el-table-column
+            :label="$t('admin.RoleName')"
+            prop="DefaultRoleName"
           ></el-table-column>
         </scTable>
       </el-main>
@@ -72,13 +72,34 @@ export default {
   data() {
     return {
       visible: false,
+      selectCode: "",
+      apiObj: this.query,
+      search: { KeyWord: "", IsShowSuperRoleCode: false, QueryType: "1" },
     };
   },
   methods: {
     open() {
+      this.visible = true;
       return this;
     },
-    submit() {},
+    setData(selectCode) {
+      this.selectCode = selectCode;
+    },
+    submit() {
+      this.$emit("success", this.selectCode);
+      this.visible = false;
+    },
+    async query(params) {
+      return await this.$API.wing.list("GetAdminPagesAsync", params);
+    },
+    //搜索
+    upsearch() {
+      this.$refs.table.upData(this.search);
+    },
+    //刷新当前页
+    refresh() {
+      this.$refs.table.refresh();
+    },
   },
 };
 </script>

+ 1 - 1
VinnoManagementSystem/src/components/scTable/index.vue

@@ -27,7 +27,7 @@
 				</template>
 			</el-table>
 		</div>
-		<div class="scTable-page" v-if="!hidePagination&&!hideDo">
+		<div class="scTable-page" v-if="!hidePagination||!hideDo">
 			<div class="scTable-pagination">
 				<el-pagination v-if="!hidePagination" background :small="true" :layout="paginationLayout" :total="total" :page-size="pageSize" v-model:currentPage="currentPage" @current-change="paginationChange"></el-pagination>
 			</div>

+ 132 - 0
VinnoManagementSystem/src/components/user/selectUser.vue

@@ -0,0 +1,132 @@
+<template>
+  <el-dialog
+    :title="$t('user.assignUser')"
+    v-model="visible"
+    :width="800"
+    destroy-on-close
+    @closed="$emit('closed')"
+  >
+    <el-container>
+      <el-header>
+        <div class="left-panel">
+          <div class="right-panel-search">
+            <el-input
+              v-model="search.Keyword"
+              clearable
+              style="width: 320px"
+              :placeholder="$t('pleaseInput')"
+            >
+              <template #prepend>
+                <el-select
+                  v-model="search.QueryType"
+                  style="width: 120px"
+                  :placeholder="$t('pleaseChoose')"
+                  class="filter-item"
+                >
+                  <el-option :label="$t('user.userName')" value="0" />
+                  <el-option :label="$t('user.phone')" value="3" />
+                  <el-option :label="$t('user.email')" value="4" />
+                  <el-option :label="$t('user.fullName')" value="5" />
+                </el-select>
+              </template>
+            </el-input>
+
+            <el-button type="primary" icon="el-icon-search" @click="upsearch">{{
+              $t("query")
+            }}</el-button>
+          </div>
+        </div>
+      </el-header>
+      <el-main class="nopadding">
+        <scTable
+          ref="table"
+          :apiObj="apiObj"
+          :pageSize="10"
+          row-key="UserCode"
+          stripe
+          :hideDo="true"
+        >
+          <el-table-column prop="UserCode" :width="34">
+            <template #default="scope">
+              <el-radio
+                v-model="selectCode"
+                :label="scope.row.UserCode"
+                @click="selectCode = scope.row.UserCode"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column
+            :label="$t('user.userName')"
+            prop="UserName"
+          ></el-table-column>
+          <el-table-column
+            :label="$t('user.fullName')"
+            prop="FullName"
+          ></el-table-column>
+          <el-table-column
+            :label="$t('user.phone')"
+            prop="Phone"
+          ></el-table-column>
+          <el-table-column
+            :label="$t('user.email')"
+            prop="Email"
+          ></el-table-column>
+        </scTable>
+      </el-main>
+    </el-container>
+
+    <template #footer>
+      <el-button @click="visible = false">{{
+        $t("dialogBox.cancelButtonText")
+      }}</el-button>
+      <el-button type="primary" :loading="isSaveing" @click="submit()">{{
+        $t("dialogBox.saveButtonText")
+      }}</el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      visible: false,
+      selectCode: "",
+      apiObj: this.query,
+      search: { Keyword: "", QueryType: "0", OrganizationCode: "" },
+    };
+  },
+  methods: {
+    open() {
+      this.visible = true;
+      return this;
+    },
+    setData(organizationCode, selectCode) {
+      this.search.OrganizationCode = organizationCode;
+      this.selectCode = selectCode;
+    },
+    submit() {
+      this.$emit("success", this.selectCode);
+      this.visible = false;
+    },
+    async query(params) {
+      params.OrganizationCode = this.search.OrganizationCode;
+      return await this.$API.wing.list(
+        "GetManageOrganizationUserPages",
+        params
+      );
+    },
+    //搜索
+    upsearch() {
+      this.$refs.table.upData(this.search);
+    },
+    //刷新当前页
+    refresh() {
+      this.$refs.table.refresh();
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 23 - 1
VinnoManagementSystem/src/locales/lang/en.js

@@ -11,6 +11,7 @@ export default {
 	audited: "Audited",
 	rejected: "Rejected",
 	version: "Version",
+	more: "More",
 	yes: "Yes",
 	no: "No",
 	login: {
@@ -60,6 +61,11 @@ export default {
 		phone: "Phone",
 		email: "Email",
 		hospitalName: "Hospital Name",
+		loginOutConfirmTitle:"exit the current user?",
+		assignUser: "Assign User",
+		authorityName: "Authority Name",
+		uniqueCode: "Unique Code",
+		uniqueCodeTip: "The system is unique and cannot be repeated, otherwise the permission will be invalid.",
 		userStatus: "User Status",
 		authenticationState: "Authentication State",
 		loginOutConfirmTitle:"exit the current user?",
@@ -108,6 +114,22 @@ export default {
 		keywordLabel:"Keyword",
 		description: "Description"
 	},
+	admin: {
+		AssignAdmin: "Assign Admin",
+		PleaseInputAdminName: "Please input name",
+		AccountName: "Account Name",
+		FullName: "User Name",
+		RoleName: "Role Name",
+		adminQueryTypeOption0: "Account Name",
+		adminQueryTypeOption1: "User Name",
+		adminRoleQuery: "Admin Role",
+		adminRoleName: "Admin Role Name",
+		password1:"Password",
+		password2:"confirm Password",
+		passwordVaild:"Passwords does not match",
+		adminConfirmDelete: "Are you sure to delete this admin",
+		assignRole: "assign Role"
+	},
 	organization: {
 		OrganizationName: "Organization Name",
 		OrganizationLogo: "Organization Logo",
@@ -130,7 +152,7 @@ export default {
 		QueryType1: "Admin Name",
 		AssignAdmin: "Assign Admin",
 		ConfirmDelete: "Are You Sure To Del This Organization ?",
-		ConfirmDelete2: "There has users or devices in the current organization. Are you sure to delete this Organization?",
+		ConfirmDelete2: "There has users or devices in the current organization. Are you sure to delete this Organizationï¼,
 		FrontOrganization: "Front Organization",
 		ApproveOrgMsg: "Are You Sure To Approve This Organization?",
 		OrgNameRequire: "Please input Organization Name",

+ 100 - 79
VinnoManagementSystem/src/locales/lang/zh-cn.js

@@ -11,36 +11,37 @@ export default {
 	audited: "审核通过",
 	rejected: "审核�通过",
 	version: "版本",
-	yes: "是",
-	no: "�",
+	more: "更多",
+	yes: "æ˜,
+	no: "å�,
 	login: {
 		slogan: '高性能 / 精致 / 优雅',
-		describe: '基于Vue3 + Element-Plus 的中���端解决方案。',
-		signInTitle: '���管���',
-		rememberMe: '记�我',
+		describe: '基于Vue3 + Element-Plus 的中å�Žå�°å‰�端解决方案ã€,
+		signInTitle: 'æ��è�†è�Ÿç®¡ç�†å�Žå�,
+		rememberMe: 'è®°ä½�æˆ,
 		forgetPassword: '忘记密�',
 		signIn: '登录',
 		signInOther: '其他登录方�',
-		userPlaceholder: '用户å�/ 手机 / 邮箱',
+		userPlaceholder: '用户å�/ 手机 / 邮箱',
 		userError: '请输入用户�',
-		PWPlaceholder: '请输入密�',
-		PWError: '请输入密�',
-		admin: '管�员',
+		PWPlaceholder: '请输入密ç ,
+		PWError: '请输入密ç ,
+		admin: '管ç�†å‘,
 		copyright: "©2019-2022 Vinno Corporation. All rights reserved.",
 		loginError: '登录失败',
 		loadingMenuError: '读���失败',
 		languageEN: '英文',
-		languageCN: '简体中文',
+		languageCN: '简体中æ–,
 		loginResult: "登录�功",
 		addPassword: "新增密�",
 		editPassword: "修改密�",
-		inputAdminCode: "请输入用户编�",
+		inputAdminCode: "请输入用户编ç ,
 		inputAdminOldPwd: "请输入旧密�",
-		inputAdminPwd: "请输入登录密�",
-		inputPwdValidate: "密�必须是由4-20�字�+数字组�",
-		againInputPwd: "请�次输入密�",
-		pwdDiff: "两次输入密��一致",
-		adminOldPwd: "旧密�",
+		inputAdminPwd: "请输入登录密ç ,
+		inputPwdValidate: "密ç �必须是由4-20ä½�å­—æ¯æ•°å­—组å�ˆ",
+		againInputPwd: "请å†�次输入密ç ,
+		pwdDiff: "两次输入密ç �ä¸�一è‡,
+		adminOldPwd: "旧密ç ,
 		newAdminPwd: "登录密�",
 		confirmAdminPwd: "确认密�",
 		loginOutConfirmTitle: "退出当�用户?"
@@ -48,11 +49,11 @@ export default {
 	dialogBox: {
 		confirmWarningText: "确认是�",
 		confirmWarningTitle: "�示",
-		confirmWarningButtonText: "退 出",
-		cancelButtonText: "å�消",
-		confirmButtonText: "确 认",
-		saveButtonText: "ä¿å­˜",
-		clearButtonText: "æ¸ç©º",
+		confirmWarningButtonText: "退 å‡,
+		cancelButtonText: "å�æ¶,
+		confirmButtonText: "ç¡è®,
+		saveButtonText: "ä¿å­,
+		clearButtonText: "æ¸ç©,
 		confirm: "确定",
 		addTitle: "新增",
 		shareTitle: "分�",
@@ -60,7 +61,7 @@ export default {
 		removeTitle: "移除",
 		detailTitle: "查看详情",
 		confirmDeleteText: "确定删除�?",
-		searchButtonText: "� 索"
+		searchButtonText: "æ�ç´
 	},
 	response: {
 		operateSuccess: "�作�功",
@@ -69,11 +70,11 @@ export default {
 		operateEditButton: "编辑",
 		operateDeleteButton: "删除",
 		deleteSuccess: "删除�功",
-		keywordLabel: "关键字",
+		keywordLabel: "关键å­,
 		description: "�述"
 	},
 	user: {
-		dynamic: '近期动�',
+		dynamic: '近期动æ€,
 		info: '个人信�',
 		settings: '设置',
 		nightmode: "黑夜模�",
@@ -82,42 +83,62 @@ export default {
 		language_msg: '翻译进行中,暂翻译了本视图的文本',
 		personSetting: '个人设置',
 		modifyPwd: '修改密�',
-		loginOut: '退出登录',
-		userName: "用户�",
+		loginOut: '退出登å½,
+		userName: "用户å�,
 		fullName: "用户姓�",
-		phone: "手机�",
+		phone: "手机å�,
 		email: "邮箱",
-		hospitalName: "所在医院",
-		userStatus: "用户状�",
-		authenticationState: "认�状�",
-		userStatusPlaceholder: "请选择用户状�",
-		nonactivated: "未激活",
-		activated: "已激活",
-		uncertified: "未认�",
-		waitcertified: "待审核",
-		rejected: "已拒�",
-		certified: "已认�",
+		hospitalName: "所在医é™,
+		userStatus: "用户状æ€,
+		authenticationState: "认è¯�状æ€,
+		userStatusPlaceholder: "请选择用户状æ€,
+		nonactivated: "未激æ´,
+		activated: "已激æ´,
+		uncertified: "未认è¯,
+		waitcertified: "待审æ ,
+		rejected: "已拒ç»,
+		certified: "已认è¯,
 		registerTime: "注册时间",
 		certificationAudit: "认�审核",
 		rejectReason: "拒�原因",
-		inputRejectReason: "请输入拒�原因",
+		inputRejectReason: "请输入拒ç»�原å›,
 		rejectReasonRequired: "拒�原因必填",
 		auditText: "是�审核通过",
 		doctorLicense: "医师执照",
-		cardFront: "身份�正�",
-		cardreverse: "身份���",
+		cardFront: "身份è¯�æ­£é�,
+		cardreverse: "身份è¯�å��é�,
 		applyRoleName: "申请角色",
+		assignUser: "分é…�è´Ÿè´£äº,
+		authorityName: "���称",
+		uniqueCode: "æ�ƒé™�唯一ç ,
+		uniqueCodeTip: "系统唯一ä¸�å�¯é‡�å¤�,å�¦åˆ™å°†å¯¼è‡´æ�ƒé™�失效ã€,
+	},
+	admin: {
+		AssignAdmin: "分é…�管ç�†å‘,
+		PleaseInputAdminName: "请输入管�员姓�",
+		AccountName: "用户å�,
+		FullName: "用户姓�",
+		RoleName: "角色�称",
+		adminQueryTypeOption0: "用户å�,
+		adminQueryTypeOption1: "姓�",
+		adminRoleQuery: "管ç�†å‘˜è§’è‰,
+		adminRoleName: "管ç�†å‘˜è§’色å��ç§,
+		password1:"密�",
+		password2:"确认密�",
+		passwordVaild:"密ç �ä¸�一è‡,
+		adminConfirmDelete: "确定删除该管�员�?",
+		assignRole: "分�角色"
 	},
 	organization: {
 		OrganizationName: "机构�称",
 		OrganizationLogo: "机构Logo",
-		OrganizationState: "审核状�",
-		OrganizationState0: "待审核",
-		OrganizationState1: "已审核",
-		OrganizationState2: "已驳回",
-		WaitAudit: "待审核",
-		Audited: "已审核",
-		Rejected: "已驳回",
+		OrganizationState: "审核状æ€,
+		OrganizationState0: "待审æ ,
+		OrganizationState1: "已审æ ,
+		OrganizationState2: "已驳å›,
+		WaitAudit: "待审æ ,
+		Audited: "已审æ ,
+		Rejected: "已驳å›,
 		CountryName: "国家地区",
 		ProvinceName: "�份",
 		CityName: "城市",
@@ -125,33 +146,33 @@ export default {
 		PatientType0: "人用",
 		PatientType1: "兽用",
 		AdminFullName: "所属管�员",
-		DirectorName: "机构负责人",
+		DirectorName: "机构负责äº,
 		QueryType0: "机构�称",
 		QueryType1: "所属管�员",
-		AssignAdmin: "分�管�员",
-		ConfirmDelete: "确定删除该组织�?",
+		AssignAdmin: "分é…�管ç�†å‘,
+		ConfirmDelete: "确定删除该组织å�—ï¼,
 		ConfirmDelete2: "当�机构存在绑定用户或设备,确定删除�?",
 		FrontOrganization: "上级机构",
-		ApproveOrgMsg: "该机构是�审核通过?",
-		OrgNameRequire: "请输入机构�称",
+		ApproveOrgMsg: "该机构是å�¦å®¡æ ¸é€šè¿‡ï¼,
+		OrgNameRequire: "请输入机构å��ç§,
 		PatientTypeRequire: "请选择�务对象",
 		UploadLogo: "上传Logo",
-		SetDirector: "编辑负责人",
+		SetDirector: "编辑负责äº,
 		Setting0: "病人�置",
-		Setting1: "检查�置",
+		Setting1: "检查é…�ç½,
 	},
 	menu: {
 		home: "首页",
-		dashboard: "控制�",
+		dashboard: "控制å�,
 		userCenter: "个人信�",
 		userManage: "用户模�",
 		userList: "用户列表",
 		roleList: "平�角色",
 		authority: "��列表",
-		adminManage: "管�员模�",
-		adminList: "管�员列表",
-		adminRole: "管�员角色",
-		adminAuthority: "管�员��",
+		adminManage: "管ç�†å‘˜æ¨¡å�,
+		adminList: "管ç�†å‘˜åˆ—è¡,
+		adminRole: "管ç�†å‘˜è§’è‰,
+		adminAuthority: "管ç�†å‘˜æ�ƒé™,
 		deviceManage: "设备模�",
 		deviceList: "设备列表",
 		deviceTypeList: "设备类型列表",
@@ -165,42 +186,42 @@ export default {
 		deviceName: "设备�称",
 		deviceCode: "设备编�",
 		shareDevice: "分�设备",
-		cancelShareDevice: "已分享用户",
-		sureToShareDevice: "确定分享设备�",
-		sureToCancelShareDevice: "确定�消分享设备�",
-		deviceTypeName: "设备类型�",
-		deviceModelName: "设备型��",
+		cancelShareDevice: "已分享用æˆ,
+		sureToShareDevice: "确定分享设备å�,
+		sureToCancelShareDevice: "确定å�–消分享设备å�,
+		deviceTypeName: "设备类型å�,
+		deviceModelName: "设备型å�·å�,
 		deviceType: "设备类型",
 		deviceModel: "设备型�",
 		deviceTypeNotNull: "设备型��能为空",
 		addDeviceModel: "添加型�",
 		deviceModel1: "该型�已关� ",
-		deviceModel2: " 个设备,请先修改设备�删除型�",
+		deviceModel2: " 个设备,请先修改设备å†�删除型å�,
 		createDeviceType: "创建设备类型",
 		modifyDeviceType: "修改设备类型",
-		requiredDeviceTypeName: "请输入设备类型�称",
-		requiredDeviceTypeCode: "请输入设备类型编�",
+		requiredDeviceTypeName: "请输入设备类型å��ç§,
+		requiredDeviceTypeCode: "请输入设备类型编ç ,
 		deviceID: "设备注册ID",
-		searchHosptial: "所在医院",
+		searchHosptial: "所在医é™,
 		searchAdmin: "所属管�员",
 		searchUser: "绑定用户",
 		searchAdminPlaceholder: "请输入管�员姓�",
-		searchUserPlaceholder: "请输入用户姓�",
-		departmentColumnTitle: "所在部门",
-		deviceBelongUser: "设备负责人",
-		shareUserCount: "分享用户数",
+		searchUserPlaceholder: "请输入用户姓å�,
+		departmentColumnTitle: "所在部é—,
+		deviceBelongUser: "设备负责äº,
+		shareUserCount: "分享用户æ•,
 		shareDeviceToUser: "分享设备",
 		removeDeviceToUser: "移除用户",
-		userQueryOptions0: "用户�",
+		userQueryOptions0: "用户å�,
 		userQueryOptions1: "用户ID",
 		userQueryOptions2: "用户昵称",
-		userQueryOptions3: "手机�",
+		userQueryOptions3: "手机å�,
 		userQueryOptions4: "邮箱",
 		userQueryOptions5: "用户姓�",
-		userQueryOptions6: "所属医院",
-		userQueryOptions7: "所属科室",
-		confirmShareDevice: "分享当�设备?",
-		confirmCancelShareDevice: "�消分享当�设备?",
-		removeDeviceBindUsers: "此�作将解除已绑定的分享用户, 是�继续?"
+		userQueryOptions6: "所属医é™,
+		userQueryOptions7: "所属科å®,
+		confirmShareDevice: "分享当å‰�设备ï¼,
+		confirmCancelShareDevice: "å�–消分享当å‰�设备ï¼,
+		removeDeviceBindUsers: "æ­¤æ“�作将解除已绑定的分享用户, 是å�¦ç»§ç»­ï¼
 	},
 }

+ 232 - 0
VinnoManagementSystem/src/views/adminManage/adminList.vue

@@ -0,0 +1,232 @@
+<template>
+  <el-container>
+    <el-header>
+      <div class="left-panel">
+        <el-button type="primary" icon="el-icon-plus" @click="add"
+          >{{ $t("create") }}
+        </el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-compass"
+          :disabled="selection.length == 0"
+          @click="assignRole"
+          >{{ $t("admin.assignRole") }}
+        </el-button>
+      </div>
+      <el-form ref="form" class="right-panel">
+        <div class="right-panel-search">
+          <el-input
+            v-model="search.keyword"
+            clearable
+            style="width: 320px"
+            :placeholder="$t('pleaseInput')"
+          >
+            <template #prepend>
+              <el-select
+                v-model="search.queryType"
+                style="width: 120px"
+                :placeholder="$t('pleaseChoose')"
+                class="filter-item"
+              >
+                <el-option
+                  v-for="item in queryTypes"
+                  :key="item"
+                  :label="$t('admin.adminQueryTypeOption' + item)"
+                  :value="item"
+                />
+              </el-select>
+            </template>
+          </el-input>
+          <el-form-item
+            ref="form"
+            style="padding: 20px 0px 0px 0px"
+            :label="$t('admin.adminRoleQuery')"
+          >
+            <sc-select
+              v-model="search.roleCode"
+              :apiObj="$API.adminManage.adminRoleSelectList"
+              clearable
+              filterable
+              style="width: 100%"
+            ></sc-select>
+          </el-form-item>
+          <el-button type="primary" icon="el-icon-search" @click="upsearch">{{
+            $t("query")
+          }}</el-button>
+        </div>
+      </el-form>
+    </el-header>
+    <el-main class="nopadding">
+      <scTable
+        ref="table"
+        :apiObj="apiObj"
+        :pageSize="10"
+        row-key="UserCode"
+        @selection-change="selectionChange"
+        stripe
+      >
+        <el-table-column type="selection" width="50"></el-table-column>
+        <el-table-column
+          :label="$t('admin.AccountName')"
+          prop="AdminName"
+        ></el-table-column>
+        <el-table-column
+          :label="$t('admin.FullName')"
+          prop="FullName"
+        ></el-table-column>
+        <el-table-column
+          :label="$t('admin.adminRoleName')"
+          prop="DefaultRoleName"
+        ></el-table-column>
+        <el-table-column :label="$t('createTime')" prop="CreateTime">
+          <template #default="scope">
+            <span>{{
+              scope.row.CreateTime.slice(0, 19).replace("T", " ")
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          :label="$t('operate')"
+          fixed="right"
+          align="center"
+          width="120"
+        >
+          <template #default="scope">
+            <!-- 编辑 -->
+            <el-button
+              type="text"
+              size="small"
+              @click="table_edit(scope.row, scope.$index)"
+              >{{ $t("edit") }}</el-button
+            >
+            <!-- 删除 -->
+            <el-popconfirm
+              :title="confirmDel"
+              @confirm="table_del(scope.row, scope.$index)"
+            >
+              <template #reference>
+                <el-button type="text" size="small">{{
+                  $t("delete")
+                }}</el-button>
+              </template>
+            </el-popconfirm>
+          </template>
+        </el-table-column>
+      </scTable>
+    </el-main>
+  </el-container>
+
+  <save-dialog
+    v-if="dialog.show"
+    ref="saveDialog"
+    @success="refresh"
+    @closed="dialog.show = false"
+  ></save-dialog>
+
+  <save-role
+    v-if="dialog.showRole"
+    ref="saveRoleDialog"
+    @success="saveRole"
+    @closed="dialog.showRole = false"
+  ></save-role>
+</template>
+
+<script>
+import saveRole from "./saveRole";
+import saveDialog from "./saveAdmin";
+
+
+export default {
+  components: {
+    saveDialog,
+    saveRole,
+  },
+  data() {
+    return {
+      dialog: {
+        show: false,
+        showRole: false,
+      },
+      apiObj: this.query,
+      search: {
+        queryType: "0",
+        roleCode: "",
+        keyword: null,
+      },
+      queryTypes: ["0", "1"],
+      selection: [],
+      confirmDel: this.$t("admin.adminConfirmDelete"),
+    };
+  },
+  methods: {
+    async query(params) {
+      return await this.$API.adminManage.adminList.post(params);
+    },
+    //搜索
+    upsearch() {
+      this.$refs.table.upData(this.search);
+    },
+    //刷新当前页
+    refresh() {
+      this.$refs.table.refresh();
+    },
+    //增加
+    add() {
+      this.dialog.show = true;
+      this.$nextTick(() => {
+        this.$refs.saveDialog.open();
+      });
+    },
+    //编辑
+    table_edit(row) {
+      this.dialog.show = true;
+      this.$nextTick(() => {
+        this.$refs.saveDialog.open("edit").setData(row);
+      });
+    },
+    //删除
+    async table_del(row) {
+      await this.$API.wing.post(
+        "RemoveAdminAsync",
+        {
+          AdminCode: row.AdminCode,
+        },
+        this.refresh
+      );
+    },
+    //分配角色
+    assignRole() {
+      this.dialog.showRole = true;
+      this.$nextTick(() => {
+        var roleCode = "";
+        if (this.selection.length == 1) {
+          roleCode = this.selection[0].DefaultRoleCode;
+        }
+        this.$refs.saveRoleDialog.open().setData(roleCode);
+      });
+    },
+    //保存角色
+    async saveRole(selectCode) {
+      if (this.selection.length == 0) {
+        return;
+      }
+      var adminCodes = this.selection.map((x) => x.AdminCode);
+      await this.$API.wing.post(
+        "ModifyAdminsRoles",
+        {
+          AdminCodes: adminCodes,
+          AdminRoleCodes: [selectCode],
+        },
+        this.refresh
+      );
+    },
+    //表格选择后回调事件
+    selectionChange(selection) {
+      this.selection = selection;
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 175 - 0
VinnoManagementSystem/src/views/adminManage/saveAdmin.vue

@@ -0,0 +1,175 @@
+<template>
+  <el-dialog
+    :title="titleMap[mode]"
+    v-model="visible"
+    :width="500"
+    destroy-on-close
+    @closed="$emit('closed')"
+  >
+    <el-form
+      :model="form"
+      :rules="rules"
+      ref="dialogForm"
+      label-width="150px"
+      label-position="left"
+    >
+      <el-form-item :label="$t('admin.AccountName')" prop="AdminName">
+        <el-input
+          v-model="form.AdminName"
+          clearable
+          :placeholder="$t('admin.AccountName')"
+          style="width: 60%"
+        ></el-input>
+      </el-form-item>
+      <el-form-item v-if="mode == 'add'" :label="$t('admin.password1')">
+        <el-input
+          v-model="form.Password1"
+          clearable
+          :placeholder="$t('admin.password1')"
+          style="width: 60%"
+        ></el-input>
+      </el-form-item>
+      <el-form-item v-if="mode == 'add'" :label="$t('admin.password2')">
+        <el-input
+          v-model="form.Password2"
+          clearable
+          :placeholder="$t('admin.password2')"
+          style="width: 60%"
+        ></el-input>
+      </el-form-item>
+      <el-form-item :label="$t('admin.FullName')">
+        <el-input
+          v-model="form.AdminFullName"
+          clearable
+          :placeholder="$t('admin.FullName')"
+          style="width: 60%"
+        ></el-input>
+      </el-form-item>
+      <el-form-item :label="$t('admin.adminRoleQuery')" prop="ParentCode">
+        <el-select v-model="form.AdminRoleCode" clearable style="width: 60%">
+          <el-option
+            v-for="item in adminRoleCodes"
+            :key="item.Key"
+            :label="item.Value"
+            :value="item.Key"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <el-button @click="visible = false">{{
+        $t("dialogBox.cancelButtonText")
+      }}</el-button>
+      <el-button
+        v-if="mode != 'show'"
+        type="primary"
+        :loading="isSaveing"
+        @click="submit()"
+        >{{ this.$t("dialogBox.saveButtonText") }}</el-button
+      >
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  emits: ["success", "closed"],
+  data() {
+    return {
+      mode: "add",
+      titleMap: {
+        add: this.$t("dialogBox.addTitle"),
+        edit: this.$t("dialogBox.modifyTitle"),
+      },
+      visible: false,
+      isSaveing: false,
+      adminRoleCodes: [],
+      //表单数据
+      form: {
+        AdminName: "",
+        Password1: "",
+        Password2: "",
+        AdminFullName: "",
+        AdminRoleCode: "",
+        AdminCode: "",
+      },
+      //验证规则
+      rules: {
+        AdminName: [
+          {
+            required: true,
+            message: this.$t("admin.AccountName"),
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    //显示
+    open(mode = "add") {
+      this.mode = mode;
+      this.visible = true;
+      this.initRoles();
+      return this;
+    },
+    //表单提交方法
+    submit() {
+      this.$refs.dialogForm.validate(async (valid) => {
+        if (valid) {
+          this.isSaveing = true;
+          var res = false;
+          //新增或者修改
+          if (this.mode === "add") {
+            if (this.form.Password1 != this.form.Password2) {
+              this.$alert(
+                this.$t("admin.passwordVaild"),
+                this.$t("dialogBox.confirmWarningTitle"),
+                {
+                  type: "error",
+                }
+              );
+              this.isSaveing = false;
+              return false;
+            }
+            res = await this.$API.adminManage.createAdmin.post(this.form);
+          } else {
+            res = await this.$API.adminManage.modifyAdmin.post(this.form);
+          }
+          this.isSaveing = false;
+          if (res==true) {
+            this.$emit("success");
+            this.visible = false;
+            this.$message.success(this.$t("response.operateSuccess"));
+          } else {
+            this.$alert(res.message, this.$t("dialogBox.confirmWarningTitle"), {
+              type: "error",
+            });
+          }
+        }
+      });
+    },
+    //表单注入数据
+    async setData(data) {
+      var res = await this.$API.wing.post("FindAdminByCodeAsync", {
+        AdminCode: data.AdminCode,
+      });
+	  this.form.AdminCode = data.AdminCode;
+      this.form.AdminName = res.AdminName;
+      this.form.AdminFullName = res.FullName;
+      if (res.RoleCodes != null && res.RoleCodes.length > 0) {
+        this.form.AdminRoleCode = res.RoleCodes[0];
+      }
+      this.form.Password1 = res.SecretPassword;
+      this.form.Password2 = res.SecretPassword;
+    },
+    async initRoles() {
+      this.adminRoleCodes =
+        await this.$API.adminManage.adminRoleSelectList.post();
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 124 - 0
VinnoManagementSystem/src/views/adminManage/saveRole.vue

@@ -0,0 +1,124 @@
+<template>
+  <el-dialog
+    :title="$t('admin.assignRole')"
+    v-model="visible"
+    :width="800"
+    destroy-on-close
+    @closed="$emit('closed')"
+  >
+    <el-container>
+      <el-main class="nopadding">
+        <div>
+         
+          <el-button
+            v-for="item in RoleItems"
+            :key="item.roleName"
+            :type="item.type"
+            :plain="item.type === 'success'||item.roleCode == selectCode ? false : true"
+            color="#66b1ff"
+            @click="handleTagSelected"
+          >
+            {{ item.roleName }}
+          </el-button>
+        </div>
+      </el-main>
+    </el-container>
+
+    <template #footer>
+      <el-button @click="visible = false">{{
+        $t("dialogBox.cancelButtonText")
+      }}</el-button>
+      <el-button type="primary" :loading="isSaveing" @click="submit()">{{
+        $t("dialogBox.saveButtonText")
+      }}</el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      visible: false,
+      selectCode: "",
+      RoleItems: [],
+      adminRoles: [],
+    };
+  },
+  methods: {
+    open(seletcCode) {
+      this.visible = true;
+      this.initRoles();
+      this.selectCode = seletcCode
+      return this;
+    },
+    setData(selectCode) {
+      this.selectCode = selectCode;
+    },
+    submit() {
+      this.$emit("success", this.selectCode);
+      this.visible = false;
+    },
+    async initRoles() {
+      this.adminRoles = await this.$API.adminManage.adminRoleSelectList.post();
+      if (this.adminRoles != null && this.adminRoles.length > 0) {
+        this.adminRoles.map((item) => {
+          var temp = JSON.parse(JSON.stringify(item)); // 为了防止错误发生,采用深拷贝
+          var tagTemp = {
+            type: "info",
+            roleName: temp.Value,
+            roleCode: temp.Key,
+            selectStatus: "dark",
+          };
+          this.RoleItems.push(tagTemp);
+        });
+      }
+    },
+    handleTagSelected(a) {
+      var curRoleName = a.target.innerText;
+      this.handlerFilterTag(curRoleName);
+    },
+    handlerFilterTag(curRoleName) {
+      this.selectCode = "";
+      if (this.RoleItems != null && this.RoleItems.length > 0) {
+        var newRoleItems = [];
+        this.RoleItems.map((item) => {
+          var temp = JSON.parse(JSON.stringify(item)); // 为了防止错误发生,采用深拷贝
+          if (curRoleName === temp.roleName) {
+            temp.type = "success";
+            this.selectCode = temp.roleCode;
+          } else {
+            temp.type = "info";
+          }
+          newRoleItems.push(temp);
+        });
+        this.RoleItems = newRoleItems;
+      }
+    },
+    //搜索
+    upsearch() {
+      this.$refs.table.upData(this.search);
+    },
+    //刷新当前页
+    refresh() {
+      this.$refs.table.refresh();
+    },
+  },
+};
+</script>
+
+<style>
+.tag-group__title {
+  font-size: 16px;
+  color: #303133;
+  font-weight: 700;
+}
+.tag-group__label {
+  margin: 5px;
+  height: 38px;
+  line-height: 36px;
+  min-width: 100px;
+  text-align: center;
+  cursor: pointer;
+}
+</style>

+ 84 - 15
VinnoManagementSystem/src/views/organizationManage/organizationList.vue

@@ -16,7 +16,7 @@
           type="primary"
           icon="el-icon-share"
           :disabled="selection.length == 0"
-          @click="add"
+          @click="table_saveAdmin"
           >{{ $t("organization.AssignAdmin") }}</el-button
         >
       </div>
@@ -73,6 +73,7 @@
         row-key="UserCode"
         @selection-change="selectionChange"
         stripe
+        :hideDo="true"
       >
         <el-table-column type="selection" width="50"></el-table-column>
         <el-table-column
@@ -140,7 +141,7 @@
           :label="$t('operate')"
           fixed="right"
           align="center"
-          width="200"
+          width="210"
         >
           <template #default="scope">
             <!-- 编辑 -->
@@ -176,23 +177,20 @@
             <el-divider direction="vertical"></el-divider>
             <el-dropdown>
               <el-button type="text" size="small"
-                >更多<el-icon class="el-icon--right"
+                >{{$t('more')}}<el-icon class="el-icon--right"
                   ><el-icon-arrow-down /></el-icon
               ></el-button>
               <template #dropdown>
                 <el-dropdown-menu>
-                  <el-dropdown-item
-                    @click="table_setDirector(scope.row, scope.$index)"
-                    >{{ $t("organization.SetDirector") }}</el-dropdown-item
-                  >
-                  <el-dropdown-item
-                    @click="table_Setting(scope.row, 0)"
-                    >{{ $t("organization.Setting0") }}</el-dropdown-item
-                  >
-                  <el-dropdown-item
-                    @click="table_Setting(scope.row, 1)"
-                    >{{ $t("organization.Setting1") }}</el-dropdown-item
-                  >
+                  <el-dropdown-item @click="table_saveUser(scope.row)">{{
+                    $t("organization.SetDirector")
+                  }}</el-dropdown-item>
+                  <el-dropdown-item @click="table_Setting(scope.row, 0)">{{
+                    $t("organization.Setting0")
+                  }}</el-dropdown-item>
+                  <el-dropdown-item @click="table_Setting(scope.row, 1)">{{
+                    $t("organization.Setting1")
+                  }}</el-dropdown-item>
                 </el-dropdown-menu>
               </template>
             </el-dropdown>
@@ -213,22 +211,40 @@
     ref="saveSetting"
     @closed="dialog.showSetting = false"
   ></save-setting>
+  <save-admin
+    v-if="dialog.showAdmin"
+    ref="saveAdmin"
+    @success="saveAdmin"
+    @closed="dialog.showAdmin = false"
+  ></save-admin>
+  <save-user
+    v-if="dialog.showUser"
+    ref="saveUser"
+    @success="saveUser"
+    @closed="dialog.showUser = false"
+  ></save-user>
 </template>
 
 <script>
 import saveDialog from "./saveOrganization";
 import saveSetting from "./saveSetting";
+import saveAdmin from "@/components/admin/selectAdmin";
+import saveUser from "@/components/user/selectUser";
 
 export default {
   components: {
     saveDialog,
     saveSetting,
+    saveAdmin,
+    saveUser,
   },
   data() {
     return {
       dialog: {
         show: false,
         showSetting: false,
+        showAdmin: false,
+        showUser: false,
       },
       apiObj: this.query,
       search: {
@@ -239,6 +255,7 @@ export default {
       stateTypes: ["WaitAudit", "Audited", "Rejected"],
       selection: [],
       confirmDel: this.$t("organization.ConfirmDelete"),
+      organizationCode: "",
     };
   },
   methods: {
@@ -274,6 +291,58 @@ export default {
         this.$refs.saveSetting.open(type).setData(row);
       });
     },
+    //分配管理员
+    table_saveAdmin() {
+      this.dialog.showAdmin = true;
+      this.$nextTick(() => {
+        var adminCode = "";
+        if (this.selection.length == 1) {
+          adminCode =
+            this.selection[0].AssignedAdmins &&
+            this.selection[0].AssignedAdmins[0];
+        }
+        this.$refs.saveAdmin.open().setData(adminCode);
+      });
+    },
+    //保存管理员
+    async saveAdmin(selectCode) {
+      if (this.selection.length == 0) {
+        return;
+      }
+      var organizationCodes = this.selection.map((x) => x.OrganizationCode);
+      await this.$API.wing.post(
+        "AssignedAdminsToOrganizationsAsync",
+        {
+          OrganizationCodes: organizationCodes,
+          AssignedAdmins: [selectCode],
+        },
+        this.refresh
+      );
+    },
+    //分配责任人
+    table_saveUser(row) {
+      this.dialog.showUser = true;
+      this.organizationCode = row.OrganizationCode;
+        console.log(row)
+      this.$nextTick(() => {
+        var director = "";
+        if (row.Directors.length == 1) {
+          director = row.Directors[0];
+        }
+        this.$refs.saveUser.open().setData(row.OrganizationCode, director);
+      });
+    },
+    //保存责任人
+    async saveUser(selectCode) {
+      await this.$API.wing.post(
+        "ModifyOrganizationDirectorsAsync",
+        {
+          OrganizationCode: this.organizationCode,
+          Directors: [selectCode],
+        },
+        this.refresh
+      );
+    },
     //审核
     table_audit(row) {
       this.$confirm(this.$t("organization.ApproveOrgMsg"), this.$t("audit"), {

+ 6 - 7
VinnoManagementSystem/src/views/organizationManage/saveOrganization.vue

@@ -29,11 +29,10 @@
           v-model="form.OrganizationName"
           clearable
           :placeholder="$t('organization.OrgNameRequire')"
-          style="width: 60%"
         ></el-input>
       </el-form-item>
       <el-form-item :label="$t('organization.PatientType')" prop="PatientType">
-        <el-select v-model="form.PatientType" style="width: 60%">
+        <el-select v-model="form.PatientType" style="width: 100%">
           <el-option
             :label="$t('organization.PatientType0')"
             :value="0"
@@ -49,7 +48,7 @@
         <el-select
           v-model="form.CountryCode"
           @change="changeCountry"
-          style="width: 60%"
+          style="width: 100%"
         >
           <el-option
             v-for="item in countries"
@@ -68,7 +67,7 @@
           v-model="form.ProvinceCode"
           @change="changePovince"
           clearable
-          style="width: 60%"
+          style="width: 100%"
         >
           <el-option
             v-for="item in provinces"
@@ -84,7 +83,7 @@
           v-model="form.CityCode"
           @change="changeCity"
           clearable
-          style="width: 60%"
+          style="width: 100%"
         >
           <el-option
             v-for="item in cities"
@@ -99,7 +98,7 @@
         :label="$t('organization.FrontOrganization')"
         prop="ParentCode"
       >
-        <el-select v-model="form.ParentCode" clearable style="width: 60%">
+        <el-select v-model="form.ParentCode" clearable style="width: 100%">
           <el-option
             v-for="item in organizations"
             :key="item.Key"
@@ -170,7 +169,7 @@ export default {
             : "ModifyOrganizationAsync";
           await this.$API.wing.post(method, this.form, () => {
             this.$emit("success");
-            this.$message.success("操作成功");
+            this.$message.success(this.$t('response.operateSuccess'));
             this.visible = false;
           });
           this.isSaveing = false;

+ 2 - 7
VinnoManagementSystem/src/views/organizationManage/saveSetting.vue

@@ -14,11 +14,7 @@
       label-position="right"
     >
       <el-form-item :label="$t('version')" prop="SettingVersion">
-        <el-input
-          v-model="form.SettingVersion"
-          disabled
-          style="width: 70%"
-        ></el-input>
+        <el-input v-model="form.SettingVersion" disabled></el-input>
       </el-form-item>
       <el-form-item
         :label="$t('organization.Setting' + settingType)"
@@ -29,7 +25,6 @@
           :autosize="{ minRows: 5, maxRows: 10 }"
           type="textarea"
           class="filter-item"
-          style="width: 70%"
         ></el-input>
       </el-form-item>
     </el-form>
@@ -72,7 +67,7 @@ export default {
             "ModifyOrganizationSetting",
             this.form,
             () => {
-              this.$message.success("操作成功");
+              this.$message.success(this.$t("response.operateSuccess"));
               this.visible = false;
             }
           );

+ 206 - 0
VinnoManagementSystem/src/views/userManage/authority.vue

@@ -0,0 +1,206 @@
+<template>
+  <el-container>
+    <el-aside width="300px" v-loading="menuloading">
+      <el-container>
+        <el-header>
+          <el-input
+            :placeholder="$t('pleaseInput')"
+            v-model="menuFilterText"
+            clearable
+          ></el-input>
+        </el-header>
+        <el-main class="nopadding">
+          <el-tree
+            ref="menu"
+            class="menu"
+            node-key="MenuId"
+            :data="menuList"
+            :props="menuProps"
+            highlight-current
+            default-expand-all
+            :expand-on-click-node="false"
+            check-strictly
+            :filter-node-method="menuFilterNode"
+            @node-click="menuClick"
+            @node-drop="nodeDrop"
+          >
+            <template #default="{ node, data }">
+              <span class="custom-tree-node el-tree-node__label">
+                <span class="label">
+                  {{ node.label }}
+                </span>
+                <span class="do">
+                  <el-icon @click.stop="add(node, data)"
+                    ><el-icon-plus
+                  /></el-icon>
+                </span>
+              </span>
+            </template>
+          </el-tree>
+        </el-main>
+        <el-footer style="height: 51px">
+          <el-button
+            type="primary"
+            size="small"
+            icon="el-icon-plus"
+            @click="add()"
+          ></el-button>
+        </el-footer>
+      </el-container>
+    </el-aside>
+    <el-container>
+      <el-main class="nopadding" style="padding: 20px" ref="main">
+        <save ref="save" :menu="menuList" @success="getMenu"></save>
+      </el-main>
+    </el-container>
+  </el-container>
+</template>
+
+<script>
+let newMenuIndex = 1;
+import save from "./saveAuthority";
+import common from "@/utils/common";
+
+export default {
+  name: "settingMenu",
+  components: {
+    save,
+  },
+  data() {
+    return {
+      menuloading: false,
+      menuList: [],
+      menuProps: {
+        label: function (a) {
+          return `${a.Label}${a.UniqueCode ? `(${a.UniqueCode})` : ""}`;
+        },
+        id: "Id",
+        children: "Children",
+      },
+      menuFilterText: "",
+    };
+  },
+  watch: {
+    menuFilterText(val) {
+      this.$refs.menu.filter(val);
+    },
+  },
+  mounted() {
+    this.getMenu();
+  },
+  methods: {
+    //加载树数据
+    async getMenu() {
+      this.menuloading = true;
+      var menuList = await this.$API.wing.post("GetUserFeatureList");
+      menuList.forEach((m) => {
+        m.MenuId = m.Id;
+      });
+      this.menuList = menuList;
+      this.menuloading = false;
+    },
+    //树点击
+    menuClick(data) {
+      this.$refs.save.setData(data, true);
+      this.$refs.main.$el.scrollTop = 0;
+    },
+    //树过滤
+    menuFilterNode(value, data) {
+      if (!value) return true;
+      var targetText = `${data.Label}${
+        data.UniqueCode ? `(${data.UniqueCode})` : ""
+      }`;
+      return targetText.indexOf(value) !== -1;
+    },
+    //树拖拽
+    nodeDrop(draggingNode, dropNode, dropType) {
+      this.$refs.save.setData({});
+      this.$message(
+        `拖拽对象:${draggingNode.data.meta.title}, 释放对象:${dropNode.data.meta.title}, 释放对象的位置:${dropType}`
+      );
+    },
+    //增加
+    async add(node) {
+      var newMenuData = {
+        MenuId: common.guid(),
+        Label: `未命名${newMenuIndex++}`,
+        FatherCode: node?.data?.Id,
+      };
+
+      this.$refs.menu.append(newMenuData, node);
+      this.$refs.menu.setCurrentKey(newMenuData.MenuId);
+      this.$refs.save.setData(newMenuData);
+    },
+    //删除菜单
+    async delMenu() {
+      var CheckedNodes = this.$refs.menu.getCheckedNodes();
+      if (CheckedNodes.length == 0) {
+        this.$message.warning("请选择需要删除的项");
+        return false;
+      }
+
+      var confirm = await this.$confirm("确认删除已选择的菜单吗?", "提示", {
+        type: "warning",
+        confirmButtonText: "删除",
+        confirmButtonClass: "el-button--danger",
+      }).catch(() => {});
+      if (confirm != "confirm") {
+        return false;
+      }
+
+      this.menuloading = true;
+      var reqData = {
+        ids: CheckedNodes.map((item) => item.id),
+      };
+      var res = await this.$API.demo.post.post(reqData);
+      this.menuloading = false;
+
+      if (res.code == 200) {
+        CheckedNodes.forEach((item) => {
+          var node = this.$refs.menu.getNode(item);
+          if (node.isCurrent) {
+            this.$refs.save.setData({});
+          }
+          this.$refs.menu.remove(item);
+        });
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+  },
+};
+</script>
+
+<style scoped>
+.custom-tree-node {
+  display: flex;
+  flex: 1;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 24px;
+  height: 100%;
+}
+.custom-tree-node .label {
+  display: flex;
+  align-items: center;
+  height: 100%;
+}
+.custom-tree-node .label .el-tag {
+  margin-left: 5px;
+}
+.custom-tree-node .do {
+  display: none;
+}
+.custom-tree-node .do i {
+  margin-left: 5px;
+  color: #999;
+}
+.custom-tree-node .do i:hover {
+  color: #333;
+}
+
+.custom-tree-node:hover .do {
+  display: inline-block;
+}
+</style>

+ 94 - 0
VinnoManagementSystem/src/views/userManage/saveAuthority.vue

@@ -0,0 +1,94 @@
+<template>
+  <h2>{{ $t(isEdit ? "edit" : "create") }}</h2>
+  <el-form
+    :model="form"
+    :rules="rules"
+    ref="dialogForm"
+    label-width="100px"
+    label-position="right"
+  >
+    <el-form-item :label="$t('user.authorityName')" prop="FeatureName">
+      <el-input
+        v-model="form.FeatureName"
+        clearable
+        :placeholder="$t('user.authorityName')"
+      ></el-input>
+    </el-form-item>
+    <!-- <el-form-item label="上级菜单" prop="parentId">
+      <el-cascader
+        v-model="form.parentId"
+        :options="menuOptions"
+        :props="menuProps"
+        :show-all-levels="false"
+        placeholder="顶级菜单"
+        clearable
+        disabled
+      ></el-cascader>
+    </el-form-item> -->
+    <el-form-item :label="$t('user.uniqueCode')" prop="UniqueCode">
+      <el-input
+        v-model="form.UniqueCode"
+        :placeholder="$t('user.uniqueCode')"
+      ></el-input>
+      <div class="el-form-item-msg">
+        {{ $t("user.uniqueCodeTip") }}
+      </div>
+    </el-form-item>
+    <el-form-item>
+      <el-button type="primary" @click="save" :loading="loading"
+        >保 存</el-button
+      >
+    </el-form-item>
+  </el-form>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      isEdit: false,
+      form: {},
+      loading: false,
+    };
+  },
+  mounted() {},
+  methods: {
+    //保存
+    async save() {
+      this.loading = true;
+      var method = this.isEdit ? "ModifyUserFeature" : "CreateUserFeature";
+      await this.$API.wing.post(method, this.form, () => {
+        this.loading = false;
+        this.$message.success(this.$t("response.operateSuccess"));
+        this.$emit("success");
+      });
+    },
+    //表单注入数据
+    setData(data) {
+      this.isEdit = !!data.Id;
+      var form = JSON.parse(JSON.stringify(data));
+      form.FeatureCode = form.Id;
+      form.FeatureName = form.Label;
+      this.form = form;
+    },
+  },
+};
+</script>
+
+<style scoped>
+h2 {
+  font-size: 17px;
+  color: #3c4a54;
+  padding: 0 0 30px 0;
+}
+.apilist {
+  border-left: 1px solid #eee;
+}
+
+[data-theme="dark"] h2 {
+  color: #fff;
+}
+[data-theme="dark"] .apilist {
+  border-color: #434343;
+}
+</style>