作者 xiaoqiu

增加了富文本编辑器以及完成配置中心

... ... @@ -19,6 +19,7 @@
"@vueup/vue-quill": "^1.2.0",
"@vueuse/core": "9.5.0",
"axios": "0.27.2",
"compressorjs": "^1.2.1",
"echarts": "5.4.0",
"element-plus": "2.2.21",
"file-saver": "2.0.5",
... ... @@ -27,8 +28,6 @@
"jsencrypt": "3.3.1",
"nprogress": "0.2.0",
"pinia": "2.0.22",
"quill-image-drop-module": "^1.0.3",
"quill-image-resize-module": "^3.0.0",
"vue": "3.2.45",
"vue-cropper": "1.0.3",
"vue-router": "4.1.4"
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727146119933" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5842" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M837.872941 220.862745h-32.928627a351.774118 351.774118 0 0 1-119.065098-20.078431 569.022745 569.022745 0 0 1-130.108236-71.077647l-20.078431-13.854118a42.566275 42.566275 0 0 0-49.995294 0l-20.078431 14.255686a495.134118 495.134118 0 0 1-127.096471 69.471373 328.282353 328.282353 0 0 1-116.454902 21.283137H186.729412a43.168627 43.168627 0 0 0-42.967843 42.967843v285.716079a369.242353 369.242353 0 0 0 368.439215 368.439215 369.443137 369.443137 0 0 0 368.037647-368.439215v-285.113726A43.369412 43.369412 0 0 0 837.872941 220.862745z m12.247843 328.081569a338.120784 338.120784 0 1 1-676.241568 0V263.42902a13.05098 13.05098 0 0 1 13.05098-12.850196h34.334118a359.80549 359.80549 0 0 0 128.501961-23.692549 528.464314 528.464314 0 0 0 134.52549-73.687844l20.078431-14.255686a12.649412 12.649412 0 0 1 14.858039 0l20.078432 13.653333a613.596863 613.596863 0 0 0 137.135686 74.691765 389.320784 389.320784 0 0 0 129.305098 23.290981h32.928627a12.850196 12.850196 0 0 1 12.649412 12.850196z" fill="#e6e6e6" p-id="5843"></path><path d="M682.666667 414.418824l-198.977255 193.355294-102.199216-102.4a15.058824 15.058824 0 0 0-21.283137 21.283137l107.620392 107.620392a22.688627 22.688627 0 0 0 16.062745 6.625882 22.287059 22.287059 0 0 0 15.661177-6.425098L702.745098 435.902745a15.058824 15.058824 0 0 0 0-21.283137 15.058824 15.058824 0 0 0-20.078431-0.200784z" fill="#e6e6e6" p-id="5844"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727144945213" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2472" width="256" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M380 704h264c4.4 0 8-3.6 8-8v-84c0-4.4-3.6-8-8-8h-40c-4.4 0-8 3.6-8 8v36H428v-36c0-4.4-3.6-8-8-8h-40c-4.4 0-8 3.6-8 8v84c0 4.4 3.6 8 8 8z" p-id="2473" fill="#ffffff"></path><path d="M760 581m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" p-id="2474" fill="#ffffff"></path><path d="M959 413.4L935.3 372c-2.2-3.8-7.1-5.1-10.9-2.9l-50.7 29.6-78.3-216.2c-8.5-26.5-33.1-44.4-60.9-44.4H301.2c-34.7 0-65.5 22.4-76.2 55.5l-74.6 205.2-50.8-29.6c-3.8-2.2-8.7-0.9-10.9 2.9L65 413.4c-2.2 3.8-0.9 8.6 2.9 10.8l60.4 35.2-14.5 40c-1.2 3.2-1.8 6.6-1.8 10V857.6c0 15.7 11.8 28.4 26.3 28.4h67.6c12.3 0 23-9.3 25.6-22.3l7.7-37.7h545.6l7.7 37.7c2.7 13 13.3 22.3 25.6 22.3h67.6c14.5 0 26.3-12.7 26.3-28.4V509.4c0-3.4-0.6-6.8-1.8-10l-14.5-40 60.3-35.2c3.8-2.2 5.1-7 3-10.8zM840 517v237H184V517l15.6-43h624.8l15.6 43zM292.7 218.1l0.5-1.3 0.4-1.3c1.1-3.3 4.1-5.5 7.6-5.5h427.6l75.4 208H220l72.7-199.9z" p-id="2475" fill="#ffffff"></path><path d="M264 581m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" p-id="2476" fill="#ffffff"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727145399547" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4191" data-spm-anchor-id="a313x.search_index.0.i12.79d43a81NjX0Ze" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M885.76 296.448H138.24c-5.632 0-10.24 4.608-10.24 10.24v408.064c0 5.632 4.608 10.24 10.24 10.24h747.52c5.632 0 10.24-4.608 10.24-10.24V306.688c0-5.632-4.608-10.24-10.24-10.24zM184.32 693.76c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6 25.6 11.264 25.6 25.6-11.264 25.6-25.6 25.6z m0-315.392c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6 25.6 11.264 25.6 25.6-11.264 25.6-25.6 25.6zM299.52 599.04c0 16.384-10.752 27.136-27.136 27.136s-27.136-13.824-27.136-27.136V421.376c0-16.384 13.824-27.136 27.136-27.136s27.136 13.824 27.136 27.136V599.04z m105.984 0c0 16.384-10.752 27.136-27.136 27.136s-27.136-13.824-27.136-27.136V421.376c0-16.384 13.824-27.136 27.136-27.136 16.384 0 27.136 13.824 27.136 27.136V599.04z m177.152 0c0 16.384-13.824 27.136-27.136 27.136-16.384 0-27.136-13.824-27.136-27.136V421.376c0-16.384 13.824-27.136 27.136-27.136 16.384 0 27.136 13.824 27.136 27.136V599.04z m95.744 0c0 16.384-10.752 27.136-27.136 27.136-16.384 0-27.136-13.824-27.136-27.136V421.376c0-16.384 13.824-27.136 27.136-27.136 16.384 0 27.136 13.824 27.136 27.136V599.04z m95.744 0c0 16.384-10.752 27.136-27.136 27.136s-27.136-13.824-27.136-27.136V421.376c0-16.384 13.824-27.136 27.136-27.136 13.824 0 27.136 13.824 27.136 27.136V599.04z m65.024 94.72c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6 25.6 11.264 25.6 25.6-11.776 25.6-25.6 25.6z m0-315.392c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6 25.6 11.264 25.6 25.6-11.776 25.6-25.6 25.6z" fill="#ffffff" p-id="4192" data-spm-anchor-id="a313x.search_index.0.i11.79d43a81NjX0Ze" class="selected"></path><path d="M885.76 245.248H138.24c-33.792 0-61.44 27.648-61.44 61.44v408.064c0 33.792 27.648 61.44 61.44 61.44h747.52c33.792 0 61.44-27.648 61.44-61.44V306.688c0-33.792-27.648-61.44-61.44-61.44z m10.24 469.504c0 5.632-4.608 10.24-10.24 10.24H138.24c-5.632 0-10.24-4.608-10.24-10.24V306.688c0-5.632 4.608-10.24 10.24-10.24h747.52c5.632 0 10.24 4.608 10.24 10.24v408.064z" p-id="4193" fill="#e6e6e6"></path><path d="M184.32 352.768m-25.6 0a25.6 25.6 0 1 0 51.2 0 25.6 25.6 0 1 0-51.2 0Z" p-id="4194" fill="#e6e6e6"></path><path d="M184.32 668.16m-25.6 0a25.6 25.6 0 1 0 51.2 0 25.6 25.6 0 1 0-51.2 0Z" p-id="4195" fill="#e6e6e6"></path><path d="M839.168 352.768m-25.6 0a25.6 25.6 0 1 0 51.2 0 25.6 25.6 0 1 0-51.2 0Z" p-id="4196" fill="#e6e6e6"></path><path d="M839.168 668.16m-25.6 0a25.6 25.6 0 1 0 51.2 0 25.6 25.6 0 1 0-51.2 0Z" p-id="4197" fill="#e6e6e6"></path><path d="M271.872 394.24c-13.824 0-27.136 10.752-27.136 27.136V599.04c0 13.824 10.752 27.136 27.136 27.136s27.136-10.752 27.136-27.136V421.376c0.512-13.312-13.312-27.136-27.136-27.136zM378.368 394.24c-13.824 0-27.136 10.752-27.136 27.136V599.04c0 13.824 10.752 27.136 27.136 27.136s27.136-10.752 27.136-27.136V421.376c0-13.312-10.752-27.136-27.136-27.136zM555.008 394.24c-13.824 0-27.136 10.752-27.136 27.136V599.04c0 13.824 10.752 27.136 27.136 27.136 13.824 0 27.136-10.752 27.136-27.136V421.376c0.512-13.312-10.752-27.136-27.136-27.136zM650.752 394.24c-13.824 0-27.136 10.752-27.136 27.136V599.04c0 13.824 10.752 27.136 27.136 27.136 16.384 0 27.136-10.752 27.136-27.136V421.376c0.512-13.312-10.752-27.136-27.136-27.136zM747.008 394.24c-13.824 0-27.136 10.752-27.136 27.136V599.04c0 13.824 10.752 27.136 27.136 27.136s27.136-10.752 27.136-27.136V421.376c0-13.312-13.824-27.136-27.136-27.136z" p-id="4198" fill="#e6e6e6" data-spm-anchor-id="a313x.search_index.0.i10.79d43a81NjX0Ze" class=""></path></svg>
\ No newline at end of file
... ...
<template>
<div>
<QuillEditor
ref="myQuillEditor"
theme="snow"
v-model:content="content"
:options="data.editorOption"
contentType="html"
@update:content="setValue()"
/>
<!-- 使用自定义图片上传 -->
<input
type="file"
hidden
accept=".jpg,.png"
ref="fileBtn"
@change="handleUpload"
/>
</div>
</template>
<script setup>
import { QuillEditor } from "@vueup/vue-quill";
import "@vueup/vue-quill/dist/vue-quill.snow.css";
import { reactive, onMounted, ref, toRaw, watch } from "vue";
// import { backsite } from '@/api'
const props = defineProps(["value"]);
const emit = defineEmits(["updateValue"]);
const content = ref("");
const myQuillEditor = ref();
// watch(() => props.value, (val) => {
// console.log(toRaw(myQuillEditor.value))
// toRaw(myQuillEditor.value).setHTML(val)
// }, { deep: true })
const fileBtn = ref();
const data = reactive({
content: "",
editorOption: {
modules: {
toolbar: [
["bold", "italic", "underline", "strike"],
[{ size: ["small", false, "large", "huge"] }],
[{ font: [] }],
[{ align: [] }],
[{ list: "ordered" }, { list: "bullet" }],
[{ indent: "-1" }, { indent: "+1" }],
[{ header: 1 }, { header: 2 }],
["image"],
[{ direction: "rtl" }],
[{ color: [] }, { background: [] }],
],
},
placeholder: "请输入内容...",
},
});
const imgHandler = (state) => {
if (state) {
fileBtn.value.click();
}
};
const setValue = () => {
const text = toRaw(myQuillEditor.value).getHTML();
emit("updateValue", text);
};
const handleUpload = (e) => {
const files = Array.prototype.slice.call(e.target.files);
console.log(files, "files");
if (!files) {
return;
}
const formdata = new FormData();
formdata.append("file", files[0]);
const quill = toRaw(myQuillEditor.value).getQuill();
const length = quill.getSelection().index;
// 插入图片,res为服务器返回的图片链接地址
quill.insertEmbed(
length,
"image",
"https://img.zcool.cn/community/0159645d5a2f40a80120695c8d54fc.jpg@1280w_1l_2o_100sh.jpg"
);
// 调整光标到最后
quill.setSelection(length + 1);
// backsite.uploadFile(formdata)
// .then(res => {
// if (res.data.url) {
// const quill = toRaw(myQuillEditor.value).getQuill()
// const length = quill.getSelection().index
// // 插入图片,res为服务器返回的图片链接地址
// quill.insertEmbed(length, 'image', res.data.url)
// // 调整光标到最后
// quill.setSelection(length + 1)
// }
// })
};
onMounted(() => {
const quill = toRaw(myQuillEditor.value).getQuill();
if (myQuillEditor.value) {
quill.getModule("toolbar").addHandler("image", imgHandler);
}
toRaw(myQuillEditor.value).setHTML(props.value);
});
</script>
<style scoped lang="scss">
:deep(.ql-editor) {
min-height: 180px;
}
:deep(.ql-formats) {
height: 21px;
line-height: 21px;
}
</style>
... ...
... ... @@ -27,6 +27,8 @@ import './permission' // permission control
import { useDict } from '@/utils/dict'
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
// 富文本编辑器
import QuillEditor from '@/components/QuillEditor'
// 分页组件
import Pagination from '@/components/Pagination'
// 自定义表格工具组件
... ... @@ -56,6 +58,7 @@ app.config.globalProperties.selectDictLabels = selectDictLabels
// 全局组件挂载
app.component('DictTag', DictTag)
app.component('QuillEditor', QuillEditor)
app.component('Pagination', Pagination)
app.component('TreeSelect', TreeSelect)
app.component('FileUpload', FileUpload)
... ...
<template>
<div>车辆型号</div>
<div class="app-container">
<!-- 筛选条件 -->
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
label-width="68px"
>
<el-form-item label="车辆品牌" prop="brandName">
<el-input
v-model="queryParams.brandName"
placeholder="填写车辆品牌"
clearable
style="width: 220px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="车辆型号" prop="modelName">
<el-input
v-model="queryParams.modelName"
placeholder="填写车辆型号"
clearable
style="width: 220px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"
>查询</el-button
>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
v-hasPermi="['system:role:add']"
@click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
v-hasPermi="['system:role:remove']"
@click="handleDelete"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="Upload"
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入</el-button
>
</el-col>
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> -->
</el-row>
<!-- 表格数据 -->
<el-table
v-loading="loading"
:data="dataList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="序号"
prop="policyId"
width="120"
align="center"
/>
<el-table-column label="车辆品牌" prop="brandName" align="center" />
<el-table-column label="车辆型号" prop="modelName" align="center" />
<el-table-column label="操作时间" prop="authTime" align="center" />
<el-table-column
label="操作人"
prop="editAuth"
width="100"
align="center"
/>
<el-table-column
label="操作"
fixed="right"
align="center"
prop="Feedback"
>
<template #default="{ row }">
<el-button type="primary" @click="handleUpdate(row)">编辑</el-button>
<el-button type="danger" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
/>
<!-- 添加或修改车辆性质配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="natureRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="车辆品牌" prop="brandName">
<el-input v-model="form.brandName" placeholder="请输入车辆性质名称" />
</el-form-item>
<el-form-item label="车辆型号" prop="modelName">
<el-input v-model="form.modelName" placeholder="请输入车辆性质名称" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog
:title="upload.title"
v-model="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<template #tip>
<div class="el-upload__tip text-center">
<div class="el-upload__tip">
<el-checkbox
v-model="upload.updateSupport"
/>是否更新已经存在的型号数据
</div>
<span>仅允许导入xls、xlsx格式文件。</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</template>
</el-upload>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
export default {};
<script setup>
import { getToken } from "@/utils/auth";
const { proxy } = getCurrentInstance();
/*** 型号导入参数 */
const upload = reactive({
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData",
});
const dataList = ref([
{
policyId: "1",
brandName: "阿尔法-罗密欧",
modelName: "156 4C Giulietta Mito",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "2",
brandName: "梅赛德斯-AMG",
modelName: "C63AMG CLSAMG G63AMG S65AMG SL63AMG",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "3",
brandName: "阿斯顿-马丁",
modelName: "DB9Cygnet DBS V12 Vantage V12 Zagato 一汽奥迪",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
]);
const open = ref(false);
const multiple = ref(true);
const loading = ref(false);
const total = ref(5);
const title = ref("");
const ids = ref([]);
const form = ref({});
const rules = ref({
natureName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" },
],
});
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
brandName: undefined,
modelName: undefined,
});
/**文件上传中处理 */
const handleFileUploadProgress = (event, file, fileList) => {
upload.isUploading = true;
};
/** 文件上传成功处理 */
const handleFileSuccess = (response, file, fileList) => {
upload.open = false;
upload.isUploading = false;
proxy.$refs["uploadRef"].handleRemove(file);
proxy.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
// getList();
};
/** 导入按钮操作 */
function handleImport() {
upload.title = "型号导入";
upload.open = true;
}
/** 下载模板操作 */
function importTemplate() {
proxy.download(
"system/user/importTemplate",
{},
`user_template_${new Date().getTime()}.xlsx`
);
}
/** 添加车辆性质 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加车辆性质";
}
/** 修改角色 */
function handleUpdate(row) {
reset();
form.value = row;
title.value = "修改车辆性质";
open.value = true;
}
/** 删除按钮操作 */
function handleDelete(row) {
const natureIds = row.natureId || ids.value;
proxy.$modal
.confirm('是否确认删除车辆性质编号为"' + natureIds + '"的数据项?')
.then(function () {
// return delRole(natureIds);
proxy.$modal.msgSuccess("删除成功");
});
}
/** 提交上传文件 */
function submitFileForm() {
proxy.$refs["uploadRef"].submit();
}
/** 重置新增的表单以及其他数据 */
function reset() {
form.value = {
natureId: undefined,
typeName: undefined,
authTime: undefined,
editAuth: undefined,
};
proxy.resetForm("natureRef");
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.roleId);
multiple.value = !selection.length;
}
/** 搜索按钮操作 */
function handleQuery() {}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["natureRef"].validate((valid) => {
if (valid) {
if (form.value.natureId != undefined) {
proxy.$modal.msgSuccess("修改成功");
} else {
proxy.$modal.msgSuccess("新增成功");
}
}
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
</script>
<style></style>
... ...
<template>
<div>车辆性质管理</div>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
v-hasPermi="['system:role:add']"
@click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
v-hasPermi="['system:role:remove']"
@click="handleDelete"
>删除</el-button
>
</el-col>
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> -->
</el-row>
<!-- 表格数据 -->
<el-table
v-loading="loading"
:data="dataList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="序号"
prop="policyId"
width="120"
align="center"
/>
<el-table-column label="车辆性质名称" prop="natureName" align="center" />
<el-table-column label="操作时间" prop="authTime" align="center" />
<el-table-column label="操作人" prop="editAuth" align="center" />
<el-table-column
label="操作"
fixed="right"
align="center"
prop="Feedback"
>
<template #default="{ row }">
<el-button type="primary" @click="handleUpdate(row)">编辑</el-button>
<el-button type="danger" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
/>
<!-- 添加或修改车辆性质配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="natureRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="车辆性质名称" prop="natureName">
<el-input
v-model="form.natureName"
placeholder="请输入车辆性质名称"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
export default {};
<script setup>
const { proxy } = getCurrentInstance();
const dataList = ref([
{
policyId: "1",
natureName: "营运车辆",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "2",
natureName: "公务车辆",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "3",
natureName: "私家车",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
]);
const open = ref(false);
const multiple = ref(true);
const loading = ref(false);
const total = ref(5);
const title = ref("");
const ids = ref([]);
const form = ref({});
const rules = ref({
natureName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" },
],
});
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
});
/** 添加车辆性质 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加车辆性质";
}
/** 修改角色 */
function handleUpdate(row) {
reset();
form.value = row;
title.value = "修改车辆性质";
open.value = true;
}
/** 删除按钮操作 */
function handleDelete(row) {
const natureIds = row.natureId || ids.value;
proxy.$modal
.confirm('是否确认删除车辆性质编号为"' + natureIds + '"的数据项?')
.then(function () {
// return delRole(natureIds);
proxy.$modal.msgSuccess("删除成功");
});
}
/** 重置新增的表单以及其他数据 */
function reset() {
form.value = {
natureId: undefined,
natureName: undefined,
authTime: undefined,
editAuth: undefined,
};
proxy.resetForm("natureRef");
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.roleId);
multiple.value = !selection.length;
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["natureRef"].validate((valid) => {
if (valid) {
if (form.value.natureId != undefined) {
proxy.$modal.msgSuccess("修改成功");
} else {
proxy.$modal.msgSuccess("新增成功");
}
}
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
</script>
<style></style>
... ...
<template>
<div>号牌种类</div>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
v-hasPermi="['system:role:add']"
@click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
v-hasPermi="['system:role:remove']"
@click="handleDelete"
>删除</el-button
>
</el-col>
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> -->
</el-row>
<!-- 表格数据 -->
<el-table
v-loading="loading"
:data="dataList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="序号"
prop="policyId"
width="120"
align="center"
/>
<el-table-column label="号牌种类名称" prop="numSort" align="center" />
<el-table-column label="操作时间" prop="authTime" align="center" />
<el-table-column label="操作人" prop="editAuth" align="center" />
<el-table-column
label="操作"
fixed="right"
align="center"
prop="Feedback"
>
<template #default="{ row }">
<el-button type="primary" @click="handleUpdate(row)">编辑</el-button>
<el-button type="danger" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
/>
<!-- 添加或修改车辆性质配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="natureRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="号牌种类名称" prop="numSort">
<el-input v-model="form.numSort" placeholder="请输入号牌种类名称" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
export default {};
<script setup>
const { proxy } = getCurrentInstance();
const dataList = ref([
{
policyId: "1",
numSort: "蓝色车牌",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "2",
numSort: "黄色车牌",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "3",
numSort: "白色色车牌",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
]);
const open = ref(false);
const multiple = ref(true);
const loading = ref(false);
const total = ref(5);
const title = ref("");
const ids = ref([]);
const form = ref({});
const rules = ref({
numSort: [{ required: true, message: "角色名称不能为空", trigger: "blur" }],
});
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
});
/** 添加车辆性质 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加号牌种类";
}
/** 修改角色 */
function handleUpdate(row) {
reset();
form.value = row;
title.value = "修改号牌种类";
open.value = true;
}
/** 删除按钮操作 */
function handleDelete(row) {
const natureIds = row.natureId || ids.value;
proxy.$modal
.confirm('是否确认删除车辆性质编号为"' + natureIds + '"的数据项?')
.then(function () {
// return delRole(natureIds);
proxy.$modal.msgSuccess("删除成功");
});
}
/** 重置新增的表单以及其他数据 */
function reset() {
form.value = {
natureId: undefined,
numSort: undefined,
authTime: undefined,
editAuth: undefined,
};
proxy.resetForm("natureRef");
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.roleId);
multiple.value = !selection.length;
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["natureRef"].validate((valid) => {
if (valid) {
if (form.value.natureId != undefined) {
proxy.$modal.msgSuccess("修改成功");
} else {
proxy.$modal.msgSuccess("新增成功");
}
}
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
</script>
<style></style>
... ...
<template>
<div>车辆类型</div>
<div class="app-container">
<!-- 筛选条件 -->
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
label-width="68px"
>
<el-form-item label="车辆类型" prop="typeName">
<el-input
v-model="queryParams.typeName"
placeholder="填写车辆类型"
clearable
style="width: 220px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"
>查询</el-button
>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
v-hasPermi="['system:role:add']"
@click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
v-hasPermi="['system:role:remove']"
@click="handleDelete"
>删除</el-button
>
</el-col>
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> -->
</el-row>
<!-- 表格数据 -->
<el-table
v-loading="loading"
:data="dataList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="序号"
prop="policyId"
width="120"
align="center"
/>
<el-table-column label="车辆类型" prop="typeName" align="center" />
<el-table-column label="操作时间" prop="authTime" align="center" />
<el-table-column label="操作人" prop="editAuth" align="center" />
<el-table-column
label="操作"
fixed="right"
align="center"
prop="Feedback"
>
<template #default="{ row }">
<el-button type="primary" @click="handleUpdate(row)">编辑</el-button>
<el-button type="danger" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
/>
<!-- 添加或修改车辆性质配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="natureRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="车辆类型名称" prop="typeName">
<el-input v-model="form.typeName" placeholder="请输入车辆性质名称" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
export default {};
<script setup>
const { proxy } = getCurrentInstance();
const dataList = ref([
{
policyId: "1",
typeName: "小型车",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "2",
typeName: "高级车型",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "3",
typeName: "三厢车型",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
]);
const open = ref(false);
const multiple = ref(true);
const loading = ref(false);
const total = ref(5);
const title = ref("");
const ids = ref([]);
const form = ref({});
const rules = ref({
natureName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" },
],
});
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
typeName: undefined,
});
/** 添加车辆性质 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加车辆性质";
}
/** 修改角色 */
function handleUpdate(row) {
reset();
form.value = row;
title.value = "修改车辆性质";
open.value = true;
}
/** 删除按钮操作 */
function handleDelete(row) {
const natureIds = row.natureId || ids.value;
proxy.$modal
.confirm('是否确认删除车辆性质编号为"' + natureIds + '"的数据项?')
.then(function () {
// return delRole(natureIds);
proxy.$modal.msgSuccess("删除成功");
});
}
/** 重置新增的表单以及其他数据 */
function reset() {
form.value = {
natureId: undefined,
typeName: undefined,
authTime: undefined,
editAuth: undefined,
};
proxy.resetForm("natureRef");
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.roleId);
multiple.value = !selection.length;
}
/** 搜索按钮操作 */
function handleQuery() {}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["natureRef"].validate((valid) => {
if (valid) {
if (form.value.natureId != undefined) {
proxy.$modal.msgSuccess("修改成功");
} else {
proxy.$modal.msgSuccess("新增成功");
}
}
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
</script>
<style></style>
... ...
... ... @@ -16,19 +16,11 @@
type="danger"
plain
icon="Delete"
:disabled="multiple"
v-hasPermi="['system:role:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
v-hasPermi="['system:role:export']"
>导出</el-button
>
</el-col>
</el-row>
<!-- 表格数据 -->
... ... @@ -52,8 +44,9 @@
width="180"
prop="Feedback"
>
<template #default>
<el-button type="danger">删除</el-button>
<template #default="{ row }">
<el-button type="primary" @click="handleUpdate(row)">编辑</el-button>
<el-button type="danger" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
... ... @@ -68,7 +61,7 @@
<!-- 添加或修改用户配置对话框 -->
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
<el-form :model="form" :rules="rules" ref="rulesRef" label-width="80px">
<el-form :model="form" :rules="rules" ref="companyRef" label-width="80px">
<el-form-item label="公司名称" prop="company">
<el-input
v-model="form.company"
... ... @@ -90,15 +83,17 @@
<script setup>
const { proxy } = getCurrentInstance();
const loading = ref(false);
const multiple = ref(true);
const total = ref(3);
const title = ref("添加分配规则");
const ids = ref([]);
const title = ref("");
const open = ref(false);
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
});
const form = reactive({});
const form = ref({});
const rules = {
company: [
{ required: true, message: "公司名称不能为空", trigger: "blur" },
... ... @@ -120,7 +115,14 @@ const rulesList = ref([
function handleAdd() {
reset();
open.value = true;
title.value = "添加规则";
title.value = "添加承保公司";
}
/** 修改角色 */
function handleUpdate(row) {
reset();
form.value = row;
title.value = "修改承保公司";
open.value = true;
}
/** 重置操作表单 */
... ... @@ -129,14 +131,23 @@ function reset() {
companyId: undefined,
company: undefined,
};
proxy.resetForm("rulesRef");
proxy.resetForm("companyRef");
}
/** 删除按钮操作 */
function handleDelete(row) {
const companyIds = row.companyId || ids.value;
proxy.$modal
.confirm('是否确认删除车辆性质编号为"' + companyIds + '"的数据项?')
.then(function () {
// return delRole(natureIds);
proxy.$modal.msgSuccess("删除成功");
});
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
// ids.value = selection.map(item => item.roleId);
// single.value = selection.length != 1;
// multiple.value = !selection.length;
ids.value = selection.map((item) => item.roleId);
multiple.value = !selection.length;
console.log(selection);
}
... ... @@ -144,7 +155,7 @@ const getList = () => {};
/** 提交按钮 */
function submitForm() {
proxy.$refs["rulesRef"].validate((valid) => {
proxy.$refs["companyRef"].validate((valid) => {
if (valid) {
if (form.value.userId != undefined) {
proxy.$modal.msgSuccess("修改成功");
... ...
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
v-hasPermi="['system:role:add']"
@click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
v-hasPermi="['system:role:remove']"
@click="handleDelete"
>删除</el-button
>
</el-col>
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> -->
</el-row>
<!-- 表格数据 -->
<el-table
v-loading="loading"
:data="dataList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="序号"
prop="policyId"
width="120"
align="center"
/>
<el-table-column label="保险名称" prop="insuranceName" align="center" />
<el-table-column label="操作时间" prop="authTime" align="center" />
<el-table-column label="操作人" prop="editAuth" align="center" />
<el-table-column
label="操作"
fixed="right"
align="center"
prop="Feedback"
>
<template #default="{ row }">
<el-button type="primary" @click="handleUpdate(row)">编辑</el-button>
<el-button type="danger" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
/>
<!-- 添加或修改车辆性质配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="natureRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="保险名称" prop="insuranceName">
<el-input v-model="form.insuranceName" placeholder="请输入保险名称" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
const { proxy } = getCurrentInstance();
const dataList = ref([
{
policyId: "1",
insuranceName: "商业险",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "2",
insuranceName: "人身安全险",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
{
policyId: "3",
insuranceName: "交强险",
authTime: "2024-09-24 11:53:43",
editAuth: "admin",
},
]);
const open = ref(false);
const multiple = ref(true);
const loading = ref(false);
const total = ref(5);
const title = ref("");
const ids = ref([]);
const form = ref({});
const rules = ref({
insuranceName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" },
],
});
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
});
/** 添加车辆性质 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加号牌种类";
}
/** 修改角色 */
function handleUpdate(row) {
reset();
form.value = row;
title.value = "修改号牌种类";
open.value = true;
}
/** 删除按钮操作 */
function handleDelete(row) {
const natureIds = row.natureId || ids.value;
proxy.$modal
.confirm('是否确认删除车辆性质编号为"' + natureIds + '"的数据项?')
.then(function () {
// return delRole(natureIds);
proxy.$modal.msgSuccess("删除成功");
});
}
/** 重置新增的表单以及其他数据 */
function reset() {
form.value = {
natureId: undefined,
numSort: undefined,
authTime: undefined,
editAuth: undefined,
};
proxy.resetForm("natureRef");
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.roleId);
multiple.value = !selection.length;
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["natureRef"].validate((valid) => {
if (valid) {
if (form.value.natureId != undefined) {
proxy.$modal.msgSuccess("修改成功");
} else {
proxy.$modal.msgSuccess("新增成功");
}
}
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
</script>
<style></style>
... ...
... ... @@ -183,14 +183,7 @@
</el-col>
</el-row>
<el-form-item label="作废原因" prop="progress">
<el-input
:rows="6"
disabled
type="textarea"
placeholder="请输入作废原因"
v-model="form.deprecatedReason"
resize="none"
/>
<QuillEditor :value="form.deprecatedReason" @updateValue="getMsg" />
</el-form-item>
</el-form>
<template #footer>
... ... @@ -329,6 +322,9 @@ function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
const getMsg = (val) => {
console.log(val);
};
</script>
<style></style>
... ...