Просмотр исходного кода

You can only authorize a certain item catalog for members
可以只给成员授权某个项目目录

star7th 5 лет назад
Родитель
Сommit
78ab9ff5ff

BIN
Sqlite/showdoc.db.php


+ 2 - 0
server/Application/Api/Controller/CatalogController.class.php

@@ -13,6 +13,7 @@ class CatalogController extends BaseController {
         }
         if ($item_id > 0 ) {
             $ret = D("Catalog")->getList($item_id);
+            $ret = D("Catalog")->filteMemberCat($login_user['uid'] , $ret);
         }
         if ($ret) {
            $this->sendResult($ret);
@@ -31,6 +32,7 @@ class CatalogController extends BaseController {
         }
         if ($item_id > 0 ) {
             $ret = D("Catalog")->getList($item_id,true);
+            $ret = D("Catalog")->filteMemberCat($login_user['uid'] , $ret);
         }
         if ($ret) {
            $this->sendResult($ret);

+ 3 - 0
server/Application/Api/Controller/ItemController.class.php

@@ -67,6 +67,9 @@ class ItemController extends BaseController {
             $menu['pages'] = $pages ? $pages : array();
         }else{
             $menu = D("Item")->getMemu($item_id) ;
+            if($uid > 0 ){
+                $menu = D("Item")->filteMemberItem($uid , $item_id , $menu);
+            }
         }
 
         $domain = $item['item_domain'] ? $item['item_domain'] : $item['item_id'];

+ 11 - 1
server/Application/Api/Controller/MemberController.class.php

@@ -8,6 +8,7 @@ class MemberController extends BaseController {
     public function save(){ 
         $member_group_id =  I("member_group_id/d");
         $item_id = I("item_id/d");  
+        $cat_id = I("cat_id/d") ?  I("cat_id/d") : 0 ;
         $login_user = $this->checkLogin();
         $uid = $login_user['uid'] ;
         if(!$this->checkItemCreator($uid , $item_id)){
@@ -31,6 +32,7 @@ class MemberController extends BaseController {
             $data['uid'] = $member['uid'] ;
             $data['item_id'] = $item_id ;
             $data['member_group_id'] = $member_group_id ;
+            $data['cat_id'] = $cat_id ;
             $data['addtime'] = time() ; 
             $id = D("ItemMember")->add($data); 
         }
@@ -58,7 +60,15 @@ class MemberController extends BaseController {
         if ($ret) {
             foreach ($ret as $key => &$value) {
                 $value['addtime'] = date("Y-m-d H:i:s",$value['addtime']);
-                $value['member_group'] = $value['member_group_id'] == 1 ? "编辑" :"只读"; 
+                $value['member_group'] = $value['member_group_id'] == 1 ? "编辑" :"只读";
+                $value['cat_name'] = '所有目录';
+                if($value['cat_id'] > 0 ){
+                    $row = D("Catalog")->where(" cat_id = '$value[cat_id]' ")->find() ;
+                    if ( $row &&  $row['cat_name'] ){
+                        $value['cat_name'] =  $row['cat_name'] ;
+                    }
+                }
+                $value['member_group'] = $value['member_group_id'] == 1 ? "编辑/目录:{$value['cat_name']}" :"只读/目录:{$value['cat_name']}"; 
             }
         }
         $this->sendResult($ret);

+ 14 - 2
server/Application/Api/Controller/TeamItemMemberController.class.php

@@ -14,6 +14,7 @@ class TeamItemMemberController extends BaseController {
 
         $id = I("id/d");
         $member_group_id = I("member_group_id/d");
+        $cat_id = I("cat_id/d");
 
         $teamItemMemberInfo = D("TeamItemMember")->where(" id = '$id'  ")->find();
         $item_id = $teamItemMemberInfo['item_id'] ;
@@ -31,8 +32,12 @@ class TeamItemMemberController extends BaseController {
             return ;
         } 
 
-        $return = D("TeamItemMember")->where(" id = '$id' ")->save(array("member_group_id"=>$member_group_id));
-
+        if(isset($_POST['member_group_id'])){
+            $return = D("TeamItemMember")->where(" id = '$id' ")->save(array("member_group_id"=>$member_group_id));
+        }
+        if(isset($_POST['cat_id'])){
+            $return = D("TeamItemMember")->where(" id = '$id' ")->save(array("cat_id"=>$cat_id));
+        }
         $this->sendResult($return);
         
     }
@@ -55,6 +60,13 @@ class TeamItemMemberController extends BaseController {
         if ($ret) {
             foreach ($ret as $key => &$value) {
                 $value['addtime'] = date("Y-m-d H:i:s" , $value['addtime']);
+                $value['cat_name'] = '所有目录';
+                if($value['cat_id'] > 0 ){
+                    $row = D("Catalog")->where(" cat_id = '$value[cat_id]' ")->find() ;
+                    if ( $row &&  $row['cat_name'] ){
+                        $value['cat_name'] =  $row['cat_name'] ;
+                    }
+                }
             }
            $this->sendResult($ret);
         }else{

+ 28 - 0
server/Application/Api/Model/CatalogModel.class.php

@@ -134,7 +134,35 @@ class CatalogModel extends BaseModel {
 
 	}
 
+	//根据用户目录权限来过滤目录数据
+	public function filteMemberCat($uid  , $catData){
+		if(!$catData || !$catData[0]['item_id']){
+			return $catData ;
+		}
+		$item_id = $catData[0]['item_id'] ;
+		$cat_id = 0 ;
+		//首先看是否被添加为项目成员
+		$itemMember = D("ItemMember")->where("uid = '$uid' and item_id = '$item_id' ")->find() ;
+		if($itemMember && $itemMember['cat_id'] > 0 ){
+				$cat_id = $itemMember['cat_id'] ;
+		}
+		//再看是否添加为团队-项目成员
+		$teamItemMember = D("TeamItemMember")->where("member_uid = '$uid' and item_id = '$item_id' ")->find() ;
+		if($teamItemMember && $teamItemMember['cat_id'] > 0 ){
+				$cat_id = $teamItemMember['cat_id'] ;
+		}
+		//开始根据cat_id过滤
+		if($cat_id > 0 ){
+			foreach ($catData as $key => $value) {
+					if( $value['cat_id'] != $cat_id){
+							unset($catData[$key]);
+					}
+			}
+			$catData = array_values($catData);
+		}
 
+		return $catData ;
+	}
 	
 
 }

+ 33 - 1
server/Application/Api/Model/ItemModel.class.php

@@ -78,7 +78,7 @@ class ItemModel extends BaseModel {
                     "item_id"=>$item_id,
                     "addtime"=>time(),
                     );
-                D("ItemMember")->add($member_data);
+                 // 不再导入成员数据 D("ItemMember")->add($member_data);
             }
         }
         return $item_id;
@@ -251,4 +251,36 @@ class ItemModel extends BaseModel {
         return htmlspecialchars(htmlspecialchars_decode($str));
     }
 
+
+    //根据用户目录权限来过滤项目数据
+    public function filteMemberItem($uid , $item_id , $menuData){
+        if(!$menuData || !$menuData['catalogs']){
+            return $menuData ;
+        }
+
+        $cat_id = 0 ;
+        //首先看是否被添加为项目成员
+        $itemMember = D("ItemMember")->where("uid = '$uid' and item_id = '$item_id' ")->find() ;
+        if($itemMember && $itemMember['cat_id'] > 0 ){
+            $cat_id = $itemMember['cat_id'] ;
+        }
+        //再看是否添加为团队-项目成员
+        $teamItemMember = D("TeamItemMember")->where("member_uid = '$uid' and item_id = '$item_id' ")->find() ;
+        if($teamItemMember && $teamItemMember['cat_id'] > 0 ){
+            $cat_id = $teamItemMember['cat_id'] ;
+        }
+        //开始根据cat_id过滤
+        if($cat_id > 0 ){
+            foreach ($menuData['catalogs'] as $key => $value) {
+                if( $value['cat_id'] != $cat_id){
+                    unset($menuData['catalogs'][$key]);
+                }
+            }
+            $menuData['catalogs'] = array_values($menuData['catalogs']);
+        }
+
+        return $menuData ;
+
+    }
+
 }

+ 12 - 0
server/Application/Home/Controller/UpdateController.class.php

@@ -249,6 +249,18 @@ class UpdateController extends BaseController {
             )";
         D("User")->execute($sql);
 
+        //item_member表增加cat_id字段
+        if (!$this->_is_column_exist("item_member","cat_id")) {
+            $sql = "ALTER TABLE ".C('DB_PREFIX')."item_member ADD cat_id INT( 10 ) NOT NULL DEFAULT '0'  ;";
+            D("User")->execute($sql);
+        }
+
+        //team_item_member表增加cat_id字段
+        if (!$this->_is_column_exist("team_item_member","cat_id")) {
+            $sql = "ALTER TABLE ".C('DB_PREFIX')."team_item_member ADD cat_id INT( 10 ) NOT NULL DEFAULT '0'  ;";
+            D("User")->execute($sql);
+        }
+
         echo "OK!\n";
     }
 

+ 65 - 2
web_src/src/components/item/setting/Member.vue

@@ -32,7 +32,7 @@
       height="200"
       style="width: 100%"
     >
-      <el-table-column prop="team_name" :label="'团队名'"></el-table-column>
+      <el-table-column prop="team_name" :label="$t('team_name')"></el-table-column>
       <el-table-column prop="addtime" :label="$t('add_time')"></el-table-column>
 
       <el-table-column prop :label="$t('operation')">
@@ -75,6 +75,16 @@
         <el-form-item label class="readonly-checkbox">
           <el-checkbox v-model="MyForm.is_readonly">{{$t('readonly')}}</el-checkbox>
         </el-form-item>
+        <el-form-item label>
+          <el-select v-model="MyForm.cat_id" :placeholder="$t('all_cat2')">
+            <el-option
+              v-for="item in catalogs"
+              :key="item.cat_id"
+              :label="item.cat_name"
+              :value="item.cat_id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
       </el-form>
 
       <p class="tips">{{$t('member_authority_tips')}}</p>
@@ -143,6 +153,23 @@
             </el-select>
           </template>
         </el-table-column>
+        <el-table-column prop="cat_id" :label="$t('catalog')" width="130">
+          <template slot-scope="scope">
+            <el-select
+              size="mini"
+              v-model="scope.row.cat_id"
+              @change="changeTeamItemMemberCat($event,scope.row.id)"
+              :placeholder="$t('please_choose')"
+            >
+              <el-option
+                v-for="item in catalogs"
+                :key="item.cat_id"
+                :label="item.cat_name"
+                :value="item.cat_id"
+              ></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
         <el-table-column prop="addtime" :label="$t('add_time')"></el-table-column>
       </el-table>
       <br />
@@ -253,6 +280,7 @@ export default {
       var params = new URLSearchParams()
       params.append('item_id', that.$route.params.item_id)
       params.append('username', this.MyForm.username)
+      params.append('cat_id', this.MyForm.cat_id)
       var member_group_id = 1
       if (this.MyForm.is_readonly) {
         member_group_id = 0
@@ -345,7 +373,7 @@ export default {
 
       that.axios.post(url, params).then(function(response) {
         if (response.data.error_code === 0) {
-          that.$message('权限保存成功')
+          that.$message(that.$t('auth_success'))
         } else {
           that.$alert(response.data.error_message)
         }
@@ -393,6 +421,40 @@ export default {
         }
       }
       return false
+    },
+    get_catalog() {
+      var that = this
+      var url = DocConfig.server + '/api/catalog/catListGroup'
+      var params = new URLSearchParams()
+      params.append('item_id', that.$route.params.item_id)
+      that.axios.post(url, params).then(function(response) {
+        if (response.data.error_code === 0) {
+          var Info = response.data.data
+          Info.unshift({
+            cat_id: '0',
+            cat_name: that.$t('all_cat')
+          })
+          that.catalogs = Info
+        } else {
+          that.$alert(response.data.error_message)
+        }
+      })
+    },
+    changeTeamItemMemberCat(cat_id, id) {
+      var that = this
+      var url = DocConfig.server + '/api/teamItemMember/save'
+
+      var params = new URLSearchParams()
+      params.append('cat_id', cat_id)
+      params.append('id', id)
+
+      that.axios.post(url, params).then(function(response) {
+        if (response.data.error_code === 0) {
+          that.$message(that.$t('cat_success'))
+        } else {
+          that.$alert(response.data.error_message)
+        }
+      })
     }
   },
 
@@ -401,6 +463,7 @@ export default {
     this.get_teams()
     this.getTeamItem()
     this.getAllUser()
+    this.get_catalog()
   }
 }
 </script>

+ 55 - 2
web_src/src/components/team/Item.vue

@@ -63,7 +63,7 @@
           style="width: 100%"
         >
           <el-table-column prop="member_username" :label="$t('username')"></el-table-column>
-          <el-table-column prop="member_group_id" :label="$t('authority')" width="130">
+          <el-table-column prop="member_group_id" :label="$t('authority')" width="100">
             <template slot-scope="scope">
               <el-select
                 size="mini"
@@ -80,6 +80,23 @@
               </el-select>
             </template>
           </el-table-column>
+          <el-table-column prop="cat_id" :label="$t('catalog')" width="130">
+            <template slot-scope="scope">
+              <el-select
+                size="mini"
+                v-model="scope.row.cat_id"
+                @change="changeTeamItemMemberCat($event,scope.row.id)"
+                :placeholder="$t('please_choose')"
+              >
+                <el-option
+                  v-for="item in catalogs"
+                  :key="item.cat_id"
+                  :label="item.cat_name"
+                  :value="item.cat_id"
+                ></el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column prop="addtime" :label="$t('add_time')"></el-table-column>
         </el-table>
         <br />
@@ -117,7 +134,8 @@ export default {
           label: '只读',
           value: '0'
         }
-      ]
+      ],
+      catalogs: []
     }
   },
   methods: {
@@ -198,6 +216,7 @@ export default {
     getTeamItemMember(item_id) {
       var that = this
       this.dialogFormTeamMemberVisible = true
+      this.get_catalog(item_id)
       var url = DocConfig.server + '/api/teamItemMember/getList'
       var params = new URLSearchParams()
       params.append('item_id', item_id)
@@ -226,6 +245,40 @@ export default {
           that.$alert(response.data.error_message)
         }
       })
+    },
+    changeTeamItemMemberCat(cat_id, id) {
+      var that = this
+      var url = DocConfig.server + '/api/teamItemMember/save'
+
+      var params = new URLSearchParams()
+      params.append('cat_id', cat_id)
+      params.append('id', id)
+
+      that.axios.post(url, params).then(function(response) {
+        if (response.data.error_code === 0) {
+          that.$message(that.$t('cat_success'))
+        } else {
+          that.$alert(response.data.error_message)
+        }
+      })
+    },
+    get_catalog(item_id) {
+      var that = this
+      var url = DocConfig.server + '/api/catalog/catListGroup'
+      var params = new URLSearchParams()
+      params.append('item_id', item_id)
+      that.axios.post(url, params).then(function(response) {
+        if (response.data.error_code === 0) {
+          var Info = response.data.data
+          Info.unshift({
+            cat_id: '0',
+            cat_name: that.$t('all_cat')
+          })
+          that.catalogs = Info
+        } else {
+          that.$alert(response.data.error_message)
+        }
+      })
     }
   },
 

