删除status字段
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import axios from "axios"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
import tool from "@/utils/tool"
|
||||
import { get, isEmpty } from "lodash"
|
||||
import { get, isEmpty } from "lodash-es"
|
||||
import qs, { stringify } from "qs"
|
||||
import { h } from "vue"
|
||||
import { IconFaceFrownFill } from "@arco-design/web-vue/dist/arco-vue-icon"
|
||||
|
||||
@@ -19,7 +19,6 @@ import MaResourceButton from "./ma-resource/button.vue"
|
||||
import MaUser from "./ma-user/index.vue"
|
||||
import MaEditor from "./ma-editor/index.vue"
|
||||
import MaIcon from "./ma-icon/index.vue"
|
||||
import MaCodeEditor from "./ma-codeEditor/index.vue"
|
||||
import MaUserInfo from "./ma-userInfo/index.vue"
|
||||
import MaCityLinkage from "./ma-cityLinkage/index.vue"
|
||||
// 后续增加的全局组件
|
||||
@@ -51,7 +50,6 @@ export default {
|
||||
Vue.component("MaUser", MaUser)
|
||||
Vue.component("MaEditor", MaEditor)
|
||||
Vue.component("MaIcon", MaIcon)
|
||||
Vue.component("MaCodeEditor", MaCodeEditor)
|
||||
Vue.component("MaUserInfo", MaUserInfo)
|
||||
Vue.component("MaCityLinkage", MaCityLinkage)
|
||||
// 后续增加的组件
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
<template>
|
||||
<div class="editor" ref="dom" :style="'width: 100%; height: ' + props.height + 'px'"></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, watch } from "vue"
|
||||
import { useAppStore } from "@/store"
|
||||
import { formatJson } from "@/utils/common"
|
||||
import * as monaco from "monaco-editor/esm/vs/editor/editor.api"
|
||||
import "monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution"
|
||||
import "monaco-editor/esm/vs/basic-languages/php/php.contribution"
|
||||
import "monaco-editor/esm/vs/basic-languages/mysql/mysql.contribution"
|
||||
import "monaco-editor/esm/vs/basic-languages/html/html.contribution"
|
||||
import "monaco-editor/esm/vs/basic-languages/css/css.contribution"
|
||||
import "monaco-editor/esm/vs/editor/contrib/find/browser/findController"
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: [String, Object, Array],
|
||||
default: () => ""
|
||||
},
|
||||
isBind: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 400
|
||||
},
|
||||
language: {
|
||||
type: String,
|
||||
default: "javascript"
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(["update:modelValue"])
|
||||
const dom = ref()
|
||||
|
||||
let instance
|
||||
|
||||
onMounted(() => {
|
||||
instance = monaco.editor.create(dom.value, {
|
||||
value: typeof props.modelValue === "string" ? props.modelValue : formatJson(props.modelValue),
|
||||
tabSize: 2,
|
||||
automaticLayout: true,
|
||||
scrollBeyondLastLine: false,
|
||||
language: props.language,
|
||||
theme: appStore.mode === "light" ? "vs" : "vs-dark",
|
||||
autoIndent: true,
|
||||
minimap: { enabled: false },
|
||||
readOnly: props.readonly,
|
||||
folding: true,
|
||||
acceptSuggestionOnCommitCharacter: true,
|
||||
acceptSuggestionOnEnter: true,
|
||||
contextmenu: true
|
||||
})
|
||||
|
||||
instance.onDidChangeModelContent(() => {
|
||||
emit("update:modelValue", instance.getValue())
|
||||
})
|
||||
})
|
||||
|
||||
if (props.isBind) {
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(vl) => instance.setValue(typeof vl === "string" ? vl : formatJson(vl))
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.editor {
|
||||
border: 1px solid var(--color-border-2);
|
||||
border-radius: 1px;
|
||||
background: var(--color-bg-2);
|
||||
}
|
||||
</style>
|
||||
@@ -1,62 +0,0 @@
|
||||
<!--
|
||||
- MineAdmin is committed to providing solutions for quickly building web applications
|
||||
- Please view the LICENSE file that was distributed with this source code,
|
||||
- For the full copyright and license information.
|
||||
- Thank you very much for using MineAdmin.
|
||||
-
|
||||
- @Author X.Mo<root@imoi.cn>
|
||||
- @Link https://gitee.com/xmo/mineadmin-vue
|
||||
-->
|
||||
<template>
|
||||
<ma-form-item
|
||||
v-if="typeof props.component.display == 'undefined' || props.component.display === true"
|
||||
:component="props.component"
|
||||
:custom-field="props.customField"
|
||||
>
|
||||
<slot :name="`form-${props.component.dataIndex}`" v-bind="props.component">
|
||||
<ma-code-editor
|
||||
v-model="value"
|
||||
style="width: 100%"
|
||||
:height="props.component.height"
|
||||
:isBind="props.component.isBind"
|
||||
:language="props.component.language"
|
||||
:readonly="props.component.readonly"
|
||||
@change="maEvent.handleChangeEvent(props.component, $event)"
|
||||
>
|
||||
</ma-code-editor>
|
||||
</slot>
|
||||
</ma-form-item>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject, onMounted, watch } from "vue"
|
||||
import { get, set } from "lodash"
|
||||
import MaCodeEditor from "@/components/ma-codeEditor/index.vue"
|
||||
import MaFormItem from "./form-item.vue"
|
||||
import { maEvent } from "../js/formItemMixin.js"
|
||||
const props = defineProps({
|
||||
component: Object,
|
||||
customField: { type: String, default: undefined }
|
||||
})
|
||||
|
||||
const formModel = inject("formModel")
|
||||
const index = props.customField ?? props.component.dataIndex
|
||||
const value = ref(get(formModel.value, index))
|
||||
|
||||
watch(
|
||||
() => get(formModel.value, index),
|
||||
(vl) => (value.value = vl)
|
||||
)
|
||||
watch(
|
||||
() => value.value,
|
||||
(v) => {
|
||||
set(formModel.value, index, v)
|
||||
index.indexOf(".") > -1 && delete formModel.value[index]
|
||||
}
|
||||
)
|
||||
|
||||
maEvent.handleCommonEvent(props.component, "onCreated")
|
||||
onMounted(() => {
|
||||
maEvent.handleCommonEvent(props.component, "onMounted")
|
||||
})
|
||||
</script>
|
||||
2
cdTMP/src/env.d.ts
vendored
2
cdTMP/src/env.d.ts
vendored
@@ -5,3 +5,5 @@ declare module "*.vue" {
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
// 声明tinymce的min
|
||||
declare module "tinymce/tinymce.min.js"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { computed } from 'vue'
|
||||
import usePermission from '@/hooks/permission'
|
||||
import { useAppStore } from '@/store'
|
||||
import appClientMenus from '@/router/app-menus'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
export default function useMenuTree() {
|
||||
const permission = usePermission()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import NProgress from "nprogress" // progress bar
|
||||
import "nprogress/nprogress.css"
|
||||
|
||||
import usePermission from "@/hooks/permission"
|
||||
import { useUserStore, useAppStore } from "@/store"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import NProgress from "nprogress" // progress bar
|
||||
import "nprogress/nprogress.css"
|
||||
import { useUserStore } from "@/store"
|
||||
// userInfo守卫
|
||||
export default function setupUserLoginInfoGuard(router) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from "axios"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
import tool from "@/utils/tool"
|
||||
import { get, isEmpty } from "lodash"
|
||||
import { get, isEmpty } from "lodash-es"
|
||||
import qs from "qs"
|
||||
import { h } from "vue"
|
||||
import { IconFaceFrownFill } from "@arco-design/web-vue/dist/arco-vue-icon"
|
||||
|
||||
@@ -135,13 +135,6 @@ const columnsOptions = reactive([
|
||||
formType: "radio",
|
||||
dict: { name: "passType", props: { label: "title", value: "key" } },
|
||||
rules: [{ required: true, message: "是否通过必填" }]
|
||||
},
|
||||
{
|
||||
title: "执行状态",
|
||||
dataIndex: "status",
|
||||
formType: "radio",
|
||||
dict: { name: "execType", props: { label: "title", value: "key" } },
|
||||
rules: [{ required: true, message: "执行状态必填" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import PinYinMatch from "pinyin-match"
|
||||
import { useTreeDataStore } from "@/store"
|
||||
import { useRoute } from "vue-router"
|
||||
import testDemandApi from "@/api/project/testDemand"
|
||||
import { isEqual, cloneDeep } from "lodash"
|
||||
import { isEqual, cloneDeep } from "lodash-es"
|
||||
interface ITestContent {
|
||||
subName: string
|
||||
subDesc: string
|
||||
|
||||
@@ -18,7 +18,7 @@ import { useRoute } from "vue-router"
|
||||
import caseApi from "@/api/project/case"
|
||||
import { useTreeDataStore } from "@/store"
|
||||
import ProblemForm from "@/views/project/case/components/ProblemForm.vue"
|
||||
import { isEqual, cloneDeep } from "lodash"
|
||||
import { isEqual, cloneDeep } from "lodash-es"
|
||||
const problemFormRef = ref(null)
|
||||
const title = ref("问题单表单")
|
||||
const treeDataStore = useTreeDataStore()
|
||||
@@ -38,6 +38,7 @@ const showType = (record) => {
|
||||
// crud设置以及是否保留step数据事件函数
|
||||
const app = getCurrentInstance().appContext.config.globalProperties
|
||||
let beforeFormStep = undefined
|
||||
// 注意只保留测试步骤!!!
|
||||
const handleBeforeCancel = () => {
|
||||
if (!beforeFormStep) {
|
||||
return
|
||||
@@ -202,42 +203,6 @@ const crudColumns = ref([
|
||||
commonRules: [{ required: true, message: "名称是必填" }],
|
||||
validateTrigger: "blur"
|
||||
},
|
||||
{
|
||||
title: "执行情况",
|
||||
align: "center",
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
customRender: ({ record }) => {
|
||||
// 执行情况逻辑,查看所有步骤的执行情况 - 暂时硬编码
|
||||
let completeCount = 0
|
||||
let stepCount = record.testStep.length
|
||||
record.testStep.forEach((item) => {
|
||||
if (item.status === "1") {
|
||||
completeCount++
|
||||
}
|
||||
})
|
||||
if (completeCount === stepCount) {
|
||||
return (
|
||||
<a-tag bordered color="green">
|
||||
已执行
|
||||
</a-tag>
|
||||
)
|
||||
} else if (completeCount > 0 && completeCount < stepCount) {
|
||||
return (
|
||||
<a-tag bordered color="orange">
|
||||
部分执行
|
||||
</a-tag>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<a-tag bordered color="red">
|
||||
未执行
|
||||
</a-tag>
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "是否通过",
|
||||
align: "center",
|
||||
@@ -356,8 +321,7 @@ const crudColumns = ref([
|
||||
operation: "",
|
||||
expect: "",
|
||||
result: "",
|
||||
passed: "3",
|
||||
status: "3"
|
||||
passed: "3"
|
||||
}
|
||||
],
|
||||
formType: "children-form",
|
||||
@@ -386,13 +350,6 @@ const crudColumns = ref([
|
||||
formType: "radio",
|
||||
dict: { name: "passType", props: { label: "title", value: "key" } },
|
||||
commonRules: [{ required: true, message: "是否通过必填" }]
|
||||
},
|
||||
{
|
||||
title: "执行状态",
|
||||
dataIndex: "status",
|
||||
formType: "radio",
|
||||
dict: { name: "execType", props: { label: "title", value: "key" } },
|
||||
commonRules: [{ required: true, message: "执行状态必填" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -156,8 +156,8 @@ const useCrudInit = function () {
|
||||
search: true,
|
||||
commonRules: [
|
||||
{ required: true, message: "标识是必填" },
|
||||
{ validator: validateBlank, message: "标识格式不正确" }
|
||||
// { validator: validateWindowFileNameInput }
|
||||
{ validator: validateBlank, message: "标识格式不正确" },
|
||||
{ validator: validateWindowFileNameInput }
|
||||
],
|
||||
validateTrigger: "blur"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="ma-content-block p-3 lg:h-full block lg:border-0 lg:flex justify-between">
|
||||
<div class="ma-content-block p-3 block lg:border-0 lg:flex justify-between">
|
||||
<!-- 注意修复 上面dom删除 -> lg:h-full -->
|
||||
<div class="h-full w-full lg:ml-3 lg:mr-2 pt-2">
|
||||
<!-- ma-crud组件 -->
|
||||
<ma-crud :options="crudOptions" :columns="crudColumns" ref="crudRef">
|
||||
|
||||
Reference in New Issue
Block a user