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