提交 437630eb 编写于 作者: S shiziyuan9527

feat: zentao组件添加地址属性

上级 67f411f5
......@@ -10,6 +10,9 @@
<el-input v-model="form.password" auto-complete="new-password"
:placeholder="$t('organization.integration.input_app_key')" show-password/>
</el-form-item>
<el-form-item :label="$t('organization.integration.zentao_url')" prop="url">
<el-input v-model="form.url" :placeholder="$t('organization.integration.input_zentao_url')"/>
</el-form-item>
</el-form>
</div>
......@@ -63,7 +66,12 @@ export default {
required: true,
message: this.$t('organization.integration.input_app_key'),
trigger: ['change', 'blur']
}
},
url: {
required: true,
message: this.$t('organization.integration.input_zentao_url'),
trigger: ['change', 'blur']
},
},
}
},
......@@ -71,12 +79,16 @@ export default {
save() {
this.$refs['form'].validate(valid => {
if (valid) {
let formatUrl = this.form.url.trim();
if (!formatUrl.endsWith('/')) {
formatUrl = formatUrl + '/';
}
const {lastOrganizationId} = getCurrentUser();
let param = {};
let auth = {
account: this.form.account,
password: this.form.password,
url: formatUrl,
};
param.organizationId = lastOrganizationId;
param.platform = ZEN_TAO;
......@@ -106,6 +118,7 @@ export default {
let config = JSON.parse(data.configuration);
this.$set(this.form, 'account', config.account);
this.$set(this.form, 'password', config.password);
this.$set(this.form, 'url', config.url);
} else {
this.clear();
}
......@@ -114,19 +127,26 @@ export default {
clear() {
this.$set(this.form, 'account', '');
this.$set(this.form, 'password', '');
this.$set(this.form, 'url', '');
this.$nextTick(() => {
this.$refs.form.clearValidate();
});
},
testConnection() {
if (this.form.account && this.form.password) {
this.$parent.result = this.$get("issues/auth/" + ZEN_TAO, () => {
this.$success(this.$t('organization.integration.verified'));
});
} else {
this.$warning(this.$t('organization.integration.not_integrated'));
return false;
}
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.account && this.form.password) {
this.$parent.result = this.$get("issues/auth/" + ZEN_TAO, () => {
this.$success(this.$t('organization.integration.verified'));
});
} else {
this.$warning(this.$t('organization.integration.not_integrated'));
return false;
}
} else {
return false;
}
})
},
cancelIntegration() {
if (this.form.account && this.form.password) {
......
......@@ -262,6 +262,8 @@ export default {
input_app_key: 'Please enter the key',
input_jira_url: 'Please enter Jira address, for example: https://metersphere.atlassian.net/',
input_jira_issuetype: 'Please enter the question type',
zentao_url: 'Zentao url',
input_zentao_url: 'Please enter Zentao address, for example: http://xx.xx.xx.xx/zentao/',
use_tip: 'Usage guidelines:',
use_tip_tapd: 'Basic Auth account information is queried in "Company Management-Security and Integration-Open Platform"',
use_tip_jira: 'Jira software server authentication information is account password, Jira software cloud authentication information is account + token (account settings-security-create API token)',
......
......@@ -262,6 +262,8 @@ export default {
input_app_key: '请输入密钥',
input_jira_url: '请输入Jira地址,例:https://metersphere.atlassian.net/',
input_jira_issuetype: '请输入问题类型',
zentao_url: 'Zentao 地址',
input_zentao_url: '请输入Zentao地址,例:http://xx.xx.xx.xx/zentao/',
use_tip: '使用指引:',
use_tip_tapd: 'Tapd Basic Auth 账号信息在"公司管理-安全与集成-开放平台"中查询',
use_tip_jira: 'Jira software server 认证信息为 账号密码,Jira software cloud 认证信息为 账号+令牌(账户设置-安全-创建API令牌)',
......
......@@ -264,6 +264,8 @@ export default {
input_app_key: '請輸入密鑰',
input_jira_url: '請輸入Jira地址,例:https://metersphere.atlassian.net/',
input_jira_issuetype: '請輸入問題類型',
zentao_url: 'Zentao 地址',
input_zentao_url: '請輸入Zentao地址,例:http://xx.xx.xx.xx/zentao/',
use_tip: '使用指引:',
use_tip_tapd: 'Tapd Basic Auth 賬號信息在"公司管理-安全與集成-開放平臺"中查詢',
use_tip_jira: 'Jira software server 認證信息為 賬號密碼,Jira software cloud 認證信息為 賬號+令牌(賬戶設置-安全-創建API令牌)',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册