修改字典推送和增加eslint校验
This commit is contained in:
parent
57dd3c04f8
commit
f8bbf44102
31
eslint.config.js
Normal file
31
eslint.config.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import js from "@eslint/js";
|
||||||
|
import globals from "globals";
|
||||||
|
import pluginVue from "eslint-plugin-vue";
|
||||||
|
import { defineConfig } from "eslint/config";
|
||||||
|
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{ files: ["**/*.{js,mjs,cjs,vue}"], plugins: { js }, extends: ["js/recommended"] },
|
||||||
|
{ files: ["**/*.{js,mjs,cjs,vue}"], languageOptions: { globals: globals.browser } },
|
||||||
|
pluginVue.configs["flat/essential"],
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
'auto-import': {
|
||||||
|
extensions: ['.js', '.mjs', '.jsx', '.vue'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'auto-import/export': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
settings: {
|
||||||
|
'auto-import': {
|
||||||
|
// 自动导入的模块配置,与 unplugin-auto-import 配置一致
|
||||||
|
imports: ['vue'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
19
package.json
19
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ruoyi",
|
"name": "czlis",
|
||||||
"version": "3.8.7",
|
"version": "8.0.0",
|
||||||
"description": "工具管理系统",
|
"description": "实验室管理系统",
|
||||||
"author": "工具",
|
"author": "工具",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@ -11,10 +11,6 @@
|
|||||||
"build:stage": "vite build --mode staging",
|
"build:stage": "vite build --mode staging",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "2.3.1",
|
"@element-plus/icons-vue": "2.3.1",
|
||||||
"@vueup/vue-quill": "1.2.0",
|
"@vueup/vue-quill": "1.2.0",
|
||||||
@ -36,13 +32,18 @@
|
|||||||
"vuedraggable": "^4.1.0"
|
"vuedraggable": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.27.0",
|
||||||
"@vitejs/plugin-vue": "5.0.1",
|
"@vitejs/plugin-vue": "5.0.1",
|
||||||
"@vue/compiler-sfc": "3.4.0",
|
"@vue/compiler-sfc": "3.4.0",
|
||||||
|
"eslint": "^9.27.0",
|
||||||
|
"eslint-plugin-auto-import": "^0.1.1",
|
||||||
|
"eslint-plugin-vue": "^10.1.0",
|
||||||
|
"globals": "^16.1.0",
|
||||||
"sass": "1.69.5",
|
"sass": "1.69.5",
|
||||||
"unplugin-auto-import": "0.17.1",
|
"unplugin-auto-import": "0.17.1",
|
||||||
|
"unplugin-vue-setup-extend-plus": "1.0.0",
|
||||||
"vite": "5.0.4",
|
"vite": "5.0.4",
|
||||||
"vite-plugin-compression": "0.5.1",
|
"vite-plugin-compression": "0.5.1",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1"
|
||||||
"unplugin-vue-setup-extend-plus": "1.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
738
pnpm-lock.yaml
generated
738
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -17,3 +17,12 @@ export function addComDictService(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//修改字典数据
|
||||||
|
export function updateComDictService(data) {
|
||||||
|
return request({
|
||||||
|
url: '/comdict/update',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {queryComDictListService} from "../../../api/liswork/dict/ComDict.js";
|
import { computed } from "vue";
|
||||||
|
import {queryComDictListService,addComDictService,updateComDictService} from "../../../api/liswork/dict/ComDict.js";
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
@ -26,7 +27,13 @@ const typeList = ref([])
|
|||||||
const typeDetail = ref([])
|
const typeDetail = ref([])
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const zdlbmc = ref('');
|
const zdlbmc = ref('');
|
||||||
const zdlbRef = ref('')
|
const open = ref(false);
|
||||||
|
const title = ref('');
|
||||||
|
// const zdlbmcComputed = computed(() => {
|
||||||
|
// return typeDetail.value.map(item => {
|
||||||
|
// return item.zddh+'('+item.zdmc+')';
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
function resetData(zdlb){
|
function resetData(zdlb){
|
||||||
@ -76,6 +83,16 @@ function handleQuery(){
|
|||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
zdlb: '',
|
||||||
|
zdmc: '',
|
||||||
|
zddh: '',
|
||||||
|
bz: ''
|
||||||
|
};
|
||||||
|
proxy.resetForm("dictRef");
|
||||||
|
}
|
||||||
//重置
|
//重置
|
||||||
function resetQuery(){
|
function resetQuery(){
|
||||||
queryParams.value = {
|
queryParams.value = {
|
||||||
@ -88,7 +105,13 @@ function resetQuery(){
|
|||||||
|
|
||||||
//新增
|
//新增
|
||||||
function handleAdd(){
|
function handleAdd(){
|
||||||
|
if(queryParams.value.zdlb === undefined || queryParams.value.zdlb === ''){
|
||||||
|
proxy.$modal.msgWarning("请先选择字典大类");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = '新增字典';
|
||||||
}
|
}
|
||||||
|
|
||||||
//修改
|
//修改
|
||||||
@ -118,6 +141,38 @@ function handleQueryDetail(){
|
|||||||
resetData()
|
resetData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//提交表单数据
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dictRef"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.zdlb != undefined && form.value.zdlb != '') {
|
||||||
|
updateComDictService(form.value).then(response => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
}).catch(error => {
|
||||||
|
reset();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
form.value.zdlb = queryParams.value.zdlb;
|
||||||
|
addComDictService(form.value).then(response => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
}).catch(error => {
|
||||||
|
form.value.zdlb = '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
getTypeList()
|
getTypeList()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -130,12 +185,9 @@ getTypeList()
|
|||||||
<el-input v-model="zdlbmc" clearable placeholder="请输入字典名称" prefix-icon="Search" style="margin-bottom: 20px" @keyup.enter="handleQueryDetail" @clear="handleQueryDetail" />
|
<el-input v-model="zdlbmc" clearable placeholder="请输入字典名称" prefix-icon="Search" style="margin-bottom: 20px" @keyup.enter="handleQueryDetail" @clear="handleQueryDetail" />
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-card class="scrollable-card">
|
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<p class="clickable" v-for="item in typeList" :key="item.zdlb" @click="refreshDetail(item.zddh)">{{ item.zdmc }}</p>
|
<p class="clickable" v-for="item in typeList" :key="item.zdlb" @click="refreshDetail(item.zddh)">{{ item.zdmc }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-card>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- 字典明细-->
|
<!-- 字典明细-->
|
||||||
@ -188,12 +240,35 @@ getTypeList()
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="dictRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="字典类别" prop="zdlb">
|
||||||
|
<el-input v-model="form.zdlb" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="字典代号" prop="zddh">
|
||||||
|
<el-input v-model="form.zddh" placeholder="请输入字典代号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="字典名称" prop="zdmc">
|
||||||
|
<el-input v-model="form.zdmc" placeholder="请输入字典名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="bz">
|
||||||
|
<el-input v-model="form.bz" placeholder="请输入内容"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
||||||
.scrollable-card .card-content {
|
.card-content {
|
||||||
max-height: 450px; /* 设置最大高度 */
|
max-height: 450px; /* 设置最大高度 */
|
||||||
overflow-y: auto; /* 超出高度时显示垂直滚动条 */
|
overflow-y: auto; /* 超出高度时显示垂直滚动条 */
|
||||||
padding: 16px; /* 保持与卡片默认一致的内边距 */
|
padding: 16px; /* 保持与卡片默认一致的内边距 */
|
||||||
@ -206,4 +281,5 @@ getTypeList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user