star7th vor 6 Jahren
Ursprung
Commit
925cc9ac45
3 geänderte Dateien mit 22 neuen und 5 gelöschten Zeilen
  1. 11 2
      web_src/src/components/item/Add.vue
  2. 6 2
      web_src/static/lang/en.js
  3. 5 1
      web_src/static/lang/zh-CN.js

+ 11 - 2
web_src/src/components/item/Add.vue

@@ -23,7 +23,12 @@
 
 
               <el-form-item label="" >
-                <el-input type="password" auto-complete="off" v-model="password"  :placeholder="$t('visit_password_placeholder')"></el-input>
+                <el-radio v-model="isOpenItem" :label="true">{{$t('Open_item')}}</el-radio>
+                <el-radio v-model="isOpenItem" :label="false">{{$t('private_item')}}</el-radio>
+              </el-form-item>
+
+              <el-form-item label="" v-show="!isOpenItem" >
+                  <el-input type="password" auto-complete="off" v-model="password"  :placeholder="$t('visit_password_placeholder')"></el-input>
               </el-form-item>
 
               <el-form-item label="" class="text-left">
@@ -79,6 +84,7 @@ export default {
       itemList:{},
       copy_item_id:"",
       lang:'',
+      isOpenItem:true,
 
     }
 
@@ -113,7 +119,10 @@ export default {
     onSubmit() {
         var that = this ;
         var url = DocConfig.server+'/api/item/add';
-
+        if (!this.isOpenItem && !this.password) {
+          that.$alert(that.$t("private_item_passwrod"));
+          return false;
+        };
         var params = new URLSearchParams();
         params.append('item_type', this.item_type);
         params.append('item_name', this.item_name);

+ 6 - 2
web_src/static/lang/en.js

@@ -71,7 +71,7 @@ exports.default = {
     '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 (optional: private project required)',
+    'visit_password_placeholder' : 'Password',
     'copy_exists_item' : 'Copy existing item',
     'please_choose' : 'Please select',
     'auto_db' : 'Auto data dictionary',
@@ -277,7 +277,11 @@ exports.default = {
     "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",
 
        
 };

+ 5 - 1
web_src/static/lang/zh-CN.js

@@ -71,7 +71,7 @@ exports.default = {
     'item_domain' : '(可选)个性域名',
     'item_domain_illegal' : '个性域名只能是字母或数字的组合',
     'domain_already_exists' : '个性域名已经存在',
-    'visit_password_placeholder' : '访问密码(可选,私密项目请设置密码)',
+    'visit_password_placeholder' : '访问密码',
     'submit' : '提交',
     'goback' : '返回',
     'copy_exists_item' : '复制已存在项目',
@@ -285,4 +285,8 @@ exports.default = {
     "confirm_exit_item":"你确定要退出该项目吗?",   
 
      "insert":"插入",
+
+    "Open_item":"公开项目",
+    "private_item":"私密项目",
+    "private_item_passwrod":"私密项目请设置访问密码",
 };