| | |
| | | method: 'delete', |
| | | data: query |
| | | }) |
| | | } |
| | | |
| | | // /inspectionTask/addOrEditInspectionTask |
| | | // 巡检上传 |
| | | export function uploadInspectionTask(query) { |
| | | return request({ |
| | | url: '/inspectionTask/addOrEditInspectionTask', |
| | | method: 'post', |
| | | data: query |
| | | }) |
| | | } |
| | |
| | | method: 'delete', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // /coalInfo/coalInfoList |
| | | // 查询煤种列表 |
| | | export function getCoalInfoList(query) { |
| | | return request({ |
| | | url: '/coalInfo/coalInfoList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | /* 分割面板样式 */ |
| | | .splitpanes.default-theme .splitpanes__pane { |
| | | background-color: var(--splitpanes-default-bg) !important; |
| | | height: 86vh; |
| | | padding: 20px 0; |
| | | } |
| | |
| | | v-for="(file, index) in fileList" |
| | | > |
| | | <el-link :href="`${file.url}`" :underline="false" target="_blank"> |
| | | <span class="el-icon-document"> {{ file.bucketFilename }} </span> |
| | | <!-- 取8位 --> |
| | | <span class="el-icon-document"> |
| | | {{ file.bucketFilename.substring(0, 18) }} |
| | | </span> |
| | | </el-link> |
| | | <div class="ele-upload-list__item-content-action"> |
| | | <el-link |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, watch, onMounted, nextTick, getCurrentInstance } from 'vue'; |
| | | import { getToken } from "@/utils/auth"; |
| | | import Sortable from "sortablejs"; |
| | | import { ElMessage } from "element-plus"; |
| | | import axios from "axios"; |
| | | |
| | | // Props 定义 |
| | | const props = defineProps({ |
| | | modelValue: [String, Object, Array], |
| | | // 上传接口地址 |
| | | action: { |
| | | type: String, |
| | | default: "/common/minioUploads", |
| | | action: { type: String, default: "/common/minioUploads" }, |
| | | data: { type: Object }, |
| | | limit: { type: Number, default: 5 }, |
| | | fileSize: { type: Number, default: 5 }, |
| | | fileType: { |
| | | type: Array, |
| | | default: () => ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "pdf"] |
| | | }, |
| | | // 上传携带的参数 |
| | | data: { |
| | | type: Object, |
| | | }, |
| | | // 数量限制 |
| | | limit: { |
| | | type: Number, |
| | | default: 5, |
| | | }, |
| | | // 大小限制(MB) |
| | | fileSize: { |
| | | type: Number, |
| | | default: 5, |
| | | }, |
| | | // 文件类型, 例如['png', 'jpg', 'jpeg'] |
| | | fileType: { |
| | | type: Array, |
| | | default: () => ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "pdf"], |
| | | }, |
| | | // 是否显示提示 |
| | | isShowTip: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | // 禁用组件(仅查看文件) |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | // 拖动排序 |
| | | drag: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | isShowTip: { type: Boolean, default: true }, |
| | | disabled: { type: Boolean, default: false }, |
| | | drag: { type: Boolean, default: true }, |
| | | statusType: { type: Number, default: "" }, // 用于区分不同状态的上传 |
| | | }); |
| | | |
| | | // 组件实例和事件 |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(); |
| | | const emit = defineEmits(['update:modelValue']); |
| | | |
| | | // 响应式数据 |
| | | const number = ref(0); |
| | | const uploadList = ref([]); |
| | | const baseUrl = import.meta.env.VITE_APP_BASE_API; |
| | | const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + props.action); // 上传文件服务器地址 |
| | | const headers = ref({ Authorization: "Bearer " + getToken() }); |
| | | const fileList = ref([]); |
| | | const showTip = computed( |
| | | () => props.isShowTip && (props.fileType || props.fileSize) |
| | | ); |
| | | const init = () =>{ |
| | | |
| | | // 计算属性 |
| | | const uploadFileUrl = computed(() => import.meta.env.VITE_APP_BASE_API + props.action); |
| | | const headers = computed(() => ({ Authorization: "Bearer " + getToken() })); |
| | | const showTip = computed(() => props.isShowTip && (props.fileType || props.fileSize)); |
| | | // 初始化和编辑初始化方法 |
| | | const init = () => { |
| | | fileList.value = []; |
| | | uploadList.value = []; |
| | | number.value = 0; |
| | | } |
| | | }; |
| | | |
| | | const editInit = (val) => { |
| | | fileList.value = []; |
| | | val.storageBlobDTO.forEach(element => { |
| | | console.log("编辑初始化", element); |
| | | val.storageBlobDTO.forEach((element) => { |
| | | fileList.value.push(element); |
| | | uploadedSuccessfully(); |
| | | }); |
| | | // uploadList.value.push |
| | | }; |
| | | defineExpose({ |
| | | init, |
| | | editInit |
| | | }); |
| | | |
| | | // 暴露方法 |
| | | defineExpose({ init, editInit }); |
| | | |
| | | // 监听 modelValue 变化 |
| | | watch( |
| | | () => props.modelValue, |
| | | (val) => { |
| | | if (val) { |
| | | let temp = 1; |
| | | // 首先将值转为数组 |
| | | const list = Array.isArray(val) ? val : props.modelValue.split(","); |
| | | // 然后将数组转为对象数组 |
| | | fileList.value = list.map((item) => { |
| | | if (typeof item === "string") { |
| | | item = { name: item, url: item }; |
| | |
| | | }); |
| | | } else { |
| | | fileList.value = []; |
| | | return []; |
| | | } |
| | | }, |
| | | { deep: true, immediate: true } |
| | | ); |
| | | |
| | | // 文件上传处理 |
| | | const UploadImage = (param) => { |
| | | const formData = new FormData(); |
| | | formData.append("files", param.file); |
| | | axios |
| | | .post(uploadFileUrl.value, formData, { |
| | | headers: { |
| | | "Content-Type": "multipart/form-data", |
| | | ...headers.value, |
| | | }, |
| | | onUploadProgress: (progressEvent) => { |
| | | // 进度条更新 |
| | | const percent = Math.round( |
| | | (progressEvent.loaded * 100) / progressEvent.total |
| | | ); |
| | | param.onProgress({ percent }); |
| | | }, |
| | | }) |
| | | .then((response) => { |
| | | if (response.data.code === 200) { |
| | | console.log("上传成功", response.data); |
| | | handleUploadSuccess(response.data, param.file); |
| | | // 更新父组件 |
| | | emit("update:modelValue", fileList.value); |
| | | formData.append("type", props.statusType); |
| | | axios.post(uploadFileUrl.value, formData, { |
| | | headers: { |
| | | "Content-Type": "multipart/form-data", |
| | | ...headers.value, |
| | | }, |
| | | onUploadProgress: (progressEvent) => { |
| | | const percent = Math.round((progressEvent.loaded * 100) / progressEvent.total); |
| | | param.onProgress({ percent }); |
| | | }, |
| | | }) |
| | | .then((response) => { |
| | | if (response.data.code === 200) { |
| | | handleUploadSuccess(response.data, param.file); |
| | | ElMessage.success("上传成功"); |
| | | emit("update:modelValue", fileList.value); |
| | | } else { |
| | | param.onError(new Error(response.data.msg)); |
| | | ElMessage.error(response.data.msg); |
| | | handleUploadError(); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | param.onError(error); |
| | | }); |
| | | }; |
| | | // 获取文件Base64(可选功能,暂时保留) |
| | | const getBase64ByUrl = (url) => { |
| | | return new Promise((resolve, reject) => { |
| | | const xhr = new XMLHttpRequest(); |
| | | xhr.open("GET", url, true); |
| | | xhr.responseType = "blob"; |
| | | xhr.onload = function () { |
| | | if (this.status === 200) { |
| | | const reader = new FileReader(); |
| | | reader.onloadend = () => resolve(reader.result); |
| | | reader.readAsDataURL(this.response); |
| | | } else { |
| | | param.onError(new Error(response.data.msg)); |
| | | reject(new Error("Failed to fetch image")); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | param.onError(error); |
| | | }); |
| | | }; |
| | | xhr.onerror = () => reject(new Error("Network error")); |
| | | xhr.send(); |
| | | }); |
| | | }; |
| | | |
| | | // 移动端下载图片 |
| | | const downloadImageForMobile = (imgSrc, name) => { |
| | | const image = new Image(); |
| | | image.setAttribute("crossOrigin", "anonymous"); |
| | | image.onload = () => { |
| | | const canvas = document.createElement("canvas"); |
| | | canvas.width = image.width; |
| | | canvas.height = image.height; |
| | | const ctx = canvas.getContext("2d"); |
| | | ctx.drawImage(image, 0, 0, image.width, image.height); |
| | | const url = canvas.toDataURL("image/png"); |
| | | const a = document.createElement("a"); |
| | | a.download = name; |
| | | a.href = url; |
| | | a.click(); |
| | | }; |
| | | image.src = imgSrc; |
| | | }; |
| | | |
| | | // 下载文件 |
| | | function handleDownload(index) { |
| | | const url = fileList.value[index].downloadUrl; |
| | | const handleDownload = (index) => { |
| | | const file = fileList.value[index]; |
| | | const url = file.url; |
| | | if (!url) { |
| | | proxy.$modal.msgError("文件链接不存在,无法下载"); |
| | | return; |
| | | } |
| | | // 读取预览图片的数据 |
| | | // 移动端特殊处理 |
| | | if (window.navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) { |
| | | const fileName = file.bucketFilename || file.key; |
| | | downloadImageForMobile(url, fileName); |
| | | return; |
| | | } |
| | | // 桌面端下载 |
| | | const link = document.createElement("a"); |
| | | link.href = url; // 链接地址 |
| | | link.download = fileList.value[index].bucketFilename; // 设置下载文件名 |
| | | link.href = url; |
| | | link.download = file.bucketFilename || file.key; |
| | | link.click(); |
| | | } |
| | | |
| | | |
| | | // 上传前校检格式和大小 |
| | | function handleBeforeUpload(file) { |
| | | // 校检文件类型 |
| | | // if (props.fileType.length) { |
| | | // const fileName = file.name.split('.') |
| | | // const fileExt = fileName[fileName.length - 1] |
| | | // const isTypeOk = props.fileType.indexOf(fileExt) >= 0 |
| | | // if (!isTypeOk) { |
| | | // proxy.$modal.msgError(`文件格式不正确,请上传${props.fileType.join("/")}格式文件!`) |
| | | // return false |
| | | // } |
| | | // } |
| | | // 校检文件名是否包含特殊字符 |
| | | }; |
| | | // 上传前校验 |
| | | const handleBeforeUpload = (file) => { |
| | | // 校验文件名特殊字符 |
| | | if (file.name.includes(",")) { |
| | | proxy.$modal.msgError("文件名不正确,不能包含英文逗号!"); |
| | | return false; |
| | | } |
| | | // 校检文件大小 |
| | | |
| | | // 校验文件大小 |
| | | if (props.fileSize) { |
| | | const isLt = file.size / 1024 / 1024 < props.fileSize; |
| | | if (!isLt) { |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | proxy.$modal.loading("正在上传文件,请稍候..."); |
| | | number.value++; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | // 文件个数超出 |
| | | function handleExceed() { |
| | | // 文件个数超出限制 |
| | | const handleExceed = () => { |
| | | proxy.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`); |
| | | } |
| | | }; |
| | | |
| | | // 上传失败 |
| | | function handleUploadError(err) { |
| | | proxy.$modal.msgError("上传文件失败"); |
| | | // 上传失败处理 |
| | | const handleUploadError = () => { |
| | | ElMessage.error("上传文件失败"); |
| | | proxy.$modal.closeLoading(); |
| | | } |
| | | }; |
| | | |
| | | // 上传成功回调 |
| | | function handleUploadSuccess(res, file) { |
| | | const handleUploadSuccess = (res, file) => { |
| | | if (res.code === 200) { |
| | | console.log("上传成功", res); |
| | | uploadList.value.push(res.data[0]) |
| | | uploadList.value.push(res.data[0]); |
| | | uploadedSuccessfully(); |
| | | // proxy.$modal.msgSuccess("文件上传成功"); |
| | | } else { |
| | | number.value--; |
| | | proxy.$modal.closeLoading(); |
| | |
| | | proxy.$refs.fileUpload.handleRemove(file); |
| | | uploadedSuccessfully(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 删除文件 |
| | | function handleDelete(index) { |
| | | const handleDelete = (index) => { |
| | | fileList.value.splice(index, 1); |
| | | emit("update:modelValue", listToString(fileList.value)); |
| | | } |
| | | }; |
| | | |
| | | // 上传结束处理 |
| | | function uploadedSuccessfully() { |
| | | const uploadedSuccessfully = () => { |
| | | if (number.value > 0 && uploadList.value.length === number.value) { |
| | | fileList.value = fileList.value |
| | | .filter((f) => f.url !== undefined) |
| | |
| | | emit("update:modelValue"); |
| | | proxy.$modal.closeLoading(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 获取文件名称 |
| | | function getFileName(name) { |
| | | // 如果是url那么取最后的名字 如果不是直接返回 |
| | | if (name.lastIndexOf("/") > -1) { |
| | | return name.slice(name.lastIndexOf("/") + 1); |
| | | } else { |
| | | return name; |
| | | } |
| | | } |
| | | |
| | | // 对象转成指定字符串分隔 |
| | | function listToString(list, separator) { |
| | | let strs = ""; |
| | | separator = separator || ","; |
| | | for (let i in list) { |
| | | if (list[i].url) { |
| | | strs += list[i].url + separator; |
| | | } |
| | | } |
| | | return strs != "" ? strs.substr(0, strs.length - 1) : ""; |
| | | } |
| | | const listToString = (list, separator = ",") => { |
| | | const strs = list |
| | | .filter(item => item.url) |
| | | .map(item => item.url) |
| | | .join(separator); |
| | | return strs; |
| | | }; |
| | | |
| | | // 初始化拖拽排序 |
| | | onMounted(() => { |
| | | if (props.drag && !props.disabled) { |
| | | nextTick(() => { |
| | | const element = |
| | | proxy.$refs.uploadFileList?.$el || proxy.$refs.uploadFileList; |
| | | Sortable.create(element, { |
| | | ghostClass: "file-upload-darg", |
| | | onEnd: (evt) => { |
| | | const movedItem = fileList.value.splice(evt.oldIndex, 1)[0]; |
| | | fileList.value.splice(evt.newIndex, 0, movedItem); |
| | | emit("update:modelValue", listToString(fileList.value)); |
| | | }, |
| | | }); |
| | | const element = proxy.$refs.uploadFileList?.$el || proxy.$refs.uploadFileList; |
| | | if (element) { |
| | | Sortable.create(element, { |
| | | ghostClass: "file-upload-darg", |
| | | onEnd: (evt) => { |
| | | const movedItem = fileList.value.splice(evt.oldIndex, 1)[0]; |
| | | fileList.value.splice(evt.newIndex, 0, movedItem); |
| | | emit("update:modelValue", listToString(fileList.value)); |
| | | }, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | for (let i = 0; i < data.length; i++) { |
| | | console.log(data[i]) |
| | | const item = data[i]; |
| | | for (const field of requiredFields) { |
| | | if (item[field] === '' || item[field] === null || item[field] === undefined) { |
| | |
| | | */ |
| | | export function createDefaultProductionRow(userData = {}, extraData = {}) { |
| | | return { |
| | | coal: "", |
| | | coalId: "", |
| | | productionQuantity: "", |
| | | laborCost: "", |
| | | energyConsumptionCost: "", |
| | |
| | | selectedRows.splice(0, selectedRows.length, ...selection); |
| | | }; |
| | | const queryParams = reactive({ |
| | | searchText: "", |
| | | searchAll: "", |
| | | current: 1, |
| | | pageSize: 10, // 固定每页10条 |
| | | treeId: null, // 当前树节点ID |
| | |
| | | </el-row> |
| | | </template> |
| | | <fileUpload |
| | | ref="fileUploadRef" |
| | | :fileSize="1024" |
| | | :fileType="['pdf', 'docx', 'txt', 'xlsx', 'pptx....']" |
| | | :limit="10" |
| | | v-model:modelValue="modelValue" |
| | | ref="fileUploadRef" |
| | | :fileSize="1024" |
| | | :fileType="['pdf', 'docx', 'txt', 'xlsx', 'pptx....']" |
| | | :limit="10" |
| | | :drag="false" |
| | | v-model:modelValue="modelValue" |
| | | /> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | }; |
| | | const fileUploadRef = ref(null); |
| | | const initForm = () => { |
| | | ruleForm.value = {} |
| | | fileUploadRef.value.init() |
| | | ruleForm.value = {}; |
| | | fileUploadRef.value.init(); |
| | | }; |
| | | const editForm = (val) => { |
| | | ruleForm.value = copyForm.value; |
| | | nextTick(() => { |
| | | fileUploadRef.value.editInit(val); |
| | | |
| | | fileUploadRef.value.editInit(val); |
| | | }); |
| | | }; |
| | | defineExpose({ |
| | |
| | | return; |
| | | } |
| | | // 发送 emit 事件 |
| | | |
| | | |
| | | // 关闭对话框 |
| | | centerDialogVisible.value = false; |
| | | } catch (error) { |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog title="上传" |
| | | v-model="dialogVisitable" width="400px" @close="cancel"> |
| | | <el-form :model="form" ref="formRef" label-width="120px"> |
| | | <el-form-item label="生产前" prop="fileList0"> |
| | | <el-upload |
| | | v-model:file-list="fileList0" |
| | | ref="fileUpload0" |
| | | :action="uploadFileUrl" |
| | | multiple |
| | | name="files" |
| | | :data="{type: 0}" |
| | | style="width: 100%" |
| | | :headers="headers" |
| | | :before-upload="handleBeforeUpload" |
| | | :on-success="handleUploadSuccess" |
| | | <el-dialog |
| | | title="上传" |
| | | v-model="dialogVisitable" |
| | | width="400px" |
| | | @close="cancel" |
| | | > |
| | | <div class="upload-container"> |
| | | <div class="form-container"> |
| | | <div class="title">生产前</div> |
| | | <fileUpload |
| | | :statusType="0" |
| | | ref="beforeProductionRef" |
| | | :fileSize="1024" |
| | | :fileType="['mp3', 'mp4', 'avi', 'mov', 'mkv']" |
| | | :limit="10" |
| | | :drag="false" |
| | | v-model:modelValue="beforeModelValue" |
| | | > |
| | | <el-button type="primary">上传</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <el-form-item label="生产后" prop="fileList1"> |
| | | <el-upload |
| | | v-model:file-list="fileList1" |
| | | ref="fileUpload1" |
| | | :action="uploadFileUrl" |
| | | multiple |
| | | name="files" |
| | | :data="{type: 1}" |
| | | style="width: 100%" |
| | | :headers="headers" |
| | | :before-upload="handleBeforeUpload" |
| | | :on-success="handleUploadSuccess1" |
| | | </fileUpload> |
| | | </div> |
| | | <div class="form-container"> |
| | | <div class="title">生产后</div> |
| | | <fileUpload |
| | | :statusType="1" |
| | | ref="afterProductionRef" |
| | | :fileSize="1024" |
| | | :fileType="['mp3', 'mp4', 'avi', 'mov', 'mkv']" |
| | | :limit="10" |
| | | :drag="false" |
| | | v-model:modelValue="afterModelValue" |
| | | > |
| | | <el-button type="primary">上传</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <el-form-item label="生产问题" prop="fileList2"> |
| | | <el-upload |
| | | v-model:file-list="fileList2" |
| | | ref="fileUpload2" |
| | | :action="uploadFileUrl" |
| | | multiple |
| | | name="files" |
| | | :data="{type: 2}" |
| | | style="width: 100%" |
| | | :headers="headers" |
| | | :before-upload="handleBeforeUpload" |
| | | :on-success="handleUploadSuccess2" |
| | | </fileUpload> |
| | | </div> |
| | | <div class="form-container"> |
| | | <div class="title">生产问题</div> |
| | | <fileUpload |
| | | :statusType="2" |
| | | ref="issueProductionRef" |
| | | :fileSize="1024" |
| | | :fileType="['mp3', 'mp4', 'avi', 'mov', 'mkv']" |
| | | :limit="10" |
| | | :drag="false" |
| | | v-model:modelValue="issueModelValue" |
| | | > |
| | | <el-button type="primary">上传</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | </fileUpload> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="cancel">取消</el-button> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {reactive, ref} from "vue"; |
| | | import {addOrEditInspectionTask} from "@/api/inspectionManagement/index.js"; |
| | | import {getToken} from "@/utils/auth.js"; |
| | | import { reactive, ref } from "vue"; |
| | | import {ElMessage} from "element-plus"; |
| | | import fileUpload from "@/components/FileUpload/index.vue"; |
| | | import {uploadInspectionTask} from "@/api/inspectionManagement/index.js"; |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits() |
| | | const emit = defineEmits(['closeDia']); |
| | | const dialogVisitable = ref(false); |
| | | const data = reactive({ |
| | | form: { |
| | | id: '', |
| | | storageBlobDTO: {} |
| | | }, |
| | | }) |
| | | const { proxy } = getCurrentInstance() |
| | | const beforeModelValue = ref([]); |
| | | const afterModelValue = ref([]); |
| | | const issueModelValue = ref([]); |
| | | const beforeProductionRef = ref(null); |
| | | const afterProductionRef = ref(null); |
| | | const issueProductionRef = ref(null); |
| | | |
| | | const { form } = toRefs(data) |
| | | const fileList0 = ref([]) |
| | | const fileList1 = ref([]) |
| | | const fileList2 = ref([]) |
| | | const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + '/common/minioUploads'); // 上传文件服务器地址 |
| | | const headers = ref({ Authorization: "Bearer " + getToken() }); |
| | | |
| | | const submitForm = async () => { |
| | | let arr = []; |
| | | if (beforeModelValue.value.length > 0) { |
| | | arr.push(...beforeModelValue.value); |
| | | } |
| | | if (afterModelValue.value.length > 0) { |
| | | arr.push(...afterModelValue.value); |
| | | } |
| | | if (issueModelValue.value.length > 0) { |
| | | arr.push(...issueModelValue.value); |
| | | } |
| | | // 提交数据 |
| | | infoData.value.storageBlobDTO = arr; |
| | | await uploadInspectionTask({...infoData.value}); |
| | | cancel() |
| | | ElMessage.success("提交成功"); |
| | | }; |
| | | const infoData = ref(null); |
| | | // 打开弹框 |
| | | const openDialog = async (row) => { |
| | | dialogVisitable.value = true |
| | | form.value.id = row.id |
| | | } |
| | | // 上传前校检格式和大小 |
| | | function handleBeforeUpload(file) { |
| | | |
| | | return true |
| | | } |
| | | // 上传成功回调 |
| | | function handleUploadSuccess(res, file) { |
| | | if (res.code === 200) { |
| | | console.log("上传成功", res); |
| | | proxy.$modal.msgSuccess("文件上传成功"); |
| | | console.log('fileList0---', fileList0) |
| | | } else { |
| | | proxy.$modal.msgError(res.msg) |
| | | proxy.$refs.fileUpload0.handleRemove(file) |
| | | } |
| | | } |
| | | function handleUploadSuccess1(res, file) { |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("文件上传成功"); |
| | | } else { |
| | | proxy.$modal.msgError(res.msg) |
| | | proxy.$refs.fileUpload1.handleRemove(file) |
| | | } |
| | | } |
| | | function handleUploadSuccess2(res, file) { |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("文件上传成功"); |
| | | } else { |
| | | proxy.$modal.msgError(res.msg) |
| | | proxy.$refs.fileUpload2.handleRemove(file) |
| | | } |
| | | } |
| | | |
| | | // 提交合并表单 |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | // 初始化 storageBlobDTO 为一个空数组 |
| | | form.value.storageBlobDTO = [] |
| | | // 合并所有 fileList 到 storageBlobDTO |
| | | const allFiles = [ |
| | | ...fileList0.value, |
| | | ...fileList1.value, |
| | | ...fileList2.value |
| | | ] |
| | | // 将文件列表赋值给 form |
| | | form.value.storageBlobDTO = allFiles |
| | | // 提交数据 |
| | | addOrEditInspectionTask(form.value).then(() => { |
| | | cancel() |
| | | proxy.$modal.msgSuccess('提交成功') |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | infoData.value = row; |
| | | dialogVisitable.value = true; |
| | | }; |
| | | // 关闭合并表单 |
| | | const cancel = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogVisitable.value = false |
| | | emit('closeDia') |
| | | } |
| | | defineExpose({ openDialog }) |
| | | proxy.resetForm("formRef"); |
| | | dialogVisitable.value = false; |
| | | emit("closeDia"); |
| | | }; |
| | | defineExpose({ openDialog }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | <style scoped lang="scss"> |
| | | .upload-container { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | padding: 20px; |
| | | border: 1px solid #dcdfe6; |
| | | box-sizing: border-box; |
| | | .form-container { |
| | | flex: 1; |
| | | width: 100%; |
| | | margin-bottom: 20px; |
| | | } |
| | | } |
| | | .title { |
| | | font-size: 14px; |
| | | color: #165dff; |
| | | line-height: 20px; |
| | | font-weight: 600; |
| | | padding-left: 10px; |
| | | position: relative; |
| | | margin: 6px 0; |
| | | } |
| | | .title::before { |
| | | content: ""; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 3px; /* 调整垂直位置 */ |
| | | width: 4px; /* 小数条宽度 */ |
| | | height: 14px; /* 小数条高度 */ |
| | | background-color: #165dff; /* 蓝色 */ |
| | | } |
| | | </style> |
| | |
| | | formDia.value?.openDialog(row) |
| | | }) |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <div style="background: #ffffff;padding: 20px 16px"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="登录地址" prop="ipaddr"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.ipaddr" |
| | | placeholder="请输入登录地址" |
| | | clearable |
| | | style="width: 240px;" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="用户名称" prop="userName"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.userName" |
| | | placeholder="请输入用户名称" |
| | | clearable |
| | | style="width: 240px;" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select |
| | | <el-select |
| | | v-model="queryParams.status" |
| | | placeholder="登录状态" |
| | | clearable |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_common_status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_common_status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="登录时间" style="width: 308px"> |
| | | <el-date-picker |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | type="daterange" |
| | |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]" |
| | | ></el-date-picker> |
| | | ></el-date-picker> |
| | | </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-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-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['monitor:logininfor:remove']" |
| | | >删除</el-button> |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | @click="handleClean" |
| | | v-hasPermi="['monitor:logininfor:remove']" |
| | | >清空</el-button> |
| | | >清空</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Unlock" |
| | | :disabled="single" |
| | | @click="handleUnlock" |
| | | v-hasPermi="['monitor:logininfor:unlock']" |
| | | >解锁</el-button> |
| | | >解锁</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['monitor:logininfor:export']" |
| | | >导出</el-button> |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table ref="logininforRef" v-loading="loading" :data="logininforList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange"> |
| | | </el-row> |
| | | |
| | | <el-table ref="logininforRef" v-loading="loading" :data="logininforList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="访问编号" align="center" prop="infoId" /> |
| | | <el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" /> |
| | |
| | | <el-table-column label="操作系统" align="center" prop="os" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="登录状态" align="center" prop="status"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_common_status" :value="scope.row.status" /> |
| | | </template> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_common_status" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="描述" align="center" prop="msg" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="访问时间" align="center" prop="loginTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.loginTime) }}</span> |
| | | </template> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.loginTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <div style="background: #ffffff;padding: 20px 16px"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="操作地址" prop="operIp"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.operIp" |
| | | placeholder="请输入操作地址" |
| | | clearable |
| | | style="width: 240px;" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="系统模块" prop="title"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.title" |
| | | placeholder="请输入系统模块" |
| | | clearable |
| | | style="width: 240px;" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="操作人员" prop="operName"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.operName" |
| | | placeholder="请输入操作人员" |
| | | clearable |
| | | style="width: 240px;" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="类型" prop="businessType"> |
| | | <el-select |
| | | <el-select |
| | | v-model="queryParams.businessType" |
| | | placeholder="操作类型" |
| | | clearable |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_oper_type" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_oper_type" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select |
| | | <el-select |
| | | v-model="queryParams.status" |
| | | placeholder="操作状态" |
| | | clearable |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_common_status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_common_status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="操作时间" style="width: 308px"> |
| | | <el-date-picker |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | type="daterange" |
| | |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]" |
| | | ></el-date-picker> |
| | | ></el-date-picker> |
| | | </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-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-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['monitor:operlog:remove']" |
| | | >删除</el-button> |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | @click="handleClean" |
| | | v-hasPermi="['monitor:operlog:remove']" |
| | | >清空</el-button> |
| | | >清空</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['monitor:operlog:export']" |
| | | >导出</el-button> |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table ref="operlogRef" v-loading="loading" :data="operlogList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange"> |
| | | </el-row> |
| | | |
| | | <el-table ref="operlogRef" v-loading="loading" :data="operlogList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange"> |
| | | <el-table-column type="selection" width="50" align="center" /> |
| | | <el-table-column label="日志编号" align="center" prop="operId" /> |
| | | <el-table-column label="系统模块" align="center" prop="title" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="操作类型" align="center" prop="businessType"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_oper_type" :value="scope.row.businessType" /> |
| | | </template> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_oper_type" :value="scope.row.businessType" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作人员" align="center" width="110" prop="operName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" /> |
| | | <el-table-column label="操作地址" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="操作状态" align="center" prop="status"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_common_status" :value="scope.row.status" /> |
| | | </template> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_common_status" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作日期" align="center" prop="operTime" width="180" sortable="custom" :sort-orders="['descending', 'ascending']"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.operTime) }}</span> |
| | | </template> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.operTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="消耗时间" align="center" prop="costTime" width="110" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"> |
| | | <template #default="scope"> |
| | | <span>{{ scope.row.costTime }}毫秒</span> |
| | | </template> |
| | | <template #default="scope"> |
| | | <span>{{ scope.row.costTime }}毫秒</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="View" @click="handleView(scope.row, scope.index)" v-hasPermi="['monitor:operlog:query']">详细</el-button> |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="View" @click="handleView(scope.row, scope.index)" v-hasPermi="['monitor:operlog:query']">详细</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" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | <!-- 操作日志详细 --> |
| | | <el-dialog title="操作日志详细" v-model="open" width="800px" append-to-body> |
| | | <el-form :model="form" label-width="100px"> |
| | |
| | | <el-form :inline="true" :model="queryParams" class="search-form"> |
| | | <el-form-item label="搜索"> |
| | | <el-input |
| | | v-model="queryParams.searchText" |
| | | placeholder="请输入关键词" |
| | | clearable |
| | | :style="{ width: '100%' }" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="供应商名称"> |
| | | <el-input |
| | | v-model="queryParams.supplierName" |
| | | placeholder="请输入" |
| | | clearable |
| | | :style="{ width: '100%' }" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="统一人识别号"> |
| | | <el-input |
| | | v-model="queryParams.identifyNumber" |
| | | placeholder="请输入" |
| | | clearable |
| | | :style="{ width: '100%' }" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="经营地址"> |
| | | <el-input |
| | | v-model="queryParams.address" |
| | | placeholder="请输入" |
| | | v-model="queryParams.searchAll" |
| | | placeholder="请输入供应商/煤种" |
| | | clearable |
| | | :style="{ width: '100%' }" |
| | | /> |
| | |
| | | :columns="columns" |
| | | @selection-change="handleSelectionChange" |
| | | @edit="handleEdit" |
| | | :showOverflowTooltip="false" |
| | | @delete="handleDeleteSuccess" |
| | | :show-selection="true" |
| | | :border="true" |
| | |
| | | const copyForm = ref({}); |
| | | // 查询参数 |
| | | const queryParams = reactive({ |
| | | searchText: "", |
| | | searchAll: "", |
| | | supplierName: "", |
| | | identifyNumber: "", |
| | | address: "", |
| | |
| | | |
| | | // 重置查询 |
| | | const resetQuery = () => { |
| | | Object.keys(queryParams).forEach((key) => { |
| | | if (key !== "current" && key !== "pageSize") { |
| | | queryParams[key] = ""; |
| | | } |
| | | }); |
| | | queryParams.searchAll = ""; |
| | | queryParams.supplierName = ""; |
| | | queryParams.identifyNumber = ""; |
| | | queryParams.address = ""; |
| | | current.value = 1; |
| | | pageSize.value = 10; |
| | | queryParams.current = current.value; |
| | | queryParams.pageSize = pageSize.value; |
| | | getList(); |
| | | }; |
| | | // 新增 |
| | | const handleAdd = () => { |
| | |
| | | <template #default="{ row, $index }"> |
| | | <el-select |
| | | clearable |
| | | :model-value="getCoalNameById(row.coal) || row.coal" |
| | | :model-value="getCoalNameById(row.coalId) || row.coalId" |
| | | placeholder="请选择煤种" |
| | | @change="(value) => handleCoalSelectChange(row, value)" |
| | | filterable |
| | | :key="`coal-select-${$index}-${weekList.length}`" |
| | | :key="`coalId-select-${$index}-${weekList.length}`" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) of weekList" |
| | |
| | | import { ref, computed, watch, onMounted, nextTick } from "vue"; |
| | | import { Delete } from "@element-plus/icons-vue"; |
| | | import { getCoalFieldList } from "@/api/basicInformation/coalQualityMaintenance"; |
| | | import { getCoalInfoList } from "@/api/production"; |
| | | import { userListAll } from "@/api/publicApi"; |
| | | const props = defineProps({ |
| | | modelValue: { |
| | |
| | | // 根据选择的名称找到对应的ID |
| | | const coalItem = weekList.value.find(item => item.value === selectedName); |
| | | if (coalItem) { |
| | | row.coal = coalItem.key; // 设置为ID |
| | | row.coalId = coalItem.key; // 设置为ID |
| | | } else { |
| | | row.coal = ''; // 如果没找到,清空 |
| | | row.coalId = ''; // 如果没找到,清空 |
| | | } |
| | | }; |
| | | |
| | | // 根据ID获取煤种名称(用于显示) |
| | | const getCoalNameById = (id) => { |
| | | const coal = weekList.value.find(item => item.key == id); |
| | | return coal ? coal.value : id; |
| | | const coalId = weekList.value.find(item => item.key == id); |
| | | return coalId ? coalId.value : id; |
| | | }; |
| | | |
| | | const weekList = ref([]); |
| | |
| | | }, { deep: true }); |
| | | |
| | | onMounted(async()=>{ |
| | | let res = await getCoalFieldList() |
| | | let res = await getCoalInfoList() |
| | | console.log(res); |
| | | res.data.forEach(item => { |
| | | let obj = {}; |
| | | obj.value = item.fieldName; |
| | | obj.value = item.coal; |
| | | obj.key = item.id; |
| | | weekList.value.push(obj); |
| | | }); |
| | |
| | | let res = await getCoalFieldList(); |
| | | if (res.code === 200) { |
| | | dropdownList.value = res.data.map((item) => ({ |
| | | value: item.fieldName, |
| | | value: item.coal, |
| | | key: item.id, |
| | | })); |
| | | } else { |
| | |
| | | defineExpose({ |
| | | calculateTotalCost, |
| | | getDropdownData, |
| | | getUserList, |
| | | getCoalNameById, // 暴露获取煤种名称的方法 |
| | | weekList, // 暴露weekList让父组件可以访问 |
| | | addRow: (rowData = {}) => { |
| | | const defaultRow = { |
| | | coal: "", |
| | | coalId: "", |
| | | calorificValue: "", |
| | | productionQuantity: "", |
| | | laborCost: "", |
| | |
| | | const handleSubmit = async () => { |
| | | // 验证生产明细数据 |
| | | const detailsValidation = validateFormData(detailsTableData.value, [ |
| | | "coal", |
| | | "coalId", |
| | | "productionQuantity", |
| | | "laborCost", |
| | | "energyConsumptionCost", |
| | |
| | | * 提供煤种数据的获取、缓存、转换等功能 |
| | | */ |
| | | import { ref, computed, watch } from 'vue'; |
| | | import { getCoalFieldList } from '@/api/basicInformation/coalQualityMaintenance'; |
| | | import { getCoalInfoList } from "@/api/production"; |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | // 全局煤种数据缓存 |
| | |
| | | |
| | | isLoading.value = true; |
| | | try { |
| | | const res = await getCoalFieldList(); |
| | | const res = await getCoalInfoList(); |
| | | if (res.code === 200) { |
| | | coalData.value = res.data; |
| | | isLoaded.value = true; |
| | |
| | | const getCoalNameById = (id) => { |
| | | if (!id || coalData.value.length === 0) return id; |
| | | const coal = coalData.value.find(item => item.id == id); |
| | | return coal ? coal.fieldName : id; |
| | | return coal ? coal.coal : id; |
| | | }; |
| | | |
| | | // 根据名称获取煤种ID |
| | | const getCoalIdByName = (name) => { |
| | | if (!name || coalData.value.length === 0) return ''; |
| | | const coal = coalData.value.find(item => item.fieldName === name); |
| | | const coal = coalData.value.find(item => item.coal === name); |
| | | return coal ? coal.id : ''; |
| | | }; |
| | | |
| | | // 生成下拉选项 |
| | | const coalOptions = computed(() => { |
| | | return coalData.value.map(item => ({ |
| | | label: item.fieldName, |
| | | value: item.fieldName, |
| | | label: item.coal, |
| | | value: item.coal, |
| | | key: item.id |
| | | })); |
| | | }); |
| | |
| | | const coalMap = computed(() => { |
| | | const map = {}; |
| | | coalData.value.forEach(item => { |
| | | map[item.id] = item.fieldName; |
| | | map[item.id] = item.coal; |
| | | }); |
| | | return map; |
| | | }); |
| | |
| | | [searchField]: queryParams[searchField], |
| | | current: queryParams.current, |
| | | size: queryParams.size, |
| | | page: queryParams.current, |
| | | pageSize: queryParams.size, |
| | | pageNum: queryParams.current, |
| | | limit: queryParams.size, |
| | | offset: (queryParams.current - 1) * queryParams.size |
| | | }; |
| | | |
| | | console.log('查询参数:', params); |
| | | const res = await apiFunction(params); |
| | | tableData.value = res.data.records || []; |
| | | total.value = res.data.total || 0; |
| | |
| | | // 重置搜索 |
| | | const handleReset = () => { |
| | | queryParams[searchField] = ''; |
| | | console.log('重置搜索参数:', queryParams); |
| | | handleSearch(); |
| | | }; |
| | | |
| | |
| | | { prop: "energyConsumptionCost", label: "能耗成本", minWidth: 120 }, |
| | | { prop: "equipmentDepreciation", label: "设备折旧", minWidth: 143 }, |
| | | { prop: "totalCost", label: "总成本", minWidth: 150 }, |
| | | { prop: "producer", label: "生产人", minWidth: 150 }, |
| | | ]; |
| | | |
| | | // 使用表格数据组合式函数 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> |
| | | <div style="background: #ffffff;padding: 20px 16px"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="部门名称" prop="deptName"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.deptName" |
| | | placeholder="请输入部门名称" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="部门状态" clearable style="width: 200px"> |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="queryParams.status" placeholder="部门状态" clearable style="width: 200px"> |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </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-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-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:dept:add']" |
| | | >新增</el-button> |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="info" |
| | | plain |
| | | icon="Sort" |
| | | @click="toggleExpandAll" |
| | | >展开/折叠</el-button> |
| | | >展开/折叠</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-if="refreshTable" |
| | | v-loading="loading" |
| | | :data="deptList" |
| | | row-key="deptId" |
| | | :default-expand-all="isExpandAll" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | > |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-if="refreshTable" |
| | | v-loading="loading" |
| | | :data="deptList" |
| | | row-key="deptId" |
| | | :default-expand-all="isExpandAll" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | > |
| | | <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column> |
| | | <el-table-column prop="orderNum" label="排序" width="200"></el-table-column> |
| | | <el-table-column prop="status" label="状态" width="100"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="200"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dept:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']">新增</el-button> |
| | | <el-button v-if="scope.row.parentId != 0" link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']">删除</el-button> |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dept:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']">新增</el-button> |
| | | <el-button v-if="scope.row.parentId != 0" link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | </el-table> |
| | | </div> |
| | | <!-- 添加或修改部门对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="600px" append-to-body> |
| | | <el-form ref="deptRef" :model="form" :rules="rules" label-width="80px"> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <div style="background: #ffffff;padding: 20px 16px"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="字典名称" prop="dictName"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.dictName" |
| | | placeholder="请输入字典名称" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="字典类型" prop="dictType"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.dictType" |
| | | placeholder="请输入字典类型" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select |
| | | <el-select |
| | | v-model="queryParams.status" |
| | | placeholder="字典状态" |
| | | clearable |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间" style="width: 308px"> |
| | | <el-date-picker |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | value-format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | ></el-date-picker> |
| | | ></el-date-picker> |
| | | </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-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-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:dict:add']" |
| | | >新增</el-button> |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:dict:edit']" |
| | | >修改</el-button> |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:dict:remove']" |
| | | >删除</el-button> |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:dict:export']" |
| | | >导出</el-button> |
| | | >导出</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Refresh" |
| | | @click="handleRefreshCache" |
| | | v-hasPermi="['system:dict:remove']" |
| | | >刷新缓存</el-button> |
| | | >刷新缓存</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="字典编号" align="center" prop="dictId" /> |
| | | <el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/> |
| | | <el-table-column label="字典类型" align="center" :show-overflow-tooltip="true"> |
| | | <template #default="scope"> |
| | | <router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type"> |
| | | <span>{{ scope.row.dictType }}</span> |
| | | </router-link> |
| | | </template> |
| | | <template #default="scope"> |
| | | <router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type"> |
| | | <span>{{ scope.row.dictType }}</span> |
| | | </router-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button> |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</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" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | <!-- 添加或修改参数配置对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | | <el-form ref="dictRef" :model="form" :rules="rules" label-width="80px"> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> |
| | | <div style="background: #ffffff;padding: 20px 16px"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="菜单名称" prop="menuName"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.menuName" |
| | | placeholder="请输入菜单名称" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="菜单状态" clearable style="width: 200px"> |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="queryParams.status" placeholder="菜单状态" clearable style="width: 200px"> |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </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-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-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:menu:add']" |
| | | >新增</el-button> |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="info" |
| | | plain |
| | | icon="Sort" |
| | | @click="toggleExpandAll" |
| | | >展开/折叠</el-button> |
| | | >展开/折叠</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-if="refreshTable" |
| | | v-loading="loading" |
| | | :data="menuList" |
| | | row-key="menuId" |
| | | :default-expand-all="isExpandAll" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | > |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-if="refreshTable" |
| | | v-loading="loading" |
| | | :data="menuList" |
| | | row-key="menuId" |
| | | :default-expand-all="isExpandAll" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | > |
| | | <el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column> |
| | | <el-table-column prop="icon" label="图标" align="center" width="100"> |
| | | <template #default="scope"> |
| | | <svg-icon :icon-class="scope.row.icon" /> |
| | | </template> |
| | | <template #default="scope"> |
| | | <svg-icon :icon-class="scope.row.icon" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="orderNum" label="排序" width="60"></el-table-column> |
| | | <el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column> |
| | | <el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column> |
| | | <el-table-column prop="status" label="状态" width="80"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" align="center" width="160" prop="createTime"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="210" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:menu:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:menu:add']">新增</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:menu:remove']">删除</el-button> |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:menu:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:menu:add']">新增</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:menu:remove']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | </el-table> |
| | | </div> |
| | | <!-- 添加或修改菜单对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="680px" append-to-body> |
| | | <el-form ref="menuRef" :model="form" :rules="rules" label-width="100px"> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="68px"> |
| | | <div style="background: #ffffff;padding: 20px 16px"> |
| | | <el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="68px"> |
| | | <el-form-item label="角色名称" prop="roleName"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.roleName" |
| | | placeholder="请输入角色名称" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="权限字符" prop="roleKey"> |
| | | <el-input |
| | | <el-input |
| | | v-model="queryParams.roleKey" |
| | | placeholder="请输入权限字符" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select |
| | | <el-select |
| | | v-model="queryParams.status" |
| | | placeholder="角色状态" |
| | | clearable |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间" style="width: 308px"> |
| | | <el-date-picker |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | value-format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | ></el-date-picker> |
| | | ></el-date-picker> |
| | | </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-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-form> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:role:add']" |
| | | >新增</el-button> |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:role:edit']" |
| | | >修改</el-button> |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:role:remove']" |
| | | >删除</el-button> |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:role:export']" |
| | | >导出</el-button> |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange"> |
| | | </el-row> |
| | | |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="角色编号" prop="roleId" width="120" /> |
| | | <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> |
| | | <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" /> |
| | | <el-table-column label="显示顺序" prop="roleSort" width="100" /> |
| | | <el-table-column label="状态" align="center" width="100"> |
| | | <template #default="scope"> |
| | | <el-switch |
| | | v-model="scope.row.status" |
| | | active-value="0" |
| | | inactive-value="1" |
| | | @change="handleStatusChange(scope.row)" |
| | | ></el-switch> |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-switch |
| | | v-model="scope.row.status" |
| | | active-value="0" |
| | | inactive-value="1" |
| | | @change="handleStatusChange(scope.row)" |
| | | ></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" align="center" prop="createTime"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-tooltip content="修改" placement="top" v-if="scope.row.roleId !== 1"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:role:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="删除" placement="top" v-if="scope.row.roleId !== 1"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="数据权限" placement="top" v-if="scope.row.roleId !== 1"> |
| | | <el-button link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)" v-hasPermi="['system:role:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="分配用户" placement="top" v-if="scope.row.roleId !== 1"> |
| | | <el-button link type="primary" icon="User" @click="handleAuthUser(scope.row)" v-hasPermi="['system:role:edit']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-tooltip content="修改" placement="top" v-if="scope.row.roleId !== 1"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:role:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="删除" placement="top" v-if="scope.row.roleId !== 1"> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="数据权限" placement="top" v-if="scope.row.roleId !== 1"> |
| | | <el-button link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)" v-hasPermi="['system:role:edit']"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="分配用户" placement="top" v-if="scope.row.roleId !== 1"> |
| | | <el-button link type="primary" icon="User" @click="handleAuthUser(scope.row)" v-hasPermi="['system:role:edit']"></el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | <!-- 添加或修改角色配置对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | | <el-form ref="roleRef" :model="form" :rules="rules" label-width="100px"> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-row :gutter="20"> |
| | | <el-row :gutter="20" style="margin: 0"> |
| | | <splitpanes :horizontal="appStore.device === 'mobile'" class="default-theme"> |
| | | <!--部门数据--> |
| | | <pane size="16"> |