|
@@ -0,0 +1,142 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="model-manage">
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="提示词模板列表"
|
|
|
|
+ class="page-dialog"
|
|
|
|
+ :visible.sync="modalIsShow"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :close-on-press-escape="false"
|
|
|
|
+ append-to-body
|
|
|
|
+ fullscreen
|
|
|
|
+ @opened="visibleChange"
|
|
|
|
+ >
|
|
|
|
+ <div class="part-box part-box-filter part-box-flex">
|
|
|
|
+ <el-form ref="FilterForm" label-position="left" inline>
|
|
|
|
+ <el-form-item label="应用类型:">
|
|
|
|
+ <AppTypeSelect
|
|
|
|
+ v-model="appType"
|
|
|
|
+ :init="true"
|
|
|
|
+ @getOptions="getAppTypeOptions"
|
|
|
|
+ ></AppTypeSelect>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width="0px">
|
|
|
|
+ <el-button type="primary" @click="getList">查询</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width="0px">
|
|
|
|
+ <el-button type="success" @click="toAdd">新增</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
|
+ <el-table ref="TableList" :data="dataList" v-loading="loading">
|
|
|
|
+ <el-table-column prop="id" label="ID"></el-table-column>
|
|
|
|
+ <el-table-column prop="appType" label="应用类型">
|
|
|
|
+ <span slot-scope="scope">
|
|
|
|
+ {{ getAppTypeStr(scope.row.appType) }}
|
|
|
|
+ </span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="system" label="system角色提示词模版">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="user" label="user角色提示词模版">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="remark" label="备注"> </el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column
|
|
|
|
+ class-name="action-column"
|
|
|
|
+ label="操作"
|
|
|
|
+ width="120"
|
|
|
|
+ fixed="right"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toEdit(scope.row)"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <ModifyTpl
|
|
|
|
+ :instance="curCueWordRow"
|
|
|
|
+ ref="ModifyTpl"
|
|
|
|
+ :modelId="curRow.id"
|
|
|
|
+ @modified="getList"
|
|
|
|
+ ></ModifyTpl>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { cueWordListQuery } from "../../../api";
|
|
|
|
+import AppTypeSelect from "@/components/AppTypeSelect.vue";
|
|
|
|
+import ModifyTpl from "./ModifyTpl.vue";
|
|
|
|
+export default {
|
|
|
|
+ name: "CueWordTpl",
|
|
|
|
+ components: { AppTypeSelect, ModifyTpl },
|
|
|
|
+ props: {
|
|
|
|
+ curRow: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default() {
|
|
|
|
+ return {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ modalIsShow: false,
|
|
|
|
+ loading: false,
|
|
|
|
+ dataList: [],
|
|
|
|
+ curCueWordRow: {},
|
|
|
|
+ appType: "",
|
|
|
|
+ appTypeOptions: [],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ getAppTypeOptions(arr) {
|
|
|
|
+ this.appTypeOptions = arr;
|
|
|
|
+ },
|
|
|
|
+ getAppTypeStr(code) {
|
|
|
|
+ return this.appTypeOptions.find((item) => item.code == code)?.name;
|
|
|
|
+ },
|
|
|
|
+ cancel() {
|
|
|
|
+ this.modalIsShow = false;
|
|
|
|
+ },
|
|
|
|
+ open() {
|
|
|
|
+ this.modalIsShow = true;
|
|
|
|
+ },
|
|
|
|
+ getList() {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ cueWordListQuery({ modelId: this.curRow.id, appType: this.appType }).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ this.dataList = res || [];
|
|
|
|
+ this.loading = false;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ async visibleChange() {
|
|
|
|
+ if (this.appType) {
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ toAdd() {
|
|
|
|
+ this.curCueWordRow = {};
|
|
|
|
+ this.$refs.ModifyTpl.open();
|
|
|
|
+ },
|
|
|
|
+ toEdit(row) {
|
|
|
|
+ this.curCueWordRow = row;
|
|
|
|
+ this.$refs.ModifyTpl.open();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ appType(val) {
|
|
|
|
+ if (val) {
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style></style>
|