Merge remote-tracking branch 'origin/main' into gyj
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"mockjs": "^1.1.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"screenfull": "^6.0.1",
|
||||
"sortablejs": "^1.15.3",
|
||||
"video.js": "^7.20.3",
|
||||
"vue": "^3.2.25",
|
||||
"vue-router": "^4.0.13",
|
||||
|
||||
@@ -1,18 +1,3 @@
|
||||
import service from "../request.js";
|
||||
const API_BASE_URL = '/config';
|
||||
|
||||
// 客户列表
|
||||
export function getConfigList(query) {
|
||||
return service({
|
||||
method: "get",
|
||||
url: `${API_BASE_URL}/list`,
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
export function updateConfig(query) {
|
||||
return service({
|
||||
method: "put",
|
||||
url: `${API_BASE_URL}`,
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 原接口方法已转移至system.js 中
|
||||
|
||||
+19
-10
@@ -1,15 +1,6 @@
|
||||
import service from "../request.js";
|
||||
const API_BASE_URL = '/config';
|
||||
|
||||
// 配置列表
|
||||
export function getSystemList(query) {
|
||||
return service({
|
||||
method: "get",
|
||||
url: `${API_BASE_URL}/list`,
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改配置
|
||||
export function updateSystem(params) {
|
||||
return service({
|
||||
@@ -17,4 +8,22 @@ export function updateSystem(params) {
|
||||
url: `${API_BASE_URL}`,
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 获取配置信息列表(全部配置)
|
||||
export function getConfigList(query) {
|
||||
return service({
|
||||
method: "get",
|
||||
url: `${API_BASE_URL}/list`,
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新单个配置项内容(仅更新内容字段)
|
||||
export function updateConfig(query) {
|
||||
return service({
|
||||
method: "put",
|
||||
url: `${API_BASE_URL}`,
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -63,8 +63,9 @@ export default {
|
||||
return new Promise((resolve, reject) => {
|
||||
LoginInfo(userInfo)
|
||||
.then((res) => {
|
||||
console.log(res.data.data);
|
||||
console.log(res.data.token, "token");
|
||||
sessionStorage.setItem("token", res.data.token);
|
||||
localStorage.setItem("token", res.data.token);
|
||||
sessionStorage.setItem("UserInfo", JSON.stringify(res.data));
|
||||
commit("setToken", res.data.token);
|
||||
commit("setUserInfo", res.data);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="henader-card">
|
||||
<div class="flx-row">
|
||||
<el-button type="success" @click="dialogVisibleShow">
|
||||
<el-icon style="margin-right: 10px;"><CirclePlus /></el-icon>
|
||||
添加
|
||||
</el-button>
|
||||
<el-form :inline="true" :model="queryData" style="flex: 1">
|
||||
<!-- <el-input placeholder="请输入搜索内容" v-model="queryData.keyWord">-->
|
||||
<!-- </el-input>-->
|
||||
@@ -9,7 +13,6 @@
|
||||
<!-- <el-button type="primary" :icon="Search" @click="initData" class="ml20"-->
|
||||
<!-- >搜索</el-button-->
|
||||
<!-- >-->
|
||||
<el-button type="primary" @click="dialogVisibleShow">+添加</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<el-form :model="form" label-width="auto" style="max-width: 600px;">
|
||||
|
||||
<el-form-item label="客服电话">
|
||||
<span>400******************</span>
|
||||
<span>{{ serviceTelephone }}</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修改电话">
|
||||
<el-input v-model="form.name" />
|
||||
<el-input v-model="form.content" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
@@ -18,23 +18,57 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue'
|
||||
import {onMounted, reactive, ref} from 'vue'
|
||||
import {getConfigList, updateConfig} from "../../api/modules/system";
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
// do not use same name with ref
|
||||
const form = reactive({
|
||||
name: '',
|
||||
region: '',
|
||||
date1: '',
|
||||
date2: '',
|
||||
delivery: false,
|
||||
type: [],
|
||||
resource: '',
|
||||
desc: '',
|
||||
id: undefined,
|
||||
content: ''
|
||||
})
|
||||
let serviceTelephone = ref("400 000 0000")
|
||||
|
||||
const initData = () => {
|
||||
|
||||
getConfigList().then((res) => {
|
||||
console.log(res.data);
|
||||
|
||||
if (Array.isArray(res.data) && res.data.length > 0) {
|
||||
let customerServicePhoneRecord = res.data.find(item => item.title === "客服电话");
|
||||
if (customerServicePhoneRecord) {
|
||||
// 如果找到了匹配的记录,你可以根据需要进行处理
|
||||
console.log("找到客服电话记录:", customerServicePhoneRecord);
|
||||
// 如果需要,可以将这条记录赋值给某个变量或用于其他操作
|
||||
form.id = customerServicePhoneRecord.id;
|
||||
form.content = customerServicePhoneRecord.content;
|
||||
serviceTelephone.value = customerServicePhoneRecord.content;
|
||||
} else {
|
||||
console.log("未找到客服电话记录");
|
||||
}
|
||||
} else {
|
||||
console.log("res.data 是空或不是一个数组");
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error("获取配置列表时出错:", error);
|
||||
});
|
||||
}
|
||||
|
||||
const onSubmit = () => {
|
||||
console.log('submit!')
|
||||
updateConfig(form).then((res) => {
|
||||
console.log('编辑数据成功')
|
||||
console.log(ElMessage)
|
||||
ElMessage({
|
||||
message: '编辑服务项目成功',
|
||||
type: 'success',
|
||||
})
|
||||
// tableData.value = res.data
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
initData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
drag
|
||||
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
|
||||
action="https://repair.cpolar.top/file"
|
||||
multiple
|
||||
>
|
||||
<el-icon class="el-icon--upload">
|
||||
@@ -105,7 +105,7 @@ import {
|
||||
import {nextTick, onMounted, reactive, ref} from 'vue'
|
||||
|
||||
import {options} from './options.js'
|
||||
import {getUserList} from "../../api/modules/user";
|
||||
import {getConfigList} from "../../api/modules/system";
|
||||
|
||||
const tableData = ref([])
|
||||
const dataList = ref([])
|
||||
@@ -130,11 +130,11 @@ const initData = () => {
|
||||
|
||||
tableData.value = columnData.value;
|
||||
|
||||
// orderLists(queryData.value).then((res) => {
|
||||
// console.log(res.data.data)
|
||||
// // total.value = res.data.data.total
|
||||
// tableData.value = res.data.data
|
||||
// })
|
||||
getConfigList(queryData.value).then((res) => {
|
||||
console.log(res.data)
|
||||
// total.value = res.data.data.total
|
||||
tableData.value = res.data
|
||||
})
|
||||
}
|
||||
const itemEditHanld = (item) => {
|
||||
item.itemEdit = !item.itemEdit
|
||||
|
||||
Reference in New Issue
Block a user