|
|
@@ -35,7 +35,7 @@
|
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
|
plain
|
|
|
- v-if="permission.autodata_delete"
|
|
|
+ v-if="deleteBatch"
|
|
|
@click="handleDelete">刪 除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
@@ -47,7 +47,7 @@
|
|
|
<script>
|
|
|
import {getList, getDetail, add, update, remove} from "@/api/bank/autodata";
|
|
|
import {mapGetters} from "vuex";
|
|
|
- import {getList as getTables} from "@/api/bank/autostruct";
|
|
|
+ import {getSelectAndPermissionByDept} from "@/api/bank/autostruct";
|
|
|
import {opStr2opObj} from "../../api/bank/autostruct";
|
|
|
|
|
|
export default {
|
|
|
@@ -60,6 +60,7 @@
|
|
|
form: {},
|
|
|
query: {},
|
|
|
loading: true,
|
|
|
+ deleteBatch: false,
|
|
|
page: {
|
|
|
pageSize: 10,
|
|
|
currentPage: 1,
|
|
|
@@ -108,9 +109,9 @@
|
|
|
},
|
|
|
methods: {
|
|
|
initTableList(){
|
|
|
- getTables(1, 500, {}).then(res => {
|
|
|
+ getSelectAndPermissionByDept().then(res => {
|
|
|
const data = res.data.data;
|
|
|
- this.tableList = data.records;
|
|
|
+ this.tableList = data;
|
|
|
if (this.tableList.length > 0){
|
|
|
this.value = this.tableList[0].id;
|
|
|
this.selectTable(this.value)
|
|
|
@@ -120,12 +121,18 @@
|
|
|
selectTable(value){
|
|
|
let _this = this;
|
|
|
this.show = false;
|
|
|
- let table = this.getItemById(value);
|
|
|
- let option = opStr2opObj(table.columns);
|
|
|
+ let tableStruct = this.getItemById(value);
|
|
|
+ let option = opStr2opObj(tableStruct.columns);
|
|
|
+ option.addBtn = tableStruct.canWrite;
|
|
|
+ _this.deleteBatch = tableStruct.isManageRole;
|
|
|
+ option.delBtn = tableStruct.isManageRole;
|
|
|
+ option.excelBtn = tableStruct.isManageRole;
|
|
|
+ option.editBtn = tableStruct.isManageRole;
|
|
|
option.viewBtn = true;
|
|
|
option.searchMenuSpan = 6;
|
|
|
option.column.forEach((item, index) => {
|
|
|
item.search = index < 4 && item.type != 'title';
|
|
|
+ item.editDisabled = true;
|
|
|
if (item.dicUrl){
|
|
|
item.dicFormatter = (res) => {
|
|
|
res.data.forEach(item => {item.disabled = item.isSealed == 1;})
|