|
@@ -18,7 +18,7 @@
|
|
|
}
|
|
|
})"/>
|
|
|
<CzrButton title="迁移" icon="move"/>
|
|
|
- <CzrButton title="归档" icon="cloud"/>
|
|
|
+ <CzrButton title="归档" icon="cloud" @click="onKnowledge()"/>
|
|
|
<CzrButton type="del" title="删除" icon="czr_del" @click="onDel()"/>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -65,7 +65,7 @@
|
|
|
<template #caozuo-column-value="{ scope }">
|
|
|
<div class="__czr-table-operations">
|
|
|
<CzrButton type="table" title="重命名" @click="onRename(scope.row)"/>
|
|
|
- <CzrButton type="table" title="迁移"/>
|
|
|
+ <CzrButton type="table" title="迁移" @click="onKnowledge(scope.row)"/>
|
|
|
<CzrButton type="table" title="归档"/>
|
|
|
<CzrButton type="table-del" @click="onDel(scope.row)"/>
|
|
|
</div>
|
|
@@ -74,6 +74,7 @@
|
|
|
</template>
|
|
|
</CzrContent>
|
|
|
<renameCom v-model:show="state.rename.show" :transfer="state.rename.transfer" @refresh="onSearch"/>
|
|
|
+ <knowledgeSelectCom v-model:show="state.knowledge.show" :transfer="state.knowledge.transfer" @refresh="onSearch"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -84,6 +85,7 @@ import {debounce} from "lodash";
|
|
|
import {useDialogStore, useDictionaryStore} from "@/stores";
|
|
|
import {ElMessage} from "element-plus";
|
|
|
import renameCom from './rename.vue'
|
|
|
+import knowledgeSelectCom from './knowledge-select.vue'
|
|
|
|
|
|
const DialogStore = useDialogStore();
|
|
|
const DictionaryStore = useDictionaryStore();
|
|
@@ -125,6 +127,10 @@ const state: any = reactive({
|
|
|
show: false,
|
|
|
transfer: {}
|
|
|
},
|
|
|
+ knowledge: {
|
|
|
+ show: false,
|
|
|
+ transfer: {}
|
|
|
+ },
|
|
|
})
|
|
|
const setText = debounce((v) => {
|
|
|
state.query.form.name = v
|
|
@@ -217,7 +223,18 @@ const onDel = (row: any = null) => {
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- console.log(state.query.selected)
|
|
|
+ if (state.query.selected.length === 0) {
|
|
|
+ ElMessage.warning('请至少选择一条记录!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ DialogStore.confirm({
|
|
|
+ title: '删除确认',
|
|
|
+ content: `是否批量删除${state.query.selected.length}个文档?<br/>所选文档中的分段会跟随删除,请谨慎操作。`,
|
|
|
+ onSubmit: () => {
|
|
|
+ ElMessage.success('删除成功!')
|
|
|
+ onSearch()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
const onRename = (row) => {
|
|
@@ -226,13 +243,32 @@ const onRename = (row) => {
|
|
|
}
|
|
|
state.rename.show = true
|
|
|
}
|
|
|
-const initDictionary = () => {
|
|
|
- DictionaryStore.initKnowledgeGroups()
|
|
|
+const onKnowledge = (row: any = null) => {
|
|
|
+ if (row) {
|
|
|
+ state.knowledge.transfer = {
|
|
|
+ row: JSON.parse(JSON.stringify(row)),
|
|
|
+ type: 'text',
|
|
|
+ }
|
|
|
+ state.knowledge.show = true
|
|
|
+ } else {
|
|
|
+ if (state.query.selected.length === 0) {
|
|
|
+ ElMessage.warning('请至少选择一条记录!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ state.knowledge.transfer = {
|
|
|
+ list: [...state.query.selected],
|
|
|
+ type: 'text',
|
|
|
+ }
|
|
|
+ state.knowledge.show = true
|
|
|
+ }
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
initDictionary()
|
|
|
onReset()
|
|
|
})
|
|
|
+const initDictionary = () => {
|
|
|
+ DictionaryStore.initKnowledgeGroups()
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|