完成服务项目

This commit is contained in:
monanxiao
2024-10-15 11:16:25 +08:00
parent c4cad4c2bf
commit dbb9d1475b
5 changed files with 46 additions and 140 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ const API_BASE_URL = '/user';
export function getUserList(query) {
return service({
method: "get",
url: `${API_BASE_URL}`,
url: `${API_BASE_URL}/${query.roleld}`,
data: query,
});
}
+24 -17
View File
@@ -26,7 +26,6 @@
style="max-width: 600px;margin-bottom: 20px"
placeholder="请输入图片排序"
>
<template #prepend>序号</template>
</el-input>
</el-form-item>
<el-form-item label="首页图">
@@ -65,7 +64,7 @@
<el-table-column
label="序号"
prop="userId"
prop="sort"
width="120"
align="center"
show-overflow-tooltip
@@ -74,7 +73,7 @@
<el-table-column label="首页图" align="center">
<template #default="scope">
<el-image style="width: 600px; height: 50px" :src="scope.row.avatar" :fit="fit" lazy/>
<el-image style="width: 600px; height: 50px" :src="scope.row.img" :fit="fit" lazy/>
</template>
</el-table-column>
@@ -85,14 +84,7 @@
</el-table-column>
</el-table>
<el-pagination
small
background
layout="prev, pager, next"
:total="tableData.length"
class="mt-4 mt10"
@current-change="handleCurrentChange"
/>
</el-card>
</template>
<script setup>
@@ -108,7 +100,7 @@ import {
import {nextTick, onMounted, reactive, ref} from 'vue'
import {options} from './options.js'
import {getConfigList} from "../../api/modules/system";
import {getConfigList, updateSystem} from "../../api/modules/system";
import {addFile} from "../../api/modules/upload";
import {ElMessage} from "element-plus";
@@ -139,10 +131,10 @@ const formData = ref({
// 初始化数据
const initData = () => {
tableData.value = columnData.value;
getConfigList(queryData.value).then((res) => {
tableData.value = res.data[0]
tableData.value = JSON.parse(res.data[0].content);
console.log('cccc',tableData.value);
})
}
@@ -154,9 +146,24 @@ const confirmClick = () => {
return;
}
formData.value.img = JSON.stringify(formData.value.img); // 转为字符串
let params = {
id: 1,
content: JSON.stringify(formData.value)
};
console.log('formData', formData)
// 更新系统配置
updateSystem(params).then((res) => {
ElMessage({
message: '添加成功',
type: 'success',
})
});
drawer.value = false;
formData.value = {
sort: '',
img: ''
}
}
+7 -33
View File
@@ -46,7 +46,7 @@
<el-table-column
label="序号"
prop="userId"
prop="id"
width="120"
align="center"
show-overflow-tooltip
@@ -60,14 +60,14 @@
</el-table-column>
<el-table-column
label="微信昵称"
prop="name"
prop="nickName"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="注册时间"
prop="date"
prop="createTime"
width="auto"
align="center"
show-overflow-tooltip
@@ -120,24 +120,16 @@ const queryData = ref({
const initData = () => {
tableData.value = columnData.value;
queryData.value.roleld = 2;
// 获取用户列表
getUserList(queryData.value).then((res) => {
console.log('用户', res.data);
tableData.value = res.data.records;
total.value = res.data.total
});
// orderLists(queryData.value).then((res) => {
// console.log(res.data.data)
// // total.value = res.data.data.total
// tableData.value = res.data.data
// })
}
const itemEditHanld = (item) => {
item.itemEdit = !item.itemEdit
// // console.log(JSON.stringify(item));
// tabclickIndex.value = item;
}
const handleSizeChange = (val) => {
console.log(val)
}
@@ -148,24 +140,6 @@ const handleCurrentChange = (val) => {
queryData.value.page = val
initData(queryData.value)
}
const handleClose = () => {
}
const dialogVisibleHanle = () => {
console.log('滑动加载')
}
const handleExpand = () => {
isExpand.value = false
tableData.value.forEach((item) => {
table.value.toggleRowExpansion(item, isExpand.value)
})
}
const handleOpen = () => {
isExpand.value = true
tableData.value.forEach((item) => {
table.value.toggleRowExpansion(item, isExpand.value)
})
}
// 搜索事件
const searchEvnt = ()=> {
+7 -44
View File
@@ -88,16 +88,10 @@
<el-avatar :size="50" :src="scope.row.avatar" />
</template>
</el-table-column>
<el-table-column
label="微信昵称"
prop="nickname"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="名字"
prop="name"
prop="nickName"
width="300"
align="center"
show-overflow-tooltip
@@ -111,7 +105,7 @@
/>
<el-table-column
label="注册时间"
prop="date"
prop="createTime"
width="auto"
align="center"
show-overflow-tooltip
@@ -164,53 +158,22 @@ const queryData = ref({
const initData = () => {
tableData.value = columnData.value;
queryData.value.roleld = 2;
// 获取维修工程师列表
getUserList(queryData.value).then((res) => {
console.log('用户', res.data);
tableData.value = res.data.records;
total.value = res.data.total
});
// orderLists(queryData.value).then((res) => {
// console.log(res.data.data)
// // total.value = res.data.data.total
// tableData.value = res.data.data
// })
}
const itemEditHanld = (item) => {
item.itemEdit = !item.itemEdit
// // console.log(JSON.stringify(item));
// tabclickIndex.value = item;
}
const handleSizeChange = (val) => {
console.log(val)
}
const handleSelectionChange = (val) => {
}
const handleCurrentChange = (val) => {
queryData.value.size = 10
queryData.value.page = val
initData(queryData.value)
}
const handleClose = () => {
}
const dialogVisibleHanle = () => {
console.log('滑动加载')
}
const handleExpand = () => {
isExpand.value = false
tableData.value.forEach((item) => {
table.value.toggleRowExpansion(item, isExpand.value)
})
}
const handleOpen = () => {
isExpand.value = true
tableData.value.forEach((item) => {
table.value.toggleRowExpansion(item, isExpand.value)
})
}
// 搜索事件
const searchEvnt = ()=> {
+7 -45
View File
@@ -88,16 +88,10 @@
<el-avatar :size="50" :src="scope.row.avatar" />
</template>
</el-table-column>
<el-table-column
label="微信昵称"
prop="nickname"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="名字"
prop="name"
prop="nickName"
width="300"
align="center"
show-overflow-tooltip
@@ -111,7 +105,7 @@
/>
<el-table-column
label="注册时间"
prop="date"
prop="createTime"
width="auto"
align="center"
show-overflow-tooltip
@@ -164,53 +158,21 @@ const queryData = ref({
const initData = () => {
tableData.value = columnData.value;
queryData.value.roleld = 2;
// 获取勘察工程师列表
getUserList(queryData.value).then((res) => {
console.log('用户', res.data);
tableData.value = res.data.records;
total.value = res.data.total
});
}
// orderLists(queryData.value).then((res) => {
// console.log(res.data.data)
// // total.value = res.data.data.total
// tableData.value = res.data.data
// })
}
const itemEditHanld = (item) => {
item.itemEdit = !item.itemEdit
// // console.log(JSON.stringify(item));
// tabclickIndex.value = item;
}
const handleSizeChange = (val) => {
console.log(val)
}
const handleSelectionChange = (val) => {
}
const handleCurrentChange = (val) => {
queryData.value.size = 10
queryData.value.page = val
initData(queryData.value)
}
const handleClose = () => {
}
const dialogVisibleHanle = () => {
console.log('滑动加载')
}
const handleExpand = () => {
isExpand.value = false
tableData.value.forEach((item) => {
table.value.toggleRowExpansion(item, isExpand.value)
})
}
const handleOpen = () => {
isExpand.value = true
tableData.value.forEach((item) => {
table.value.toggleRowExpansion(item, isExpand.value)
})
}
// 搜索事件
const searchEvnt = ()=> {