feat: save code
This commit is contained in:
parent
fbac2ef72b
commit
4b06c403a7
|
|
@ -20,6 +20,9 @@ import { Dialog, TableColumn, TableConfig } from "./hTable";
|
|||
import hTableEdit from "./hTableEdit.vue";
|
||||
import { hTableAPI } from "@/api/hTable";
|
||||
import { getenum } from "@/api/enum";
|
||||
//按钮权限
|
||||
import { hasPerms } from "@/utils/auth";
|
||||
|
||||
const props = defineProps({
|
||||
//** 传入的表单数据 */
|
||||
Row: {
|
||||
|
|
@ -278,7 +281,7 @@ function handleReloadPaged(reload = true) {
|
|||
data.ConditionalType = "Like";
|
||||
}
|
||||
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) {
|
||||
data.ConditionalType = table.value.column[name].searchType || 0;
|
||||
|
|
@ -300,11 +303,10 @@ async function fetchInitData() {
|
|||
const element = table.value.column[key];
|
||||
if (element.type === "dropdown") {
|
||||
if (!element.setting.datasource) {
|
||||
// 存在值就不处理
|
||||
|
||||
let rdata = await eval(element.setting.datasourceStr);
|
||||
element.setting.datasource = rdata.data;
|
||||
console.log(key + " " + element.setting.datasourceStr, rdata);
|
||||
// 不安全取消 存在值就不处理
|
||||
// let rdata = await eval(element.setting.datasourceStr);
|
||||
// element.setting.datasource = rdata.data;
|
||||
// console.log(key + " " + element.setting.datasourceStr, rdata);
|
||||
}
|
||||
}
|
||||
if (
|
||||
|
|
@ -380,9 +382,9 @@ function fetchPagedData() {
|
|||
<el-date-picker
|
||||
v-if="o.type.trim() == 'datetime'"
|
||||
v-model="o.value as Date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:placeholder="o.label"
|
||||
style="width: 100%"
|
||||
/>
|
||||
|
|
@ -397,7 +399,7 @@ function fetchPagedData() {
|
|||
>
|
||||
<el-option
|
||||
v-for="item in o.setting.datasource"
|
||||
:key="item.Value"
|
||||
:key="item.value"
|
||||
autocomplete="off"
|
||||
:label="item[o.setting.maplabel]"
|
||||
:value="item[o.setting.mapValue]"
|
||||
|
|
@ -464,7 +466,9 @@ function fetchPagedData() {
|
|||
<div v-if="table.operationTop" class="toolbar-container">
|
||||
<!-- 头部按钮组 -->
|
||||
<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)"
|
||||
:key="i"
|
||||
:type="e.btnStyle || 'info'"
|
||||
|
|
@ -495,7 +499,9 @@ function fetchPagedData() {
|
|||
<template v-slot="scope">
|
||||
<div class="columnTemplate">
|
||||
<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)"
|
||||
:key="i"
|
||||
class="btn"
|
||||
|
|
@ -571,26 +577,28 @@ function fetchPagedData() {
|
|||
.columnTemplate .btn {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.columnTemplate {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-flow: row wrap;
|
||||
gap: 5px;
|
||||
place-content: flex-start flex-start;
|
||||
align-items: center;
|
||||
-webkit-box-orient: horizontal;
|
||||
-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 {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.toolbar-container {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.maxWidth600px {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue