提交代码

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() { function closeBack() {
router.replace({ path: "/operatorLibrary/calculate" }); router.push({ path: "/operatorLibrary/calculate" });
} }
/** 算子主类型改变 */ /** 算子主类型改变 */

View File

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

View File

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

View File

@ -87,7 +87,7 @@ const formData = reactive<UserForm>({
/** 返回默认页面 */ /** 返回默认页面 */
function closeBack() { 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 formRef = ref(ElForm); //
const loading = ref(false); // const loading = ref(false); //
// //
const formData = reactive({ const formData = reactive({
unregisted: null, unregisted: null,
}); });
//
const uploadRef = ref<UploadInstance>();
const userStore = useUserStore(); const userStore = useUserStore();
// //
@ -163,7 +165,7 @@ function getCurrentRow(row: { [key: string]: any }) {
/** 返回默认页面 */ /** 返回默认页面 */
function closeBack() { 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 }) { function handleDetail(row: { [key: string]: any }) {
localStorage.setItem('toolChainsKey-'+row.tool_id, JSON.stringify(row)); router.push({ path: "/tester/otherToolDetail", query: { id: row.tool_id } });
router.replace({ path: "/tester/otherToolDetail", query: { id: row.tool_id } });
} }
/** 新增第三方工具链 */ /** 新增第三方工具链 */
function handleAdd() { function handleAdd() {
router.replace({ path: "/tester/otherToolEdit" }); router.push({ path: "/tester/otherToolEdit" });
} }
onMounted(() => { onMounted(() => {
handleQuery(); handleQuery();
}); });
</script> </script>
router.pushrouter.push

View File

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