¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request" |
| | | |
| | | // è·åå表 |
| | | export function policyPage(params) { |
| | | return request({ |
| | | url: "/policiesRegulations/page", |
| | | method: "get", |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢ |
| | | export function policyAdd(data) { |
| | | return request({ |
| | | url: "/policiesRegulations/add", |
| | | method: "post", |
| | | data, |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¦æ
|
| | | export function policyInfo(params) { |
| | | return request({ |
| | | url: "/policiesRegulations/detail?id=" + params, |
| | | method: "get", |
| | | }) |
| | | } |
| | | |
| | | // ç¼è¾ |
| | | export function policyEdit(data) { |
| | | return request({ |
| | | url: "/policiesRegulations/edit", |
| | | method: "post", |
| | | data, |
| | | }) |
| | | } |
| | | |
| | | //å é¤ |
| | | export function policyDel(id) { |
| | | return request({ |
| | | url: "/policiesRegulations/delete/" + id, |
| | | method: "delete", |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request" |
| | | |
| | | // è·åå表 |
| | | export function projectPage(params) { |
| | | return request({ |
| | | url: "/energySavingProject/page", |
| | | method: "get", |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢ |
| | | export function projectAdd(data) { |
| | | return request({ |
| | | url: "/energySavingProject/add", |
| | | method: "post", |
| | | data, |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¦æ
|
| | | export function projectInfo(params) { |
| | | return request({ |
| | | url: "/energySavingProject/getById?id=" + params, |
| | | method: "get", |
| | | }) |
| | | } |
| | | |
| | | // ç¼è¾ |
| | | export function projectEdit(data) { |
| | | return request({ |
| | | url: "/energySavingProject/edit", |
| | | method: "post", |
| | | data, |
| | | }) |
| | | } |
| | | |
| | | //å é¤ |
| | | export function projectDel(id) { |
| | | return request({ |
| | | url: "/energySavingProject/del/" + id, |
| | | method: "delete", |
| | | }) |
| | | } |
| | |
| | | <!-- ä¸ä¼ æç¤º --> |
| | | <div class="el-upload__tip" v-if="showTip"> |
| | | 请ä¸ä¼ |
| | | <template v-if="fileSize"> 大å°ä¸è¶
è¿ <b style="color: #f56c6c">{{ fileSize }}MB</b> </template> |
| | | <template v-if="fileType"> æ ¼å¼ä¸º <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template> |
| | | <template v-if="fileSize"> |
| | | 大å°ä¸è¶
è¿ <b style="color: #f56c6c">{{ fileSize }}MB</b> |
| | | </template> |
| | | <template v-if="fileType"> |
| | | æ ¼å¼ä¸º <b style="color: #f56c6c">{{ fileType.join("/") }}</b> |
| | | </template> |
| | | çæä»¶ |
| | | </div> |
| | | <!-- æä»¶å表 --> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getToken } from "@/utils/auth"; |
| | | import { getToken } from "@/utils/auth" |
| | | const props = defineProps({ |
| | | modelValue: [String, Object, Array], |
| | | // æ°ééå¶ |
| | |
| | | // æä»¶ç±»å, ä¾å¦['png', 'jpg', 'jpeg'] |
| | | fileType: { |
| | | type: Array, |
| | | default: () => ["doc", "xls", "ppt", "txt", "pdf","docx"], |
| | | default: () => ["doc", "xls", "ppt", "txt", "pdf", "docx"], |
| | | }, |
| | | // æ¯å¦æ¾ç¤ºæç¤º |
| | | isShowTip: { |
| | | type: Boolean, |
| | | default: true |
| | | } |
| | | }); |
| | | default: true, |
| | | }, |
| | | }) |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(); |
| | | 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 + "/common/upload"); // ä¸ä¼ æä»¶æå¡å¨å°å |
| | | const headers = ref({ Authorization: "Bearer " + getToken() }); |
| | | const fileList = ref([]); |
| | | const showTip = computed( |
| | | () => props.isShowTip && (props.fileType || props.fileSize) |
| | | ); |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits() |
| | | 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 + "/common/upload") // ä¸ä¼ æä»¶æå¡å¨å°å |
| | | const headers = ref({ Authorization: "Bearer " + getToken() }) |
| | | const fileList = ref([]) |
| | | const showTip = computed(() => props.isShowTip && (props.fileType || props.fileSize)) |
| | | |
| | | 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 }; |
| | | } |
| | | item.uid = item.uid || new Date().getTime() + temp++; |
| | | return item; |
| | | }); |
| | | } else { |
| | | fileList.value = []; |
| | | return []; |
| | | } |
| | | },{ deep: true, immediate: true }); |
| | | 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 } |
| | | } |
| | | item.uid = item.uid || new Date().getTime() + temp++ |
| | | return item |
| | | }) |
| | | } else { |
| | | fileList.value = [] |
| | | return [] |
| | | } |
| | | }, |
| | | { deep: true, immediate: true } |
| | | ) |
| | | |
| | | // ä¸ä¼ åæ ¡æ£æ ¼å¼åå¤§å° |
| | | 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; |
| | | 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; |
| | | proxy.$modal.msgError(`æä»¶æ ¼å¼ä¸æ£ç¡®, 请ä¸ä¼ ${props.fileType.join("/")}æ ¼å¼æä»¶!`) |
| | | return false |
| | | } |
| | | } |
| | | // æ ¡æ£æä»¶å¤§å° |
| | | if (props.fileSize) { |
| | | const isLt = file.size / 1024 / 1024 < props.fileSize; |
| | | const isLt = file.size / 1024 / 1024 < props.fileSize |
| | | if (!isLt) { |
| | | proxy.$modal.msgError(`ä¸ä¼ æä»¶å¤§å°ä¸è½è¶
è¿ ${props.fileSize} MB!`); |
| | | return false; |
| | | proxy.$modal.msgError(`ä¸ä¼ æä»¶å¤§å°ä¸è½è¶
è¿ ${props.fileSize} MB!`) |
| | | return false |
| | | } |
| | | } |
| | | proxy.$modal.loading("æ£å¨ä¸ä¼ æä»¶ï¼è¯·ç¨å..."); |
| | | number.value++; |
| | | return true; |
| | | proxy.$modal.loading("æ£å¨ä¸ä¼ æä»¶ï¼è¯·ç¨å...") |
| | | number.value++ |
| | | return true |
| | | } |
| | | |
| | | // æä»¶ä¸ªæ°è¶
åº |
| | | function handleExceed() { |
| | | proxy.$modal.msgError(`ä¸ä¼ æä»¶æ°éä¸è½è¶
è¿ ${props.limit} 个!`); |
| | | proxy.$modal.msgError(`ä¸ä¼ æä»¶æ°éä¸è½è¶
è¿ ${props.limit} 个!`) |
| | | } |
| | | |
| | | // ä¸ä¼ 失败 |
| | | function handleUploadError(err) { |
| | | proxy.$modal.msgError("ä¸ä¼ æä»¶å¤±è´¥"); |
| | | proxy.$modal.msgError("ä¸ä¼ æä»¶å¤±è´¥") |
| | | } |
| | | |
| | | // ä¸ä¼ æååè° |
| | | function handleUploadSuccess(res, file) { |
| | | if (res.code === 200) { |
| | | uploadList.value.push({ name: res.fileName, url: res.fileName }); |
| | | uploadedSuccessfully(); |
| | | uploadList.value.push({ name: res.fileName, url: res.fileName, fullUrl: res.url }) |
| | | uploadedSuccessfully() |
| | | } else { |
| | | number.value--; |
| | | proxy.$modal.closeLoading(); |
| | | proxy.$modal.msgError(res.msg); |
| | | proxy.$refs.fileUpload.handleRemove(file); |
| | | uploadedSuccessfully(); |
| | | number.value-- |
| | | proxy.$modal.closeLoading() |
| | | proxy.$modal.msgError(res.msg) |
| | | proxy.$refs.fileUpload.handleRemove(file) |
| | | uploadedSuccessfully() |
| | | } |
| | | } |
| | | |
| | | // å 餿件 |
| | | function handleDelete(index) { |
| | | fileList.value.splice(index, 1); |
| | | emit("update:modelValue", fileList.value); |
| | | fileList.value.splice(index, 1) |
| | | emit("update:modelValue", fileList.value) |
| | | } |
| | | |
| | | // ä¸ä¼ ç»æå¤ç |
| | | function uploadedSuccessfully() { |
| | | if (number.value > 0 && uploadList.value.length === number.value) { |
| | | fileList.value = fileList.value.filter(f => f.url !== undefined).concat(uploadList.value); |
| | | uploadList.value = []; |
| | | number.value = 0; |
| | | fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value) |
| | | uploadList.value = [] |
| | | number.value = 0 |
| | | console.log(fileList.value) |
| | | emit("update:modelValue", fileList.value); |
| | | proxy.$modal.closeLoading(); |
| | | emit("update:modelValue", fileList.value) |
| | | proxy.$modal.closeLoading() |
| | | } |
| | | } |
| | | |
| | |
| | | function getFileName(name) { |
| | | // 妿æ¯urlé£ä¹åæåçåå 妿䏿¯ç´æ¥è¿å |
| | | if (name.lastIndexOf("/") > -1) { |
| | | return name.slice(name.lastIndexOf("/") + 1); |
| | | return name.slice(name.lastIndexOf("/") + 1) |
| | | } else { |
| | | return name; |
| | | return name |
| | | } |
| | | } |
| | | |
| | | // 对象转ææå®å符串åé |
| | | function listToString(list, separator) { |
| | | let strs = ""; |
| | | separator = separator || ","; |
| | | let strs = "" |
| | | separator = separator || "," |
| | | for (let i in list) { |
| | | if (list[i].url) { |
| | | strs += list[i].url + separator; |
| | | strs += list[i].url + separator |
| | | } |
| | | } |
| | | return strs != '' ? strs.substr(0, strs.length - 1) : ''; |
| | | return strs != "" ? strs.substr(0, strs.length - 1) : "" |
| | | } |
| | | </script> |
| | | |
| | |
| | | import useDictStore from '@/store/modules/dict' |
| | | import { getDicts } from '@/api/system/dict/data' |
| | | import useDictStore from "@/store/modules/dict" |
| | | import { getDicts } from "@/api/system/dict/data" |
| | | |
| | | /** |
| | | * è·ååå
¸æ°æ® |
| | | */ |
| | | export function useDict(...args) { |
| | | const res = ref({}); |
| | | const res = ref({}) |
| | | return (() => { |
| | | args.forEach((dictType, index) => { |
| | | res.value[dictType] = []; |
| | | const dicts = useDictStore().getDict(dictType); |
| | | res.value[dictType] = [] |
| | | const dicts = useDictStore().getDict(dictType) |
| | | if (dicts) { |
| | | res.value[dictType] = dicts; |
| | | res.value[dictType] = dicts |
| | | } else { |
| | | getDicts(dictType).then(resp => { |
| | | res.value[dictType] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass })) |
| | | useDictStore().setDict(dictType, res.value[dictType]); |
| | | getDicts(dictType).then((resp) => { |
| | | console.log(resp) |
| | | res.value[dictType] = resp.data.map((p) => ({ |
| | | label: p.dictLabel, |
| | | value: p.dictValue, |
| | | elTagType: p.listClass, |
| | | elTagClass: p.cssClass, |
| | | })) |
| | | useDictStore().setDict(dictType, res.value[dictType]) |
| | | }) |
| | | } |
| | | }) |
| | | return toRefs(res.value); |
| | | return toRefs(res.value) |
| | | })() |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <el-dialog v-model="visible" :title="title" width="600" @close="handleClose"> |
| | | <el-form :model="form" ref="queryRef" :rules="formRules" label-width="120px" v-loading="loading"> |
| | | <el-form-item label="æä»¶æ é¢" prop="limitName"> |
| | | <el-input v-model="form.value1" placeholder="请è¾å
¥æä»¶æ é¢" /> |
| | | </el-form-item> |
| | | <el-form-item label="æä»¶ç±»å«"> |
| | | <el-select v-model="form.value2" placeholder="è¯·éæ©"> |
| | | <el-option v-for="item in 6" :key="item" :label="item" :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <div slot="footer" class="text-right"> |
| | | <el-button type="primary" @click="submitForm" :loading="loading">ç¡® å®</el-button> |
| | | <el-button @click="handleClose">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog v-model="visible" :title="title" width="600" @close="handleClose"> |
| | | <el-form :model="form" ref="queryRef" :rules="formRules" label-width="120px" v-loading="loading"> |
| | | <el-form-item label="æä»¶æ é¢" prop="title"> |
| | | <el-input v-model="form.title" placeholder="请è¾å
¥æä»¶æ é¢" /> |
| | | </el-form-item> |
| | | <el-form-item label="æä»¶ç±»å«" prop="type"> |
| | | <el-select v-model="form.type" placeholder="æä»¶ç±»å«" style="width: 100%"> |
| | | <el-option v-for="dict in policy_sort" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å°åé¨é¨" prop="dept"> |
| | | <el-input v-model="form.dept" placeholder="请è¾å
¥å°åé¨é¨" /> |
| | | </el-form-item> |
| | | <el-form-item label="å°åæ¶é´" prop="issuingTime"> |
| | | <el-date-picker |
| | | v-model="form.issuingTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©å°åæ¶é´" |
| | | format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="éä»¶" prop="url"> |
| | | <FileUpload :limit="1" :modelValue="fileList" @update:modelValue="(val) => (fileList = val)"></FileUpload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="text-right"> |
| | | <el-button type="primary" @click="submitForm" :loading="loading">ç¡® å®</el-button> |
| | | <el-button @click="handleClose">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | import { policyAdd, policyEdit } from "@/api/policy/policy" |
| | | const { proxy } = getCurrentInstance() |
| | | const { policy_sort } = proxy.useDict("policy_sort") |
| | | |
| | | let visible = ref(false) |
| | | let title = ref('') |
| | | let title = ref("") |
| | | let loading = ref(false) |
| | | let form = ref({ |
| | | value1: '', |
| | | value2: '', |
| | | title: "", |
| | | type: "", |
| | | url: "", |
| | | }) |
| | | let emit = defineEmits(['get-list']) |
| | | const fileList = ref([]) |
| | | let emit = defineEmits(["get-list"]) |
| | | const formRules = { |
| | | value1: [{ required: true, trigger: "blur", message: "请è¾å
¥æä»¶æ é¢" }], |
| | | value2: [{ required: true, trigger: "change", message: "è¯·éæ©æä»¶ç±»å" }], |
| | | title: [{ required: true, trigger: "blur", message: "请è¾å
¥æä»¶æ é¢" }], |
| | | type: [{ required: true, trigger: "change", message: "è¯·éæ©æä»¶ç±»å" }], |
| | | } |
| | | |
| | | function submitForm() { |
| | | proxy.$refs.queryRef.validate(valid => { |
| | | if (valid) { |
| | | // loading.value = true; |
| | | // let obj = form.value.id ? alarmEdit(form.value) : alarmAdd(form.value) |
| | | // obj.then((res) => { |
| | | // if (res.code == 200) { |
| | | // proxy.$modal.msgSuccess(res.message); |
| | | // emit('get-list') |
| | | // } else { |
| | | // proxy.$modal.msgError(res.message); |
| | | // } |
| | | |
| | | // }).catch((err) => { |
| | | |
| | | // }).finally(() => { |
| | | // handleClose() |
| | | // }); |
| | | } |
| | | }) |
| | | proxy.$refs.queryRef.validate((valid) => { |
| | | if (valid) { |
| | | loading.value = true |
| | | if (fileList.value.length > 0) { |
| | | form.value.url = fileList.value[0].fullUrl |
| | | } else { |
| | | form.value.url = "" |
| | | } |
| | | let obj = form.value.id ? policyEdit(form.value) : policyAdd(form.value) |
| | | obj |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | proxy.$modal.msgSuccess(res.msg) |
| | | emit("get-list") |
| | | handleClose() |
| | | } else { |
| | | proxy.$modal.msgError(res.msg) |
| | | } |
| | | }) |
| | | .catch((err) => {}) |
| | | .finally(() => { |
| | | loading.value = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function handleOpen(row) { |
| | | if (row && row.id) { |
| | | title.value = "ç¼è¾æ¿çæ³è§" |
| | | form.value = JSON.parse(JSON.stringify(row)) |
| | | } else { |
| | | title.value = "æ·»å æ¿çæ³è§" |
| | | fileList.value = [] |
| | | if (row && row.id) { |
| | | title.value = "ç¼è¾æ¿çæ³è§" |
| | | form.value = JSON.parse(JSON.stringify(row)) |
| | | if (row.url) { |
| | | fileList.value = [ |
| | | { |
| | | url: row.url, |
| | | name: row.url, |
| | | }, |
| | | ] |
| | | } |
| | | visible.value = true |
| | | } else { |
| | | title.value = "æ·»å æ¿çæ³è§" |
| | | fileList.value = [] |
| | | } |
| | | visible.value = true |
| | | } |
| | | |
| | | function handleClose(value) { |
| | | visible.value = false |
| | | loading.value = false |
| | | proxy.$refs.queryRef.resetFields() |
| | | form.value = { |
| | | value1: '', |
| | | value2: '', |
| | | |
| | | } |
| | | visible.value = false |
| | | loading.value = false |
| | | proxy.$refs.queryRef.resetFields() |
| | | form.value = { |
| | | value1: "", |
| | | value2: "", |
| | | } |
| | | } |
| | | |
| | | defineExpose({ handleOpen }) |
| | | |
| | | </script> |
| | | |
| | | |
| | | |
| | | <style lang="scss" scoped></style> |
| | | <style lang="scss" scoped></style> |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="120px"> |
| | | <el-form-item label="æä»¶ç±»å«"> |
| | | <el-select v-model="queryParams.value1" placeholder="è¯·éæ©"> |
| | | <el-option v-for="item in 6" :key="item" :label="item" :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æä»¶æ é¢"> |
| | | <el-input v-model="queryParams.value2" placeholder="请è¾å
¥æä»¶æ é¢" /> |
| | | </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> |
| | | </div> |
| | | <div class="table-box"> |
| | | <div class="mt20 mb20"> |
| | | <el-button type="primary" icon="plus" @click="handleAdd">æ°å¢</el-button> |
| | | <!-- <el-button type="primary" icon="Delete">å é¤</el-button> --> |
| | | </div> |
| | | <el-table :data="tableData" v-loading="loading"> |
| | | <el-table-column prop="value1" label="æä»¶æ é¢" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value2" label="æä»¶ç±»å«" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value3" label="å°åæ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column label="æä½" width="300" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleAdd(scope.row)"> |
| | | ä¿®æ¹ |
| | | </el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDel(scope.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" @pagination="getList" /> |
| | | |
| | | </div> |
| | | <EditModal ref="editModalRef" @get-list="getList" /> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="120px"> |
| | | <el-form-item label="æä»¶æ é¢"> |
| | | <el-input v-model="queryParams.title" placeholder="请è¾å
¥æä»¶æ é¢" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="æä»¶ç±»å«"> |
| | | <el-select v-model="queryParams.type" placeholder="æä»¶ç±»å«" style="width: 100%" clearable> |
| | | <el-option v-for="dict in policy_sort" :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-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table-box"> |
| | | <div class="mt20 mb20"> |
| | | <el-button type="primary" icon="plus" @click="handleAdd">æ°å¢</el-button> |
| | | <!-- <el-button type="primary" icon="Delete">å é¤</el-button> --> |
| | | </div> |
| | | <el-table :data="tableData" v-loading="loading"> |
| | | <el-table-column prop="title" label="æä»¶æ é¢" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="typeName" label="æä»¶ç±»å«" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="dept" label="å°åé¨é¨" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="issuingTime" label="å°åæ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column label="æä½" width="300" align="center"> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.url" link type="primary" icon="Files" @click="handleFile(scope.row.url)"> |
| | | éä»¶ |
| | | </el-button> |
| | | <el-button link type="primary" icon="Edit" @click="handleAdd(scope.row)"> ä¿®æ¹ </el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDel(scope.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" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | <EditModal ref="editModalRef" @get-list="getList" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import EditModal from './components/EditModal' |
| | | import EditModal from "./components/EditModal" |
| | | import { policyPage, policyDel } from "@/api/policy/policy" |
| | | const { proxy } = getCurrentInstance() |
| | | const { policy_sort } = proxy.useDict("policy_sort") |
| | | |
| | | let { proxy } = getCurrentInstance() |
| | | let loading = ref(false); |
| | | let total = ref(2); |
| | | let tableData = ref([ |
| | | { id: 1, value1: '1111', value2: 'value2', value3: '2024å¹´10æ17æ¥11:15:39' }, |
| | | { id: 2, value1: '222', value2: '222', value3: '2024å¹´10æ17æ¥11:16:39' }]) |
| | | let loading = ref(false) |
| | | let total = ref(2) |
| | | let tableData = ref([]) |
| | | let queryParams = ref({ |
| | | value1: '', |
| | | value2: '', |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | value1: "", |
| | | value2: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | }) |
| | | |
| | | function getList() { |
| | | // loading.value = true |
| | | // alarmList(queryParams.value).then(res => { |
| | | // console.log(res.rows) |
| | | // tableData.value = res.rows |
| | | // total.value = res.total |
| | | // loading.value = false |
| | | // }) |
| | | loading.value = true |
| | | policyPage(queryParams.value).then((res) => { |
| | | console.log(res.rows) |
| | | tableData.value = res.rows |
| | | total.value = res.total |
| | | loading.value = false |
| | | }) |
| | | } |
| | | |
| | | getList() |
| | | |
| | | let editModalRef = ref('') |
| | | let editModalRef = ref("") |
| | | function handleAdd(row) { |
| | | if (editModalRef.value) { |
| | | editModalRef.value.handleOpen(row) |
| | | } |
| | | |
| | | if (editModalRef.value) { |
| | | editModalRef.value.handleOpen(row) |
| | | } |
| | | } |
| | | |
| | | function handleDel(row) { |
| | | // proxy.$modal.confirm('æ¯å¦ç¡®è®¤å 餿°æ®é¡¹?').then(function () { |
| | | // return alarmDel(row.id); |
| | | // }).then(() => { |
| | | // getList(); |
| | | // proxy.$modal.msgSuccess("å 餿å"); |
| | | // }).catch(() => { }); |
| | | proxy.$modal |
| | | .confirm("æ¯å¦ç¡®è®¤å 餿°æ®é¡¹?") |
| | | .then(function () { |
| | | return policyDel(row.id) |
| | | }) |
| | | .then(() => { |
| | | getList() |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | |
| | | function handleFile(url) { |
| | | window.open(url) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | value1: '', |
| | | value2: '', |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | } |
| | | getList() |
| | | queryParams.value = { |
| | | value1: "", |
| | | value2: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | } |
| | | getList() |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <template> |
| | | <el-dialog v-model="visible" :title="title" width="600" @close="handleClose"> |
| | | <el-form :model="form" ref="queryRef" :rules="formRules" label-width="120px" v-loading="loading"> |
| | | <el-form-item label="项ç®åç§°" prop="value1"> |
| | | <el-input v-model="form.value1" placeholder="请è¾å
¥é¡¹ç®åç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="èè½è®¡å" prop="value2"> |
| | | <el-input v-model="form.value2" placeholder="请è¾å
¥èè½è®¡å" /> |
| | | </el-form-item> |
| | | <el-form-item label="èè½ç®æ " prop="value3"> |
| | | <el-input v-model="form.value3" placeholder="请è¾å
¥èè½ç®æ " /> |
| | | </el-form-item> |
| | | <el-form-item label="å¼å§æ¶é´" prop="value4"> |
| | | <el-date-picker v-model="form.value4" type="date" placeholder="è¯·éæ©å¼å§æ¶é´" format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»ææ¶é´" prop="value5"> |
| | | <el-date-picker v-model="form.value5" type="date" placeholder="è¯·éæ©ç»ææ¶é´" format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" /> |
| | | </el-form-item> |
| | | <el-form-item label="è´è´£äºº" prop="value6"> |
| | | <el-input v-model="form.value6" placeholder="请è¾å
¥è´è´£äºº" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¶å®æ¶æ£" prop="value7"> |
| | | <el-date-picker v-model="form.value7" type="date" placeholder="è¯·éæ©å¶å®æ¶æ£" format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="text-right"> |
| | | <el-button type="primary" @click="submitForm" :loading="loading">ç¡® å®</el-button> |
| | | <el-button @click="handleClose">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog v-model="visible" :title="title" width="600" @close="handleClose"> |
| | | <el-form :model="form" ref="queryRef" :rules="formRules" label-width="120px" v-loading="loading"> |
| | | <el-form-item label="æ»ä½è®¡å" prop="plan"> |
| | | <el-input v-model="form.plan" placeholder="请è¾å
¥æ»ä½è®¡å" /> |
| | | </el-form-item> |
| | | <el-form-item label="宿½è®¡å" prop="implementationPlan"> |
| | | <el-input v-model="form.implementationPlan" placeholder="请è¾å
¥å®æ½è®¡å" /> |
| | | </el-form-item> |
| | | <el-form-item label="å½åå·¥ä½" prop="currentWork"> |
| | | <el-input v-model="form.currentWork" placeholder="请è¾å
¥å½åå·¥ä½" /> |
| | | </el-form-item> |
| | | <el-form-item label="è约é" prop="savingAmount"> |
| | | <el-input-number style="width: 100%" v-model="form.savingAmount" placeholder="请è¾å
¥è约é" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="å¼å§æ¶é´" prop="value4"> |
| | | <el-date-picker |
| | | v-model="form.value4" |
| | | type="date" |
| | | placeholder="è¯·éæ©å¼å§æ¶é´" |
| | | format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»ææ¶é´" prop="value5"> |
| | | <el-date-picker |
| | | v-model="form.value5" |
| | | type="date" |
| | | placeholder="è¯·éæ©ç»ææ¶é´" |
| | | format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" |
| | | /> |
| | | </el-form-item> --> |
| | | <el-form-item label="è´è´£äºº" prop="liablePerson"> |
| | | <el-input v-model="form.liablePerson" placeholder="请è¾å
¥è´è´£äºº" /> |
| | | </el-form-item> |
| | | <el-form-item label="宿æ¶é´" prop="completionTime"> |
| | | <el-date-picker |
| | | v-model="form.completionTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©å®ææ¶é´" |
| | | format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input type="textarea" v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="text-right"> |
| | | <el-button type="primary" @click="submitForm" :loading="loading">ç¡® å®</el-button> |
| | | <el-button @click="handleClose">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { alarmAdd, alarmEdit } from '@/api/businessConfiguration/businessConfiguration' |
| | | const { proxy } = getCurrentInstance(); |
| | | let props = defineProps(['alarmTypeList', 'operatorList']) |
| | | |
| | | import { projectEdit, projectAdd } from "@/api/policy/project" |
| | | const { proxy } = getCurrentInstance() |
| | | let props = defineProps(["alarmTypeList", "operatorList"]) |
| | | |
| | | let visible = ref(false) |
| | | let title = ref('') |
| | | let title = ref("") |
| | | let loading = ref(false) |
| | | let form = ref({ |
| | | value1: null, |
| | | value2: null, |
| | | value3: null, |
| | | value4: null, |
| | | value5: null, |
| | | value6: null, |
| | | value7: null, |
| | | |
| | | plan: null, |
| | | implementationPlan: null, |
| | | remark: null, |
| | | liablePerson: null, |
| | | currentWork: null, |
| | | completionTime: null, |
| | | savingAmount: null, |
| | | }) |
| | | let emit = defineEmits(['getList']) |
| | | let emit = defineEmits(["getList"]) |
| | | const formRules = { |
| | | value1: [{ required: true, trigger: "blur", message: "请è¾å
¥é¡¹ç®åç§°" }], |
| | | value2: [{ required: true, trigger: "blur", message: "请è¾å
¥èè½è®¡å" }], |
| | | value3: [{ required: true, trigger: "blur", message: "请è¾å
¥èè½ç®æ " }], |
| | | value4: [{ required: true, trigger: "blur", message: "è¯·éæ©å¼å§æ¶é´" }], |
| | | value5: [{ required: true, trigger: "blur", message: "è¯·éæ©ç»ææ¶é´" }], |
| | | value6: [{ required: true, trigger: "blur", message: "请è¾å
¥è´è´£äºº" }], |
| | | value7: [{ required: true, trigger: "blur", message: "è¯·éæ©å¶å®æ¶æ£" }], |
| | | |
| | | plan: [{ required: true, trigger: "blur", message: "请è¾å
¥å¿
填项" }], |
| | | implementationPlan: [{ required: true, trigger: "blur", message: "请è¾å
¥å¿
填项" }], |
| | | savingAmount: [{ required: true, trigger: "blur", message: "请è¾å
¥å¿
填项" }], |
| | | liablePerson: [{ required: true, trigger: "blur", message: "请è¾å
¥å¿
填项" }], |
| | | currentWork: [{ required: true, trigger: "blur", message: "请è¾å
¥å¿
填项" }], |
| | | } |
| | | |
| | | function submitForm() { |
| | | proxy.$refs.queryRef.validate(valid => { |
| | | if (valid) { |
| | | // loading.value = true; |
| | | // let obj = form.value.id ? alarmEdit(form.value) : alarmAdd(form.value) |
| | | // obj.then((res) => { |
| | | // if (res.code == 200) { |
| | | // proxy.$modal.msgSuccess(res.message); |
| | | // emit('getList') |
| | | // } else { |
| | | // proxy.$modal.msgError(res.message); |
| | | // } |
| | | |
| | | // }).catch((err) => { |
| | | |
| | | // }).finally(() => { |
| | | // handleClose() |
| | | // }); |
| | | } |
| | | }) |
| | | proxy.$refs.queryRef.validate((valid) => { |
| | | if (valid) { |
| | | loading.value = true |
| | | let obj = form.value.id ? projectEdit(form.value) : projectAdd(form.value) |
| | | obj |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | proxy.$modal.msgSuccess(res.msg) |
| | | emit("getList") |
| | | handleClose() |
| | | } else { |
| | | proxy.$modal.msgError(res.msg) |
| | | } |
| | | }) |
| | | .catch((err) => {}) |
| | | .finally(() => {}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function handleOpen(row) { |
| | | if (row && row.id) { |
| | | title.value = "ç¼è¾èè½é¡¹ç®ç®¡ç" |
| | | form.value = JSON.parse(JSON.stringify(row)) |
| | | } else { |
| | | title.value = "æ·»å èè½é¡¹ç®ç®¡ç" |
| | | } |
| | | visible.value = true |
| | | if (row && row.id) { |
| | | title.value = "ç¼è¾èè½é¡¹ç®ç®¡ç" |
| | | form.value = JSON.parse(JSON.stringify(row)) |
| | | } else { |
| | | title.value = "æ·»å èè½é¡¹ç®ç®¡ç" |
| | | } |
| | | visible.value = true |
| | | } |
| | | |
| | | function handleClose(value) { |
| | | visible.value = false |
| | | loading.value = false |
| | | proxy.$refs.queryRef.resetFields() |
| | | form.value = { |
| | | value1: null, |
| | | value2: null, |
| | | value3: null, |
| | | value4: null, |
| | | value5: null, |
| | | value6: null, |
| | | value7: null, |
| | | } |
| | | visible.value = false |
| | | loading.value = false |
| | | proxy.$refs.queryRef.resetFields() |
| | | form.value = {} |
| | | } |
| | | |
| | | defineExpose({ handleOpen }) |
| | | |
| | | </script> |
| | | |
| | | |
| | | |
| | | <style lang="scss" scoped></style> |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="120px"> |
| | | <el-form-item label="项ç®åç§°"> |
| | | <el-input v-model="queryParams.value1" placeholder="请è¾å
¥é¡¹ç®åç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker v-model="queryParams.value2" type="daterange" start-placeholder="éæ©å¼å§æ¶é´" |
| | | end-placeholder="éæ©ç»ææ¶é´" format="YYYY-MM-DD" date-format="YYYY/MM/DD" /> |
| | | </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> |
| | | </div> |
| | | <div class="table-box"> |
| | | <div class="mt20 mb20"> |
| | | <el-button type="primary" icon="plus" @click="handleAdd">æ°å¢</el-button> |
| | | <el-button type="primary" icon="Download" @click="handleAdd"> å¯¼åº </el-button> |
| | | </div> |
| | | <el-table :data="tableData" v-loading="loading"> |
| | | <el-table-column prop="value1" label="项ç®åç§°" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value2" label="èè½è®¡å" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value3" label="èè½ç®æ " show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value4" label="å¼å§æ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value5" label="ç»ææ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value6" label="è´è´£äºº" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value7" label="å¶å®æ¶æ£" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value8" label="å建人" show-overflow-tooltip align="center" /> |
| | | |
| | | <el-table-column label="æä½" width="300" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Files" @click=" "> |
| | | éä»¶ |
| | | </el-button> |
| | | <el-button link type="primary" icon="Edit" @click="handleAdd(scope.row)"> |
| | | ä¿®æ¹ |
| | | </el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDel(scope.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" @pagination="getList" /> |
| | | |
| | | </div> |
| | | <edit-modal ref="EditModalRef" @getList="getList" /> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="120px"> |
| | | <el-form-item label="æ»ä½è®¡å"> |
| | | <el-input v-model="queryParams.plan" placeholder="请è¾å
¥æ»ä½è®¡å" /> |
| | | </el-form-item> |
| | | <el-form-item label="è´è´£äºº"> |
| | | <el-input v-model="queryParams.liablePerson" placeholder="请è¾å
¥è´è´£äºº" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.value2" |
| | | type="daterange" |
| | | start-placeholder="éæ©å¼å§æ¶é´" |
| | | end-placeholder="éæ©ç»ææ¶é´" |
| | | format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" |
| | | /> |
| | | </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> |
| | | </div> |
| | | <div class="table-box"> |
| | | <div class="mt20 mb20"> |
| | | <el-button type="primary" icon="plus" @click="handleAdd">æ°å¢</el-button> |
| | | <!-- <el-button type="primary" icon="Download" @click="handleAdd"> å¯¼åº </el-button> --> |
| | | </div> |
| | | <el-table :data="tableData" v-loading="loading"> |
| | | <el-table-column prop="plan" label="æ»ä½è®¡å" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="implementationPlan" label="宿½è®¡å" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="savingAmount" label="è约é" show-overflow-tooltip align="center" /> |
| | | <!-- <el-table-column prop="value4" label="å¼å§æ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value5" label="ç»ææ¶é´" show-overflow-tooltip align="center" /> --> |
| | | <el-table-column prop="currentWork" label="å½åå·¥ä½" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="liablePerson" label="è´è´£äºº" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="completionTime" label="宿æ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="remark" label="夿³¨" show-overflow-tooltip align="center" /> |
| | | |
| | | <el-table-column label="æä½" width="300" align="center"> |
| | | <template #default="scope"> |
| | | <!-- <el-button link type="primary" icon="Files" @click=""> éä»¶ </el-button> --> |
| | | <el-button link type="primary" icon="Edit" @click="handleAdd(scope.row)"> ä¿®æ¹ </el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDel(scope.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" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | <edit-modal ref="EditModalRef" @getList="getList" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import EditModal from './components/EditModal.vue' |
| | | |
| | | import EditModal from "./components/EditModal.vue" |
| | | import { projectPage, projectDel } from "@/api/policy/project" |
| | | |
| | | let { proxy } = getCurrentInstance() |
| | | let loading = ref(false); |
| | | let total = ref(0); |
| | | let tableData = ref([ |
| | | {id:1, value1: '1', value2: '2', value3: '3', value4: '4', value5: '5', value6: '6', value7: '7', value8: '8' }, |
| | | { id:2, value1: '1', value2: '2', value3: '3', value4: '4', value5: '5', value6: '6', value7: '7', value8: '8' }, |
| | | { id:3, value1: '1', value2: '2', value3: '3', value4: '4', value5: '5', value6: '6', value7: '7', value8: '8' }, |
| | | { id:4, value1: '1', value2: '2', value3: '3', value4: '4', value5: '5', value6: '6', value7: '7', value8: '8' }, |
| | | ]) |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let tableData = ref([]) |
| | | let queryParams = ref({ |
| | | value1: '', |
| | | value2: [], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | value1: "", |
| | | value2: [], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | }) |
| | | |
| | | function getList() { |
| | | // loading.value = true |
| | | // alarmList(queryParams.value).then(res => { |
| | | // console.log(res.rows) |
| | | // tableData.value = res.rows |
| | | // total.value = res.total |
| | | // loading.value = false |
| | | // }) |
| | | loading.value = true |
| | | projectPage(queryParams.value).then((res) => { |
| | | console.log(res.rows) |
| | | tableData.value = res.rows |
| | | total.value = res.total |
| | | loading.value = false |
| | | }) |
| | | } |
| | | |
| | | getList() |
| | | |
| | | |
| | | let EditModalRef = ref('') |
| | | let EditModalRef = ref("") |
| | | function handleAdd(row) { |
| | | if (EditModalRef.value) { |
| | | EditModalRef.value.handleOpen(row) |
| | | } |
| | | |
| | | if (EditModalRef.value) { |
| | | EditModalRef.value.handleOpen(row) |
| | | } |
| | | } |
| | | |
| | | function handleDel(row) { |
| | | // proxy.$modal.confirm('æ¯å¦ç¡®è®¤å 餿°æ®é¡¹?').then(function () { |
| | | // return alarmDel(row.id); |
| | | // }).then(() => { |
| | | // getList(); |
| | | // proxy.$modal.msgSuccess("å 餿å"); |
| | | // }).catch(() => { }); |
| | | proxy.$modal |
| | | .confirm("æ¯å¦ç¡®è®¤å 餿°æ®é¡¹?") |
| | | .then(function () { |
| | | return projectDel(row.id) |
| | | }) |
| | | .then(() => { |
| | | getList() |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | value1: '', |
| | | value2: [], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | } |
| | | getList() |
| | | queryParams.value = { |
| | | value1: "", |
| | | value2: [], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | } |
| | | getList() |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <el-row> |
| | | <el-col :span="24" class="card-box"> |
| | | <el-card> |
| | | <template #header><Monitor style="width: 1em; height: 1em; vertical-align: middle;" /> <span style="vertical-align: middle;">åºæ¬ä¿¡æ¯</span></template> |
| | | <template #header |
| | | ><Monitor style="width: 1em; height: 1em; vertical-align: middle" /> |
| | | <span style="vertical-align: middle">åºæ¬ä¿¡æ¯</span></template |
| | | > |
| | | <div class="el-table el-table--enable-row-hover el-table--medium"> |
| | | <table cellspacing="0" style="width: 100%"> |
| | | <tbody> |
| | | <tr> |
| | | <td class="el-table__cell is-leaf"><div class="cell">Redisçæ¬</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">è¿è¡æ¨¡å¼</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "åæº" : "é群" }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info"> |
| | | {{ cache.info.redis_mode == "standalone" ? "åæº" : "é群" }} |
| | | </div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">端å£</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">客æ·ç«¯æ°</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td class="el-table__cell is-leaf"><div class="cell">è¿è¡æ¶é´(天)</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">使ç¨å
å</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">使ç¨CPU</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info"> |
| | | {{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }} |
| | | </div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">å
åé
ç½®</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td class="el-table__cell is-leaf"><div class="cell">AOFæ¯å¦å¼å¯</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "å¦" : "æ¯" }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "å¦" : "æ¯" }}</div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">RDBæ¯å¦æå</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">Keyæ°é</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.dbSize">{{ cache.dbSize }}</div> |
| | | </td> |
| | | <td class="el-table__cell is-leaf"><div class="cell">ç½ç»å
¥å£/åºå£</div></td> |
| | | <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td> |
| | | <td class="el-table__cell is-leaf"> |
| | | <div class="cell" v-if="cache.info"> |
| | | {{ cache.info.instantaneous_input_kbps }}kps/{{ cache.info.instantaneous_output_kbps }}kps |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | |
| | | |
| | | <el-col :span="12" class="card-box"> |
| | | <el-card> |
| | | <template #header><PieChart style="width: 1em; height: 1em; vertical-align: middle;" /> <span style="vertical-align: middle;">å½ä»¤ç»è®¡</span></template> |
| | | <template #header |
| | | ><PieChart style="width: 1em; height: 1em; vertical-align: middle" /> |
| | | <span style="vertical-align: middle">å½ä»¤ç»è®¡</span></template |
| | | > |
| | | <div class="el-table el-table--enable-row-hover el-table--medium"> |
| | | <div ref="commandstats" style="height: 420px" /> |
| | | </div> |
| | |
| | | |
| | | <el-col :span="12" class="card-box"> |
| | | <el-card> |
| | | <template #header><Odometer style="width: 1em; height: 1em; vertical-align: middle;" /> <span style="vertical-align: middle;">å
åä¿¡æ¯</span></template> |
| | | <template #header |
| | | ><Odometer style="width: 1em; height: 1em; vertical-align: middle" /> |
| | | <span style="vertical-align: middle">å
åä¿¡æ¯</span></template |
| | | > |
| | | <div class="el-table el-table--enable-row-hover el-table--medium"> |
| | | <div ref="usedmemory" style="height: 420px" /> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script setup name="Cache"> |
| | | import { getCache } from '@/api/monitor/cache'; |
| | | import * as echarts from 'echarts'; |
| | | import { getCache } from "@/api/monitor/cache" |
| | | import * as echarts from "echarts" |
| | | |
| | | const cache = ref([]); |
| | | const commandstats = ref(null); |
| | | const usedmemory = ref(null); |
| | | const { proxy } = getCurrentInstance(); |
| | | const cache = ref([]) |
| | | const commandstats = ref(null) |
| | | const usedmemory = ref(null) |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | function getList() { |
| | | proxy.$modal.loading("æ£å¨å è½½ç¼åçæ§æ°æ®ï¼è¯·ç¨åï¼"); |
| | | getCache().then(response => { |
| | | proxy.$modal.closeLoading(); |
| | | cache.value = response.data; |
| | | proxy.$modal.loading("æ£å¨å è½½ç¼åçæ§æ°æ®ï¼è¯·ç¨åï¼") |
| | | getCache().then((response) => { |
| | | proxy.$modal.closeLoading() |
| | | cache.value = response.data |
| | | |
| | | const commandstatsIntance = echarts.init(commandstats.value, "macarons"); |
| | | const commandstatsIntance = echarts.init(commandstats.value, "macarons") |
| | | commandstatsIntance.setOption({ |
| | | tooltip: { |
| | | trigger: "item", |
| | | formatter: "{a} <br/>{b} : {c} ({d}%)" |
| | | formatter: "{a} <br/>{b} : {c} ({d}%)", |
| | | }, |
| | | series: [ |
| | | { |
| | |
| | | center: ["50%", "38%"], |
| | | data: response.data.commandStats, |
| | | animationEasing: "cubicInOut", |
| | | animationDuration: 1000 |
| | | } |
| | | ] |
| | | }); |
| | | const usedmemoryInstance = echarts.init(usedmemory.value, "macarons"); |
| | | animationDuration: 1000, |
| | | }, |
| | | ], |
| | | }) |
| | | const usedmemoryInstance = echarts.init(usedmemory.value, "macarons") |
| | | usedmemoryInstance.setOption({ |
| | | tooltip: { |
| | | formatter: "{b} <br/>{a} : " + cache.value.info.used_memory_human |
| | | formatter: "{b} <br/>{a} : " + cache.value.info.used_memory_human, |
| | | }, |
| | | series: [ |
| | | { |
| | |
| | | min: 0, |
| | | max: 1000, |
| | | detail: { |
| | | formatter: cache.value.info.used_memory_human |
| | | formatter: cache.value.info.used_memory_human, |
| | | }, |
| | | data: [ |
| | | { |
| | | value: parseFloat(cache.value.info.used_memory_human), |
| | | name: "å
åæ¶è" |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | name: "å
åæ¶è", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }) |
| | | window.addEventListener("resize", () => { |
| | | commandstatsIntance.resize(); |
| | | usedmemoryInstance.resize(); |
| | | },{passive: true}); |
| | | window.addEventListener( |
| | | "resize", |
| | | () => { |
| | | commandstatsIntance.resize() |
| | | usedmemoryInstance.resize() |
| | | }, |
| | | { passive: true } |
| | | ) |
| | | }) |
| | | } |
| | | |
| | | getList(); |
| | | getList() |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .el-table { |
| | | color: #333; |
| | | } |
| | | </style> |