|
@@ -520,7 +520,7 @@
|
|
|
<div class="text-2xl font-bold text-[#303133]">预览</div>
|
|
|
<div
|
|
|
class="flex items-center gap-2 text-sm text-[var(--czr-error-color)]"
|
|
|
- v-if="debugError"
|
|
|
+ v-if="modelApplyCpt"
|
|
|
>
|
|
|
<SvgIcon name="czr_tip" color="var(--czr-error-color)" />
|
|
|
编排中有申请中的模型,预览暂不可用
|
|
@@ -581,6 +581,39 @@
|
|
|
v-model:show="state.templateDetail.show"
|
|
|
:transfer="state.templateDetail.transfer"
|
|
|
/>
|
|
|
+ <CzrDialog
|
|
|
+ :show="state.publish.show"
|
|
|
+ title="发布"
|
|
|
+ @onClose="state.publish.show = false"
|
|
|
+ @onSubmit="onPublishSubmit"
|
|
|
+ width="42.5rem"
|
|
|
+ height="auto"
|
|
|
+ >
|
|
|
+ <div class="bm-form">
|
|
|
+ <CzrForm ref="ref_formPublish">
|
|
|
+ <CzrFormColumn
|
|
|
+ required
|
|
|
+ label="发布渠道"
|
|
|
+ :span="24"
|
|
|
+ v-model:param="state.publish.form.name"
|
|
|
+ link="select"
|
|
|
+ :options="[
|
|
|
+ { label: '个人', value: '1' },
|
|
|
+ { label: '公共空间(需审批)', value: '2' },
|
|
|
+ ]"
|
|
|
+ :clearable="false"
|
|
|
+ />
|
|
|
+ <CzrFormColumn
|
|
|
+ v-if="state.publish.form.name == 2"
|
|
|
+ label="申请留言"
|
|
|
+ :span="24"
|
|
|
+ v-model:param="state.publish.form.description"
|
|
|
+ type="textarea"
|
|
|
+ :rows="10"
|
|
|
+ />
|
|
|
+ </CzrForm>
|
|
|
+ </div>
|
|
|
+ </CzrDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -597,7 +630,7 @@ import {
|
|
|
} from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import { ElLoading, ElMessage } from 'element-plus'
|
|
|
-import { useDictionaryStore } from '@/stores'
|
|
|
+import { useDialogStore, useDictionaryStore } from '@/stores'
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import knowledgeSelect from './knowledge-select.vue'
|
|
|
import modelSelect from './model-select.vue'
|
|
@@ -609,8 +642,10 @@ import templateSelect from './template-select.vue'
|
|
|
import templateDetail from './template-detail.vue'
|
|
|
import workflowSelect from './workflow-select.vue'
|
|
|
import CzrForm from '@/components/czr-ui/CzrForm.vue'
|
|
|
+import CzrDialog from '@/components/czr-ui/CzrDialog.vue'
|
|
|
|
|
|
const DictionaryStore = useDictionaryStore()
|
|
|
+const DialogStore = useDialogStore()
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
|
const emit = defineEmits([])
|
|
@@ -649,12 +684,13 @@ const state: any = reactive({
|
|
|
method: 1,
|
|
|
voicePackage: '',
|
|
|
advise: {
|
|
|
- types: ['open', 'tips', 'knowledge'],
|
|
|
+ types: [],
|
|
|
model: { name: '' },
|
|
|
tips: '',
|
|
|
knowledges: [],
|
|
|
},
|
|
|
},
|
|
|
+ detail: {},
|
|
|
knowledgeSelect: {
|
|
|
show: false,
|
|
|
transfer: {},
|
|
@@ -674,6 +710,11 @@ const state: any = reactive({
|
|
|
show: false,
|
|
|
transfer: {},
|
|
|
},
|
|
|
+ publish: {
|
|
|
+ show: false,
|
|
|
+ transfer: {},
|
|
|
+ form: {},
|
|
|
+ },
|
|
|
prologuesAdd: {
|
|
|
value: '',
|
|
|
},
|
|
@@ -681,10 +722,11 @@ const state: any = reactive({
|
|
|
isDebug: false,
|
|
|
})
|
|
|
const ref_form = ref()
|
|
|
+const ref_formPublish = ref()
|
|
|
const ref_tips = ref()
|
|
|
const ref_prologue = ref()
|
|
|
const ref_prologueBody = ref()
|
|
|
-const debugError = computed(() => {
|
|
|
+const modelApplyCpt = computed(() => {
|
|
|
return true
|
|
|
})
|
|
|
const initDetail = () => {
|
|
@@ -818,12 +860,61 @@ const onPublish = () => {
|
|
|
ref_form.value
|
|
|
.submit()
|
|
|
.then(() => {
|
|
|
+ if (state.detail.type == 1) {
|
|
|
+ if (state.form.workflows.length === 0) {
|
|
|
+ ElMessage.warning('请添加工作流!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
if (state.form.advise.types.includes('knowledge')) {
|
|
|
if (state.form.advise.knowledges.length === 0) {
|
|
|
ElMessage.warning('请添加问题建议知识库!')
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ // if (modelApplyCpt.value) {
|
|
|
+ // DialogStore.confirm({
|
|
|
+ // content: `编排中有申请中的模型,暂不可发布!`,
|
|
|
+ // props: {
|
|
|
+ // showSubmit: false,
|
|
|
+ // showCancel: false,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // if (1) {
|
|
|
+ // DialogStore.confirm({
|
|
|
+ // title: '发布失败',
|
|
|
+ // content: `该应用有发布中的申请,无法提交发布!<br/>申请提交时间:2023-02-02 15:21:23`,
|
|
|
+ // onSubmit: () => {},
|
|
|
+ // props: {
|
|
|
+ // submitText: '撤销上一次的申请,重新发布',
|
|
|
+ // cancelText: '等待审批',
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ if (1) {
|
|
|
+ state.publish.transfer = {}
|
|
|
+ state.publish.show = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ ElMessage({
|
|
|
+ message: e[0].message,
|
|
|
+ grouping: true,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+const onPublishSubmit = () => {
|
|
|
+ ref_formPublish.value
|
|
|
+ .submit()
|
|
|
+ .then(() => {
|
|
|
+ DialogStore.confirm({
|
|
|
+ content: `请确认是否提交?`,
|
|
|
+ onSubmit: () => {
|
|
|
+ state.publish.show = false
|
|
|
+ },
|
|
|
+ })
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
ElMessage({
|