add t_bookmark_type operate

This commit is contained in:
simple321vip
2022-08-28 13:26:29 +08:00
parent c865fd1184
commit 4eef8656c3
51 changed files with 148 additions and 51 deletions
+84
View File
@@ -0,0 +1,84 @@
<template>
<div class="dashboard">
<el-form :model="dialog_form">
<el-form-item label="分类" :label-width="formLabelWidth">
<el-select v-model="dialog_form.bk_type_id" placeholder>
<el-option
v-for="(item) in types"
:key="item.bk_type_id"
:value="item.bk_type_id"
:label="item.bk_type_name"
/>
</el-select>
<el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="dialog_form.comment" autocomplete="off" />
</el-form-item>
<el-form-item label="url" :label-width="formLabelWidth">
<el-input v-model="dialog_form.url" autocomplete="off" />
</el-form-item>
</el-form-item>
</el-form>
<!-- <template #footer> -->
<span class="dialog-footer">
<el-button @click="concel">取消</el-button>
<el-button type="primary" @click="submit">提交</el-button>
</span>
<!-- </template> -->
</div>
</template>
<script setup lang="ts">
import { reactive } from 'vue';
import { update_bookmark, put_bookmark } from '../../api/bookmark'
import type { FormInstance } from 'element-plus'
const formLabelWidth = '140px'
type Props = {
types: any[],
dialog_form: any,
operate_code: String
}
const props = defineProps<Props>()
const emit = defineEmits(['on-concel', 'on-submit'])
const concel = () => {
emit('on-concel')
}
const submit = () => {
const params = {
bk_id: props.dialog_form.bk_id,
bk_type_id: props.dialog_form.bk_type_id,
comment: props.dialog_form.comment,
url: props.dialog_form.url,
}
if (props.operate_code == '0') {
put_bookmark(params).then(response => {
emit('on-submit')
})
} else if (props.operate_code == '1') {
update_bookmark(params).then(response => {
emit('on-submit')
})
} else if (props.operate_code == '2') {
update_bookmark(params).then(response => {
emit('on-submit')
})
}
}
</script>
<style scoped>.el-button--text {
margin-right: 15px;
}
.el-select {
width: 300px;
}
.el-input {
width: 300px;
}
.dialog-footer button:first-child {
margin-right: 10px;
}
</style>
+12
View File
@@ -14,6 +14,7 @@
<div class="tag_list">
<el-tag class="ml-2 click-icon" :type="item.clicked ? 'danger' : 'info'" v-for="(item) in bookmark_types"
@click="handleTags(item)">{{ item.bk_type_name }}</el-tag>
<el-button type="primary" @click="handleManageType" v-show="Tenant.account">自定义</el-button>
</div>
</el-form>
<div class="create_dialog">
@@ -58,6 +59,10 @@
<el-dialog v-model="dialogVisible">
<delete_dialog :delete_id="currentDialogData.bk_id" @on-submit="doDelete"></delete_dialog>
</el-dialog>
<!-- <el-dialog v-model="TypeDialogVisible">
<bookmarkType_dialog :delete_id="currentDialogData.bk_id" @on-submit="doDelete"></bookmarkType_dialog>
</el-dialog> -->
</div>
</template>
@@ -66,6 +71,7 @@ import { reactive, ref } from 'vue'
import { search_bookmark, delete_bookmark } from '../../api/bookmark'
import { bookmark_type } from '../../api/master'
import bookmark_dialog from './dialog.vue'
import bookmarkType_dialog from './Typedialog.vue'
import delete_dialog from '../../components/operate/deleteDialog.vue'
import type { ElTable } from 'element-plus'
import { CopyDocument } from "@element-plus/icons-vue";
@@ -135,9 +141,15 @@ const toggleSelection = (rows?: Bookmark[]) => {
}
const handleManageType = () => {
}
// dialog表示flag
let dialogFormVisible = ref(false)
let dialogVisible = ref(false)
let TypeDialogVisible = ref(false)
// 操作-》添加
const handleInsert = () => {