The Interstate Commerce Commission yesterday ruled that truckers' reimbursement for the rising cost of diesel fuel should be based on the distance they drive, not what product they are hauling.

The decision, effective in about a month, eliminates the existing fuel surcharge based on the value of a shipment, and substitutes a complex formula based partly on diesel cost increases (prices rose from 63.5 cents a gallon in January, 1979, to 130.2 cents today) and average fuel efficiency. Based on today's prices, the new formula would give truckers 14 cents a mile above base rates.

However, the commission also permitted trucking companies, whose rates must win ICC approval, to file new tariffs including all or part of the existing 18 percent fuel surcharge, if they can defend the increase.

It is not clear what effect the ruling will have on the truckers' threat to strike if they lose the surcharge. Independent truckers claim it is essential to make up for their total costs, which have reached $1 a mile.

The decision ends the fuel surcharge instituted in 1979, when independent truckers were striking because the ICC's cumbersome rate-setting process couldn't keep up with the escalation of fuel costs. The surcharge allowed automatic increases in trucking fees.

In recent months, however, shippers such as the National Association of Manufacturers renewed complaints that the fuel surcharge, paid to independent drivers by trucking companies who then pass the costs on to shippers, is skewed because it is not based on mileage.