123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <!-- 表格数据 -->
- <template>
- <div class="mainContentBox">
- <avue-crud
- ref="crudRef2"
- v-model:search="search"
- v-model="form"
- @row-update="createRow"
- :data="data"
- :option="option"
- v-model:page="page"
- >
- <template #menu="{ size, row, index }">
- <el-button
- v-if="row.excelData != '' && row.excelData != null"
- link
- size="small"
- type="primary"
- @click="opView(row)"
- style="margin: 0"
- ><i-ep-view />查看
- </el-button>
- <el-button
- v-if="row.excelData != '' && row.excelData != null"
- type="warning"
- link
- size="small"
- @click="opUpdate(row)"
- style="margin: 0"
- ><i-ep-edit />修改表格数据
- </el-button>
- </template>
- </avue-crud>
- <el-dialog
- v-model="updataShow"
- :title="updateTitle"
- @close="updataShow = false"
- width="1600"
- >
- <updateExcel
- @refresh="refreshDatalist"
- :data="ExData"
- @close="closeShow"
- />
- </el-dialog>
- </div>
- </template>
- <script setup>
- import { ref, getCurrentInstance } from "vue";
- import { useCrud } from "@/hooks/userCrud";
- import dictDataUtil from "@/common/configs/dictDataUtil";
- import ButtonPermKeys from "@/common/configs/buttonPermission";
- import {
- useCommonStoreHook,
- useDictionaryStore,
- useUserStoreHook,
- } from "@/store";
- import updateExcel from "./updateExcel.vue";
- // 数据字典相关
- const { dicts } = useDictionaryStore();
- const updataShow = ref(false);
- const updateTitle = ref("修改表格数据");
- const crudRef2 = ref({});
- const lookStatus = ref(false);
- const opUpdate = (row) => {
- ExData.value = row;
- ExData.value.lookStatus = false;
- updataShow.value = true;
- };
- const opView = (row) => {
- ExData.value = row;
- ExData.value.lookStatus = true;
- updataShow.value = true;
- };
- const closeShow = () => {
- updataShow.value = false;
- };
- const ExData = ref("");
- // 传入一个url,后面不带/
- const {
- form,
- data,
- option,
- search,
- page,
- toDeleteIds,
- Methords,
- Utils,
- commonConfig,
- } = useCrud({
- src: "/api/v1/ProcessFormData",
- });
- const ctableRef = ref(null);
- const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
- Methords; //增删改查
- const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
- const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
- const userStore = useUserStoreHook();
- const crudRef = ref(null); //crudRef.value 获取avue-crud对象
- const doEdit = (row, index) => {
- crudRef2.value && crudRef2.value.rowEdit(row, index);
- };
- const refreshTra = (row) => {
- commonConfig.value.params = { seqNo: row.seqNo };
- dataList();
- };
- const refreshDatalist = () => {
- dataList();
- };
- defineExpose({ refreshTra });
- onMounted(() => {
- if (userStore.user.userId === 10000) {
- option.value.menu = true;
- }
- });
- option.value = Object.assign(option.value, {
- selection: false,
- border: true,
- index: false,
- expandLevel: 3,
- headerAlign: "center",
- align: "center",
- labelWidth: 100,
- addBtn: false,
- delBtn: false,
- viewBtn: false,
- menu: false,
- header: false,
- editBtn: false,
- rowKey: "operationId",
- column: [
- {
- label: "工序Id",
- prop: "operationId",
- display: false,
- hide: true,
- },
- {
- label: "工序名称",
- prop: "operationName",
- disabled: true,
- search: false,
- display: false,
- },
- {
- label: "表格名称",
- disabled: true,
- prop: "formName",
- search: false,
- },
- {
- label: "表格类型",
- prop: "formType",
- type: "select",
- disabled: true,
- search: false,
- dicData: dicts.excel_type,
- props: {
- label: "dictLabel",
- value: "dictValue",
- },
- },
- ],
- });
- </script>
|