888
This commit is contained in:
@@ -21,12 +21,12 @@ function createService() {
|
|||||||
// 实例的response响应拦截器
|
// 实例的response响应拦截器
|
||||||
service.interceptors.response.use(
|
service.interceptors.response.use(
|
||||||
(res) => {
|
(res) => {
|
||||||
// 如果发现响应头有文件传输扩展,或则响应头为application/json,或者直接status=200
|
// 如果发现响应头有文件传输扩展,或者响应头为application/json,或者直接status=200
|
||||||
if (
|
if (
|
||||||
(res.headers["content-disposition"] || !/^application\/json/.test(res.headers["content-type"])) &&
|
(res.headers["content-disposition"] || !/^application\/json/.test(res.headers["content-type"])) &&
|
||||||
res.status === 200
|
res.status === 200
|
||||||
) {
|
) {
|
||||||
return res
|
return res.data
|
||||||
// 如果发现data中有size字段直接报错
|
// 如果发现data中有size字段直接报错
|
||||||
} else if (res.data.size) {
|
} else if (res.data.size) {
|
||||||
res.data.code = 500
|
res.data.code = 500
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 添加用户
|
* 添加项目
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
save(params = {}) {
|
save(params = {}) {
|
||||||
|
|||||||
@@ -463,6 +463,7 @@ const requestHandle = async () => {
|
|||||||
if (response.rows) {
|
if (response.rows) {
|
||||||
tableData.value = response.rows
|
tableData.value = response.rows
|
||||||
if (response.pageInfo) {
|
if (response.pageInfo) {
|
||||||
|
// 这里去找total字段
|
||||||
total.value = response.pageInfo.total
|
total.value = response.pageInfo.total
|
||||||
openPagination.value = true
|
openPagination.value = true
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -220,14 +220,16 @@ const maFormModalRef = ref()
|
|||||||
const title = ref("")
|
const title = ref("")
|
||||||
/// 点击新增轮次按钮
|
/// 点击新增轮次按钮
|
||||||
const handleRoundAddClick = (nodeData) => {
|
const handleRoundAddClick = (nodeData) => {
|
||||||
|
let create_number = treeDataStore.getRoundMiddleInfo()
|
||||||
// 这里是文档写错了,调用form是里面组件绑定的数据
|
// 这里是文档写错了,调用form是里面组件绑定的数据
|
||||||
maFormModalRef.value.form = {}
|
maFormModalRef.value.form = {}
|
||||||
|
// 这里如果删除中间轮次,那么新增信息应该从中间开始
|
||||||
maFormModalRef.value.open({
|
maFormModalRef.value.open({
|
||||||
beginTime: dayjs().format("YYYY-MM-DD"),
|
beginTime: dayjs().format("YYYY-MM-DD"),
|
||||||
grade: "1",
|
grade: "1",
|
||||||
key: `${treeDataStore.treeData.length}`,
|
key: `${create_number}`,
|
||||||
name: `第${treeDataStore.treeData.length + 1}轮测试`,
|
name: `第${create_number + 1}轮测试`,
|
||||||
ident: `${route.query.ident}-R${treeDataStore.treeData.length + 1}`,
|
ident: `${route.query.ident}-R${create_number + 1}`,
|
||||||
project: projectId.value
|
project: projectId.value
|
||||||
})
|
})
|
||||||
title.value = "新增轮次"
|
title.value = "新增轮次"
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ const useUserStore = defineStore("user", {
|
|||||||
return loginAPI
|
return loginAPI
|
||||||
.login(form)
|
.login(form)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.success === true) {
|
if (res.success === true) {
|
||||||
this.setToken(res.data.token)
|
this.setToken(res.data.token)
|
||||||
|
// this.setToken(res.data.token)
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -26,6 +26,23 @@ const useTreeDataStore = defineStore("treeDataStore", {
|
|||||||
},
|
},
|
||||||
setCurrentNode(nodeKey) {
|
setCurrentNode(nodeKey) {
|
||||||
this.currentNode = nodeKey
|
this.currentNode = nodeKey
|
||||||
|
},
|
||||||
|
// 获取轮次信息中差中间的是哪几个轮次
|
||||||
|
getRoundMiddleInfo() {
|
||||||
|
let roundLength = this.treeData.length
|
||||||
|
// 取出最后一个key的值
|
||||||
|
let lastKey = parseInt(this.treeData[this.treeData.length - 1].key) + 1
|
||||||
|
// 遍历数组,找出key最大值
|
||||||
|
let key_list = []
|
||||||
|
this.treeData.forEach((item) => {
|
||||||
|
key_list.push(parseInt(item.key))
|
||||||
|
})
|
||||||
|
if (roundLength !== lastKey) {
|
||||||
|
let cha = lastKey - roundLength
|
||||||
|
return lastKey - cha - 1
|
||||||
|
} else {
|
||||||
|
return roundLength
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ function createService() {
|
|||||||
!/^application\/json/.test(response.headers["content-type"])) &&
|
!/^application\/json/.test(response.headers["content-type"])) &&
|
||||||
response.status === 200
|
response.status === 200
|
||||||
) {
|
) {
|
||||||
return response
|
return response.data
|
||||||
} else if (response.data.size) {
|
} else if (response.data.size) {
|
||||||
response.data.code = 500
|
response.data.code = 500
|
||||||
response.data.message = "服务器内部错误"
|
response.data.message = "服务器内部错误"
|
||||||
|
|||||||
@@ -149,8 +149,8 @@ const crudRef = ref()
|
|||||||
const crudOptions = reactive({
|
const crudOptions = reactive({
|
||||||
// 顶部每行显示列数
|
// 顶部每行显示列数
|
||||||
searchColNumber: 3,
|
searchColNumber: 3,
|
||||||
// 开启分页
|
// 不开启table的分页,但开启我们自己的分页器
|
||||||
tablePagination: true,
|
tablePagination: false,
|
||||||
// 是否显示索引列
|
// 是否显示索引列
|
||||||
showIndex: false,
|
showIndex: false,
|
||||||
// 行选择器
|
// 行选择器
|
||||||
@@ -222,7 +222,6 @@ const crudColumns = reactive([
|
|||||||
title: "邮箱",
|
title: "邮箱",
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: "email",
|
dataIndex: "email",
|
||||||
search: true,
|
|
||||||
width: 100,
|
width: 100,
|
||||||
commonRules: [{ type: "email", message: "请输入正确的邮箱" }]
|
commonRules: [{ type: "email", message: "请输入正确的邮箱" }]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const crudOptions = ref({
|
|||||||
edit: { show: true },
|
edit: { show: true },
|
||||||
delete: { show: true },
|
delete: { show: true },
|
||||||
searchColNumber: 3,
|
searchColNumber: 3,
|
||||||
tablePagination: true,
|
tablePagination: false,
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
scroll: { x: "100%", y: "100%" },
|
scroll: { x: "100%", y: "100%" },
|
||||||
formOption: {
|
formOption: {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const crudOptions = ref({
|
|||||||
edit: { show: true, api: testDemandApi.editTestDemand },
|
edit: { show: true, api: testDemandApi.editTestDemand },
|
||||||
delete: { show: true },
|
delete: { show: true },
|
||||||
searchColNumber: 3,
|
searchColNumber: 3,
|
||||||
tablePagination: true,
|
tablePagination: false,
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
formOption: {
|
formOption: {
|
||||||
width: 1200
|
width: 1200
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const crudOptions = ref({
|
|||||||
edit: { show: true, api: designDemandApi.editDesignDemand },
|
edit: { show: true, api: designDemandApi.editDesignDemand },
|
||||||
delete: { show: true },
|
delete: { show: true },
|
||||||
searchColNumber: 3,
|
searchColNumber: 3,
|
||||||
tablePagination: true,
|
tablePagination: false,
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
operationColumnAlign:'center',
|
operationColumnAlign:'center',
|
||||||
formOption: {
|
formOption: {
|
||||||
@@ -42,7 +42,6 @@ const crudColumns = ref([
|
|||||||
align:'center',
|
align:'center',
|
||||||
width: 50,
|
width: 50,
|
||||||
dataIndex: "id",
|
dataIndex: "id",
|
||||||
search: true,
|
|
||||||
commonRules: [{ required: true, message: "标识是必填" }],
|
commonRules: [{ required: true, message: "标识是必填" }],
|
||||||
validateTrigger: "blur"
|
validateTrigger: "blur"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ const crudOptions = ref({
|
|||||||
edit: { show: true },
|
edit: { show: true },
|
||||||
delete: { show: true },
|
delete: { show: true },
|
||||||
searchColNumber: 3,
|
searchColNumber: 3,
|
||||||
tablePagination: true,
|
tablePagination: false,
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
operationColumnAlign: "center",
|
operationColumnAlign: "center",
|
||||||
formOption: {
|
formOption: {
|
||||||
@@ -83,7 +83,6 @@ const crudColumns = ref([
|
|||||||
width: 50,
|
width: 50,
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: "id",
|
dataIndex: "id",
|
||||||
search: true,
|
|
||||||
commonRules: [{ required: true, message: "ID是必填" }],
|
commonRules: [{ required: true, message: "ID是必填" }],
|
||||||
validateTrigger: "blur"
|
validateTrigger: "blur"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const crudOptions = ref({
|
|||||||
edit: { show: true },
|
edit: { show: true },
|
||||||
delete: { show: true },
|
delete: { show: true },
|
||||||
searchColNumber: 3,
|
searchColNumber: 3,
|
||||||
tablePagination: true,
|
tablePagination: false,
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
formOption: {
|
formOption: {
|
||||||
width: 1200,
|
width: 1200,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const crudOptions = ref({
|
|||||||
edit: { show: true,api: projectApi.update},
|
edit: { show: true,api: projectApi.update},
|
||||||
delete: { show: true ,api:projectApi.delete},
|
delete: { show: true ,api:projectApi.delete},
|
||||||
searchColNumber: 3,
|
searchColNumber: 3,
|
||||||
tablePagination: true,
|
tablePagination: false,
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
operationWidth: 500,
|
operationWidth: 500,
|
||||||
showIndex: false,
|
showIndex: false,
|
||||||
@@ -193,7 +193,7 @@ const crudColumns = ref([
|
|||||||
search: true,
|
search: true,
|
||||||
commonRules: [{ required: true, message: "责任人必选" }],
|
commonRules: [{ required: true, message: "责任人必选" }],
|
||||||
formType: "select",
|
formType: "select",
|
||||||
dict: { url: "system/user/index", props: { label: "name", value: "name" }, translation: true }
|
dict: { url: "system/user/list", props: { label: "name", value: "name" }, translation: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "成员",
|
title: "成员",
|
||||||
@@ -202,7 +202,7 @@ const crudColumns = ref([
|
|||||||
search: true,
|
search: true,
|
||||||
formType: "select",
|
formType: "select",
|
||||||
multiple: true,
|
multiple: true,
|
||||||
dict: { url: "system/user/index", props: { label: "name", value: "name" }, translation: true },
|
dict: { url: "system/user/list", props: { label: "name", value: "name" }, translation: true },
|
||||||
commonRules: [{ required: true, message: "成员至少选择一个" }]
|
commonRules: [{ required: true, message: "成员至少选择一个" }]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user