|
@@ -15,7 +15,7 @@
|
|
|
class="__czr-table-form-column"
|
|
|
:span="24"
|
|
|
label-width="0px"
|
|
|
- v-model:param="state.query.form.modeType"
|
|
|
+ v-model:param="state.query.form.type"
|
|
|
link="select"
|
|
|
:options="DictionaryStore.modelTypes.list"
|
|
|
placeholder="模型类型"
|
|
@@ -61,8 +61,10 @@
|
|
|
<template #caozuo-column-value="{ scope }">
|
|
|
<div class="__czr-table-operations">
|
|
|
<CzrButton type="table" title="查看" @click="onView(scope.row)" />
|
|
|
- <CzrButton type="table" title="编辑" @click="onEdit(scope.row)" />
|
|
|
- <CzrButton type="table-del" @click="onDel(scope.row)" />
|
|
|
+ <template v-if="scope.row.state != 1">
|
|
|
+ <CzrButton type="table" title="编辑" @click="onEdit(scope.row)" />
|
|
|
+ <CzrButton type="table-del" @click="onDel(scope.row)" />
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
</CzrTable>
|
|
@@ -93,8 +95,10 @@ import {
|
|
|
appManageChangeState,
|
|
|
appManageDeleteAppManageByPatch,
|
|
|
appManageGetAppManageByPage,
|
|
|
+ modelManageChangeState,
|
|
|
+ modelManageDeleteModelManagePatch,
|
|
|
+ modelManageGetModelManageByPage,
|
|
|
} from '@/api/modules/center/square'
|
|
|
-import { pluginUpdateStatus } from '@/api/modules/model'
|
|
|
|
|
|
const AppStore = useAppStore()
|
|
|
const DialogStore = useDialogStore()
|
|
@@ -111,12 +115,17 @@ const state: any = reactive({
|
|
|
{ value: 'name', label: '模型名称', show: true },
|
|
|
{
|
|
|
value: 'type',
|
|
|
+ label: '模型类型',
|
|
|
+ show: true,
|
|
|
+ dictList: computed(() => DictionaryStore.modelTypes.list),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'manufacturer',
|
|
|
label: '模型厂商',
|
|
|
show: true,
|
|
|
- dictList: computed(() => DictionaryStore.squareAppType),
|
|
|
+ dictList: computed(() => DictionaryStore.modelProvides.list),
|
|
|
},
|
|
|
- { value: 'clickCount', label: '模型类型', show: true },
|
|
|
- { value: 'clickCount', label: '模型版本', show: true },
|
|
|
+ { value: 'version', label: '模型版本', show: true },
|
|
|
{
|
|
|
value: 'createTime',
|
|
|
label: '接入时间',
|
|
@@ -208,7 +217,7 @@ const onPage = (pageNum, pageSize) => {
|
|
|
for (const [k, v] of Object.entries(state.query.sort)) {
|
|
|
}
|
|
|
state.query.loading = true
|
|
|
- appManageGetAppManageByPage(params)
|
|
|
+ modelManageGetModelManageByPage(params)
|
|
|
.then(({ data }: any) => {
|
|
|
state.query.result.total = data.totalElements
|
|
|
state.query.result.data = data.content
|
|
@@ -257,7 +266,7 @@ const onDel = (row: any = null) => {
|
|
|
title: '删除确认',
|
|
|
content: `请确认是否删除${row.name}?`,
|
|
|
onSubmit: () => {
|
|
|
- appManageDeleteAppManageByPatch([row.id])
|
|
|
+ modelManageDeleteModelManagePatch([row.id])
|
|
|
.then(() => {
|
|
|
ElMessage.success('删除成功!')
|
|
|
})
|
|
@@ -272,11 +281,15 @@ const onDel = (row: any = null) => {
|
|
|
ElMessage.warning('请至少选择一条记录!')
|
|
|
return
|
|
|
}
|
|
|
+ if (state.query.selected.some((v) => v.state == 1)) {
|
|
|
+ ElMessage.warning('已启用的应用不可删除,请重新选择!')
|
|
|
+ return
|
|
|
+ }
|
|
|
DialogStore.confirm({
|
|
|
title: '删除确认',
|
|
|
content: `请确认是否删除${state.query.selected.length}条记录?`,
|
|
|
onSubmit: () => {
|
|
|
- appManageDeleteAppManageByPatch(state.query.selected.map((v) => v.id))
|
|
|
+ modelManageDeleteModelManagePatch(state.query.selected.map((v) => v.id))
|
|
|
.then(() => {
|
|
|
ElMessage.success('删除成功!')
|
|
|
})
|
|
@@ -294,7 +307,7 @@ const onSwitch = (row) => {
|
|
|
title: '停用确认',
|
|
|
content: `${row.name}正在首页展示,停用将导致不可用,请确认是否停用`,
|
|
|
onSubmit: () => {
|
|
|
- appManageChangeState({ id: row.id, state: 0 })
|
|
|
+ modelManageChangeState({ id: row.id, state: 0 })
|
|
|
.then(() => {
|
|
|
ElMessage.success('停用成功!')
|
|
|
})
|
|
@@ -306,7 +319,7 @@ const onSwitch = (row) => {
|
|
|
onCancel: () => {},
|
|
|
})
|
|
|
} else {
|
|
|
- appManageChangeState({ id: row.id, state: 1 })
|
|
|
+ modelManageChangeState({ id: row.id, state: 1 })
|
|
|
.then(() => {
|
|
|
ElMessage.success('启用成功!')
|
|
|
})
|
|
@@ -321,7 +334,8 @@ onMounted(() => {
|
|
|
onReset()
|
|
|
})
|
|
|
const initDictionary = () => {
|
|
|
- DictionaryStore.initTenants()
|
|
|
+ DictionaryStore.initModelTypes()
|
|
|
+ DictionaryStore.initModelProvides()
|
|
|
}
|
|
|
</script>
|
|
|
|