|
@@ -155,6 +155,13 @@
|
|
|
@click="handleSqlScript(scope.row)"
|
|
@click="handleSqlScript(scope.row)"
|
|
|
v-hasPermi="['tenant:config:edit']"
|
|
v-hasPermi="['tenant:config:edit']"
|
|
|
>上传sql脚本</el-button>
|
|
>上传sql脚本</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-key"
|
|
|
|
|
+ @click="handleAiKeyword(scope.row)"
|
|
|
|
|
+ v-hasPermi="['tenant:tenant:edit']"
|
|
|
|
|
+ >修改AI关键词</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -261,6 +268,24 @@
|
|
|
<el-dialog title="修改配置" :visible.sync="openConfig" width="900px" append-to-body class="tenant-dialog">
|
|
<el-dialog title="修改配置" :visible.sync="openConfig" width="900px" append-to-body class="tenant-dialog">
|
|
|
<config-index v-if="openConfig" :tenant-id="configTenantId" @success="handleConfigSuccess" />
|
|
<config-index v-if="openConfig" :tenant-id="configTenantId" @success="handleConfigSuccess" />
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 修改AI关键词 -->
|
|
|
|
|
+ <el-dialog title="修改AI关键词" :visible.sync="openAiKeyword" width="600px" append-to-body class="tenant-dialog">
|
|
|
|
|
+ <el-form ref="aiKeywordForm" :model="aiKeywordForm" :rules="aiKeywordRules" label-width="100px">
|
|
|
|
|
+ <el-form-item label="AI关键词" prop="aiKeyword">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ v-model="aiKeywordForm.aiKeyword"
|
|
|
|
|
+ placeholder="请输入AI关键词"
|
|
|
|
|
+ :rows="8"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitAiKeyword">确 定</el-button>
|
|
|
|
|
+ <el-button @click="openAiKeyword = false">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -271,9 +296,11 @@ import {
|
|
|
exportTenant,
|
|
exportTenant,
|
|
|
getTenant,
|
|
getTenant,
|
|
|
listTenant,
|
|
listTenant,
|
|
|
- menuEdit,
|
|
|
|
|
roleMenuTreeselect,
|
|
roleMenuTreeselect,
|
|
|
- updateTenant
|
|
|
|
|
|
|
+ updateTenant,
|
|
|
|
|
+ menuEdit,
|
|
|
|
|
+ editTenantConfig,
|
|
|
|
|
+ getTenantConfigByKey
|
|
|
} from "@/api/tenant/tenant";
|
|
} from "@/api/tenant/tenant";
|
|
|
import ConfigIndex from "./config/index";
|
|
import ConfigIndex from "./config/index";
|
|
|
import {uploadScript} from "@/api/tenant/record";
|
|
import {uploadScript} from "@/api/tenant/record";
|
|
@@ -379,6 +406,18 @@ export default {
|
|
|
isAdd: false,
|
|
isAdd: false,
|
|
|
openConfig: false,
|
|
openConfig: false,
|
|
|
configTenantId: null,
|
|
configTenantId: null,
|
|
|
|
|
+ // AI关键词弹窗
|
|
|
|
|
+ openAiKeyword: false,
|
|
|
|
|
+ aiKeywordConfigId: null,
|
|
|
|
|
+ aiKeywordForm: {
|
|
|
|
|
+ tenantId: null,
|
|
|
|
|
+ aiKeyword: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ aiKeywordRules: {
|
|
|
|
|
+ aiKeyword: [
|
|
|
|
|
+ { required: true, message: "AI关键词不能为空", trigger: "blur" }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -669,6 +708,44 @@ export default {
|
|
|
handleConfigSuccess() {
|
|
handleConfigSuccess() {
|
|
|
this.openConfig = false;
|
|
this.openConfig = false;
|
|
|
},
|
|
},
|
|
|
|
|
+ /** 修改AI关键词按钮操作 */
|
|
|
|
|
+ handleAiKeyword(row) {
|
|
|
|
|
+ this.aiKeywordForm = {
|
|
|
|
|
+ tenantId: row.id,
|
|
|
|
|
+ aiKeyword: ''
|
|
|
|
|
+ };
|
|
|
|
|
+ this.aiKeywordConfigId = null;
|
|
|
|
|
+ this.openAiKeyword = true;
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.aiKeywordForm && this.$refs.aiKeywordForm.clearValidate();
|
|
|
|
|
+ });
|
|
|
|
|
+ // 获取已有AI关键词配置
|
|
|
|
|
+ getTenantConfigByKey('aiKeyword', row.id).then(response => {
|
|
|
|
|
+ if (response.data) {
|
|
|
|
|
+ this.aiKeywordConfigId = response.data.configId || null;
|
|
|
|
|
+ if (response.data.configValue) {
|
|
|
|
|
+ this.aiKeywordForm.aiKeyword = response.data.configValue;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 提交AI关键词 */
|
|
|
|
|
+ submitAiKeyword() {
|
|
|
|
|
+ this.$refs.aiKeywordForm.validate(valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ editTenantConfig({
|
|
|
|
|
+ configId: this.aiKeywordConfigId,
|
|
|
|
|
+ id: this.aiKeywordForm.tenantId,
|
|
|
|
|
+ configKey: 'aiKeyword',
|
|
|
|
|
+ configName: 'ai配置',
|
|
|
|
|
+ configValue: this.aiKeywordForm.aiKeyword
|
|
|
|
|
+ }).then(response => {
|
|
|
|
|
+ this.msgSuccess("修改AI关键词成功");
|
|
|
|
|
+ this.openAiKeyword = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
handleSqlScript(row){
|
|
handleSqlScript(row){
|
|
|
// 创建隐藏的文件选择框
|
|
// 创建隐藏的文件选择框
|