|
@@ -148,6 +148,13 @@
|
|
|
@click="handleConfig(scope.row)"
|
|
@click="handleConfig(scope.row)"
|
|
|
v-hasPermi="['tenant:config:edit']"
|
|
v-hasPermi="['tenant:config:edit']"
|
|
|
>修改配置</el-button>
|
|
>修改配置</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>
|
|
@@ -248,6 +255,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>
|
|
|
|
|
|
|
@@ -260,7 +285,9 @@ import {
|
|
|
updateTenant,
|
|
updateTenant,
|
|
|
exportTenant,
|
|
exportTenant,
|
|
|
roleMenuTreeselect,
|
|
roleMenuTreeselect,
|
|
|
- menuEdit
|
|
|
|
|
|
|
+ menuEdit,
|
|
|
|
|
+ editTenantConfig,
|
|
|
|
|
+ getTenantConfigByKey
|
|
|
} from "@/api/tenant/tenant";
|
|
} from "@/api/tenant/tenant";
|
|
|
import {code} from "quill/ui/icons";
|
|
import {code} from "quill/ui/icons";
|
|
|
import {getRole} from "@/api/system/role";
|
|
import {getRole} from "@/api/system/role";
|
|
@@ -361,6 +388,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() {
|
|
@@ -651,6 +690,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;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|