|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="model-manage">
|
|
<div class="model-manage">
|
|
<el-dialog
|
|
<el-dialog
|
|
- :title="`${supplierInfo.name} - ${curRow.name}`"
|
|
|
|
|
|
+ :title="`${supplierInfo.name}`"
|
|
class="page-dialog"
|
|
class="page-dialog"
|
|
:visible.sync="modalIsShow"
|
|
:visible.sync="modalIsShow"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
@@ -12,6 +12,14 @@
|
|
>
|
|
>
|
|
<div class="part-box part-box-filter part-box-flex">
|
|
<div class="part-box part-box-filter part-box-flex">
|
|
<el-form ref="FilterForm" label-position="left" inline>
|
|
<el-form ref="FilterForm" label-position="left" inline>
|
|
|
|
+ <el-form-item label="模型列表:">
|
|
|
|
+ <NormalSelect
|
|
|
|
+ v-model="modelId"
|
|
|
|
+ :init="true"
|
|
|
|
+ :func="modelListQuery"
|
|
|
|
+ :params="modelSelectParams"
|
|
|
|
+ ></NormalSelect>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="应用类型:">
|
|
<el-form-item label="应用类型:">
|
|
<NormalSelect
|
|
<NormalSelect
|
|
v-model="appType"
|
|
v-model="appType"
|
|
@@ -53,6 +61,12 @@
|
|
@click="toEdit(scope.row)"
|
|
@click="toEdit(scope.row)"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="deleteItem(scope.row)"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -61,7 +75,7 @@
|
|
<ModifyTpl
|
|
<ModifyTpl
|
|
:instance="curCueWordRow"
|
|
:instance="curCueWordRow"
|
|
ref="ModifyTpl"
|
|
ref="ModifyTpl"
|
|
- :modelId="curRow.id"
|
|
|
|
|
|
+ :modelId="modelId"
|
|
@modified="getList"
|
|
@modified="getList"
|
|
:appType="appType"
|
|
:appType="appType"
|
|
></ModifyTpl>
|
|
></ModifyTpl>
|
|
@@ -69,7 +83,12 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { cueWordListQuery, appTypeList } from "../../../api";
|
|
|
|
|
|
+import {
|
|
|
|
+ cueWordListQuery,
|
|
|
|
+ appTypeList,
|
|
|
|
+ modelListQuery,
|
|
|
|
+ promptDelete,
|
|
|
|
+} from "../../../api";
|
|
import NormalSelect from "@/components/NormalSelect.vue";
|
|
import NormalSelect from "@/components/NormalSelect.vue";
|
|
|
|
|
|
import ModifyTpl from "./ModifyTpl.vue";
|
|
import ModifyTpl from "./ModifyTpl.vue";
|
|
@@ -77,12 +96,6 @@ export default {
|
|
name: "CueWordTpl",
|
|
name: "CueWordTpl",
|
|
components: { NormalSelect, ModifyTpl },
|
|
components: { NormalSelect, ModifyTpl },
|
|
props: {
|
|
props: {
|
|
- curRow: {
|
|
|
|
- type: Object,
|
|
|
|
- default() {
|
|
|
|
- return {};
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
supplierInfo: {
|
|
supplierInfo: {
|
|
type: Object,
|
|
type: Object,
|
|
default() {
|
|
default() {
|
|
@@ -90,14 +103,21 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ modelSelectParams() {
|
|
|
|
+ return { supplierId: this.supplierInfo?.id };
|
|
|
|
+ },
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ modelListQuery,
|
|
appTypeList,
|
|
appTypeList,
|
|
modalIsShow: false,
|
|
modalIsShow: false,
|
|
loading: false,
|
|
loading: false,
|
|
dataList: [],
|
|
dataList: [],
|
|
curCueWordRow: {},
|
|
curCueWordRow: {},
|
|
appType: "",
|
|
appType: "",
|
|
|
|
+ modelId: "",
|
|
appTypeOptions: [],
|
|
appTypeOptions: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -116,7 +136,7 @@ export default {
|
|
},
|
|
},
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- cueWordListQuery({ modelId: this.curRow.id, appType: this.appType }).then(
|
|
|
|
|
|
+ cueWordListQuery({ modelId: this.modelId, appType: this.appType }).then(
|
|
(res) => {
|
|
(res) => {
|
|
this.dataList = res || [];
|
|
this.dataList = res || [];
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -136,10 +156,27 @@ export default {
|
|
this.curCueWordRow = row;
|
|
this.curCueWordRow = row;
|
|
this.$refs.ModifyTpl.open();
|
|
this.$refs.ModifyTpl.open();
|
|
},
|
|
},
|
|
|
|
+ async deleteItem(item) {
|
|
|
|
+ const confirm = await this.$confirm(`确定要删除该模板吗?`, "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+ const res = await promptDelete({
|
|
|
|
+ id: item.id,
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("删除成功!");
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
appType(val) {
|
|
appType(val) {
|
|
- if (val) {
|
|
|
|
|
|
+ if (val && this.modelId) {
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ modelId(val) {
|
|
|
|
+ if (val && this.appType) {
|
|
this.getList();
|
|
this.getList();
|
|
}
|
|
}
|
|
},
|
|
},
|