123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <template>
- <div class="dialog">
- <el-dialog
- :title="formData.name"
- width="40%"
- :visible.sync="dialogVisible"
- :before-close="close"
- :modal-append-to-body="false"
- :close-on-click-modal="false"
- >
- <div class="content">
- <el-table
- ref="multipleTable"
- :data="fieldList"
- style="width: 100%"
- @selection-change="handleSelectionChange"
- >
- <el-table-column label="序号" width="70px">
- <template slot-scope="scope">{{ scope.$index + 1 }}</template>
- </el-table-column>
- <el-table-column prop="filedName" label="字段名"> </el-table-column>
- <el-table-column
- prop="filedNameZh"
- label="中文名"
- show-overflow-tooltip
- >
- </el-table-column>
- <el-table-column label="是否可共享" width="150">
- <template #default="{ row, $index }">
- <el-checkbox
- v-model="row.checked"
- @change="changeShare(row, $index)"
- >
- 可共享
- </el-checkbox>
- </template></el-table-column
- >
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="refresh">刷新字段列表</el-button>
- <el-button type="primary" @click="submit">保存</el-button>
- <el-button @click="close">关闭</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { Getfiledslist, fileds } from "@/api/shared.js";
- export default {
- components: {},
- props: {},
- data() {
- return {
- formData: {},
- fieldList: [{ label: "sc", name: "字段" }],
- dialogVisible: false,
- };
- },
- created() {},
- methods: {
- // 关闭弹窗
- close() {
- this.dialogVisible = false;
- this.$emit("close");
- },
- Init(rowdata) {
- this.formData = rowdata;
- this.dialogVisible = true;
- this.getfieldList(rowdata.bsm, false);
- },
- async getfieldList(zymlBsm, resetType) {
- this.fieldList = [];
- let res = await Getfiledslist({ zymlBsm, resetType });
- // this.fieldList = res.data;
- res.data.forEach((field) => {
- this.fieldList.push({ ...field, checked: field.shareDisplay == 0 });
- });
- },
- changeShare(row, index) {
- this.fieldList[index].shareDisplay = row.checked ? 0 : 1;
- },
- refresh() {
- this.getfieldList(this.formData.bsm, true);
- },
- async submit() {
- fileds(this.fieldList).then((res) => {
- if ((res.code = 200)) {
- this.$message.success("共享字段设置成功!");
- this.close();
- }
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .dialog {
- .content {
- height: 400px;
- overflow-y: auto;
- overflow-x: hidden;
- color: #fff;
- .el-checkbox {
- color: #fff;
- }
- }
- }
- </style>
- <style lang="scss" >
- </style>
|