|
|
@@ -1,57 +1,51 @@
|
|
|
<template>
|
|
|
<div class="page">
|
|
|
- <div>
|
|
|
- <a-row style="margin: 2px; padding: 10px 0px 0px 0px" type="flex">
|
|
|
- <a-col :flex="1">
|
|
|
- <a-button style="margin-left: 30px" type="dashed" @click="addField"> 添加数据</a-button>
|
|
|
- </a-col>
|
|
|
- <a-col style="display: flex; align-items: center; gap: 10px; margin-right: 10px">
|
|
|
- <a-button type="dashed" @click="smartAdd">智能添加</a-button>
|
|
|
- <a-button type="dashed" @click="saveField">保存</a-button>
|
|
|
- <a-button @click="publishField" type="primary"> 发布</a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row style="margin: 2px; padding: 10px">
|
|
|
- <a-table size="middle" :pagination="false" :columns="columns" :data-source="data" :defaultExpandAllRows="true"
|
|
|
- :scroll="{ y: 530 }" :loading="loading">
|
|
|
- <template #bodyCell="{ column, text, record, index }">
|
|
|
- <span v-if="column.key === 'seq'">{{ index + 1 }}</span>
|
|
|
- <span v-if="['name','code'].includes(column.key)" style="font-size: 16px">{{ text }}</span>
|
|
|
- <a style="font-size: 16px" v-if="column.key === 'type'">
|
|
|
- <span v-if="text == 'STRING'">短文本</span>
|
|
|
- <span v-else-if="text == 'TEXT'">长文本</span>
|
|
|
- <span v-else-if="text == 'SINGLE'">人员组织(单选)</span>
|
|
|
- <span v-else-if="text == 'MULTI'">多选(包括 人员组织)</span>
|
|
|
- <span v-else-if="text == 'INTEGER'">整数</span>
|
|
|
- <span v-else-if="text == 'DECIMAL'">小数</span>
|
|
|
- <span v-else-if="text == 'DATETIME'">时间</span>
|
|
|
- <span v-else-if="text == 'ATTACH'">附件</span>
|
|
|
- <span v-else-if="text == 'IMAGE'">图片</span>
|
|
|
- <span v-else-if="text == 'CHILDREN'">子表</span>
|
|
|
- <span v-else>
|
|
|
+ <div class="header-data">
|
|
|
+ <a-button type="dashed" @click="addField"> 添加数据</a-button>
|
|
|
+ <a-button type="dashed" @click="smartAdd">智能添加</a-button>
|
|
|
+ <a-button type="dashed" @click="saveField">保存</a-button>
|
|
|
+ <a-button style="margin-right: 30px" @click="publishField" type="primary"> 发布</a-button>
|
|
|
+ </div>
|
|
|
+ <div class="table-data">
|
|
|
+ <a-table size="middle" :pagination="false" :columns="columns" :data-source="data" :defaultExpandAllRows="true"
|
|
|
+ :scroll="{ y: tableHeight }" :loading="loading">
|
|
|
+ <template #bodyCell="{ column, text, record, index }">
|
|
|
+ <span v-if="column.key === 'seq'">{{ index + 1 }}</span>
|
|
|
+ <span v-if="['name','code'].includes(column.key)" style="font-size: 16px">{{ text }}</span>
|
|
|
+ <a style="font-size: 16px" v-if="column.key === 'type'">
|
|
|
+ <span v-if="text == 'STRING'">短文本</span>
|
|
|
+ <span v-else-if="text == 'TEXT'">长文本</span>
|
|
|
+ <span v-else-if="text == 'SINGLE'">人员组织(单选)</span>
|
|
|
+ <span v-else-if="text == 'MULTI'">多选(包括 人员组织)</span>
|
|
|
+ <span v-else-if="text == 'INTEGER'">整数</span>
|
|
|
+ <span v-else-if="text == 'DECIMAL'">小数</span>
|
|
|
+ <span v-else-if="text == 'DATETIME'">时间</span>
|
|
|
+ <span v-else-if="text == 'ATTACH'">附件</span>
|
|
|
+ <span v-else-if="text == 'IMAGE'">图片</span>
|
|
|
+ <span v-else-if="text == 'CHILDREN'">子表</span>
|
|
|
+ <span v-else>
|
|
|
{{ text }}
|
|
|
</span>
|
|
|
- </a>
|
|
|
- <a-switch v-if="column.key === 'publish'" :checked="checked(text)"/>
|
|
|
- <a-switch v-if="chargeCanTrance(column,record)"
|
|
|
- v-model:checked="record.trace"/>
|
|
|
- <template v-if="column.key === 'operation'">
|
|
|
- <div style="display: flex; gap: 10px">
|
|
|
- <a-button type="dashed" @click="handleRem(record, 'up')" :disabled="!record.isMoveUp">
|
|
|
- <UpOutlined/>
|
|
|
- </a-button>
|
|
|
- <a-button type="dashed" @click="handleRem(record, 'down')" :disabled="!record.isMoveDown">
|
|
|
- <DownOutlined/>
|
|
|
- </a-button>
|
|
|
- <a-button type="dashed" @click="handleEdit(record)">编辑</a-button>
|
|
|
- <a-button v-show="record.publish!='1'" danger @click="handleDel(record)">删除</a-button>
|
|
|
- <a-button type="primary" v-if="record.type == 'CHILDREN'" @click="handleAddChild(record)">新增子数据
|
|
|
- </a-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ </a>
|
|
|
+ <a-switch v-if="column.key === 'publish'" :checked="checked(text)"/>
|
|
|
+ <a-switch v-if="chargeCanTrance(column,record)"
|
|
|
+ v-model:checked="record.trace"/>
|
|
|
+ <template v-if="column.key === 'operation'">
|
|
|
+ <div style="display: flex; gap: 10px">
|
|
|
+ <a-button type="dashed" @click="handleRem(record, 'up')" :disabled="!record.isMoveUp">
|
|
|
+ <UpOutlined/>
|
|
|
+ </a-button>
|
|
|
+ <a-button type="dashed" @click="handleRem(record, 'down')" :disabled="!record.isMoveDown">
|
|
|
+ <DownOutlined/>
|
|
|
+ </a-button>
|
|
|
+ <a-button type="dashed" @click="handleEdit(record)">编辑</a-button>
|
|
|
+ <a-button v-show="record.publish!='1'" danger @click="handleDel(record)">删除</a-button>
|
|
|
+ <a-button type="primary" v-if="record.type == 'CHILDREN'" @click="handleAddChild(record)">新增子数据
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- </a-table>
|
|
|
- </a-row>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
</div>
|
|
|
|
|
|
<SmartFieldDialog ref="smartFielDialog" :tableData="data" @ok="okSmartFieldDialog"></SmartFieldDialog>
|
|
|
@@ -133,6 +127,7 @@ export default defineComponent({
|
|
|
data: [],
|
|
|
loading: false,
|
|
|
smartFields: '',
|
|
|
+ tableHeight: 500,
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -143,6 +138,7 @@ export default defineComponent({
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initForm();
|
|
|
+ this.tableHeight = window.innerHeight - 246;
|
|
|
},
|
|
|
methods: {
|
|
|
handleRem(row, dr) {
|
|
|
@@ -464,9 +460,23 @@ export default defineComponent({
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
-<style scoped lang="less">
|
|
|
+<style lang="less" scoped>
|
|
|
.page {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
+
|
|
|
+.header-data {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 10px; /* 子元素之间的间距 */
|
|
|
+ align-items: center;
|
|
|
+ justify-content: right;
|
|
|
+ padding-top: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.table-data {
|
|
|
+ height: 100%;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
</style>
|