+ 324 - 283
web_src/static/lang/en.js

@@ -1,330 +1,371 @@
 exports.__esModule = true
 exports.default = {
   // index
-  'help': 'Help',
-  'demo': 'Demo',
-  'index_login_or_register': 'Login / Register',
-  'my_item': 'My items',
-  'section_title1': 'ShowDoc',
-  'section_description1': ' A tool greatly applicable for an IT team',
-  'section_title2': 'API Document',
-  'section_description2': 'ShowDoc can compile exquisite API documents <br>in a very fast and convenient way',
-  'section_title3': 'Data Dictionary',
-  'section_description3': 'A good Data Dictionary can easily exhibit database structure to other people<br>ShowDoc can compile exquisite Data Dictionary',
-  'section_title4': 'Explanation Document',
-  'section_description4': 'You can absolutely use ShowDoc to compile the explanation documents for some tools',
-  'section_title5': 'Team Work',
-  'section_description5': 'Your team will work with ShowDoc together very well ',
-  'section_title6': 'Open Source',
-  'section_description6': 'ShowDoc is a free, open source tool that <br>you can deploy it to your own server',
-  'section_title7': 'Hosted online',
-  'section_description7': 'Www.showdoc.cc provide security and stability of the document hosting service',
-  'section_title8': 'Try it now',
-  'section_description8': 'Over 10000+ IT team is using ShowDoc',
+  help: 'Help',
+  demo: 'Demo',
+  index_login_or_register: 'Login / Register',
+  my_item: 'My items',
+  section_title1: 'ShowDoc',
+  section_description1: ' A tool greatly applicable for an IT team',
+  section_title2: 'API Document',
+  section_description2:
+    'ShowDoc can compile exquisite API documents <br>in a very fast and convenient way',
+  section_title3: 'Data Dictionary',
+  section_description3:
+    'A good Data Dictionary can easily exhibit database structure to other people<br>ShowDoc can compile exquisite Data Dictionary',
+  section_title4: 'Explanation Document',
+  section_description4:
+    'You can absolutely use ShowDoc to compile the explanation documents for some tools',
+  section_title5: 'Team Work',
+  section_description5: 'Your team will work with ShowDoc together very well ',
+  section_title6: 'Open Source',
+  section_description6:
+    'ShowDoc is a free, open source tool that <br>you can deploy it to your own server',
+  section_title7: 'Hosted online',
+  section_description7:
+    'Www.showdoc.cc provide security and stability of the document hosting service',
+  section_title8: 'Try it now',
+  section_description8: 'Over 10000+ IT team is using ShowDoc',
 
   // user
-  'login': 'Login',
-  'username': 'Username',
-  'password': 'Password',
-  'register_new_account': 'Register',
-  'forget_password': 'Forget password?',
-  'username_description': 'Username/Email',
-  'password_again': 'Input password again',
-  'verification_code': 'Verification code',
-  'register': 'Register',
-  'update_personal_info': 'Update personal info',
-  'submit': 'Submit',
-  'goback': 'Back',
-  'my_email': 'My email',
-  'input_email': 'Input email',
-  'input_login_password': 'Please enter your login password to verify',
-  'status': 'Status',
-  'status_1': 'Verified',
-  'status_2': 'Unverified',
-  'status_3': 'Unbound',
-  'binding': 'Binding',
-  'modify': 'Modify',
-  'modify_password': 'Modify password',
-  'old_password': 'Old password',
-  'new_password': 'New password',
-  'modify_success': 'Modify success!',
-  'update_email_success': 'Update your mailbox successfully! Please log in to check the email to check the email.',
+  login: 'Login',
+  username: 'Username',
+  password: 'Password',
+  register_new_account: 'Register',
+  forget_password: 'Forget password?',
+  username_description: 'Username/Email',
+  password_again: 'Input password again',
+  verification_code: 'Verification code',
+  register: 'Register',
+  update_personal_info: 'Update personal info',
+  submit: 'Submit',
+  goback: 'Back',
+  my_email: 'My email',
+  input_email: 'Input email',
+  input_login_password: 'Please enter your login password to verify',
+  status: 'Status',
+  status_1: 'Verified',
+  status_2: 'Unverified',
+  status_3: 'Unbound',
+  binding: 'Binding',
+  modify: 'Modify',
+  modify_password: 'Modify password',
+  old_password: 'Old password',
+  new_password: 'New password',
+  modify_success: 'Modify success!',
+  update_email_success:
+    'Update your mailbox successfully! Please log in to check the email to check the email.',
 
   // item/index
-  'personal_setting': 'Personal settings',
-  'web_home': 'Home',
-  'logout': 'Logout',
-  'add_an_item': 'Add an item',
-  'new_item': 'New item',
-  'feedback': 'Feedback',
-  'more': 'More',
-  'my_notice': 'My notice',
-  'item_setting': 'Item settings',
-  'item_top': 'Make item top',
-  'cancel_item_top': 'Cancel top',
+  personal_setting: 'Personal settings',
+  web_home: 'Home',
+  logout: 'Logout',
+  add_an_item: 'Add an item',
+  new_item: 'New item',
+  feedback: 'Feedback',
+  more: 'More',
+  my_notice: 'My notice',
+  item_setting: 'Item settings',
+  item_top: 'Make item top',
+  cancel_item_top: 'Cancel top',
 
   // item/add
-  'item_type1': 'Regular item',
-  'item_type2': 'Single item',
-  'item_name': 'Item name',
-  'item_description': 'Description',
-  'item_domain': 'Personalized domain name (optional)',
-  'item_domain_illegal': 'Personalized domain names can only be a combination of letters or numbers',
-  'domain_already_exists': 'Personal domain name already exists',
-  'visit_password_placeholder': 'Password',
-  'copy_exists_item': 'Copy existing item',
-  'please_choose': 'Please select',
-  'auto_db': 'Auto data dictionary',
+  item_type1: 'Regular item',
+  item_type2: 'Single item',
+  item_name: 'Item name',
+  item_description: 'Description',
+  item_domain: 'Personalized domain name (optional)',
+  item_domain_illegal:
+    'Personalized domain names can only be a combination of letters or numbers',
+  domain_already_exists: 'Personal domain name already exists',
+  visit_password_placeholder: 'Password',
+  copy_exists_item: 'Copy existing item',
+  please_choose: 'Please select',
+  auto_db: 'Auto data dictionary',
 
   // item/pwd
-  'input_visit_password': 'Input visit password',
+  input_visit_password: 'Input visit password',
 
   // item/export
-  'export_all': 'Export all',
-  'export_cat': 'export catalog',
-  'select_cat_2': 'Select catalog level2',
-  'select_cat_3': 'Select catalog level3',
-  'begin_export': 'Begin to export',
+  export_all: 'Export all',
+  export_cat: 'export catalog',
+  select_cat_2: 'Select catalog level2',
+  select_cat_3: 'Select catalog level3',
+  begin_export: 'Begin to export',
 
   // item/setting
-  'base_info': 'Base info',
-  'member_manage': 'Manage member',
-  'advance_setting': 'Advanced setting',
-  'open_api': 'open api',
-  'info_item_domain': 'Personal domain name',
-  'visit_password': 'Password',
-  'visit_password_description': '(Optional: private item required)',
-  'add_member': 'Add member',
-  'authority': 'Authority',
-  'add_time': 'Add time',
-  'operation': 'Operation',
-  'delete': 'Delete',
-  'input_target_member': "Input member's username",
-  'readonly': 'Read-only',
-  'member_authority_tips': 'Permission Description: The default member can create/edit the project page, and only delete the newly created/edited page when deleting. After checking the read-only attribute, the member can only view all pages, and cannot add/edit/delete',
-  'cancel': 'Cancel',
-  'confirm': 'Confirm',
-  'confirm_delete': 'Confirm to delete',
-  'attorn': 'Attorn',
-  'archive': 'Archive',
-  'attorn_tips': 'You can attorn item(s) to other user(s)',
-  'archive_tips': 'After archiving, the item will become read-only, and no more changes / additions can be made. If you want to edit it again, copy it to the new project and then edit it',
-  'delete_tips': 'After deleting it, it can not be restored!',
-  'attorn_username': 'Username of receiver',
-  'archive_tips2': 'Note: After archiving a project, the project will no longer be able to add and modify content and will not be able to unarchive. If you want to modify the content again, you can copy the project and modify it on the basis of the new project. The way to copy a project is to choose to copy from an existing project when you create the project.',
-  'success_jump': 'The operation is successful! Skipping...',
-  'reset_token': 'Reset token',
-  'open_api_tips1': 'Showdoc opens the API for document editing, making it easier for users to manipulate document data. <br>With the open API, you can do a lot of things automatically',
-  'open_api_tips2': 'If you want to automate the generation of API documentation, you can refer to<a target="_bank" href="https://www.showdoc.cc/page/741656402509783">API documentation</a>',
-  'open_api_tips3': 'If you want to automate the generation of a data dictionary, you can refer to<a target="_bank" href="https://www.showdoc.cc/page/312209902620725">Data dictionary</a>',
-  'open_api_tips4': 'If you are more free to generate the format you need, you can refer to<a target="_bank" href="https://www.showdoc.cc/page/102098">Open API</a>',
+  base_info: 'Base info',
+  member_manage: 'Manage member',
+  advance_setting: 'Advanced setting',
+  open_api: 'open api',
+  info_item_domain: 'Personal domain name',
+  visit_password: 'Password',
+  visit_password_description: '(Optional: private item required)',
+  add_member: 'Add member',
+  authority: 'Authority',
+  add_time: 'Add time',
+  operation: 'Operation',
+  delete: 'Delete',
+  input_target_member: "Input member's username",
+  readonly: 'Read-only',
+  member_authority_tips:
+    'Permission Description: The default member can create/edit the project page, and only delete the newly created/edited page when deleting. After checking the read-only attribute, the member can only view all pages, and cannot add/edit/delete',
+  cancel: 'Cancel',
+  confirm: 'Confirm',
+  confirm_delete: 'Confirm to delete',
+  attorn: 'Attorn',
+  archive: 'Archive',
+  attorn_tips: 'You can attorn item(s) to other user(s)',
+  archive_tips:
+    'After archiving, the item will become read-only, and no more changes / additions can be made. If you want to edit it again, copy it to the new project and then edit it',
+  delete_tips: 'After deleting it, it can not be restored!',
+  attorn_username: 'Username of receiver',
+  archive_tips2:
+    'Note: After archiving a project, the project will no longer be able to add and modify content and will not be able to unarchive. If you want to modify the content again, you can copy the project and modify it on the basis of the new project. The way to copy a project is to choose to copy from an existing project when you create the project.',
+  success_jump: 'The operation is successful! Skipping...',
+  reset_token: 'Reset token',
+  open_api_tips1:
+    'Showdoc opens the API for document editing, making it easier for users to manipulate document data. <br>With the open API, you can do a lot of things automatically',
+  open_api_tips2:
+    'If you want to automate the generation of API documentation, you can refer to<a target="_bank" href="https://www.showdoc.cc/page/741656402509783">API documentation</a>',
+  open_api_tips3:
+    'If you want to automate the generation of a data dictionary, you can refer to<a target="_bank" href="https://www.showdoc.cc/page/312209902620725">Data dictionary</a>',
+  open_api_tips4:
+    'If you are more free to generate the format you need, you can refer to<a target="_bank" href="https://www.showdoc.cc/page/102098">Open API</a>',
   // item/show
-  'item': 'Item',
-  'share': 'Share',
-  'export': 'Export',
-  'update_info': 'Update info',
-  'manage_members': 'Manage members',
-  'more_item': 'More item(s)',
-  'login_or_register': 'Login/Register',
-  'about_showdoc': 'About ShowDoc',
-  'new_page': 'New page',
-  'edit_page': 'Edit page',
-  'new_catalog': 'New/Manage catalog ',
-  'share_address_to_your_friends': 'Share the interface address to your friends',
-  'copy_interface_to_new': 'Copy this page to a new page',
-  'copy': 'Copy',
-  'edit': 'Edit',
-  'detail': 'Detail',
-  'delete_interface': 'Delete page',
-  'comfirm_delete': 'Comfirm to delete',
-  'item_address': 'Item address',
-  'copy_address_to_your_friends': 'You can copy the address to your friend',
-  'share_page': 'Share page',
-  'page_address': 'Page address',
-  'input_keyword': 'Press Enter to search',
-  'item_page_address': 'Item page address',
-  'single_page_address': 'Single page address',
-  'page_diff_tips': 'What is the difference between the project page address and the single page address?',
+  item: 'Item',
+  share: 'Share',
+  export: 'Export',
+  update_info: 'Update info',
+  manage_members: 'Manage members',
+  more_item: 'More item(s)',
+  login_or_register: 'Login/Register',
+  about_showdoc: 'About ShowDoc',
+  new_page: 'New page',
+  edit_page: 'Edit page',
+  new_catalog: 'New/Manage catalog ',
+  share_address_to_your_friends: 'Share the interface address to your friends',
+  copy_interface_to_new: 'Copy this page to a new page',
+  copy: 'Copy',
+  edit: 'Edit',
+  detail: 'Detail',
+  delete_interface: 'Delete page',
+  comfirm_delete: 'Comfirm to delete',
+  item_address: 'Item address',
+  copy_address_to_your_friends: 'You can copy the address to your friend',
+  share_page: 'Share page',
+  page_address: 'Page address',
+  input_keyword: 'Press Enter to search',
+  item_page_address: 'Item page address',
+  single_page_address: 'Single page address',
+  page_diff_tips:
+    'What is the difference between the project page address and the single page address?',
 
   // page
-  'title': 'Title',
-  'catalog': 'Catalog',
-  'level_2_directory': 'Level 2 catalog',
-  'level_3_directory': 'Level 3 catalog',
-  's_number': 'Order',
-  's_number_explain': 'The default is 99, the smaller the number, the earlier it is set.(optional)',
-  'optional': 'Optional',
-  'history_version': 'History version',
-  'save': 'Save',
-  'insert_apidoc_template': 'ApiDoc template',
-  'insert_database_doc_template': 'DatabaseDoc template',
-  'json_tools': 'Json tools',
-  'format_tools': 'Format tools',
-  'json_to_table': 'JSON to table',
-  'beautify_json': 'JSON beautify',
-  'beautify_json_description': 'Please paste a JSON script, the program will automatically format the display in an elegant way.',
-  'http_test_api': 'Test API online',
-  'json_to_table_description': 'Please paste a JSON script, the program will automatically parse the code and generate a parameter table. This feature is suitable for quickly writing back parameter tables for API documents.',
-  'update_time': 'Update time',
-  'update_by_who': 'Update by ',
-  'recover_to_this_version': 'Recover',
-  'close': 'Close',
-  'finish': 'Finish',
-  'params': 'params',
-  'clear': 'Clear',
-  'result': 'Result',
-  'save_to_templ': 'Save to template',
-  'more_templ': 'More templates',
-  'saved_templ_list': 'Template list',
-  'page_comments': 'Page comment',
-  'cur_page_content': 'Current newest version',
-  'overview': 'Overview',
-  'save_templ_title': 'Input template title',
-  'save_templ_text': 'The template has been saved. When you create or edit an edit page later, click the "More Templates" button to use your saved template.',
-  'welcome_use_showdoc': 'Welcome to ShowDoc!',
-  'templ_list': 'Template list',
-  'templ_title': 'Template title',
-  'no_templ_text': 'You have not saved any templates yet. You can click on the right side of the "Save" button while editing the page, and select "Save as template" from the drop-down menu. After saving the page content as a template, you can use your previously saved template the next time you create or edit a page.',
-  'save_time': 'Save time',
-  'insert_templ': 'Insert',
-  'delete_templ': 'Delete',
-  'save_success': 'Save success',
-  'paste_insert_table': 'Insert table from paste',
-  'paste_insert_table_tips': 'Paste (Ctrl + V) below an existing table data copied (Ctrl + C) from a spreadsheet (e.g. Microsoft Excel), a text document, a Markdown code, or even a website.',
+  title: 'Title',
+  catalog: 'Catalog',
+  level_2_directory: 'Level 2 catalog',
+  level_3_directory: 'Level 3 catalog',
+  s_number: 'Order',
+  s_number_explain:
+    'The default is 99, the smaller the number, the earlier it is set.(optional)',
+  optional: 'Optional',
+  history_version: 'History version',
+  save: 'Save',
+  insert_apidoc_template: 'ApiDoc template',
+  insert_database_doc_template: 'DatabaseDoc template',
+  json_tools: 'Json tools',
+  format_tools: 'Format tools',
+  json_to_table: 'JSON to table',
+  beautify_json: 'JSON beautify',
+  beautify_json_description:
+    'Please paste a JSON script, the program will automatically format the display in an elegant way.',
+  http_test_api: 'Test API online',
+  json_to_table_description:
+    'Please paste a JSON script, the program will automatically parse the code and generate a parameter table. This feature is suitable for quickly writing back parameter tables for API documents.',
+  update_time: 'Update time',
+  update_by_who: 'Update by ',
+  recover_to_this_version: 'Recover',
+  close: 'Close',
+  finish: 'Finish',
+  params: 'params',
+  clear: 'Clear',
+  result: 'Result',
+  save_to_templ: 'Save to template',
+  more_templ: 'More templates',
+  saved_templ_list: 'Template list',
+  page_comments: 'Page comment',
+  cur_page_content: 'Current newest version',
+  overview: 'Overview',
+  save_templ_title: 'Input template title',
+  save_templ_text:
+    'The template has been saved. When you create or edit an edit page later, click the "More Templates" button to use your saved template.',
+  welcome_use_showdoc: 'Welcome to ShowDoc!',
+  templ_list: 'Template list',
+  templ_title: 'Template title',
+  no_templ_text:
+    'You have not saved any templates yet. You can click on the right side of the "Save" button while editing the page, and select "Save as template" from the drop-down menu. After saving the page content as a template, you can use your previously saved template the next time you create or edit a page.',
+  save_time: 'Save time',
+  insert_templ: 'Insert',
+  delete_templ: 'Delete',
+  save_success: 'Save success',
+  paste_insert_table: 'Insert table from paste',
+  paste_insert_table_tips:
+    'Paste (Ctrl + V) below an existing table data copied (Ctrl + C) from a spreadsheet (e.g. Microsoft Excel), a text document, a Markdown code, or even a website.',
   // catalog
-  'add_cat': 'Add catalog',
-  'cat_name': 'Catalog name',
-  'input_cat_name': 'Input catalog name',
-  'parent_cat_name': 'Parent catalog',
-  'none': 'none',
+  add_cat: 'Add catalog',
+  cat_name: 'Catalog name',
+  input_cat_name: 'Input catalog name',
+  parent_cat_name: 'Parent catalog',
+  none: 'none',
 
   // 其他
-  'back_to_top': 'Back to top',
-  'draft_tips': 'Your last draft is automatically saved. Do you want automatically fill this document in with the last draft?',
+  back_to_top: 'Back to top',
+  draft_tips:
+    'Your last draft is automatically saved. Do you want automatically fill this document in with the last draft?',
 
   // 管理后台
-  'management_backstage': 'Backstage',
-  'user_management': 'User(s)',
-  'item_management': 'Items',
-  'add_user': 'Add user',
-  'search': 'Search',
+  management_backstage: 'Backstage',
+  user_management: 'User(s)',
+  item_management: 'Items',
+  add_user: 'Add user',
+  search: 'Search',
 
-  'team_mamage': 'Manage Team(s)',
-  'background': 'Background',
-  'distribution_to_team': 'Distribution item',
-  'back_to_team': 'Back to team',
-  'check_item': 'Check item',
-  'unassign': 'Unassign',
-  'go_to_new_an_item': 'New item',
-  'confirm_unassign': 'Confirm unassign?',
-  'Join_time': 'Join time',
-  'add_team': 'Add team',
-  'member_authority': 'Member authority',
-  'go_to_new_an_team': 'New team',
-  'adjust_member_authority': 'Adjust member authority',
-  'team_member_empty_tips': 'The team does not have any members yet.',
-  'team_member_authority_tips': 'Permission description: The editing permission means that members can create/edit project pages, and when deleted, they can only delete their own newly created/edited pages. The read-only permission means that the member can only view all pages of this project and can not add/edit/delete them.',
-  'member': 'Member',
-  'team_item': 'Item',
-  'member_username': 'Member username',
-  'team_name': 'Team name',
-  'memberCount': 'Member count',
-  'itemCount': 'Item count',
-  'empty_team_tips': 'Welcome to the team management function. This function is well suited for collaborative management of team leader for multi person and cross team projects. Please click the top left button to add the team(s). After adding team(s), team members can be added or deleted at any time, allocated to different projects in batches, and member rights can be set in different projects. Compared with simple membership management mode, team management function can add and delete personnel in batches, which is more convenient for complex team cooperation.',
+  team_mamage: 'Manage Team(s)',
+  background: 'Background',
+  distribution_to_team: 'Distribution item',
+  back_to_team: 'Back to team',
+  check_item: 'Check item',
+  unassign: 'Unassign',
+  go_to_new_an_item: 'New item',
+  confirm_unassign: 'Confirm unassign?',
+  Join_time: 'Join time',
+  add_team: 'Add team',
+  member_authority: 'Member authority',
+  go_to_new_an_team: 'New team',
+  adjust_member_authority: 'Adjust member authority',
+  team_member_empty_tips: 'The team does not have any members yet.',
+  team_member_authority_tips:
+    'Permission description: The editing permission means that members can create/edit project pages, and when deleted, they can only delete their own newly created/edited pages. The read-only permission means that the member can only view all pages of this project and can not add/edit/delete them.',
+  member: 'Member',
+  team_item: 'Item',
+  member_username: 'Member username',
+  team_name: 'Team name',
+  memberCount: 'Member count',
+  itemCount: 'Item count',
+  empty_team_tips:
+    'Welcome to the team management function. This function is well suited for collaborative management of team leader for multi person and cross team projects. Please click the top left button to add the team(s). After adding team(s), team members can be added or deleted at any time, allocated to different projects in batches, and member rights can be set in different projects. Compared with simple membership management mode, team management function can add and delete personnel in batches, which is more convenient for complex team cooperation.',
 
-  'copy_link': 'Copy link',
-  'copy_success': 'Copy success',
+  copy_link: 'Copy link',
+  copy_success: 'Copy success',
 
-  'user_manage': 'User manage',
-  'item_manage': 'Item manage',
-  'web_setting': 'Web setting',
-  'register_open_label': 'Register open',
-  'ldap_open_label': 'LDAP login',
+  user_manage: 'User manage',
+  item_manage: 'Item manage',
+  web_setting: 'Web setting',
+  register_open_label: 'Register open',
+  ldap_open_label: 'LDAP login',
 
-  'name': 'Name',
-  'name_tips': 'Your real name',
+  name: 'Name',
+  name_tips: 'Your real name',
 
-  'attachment': 'Attachment',
-  'upload': 'Upload',
-  'upload_file': 'Upload file',
-  'file_name': 'File name',
-  'download': 'Download',
-  'file_size_tips': 'Less than 4MB',
+  attachment: 'Attachment',
+  upload: 'Upload',
+  upload_file: 'Upload file',
+  file_name: 'File name',
+  download: 'Download',
+  file_size_tips: 'Less than 4MB',
 
-  'confirm_cat_delete': 'Are you sure you want to delete the directory? This action will delete all the pages in this directory. Please be careful.',
+  confirm_cat_delete:
+    'Are you sure you want to delete the directory? This action will delete all the pages in this directory. Please be careful.',
 
-  'userrole': 'User role',
-  'reg_time': 'Registration time',
-  'last_login_time': 'Last login time',
-  'administrator': 'Administrator',
-  'ordinary_users': 'Ordinary users',
-  'owner': 'Owner',
-  'privacy': 'Privacy',
-  'link': 'link',
-  'private': 'private',
-  'public': 'public',
-  'register_open': 'Open registration',
-  'long_page_tips': 'The content of this page was detected to be more, and showdoc temporarily shut down the HTML real-time preview function to prevent the page from getting stuck due to too much content. You can find the preview button in the edit bar and open it manually.',
+  userrole: 'User role',
+  reg_time: 'Registration time',
+  last_login_time: 'Last login time',
+  administrator: 'Administrator',
+  ordinary_users: 'Ordinary users',
+  owner: 'Owner',
+  privacy: 'Privacy',
+  link: 'link',
+  private: 'private',
+  public: 'public',
+  register_open: 'Open registration',
+  long_page_tips:
+    'The content of this page was detected to be more, and showdoc temporarily shut down the HTML real-time preview function to prevent the page from getting stuck due to too much content. You can find the preview button in the edit bar and open it manually.',
 
-  'item_exit': 'Exit item',
-  'confirm_exit_item': 'Are you sure to exit this item?',
+  item_exit: 'Exit item',
+  confirm_exit_item: 'Are you sure to exit this item?',
 
-  'insert': 'Insert',
+  insert: 'Insert',
 
-  'Open_item': 'public item',
-  'private_item': 'private item',
-  'private_item_passwrod': 'Please set a password for private item',
+  Open_item: 'public item',
+  private_item: 'private item',
+  private_item_passwrod: 'Please set a password for private item',
 
-  'create_sigle_page': 'I want to create a single page address',
-  'create_sigle_page_tips': 'When you just want to share a page and not the whole project, you can choose to share a single page address. After sharing, your friends will only see a single page, can not browse the catalog menu, and can not switch to other pages to view.',
+  create_sigle_page: 'I want to create a single page address',
+  create_sigle_page_tips:
+    'When you just want to share a page and not the whole project, you can choose to share a single page address. After sharing, your friends will only see a single page, can not browse the catalog menu, and can not switch to other pages to view.',
 
-  'home_page': 'Website home page',
-  'full_page': 'Full page',
-  'login_page': 'jump to login page',
-  'jump_to_an_item': 'jump to an item',
-  'jump_to_item': 'choose item',
+  home_page: 'Website home page',
+  full_page: 'Full page',
+  login_page: 'jump to login page',
+  jump_to_an_item: 'jump to an item',
+  jump_to_item: 'choose item',
 
-  'recycle': 'recycle',
-  'recycle_tips': 'The deleted page will go to the recycle bin. The content in the recycle bin for more than 30 days will be automatically selected by the system and cleaned up when appropriate',
-  'page_title': 'Page title',
-  'deleter': 'Delete Account',
-  'del_time': 'Delete time',
-  'recover': 'recover',
-  'recover_tips': 'Are you sure to recover? The recovered page will appear in the item root',
+  recycle: 'recycle',
+  recycle_tips:
+    'The deleted page will go to the recycle bin. The content in the recycle bin for more than 30 days will be automatically selected by the system and cleaned up when appropriate',
+  page_title: 'Page title',
+  deleter: 'Delete Account',
+  del_time: 'Delete time',
+  recover: 'recover',
+  recover_tips:
+    'Are you sure to recover? The recovered page will appear in the item root',
 
-  'sort_pages': 'Sort Pages',
-  'sort_pages_tips': 'After selecting a specific catalog, you can drag and sort the pages in that catalog',
+  sort_pages: 'Sort Pages',
+  sort_pages_tips:
+    'After selecting a specific catalog, you can drag and sort the pages in that catalog',
 
-  'cat_tips': 'Drag to sort',
-  'cat_limite_tips': 'Only up to three levels of directories are supported',
+  cat_tips: 'Drag to sort',
+  cat_limite_tips: 'Only up to three levels of directories are supported',
 
-  'regular_item': 'Regular Item',
-  'single_item': 'Single Item',
-  'copy_item': 'Copy Item',
-  'import_file': 'Import File',
-  'auto_item': 'Auto Create',
-  'single_item_tips': 'Single item refers to the item with no catalog structure and only one page',
-  'copy_item_tips1': 'Select and copy from your existing items',
-  'copy_item_tips2': 'After copying, rename the new item to:',
-  'import_file_tips1': 'The imported file can be the JSON file of postman, the JSON file of swagger, and the markdown zip of showdoc. The system will automatically identify the file type',
-  'import_file_tips2': 'Drag the file here, or click to upload',
-  'export_format_word': 'Word format',
-  'export_format_markdown': 'Markdown zip',
-  'export_markdown_tips': "The exported compressed package can be re imported into showdoc. Select 'Import File' when creating a new item",
+  regular_item: 'Regular Item',
+  single_item: 'Single Item',
+  copy_item: 'Copy Item',
+  import_file: 'Import File',
+  auto_item: 'Auto Create',
+  single_item_tips:
+    'Single item refers to the item with no catalog structure and only one page',
+  copy_item_tips1: 'Select and copy from your existing items',
+  copy_item_tips2: 'After copying, rename the new item to:',
+  import_file_tips1:
+    'The imported file can be the JSON file of postman, the JSON file of swagger, and the markdown zip of showdoc. The system will automatically identify the file type',
+  import_file_tips2: 'Drag the file here, or click to upload',
+  export_format_word: 'Word format',
+  export_format_markdown: 'Markdown zip',
+  export_markdown_tips:
+    "The exported compressed package can be re imported into showdoc. Select 'Import File' when creating a new item",
 
-  'private_tips': "It's a private item",
+  private_tips: "It's a private item",
 
-  'oss_open': 'Image/attachment saved to cloud',
-  'oss_server': 'cloud server',
-  'aliyun': 'aliyun',
-  'qiniu': 'qiniu',
-  'oss_domain': 'domain(optional)',
+  oss_open: 'Image/attachment saved to cloud',
+  oss_server: 'cloud server',
+  aliyun: 'aliyun',
+  qiniu: 'qiniu',
+  oss_domain: 'domain(optional)',
 
-  'attornTeamTips': 'All items owned by the team will also be transferred to he/her',
+  attornTeamTips:
+    'All items owned by the team will also be transferred to he/her',
 
   lock_edit: 'Lock edit',
-  lock_edit_tips: 'When locked, other people will not be able to edit this page. Until you unlock or exit editing',
+  lock_edit_tips:
+    'When locked, other people will not be able to edit this page. Until you unlock or exit editing',
   cacel_lock: 'Unlock',
-  locking: 'The current page is being locked and edited by other members. Editor:'
+  locking:
+    'The current page is being locked and edited by other members. Editor:',
 
+  all_cat: 'All catalogs',
+  cat_success: 'Catalogs saved successfully',
+  auth_success: 'saved successfully',
+  all_cat2: 'Catalogs permissions: all',
+  c_team: 'Select team'
 }

