|
@@ -1,25 +1,24 @@
|
|
|
-<script setup lang="ts">
|
|
|
+<script lang="ts" setup>
|
|
|
/**
|
|
|
* @Name: EditLabelDialog.vue
|
|
|
- * @Description: 负面标签-编辑弹窗
|
|
|
+ * @Description: 负面标签-编辑
|
|
|
* @Author: xinyan
|
|
|
*/
|
|
|
import { Close, Finished } from '@element-plus/icons-vue';
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
|
|
import { useResponse } from '/@/utils/useResponse';
|
|
|
import * as api from '../api';
|
|
|
-import { updateNegativeTags } from '../api';
|
|
|
|
|
|
const props = defineProps({
|
|
|
editData: <any>Object,
|
|
|
rowData: <any>Object,
|
|
|
});
|
|
|
-const { editData , rowData } = props;
|
|
|
+const { editData, rowData } = props;
|
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
|
const editOpen = defineModel({ default: false });
|
|
|
-const editDialog = <Ref>useTemplateRef('editDialog');
|
|
|
+const editDrawer = <Ref>useTemplateRef('editDrawer');
|
|
|
|
|
|
const emit = defineEmits(['refresh']);
|
|
|
|
|
@@ -60,9 +59,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-function cancelDialog() {
|
|
|
- resetForm(ruleFormRef.value);
|
|
|
- editDialog.value.visible = false;
|
|
|
+function closeDrawer() {
|
|
|
+ editDrawer.value.handleClose();
|
|
|
}
|
|
|
|
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
@@ -72,31 +70,38 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <el-dialog
|
|
|
- ref="editDialog"
|
|
|
- v-model="editOpen"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- :title="`负面标签 - 编辑 `"
|
|
|
- style="width: 35%"
|
|
|
- >
|
|
|
- <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" class="mx-2.5 mt-5" label-width="auto" status-icon>
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item class="font-medium" label="原始标签" prop="raw_label">
|
|
|
- <el-input v-model="ruleForm.raw_label" type="textarea" maxlength="150" show-word-limit :autosize="{ minRows: 2, maxRows: 4 }"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item class="font-medium" label="类别" prop="kind">
|
|
|
- <el-input v-model="ruleForm.kind" type="textarea" maxlength="150" show-word-limit/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <template #footer>
|
|
|
- <el-button :icon="Close" @click="cancelDialog">取 消</el-button>
|
|
|
- <el-button :icon="Finished" :loading="loading" type="primary" @click="submitForm(ruleFormRef)">确 定</el-button>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
+ <div class="drawer-container">
|
|
|
+ <el-drawer
|
|
|
+ ref="editDrawer"
|
|
|
+ v-model="editOpen"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ :title="`负面标签 - 编辑 `"
|
|
|
+ style="width: 25%"
|
|
|
+ >
|
|
|
+ <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" class="mx-2.5 mt-5" label-width="auto" status-icon label-position="top">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item class="font-medium" label="原始标签" prop="raw_label">
|
|
|
+ <el-input v-model="ruleForm.raw_label" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="150" show-word-limit type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="font-medium" label="类别" prop="kind">
|
|
|
+ <el-input v-model="ruleForm.kind" maxlength="150" show-word-limit type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-divider />
|
|
|
+ <div class="flex flex-1 justify-end">
|
|
|
+ <el-button :icon="Close" @click="closeDrawer">取 消</el-button>
|
|
|
+ <el-button :icon="Finished" :loading="btnLoading" type="primary" @click="submitForm(ruleFormRef)">
|
|
|
+ 确 定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<style scoped></style>
|