|
@@ -0,0 +1,145 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="system_config">
|
|
|
|
|
+ <MenuPage cur-key="voiceEngine" />
|
|
|
|
|
+ <div class="btn-box">
|
|
|
|
|
+ <el-button type="primary" :loading="refresh_loading" @click="getInfo">刷新</el-button>
|
|
|
|
|
+ <el-button type="primary" :loading="loading" @click="onSubmit('configForm')">应用</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-form ref="configForm" :model="configForm" label-width="110px" :rules="rules" class="config-form">
|
|
|
|
|
+ <el-form-item label="应用 ID" prop="appid">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="configForm.appid"
|
|
|
|
|
+ autocomplete="off"
|
|
|
|
|
+ placeholder="请输入应用 ID"
|
|
|
|
|
+ maxlength="100"
|
|
|
|
|
+ :autocomplete="'new-appid'"
|
|
|
|
|
+ @blur="handleTrim('configForm', 'appid')"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label=" 令牌" prop="token">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="configForm.token"
|
|
|
|
|
+ autocomplete="off"
|
|
|
|
|
+ placeholder="请输入令牌"
|
|
|
|
|
+ maxlength="200"
|
|
|
|
|
+ @blur="handleTrim('configForm', 'token')"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label=" 密钥" prop="key">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="configForm.key"
|
|
|
|
|
+ :type="newPwdFlag ? 'text' : 'password'"
|
|
|
|
|
+ autocomplete="off"
|
|
|
|
|
+ placeholder="请输入密钥"
|
|
|
|
|
+ maxlength="200"
|
|
|
|
|
+ :autocomplete="'new-password'"
|
|
|
|
|
+ @blur="handleTrim('configForm', 'key')"
|
|
|
|
|
+ >
|
|
|
|
|
+ <i v-if="newPwdFlag" slot="suffix" class="el-icon-view show-icon" @click="changeIcon('newPwdFlag')"></i>
|
|
|
|
|
+ <i v-else slot="suffix" class="show-icon" @click="changeIcon('newPwdFlag')">
|
|
|
|
|
+ <svg-icon icon-class="eye-invisible" />
|
|
|
|
|
+ </i>
|
|
|
|
|
+ </el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import { GetSysConfig_SpeechEngine, SetSysConfig_SpeechEngine } from '@/api/config';
|
|
|
|
|
+import MenuPage from '../common/menu.vue';
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'voiceEngineConfig',
|
|
|
|
|
+ components: { MenuPage },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ configForm: {
|
|
|
|
|
+ appid: '',
|
|
|
|
|
+ token: '',
|
|
|
|
|
+ key: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ appid: [{ required: true, message: '请输入应用 ID', trigger: 'blur' }],
|
|
|
|
|
+ token: [{ required: true, message: '请输入令牌', trigger: 'blur' }],
|
|
|
|
|
+ key: [{ required: true, message: '请输入密钥', trigger: 'blur' }],
|
|
|
|
|
+ },
|
|
|
|
|
+ newPwdFlag: false, // 查看新密码
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ refresh_loading: false,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getInfo();
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ // 去掉前后空格
|
|
|
|
|
+ handleTrim(form, field) {
|
|
|
|
|
+ this[form][field] = this[form][field].trim();
|
|
|
|
|
+ },
|
|
|
|
|
+ changeIcon(flag) {
|
|
|
|
|
+ this[flag] = !this[flag];
|
|
|
|
|
+ },
|
|
|
|
|
+ getInfo() {
|
|
|
|
|
+ this.refresh_loading = true;
|
|
|
|
|
+ GetSysConfig_SpeechEngine()
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.refresh_loading = false;
|
|
|
|
|
+ if (res.status === 1) {
|
|
|
|
|
+ this.configForm = res;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.refresh_loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 应用
|
|
|
|
|
+ onSubmit(formName) {
|
|
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ SetSysConfig_SpeechEngine(this.configForm)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ if (res.status === 1) {
|
|
|
|
|
+ this.$message.success('操作成功!');
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+@use '@/styles/mixin.scss' as *;
|
|
|
|
|
+
|
|
|
|
|
+.system_config {
|
|
|
|
|
+ @include page-base;
|
|
|
|
|
+
|
|
|
|
|
+ .btn-box {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ max-width: 1148px;
|
|
|
|
|
+ padding: 5px 0;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ border-bottom: $border;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .config-form {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ max-width: 1148px;
|
|
|
|
|
+ height: calc(100vh - 200px);
|
|
|
|
|
+ margin: 10px auto;
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+
|
|
|
|
|
+ :deep .el-input--small {
|
|
|
|
|
+ width: 304px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|