feat: save code

This commit is contained in:
xiangbo 2025-08-15 15:18:25 +08:00
parent fbac2ef72b
commit 4b06c403a7
1 changed files with 27 additions and 19 deletions

View File

@ -20,6 +20,9 @@ import { Dialog, TableColumn, TableConfig } from "./hTable";
import hTableEdit from "./hTableEdit.vue"; import hTableEdit from "./hTableEdit.vue";
import { hTableAPI } from "@/api/hTable"; import { hTableAPI } from "@/api/hTable";
import { getenum } from "@/api/enum"; import { getenum } from "@/api/enum";
//
import { hasPerms } from "@/utils/auth";
const props = defineProps({ const props = defineProps({
//** */ //** */
Row: { Row: {
@ -278,7 +281,7 @@ function handleReloadPaged(reload = true) {
data.ConditionalType = "Like"; data.ConditionalType = "Like";
} }
data.FieldName = name.charAt(0).toUpperCase() + name.slice(1); data.FieldName = name.charAt(0).toUpperCase() + name.slice(1);
data.FieldValue = table.value.column[name].value; data.FieldValue = table.value.column[name].value.toString();
if (table.value.column[name].searchType != undefined) { if (table.value.column[name].searchType != undefined) {
data.ConditionalType = table.value.column[name].searchType || 0; data.ConditionalType = table.value.column[name].searchType || 0;
@ -300,11 +303,10 @@ async function fetchInitData() {
const element = table.value.column[key]; const element = table.value.column[key];
if (element.type === "dropdown") { if (element.type === "dropdown") {
if (!element.setting.datasource) { if (!element.setting.datasource) {
// //
// let rdata = await eval(element.setting.datasourceStr);
let rdata = await eval(element.setting.datasourceStr); // element.setting.datasource = rdata.data;
element.setting.datasource = rdata.data; // console.log(key + " " + element.setting.datasourceStr, rdata);
console.log(key + " " + element.setting.datasourceStr, rdata);
} }
} }
if ( if (
@ -380,9 +382,9 @@ function fetchPagedData() {
<el-date-picker <el-date-picker
v-if="o.type.trim() == 'datetime'" v-if="o.type.trim() == 'datetime'"
v-model="o.value as Date" v-model="o.value as Date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
type="date" type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:placeholder="o.label" :placeholder="o.label"
style="width: 100%" style="width: 100%"
/> />
@ -397,7 +399,7 @@ function fetchPagedData() {
> >
<el-option <el-option
v-for="item in o.setting.datasource" v-for="item in o.setting.datasource"
:key="item.Value" :key="item.value"
autocomplete="off" autocomplete="off"
:label="item[o.setting.maplabel]" :label="item[o.setting.maplabel]"
:value="item[o.setting.mapValue]" :value="item[o.setting.mapValue]"
@ -464,7 +466,9 @@ function fetchPagedData() {
<div v-if="table.operationTop" class="toolbar-container"> <div v-if="table.operationTop" class="toolbar-container">
<!-- 头部按钮组 --> <!-- 头部按钮组 -->
<el-button <el-button
v-for="(e, i) in table.operationColumnData.filter(s => s.topBtn)" v-for="(e, i) in table.operationColumnData.filter(
s => s.topBtn && hasPerms(s.perms)
)"
v-show="execute(e['show'], {}, e)" v-show="execute(e['show'], {}, e)"
:key="i" :key="i"
:type="e.btnStyle || 'info'" :type="e.btnStyle || 'info'"
@ -495,7 +499,9 @@ function fetchPagedData() {
<template v-slot="scope"> <template v-slot="scope">
<div class="columnTemplate"> <div class="columnTemplate">
<el-button <el-button
v-for="(e, i) in table.operationColumnData.filter(s => !s.topBtn)" v-for="(e, i) in table.operationColumnData.filter(
s => !s.topBtn && hasPerms(s.perms)
)"
v-show="execute(e['show'], scope, e)" v-show="execute(e['show'], scope, e)"
:key="i" :key="i"
class="btn" class="btn"
@ -571,26 +577,28 @@ function fetchPagedData() {
.columnTemplate .btn { .columnTemplate .btn {
margin-left: 0 !important; margin-left: 0 !important;
} }
.columnTemplate { .columnTemplate {
display: flex; display: flex;
flex-direction: row;
flex-flow: row wrap;
gap: 5px; gap: 5px;
place-content: flex-start flex-start;
align-items: center;
-webkit-box-orient: horizontal; -webkit-box-orient: horizontal;
-webkit-box-direction: normal; -webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: flex-start;
align-content: flex-start;
} }
.sty .tab_tip { .sty .tab_tip {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.toolbar-container { .toolbar-container {
padding-bottom: 5px; padding-bottom: 5px;
} }
.maxWidth600px { .maxWidth600px {
max-width: 600px; max-width: 600px;
} }