#
Junjie
2024-08-02 e83dacb5066a86db29dbdc232218d8aba6adc95f
zy-asrs-framework/src/main/resources/templates/vue/Index.txt
@@ -6,6 +6,7 @@
import { logout } from '@/config.js';
import EditView from './edit.vue'
import { formatMessage } from '@/utils/localeUtils.js';
import useTableSearch from '@/utils/tableUtils.jsx';
const context = getCurrentInstance()?.appContext.config.globalProperties;
const router = useRouter();
@@ -19,14 +20,20 @@
let tableData = ref([]);
getPage();
const {
  getColumnSearchProps,
  handleResizeColumn,
} = useTableSearch();
const columns = [
@{TABLECOLUMNS}
  {
    title: '操作',
    title: formatMessage('common.operation', '操作'),
    name: 'oper',
    dataIndex: 'oper',
    key: 'oper',
    width: 140,
    fixed: 'right',
  },
];
@@ -79,15 +86,21 @@
    content: formatMessage('page.delete.confirm', '确定删除该项吗?'),
    maskClosable: true,
    onOk: async () => {
      post('/api/@{SIMPLEENTITYNAME}/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
        let result = resp.data;
        if (result.code === 200) {
          message.success(result.msg);
        } else {
          message.error(result.msg);
        }
        getPage()
      })
      const hide = message.loading(formatMessage('common.loading', '请求中'));
      try {
        post('/api/@{SIMPLEENTITYNAME}/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
          let result = resp.data;
          if (result.code === 200) {
            message.success(result.msg);
          } else {
            message.error(result.msg);
          }
          getPage()
          hide()
        })
      } catch (error) {
        message.error(formatMessage('common.fail', '请求失败'));
      }
    },
  });
}
@@ -137,7 +150,7 @@
    <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
      :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
      :pagination="{ total: tableData.total, onChange: onPageChange }"
      :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns">
      :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn">
      <template #bodyCell="{ column, text, record }">
        <template v-if="column.dataIndex === 'oper'">
          <div style="display: flex;justify-content: space-evenly;">