+ 11 - 4
web_src/static/lang/zh-CN.js

@@ -107,7 +107,7 @@ exports.default = {
   input_target_member: '请输入目标成员的用户名',
   readonly: '只读',
   member_authority_tips:
-    '权限说明:默认成员可以新建/编辑项目页面,删除时将只能删除自己新建/编辑的页面。 勾选只读属性后,该成员对所有页面都只能查看,无法新增/编辑/删除',
+    '权限说明:编辑权限指的是成员可以新建/编辑/删除项目页面。 只读权限指的是,该成员对本项目所有页面都只能查看,无法新增/编辑/删除。可以按项目目录给用户授权,该用户将只能查看和操作自己有权限的目录。目前只支持选择一级目录。',
   cancel: '取消',
   confirm: '确定',
   confirm_delete: '确认删除吗?',
@@ -242,7 +242,7 @@ exports.default = {
   adjust_member_authority: '调整每一个成员的项目权限',
   team_member_empty_tips: '该团队尚未有任何成员',
   team_member_authority_tips:
-    '权限说明:编辑权限指的是成员可以新建/编辑项目页面,删除时将只能删除自己新建/编辑的页面。 只读权限指的是,该成员对本项目所有页面都只能查看,无法新增/编辑/删除',
+    '权限说明:默认成员可以新建/编辑/删除项目页面, 勾选只读属性后,该成员对所有页面都只能查看,无法新增/编辑/删除。可以按项目目录给用户授权,该用户将只能查看和操作自己有权限的目录。目前只支持选择一级目录。',
   member: '成员',
   team_item: '项目',
   member_username: '成员用户名',
@@ -349,7 +349,14 @@ exports.default = {
   attornTeamTips: '转让团队后,该团队下拥有的所有项目也会一并转让给对方',
 
   lock_edit: '锁定编辑',
-  lock_edit_tips: '当锁定后,其他人将无法编辑本页面。直到你取消锁定或者退出编辑',
+  lock_edit_tips:
+    '当锁定后,其他人将无法编辑本页面。直到你取消锁定或者退出编辑',
   cacel_lock: '解除锁定',
-  locking: '当前页面正在被其他成员锁定编辑中,编辑者:'
+  locking: '当前页面正在被其他成员锁定编辑中,编辑者:',
+
+  all_cat: '所有目录',
+  cat_success: '目录保存成功',
+  auth_success: '权限保存成功',
+  all_cat2: '目录权限:所有目录',
+  c_team: '选择团队'
 }