提交代码

main
姜玉琦 2024-07-14 22:48:26 +08:00
parent c7eddc7a1c
commit 94ea2f9fa8
7 changed files with 52 additions and 25 deletions

View File

@ -163,7 +163,7 @@ const handleSubmit = useThrottleFn(() => {
/** 返回默认页面 */
function closeBack() {
router.replace({ path: "/operatorLibrary/calculate" });
router.push({ path: "/operatorLibrary/calculate" });
}
/** 算子主类型改变 */

View File

@ -70,7 +70,7 @@ const dataInfo = ref({});
/** 返回默认页面 */
function closeBack() {
router.replace({ path: "/operatorLibrary/calculate" });
router.push({ path: "/operatorLibrary/calculate" });
}
/** 初始化数据 */

View File

@ -213,7 +213,7 @@ furouter.pushileExceed() {
/** 返回默认页面 */
function closeBack() {
router.replace({ path: "/operatorLibrary/calculateParam" });
router.push({ path: "/operatorLibrary/calculateParam" });
}
/** 搜索算子 */

View File

@ -87,7 +87,7 @@ const formData = reactive<UserForm>({
/** 返回默认页面 */
function closeBack() {
router.replace({ path: "/operatorLibrary/calculateParam" });
router.push({ path: "/operatorLibrary/calculateParam" });
}
/** 初始化数据 */

View File

@ -94,10 +94,12 @@ const router = useRouter();
const formRef = ref(ElForm); //
const loading = ref(false); //
//
//
const formData = reactive({
unregisted: null,
});
//
const uploadRef = ref<UploadInstance>();
const userStore = useUserStore();
//
@ -163,7 +165,7 @@ function getCurrentRow(row: { [key: string]: any }) {
/** 返回默认页面 */
function closeBack() {
router.replace({ path: "/tester/otherTool" });
router.push({ path: "/tester/otherTool" });
}
//

View File

@ -152,17 +152,15 @@ function handleDelete(row: { [key: string]: any }) {
/** 查看第三方工具链 */
function handleDetail(row: { [key: string]: any }) {
localStorage.setItem('toolChainsKey-'+row.tool_id, JSON.stringify(row));
router.replace({ path: "/tester/otherToolDetail", query: { id: row.tool_id } });
router.push({ path: "/tester/otherToolDetail", query: { id: row.tool_id } });
}
/** 新增第三方工具链 */
function handleAdd() {
router.replace({ path: "/tester/otherToolEdit" });
router.push({ path: "/tester/otherToolEdit" });
}
onMounted(() => {
handleQuery();
});
</script>
router.pushrouter.push
</script>

View File

@ -17,15 +17,15 @@
</el-form-item>
</el-col>
<el-col :lg="12" :xs="12">
<el-form-item label="厂商名称" prop="tool_name">
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入厂商名称" />
<el-form-item label="厂商名称" prop="tool_type_name">
<el-input v-model="baseForm.tool_type_name" disabled placeholder="请输入厂商名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :lg="12" :xs="12">
<el-form-item label="工具链类型" prop="tool_name">
<el-input v-model="baseForm.tool_name" disabled placeholder="请输入工具链类型" />
<el-form-item label="工具链类型" prop="cmpt_hardware_type">
<el-input v-model="baseForm.cmpt_hardware_type" disabled placeholder="请输入工具链类型" />
</el-form-item>
</el-col>
<el-col :lg="12" :xs="12">
@ -133,7 +133,6 @@
<el-form ref="formRef" :model="form" :rules="rules" label-width="108px">
<el-form-item label="运行参数名称" prop="params_name">
<el-input v-model="form.params_name" placeholder="请输入运行参数名称" />
router.pushm-item>
<el-form-item label="运行参数描述" prop="params_desc">
<el-input
v-model="form.params_desc"
@ -167,7 +166,7 @@
</el-form-item>
<el-form-item v-if="fileStatus">
<el-input
v-model="form.params_content"
v-model="form.params_content_v2"
:rows="10"
type="textarea"
/>
@ -214,6 +213,28 @@ const rules = reactive({
params_content: [{ required: true, message: "运行参数文件不能为空", trigger: "blur" }],
});
//
let listOpt = reactive({
typeList: [
{
type: "quantizer",
name: "量化工具",
},
{
type: "compiler",
name: "编译工具",
},
{
type: "label",
name: "标注工具",
},
{
type: "other",
name: "其他工具",
},
],
});
/** 表单提交 */
const handleSubmitFile = useThrottleFn(() => {
formRef.value.validate((valid: any) => {
@ -257,6 +278,7 @@ function handleFileChange(file) {
if (isJSON(res)) {
let jsonStr = JSON.stringify(res);
form.params_content = jsonStr;
form.params_content_v2 = res;
formRef.value.validateField("params_content");
fileStatus.value = true;
}
@ -277,6 +299,7 @@ function isJSON(str) {
uploadRef.value.clearFiles();
fileStatus.value = false;
form.params_content = "";
form.params_content_v2 = "{}";
return false;
}
}
@ -297,6 +320,7 @@ function uploadFile(file) {
//
function handleFileRemove() {
form.params_content = "";
form.params_content_v2 = "{}";
fileStatus.value = false;
}
@ -309,22 +333,25 @@ function handleFileExceed() {
/** 返回默认页面 */
function closeBack() {
router.replace({ path: "/tester/otherTool" });
router.push({ path: "/tester/otherTool" });
}
/** 初始化数据 */
function initData(){
let id=route.query.id;
var row = localStorage.getItem('toolChainsKey-'+id);
if(!row){
ElMessage.error("未找到相关数据,请从列表页进入详情");
closeBack();
}
baseForm = row;
loading.value = true;
OperatorApi.toolChains(id)
.then((res) => {
//JSON
baseForm = res.data.data;
})
.finally(() => {
loading.value = false;
});
}
onMounted(() => {
//initData();
initData();
});
</script>
<style scoped lang="scss">